From a81c4830613a12700d6cb907312fa28068858db4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Nov 2014 02:14:25 +0100 Subject: [PATCH 01/10] Revert "Update objectline_create.tpl.php" This reverts commit fdac53bfca37b034a8decfb4f0e568cbc93a5b27. --- htdocs/core/tpl/objectline_create.tpl.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6e9b3251fbd..a51a6505416 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -107,9 +107,7 @@ else { print ''; } else {*/ - echo ''; /* if (empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("Type"); else if (! empty($forceall) || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))) echo $langs->trans("FreeLineOfType"); @@ -125,7 +123,7 @@ else { { echo '
'; echo ' '; - echo ''; echo ' '; $filtertype=''; From f6ab7ca0c96f69822f10c5173eb71d062294f6bb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Dec 2014 20:42:47 +0100 Subject: [PATCH 02/10] Typo --- htdocs/admin/ihm.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index fe375d7668c..358bf486607 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -117,7 +117,7 @@ if ($action == 'edit') // Edit print_fiche_titre($langs->trans("Language"),'','').'
'; print ''; - print ''; + print ''; print ''; print ''; @@ -159,7 +159,7 @@ if ($action == 'edit') // Edit // Other print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'; - print ''; + print ''; print ''; print ''; @@ -283,7 +283,7 @@ else // Show // Language print_fiche_titre($langs->trans("Language"),'','').'
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'; - print ''; + print ''; $var=!$var; print '\n\n"; } @@ -231,8 +212,8 @@ if (! empty($conf->fournisseur->enabled)) print ""; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled); + print ''; print "\n\n\n"; } if (! empty($conf->fournisseur->enabled)) @@ -244,8 +225,8 @@ if (! empty($conf->fournisseur->enabled)) print ""; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled); + print ''; print "\n\n\n"; } @@ -334,6 +315,34 @@ if ($virtualdiffersfromphysical) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("DefaultLanguage").''; @@ -327,7 +327,7 @@ else // Show // Other $var=true; print ''; - print ''; + print ''; $var=!$var; print ''; From 5a05d4a4b8efa4d546e84970b491267f0649585f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 2 Dec 2014 20:59:00 +0100 Subject: [PATCH 03/10] Untranslatable token Calendar in datepicker --- htdocs/core/datepicker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..67af3c7e083 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,6 +39,7 @@ require_once '../main.inc.php'; if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php $langs->load("main"); +$langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -57,7 +58,7 @@ if (GETPOST('mode') && GETPOST('mode') == 'test') } else { - print 'Calendar'; + print ''.$langs->trans("Calendar").''; } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) From 9e1b0d1abceeaebd96cfeac2c623dd16cec10eeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Dec 2014 15:09:47 +0100 Subject: [PATCH 04/10] Prepare 3.5.6 --- ChangeLog | 8 ++++++++ build/debian/changelog | 7 +++++++ build/exe/doliwamp/doliwamp.iss | 4 ++-- build/makepack-howto.txt | 1 - build/rpm/dolibarr_fedora.spec | 3 +++ build/rpm/dolibarr_generic.spec | 3 +++ build/rpm/dolibarr_mandriva.spec | 3 +++ build/rpm/dolibarr_opensuse.spec | 3 +++ htdocs/filefunc.inc.php | 2 +- 9 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bab2b804a5c..7a65eef7fc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,14 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 +Fix: Can't update phone_pro from web service +Fix: Some security holes. +Fix: copy extrafields when creating order from proposal. +Fix: report on action was not filtering by environment. +Fix: Avoid missing class error. +Fix: Add function dolEscapeXML. +Fix: Bad days and month reported by function. +Fix: Bad margin calculation. ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. diff --git a/build/debian/changelog b/build/debian/changelog index aeba0dfa190..e1f40514d9a 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,3 +1,10 @@ +dolibarr (3.5.6-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 2 Dec 2014 12:00:00 +0100 + dolibarr (3.5.5-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 5ff4e7770b0..f06ec591712 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.5.5 +AppVerName=DoliWamp-3.5.6 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.5.5 +OutputBaseFilename=DoliWamp-3.5.6 ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 7ab0da72138..24e5f809185 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -13,7 +13,6 @@ beta version of Dolibarr, step by step. - Update version number with x.y.z-w in build/debian/changelog - Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z-w in build/rpm/*.spec -- Update version number with x.y in build/doxygen/dolibarr-doxygen.doxyfile - Commit all changes. - Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags - Create a branch (x.y). diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 92b097801b4..242d19239a5 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -331,6 +331,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index b2b7e745b34..d8e8349f9fb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -567,6 +567,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 658601980f7..9238530a308 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -336,6 +336,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index d11630c3bb9..94ce0e7e549 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -347,6 +347,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Tue Dec 2 2014 Laurent Destailleur 3.5.6-0.3 +- Upstream release + * Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 - Upstream release diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 95916901c6d..9705eee2028 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.5'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.6'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From bff65fc6b479f744c34af7a3020d50c66ae9a731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 01:25:18 +0100 Subject: [PATCH 05/10] Fix: starting with var with always same color --- htdocs/comm/card.php | 2 +- htdocs/core/class/html.formfile.class.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d0dd842cd7c..8a4df52748c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -530,6 +530,7 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); + $var=!$var; print ""; print '\n"; print ''; print ''; - $var=!$var; $i++; } $db->free($resql); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 824bd4f3ae9..2bcfd36bdde 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -133,9 +133,10 @@ class FormFile if ($perm) { $langs->load('other'); - $out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); - $out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); - $out .= ')'; + //$out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); + $out .= ' '; + $out.=info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + //$out .= ')'; } } else @@ -778,7 +779,7 @@ class FormFile if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var=false; + $var=true; foreach($filearray as $key => $file) // filearray must be only files here { if ($file['name'] != '.' From a9338a0f9f5c55a42ff70cefca9c014d86b91f25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 16:04:37 +0100 Subject: [PATCH 06/10] Fix: Maxi debug of module productbatch. Conflicts: htdocs/core/class/conf.class.php htdocs/langs/en_US/productbatch.lang --- htdocs/admin/stock.php | 93 ++++++++++--------- htdocs/core/class/conf.class.php | 13 +++ htdocs/core/modules/modProductBatch.class.php | 2 +- htdocs/expedition/card.php | 68 ++++++++++---- htdocs/expedition/index.php | 12 ++- htdocs/expedition/shipment.php | 5 +- htdocs/langs/en_US/productbatch.lang | 25 ++--- htdocs/langs/fr_FR/productbatch.lang | 2 +- htdocs/product/card.php | 2 +- 9 files changed, 142 insertions(+), 80 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index a3109647939..6b2c626da39 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -113,35 +113,20 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup'); $form=new Form($db); -$var=true; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . '
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) @@ -539,7 +540,6 @@ if ($id > 0) print ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'; -print ''; -print " \n"; -print " \n"; -print ''."\n"; -/* - * Formulaire parametres divers - */ +$disabled=''; +if (! empty($conf->productbatch->enabled)) +{ + $langs->load("productbatch"); + $disabled=' disabled="disabled"'; + print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); +} -$var=!$var; - -print ""; -print ''; - -print '\n"; -print "\n"; -print '
'; -print '
".$langs->trans("Parameters")." 
'.$langs->trans("UserWarehouseAutoCreate").''; -print "
"; -print ''; -print ""; -print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1); -print ''; -print '
'; -print "
'; -print '
'; +//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) +//{ +print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); +//} // Title rule for stock decrease print ''; @@ -160,8 +145,8 @@ if (! empty($conf->facture->enabled)) print ""; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled); + print ''; print "\n\n\n"; } @@ -174,8 +159,8 @@ if (! empty($conf->commande->enabled)) print ""; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled); + print ''; print "\n\n\n"; } @@ -188,16 +173,12 @@ if (! empty($conf->expedition->enabled)) print ""; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled); + print ''; print "\n\n\n"; } print '
'; -//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) -//{ -print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); -//} print '
'; // Title rule for stock increase @@ -217,8 +198,8 @@ if (! empty($conf->fournisseur->enabled)) print "
"; print ''; print ""; - print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1); - print ''; + print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled); + print ''; print "
\n
'; } + +$var=true; +print ''; + +print ''; +print " \n"; +print " \n"; +print ''."\n"; + +$var=!$var; + +print ""; +print ''; + +print '\n"; +print "\n"; +print '
'; +print '
".$langs->trans("Other")." 
'.$langs->trans("UserWarehouseAutoCreate").''; +print "
"; +print ''; +print ""; +print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1); +print ''; +print '
'; +print "
'; +print '
'; + + llxFooter(); $db->close(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8a17273435e..9127ed614b3 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -366,6 +366,16 @@ class Conf unset($this->global->CONTACT_USE_SEARCH_TO_SELECT); } + if (! empty($conf->productbatch->enabled)) + { + $this->global->STOCK_CALCULATE_ON_BILL=0; + $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0; + $this->global->STOCK_CALCULATE_ON_SHIPMENT=1; + $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL=0; + $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER=0; + $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1; + } + // conf->currency if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR'; $this->currency=$this->global->MAIN_MONNAIE; @@ -373,6 +383,9 @@ class Conf // conf->global->ACCOUNTING_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...) if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES' + // By default, suppliers objects can be linked to all projects + $conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1; + // conf->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25; $this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT; diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 0cd30f04d22..6eb358aa99d 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -67,7 +67,7 @@ class modProductBatch extends DolibarrModules $this->config_page_url = array(); // Dependencies - $this->depends = array("modProduct","modStock"); // List of modules id that must be enabled if this module is enabled + $this->depends = array("modProduct","modStock","modExpedition","modSupplier"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order). $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(5,0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8984e4c5424..979ed0491a1 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -84,9 +84,24 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('expeditioncard','globalcard')); + /* * Actions */ + +$warehousecanbeselectedlater=1; +if (! empty($conf->productbatch->enabled)) +{ + if (! (GETPOST('entrepot_id','int') > 0)) + { + $langs->load("errors"); + setEventMessage($langs->trans("WarhouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors'); + header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id); + exit; + } +} + + $parameters=array(); $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'); @@ -593,7 +608,7 @@ if ($action == 'create') print_fiche_titre($langs->trans("CreateASending")); if (! $origin) { - $mesg='
'.$langs->trans("ErrorBadParameters").'
'; + setEventMessage($langs->trans("ErrorBadParameters"),'errors'); } dol_htmloutput_mesg($mesg); @@ -771,10 +786,13 @@ if ($action == 'create') print ''; if (! empty($conf->stock->enabled)) { - if (empty($conf->productbatch->enabled)) { - print ''.$langs->trans("Warehouse").' / '.$langs->trans("Stock").''; - } else { - print ''.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' / '.$langs->trans("Stock").''; + if (empty($conf->productbatch->enabled)) + { + print ''.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'; + } + else + { + print ''.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')'; } } print "\n"; @@ -828,7 +846,7 @@ if ($action == 'create') print ''; } else - { + { print ""; if ($type==1) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); @@ -861,17 +879,19 @@ if ($action == 'create') $quantityAsked = $line->qty; $quantityToBeDelivered = $quantityAsked - $quantityDelivered; + $warehouse_id = GETPOST('entrepot_id','int'); + $defaultqty=0; - if (GETPOST('entrepot_id','int') > 0) + if ($warehouse_id > 0) { //var_dump($product); - $stock = $product->stock_warehouse[GETPOST('entrepot_id','int')]->real; + $stock = $product->stock_warehouse[$warehouse_id]->real; $stock+=0; // Convertit en numerique $defaultqty=min($quantityToBeDelivered, $stock); if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[GETPOST('entrepot_id','int')]))) + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[$warehouse_id]))) { // Quantity to send print ''; @@ -892,14 +912,14 @@ if ($action == 'create') // Show warehouse combo list $ent = "entl".$indiceAsked; $idl = "idl".$indiceAsked; - $tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); + $tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):$warehouse_id; print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product); - if ($tmpentrepot_id > 0 && $tmpentrepot_id == GETPOST('entrepot_id','int')) + if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { //print $stock.' '.$quantityToBeDelivered; if ($stock < $quantityToBeDelivered) { - print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for entrepot_id but we may have change warehouse + print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse } } } @@ -934,11 +954,14 @@ if ($action == 'create') } } } - } else { + } + else + { print ''; $subj=0; print ''; - foreach ($product->stock_warehouse[GETPOST('entrepot_id','int')]->detail_batch as $dbatch) { + foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) + { //var_dump($dbatch); $substock=$dbatch->qty +0 ; print ''; @@ -946,8 +969,13 @@ if ($action == 'create') print ''; print ''; + + $staticwarehouse=new Entrepot($db); + $staticwarehouse->fetch($warehouse_id); + print $staticwarehouse->getNomUrl(0).' / '; + print ''; - print $langs->trans("DetailBatchFormat", dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->batch, $dbatch->qty); + print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); if ($defaultqty<=0) { $defaultqty=0; } else { @@ -1451,12 +1479,14 @@ else if ($id || $ref) } // Batch number managment - if (! empty($conf->productbatch->enabled)) { - if (isset($lines[$i]->detail_batch) ) { - print ''; + if (! empty($conf->productbatch->enabled)) + { + if (isset($lines[$i]->detail_batch)) + { + print ''; $detail = ''; foreach ($lines[$i]->detail_batch as $dbatch) { - $detail.= $langs->trans("DetailBatchFormat",dol_print_date($dbatch->eatby,"day"),dol_print_date($dbatch->sellby,"day"),$dbatch->batch,$dbatch->dluo_qty).'
'; + $detail.= $langs->trans("DetailBatchFormat",$dbatch->batch,dol_print_date($dbatch->eatby,"day"),dol_print_date($dbatch->sellby,"day"),$dbatch->dluo_qty).'
'; } print $form->textwithtooltip($langs->trans("DetailBatchNumber"),$detail); print ''; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index e3cb8305562..2b41a939c7b 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -114,7 +114,7 @@ if ($resql) /* * Commandes a traiter */ -$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; +$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -136,7 +136,7 @@ if ($resql) $i = 0; print ''; print ''; - print ''; + print ''; $var = True; while ($i < $num) { @@ -146,13 +146,19 @@ if ($resql) print ''; print ''; + print ''; + print ''; + print ''; $i++; } print "
'.$langs->trans("OrdersToProcess").'
'.$langs->trans("OrdersToProcess").'
'; $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; + $orderstatic->statut=$obj->fk_statut; + $orderstatic->facturee=0; print $orderstatic->getNomUrl(1); print ''; $companystatic->name=$obj->name; $companystatic->id=$obj->socid; print $companystatic->getNomUrl(1,'customer',32); - print '
'; + print $orderstatic->getLibStatut(3); + print '

"; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index f1be4b07021..bce365447e1 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -643,7 +643,10 @@ if ($id > 0 || ! empty($ref)) if (! empty($conf->stock->enabled)) { - print ''.$langs->trans("WarehouseSource").''; + $warehousecanbeselectedlater=1; + if (! empty($conf->productbatch->enabled)) $warehousecanbeselectedlater=0; + + print ''.$langs->trans("WarehouseSource").''; print ''; print $formproduct->selectWarehouses(-1,'entrepot_id','',1); if (count($formproduct->cache_warehouses) <= 0) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 435ceadfbbf..0102f688b1b 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -5,16 +5,17 @@ ProductStatusOnBatch=Managed ProductStatusNotOnBatch=Not Managed ProductStatusOnBatchShort=Managed ProductStatusNotOnBatchShort=Not Managed -Batch=Batch -atleast1batchfield= Eat-by date or Sell-by date or Batch number -batch_number= Batch number -l_eatby= Eat-by date -l_sellby= Sell-by date -DetailBatchNumber= Batch details -DetailBatchFormat= E:%s S: %s BATCH: %s (Qty : %d) -printBatch= Batch: %s -printEatby= Eat-by: %s -printSellby= Sell-by: %s -printQty= Qty: %d +Batch=Batch/Serial +atleast1batchfield=Eat-by date or Sell-by date or Batch number +batch_number=Batch/Serial number +l_eatby=Eat-by date +l_sellby=Sell-by date +DetailBatchNumber=Batch/Serial details +DetailBatchFormat=Batch/Serial: %s - E:%s - S: %s (Qty : %d) +printBatch=Batch: %s +printEatby=Eat-by: %s +printSellby=Sell-by: %s +printQty=Qty: %d AddDispatchBatchLine=Add a line for Shelf Life dispatching -BatchDefaultNumber= Undefined \ No newline at end of file +BatchDefaultNumber=Undefined +WhenProductBatchModuleOnOptionAreForced=When module Batch/Serial is on, increase/decrease stock mode is forced to last choice and can't be edited. Other options can be defined as you want. diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 68e76dca46b..83f37508b8d 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -10,7 +10,7 @@ batch_number= Numéro de lot l_eatby= DLC l_sellby= DLUO DetailBatchNumber= Détails des lots -DetailBatchFormat= C:%s UO: %s LOT: %s (Qté : %d) +DetailBatchFormat= Lot/Serie: %s - C:%s - UO: %s (Qté : %d) printBatch= Lot: %s printEatby= DLC: %s printSellby= DLUO: %s diff --git a/htdocs/product/card.php b/htdocs/product/card.php index e03eb5fa104..133cd9e20cc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1122,7 +1122,7 @@ else // Batch number managment if ($conf->productbatch->enabled) { - print ''.$langs->trans("ManageLotSerial").''; + print ''.$langs->trans("ManageLotSerial").''; $statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); print $form->selectarray('status_batch',$statutarray,$object->status_batch); print ''; From d3a22c42abbbdc2117dd43c2393a5ec236c7c12c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 16:45:19 +0100 Subject: [PATCH 07/10] Try to solve pb with phpcs --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 57781d47e44..4db9ff10b2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,7 @@ before_script: - echo Install phpcs then show installed rules - pyrus install pear/PHP_CodeSniffer - phpenv rehash + - phpcs --version - phpcs -i - echo Create dir $(pwd)/htdocs/documents - sudo mkdir -p $(pwd)/htdocs/documents/admin/temp; From c36d362248c90319858733e96834bb1fd0b2dfbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 17:38:34 +0100 Subject: [PATCH 08/10] Fix: PHPCS 2.0 --- dev/codesniffer/ruleset.xml | 32 +++++++++++++++++++ .../adherents/class/adherentstats.class.php | 1 - 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 7e3057a6675..fa4b558c15f 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -169,6 +169,38 @@ 0 + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 @@ -200,7 +200,9 @@ 0 - + + 0 +