From ca939bf8a59f4e281c68c493673caee3763ffb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Feb 2015 11:02:11 +0100 Subject: [PATCH] PHPDoc and misc fixes for several folders --- htdocs/asterisk/wrapper.php | 4 ++-- htdocs/barcode/codeinit.php | 6 ++++-- htdocs/barcode/printsheet.php | 2 +- htdocs/bookmarks/bookmarks.lib.php | 2 -- htdocs/bookmarks/list.php | 9 ++++++--- htdocs/cashdesk/tpl/validation2.tpl.php | 2 +- htdocs/categories/categorie.php | 4 ++-- htdocs/categories/class/categorie.class.php | 21 ++++++++++----------- htdocs/categories/photos.php | 4 +++- htdocs/core/class/html.form.class.php | 2 +- 10 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index d0e3ec633a5..e0f115e31c5 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -41,7 +41,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); /** * Empty header * - * @return none + * @return void */ function llxHeader() { @@ -53,7 +53,7 @@ function llxHeader() /** * Empty footer * - * @return none + * @return void */ function llxFooter() { diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 19fb5c193bb..546384a98bf 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -210,7 +210,8 @@ if ($conf->societe->enabled) { $nbno=$nbtotal=0; - print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','').'
'."\n"; + print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'',''); + print '
'."\n"; $sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; $resql=$db->query($sql); if ($resql) @@ -250,7 +251,8 @@ if ($conf->product->enabled || $conf->product->service) $nbno=$nbtotal=0; - print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','').'
'."\n"; + print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'',''); + print '
'."\n"; $sql ="SELECT count(rowid) as nb, fk_product_type"; $sql.=" FROM ".MAIN_DB_PREFIX."product"; $sql.=" WHERE barcode IS NULL OR barcode = ''"; diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 0ce692674b1..fd89390f3db 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -360,7 +360,7 @@ print '
'; print ' '.$langs->trans("FillBarCodeTypeAndValueFromProduct").'   '; print '
'; print '
'; -print $form->select_produits(GETPOST('productid'), 'productid', ''); +$form->select_produits(GETPOST('productid'), 'productid', ''); print '   '; print '
'; diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index a9d2d7eb6c0..ee6003d0119 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -38,8 +38,6 @@ function printBookmarksList($aDb, $aLangs) require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5; - $bookm = new Bookmark($db); - $langs->load("bookmarks"); $url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:''); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 748a4d9b7fa..e00772a0af5 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -94,9 +94,12 @@ if ($resql) print ""; //print " "; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),'','').""; - print_liste_field_titre($langs->trans("Link"),'','').""; - print_liste_field_titre($langs->trans("Target"),'','','','','align="center"').""; + print_liste_field_titre($langs->trans("Title"),'',''); + print ""; + print_liste_field_titre($langs->trans("Link"),'',''); + print ""; + print_liste_field_titre($langs->trans("Target"),'','','','','align="center"'); + print ""; print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder); diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index b00268d7b0a..7bc7999d377 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -31,7 +31,7 @@ $langs->load("bills"); function popupTicket() { largeur = 600; - hauteur = 500 + hauteur = 500; opt = 'width='+largeur+', height='+hauteur+', left='+(screen.width - largeur)/2+', top='+(screen.height-hauteur)/2+''; window.open('validation_ticket.php?facid=', 'trans('PrintTicket') ?>', opt); } diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 61ab169029f..0746475ecec 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -278,7 +278,7 @@ if ($socid) // Address print ''.$langs->trans('Address').''; - print dol_print_address($soc->address,'gmap','thirdparty',$soc->id); + dol_print_address($soc->address,'gmap','thirdparty',$soc->id); print ''; // Zip / Town @@ -609,7 +609,7 @@ else if ($id || $ref) * @param Object $object Object we want to see categories it can be classified into * @param int $typeid Type of category (0, 1, 2, 3) * @param int $socid Id thirdparty - * @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify' + * @param int $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify' * @return int 0 */ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index de8d494f9fc..f5828ecdea7 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -297,7 +297,6 @@ class Categorie extends CommonObject // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('HookCategorydao')); $parameters=array(); - $action='update'; $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { @@ -334,7 +333,7 @@ class Categorie extends CommonObject * Delete a category from database * * @param User $user Object user that ask to delete - * @return void + * @return int <0 KO >0 OK */ function delete($user) { @@ -689,7 +688,9 @@ class Categorie extends CommonObject */ function containsObject($type, $object_id) { - $field = ''; $classname = ''; $category_table = ''; $object_table = ''; + $field = ''; + $category_table = ''; + if ($type == 'product') { $field = 'product'; } @@ -726,7 +727,7 @@ class Categorie extends CommonObject /** * Return childs of a category * - * @return void + * @return array|int <0 KO, array ok */ function get_filles() { @@ -1045,7 +1046,7 @@ class Categorie extends CommonObject * Retourne les categories de premier niveau (qui ne sont pas filles) * * @param int $type Type of category - * @return void + * @return array */ function get_main_categories($type=null) { @@ -1058,7 +1059,7 @@ class Categorie extends CommonObject * * @param string $sep Separator * @param string $url Url - * @return void + * @return array */ function print_all_ways($sep = " >> ", $url='') { @@ -1088,7 +1089,7 @@ class Categorie extends CommonObject /** * Retourne un tableau contenant la liste des categories meres * - * @return void + * @return int|array <0 KO, array OK */ function get_meres() { @@ -1123,7 +1124,7 @@ class Categorie extends CommonObject * Retourne dans un tableau tous les chemins possibles pour arriver a la categorie * en partant des categories principales, representes par des tableaux de categories * - * @return void + * @return array */ function get_all_ways() { @@ -1315,7 +1316,7 @@ class Categorie extends CommonObject $originImage = $dir . $file['name']; // Cree fichier en taille origine - $result=dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0); + dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0); if (file_exists($originImage)) { @@ -1560,8 +1561,6 @@ class Categorie extends CommonObject */ function initAsSpecimen() { - global $user,$langs,$conf; - dol_syslog(get_class($this)."::initAsSpecimen"); // Initialise parametres diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index c54d7d889b2..36a44f4bdda 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -66,7 +66,9 @@ if ($id > 0) if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - if ($object->id) $result = $object->add_photo($upload_dir, $_FILES['userfile']); + if ($object->id) { + $object->add_photo($upload_dir, $_FILES['userfile']); + } } if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5448666dbdb..c02df68db2c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2794,7 +2794,7 @@ class Form * @param string $htmlname HTML field name * @param int $maxlength Maximum length for labels * @param int $excludeafterid Exclude all categories after this leaf in category tree. - * @return void + * @return string * @see select_categories */ function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0)