add a field for label input

This commit is contained in:
Cédric Salvador 2013-07-30 17:07:19 +02:00 committed by Raphaël Doursenaud
parent f19e5e86f4
commit b625b1843e
2 changed files with 4 additions and 0 deletions

View File

@ -165,7 +165,10 @@ class FormFile
$out .= '<table width="100%" class="nobordernopadding">';
$out .= '<tr>';
$out .= '<td valign="middle" class="nowrap">';
$out .= $langs->trans("Link") . ': ';
$out .= '<input type="text" name="link" id="link">';
$out .= ' &nbsp; ' . $langs->trans("Label") . ': ';
$out .= '<input type="text" name="label" id="label">';
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
$out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("Upload").'"';

View File

@ -1062,6 +1062,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
$linkObject->url = $link;
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
$linkObject->objectid = GETPOST('objectid', 'int');
$linkObject->label = GETPOST('label', 'alpha');
$res = $linkObject->create($user);
if ($res > 0) {
setEventMessage($langs->trans("LinkComplete"));