From b9c36e6e0af7b7a14729c8b9e386219690f2d4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 18 Sep 2013 12:13:50 +0200 Subject: [PATCH] checkstyle --- htdocs/core/class/html.formfile.class.php | 70 ++++++++++++----------- htdocs/core/lib/files.lib.php | 1 + htdocs/core/tpl/doc2.tpl.php | 53 +++++++++-------- htdocs/link/class/link.class.php | 8 ++- 4 files changed, 71 insertions(+), 61 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 275ada1ef28..36afd101159 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1018,7 +1018,7 @@ class FormFile } - public function list_of_links($object, $permtodelete=1, $action=null, $selected=null) + public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null) { global $user, $conf, $langs, $user; @@ -1042,38 +1042,42 @@ class FormFile print_titre($langs->trans("LinkedFiles")); print ''; print ''; - print_liste_field_titre($langs->trans("Documents2"), - $_SERVER['PHP_SELF'], - "name", - "", - $param, - 'align="left"', - $sortfield, - $sortorder - ); - print_liste_field_titre($langs->trans("Size"), - "", - "", - "", - "", - 'align="right"' - ); - print_liste_field_titre($langs->trans("Date"), - $_SERVER['PHP_SELF'], - "date", - "", - $param, - 'align="center"', - $sortfield, - $sortorder - ); - print_liste_field_titre('', - $_SERVER['PHP_SELF'], - "", - "", - $param, - 'align="center"' - ); + print_liste_field_titre( + $langs->trans("Documents2"), + $_SERVER['PHP_SELF'], + "name", + "", + $param, + 'align="left"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + $langs->trans("Size"), + "", + "", + "", + "", + 'align="right"' + ); + print_liste_field_titre( + $langs->trans("Date"), + $_SERVER['PHP_SELF'], + "date", + "", + $param, + 'align="center"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + '', + $_SERVER['PHP_SELF'], + "", + "", + $param, + 'align="center"' + ); print_liste_field_titre('','',''); print ''; $nboflinks = count($links); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 9da243dff4f..2296454dc73 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -995,6 +995,7 @@ function dol_init_file_process($pathtoscan='') * @param int $donotupdatesession 1=Do no edit _SESSION variable * @param string $varfiles _FILES var name * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param string $link Link to add * @return void */ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null) diff --git a/htdocs/core/tpl/doc2.tpl.php b/htdocs/core/tpl/doc2.tpl.php index 37ec4fc1760..e4551eecae0 100644 --- a/htdocs/core/tpl/doc2.tpl.php +++ b/htdocs/core/tpl/doc2.tpl.php @@ -3,40 +3,43 @@ * Confirm suppression */ if ($action == 'delete') { - $ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'), - $langs->trans('DeleteFile'), - $langs->trans('ConfirmDeleteFile'), - 'confirm_deletefile', - '', - 0, - 1 - ); + $ret = $form->form_confirm( + $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'), + $langs->trans('DeleteFile'), + $langs->trans('ConfirmDeleteFile'), + 'confirm_deletefile', + '', + 0, + 1 + ); if ($ret == 'html') print '
'; } $formfile=new FormFile($db); // Show upload form -$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, - '', - 0, - 0, - $permission, - 50, - $object - ); +$formfile->form_attach_new_file( + $_SERVER["PHP_SELF"].'?id='.$object->id, + '', + 0, + 0, + $permission, + 50, + $object +); // List of document -$formfile->list_of_documents($filearray, - $object, - $modulepart, - $param, - 0, - '', - $permission - ); +$formfile->list_of_documents( + $filearray, + $object, + $modulepart, + $param, + 0, + '', + $permission +); print "
"; //List of links -$formfile->list_of_links($object, $permission, $action, GETPOST('linkid', 'int')); +$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int')); print "
"; diff --git a/htdocs/link/class/link.class.php b/htdocs/link/class/link.class.php index 982799a57cc..5f1054ef968 100644 --- a/htdocs/link/class/link.class.php +++ b/htdocs/link/class/link.class.php @@ -226,9 +226,11 @@ class Link extends CommonObject /** * Loads all links from database - * @param $links array of Link objects to fill - * @param $objecttype type of the associated object in dolibarr - * @param $objectid id of the associated object in dolibarr + * @param array $links array of Link objects to fill + * @param string $objecttype type of the associated object in dolibarr + * @param int $objectid id of the associated object in dolibarr + * @param string $sortfield field used to sort + * @param string $sortorder * @return 1 if ok, 0 if no records, -1 if error * * */