From 918ed34364feef1039f989af6c1ce725f09ee2e8 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 7 Apr 2015 00:45:30 +0000 Subject: [PATCH 1/7] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/core/filemanagerdol/connectors/php/commands.php | 6 ++++++ .../core/modules/contract/doc/pdf_strato.modules.php | 6 +++--- htdocs/core/modules/import/modules_import.php | 2 +- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- htdocs/core/modules/mailings/fraise.modules.php | 2 +- htdocs/core/modules/product/modules_product.class.php | 2 +- .../project/doc/doc_generic_project_odt.modules.php | 2 +- htdocs/core/modules/propale/modules_propale.php | 4 ++-- htdocs/core/modules/societe/modules_societe.class.php | 4 ++-- .../supplier_invoice/modules_facturefournisseur.php | 2 +- htdocs/paypal/lib/paypal.lib.php | 10 ++++++++++ htdocs/projet/class/task.class.php | 4 ++-- 12 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 18b54c1c6b8..0dc17d7313c 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -22,6 +22,9 @@ * This is the File Manager Connector for PHP. */ +/** + * @param string $currentFolder + */ function GetFolders( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. @@ -178,6 +181,9 @@ function CreateFolder( $resourceType, $currentFolder ) // DOL_CHANGE //function FileUpload( $resourceType, $currentFolder, $sCommand ) +/** + * @param string $currentFolder + */ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') { if (!isset($_FILES)) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 46364b23d0d..9b5b80ceeaf 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -452,7 +452,7 @@ class pdf_strato extends ModelePDFContract * Show top header of page. * * @param PDF $pdf Object PDF - * @param Object $object Object to show + * @param CommonObject $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return void @@ -631,10 +631,10 @@ class pdf_strato extends ModelePDFContract * Show footer of page. Need this->emetteur object * * @param PDF $pdf PDF - * @param Object $object Object to show + * @param CommonObject $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text - * @return void + * @return integer */ function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) { diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 49fb7decd69..4fa5052a90a 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -63,7 +63,7 @@ class ModeleImports * Charge en memoire et renvoie la liste des modeles actifs * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ function liste_modeles($db,$maxfilenamelength=0) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 5d218376983..558b83ed53f 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -60,7 +60,7 @@ class mailing_contacts1 extends MailingTargets * array of SQL request that returns two field: * One called "label", One called "nb". * - * @return array Array with SQL requests + * @return string[] Array with SQL requests */ function getSqlArrayForStats() { diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 69b018080b8..963e8ef0c28 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -63,7 +63,7 @@ class mailing_fraise extends MailingTargets * array of SQL request that returns two field: * One called "label", One called "nb". * - * @return array Array with SQL requests + * @return string[] Array with SQL requests */ function getSqlArrayForStats() { diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 0bfd3f8f03e..e08ea074bbd 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -105,7 +105,7 @@ abstract class ModeleProductCode * Renvoi la liste des modeles de numérotation * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ static function liste_modeles($db,$maxfilenamelength=0) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index f19d8a0e3a0..6e2601797f8 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -105,7 +105,7 @@ class doc_generic_project_odt extends ModelePDFProjects /** * Define array with couple substitution key => substitution value * - * @param Object $object Main object to use as data source + * @param Project $object Main object to use as data source * @param Translate $outputlangs Lang object to use for output * @return array Array of substitution */ diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 9b0cc1d82a2..9ad90e9e3b5 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -43,7 +43,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator * Return list of active generation modules * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) @@ -149,7 +149,7 @@ abstract class ModeleNumRefPropales * Create a document onto disk according to template module. * * @param DoliDB $db Database handler - * @param object $object Object proposal + * @param Propal $object Object proposal * @param string $modele Force model to use ('' to not force) * @param Translate $outputlangs Object langs to use for output * @param int $hidedetails Hide details of lines diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index f1fc05d29db..72090a581ea 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -39,7 +39,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator * Return list of active generation modules * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) @@ -142,7 +142,7 @@ abstract class ModeleThirdPartyCode * Renvoi la liste des modeles de numéroation * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ static function liste_modeles($db,$maxfilenamelength=0) diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 51eb675057e..03dc42280cb 100644 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -41,7 +41,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator * Return list of active generation models * * @param DoliDB $db Database handler - * @param string $maxfilenamelength Max length of value to show + * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ static function liste_modeles($db,$maxfilenamelength=0) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 2e8ab4bf0b8..76ea5ab4834 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -436,6 +436,16 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re ' desc: Product description '-------------------------------------------------------------------------------------------------------------------------------------------- */ +/** + * @param double $paymentAmount + * @param string $currencyCodeType + * @param string $paymentType + * @param string $returnURL + * @param string $cancelURL + * @param string $tag + * @param string $solutionType + * @param string $landingPage + */ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag, $solutionType, $landingPage, $shipToName, $shipToStreet, $shipToCity, $shipToState, $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum, $email='', $desc='') { //------------------------------------------------------------------------------------------------------------------------------------ diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 5e02efe6463..3fb2586625e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1331,7 +1331,7 @@ class Task extends CommonObject /** * Return status label of object * - * @param string $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ function getLibStatut($mode=0) @@ -1343,7 +1343,7 @@ class Task extends CommonObject * Return status label for an object * * @param int $statut Id statut - * @param string $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ function LibStatut($statut,$mode=0) From a0de33912ef1274bde7f751a465dfc22795b0c2e Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 7 Apr 2015 18:54:38 +0200 Subject: [PATCH 2/7] Closes #2545 Bug: Missing object_margin.png in Amarok theme Conflicts: ChangeLog --- ChangeLog | 4 ++++ htdocs/theme/amarok/img/object_margin.png | Bin 0 -> 579 bytes 2 files changed, 4 insertions(+) create mode 100644 htdocs/theme/amarok/img/object_margin.png diff --git a/ChangeLog b/ChangeLog index 6ed93c77235..6617e8af742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -243,6 +243,10 @@ Dolibarr better: - Fix: Bad SEPA xml file creation - Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment - Fix: Showing system error if not enough stock of product into orders creation with lines +- Fix: [ bug #2543 ] Untranslated "Contract" origin string when creating an invoice from a contract +- Fix: [ bug #2534 ] SQL error when editing a supplier invoice line +- Fix: [ bug #2535 ] Untranslated string in "Linked objects" page of a project +- Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/theme/amarok/img/object_margin.png b/htdocs/theme/amarok/img/object_margin.png new file mode 100644 index 0000000000000000000000000000000000000000..13e4b92c9ce2e0a3698d31fcfc2b82704653f7a0 GIT binary patch literal 579 zcmV-J0=)f+P)AcnU72+nI~k7O&wbPhKp(25S7yLez;ORgKES18>^qZMxkS#t4;4mP!Tkxe+YuKR~p# z$@oMS%NT}+&HxFcfQVpOE|z7b`l*-e*o5sSUdH9q`!{4z zY}=+hGKO=k6tl2Go9vMSK*{xkcH6fG93;^_SAQs`< z{(cHnFI|}=th_KaaqN?Qc zCjh-}k1uO$6!RW|XLIq=Wef@DrfbBaWOD(c3Aube1@!k|XJ_aB{QRpKpjs>h)nXxF zV!T4J5a9bh)6?g%EknKjAqAw@>R4{yeRvJ19-WzA_asS(wl*I>ee~caz)y}P@RPTh R<>vqZ002ovPDHLkV1h?{2Q~lz literal 0 HcmV?d00001 From c2bc2c9ea64701563a22e582e18bafba3ec3aafc Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 7 Apr 2015 20:10:27 +0200 Subject: [PATCH 3/7] Solves #2542 Bug: Contracts store localtax preferences Conflicts: htdocs/compta/facture.php --- ChangeLog | 1 + htdocs/compta/facture.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6617e8af742..51fed6df120 100644 --- a/ChangeLog +++ b/ChangeLog @@ -247,6 +247,7 @@ Dolibarr better: - Fix: [ bug #2534 ] SQL error when editing a supplier invoice line - Fix: [ bug #2535 ] Untranslated string in "Linked objects" page of a project - Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme +- Fix: [ bug #2542 ] Contracts store localtax preferences ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e8f3bde2fd9..75f829be46e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012-2013 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud @@ -1076,8 +1076,12 @@ if (empty($reshook)) $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_options = $lines[$i]->array_options; } + + // View third's localtaxes for now + $localtax1_tx = get_localtax($lines[$i]->tva_tx, 1, $object->client); + $localtax2_tx = get_localtax($lines[$i]->tva_tx, 2, $object->client); - $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->situation_percent, $lines[$i]->fk_prev_id); + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $localtax1_tx, $localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->situation_percent, $lines[$i]->fk_prev_id); if ($result > 0) { $lineid = $result; From 1f4a1316910f02bb64f593a533c7d753b1df66aa Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 7 Apr 2015 20:43:27 +0200 Subject: [PATCH 4/7] Fix: Bad permission assignments for stock movements actions Conflicts: htdocs/product/stock/product.php --- ChangeLog | 1 + htdocs/core/menus/init_menu_auguria.sql | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 6 +++--- htdocs/product/stock/mouvement.php | 3 ++- htdocs/product/stock/product.php | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51fed6df120..618231d8937 100644 --- a/ChangeLog +++ b/ChangeLog @@ -248,6 +248,7 @@ Dolibarr better: - Fix: [ bug #2535 ] Untranslated string in "Linked objects" page of a project - Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme - Fix: [ bug #2542 ] Contracts store localtax preferences +- Fix: Bad permission assignments for stock movements actions ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 37d074b9f16..f1db486bfc0 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -104,8 +104,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/mouvement.php', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php', 'StockTransfer', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php', 'StockTransfer', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); -- Product - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 069d672609c..09f4321e668 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2010 Regis Houssin - * Copyright (C) 2012-2014 Juanjo Menent + * Copyright (C) 2012-2015 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García * @@ -1094,8 +1094,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); - if ($conf->fournisseur->enabled) $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); - if ($conf->fournisseur->enabled) $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); + if ($conf->fournisseur->enabled) $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); + $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->creer); } // Expeditions diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 44cf9df493f..9182708ec8d 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2015 Juanjo Menent * * 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 @@ -400,7 +401,7 @@ if ($resql) { print "
\n"; - if ($user->rights->stock->creer) + if ($user->rights->stock->mouvement->creer) { print ''.$langs->trans("StockCorrection").''; } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c6942e8c8e2..b5639228325 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013-2015 Juanjo Menent * Copyright (C) 2014-2015 Cédric Gross * Copyright (C) 2015 Marcos García * @@ -803,7 +803,7 @@ if (empty($action) && $product->id) { print "
\n"; - if ($user->rights->stock->creer) + if ($user->rights->stock->mouvement->creer) { print ''.$langs->trans("StockCorrection").''; } From bc69703888813ed705b301723c26a061e9415e86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Apr 2015 00:07:46 +0200 Subject: [PATCH 5/7] Fix phpcs --- .../filemanagerdol/connectors/php/commands.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 0dc17d7313c..0449635aaac 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -23,9 +23,13 @@ */ /** - * @param string $currentFolder + * GetFolders + * + * @param string $resourceType Resource type + * @param string $currentFolder Current folder + * @return void */ -function GetFolders( $resourceType, $currentFolder ) +function GetFolders($resourceType, $currentFolder) { // Map the virtual path to the local server path. $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFolders'); @@ -182,7 +186,13 @@ function CreateFolder( $resourceType, $currentFolder ) // DOL_CHANGE //function FileUpload( $resourceType, $currentFolder, $sCommand ) /** - * @param string $currentFolder + * FileUpload + * + * @param string $resourceType Resource type + * @param string $currentFolder Current folder + * @param string $sCommand Command + * @param string $CKEcallback Callback + * @return null */ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') { From 369d6915b82b86f7d7bc48266e17f4410b04ad37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Apr 2015 00:14:44 +0200 Subject: [PATCH 6/7] Fix: PHPCS --- htdocs/paypal/lib/paypal.lib.php | 67 ++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 76ea5ab4834..5eb4549f0fa 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -415,36 +415,45 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re } -/* - '------------------------------------------------------------------------------------------------------------------------------------------- - ' Purpose: Prepares the parameters for the SetExpressCheckout API Call. - ' Inputs: - ' paymentAmount: Total value of the shopping cart - ' currencyCodeType: Currency code value the PayPal API - ' paymentType: paymentType has to be one of the following values: Sale or Order or Authorization - ' returnURL: the page where buyers return to after they are done with the payment review on PayPal - ' cancelURL: the page where buyers return to when they cancel the payment review on PayPal - ' shipToName: the Ship to name entered on the merchant's site - ' shipToStreet: the Ship to Street entered on the merchant's site - ' shipToCity: the Ship to City entered on the merchant's site - ' shipToState: the Ship to State entered on the merchant's site - ' shipToCountryCode: the Code for Ship to Country entered on the merchant's site - ' shipToZip: the Ship to ZipCode entered on the merchant's site - ' shipToStreet2: the Ship to Street2 entered on the merchant's site - ' phoneNum: the phoneNum entered on the merchant's site - ' email: the buyer email - ' desc: Product description - '-------------------------------------------------------------------------------------------------------------------------------------------- - */ /** - * @param double $paymentAmount - * @param string $currencyCodeType - * @param string $paymentType - * @param string $returnURL - * @param string $cancelURL - * @param string $tag - * @param string $solutionType - * @param string $landingPage + *------------------------------------------------------------------------------------------------------------------------------------------- + * Purpose: Prepares the parameters for the SetExpressCheckout API Call. + * Inputs: + * paymentAmount: Total value of the shopping cart + * currencyCodeType: Currency code value the PayPal API + * paymentType: paymentType has to be one of the following values: Sale or Order or Authorization + * returnURL: the page where buyers return to after they are done with the payment review on PayPal + * cancelURL: the page where buyers return to when they cancel the payment review on PayPal + * shipToName: the Ship to name entered on the merchant's site + * shipToStreet: the Ship to Street entered on the merchant's site + * shipToCity: the Ship to City entered on the merchant's site + * shipToState: the Ship to State entered on the merchant's site + * shipToCountryCode: the Code for Ship to Country entered on the merchant's site + * shipToZip: the Ship to ZipCode entered on the merchant's site + * shipToStreet2: the Ship to Street2 entered on the merchant's site + * phoneNum: the phoneNum entered on the merchant's site + * email: the buyer email + * desc: Product description + * + * @param double $paymentAmount Payment amount + * @param string $currencyCodeType Currency + * @param string $paymentType Payment type + * @param string $returnURL Return Url + * @param string $cancelURL Cancel Url + * @param string $tag Tag + * @param string $solutionType Type + * @param string $landingPage Landing page + * @param string $shipToName Ship to name + * @param string $shipToStreet Ship to street + * @param string $shipToCity Ship to city + * @param string $shipToState Ship to state + * @param string $shipToCountryCode Ship to country code + * @param string $shipToZip Ship to zip + * @param string $shipToStreet2 Ship to street2 + * @param string $phoneNum Phone + * @param string $email Email + * @param string $desc Description + * @return array Array */ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag, $solutionType, $landingPage, $shipToName, $shipToStreet, $shipToCity, $shipToState, $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum, $email='', $desc='') { From 7f62892609edd60c32ca7536c059275cc4a19564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 8 Apr 2015 09:19:41 +0200 Subject: [PATCH 7/7] Display total with currency code --- htdocs/compta/bank/treso.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 91c41aa5e3c..292742315bb 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -329,8 +329,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) // Solde actuel $var=!$var; print ''; - print ''.$langs->trans("FutureBalance").''; - print ''.price($solde).''; + print ''.$langs->trans("FutureBalance").' ('.$acct->currency_code.')'; + print ''.price($solde, 0, $langs, 0, 0, -1, $acct->currency_code).''; print ''; print "";