diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index d005549636c..00efd44a1a7 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) { @@ -363,9 +364,9 @@ 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 + * @return array|false */ function get_sort_event_list() { @@ -398,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 */ @@ -422,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 */ 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(); } } 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) { 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) { diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 3dd9b7f8920..dd4bd9aa628 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -108,7 +108,7 @@ $arrayfields=array( 'origin'=>array('label'=>$langs->trans("Origin"), 'checked'=>1), 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1), 'm.price'=>array('label'=>$langs->trans("UnitPurchaseValue"), 'checked'=>0), - //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500) ); @@ -221,16 +221,19 @@ if ($action == "correct_stock") $origin_id ); // We do not change value of stock for a correction } - if ($result > 0) - { - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); - exit(); - } else { - $error ++; - setEventMessages($product->error, $product->errors, 'errors'); - $action = 'correction'; - } - } + + if ($result > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); + exit; + } + else + { + $error++; + setEventMessages($product->error, $product->errors, 'errors'); + $action='correction'; + } + } if (! $error) $action=''; } @@ -337,7 +340,7 @@ if ($action == "transfert_stock" && ! $cancel) $sellby, $batch, GETPOST('inventorycode', 'alpha') - ); + ); // Add stock $result2=$product->correct_stock_batch( $user, @@ -350,7 +353,7 @@ if ($action == "transfert_stock" && ! $cancel) $sellby, $batch, GETPOST('inventorycode', 'alpha') - ); + ); } } else @@ -364,7 +367,7 @@ if ($action == "transfert_stock" && ! $cancel) GETPOST("label", 'alpha'), $pricesrc, GETPOST('inventorycode', 'alpha') - ); + ); // Add stock $result2=$product->correct_stock( @@ -375,7 +378,7 @@ if ($action == "transfert_stock" && ! $cancel) GETPOST("label", 'alpha'), $pricedest, GETPOST('inventorycode', 'alpha') - ); + ); } if (! $error && $result1 >= 0 && $result2 >= 0) { @@ -734,7 +737,7 @@ 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); + 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) @@ -942,19 +945,12 @@ if ($resql) // 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 - 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); + // 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 + 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 '); print "\n"; @@ -1072,21 +1068,21 @@ if ($resql) } if (! empty($arrayfields['m.type_mouvement']['checked'])) { - // Type of movement - switch ($objp->type_mouvement) { - case "0" : - print '' . $langs->trans('StockIncreaseAfterCorrectTransfer') . ''; - break; - case "1" : - print '' . $langs->trans('StockDecreaseAfterCorrectTransfer') . ''; - break; - case "2" : - print '' . $langs->trans('StockDecrease') . ''; - break; - case "3" : - print '' . $langs->trans('StockIncrease') . ''; - break; - } + // Type of movement + switch($objp->type_mouvement) { + case "0": + print ''.$langs->trans('StockIncreaseAfterCorrectTransfer').''; + break; + case "1": + print ''.$langs->trans('StockDecreaseAfterCorrectTransfer').''; + break; + case "2": + print ''.$langs->trans('StockDecrease').''; + break; + case "3": + print ''.$langs->trans('StockIncrease').''; + break; + } } if (! empty($arrayfields['origin']['checked'])) {