diff --git a/op/op.AddDocumentLink.php b/op/op.AddDocumentLink.php
index 6b6efe7a7..c85177d97 100644
--- a/op/op.AddDocumentLink.php
+++ b/op/op.AddDocumentLink.php
@@ -68,7 +68,16 @@ if (!is_object($doc)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_doc_id"));
}
-if (!$document->addDocumentLink($docid, $user->getID(), $public)){
+if(!empty($_GET['linktype'])) {
+ $linktype = $dms->getLinkType($_GET['linktype']);
+ if (!is_object($linktype)) {
+ UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_link_type"));
+ }
+} else {
+ $linktype = null;
+}
+
+if (!$document->addDocumentLink($docid, $user->getID(), $public, $linktype)){
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
}
diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php
index cf5e769ad..dee48f9e0 100644
--- a/views/bootstrap/class.ViewDocument.php
+++ b/views/bootstrap/class.ViewDocument.php
@@ -2071,6 +2071,9 @@ $(document).ready( function() {
print getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) {
print "
".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
+ if($linktype = $link->getLinkType()) {
+ print "
".$linktype->getName();
+ }
print "