diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d866601cbcb..984a492aa4d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -155,6 +155,7 @@ class FormFile if (empty($sectionid)) $out .= '
'; $out .= "\n\n\n"; + $langs->load('link'); $title = $langs->trans("LinkANewFile"); $out .= load_fiche_titre($title, null, null); $out .= '
'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f3e64028808..9da243dff4f 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1060,10 +1060,11 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio $linkObject = new Link($db); $linkObject->entity = $conf->entity; $linkObject->url = $link; - $linkObject->objecttype = GETPOST('objecttype', 'alpha'); - $linkObject->objectid = GETPOST('objectid', 'int'); - $linkObject->label = GETPOST('label', 'alpha'); + $linkObject->objecttype = GETPOST('objecttype', 'alpha'); + $linkObject->objectid = GETPOST('objectid', 'int'); + $linkObject->label = GETPOST('label', 'alpha'); $res = $linkObject->create($user); + $langs->load('link'); if ($res > 0) { setEventMessage($langs->trans("LinkComplete")); } else { diff --git a/htdocs/core/tpl/document_actions.tpl.php b/htdocs/core/tpl/document_actions.tpl.php index 8ae243e47d3..bd8e2fde1e3 100644 --- a/htdocs/core/tpl/document_actions.tpl.php +++ b/htdocs/core/tpl/document_actions.tpl.php @@ -37,10 +37,11 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { $link->id = $linkid; $link->fetch(); $res = $link->delete($user); + $langs->load('link'); if ($res) { - setEventMessage($langs->trans("LinkWasRemoved", $link->label)); + setEventMessage($langs->trans("LinkRemoved", $link->label)); } else { - setEventMessage($langs->trans("ErrorFailToDeleteLink", $link->label), 'errors'); + setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); } } header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); diff --git a/htdocs/langs/en_US/link.lang b/htdocs/langs/en_US/link.lang new file mode 100644 index 00000000000..fd9589607de --- /dev/null +++ b/htdocs/langs/en_US/link.lang @@ -0,0 +1,7 @@ +LinkANewFile=Link a new file/document +LinkedFiles=Linked files and documents +NoLinkFound=No registered links +LinkComplete=The file has been linked successfully +ErrorFileNotLinked=The file could not be linked +LinkRemoved=The link %s has been removed +ErrorFailedToDeleteLink= Failed to remove link '%s' diff --git a/htdocs/langs/fr_FR/link.lang b/htdocs/langs/fr_FR/link.lang new file mode 100644 index 00000000000..f5a78d83f56 --- /dev/null +++ b/htdocs/langs/fr_FR/link.lang @@ -0,0 +1,8 @@ +CHARSET=UTF-8 +LinkANewFile=Lier un nouveau fichier/document +LinkedFiles=Fichiers et documents liés +NoLinkFound=Aucun lien associé +LinkComplete=Le fichier a été correctement lié +ErrorFileNotLinked=Le fichier n'a pas pu être lié +LinkRemoved=Le lien %s a été supprimé +ErrorFailedToDeleteLink= Impossible de supprimer le lien '%s'