From 484acc2e009b359b19e3c047332f9889a9f973f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Feb 2019 20:55:55 +0100 Subject: [PATCH 1/6] fix phpcs --- htdocs/compta/compta-files.php | 2 +- .../core/class/commondocgenerator.class.php | 2 +- htdocs/margin/agentMargins.php | 10 +- htdocs/product/stock/movement_card.php | 166 +++++++++--------- htdocs/projet/tasks/time.php | 2 +- .../class/html.formresource.class.php | 2 +- 6 files changed, 92 insertions(+), 92 deletions(-) diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 7fa3e8fb251..f61ee1a2330 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -81,7 +81,7 @@ if ($user->societe_id > 0) * Actions */ -$entity = GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity; +$entity = GETPOST('entity', 'int')?GETPOST('entity', 'int'):$conf->entity; //$parameters = array('socid' => $id); //$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 235dde63096..2d4bcb3a167 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -585,7 +585,7 @@ abstract class CommonDocGenerator $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true); $line->fetch_optionals(); - $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key=$array_key, $outputlangs); + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key= $array_key, $outputlangs); // Load product data optional fields to the line -> enables to use "line_options_{extrafield}" if (isset($line->fk_product) && $line->fk_product > 0) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 8bdbaac5861..43fc3ccda89 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -212,13 +212,13 @@ if ($result) else print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("SellingPrice",$_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($labelcostprice,$_SERVER["PHP_SELF"], "buying_price", "", $param,' align="right"', $sortfield, $sortorder); - print_liste_field_titre("Margin",$_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, ' align="right"', $sortfield, $sortorder); + print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder); if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print_liste_field_titre("MarginRate",$_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); if (! empty($conf->global->DISPLAY_MARK_RATES)) - print_liste_field_titre("MarkRate",$_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); print "\n"; $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index abf7d21284b..22596f20bef 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -47,17 +47,17 @@ $langs->loadLangs(array('products', 'stocks', 'orders')); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); // Security check -$result=restrictedArea($user,'stock'); +$result=restrictedArea($user, 'stock'); -$id=GETPOST('id','int'); -$ref = GETPOST('ref','alpha'); -$msid=GETPOST('msid','int'); +$id=GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$msid=GETPOST('msid', 'int'); $product_id=GETPOST("product_id"); -$action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel','alpha'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist'; +$action=GETPOST('action', 'aZ09'); +$cancel=GETPOST('cancel', 'alpha'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'movementlist'; -$idproduct = GETPOST('idproduct','int'); +$idproduct = GETPOST('idproduct', 'int'); $year = GETPOST("year"); $month = GETPOST("month"); $search_ref = GETPOST('search_ref', 'alpha'); @@ -69,18 +69,18 @@ $search_inventorycode = trim(GETPOST("search_inventorycode")); $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); -$search_type_mouvement=GETPOST('search_type_mouvement','int'); +$search_type_mouvement=GETPOST('search_type_mouvement', 'int'); -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$page = GETPOST("page",'int'); -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$page = GETPOST("page", 'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; if (! $sortfield) $sortfield="m.datem"; if (! $sortorder) $sortorder="DESC"; -$pdluoid=GETPOST('pdluoid','int'); +$pdluoid=GETPOST('pdluoid', 'int'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new MouvementStock($db); @@ -90,7 +90,7 @@ $formfile = new FormFile($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('movement'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); $arrayfields=array( 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), @@ -122,17 +122,17 @@ $usercanread = (($user->rights->stock->mouvement->lire)); $usercancreate = (($user->rights->stock->mouvement->creer)); $usercandelete = (($user->rights->stock->mouvement->supprimer)); -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers { $year=''; $month=''; @@ -195,11 +195,11 @@ if ($action == "correct_stock") $result=$product->correct_stock_batch( $user, $id, - GETPOST("nbpiece",'int'), + GETPOST("nbpiece", 'int'), GETPOST("mouvement"), - GETPOST("label",'san_alpha'), + GETPOST("label", 'san_alpha'), GETPOST('unitprice'), - $eatby,$sellby,$batch, + $eatby, $sellby, $batch, GETPOST('inventorycode'), $origin_element, $origin_id @@ -210,9 +210,9 @@ if ($action == "correct_stock") $result=$product->correct_stock( $user, $id, - GETPOST("nbpiece",'int'), + GETPOST("nbpiece", 'int'), GETPOST("mouvement"), - GETPOST("label",'san_alpha'), + GETPOST("label", 'san_alpha'), GETPOST('unitprice'), GETPOST('inventorycode'), $origin_element, @@ -226,11 +226,11 @@ if ($action == "correct_stock") exit; } else - { - $error++; - setEventMessages($product->error, $product->errors, 'errors'); - $action='correction'; - } + { + $error++; + setEventMessages($product->error, $product->errors, 'errors'); + $action='correction'; + } } if (! $error) $action=''; @@ -242,7 +242,7 @@ if ($action == "transfert_stock" && ! $cancel) $product = new Product($db); if (! empty($product_id)) $result=$product->fetch($product_id); - if (! (GETPOST("id_entrepot_destination",'int') > 0)) + if (! (GETPOST("id_entrepot_destination", 'int') > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; @@ -254,13 +254,13 @@ if ($action == "transfert_stock" && ! $cancel) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); $action='transfert'; } - if (! GETPOST("nbpiece",'int')) + if (! GETPOST("nbpiece", 'int')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action='transfert'; } - if ($id == GETPOST("id_entrepot_destination",'int')) + if ($id == GETPOST("id_entrepot_destination", 'int')) { setEventMessages($langs->trans("ErrorSrcAndTargetWarehouseMustDiffers"), null, 'errors'); $error++; @@ -330,22 +330,22 @@ if ($action == "transfert_stock" && ! $cancel) $result1=$product->correct_stock_batch( $user, $srcwarehouseid, - GETPOST("nbpiece",'int'), + GETPOST("nbpiece", 'int'), 1, - GETPOST("label",'san_alpha'), + GETPOST("label", 'san_alpha'), $pricesrc, - $eatby,$sellby,$batch, + $eatby, $sellby, $batch, GETPOST('inventorycode') ); // Add stock $result2=$product->correct_stock_batch( $user, - GETPOST("id_entrepot_destination",'int'), - GETPOST("nbpiece",'int'), + GETPOST("id_entrepot_destination", 'int'), + GETPOST("nbpiece", 'int'), 0, - GETPOST("label",'san_alpha'), + GETPOST("label", 'san_alpha'), $pricedest, - $eatby,$sellby,$batch, + $eatby, $sellby, $batch, GETPOST('inventorycode') ); } @@ -447,7 +447,7 @@ $sql.= " u.login, u.photo, u.lastname, u.firstname"; foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."product as p,"; @@ -464,13 +464,13 @@ if ($id > 0) $sql.= " AND e.rowid ='".$id."'"; if ($month > 0) { if ($year > 0) - $sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + $sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; else $sql.= " AND date_format(m.datem, '%m') = '$month'"; } elseif ($year > 0) { - $sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } if ($idproduct > 0) $sql.= " AND p.rowid = '".$idproduct."'"; if (! empty($search_ref)) $sql.= natural_search('m.rowid', $search_ref, 1); @@ -487,9 +487,9 @@ if ($search_type_mouvement != '' && $search_type_mouvement != '-1') $sql.= natur include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -549,7 +549,7 @@ if ($resql) $texte = $langs->trans("ListOfStockMovements"); if ($id) $texte.=' ('.$langs->trans("ForThisWarehouse").')'; } - llxHeader("",$texte,$help_url); + llxHeader("", $texte, $help_url); /* * Show tab only if we ask a particular warehouse @@ -568,7 +568,7 @@ if ($resql) $morehtmlref.=''; $shownav = 1; - if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0; + if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0; dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref); @@ -609,7 +609,7 @@ if ($resql) // Value print ''.$langs->trans("EstimatedStockValueShort").''; - print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); + print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'], 'MT')), 0, $langs, 0, -1, -1, $conf->currency); print ""; // Last movement @@ -630,7 +630,7 @@ if ($resql) print ''.$langs->trans("LastMovement").''; if ($lastmovementdate) { - print dol_print_date($lastmovementdate,'dayhour'); + print dol_print_date($lastmovementdate, 'dayhour'); } else { @@ -731,19 +731,19 @@ if ($resql) print ''; if ($id > 0) print ''; - if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,$massactionbutton,$num, $nbtotalofrecords, '', 0, '', '', $limit); - else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,$massactionbutton,$num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); + else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; } $moreforfilter=''; $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; @@ -883,7 +883,7 @@ if ($resql) // Fields from hook $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['m.datec']['checked'])) @@ -905,38 +905,38 @@ if ($resql) print "\n"; print ''; - if (! empty($arrayfields['m.rowid']['checked'])) print_liste_field_titre($arrayfields['m.rowid']['label'],$_SERVER["PHP_SELF"],'m.rowid','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['m.datem']['checked'])) print_liste_field_titre($arrayfields['m.datem']['label'],$_SERVER["PHP_SELF"],'m.datem','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'],$_SERVER["PHP_SELF"],'p.label','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'],$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible - if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['m.type_mouvement']['checked'])) print_liste_field_titre($arrayfields['m.type_mouvement']['label'],$_SERVER["PHP_SELF"], "m.type_mouvement","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'],$_SERVER["PHP_SELF"], "m.price","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['m.rowid']['checked'])) print_liste_field_titre($arrayfields['m.rowid']['label'], $_SERVER["PHP_SELF"], 'm.rowid', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['m.datem']['checked'])) print_liste_field_titre($arrayfields['m.datem']['label'], $_SERVER["PHP_SELF"], 'm.datem', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'], $_SERVER["PHP_SELF"], 'm.batch', '', $param, 'align="center"', $sortfield, $sortorder); + if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'], $_SERVER["PHP_SELF"], 'pl.eatby', '', $param, 'align="center"', $sortfield, $sortorder); + if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'], $_SERVER["PHP_SELF"], 'pl.sellby', '', $param, 'align="center"', $sortfield, $sortorder); + if (! empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); // We are on a specific warehouse card, no filter on other should be possible + if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'], $_SERVER["PHP_SELF"], "m.fk_user_author", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'], $_SERVER["PHP_SELF"], "m.inventorycode", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'], $_SERVER["PHP_SELF"], "m.label", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.type_mouvement']['checked'])) print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, 'align="center"', $sortfield, $sortorder); + if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, 'align="right"', $sortfield, $sortorder); + if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'], $_SERVER["PHP_SELF"], "m.price", "", $param, 'align="right"', $sortfield, $sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['m.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['m.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['m.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + if (! empty($arrayfields['m.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; $arrayofuniqueproduct=array(); - while ($i < min($num,$limit)) + while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); @@ -978,13 +978,13 @@ if ($resql) if (! empty($arrayfields['m.datem']['checked'])) { // Date - print ''.dol_print_date($db->jdate($objp->datem),'dayhour').''; + print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; } if (! empty($arrayfields['p.ref']['checked'])) { // Product ref print ''; - print $productstatic->getNomUrl(1,'stock',16); + print $productstatic->getNomUrl(1, 'stock', 16); print "\n"; } if (! empty($arrayfields['p.label']['checked'])) @@ -1007,11 +1007,11 @@ if ($resql) } if (! empty($arrayfields['pl.eatby']['checked'])) { - print ''. dol_print_date($objp->eatby,'day') .''; + print ''. dol_print_date($objp->eatby, 'day') .''; } if (! empty($arrayfields['pl.sellby']['checked'])) { - print ''. dol_print_date($objp->sellby,'day') .''; + print ''. dol_print_date($objp->sellby, 'day') .''; } // Warehouse if (! empty($arrayfields['e.ref']['checked'])) @@ -1048,7 +1048,7 @@ if ($resql) if (! empty($arrayfields['m.type_mouvement']['checked'])) { // Type of movement - switch($objp->type_mouvement){ + switch($objp->type_mouvement) { case "0": print ''.$langs->trans('StockIncreaseAfterCorrectTransfer').''; break; @@ -1114,20 +1114,20 @@ if ($resql) $productidselected=$key; $productlabelselected=$val; } - $datebefore=dol_get_first_day($year?$year:strftime("%Y",time()), $month?$month:1, true); - $dateafter=dol_get_last_day($year?$year:strftime("%Y",time()), $month?$month:12, true); + $datebefore=dol_get_first_day($year?$year:strftime("%Y", time()), $month?$month:1, true); + $dateafter=dol_get_last_day($year?$year:strftime("%Y", time()), $month?$month:12, true); $balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter); //print ''; - print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore,'day','gmt')); + print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore, 'day', 'gmt')); //print ''; //print ''; print ': '.$balancebefore; print "
\n"; //print ''; //print ''; - print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter,'day','gmt')); + print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter, 'day', 'gmt')); //print ''; //print ''; print ': '.$balanceafter; @@ -1169,7 +1169,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) $genallowed=$user->rights->stock->lire; $delallowed=$user->rights->stock->creer; - print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); + print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; print '
'; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index be87a52fcd9..1ec5ced0abf 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1045,7 +1045,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $contactsofproject=$projectstatic->getListContactId('internal'); if (count($contactsofproject)>0) { - if (in_array($user->id, $userid=$contactsofproject)) $userid = $user->id; + if (in_array($user->id, $userid= $contactsofproject)) $userid = $user->id; else $userid=$contactsofproject[0]; if ($projectstatic->public) $contactsofproject = array(); print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 39b789c2b7d..507e7f6a6dc 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -85,7 +85,7 @@ class FormResource $resourcestat = new Dolresource($this->db); - $resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, $filter=''); + $resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, $filter= ''); if ($outputmode != 2) { From 2aae9527603a01a85ff6c0ae65a9abd7d7a48d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Feb 2019 23:25:26 +0100 Subject: [PATCH 2/6] fix doc in tax.lib.php --- htdocs/core/lib/tax.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 399983dbd16..884ff4fc922 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -86,7 +86,7 @@ function tax_prepare_head(ChargeSociales $object) * @param string $direction 'sell' or 'buy' * @param int $m Month * @param int $q Quarter - * @return array Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developped, -3 if error + * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developped, -3 if error */ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $direction, $m = 0, $q = 0) { @@ -111,7 +111,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $paymentfacturetable='paiement_facture'; $invoicefieldref='ref'; } - if ($direction == 'buy') + elseif ($direction == 'buy') { $invoicetable='facture_fourn'; $invoicedettable='facture_fourn_det'; @@ -554,7 +554,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di * @param int $modetax Not used * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) * @param int $m Month - * @return array Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developped, -3 if error + * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developped, -3 if error */ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m = 0) { From fa31f95356e4bf168e5c7fa462886eccd7b19bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Feb 2019 23:31:21 +0100 Subject: [PATCH 3/6] Update rssparser.class.php --- htdocs/core/class/rssparser.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 155082f63f9..7683137767b 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -50,8 +50,8 @@ class RssParser private $_rssarray=array(); // For parsing with xmlparser - var $stack = array(); // parser stack - var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); + public $stack = array(); // parser stack + private $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); /** @@ -246,7 +246,7 @@ class RssParser $str = file_get_contents($this->_urlRSS, false, $context); } catch (Exception $e) { - print 'Error retrieving URL '.$this->urlRSS.' - '.$e->getMessage(); + print 'Error retrieving URL '.$this->_urlRSS.' - '.$e->getMessage(); } } From e4b73e827395ababd8c6d12a9c69d63b8e25b5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Feb 2019 23:39:59 +0100 Subject: [PATCH 4/6] Update images.lib.php --- htdocs/core/lib/images.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index a427cfd92e2..583167750eb 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -104,7 +104,7 @@ function dol_getImageSize($file, $url = false) * @param int $newHeight Hauteur maximum que dois faire l'image destination (0=keep ratio) * @param int $src_x Position of croping image in source image (not use if mode=0) * @param int $src_y Position of croping image in source image (not use if mode=0) - * @return int File name if OK, error message if KO + * @return string File name if OK, error message if KO */ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, $src_y = 0) { From 3de192364bd5081d8ab588339adc408c2d8b9f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Feb 2019 00:12:20 +0100 Subject: [PATCH 5/6] Update ical.class.php --- htdocs/comm/action/class/ical.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index d005549636c..0cfb04b79a6 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013-2014 Laurent Destailleur * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,7 +97,7 @@ class ICal * Translate Calendar * * @param string $uri Url - * @return array + * @return array|string */ function parse($uri) { @@ -365,7 +366,7 @@ class ICal /** * Return sorted eventlist as array or false if calenar is empty * - * @return array + * @return array|false */ function get_sort_event_list() { From 95212e9cc129a6356668af5a048ff46c96db3512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Feb 2019 00:44:34 +0100 Subject: [PATCH 6/6] Update ical.class.php --- htdocs/comm/action/class/ical.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 0cfb04b79a6..00efd44a1a7 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -364,7 +364,7 @@ class ICal // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return sorted eventlist as array or false if calenar is empty + * Return sorted eventlist as array or false if calendar is empty * * @return array|false */ @@ -399,7 +399,7 @@ class ICal // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return eventlist array (not sort eventlist array) + * Return eventlist array (not sorted eventlist array) * * @return array */ @@ -423,7 +423,7 @@ class ICal // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return to do array (not sort to do array) + * Return to do array (not sorted todo array) * * @return array */