From 75bd4405915dadb8eb0aa8314b7590570dbcf2ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 18:29:02 +0200 Subject: [PATCH 01/10] Trans --- htdocs/langs/en_US/stocks.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 5960f900cca..ddb94c70279 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -249,7 +249,7 @@ SelectAStockMovementFileToImport=select a stock movement file to import InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):
Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number
CSV character separator must be "%s" LabelOfInventoryMovemement=Inventory %s ReOpen=Reopen -ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock. +ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock to the real qty you entered into the inventory. ObjectNotFound=%s not found MakeMovementsAndClose=Generate movements and close AutofillWithExpected=Fill real quantity with expected quantity \ No newline at end of file From aa2d85276ec285cfa03a344b68166800d4d0ccc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 18:38:22 +0200 Subject: [PATCH 02/10] Debug v14 --- htdocs/core/class/html.formother.class.php | 4 ++-- htdocs/install/fileconf.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ba3ff77d394..46858191c7b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -88,8 +88,8 @@ class FormOther */ $out .= '
'; $out .= '
'; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= '
'; $out .= ''.$langs->trans("FeatureNotYetAvailable").''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 3f2e714640a..42c8d3459fe 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -33,7 +33,7 @@ global $langs; $err = 0; -$setuplang = GETPOST("selectlang", '', 3) ? GETPOST("selectlang", '', 3) : (GETPOST('lang', 'alpha', 1) ? GETPOST('lang', 'alpha', 1) : 'auto'); +$setuplang = GETPOST("selectlang", 'alpha', 3) ? GETPOST("selectlang", 'alpha', 3) : (GETPOST('lang', 'alpha', 1) ? GETPOST('lang', 'alpha', 1) : 'auto'); $langs->setDefaultLang($setuplang); $langs->loadLangs(array("install", "errors")); From f504cbcec4865106017066ea0c7038f84d5ca1c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 19:18:51 +0200 Subject: [PATCH 03/10] Fix log --- htdocs/core/class/utils.class.php | 2 +- htdocs/langs/en_US/errors.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9534970a856..d2987e8fc63 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -354,7 +354,7 @@ class Utils $execmethod = 1; } - dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_DEBUG); + dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO); // TODO Replace with executeCLI function if ($execmethod == 1) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index a1155b0f57c..f2d9106107b 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -117,7 +117,7 @@ ErrorCantReadFile=Failed to read file '%s' ErrorCantReadDir=Failed to read directory '%s' ErrorBadLoginPassword=Bad value for login or password ErrorLoginDisabled=Your account has been disabled -ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir. +ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server user. Check also the command is not protected on shell level by a security layer like apparmor. ErrorFailedToChangePassword=Failed to change password ErrorLoginDoesNotExists=User with login %s could not be found. ErrorLoginHasNoEmail=This user has no email address. Process aborted. From 9eda9c1e21e61363461dc23c967e855f86dacc3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 19:55:16 +0200 Subject: [PATCH 04/10] Enhance setup --- htdocs/admin/system/security.php | 33 +++++++++++++++++++++++++++++++- htdocs/langs/en_US/admin.lang | 4 +++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index d8dd21719fd..36f08309e02 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -40,6 +40,8 @@ if (GETPOST('action', 'aZ09') == 'donothing') { exit; } +$execmethod = empty($conf->global->MAIN_EXEC_USE_POPEN) ? 1 : $conf->global->MAIN_EXEC_USE_POPEN; + /* * View @@ -74,7 +76,13 @@ print "PHP allow_url_include = ".(ini_get('allow_url_include') print "PHP disable_functions = "; $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); -$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open,popen'); +if ($execmethod == 1) { + $arrayoffunctionstodisable2 = explode(',', 'passthru,shell_exec,system,proc_open,popen'); + $functiontokeep = 'exec'; +} else { + $arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open'); + $functiontokeep = 'popen'; +} $i = 0; foreach ($arrayoffunctionsdisabled as $functionkey) { if ($i > 0) { @@ -115,6 +123,13 @@ if ($todisabletext) { print '
'; } +print $langs->trans("PHPFunctionsRequiredForCLI").': '; +if (in_array($functiontokeep, $arrayoffunctionsdisabled)) { + print img_picto($langs->trans("PHPFunctionsRequiredForCLI"), 'warning'); +} +print ''.$functiontokeep.''; +print '
'; + print '
'; // XDebug @@ -245,6 +260,22 @@ print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->glob print '
'; +print 'MAIN_EXEC_USE_POPEN = '; +if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { + print ''.$langs->trans("Undefined").'   '; +} else { + print $conf->global->MAIN_EXEC_USE_POPEN.'   '; +} +if ($execmethod == 1) { + print ' --> "exec" PHP method will be used for shell commands.'; +} +if ($execmethod == 2) { + print ' --> "popen" PHP method will be used for shell commands.'; +} +print "
"; +print '
'; + + print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f4bcfcfbd4..467fba89199 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2127,7 +2127,8 @@ ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by MailToSendEventOrganization=Event Organization AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form YouShouldDisablePHPFunctions=You should disable PHP functions -IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions +IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions +PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) RecommendedValueIs=Recommended: %s NotRecommended=Not recommanded @@ -2137,3 +2138,4 @@ CheckForModuleUpdateHelp=This action will connect to editors of external modules ModuleUpdateAvailable=An update is available NoExternalModuleWithUpdate=No updates found for external modules SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) +YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. \ No newline at end of file From 19a203bd401599fca0523803dd7a9e4e44698dd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:09:06 +0200 Subject: [PATCH 05/10] Fix amount of memberships --- .../adherents/class/adherent_type.class.php | 2 +- htdocs/adherents/stats/index.php | 4 +-- htdocs/adherents/type.php | 29 ++++++++++--------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 2ffc1e2c9fd..0104f8f36e8 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -366,7 +366,7 @@ class AdherentType extends CommonObject $sql .= "libelle = '".$this->db->escape($this->label)."',"; $sql .= "morphy = '".$this->db->escape($this->morphy)."',"; $sql .= "subscription = '".$this->db->escape($this->subscription)."',"; - $sql .= "amount = '".$this->db->escape($this->amount)."',"; + $sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).","; $sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',"; $sql .= "note = '".$this->db->escape($this->note)."',"; $sql .= "vote = ".(integer) $this->db->escape($this->vote).","; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 11c0025dcc5..e820d0a0d23 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -198,8 +198,8 @@ foreach ($data as $val) { //print ''; print ''; print ''.$val['nb'].''; - print ''.price(price2num($val['total'], 'MT'), 1).''; - print ''.price(price2num($val['avg'], 'MT'), 1).''; + print ''.price(price2num($val['total'], 'MT'), 1).''; + print ''.price(price2num($val['avg'], 'MT'), 1).''; print ''; $oldyear = $year; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 6c4f63725e1..033592a9afc 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -71,7 +71,7 @@ $label = GETPOST("label", "alpha"); $morphy = GETPOST("morphy", "alpha"); $status = GETPOST("status", "int"); $subscription = GETPOST("subscription", "int"); -$amount = price2num(GETPOST('amount', 'alpha'), 'MT'); +$amount = GETPOST('amount', 'alpha'); $duration_value = GETPOST('duration_value', 'int'); $duration_unit = GETPOST('duration_unit', 'alpha'); $vote = GETPOST("vote", "int"); @@ -119,7 +119,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { $object->morphy = trim($morphy); $object->status = (int) $status; $object->subscription = (int) $subscription; - $object->amount = $amount; + $object->amount = ($amount == '' ? '' : price2num($amount, 'MT')); $object->duration_value = $duration_value; $object->duration_unit = $duration_unit; $object->note = trim($comment); @@ -166,12 +166,11 @@ if ($action == 'update' && $user->rights->adherent->configurer) { $object->fetch($rowid); $object->oldcopy = clone $object; - $object->label= trim($label); $object->morphy = trim($morphy); $object->status = (int) $status; $object->subscription = (int) $subscription; - $object->amount = $amount; + $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));; $object->duration_value = $duration_value; $object->duration_unit = $duration_unit; $object->note = trim($comment); @@ -306,7 +305,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } print ''; print ''.yn($objp->subscription).''; - print ''.price($objp->amount).''; + print ''.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).''; print ''.yn($objp->vote).''; print ''.$membertype->getLibStatut(5).''; if ($user->rights->adherent->configurer) { @@ -446,7 +445,7 @@ if ($rowid > 0) { print ''; print ''.$langs->trans("Amount").''; - print price($object->amount); + print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount)); print ''; print ''.$langs->trans("VoteAllowed").''; @@ -594,24 +593,24 @@ if ($rowid > 0) { $titre .= " (".$membertype->label.")"; } - $param = "&rowid=".$object->id; + $param = "&rowid=".urlencode($object->id); if (!empty($status)) { - $param .= "&status=".$status; + $param .= "&status=".urlencode($status); } if (!empty($search_lastname)) { - $param .= "&search_lastname=".$search_lastname; + $param .= "&search_lastname=".urlencode($search_lastname); } if (!empty($search_firstname)) { - $param .= "&search_firstname=".$search_firstname; + $param .= "&search_firstname=".urlencode($search_firstname); } if (!empty($search_login)) { - $param .= "&search_login=".$search_login; + $param .= "&search_login=".urlencode($search_login); } if (!empty($search_email)) { - $param .= "&search_email=".$search_email; + $param .= "&search_email=".urlencode($search_email); } if (!empty($filter)) { - $param .= "&filter=".$filter; + $param .= "&filter=".urlencode($filter); } if ($sall) { @@ -797,7 +796,9 @@ if ($rowid > 0) { print ''; print ''.$langs->trans("Amount").''; - print ''; + print ''; print ''; print ''.$langs->trans("VoteAllowed").''; From ba6e675273cc72259dbfa2a76e7a9dc83ffd1727 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:21:20 +0200 Subject: [PATCH 06/10] css --- htdocs/compta/bank/various_payment/list.php | 13 ++++++------- htdocs/salaries/stats/index.php | 8 ++++---- htdocs/theme/md/style.css.php | 5 ++++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5e6d199db0a..f78e004f571 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -338,14 +338,13 @@ if ($result) { if ($search_accountancy_subledger > 0) { $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger); } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); + $param .= '&optioncss='.urlencode($optioncss); } $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create'; if (!empty($socid)) { - $url .= '&socid='.$socid; + $url .= '&socid='.urlencode($socid); } $newcardbutton = dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->banque->modifier); @@ -423,7 +422,7 @@ if ($result) { // Payment type if ($arrayfields['type']['checked']) { - print ''; + print ''; $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100'); print ''; } @@ -498,7 +497,7 @@ if ($result) { print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], 'v.rowid', '', $param, '', $sortfield, $sortorder); } if ($arrayfields['label']['checked']) { - print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], 'v.label', '', $param, '', $sortfield, $sortorder, 'left '); + print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], 'v.label', '', $param, '', $sortfield, $sortorder); } if ($arrayfields['datep']['checked']) { print_liste_field_titre($arrayfields['datep']['label'], $_SERVER["PHP_SELF"], 'v.datep,v.rowid', '', $param, '', $sortfield, $sortorder, 'center '); @@ -507,7 +506,7 @@ if ($result) { print_liste_field_titre($arrayfields['datev']['label'], $_SERVER["PHP_SELF"], 'v.datev,v.rowid', '', $param, '', $sortfield, $sortorder, 'center '); } if ($arrayfields['type']['checked']) { - print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'left '); + print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'center '); } if ($arrayfields['project']['checked']) { print_liste_field_titre($arrayfields['project']['label'], $_SERVER["PHP_SELF"], 'fk_project', '', $param, '', $sortfield, $sortorder); @@ -590,7 +589,7 @@ if ($result) { // Type if ($arrayfields['type']['checked']) { - print ''; + print ''; if ($obj->payment_code) { print $langs->trans("PaymentTypeShort".$obj->payment_code); print ' '; diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1fe914d38c2..1a7f2de6d39 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -238,16 +238,16 @@ foreach ($data as $val) { print ''; print ''.$oldyear.''; print '0'; - print '0'; - print '0'; + print '0'; + print '0'; print ''; } print ''; print ''.$year.''; print ''.$val['nb'].''; - print ''.price(price2num($val['total'], 'MT'), 1).''; - print ''.price(price2num($val['avg'], 'MT'), 1).''; + print ''.price(price2num($val['total'], 'MT'), 1).''; + print ''.price(price2num($val['avg'], 'MT'), 1).''; print ''; $oldyear = $year; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8152e56e945..06e05a542ee 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -369,7 +369,7 @@ select.vmenusearchselectcombo { background-color: unset; } -textarea:focus, button:focus { +textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ border: 1px solid #aaa !important; } @@ -738,6 +738,9 @@ div.floatright .largenumber { font-size: 1.4em; } +button:focus { + outline: none; +} th .button { -webkit-box-shadow: none !important; From 5e0f2f9781dab1facea07442917a73bf8b4745f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:35:21 +0200 Subject: [PATCH 07/10] Debug v14. Fix regression. --- .../install/mysql/migration/13.0.0-14.0.0.sql | 4 ++ .../install/mysql/tables/llx_product_lot.sql | 3 ++ .../product/stock/class/productlot.class.php | 38 +++++++++---------- htdocs/theme/md/style.css.php | 2 +- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 37719c015c5..da2cd34fa00 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -64,6 +64,10 @@ ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64); -- For v14 +ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL; +ALTER TABLE llx_product_lot ADD COLUMN manufacturing_date datetime NULL; +ALTER TABLE llx_product_lot ADD COLUMN scrapping_date datetime NULL; + create table llx_accounting_groups_account ( rowid integer AUTO_INCREMENT PRIMARY KEY, diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql index 86cca7d0f04..f8d02f19ccb 100644 --- a/htdocs/install/mysql/tables/llx_product_lot.sql +++ b/htdocs/install/mysql/tables/llx_product_lot.sql @@ -24,6 +24,9 @@ CREATE TABLE llx_product_lot ( batch varchar(128) DEFAULT NULL, -- Lot or serial number eatby date DEFAULT NULL, -- Eatby date sellby date DEFAULT NULL, -- Sellby date + eol_date datetime NULL, + manufacturing_date datetime NULL, + scrapping_date datetime NULL, datec datetime, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, fk_user_creat integer, diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index f05a4ae3d39..2a3b3cf2e20 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -91,11 +91,11 @@ class Productlot extends CommonObject 'batch' => array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch', 'searchall'=>1), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'sellby' => array('type'=>'date', 'label'=>'SellByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible'=>5, 'position'=>60), - 'eol_date' => array('type'=>'date', 'label'=>'EndOfLife', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>70), - 'manufacturing_date' => array('type'=>'date', 'label'=>'ManufacturingDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>80), - 'scrapping_date' => array('type'=>'date', 'label'=>'DestructionDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>90), - 'commissionning_date' => array('type'=>'date', 'label'=>'FirstUseDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>100), - 'qc_frequency' => array('type'=>'varchar(6)', 'label'=>'QCFrequency', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_TRACEABILITY)?1:0', 'visible'=>5, 'position'=>110), + 'eol_date' => array('type'=>'date', 'label'=>'EndOfLife', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>70), + 'manufacturing_date' => array('type'=>'date', 'label'=>'ManufacturingDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>80), + 'scrapping_date' => array('type'=>'date', 'label'=>'DestructionDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>90), + //'commissionning_date' => array('type'=>'date', 'label'=>'FirstUseDate', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_TRACEABILITY)?0:1', 'visible'=>5, 'position'=>100), + //'qc_frequency' => array('type'=>'varchar(6)', 'label'=>'QCFrequency', 'enabled'=>'empty($conf->global->PRODUCT_ENABLE_QUALITYCONTROL)?1:0', 'visible'=>5, 'position'=>110), 'eatby' => array('type'=>'date', 'label'=>'EatByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_EATBY)?1:0', 'visible'=>5, 'position'=>62), 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), @@ -120,8 +120,8 @@ class Productlot extends CommonObject public $eol_date = ''; public $manufacturing_date = ''; public $scrapping_date = ''; - public $commissionning_date = ''; - public $qc_frequency = ''; + //public $commissionning_date = ''; + //public $qc_frequency = ''; public $datec = ''; public $tms = ''; @@ -184,8 +184,6 @@ class Productlot extends CommonObject $this->import_key = trim($this->import_key); } - - // Check parameters // Put here code to add control on parameters values @@ -199,8 +197,8 @@ class Productlot extends CommonObject $sql .= 'eol_date,'; $sql .= 'manufacturing_date,'; $sql .= 'scrapping_date,'; - $sql .= 'commissionning_date,'; - $sql .= 'qc_frequency,'; + //$sql .= 'commissionning_date,'; + //$sql .= 'qc_frequency,'; $sql .= 'datec,'; $sql .= 'fk_user_creat,'; $sql .= 'fk_user_modif,'; @@ -214,9 +212,8 @@ class Productlot extends CommonObject $sql .= ' '.(!isset($this->eol_date) || dol_strlen($this->eol_date) == 0 ? 'NULL' : "'".$this->db->idate($this->eol_date)."'").','; $sql .= ' '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) == 0 ? 'NULL' : "'".$this->db->idate($this->manufacturing_date)."'").','; $sql .= ' '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) == 0 ? 'NULL' : "'".$this->db->idate($this->scrapping_date)."'").','; - $sql .= ' '.(!isset($this->commissionning_date) || dol_strlen($this->commissionning_date) == 0 ? 'NULL' : "'".$this->db->idate($this->commissionning_date)."'").','; - $sql .= ' '.(!isset($this->qc_frequency) ? 'NULL' : $this->qc_frequency).','; - + //$sql .= ' '.(!isset($this->commissionning_date) || dol_strlen($this->commissionning_date) == 0 ? 'NULL' : "'".$this->db->idate($this->commissionning_date)."'").','; + //$sql .= ' '.(!isset($this->qc_frequency) ? 'NULL' : $this->qc_frequency).','; $sql .= ' '."'".$this->db->idate(dol_now())."'".','; $sql .= ' '.(!isset($this->fk_user_creat) ? 'NULL' : $this->fk_user_creat).','; $sql .= ' '.(!isset($this->fk_user_modif) ? 'NULL' : $this->fk_user_modif).','; @@ -292,8 +289,8 @@ class Productlot extends CommonObject $sql .= " t.eol_date,"; $sql .= " t.manufacturing_date,"; $sql .= " t.scrapping_date,"; - $sql .= " t.commissionning_date,"; - $sql .= " t.qc_frequency,"; + //$sql .= " t.commissionning_date,"; + //$sql .= " t.qc_frequency,"; $sql .= " t.datec,"; $sql .= " t.tms,"; $sql .= " t.fk_user_creat,"; @@ -322,11 +319,10 @@ class Productlot extends CommonObject $this->eatby = $this->db->jdate($obj->eatby); $this->sellby = $this->db->jdate($obj->sellby); $this->eol_date = $this->db->jdate($obj->eol_date); - $this->manufacturing_date = $this->db->jdate($obj->manufacturing_date); $this->scrapping_date = $this->db->jdate($obj->scrapping_date); - $this->commissionning_date = $this->db->jdate($obj->commissionning_date); - $this->qc_frequency = $obj->qc_frequency; + //$this->commissionning_date = $this->db->jdate($obj->commissionning_date); + //$this->qc_frequency = $obj->qc_frequency; $this->datec = $this->db->jdate($obj->datec); $this->tms = $this->db->jdate($obj->tms); @@ -407,8 +403,8 @@ class Productlot extends CommonObject $sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').','; $sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').','; $sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').','; - $sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').','; - $sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').','; + //$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').','; + //$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').','; $sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').','; $sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'").','; $sql .= ' fk_user_creat = '.(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").','; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 06e05a542ee..5735837d665 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3836,7 +3836,7 @@ tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre font-family: ; font-weight: normal; border-bottom: 1px solid #FDFFFF; - text-decoration: underline; + /* text-decoration: underline; */ } input.liste_titre { background: transparent; From 488f242e25bd7b87c05724b85704b96f710189c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:42:10 +0200 Subject: [PATCH 08/10] css --- htdocs/product/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 073643fe235..eb3fc71d53a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -586,7 +586,8 @@ if ($resql) { $paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); } - llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, 'classforhorizontalscrolloftabs'); + //llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, 'classforhorizontalscrolloftabs'); + llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, ''); // Displays product removal confirmation if (GETPOST('delprod')) { From 097f493315a798ef5ca210955bfe1ce0122bd542 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:43:47 +0200 Subject: [PATCH 09/10] css --- htdocs/theme/md/style.css.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 5735837d665..5d6bcf13a59 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -793,10 +793,19 @@ textarea.centpercent { color: #777; } +.flip { + transform: scaleX(-1) translate(2px, 0); +} +.rotate90 { + transform: rotate(90deg) translate(0, 2px); +} .center { text-align: center; margin: 0px auto; } +.alignstart { + text-align: start; +} .left { text-align: ; } From e47118108906ab9b6049a2dfda2d9167ae56ba9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 May 2021 22:52:50 +0200 Subject: [PATCH 10/10] css --- htdocs/theme/md/style.css.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 5d6bcf13a59..25df9b941ef 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4290,10 +4290,10 @@ div.divphotoref > a > .photowithmargin { /* Margin right for photo not inside a .photowithborder { border: 1px solid #f0f0f0; } -.photointoolitp { +.photointooltip { margin-top: 8px; margin-bottom: 6px; - text-align: center; + text-align: center !important; } .photodelete { margin-top: 6px !important;