From 4efdbc71e00ad52cb2e44e61ca3269ce41386401 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 10:46:58 +0100 Subject: [PATCH 001/119] Fix phpcs --- htdocs/comm/propal/list.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e660f32ec5d..9b585bc54a9 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1486,11 +1486,10 @@ if ($resql) $delallowed = $user->rights->propal->creer; print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); - } else { dol_print_error($db); } - // End of page - llxFooter(); - $db->close(); +// End of page +llxFooter(); +$db->close(); From 445e7a1e0c31e039ba824486d10a03c6752d9d8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 10:58:07 +0100 Subject: [PATCH 002/119] Clean code --- htdocs/compta/facture/card-rec.php | 6 ++---- htdocs/compta/facture/card.php | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 01ce7cc1abd..c95f3e3c1c3 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -933,8 +933,7 @@ $companystatic = new Societe($db); $invoicerectmp = new FactureRec($db); $now = dol_now(); -$tmparray = dol_getdate($now); -$today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day +$nowlasthour = dol_last_hour($now); /* @@ -1668,8 +1667,7 @@ if ($action == 'create') { print ''; } else { - if (empty($object->frequency) || $object->date_when <= $today) - { + if (empty($object->frequency) || $object->date_when <= $nowlasthour) { print ''; } else { print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c0a9a15739a..e0e89b7b978 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -970,7 +970,7 @@ if (empty($reshook)) if ($ret < 0) $error++; // Replacement invoice - if ($_POST['type'] == Facture::TYPE_REPLACEMENT) + if (GETPOST('type') == Facture::TYPE_REPLACEMENT) { $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { @@ -1253,7 +1253,7 @@ if (empty($reshook)) } // Standard invoice or Deposit invoice, created from a Predefined template invoice - if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) + if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) { $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { @@ -1299,7 +1299,7 @@ if (empty($reshook)) } // Standard or deposit or proforma invoice, not from a Predefined template invoice - if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT || $_POST['type'] == Facture::TYPE_PROFORMA || ($_POST['type'] == Facture::TYPE_SITUATION && empty($_POST['situations']))) && GETPOST('fac_rec') <= 0) + if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT || GETPOST('type') == Facture::TYPE_PROFORMA || (GETPOST('type') == Facture::TYPE_SITUATION && !GETPOST('situations'))) && GETPOST('fac_rec') <= 0) { if (GETPOST('socid', 'int') < 1) { @@ -1319,7 +1319,7 @@ if (empty($reshook)) $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); + $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); if (!$error) { @@ -1717,12 +1717,12 @@ if (empty($reshook)) $id = $object->create($user); for ($i = 1; $i <= $NBLINES; $i++) { - if ($_POST['idprod'.$i]) { + if (GETPOST('idprod'.$i, 'int')) { $product = new Product($db); - $product->fetch($_POST['idprod'.$i]); - $startday = dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']); - $endday = dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']); - $result = $object->addline($product->description, $product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit); + $product->fetch(GETPOST('idprod'.$i, 'int')); + $startday = dol_mktime(12, 0, 0, GETPOST('date_start'.$i.'month'), GETPOST('date_start'.$i.'day'), GETPOST('date_start'.$i.'year')); + $endday = dol_mktime(12, 0, 0, GETPOST('date_end'.$i.'month'), GETPOST('date_end'.$i.'day'), GETPOST('date_end'.$i.'year')); + $result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit); } } } @@ -1730,7 +1730,7 @@ if (empty($reshook)) } // Situation invoices - if (GETPOST('type') == Facture::TYPE_SITUATION && (!empty($_POST['situations']))) + if (GETPOST('type') == Facture::TYPE_SITUATION && GETPOST('situations')) { $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { @@ -1743,9 +1743,9 @@ if (empty($reshook)) $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); + $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!($_POST['situations'] > 0)) { + if (!(GETPOST('situations', 'int') > 0)) { $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation")); setEventMessages($mesg, null, 'errors'); @@ -1753,8 +1753,8 @@ if (empty($reshook)) } if (!$error) { - $result = $object->fetch($_POST['situations']); - $object->fk_facture_source = $_POST['situations']; + $result = $object->fetch(GETPOST('situations', 'int')); + $object->fk_facture_source = GETPOST('situations', 'int'); $object->type = Facture::TYPE_SITUATION; if (!empty($origin) && !empty($originid)) From eca010937f101c908aefab9d21951bf5711424c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 11:56:53 +0100 Subject: [PATCH 003/119] FIX Trigger on expense report was not fired FIX Bad dates on info tabs --- htdocs/admin/delais.php | 6 +++ htdocs/core/lib/functions2.lib.php | 12 ++--- htdocs/core/menus/standard/empty.php | 8 ++-- htdocs/expensereport/card.php | 44 ++++--------------- .../class/expensereport.class.php | 7 +-- htdocs/holiday/card.php | 8 ++-- .../mysql/data/llx_c_action_trigger.sql | 2 +- .../install/mysql/migration/12.0.0-13.0.0.sql | 9 +++- htdocs/langs/en_US/agenda.lang | 1 + 9 files changed, 42 insertions(+), 55 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index d605f75c511..d214a585ab2 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -33,7 +33,9 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'aZ09'); +if (empty($action)) $action = 'edit'; +// Define list of managed delays $modules = array( 'agenda' => array( array( @@ -190,6 +192,10 @@ if ($action == 'update') for ($i = 0; $i < 4; $i++) { if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + + $action = 'edit'; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index ffc79b8f4b4..fcac069183e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -315,7 +315,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_validation, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } @@ -349,7 +349,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_approve, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } @@ -377,7 +377,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_approve2, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve2, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve2, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } @@ -413,7 +413,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_closing, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_closing, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_closing, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } @@ -447,7 +447,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } @@ -460,7 +460,7 @@ function dol_print_object_info($object, $usetable = 0) if ($usetable) print ''; else print ': '; print dol_print_date($object->date_envoi, 'dayhour', 'tzserver'); - if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi, "dayhour", 'tzserver').'  '.$langs->trans("ClientHour"); + if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour"); if ($usetable) print ''; else print '
'; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 1ab7778bb01..5ab8ff24f9f 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -198,8 +198,8 @@ class MenuManager $submenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1); $submenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1); - $submenu->add("/admin/boxes.php", $langs->trans("Boxes"), 1); - $submenu->add("/admin/delais.php", $langs->trans("Alerts"), 1); + $submenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1); + $submenu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1); $submenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1); $submenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1); $submenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); @@ -340,8 +340,8 @@ class MenuManager $this->menu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1); $this->menu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1); - $this->menu->add("/admin/boxes.php", $langs->trans("Boxes"), 1); - $this->menu->add("/admin/delais.php", $langs->trans("Alerts"), 1); + $this->menu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1); + $this->menu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1); $this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1); $this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1); $this->menu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 83e1173fcb4..c7efc735051 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -976,34 +976,6 @@ if (empty($reshook)) } } - if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid) - { - $object = new ExpenseReport($db); - $object->fetch($id); - - $result = $object->set_unpaid($user); - - if ($result > 0) - { - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (!empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model = $object->model_pdf; - $ret = $object->fetch($id); // Reload to get new records - - $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - } - } - if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) { $object = new ExpenseReport($db); @@ -1492,8 +1464,7 @@ if ($action == 'create') print ''; } else { - if ($id > 0 || $ref) - { + if ($id > 0 || $ref) { $result = $object->fetch($id, $ref); $res = $object->fetch_optionals(); @@ -1755,6 +1726,7 @@ if ($action == 'create') } print ''; + // Period print ''; print ''.$langs->trans("Period").''; print ''; @@ -1772,9 +1744,9 @@ if ($action == 'create') // Validation date print ''; print ''.$langs->trans("DATE_SAVE").''; - print ''.dol_print_date($object->date_valid, 'dayhour'); - if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late")); - if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late")); + print ''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); + if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); + if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); print ''; print ''; @@ -1815,7 +1787,7 @@ if ($action == 'create') print ''; print ''; print ''.$langs->trans("DATE_CANCEL").''; - print ''.dol_print_date($object->date_cancel, 'dayhour').''; + print ''.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').''; print ''; } else { print ''; @@ -1831,7 +1803,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("DateApprove").''; - print ''.dol_print_date($object->date_approve, 'dayhour').''; + print ''.dol_print_date($object->date_approve, 'dayhour', 'tzuser').''; print ''; } @@ -1847,7 +1819,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("DATE_REFUS").''; - print ''.dol_print_date($object->date_refuse, 'dayhour'); + print ''.dol_print_date($object->date_refuse, 'dayhour', 'tzuser'); if ($object->detail_refuse) print ' - '.$object->detail_refuse; print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ad55ec4b537..31c48d790f4 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2454,10 +2454,11 @@ class ExpenseReport extends CommonObject if ($option == 'topay' && $this->status != 5) return false; $now = dol_now(); - if ($option == 'toapprove') - { + if ($option == 'toapprove') { return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); - } else return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + } else { + return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + } } /** diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 09165ee89d1..bbd5a1ac9d4 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1369,24 +1369,24 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') print ''; print ''.$langs->trans('DateCreation').''; - print ''.dol_print_date($object->date_create, 'dayhour').''; + print ''.dol_print_date($object->date_create, 'dayhour', 'tzuser').''; print ''; if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) { print ''; print ''.$langs->trans('DateValidCP').''; - print ''.dol_print_date($object->date_valid, 'dayhour').''; // warning: date_valid is approval date on holiday module + print ''.dol_print_date($object->date_valid, 'dayhour', 'tzuser').''; // warning: date_valid is approval date on holiday module print ''; } if ($object->statut == Holiday::STATUS_CANCELED) { print ''; print ''.$langs->trans('DateCancelCP').''; - print ''.dol_print_date($object->date_cancel, 'dayhour').''; + print ''.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').''; print ''; } if ($object->statut == Holiday::STATUS_REFUSED) { print ''; print ''.$langs->trans('DateRefusCP').''; - print ''.dol_print_date($object->date_refuse, 'dayhour').''; + print ''.dol_print_date($object->date_refuse, 'dayhour', 'tzuser').''; print ''; } print ''; diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 7390c3234a5..05e52c85e4b 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -102,7 +102,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141); diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index cc484477ab6..f75ef8adee6 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -565,5 +565,12 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64); ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL; - +UPDATE llx_c_action_trigger SET elementtype = 'expensereport' where elementtype = 'expense_report' AND code like 'EXPENSE_%'; UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_PAID' where code = 'EXPENSE_REPORT_PAYED'; +UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_DELETE' where code = 'EXPENSE_DELETE'; +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); + diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 8971e80a8f8..33e0c01aad6 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -119,6 +119,7 @@ MRP_MO_UNVALIDATEInDolibarr=MO set to draft status MRP_MO_PRODUCEDInDolibarr=MO produced MRP_MO_DELETEInDolibarr=MO deleted MRP_MO_CANCELInDolibarr=MO canceled +PAIDInDolibarr=%s paid ##### End agenda events ##### AgendaModelModule=Document templates for event DateActionStart=Start date From 284042af7aaaca0e3e452deafeb8a3f9bc01a006 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 12:05:28 +0100 Subject: [PATCH 004/119] FIX User creation of expense report not visible --- htdocs/expensereport/class/expensereport.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 31c48d790f4..7ac1924fec8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -256,6 +256,7 @@ class ExpenseReport extends CommonObject $sql .= ",date_debut"; $sql .= ",date_fin"; $sql .= ",date_create"; + $sql .= ",fk_user_creat"; $sql .= ",fk_user_author"; $sql .= ",fk_user_validator"; $sql .= ",fk_user_approve"; @@ -274,6 +275,7 @@ class ExpenseReport extends CommonObject $sql .= ", '".$this->db->idate($this->date_debut)."'"; $sql .= ", '".$this->db->idate($this->date_fin)."'"; $sql .= ", '".$this->db->idate($now)."'"; + $sql .= ", ".$user->id; $sql .= ", ".$fuserid; $sql .= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator : "null"); $sql .= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve : "null"); @@ -419,6 +421,7 @@ class ExpenseReport extends CommonObject $this->fk_statut = 0; // deprecated // Clear fields + $this->fk_user_creat = $user->id; $this->fk_user_author = $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for. $this->fk_user_valid = ''; $this->date_create = ''; @@ -548,7 +551,7 @@ class ExpenseReport extends CommonObject $sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS $sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int) $sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime) - $sql .= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,"; + $sql .= " d.fk_user_creat, d.fk_user_author, d.fk_user_modif, d.fk_user_validator,"; $sql .= " d.fk_user_valid, d.fk_user_approve,"; $sql .= " d.fk_statut as status, d.fk_c_paiement, d.paid"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d"; @@ -585,6 +588,7 @@ class ExpenseReport extends CommonObject $this->date_refuse = $this->db->jdate($obj->date_refuse); $this->date_cancel = $this->db->jdate($obj->date_cancel); + $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_author = $obj->fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for. $this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_validator = $obj->fk_user_validator; @@ -733,7 +737,7 @@ class ExpenseReport extends CommonObject $sql .= " f.tms as date_modification,"; $sql .= " f.date_valid as datev,"; $sql .= " f.date_approve as datea,"; - //$sql.= " f.fk_user_author as fk_user_creation,"; // This is not user of creation but user the expense is for. + $sql .= " f.fk_user_creat as fk_user_creation,"; $sql .= " f.fk_user_modif as fk_user_modification,"; $sql .= " f.fk_user_valid,"; $sql .= " f.fk_user_approve"; From 524b28d8c380baa099f5daa16600bedaedf889d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 12:15:31 +0100 Subject: [PATCH 005/119] Fix missing tab info on holiday --- htdocs/core/lib/holiday.lib.php | 5 ++ htdocs/holiday/class/holiday.class.php | 75 +++++++++++++++++ htdocs/holiday/info.php | 106 +++++++++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 htdocs/holiday/info.php diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index f5297f6fd89..7b9c5d46da2 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -51,6 +51,11 @@ function holiday_prepare_head($object) $head[$h][2] = 'documents'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/holiday/info.php?id='.$object->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 2030ab1d636..f61c0a66ca8 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2073,6 +2073,81 @@ class Holiday extends CommonObject } + /** + * Load information on object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + global $conf; + + $sql = "SELECT f.rowid,"; + $sql .= " f.date_create as datec,"; + $sql .= " f.tms as date_modification,"; + $sql .= " f.date_valid as datev,"; + //$sql .= " f.date_approve as datea,"; + $sql .= " f.date_refuse as dater,"; + $sql .= " f.fk_user_create as fk_user_creation,"; + $sql .= " f.fk_user_modif as fk_user_modification,"; + $sql .= " f.fk_user_valid,"; + $sql .= " f.fk_validator as fk_user_approve,"; + $sql .= " f.fk_user_refuse as fk_user_refuse"; + $sql .= " FROM ".MAIN_DB_PREFIX."holiday as f"; + $sql .= " WHERE f.rowid = ".$id; + $sql .= " AND f.entity = ".$conf->entity; + + $resql = $this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->rowid; + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->date_validation = $this->db->jdate($obj->datev); + $this->date_approbation = $this->db->jdate($obj->datea); + + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + + if ($obj->fk_user_creation) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_creation); + $this->user_creation = $cuser; + } + if ($obj->fk_user_valid) + { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + if ($obj->fk_user_modification) + { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modification); + $this->user_modification = $muser; + } + if ($obj->fk_user_approve) + { + $auser = new User($this->db); + $auser->fetch($obj->fk_user_approve); + $this->user_approve = $auser; + } + } + $this->db->free($resql); + } else { + dol_print_error($this->db); + } + } + + /** * Initialise an instance with random values. * Used to build previews or test instances. diff --git a/htdocs/holiday/info.php b/htdocs/holiday/info.php new file mode 100644 index 00000000000..2209143001c --- /dev/null +++ b/htdocs/holiday/info.php @@ -0,0 +1,106 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/holiday/info.php + * \ingroup holiday + * \brief Page to show a leave information + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; + +// Load translation files required by the page +$langs->load("holiday"); + +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$childids = $user->getAllChildIds(1); + +// Security check +if ($user->socid) $socid = $user->socid; +$result = restrictedArea($user, 'holiday', $id, 'holiday'); + +$object = new Holiday($db); +if (!$object->fetch($id, $ref) > 0) +{ + dol_print_error($db); +} + +if ($object->id > 0) +{ + // Check current user can read this expense report + $canread = 0; + if (!empty($user->rights->holiday->readall)) $canread = 1; + if (!empty($user->rights->holiday->lire) && in_array($object->fk_user_author, $childids)) $canread = 1; + if (!$canread) + { + accessforbidden(); + } +} + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Holiday")." - ".$langs->trans("Info"); +$helpurl = ""; +llxHeader("", $title, $helpurl); + +if ($id > 0 || !empty($ref)) +{ + $object = new Holiday($db); + $object->fetch($id, $ref); + $object->info($object->id); + + $head = holiday_prepare_head($object); + + print dol_get_fiche_head($head, 'info', $langs->trans("Holiday"), -1, 'holiday'); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + $morehtmlref .= '
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + print '
'; + + print '
'; + + print '
'; + dol_print_object_info($object); + print '
'; + + print '
'; + + print dol_get_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); From b58b3a493234f65cf6fa3be589bd9bd4c707fb7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 13:03:05 +0100 Subject: [PATCH 006/119] FIX link to create event when task is in a project with a thirdparty --- htdocs/projet/tasks/task.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index da15a73f66f..1ba2373f35d 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -650,7 +650,8 @@ if ($id > 0 || !empty($ref)) // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'task', $socid, 1, '', 10, 'withproject='.$withproject); + $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid; + $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject); print ''; } From a6b08b241f50eaaa76e891702616bb2bf4e497b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 17:13:00 +0100 Subject: [PATCH 007/119] Doc --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 6a590b44368..1bdaeef13ef 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1513,6 +1513,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '') * @param int $generatethumbs 1=Generate also thumbs for uploaded image files * @param Object $object Object used to set 'src_object_*' fields * @return int <=0 if KO, >0 if OK + * @see dol_remove_file_process() */ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null) { @@ -1673,6 +1674,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess * @param int $donotdeletefile 1=Do not delete physically file * @param string $trackid Track id (used to prefix name of session vars to avoid conflict) * @return void + * @see dol_add_file_process() */ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletefile = 1, $trackid = '') { From 95c75f8ba83f7de0382f884fa6068cea4bbfa946 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 19:17:57 +0100 Subject: [PATCH 008/119] Fix css --- htdocs/theme/eldy/global.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ce0ecf3d31f..d9e2a70eab2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3397,13 +3397,13 @@ div.pagination li:first-child span { border-bottom-left-radius: 4px;*/ } -div.pagination li a:hover, -div.pagination li:not(.paginationafterarrows,.title-button) span:hover, +/*div.pagination li a:hover, +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:hover, div.pagination li a:focus, -div.pagination li:not(.paginationafterarrows,.title-button) span:focus { +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:focus { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); -} +}*/ div.pagination li .active a, div.pagination li .active span, div.pagination li .active a:hover, From 726ef265f252fc9fe343ec8b5b7ea7050f5ad1f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 19:21:07 +0100 Subject: [PATCH 009/119] Look and feel v14 --- htdocs/admin/website.php | 20 +++++++++++-------- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/core/class/html.formactions.class.php | 4 +++- htdocs/core/lib/agenda.lib.php | 21 +++++++------------- htdocs/theme/eldy/global.inc.php | 8 ++++---- htdocs/user/home.php | 1 - 6 files changed, 29 insertions(+), 31 deletions(-) diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 3ebbd9300bc..09225a6e4a8 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -75,7 +75,7 @@ $tablib[1] = "Websites"; // Requests to extract data $tabsql = array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.position, f.status FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')'; +$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.position, f.status, f.date_creation FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')'; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -83,7 +83,7 @@ $tabsqlsort[1] = "ref ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield = array(); -$tabfield[1] = "ref,description,virtualhost,position"; +$tabfield[1] = "ref,description,virtualhost,position,date_creation"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue = array(); @@ -139,8 +139,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) $fieldnamekey = $listfield[$f]; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); break; - } elseif ($value == 'ref' && !preg_match('/^[a-z0-9_\-\.]+$/i', $_POST[$value])) - { + } elseif ($value == 'ref' && !preg_match('/^[a-z0-9_\-\.]+$/i', GETPOST($value))) { $ok = 0; $fieldnamekey = $listfield[$f]; setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities($fieldnamekey)), null, 'errors'); @@ -149,9 +148,8 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) } // Clean parameters - if (!empty($_POST['ref'])) - { - $websitekey = strtolower($_POST['ref']); + if (GETPOST('ref')) { + $websitekey = strtolower(GETPOST('ref')); } // Si verif ok et action add, on ajoute la ligne @@ -441,6 +439,8 @@ if ($id) print ''; foreach ($fieldlist as $field => $value) { + if ($fieldlist[$field] == 'date_creation') continue; + // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $valuetoshow = ucfirst($fieldlist[$field]); // Par defaut @@ -534,6 +534,7 @@ if ($id) if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); } if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); } if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); } + if ($fieldlist[$field] == 'date_creation') { $valuetoshow = $langs->trans("DateCreation"); } // Affiche nom du champ if ($showfield) @@ -597,7 +598,7 @@ if ($id) print ""; // Modify link - print ''.img_edit().''; + print ''.img_edit().''; // Delete link if ($iserasable) print ''.img_delete().''; @@ -646,6 +647,7 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '') foreach ($fieldlist as $field => $value) { $fieldname = $fieldlist[$field]; + if ($fieldlist[$field] == 'lang') { print ''; @@ -654,6 +656,8 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '') } elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) { print ''; } else { + if ($fieldlist[$field] == 'date_creation') continue; + print ''; $size = ''; if ($fieldlist[$field] == 'code') $size = 'size="8" '; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f2051aebba5..9466228ebc2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1800,10 +1800,10 @@ class Form } $out .= ' data-html="'; $outhtml = ''; - if (!empty($obj->photo)) - { +// if (!empty($obj->photo)) +// { $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; - } +// } if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; $outhtml .= $labeltoshow; if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 945566408bf..629d71897aa 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -130,7 +130,7 @@ class FormActions //var_dump($selected); if ($selected == 'done') $selected = '100'; print ''; if ($selected == 0 || $selected == 100) $canedit = 0; + print ajax_combobox('select'.$htmlname); + if (empty($onlyselect)) { print ' = 0) ? '' : ' disabled').'>'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 8e25deb21cb..c30d0c3d392 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -73,8 +73,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print '
'; // Type - print ''; - print ''.$langs->trans("Type").''; + print ''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" { @@ -85,13 +84,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Assigned to print '
'; - print img_picto('', 'user', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("ActionsToDoBy").''; + print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="fawidth30 inline-block"'); print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusxx'); print '
'; print '
'; - print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("ToUserOfGroup").''; + print img_picto($langs->trans("ToUserOfGroup"), 'object_group', 'class="fawidth30 inline-block"'); print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); print '
'; @@ -102,8 +99,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Resource print '
'; - print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("Resource").''; + print img_picto($langs->trans("Resource"), 'object_resource', 'class="fawidth30 inline-block"'); print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print '
'; } @@ -112,8 +108,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print '
'; - print img_picto('', 'company', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("ThirdParty").''; + print img_picto($langs->trans("ThirdParty"), 'company', 'class="fawidth30 inline-block"'); print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); print '
'; } @@ -124,8 +119,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh $formproject = new FormProjets($db); print '
'; - print img_picto('', 'project', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("Project").''; + print img_picto($langs->trans("Project"), 'project', 'class="fawidth30 inline-block"'); print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); print '
'; } @@ -134,8 +128,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Status print '
'; - print img_picto('', 'setup', 'class="fawidth30 inline-block"'); - print ''.$langs->trans("Status").''; + print img_picto($langs->trans("Status"), 'setup', 'class="fawidth30 inline-block"'); $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); print '
'; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 05b0f1308ec..a9cb59ee596 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3414,13 +3414,13 @@ div.pagination li:first-child span { border-bottom-left-radius: 4px;*/ } -div.pagination li a:hover, -div.pagination li:not(.paginationafterarrows,.title-button) span:hover, +/*div.pagination li a:hover, +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:hover, div.pagination li a:focus, -div.pagination li:not(.paginationafterarrows,.title-button) span:focus { +div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:focus { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); -} +}*/ div.pagination li .active a, div.pagination li .active span, div.pagination li .active a:hover, diff --git a/htdocs/user/home.php b/htdocs/user/home.php index e294be6a219..b10bd9267f8 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -277,7 +277,6 @@ if ($canreadperms) } } -//print ''; print '
'; // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array From 87a12b39b0119fe6c3c035df9af66b9b2db1ebba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 19:28:49 +0100 Subject: [PATCH 010/119] Fix css --- htdocs/core/menus/standard/eldy.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a605bcbc601..4785bd0b50b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -817,7 +817,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Societes if (!empty($conf->societe->enabled)) { $langs->load("companies"); - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright"')); if ($user->rights->societe->creer) { $newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); @@ -879,7 +879,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Contacts - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts'); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright"')); + $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { From 8cbd9fc0d8b14e392ac2d24ecf537816d5e2d0ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 19:48:57 +0100 Subject: [PATCH 011/119] CSS --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 72a8ec2974d..bcddb637b68 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -658,7 +658,7 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; if ($obj->socid > 0) { // TODO Use a cache for this string print $socstatic->getNomUrl(1, ''); From 964fa7a72dd8d734ca9adcf386b5118b998226b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 20:29:57 +0100 Subject: [PATCH 012/119] Look and feel v14 --- htdocs/compta/sociales/list.php | 4 +- htdocs/core/class/html.formcategory.class.php | 3 +- htdocs/core/lib/functions.lib.php | 11 +++-- htdocs/core/menus/standard/eldy.lib.php | 46 +++++++++---------- htdocs/theme/eldy/global.inc.php | 5 ++ htdocs/theme/md/style.css.php | 5 ++ 6 files changed, 43 insertions(+), 31 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index ce65dde989b..9a691a1785f 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -148,7 +148,7 @@ if (!empty($conf->projet->enabled)) $projectstatic = new Project($db); llxHeader('', $langs->trans("SocialContributions")); -$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user, "; +$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; $sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode,"; if (!empty($conf->projet->enabled)) $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; $sql .= " c.libelle as type_label,"; @@ -185,7 +185,7 @@ if ($filtre) { if ($search_typeid) { $sql .= " AND cs.fk_type=".$db->escape($search_typeid); } -$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; +$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; if (!empty($conf->projet->enabled)) $sql .= ", p.rowid, p.ref, p.title"; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index f2f856144ff..767a064ab31 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -52,7 +52,8 @@ class FormCategory extends Form $filter = ''; $filter .= '
'; - $filter .= $langs->trans('Categories').": "; + $filter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); + //$filter .= $langs->trans('Categories').": "; $filter .= Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0, "minwidth300"); $filter .= "
"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3eaff6a539f..53a317d5789 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3266,7 +3266,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', 'help', 'holiday', - 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot', + 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', @@ -3290,7 +3290,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'supplier_invoice', 'ticket', 'error', 'warning', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', - 'supplier_proposal', 'supplier_order', 'supplier_invoice', + 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' ) )) { @@ -3308,14 +3308,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', - 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'cubes', + 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', + 'bom'=>'shapes', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', 'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', - 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', + 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'loan'=>'money-bill-alt', 'member'=>'users', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', 'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry', 'sign-out'=>'sign-out-alt', @@ -3386,7 +3387,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'order'=>'infobox-commande', 'user'=>'infobox-adherent', 'users'=>'infobox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', - 'holiday'=>'infobox-holiday', 'invoice'=>'infobox-commande', + 'holiday'=>'infobox-holiday', 'invoice'=>'infobox-commande', 'loan'=>'infobox-bank_account', 'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', 'resource'=>'infobox-action', diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4785bd0b50b..4a6c78c6249 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -707,10 +707,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $langs->load("users"); // Home - dashboard - $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', ''); + $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', ''); // Setup - $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', ''); + $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', ''); if ($usemenuhider || empty($leftmenu) || $leftmenu == "setup") { // Load translation files required by the page @@ -757,7 +757,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // System tools - $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', ''); + $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', ''); if ($usemenuhider || empty($leftmenu) || preg_match('/^admintools/', $leftmenu)) { // Load translation files required by the page $langs->loadLangs(array('admin', 'help')); @@ -791,7 +791,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } } - $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', ''); + $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); if ($user->rights->user->user->lire) { if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); @@ -817,7 +817,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Societes if (!empty($conf->societe->enabled)) { $langs->load("companies"); - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright"')); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); if ($user->rights->societe->creer) { $newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); @@ -879,7 +879,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Contacts - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright"')); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); @@ -912,7 +912,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Customer proposal if (!empty($conf->propal->enabled)) { $langs->load("propal"); - $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100); + $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { @@ -929,7 +929,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Customers orders if (!empty($conf->commande->enabled)) { $langs->load("orders"); - $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); + $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { @@ -948,7 +948,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Supplier proposal if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); - $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300); + $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer); $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->rights->supplier_proposal->lire); $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->supplier_proposal->lire); @@ -957,7 +957,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Suppliers orders if (!empty($conf->supplier_order->enabled)) { $langs->load("orders"); - $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400); + $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); @@ -982,7 +982,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Contrat if (!empty($conf->contrat->enabled)) { $langs->load("contracts"); - $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000); + $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); @@ -997,7 +997,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Interventions if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); - $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); + $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { @@ -1017,7 +1017,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Customers invoices if (!empty($conf->facture->enabled)) { $langs->load("bills"); - $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills'); + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); @@ -1042,7 +1042,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Suppliers invoices if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { $langs->load("bills"); - $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); @@ -1063,7 +1063,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->commande->enabled)) { $langs->load("orders"); if (!empty($conf->facture->enabled)) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); } @@ -1072,7 +1072,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->supplier_invoice->enabled)) { if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { $langs->load("supplier"); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); } } @@ -1081,7 +1081,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Donations if (!empty($conf->don->enabled)) { $langs->load("donations"); - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); @@ -1091,7 +1091,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Taxes and social contributions if (!empty($conf->tax->enabled)) { - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax'); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { @@ -1140,7 +1140,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Salaries if (!empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 1, $user->rights->salaries->write); $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->rights->salaries->read); @@ -1151,7 +1151,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Loan if (!empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->rights->loan->write); //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); @@ -1161,7 +1161,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Various payment if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->rights->banque->modifier); $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->rights->banque->lire); @@ -1655,7 +1655,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingrightonly pictofixedwidth"')); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom'); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); } @@ -1663,7 +1663,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->mrp->enabled)) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo'); + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingrightonly pictofixedwidth"')); $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo'); $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo'); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a9cb59ee596..48e3e2765b9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1935,6 +1935,11 @@ span.widthpictotitle.pictotitle { .tagtdnote span.pictoedit { opacity: 0.4; } +.pictofixedwidth { + text-align: left; + width: 16px; +} + .colorthumb { padding-left: 1px !important; padding-right: 1px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ae60254ea13..76fb0692af1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1866,6 +1866,11 @@ div.nopadding { img.hideonsmartphone.pictoactionview { vertical-align: bottom; } +.pictofixedwidth { + text-align: left; + width: 16px; +} + .colorthumb { padding-left: 1px !important; padding-right: 1px; From 2a48529aeac3937d53867a34a769bbb37774d923 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 20:44:38 +0100 Subject: [PATCH 013/119] Look and feel v14 --- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/salaries/card.php | 6 +++--- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/salaries/document.php | 2 +- htdocs/salaries/info.php | 2 +- htdocs/salaries/list.php | 10 ++++++---- htdocs/salaries/stats/index.php | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53a317d5789..61bf5dc87a6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3278,7 +3278,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_payment', 'object_pdf', 'object_product', 'object_propal', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', 'object_recruitmentjobposition', 'object_recruitmentcandidature', - 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', + 'object_salary', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement', 'off', 'on', 'order', @@ -3287,7 +3287,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'supplier_invoice', 'ticket', + 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'supplier_invoice', 'ticket', 'error', 'warning', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', @@ -3331,7 +3331,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'resource'=>'laptop-house', - 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uparrow'=>'mail-forward', 'vcard'=>'address-card', @@ -3391,7 +3391,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', 'resource'=>'infobox-action', - 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier', + 'salary'=>'infobox-bank_account', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier', 'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal', 'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action', //'title_setup'=>'infobox-action', 'tools'=>'infobox-action', diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4a6c78c6249..f1141140973 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1140,7 +1140,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Salaries if (!empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 1, $user->rights->salaries->write); $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->rights->salaries->read); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7fb8427a517..2fc71bec099 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -256,7 +256,7 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewSalaryPayment"), '', 'object_payment'); + print load_fiche_titre($langs->trans("NewSalaryPayment"), '', 'salary'); print dol_get_fiche_head('', ''); @@ -375,7 +375,7 @@ if ($id) { $head = salaries_prepare_head($object); - print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").''; @@ -425,7 +425,7 @@ if ($id) print '
'; print '
'; - print ''; + print '
'; // Label print ''; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 8b5bcc13920..59cf90e72e7 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -44,7 +44,7 @@ class PaymentSalary extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'payment'; + public $picto = 'salary'; public $tms; diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 6cc482f1304..dc86a274837 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -90,7 +90,7 @@ if ($object->id) $head = salaries_prepare_head($object); - print dol_get_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'salary'); // Build file list $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 9461bae867e..c7a5090072e 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -52,7 +52,7 @@ $object->info($id); $head = salaries_prepare_head($object); -print dol_get_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'payment'); +print dol_get_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 2b700108d10..119b224e76b 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -342,13 +342,15 @@ if (!empty($socid)) { } $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'salary', 0, $newcardbutton, '', $limit, 0, 0, 1); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; //$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields = ''; $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); +$moreforfilter = ''; + print '
'; print '
'.$langs->trans("Label").''.$object->label.'
'."\n"; @@ -453,9 +455,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; - $userstatic->id = $obj->uid; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; @@ -468,6 +467,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $salstatic->id = $obj->rowid; $salstatic->ref = $obj->rowid; + // Show here line of result + print ''; + // Ref print "\n"; if (!$i) { diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1f0598f4245..99b2fd9042f 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -60,7 +60,7 @@ llxHeader(); $title = $langs->trans("SalariesStatistics"); $dir = $conf->salaries->dir_temp; -print load_fiche_titre($title, '', 'object_payment'); +print load_fiche_titre($title, '', 'salary'); dol_mkdir($dir); From a4f6c2d0c610f0a5269c6005895aa221ae137af5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 22:03:58 +0100 Subject: [PATCH 014/119] More log --- htdocs/blockedlog/admin/blockedlog_list.php | 21 ++++++++++++++++---- htdocs/blockedlog/class/blockedlog.class.php | 15 +++++++++----- htdocs/core/lib/functions.lib.php | 6 ++++++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 67c6c394815..f618042c994 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -261,7 +261,7 @@ if (GETPOST('withtab', 'alpha')) llxHeader('', $langs->trans("BrowseBlockedLog")); -$MAXLINES = 10000; +$MAXLINES = 100000; $blocks = $block_static->getLog('all', 0, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) @@ -433,12 +433,18 @@ if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) { // This is version that optimize the memory (but will not report errors that are outside the filter range) $loweridinerror = 0; $checkresult = array(); + $checkdetail = array(); if (is_array($blocks)) { foreach ($blocks as &$block) { - $checksignature = $block->checkSignature(); // Note: this make a sql request at each call, we can't avoid this as the sorting order is various + $tmpcheckresult = $block->checkSignature('', 1); // Note: this make a sql request at each call, we can't avoid this as the sorting order is various + + $checksignature = $tmpcheckresult['checkresult']; + $checkresult[$block->id] = $checksignature; // false if error + $checkdetail[$block->id] = $tmpcheckresult; + if (!$checksignature) { if (empty($loweridinerror)) $loweridinerror = $block->id; @@ -488,7 +494,11 @@ if (is_array($blocks)) // Fingerprint print ''; // Status @@ -500,7 +510,6 @@ if (is_array($blocks)) } else { print img_picto($langs->trans('OkCheckFingerprintValidity'), 'statut4'); } - print ''; // Note @@ -520,6 +529,10 @@ if (is_array($blocks)) print ''; } } + + if (count($blocks) == 0) { + print ''; + } } print '
".$salstatic->getNomUrl(1)."'; - print $form->textwithpicto(dol_trunc($block->signature, '8'), $block->signature, 1, 'help', '', 0, 2, 'fingerprint'.$block->id); + $texttoshow = $langs->trans("Fingerprint").' - '.$langs->trans("Saved").':
'.$block->signature; + $texttoshow .= '

'.$langs->trans("Fingerprint").' - Recalculated sha256(previoushash * data):
'.$checkdetail[$block->id]['calculatedsignature']; + $texttoshow .= '
'.$langs->trans("PreviousHash").'='.$checkdetail[$block->id]['previoushash'].''; + //$texttoshow .= '
keyforsignature='.$checkdetail[$block->id]['keyforsignature']; + print $form->textwithpicto(dol_trunc($block->signature, '8'), $texttoshow, 1, 'help', '', 0, 2, 'fingerprint'.$block->id); print '
'.$langs->trans("NoRecordFound").'
'; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index f6402ca3b04..4e32533074a 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -840,10 +840,11 @@ class BlockedLog /** * Check if current signature still correct compared to the value in chain * - * @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database. - * @return boolean True if OK, False if KO + * @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database. + * @param int $returnarray 1=Return array of details, 0=Boolean + * @return boolean|array True if OK, False if KO */ - public function checkSignature($previoushash = '') + public function checkSignature($previoushash = '', $returnarray = 0) { if (empty($previoushash)) { @@ -852,7 +853,7 @@ class BlockedLog // Recalculate hash $keyforsignature = $this->buildKeyForSignature(); - $signature_line = dol_hash($keyforsignature, '5'); // Not really usefull + //$signature_line = dol_hash($keyforsignature, '5'); // Not really usefull $signature = dol_hash($previoushash.$keyforsignature, '5'); //var_dump($previoushash); var_dump($keyforsignature); var_dump($signature_line); var_dump($signature); @@ -862,7 +863,11 @@ class BlockedLog $this->error = 'Signature KO'; } - return $res; + if ($returnarray) { + return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature'=>$keyforsignature); + } else { + return $res; + } } /** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 61bf5dc87a6..c5b1593cbc5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3363,6 +3363,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $fakey = 'fa-'.$pictowithouttext; } + if ($pictowithouttext == 'payment') { + $fasize = '0.9em'; + } + if ($pictowithouttext == 'loan') { + $fasize = '0.95em'; + } // Define $marginleftonlyshort $arrayconvpictotomarginleftonly = array( From 55e7bcb7ab40f1835cbdb0fe35420382fcc8351b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 22:14:46 +0100 Subject: [PATCH 015/119] Set max execution time --- htdocs/blockedlog/admin/blockedlog_list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index f618042c994..3612343280a 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -73,6 +73,15 @@ $block_static = new BlockedLog($db); $result = restrictedArea($user, 'blockedlog', 0, ''); +$max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined +$max_time = @ini_get("max_execution_time"); +if ($max_time && $max_time < $max_execution_time_for_importexport) +{ + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 +} + + /* * Actions */ From 98e5a655cc0ad00ac8fc5db84fc659337af9d8a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 22:20:57 +0100 Subject: [PATCH 016/119] Fix message if not found --- htdocs/blockedlog/admin/blockedlog_list.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 3612343280a..39e0c8c3eff 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -465,6 +465,8 @@ if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) { if (is_array($blocks)) { + $nbshown = 0; + foreach ($blocks as &$block) { $object_link = $block->getObjectLink(); @@ -472,6 +474,8 @@ if (is_array($blocks)) //if (empty($search_showonlyerrors) || ! $checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) if (empty($search_showonlyerrors) || !$checkresult[$block->id]) { + $nbshown++; + print ''; // ID @@ -539,7 +543,7 @@ if (is_array($blocks)) } } - if (count($blocks) == 0) { + if ($nbshown == 0) { print ''.$langs->trans("NoRecordFound").''; } } From 42557a014860744f190fdbf70e36daca04ec671d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 23:03:09 +0100 Subject: [PATCH 017/119] Memory optimization in blockedlog module --- htdocs/blockedlog/admin/blockedlog.php | 1 + htdocs/blockedlog/admin/blockedlog_list.php | 4 +- htdocs/blockedlog/class/blockedlog.class.php | 82 ++++++++++--------- ..._modBlockedlog_ActionsBlockedLog.class.php | 1 + 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 39725eae3b7..86a563881e4 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -77,6 +77,7 @@ if (preg_match('/del_(.*)/', $action, $reg)) $form = new Form($db); $block_static = new BlockedLog($db); +$block_static->loadTrackedEvents(); llxHeader('', $langs->trans("BlockedLogSetup")); diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 39e0c8c3eff..52372b0fa94 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -68,7 +68,7 @@ if (empty($sortfield)) $sortfield = 'rowid'; if (empty($sortorder)) $sortorder = 'DESC'; $block_static = new BlockedLog($db); - +$block_static->loadTrackedEvents(); $result = restrictedArea($user, 'blockedlog', 0, ''); @@ -270,7 +270,7 @@ if (GETPOST('withtab', 'alpha')) llxHeader('', $langs->trans("BrowseBlockedLog")); -$MAXLINES = 100000; +$MAXLINES = 50000; $blocks = $block_static->getLog('all', 0, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 4e32533074a..022c86f8ad8 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -124,9 +124,17 @@ class BlockedLog */ public function __construct(DoliDB $db) { - global $conf; - $this->db = $db; + } + + + /** + * Load list of tracked events into $this->trackedevents. + * + * @return int Always 1 + */ + public function loadTrackedEvents() { + global $conf; $this->trackedevents = array(); @@ -140,15 +148,15 @@ class BlockedLog if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_DELETE'] = 'logPAYMENT_CUSTOMER_DELETE'; /* Supplier - if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; - if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_DELETE']='BlockedLogSupplierBillDelete'; - if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done - if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done - if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done + if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; + if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_DELETE']='BlockedLogSupplierBillDelete'; + if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done + if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done + if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done - if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; - if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; - */ + if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; + if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; + */ if ($conf->don->enabled) $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; if ($conf->don->enabled) $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; @@ -158,10 +166,10 @@ class BlockedLog if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_DELETE'] = 'logDONATION_PAYMENT_DELETE'; /* - if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; - if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; - if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; - */ + if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; + if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; + if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; + */ if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; @@ -176,17 +184,21 @@ class BlockedLog $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + // Add more action to track from a conf variable if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) { $tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED); foreach ($tmparrayofmoresupportedevents as $val) { $this->trackedevents[$val] = 'log'.$val; } } + + return 1; } /** - * Try to retrieve source object (it it still exists) - * @return string + * Try to retrieve source object (it it still exists). + * + * @return string URL string of source object */ public function getObjectLink() { @@ -626,31 +638,24 @@ class BlockedLog */ public function fetch($id) { - global $langs; - dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG); - if (empty($id)) { $this->error = 'BadParameter'; return -1; } - $langs->load("blockedlog"); - $sql = "SELECT b.rowid, b.date_creation, b.signature, b.signature_line, b.amounts, b.action, b.element, b.fk_object, b.entity,"; $sql .= " b.certified, b.tms, b.fk_user, b.user_fullname, b.date_object, b.ref_object, b.object_data, b.object_version"; $sql .= " FROM ".MAIN_DB_PREFIX."blockedlog as b"; - if ($id) $sql .= " WHERE b.rowid = ".$id; + if ($id) $sql .= " WHERE b.rowid = ".((int) $id); $resql = $this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); - + $obj = $this->db->fetch_object($resql); + if ($obj) { $this->id = $obj->rowid; $this->entity = $obj->entity; $this->ref = $obj->rowid; @@ -678,6 +683,7 @@ class BlockedLog return 1; } else { + $langs->load("blockedlog"); $this->error = $langs->trans("RecordNotFound"); return 0; } @@ -946,10 +952,11 @@ class BlockedLog */ public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '') { - global $conf, $cachedlogs; + global $conf; + //global $cachedlogs; /* $cachedlogs allow fastest search */ - if (empty($cachedlogs)) $cachedlogs = array(); + //if (empty($cachedlogs)) $cachedlogs = array(); if ($element == 'all') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog @@ -962,7 +969,7 @@ class BlockedLog WHERE entity=".$conf->entity." AND certified = 1"; } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND element='".$element."' AND fk_object=".(int) $fk_object; + WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."' AND fk_object=".(int) $fk_object; } if ($search_fk_user > 0) $sql .= natural_search("fk_user", $search_fk_user, 2); @@ -989,15 +996,16 @@ class BlockedLog return -2; } - if (!isset($cachedlogs[$obj->rowid])) - { - $b = new BlockedLog($this->db); - $b->fetch($obj->rowid); + //if (!isset($cachedlogs[$obj->rowid])) + //{ + $b = new BlockedLog($this->db); + $b->fetch($obj->rowid); + //$b->loadTrackedEvents(); + //$cachedlogs[$obj->rowid] = $b; + //} - $cachedlogs[$obj->rowid] = $b; - } - - $results[] = $cachedlogs[$obj->rowid]; + //$results[] = $cachedlogs[$obj->rowid]; + $results[] = $b; } return $results; diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 221c1d70846..94d64886012 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -69,6 +69,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; $b = new BlockedLog($this->db); + $b->loadTrackedEvents(); // Tracked events if (!in_array($action, array_keys($b->trackedevents))) { From d298f54abde9443ebbb568b261ee5de7985f8eb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 23:10:57 +0100 Subject: [PATCH 018/119] Another memory optimization --- htdocs/blockedlog/class/blockedlog.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 022c86f8ad8..c90f6edb165 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -847,7 +847,7 @@ class BlockedLog * Check if current signature still correct compared to the value in chain * * @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database. - * @param int $returnarray 1=Return array of details, 0=Boolean + * @param int $returnarray 1=Return array of details, 2=Return array of details including keyforsignature, 0=Boolean * @return boolean|array True if OK, False if KO */ public function checkSignature($previoushash = '', $returnarray = 0) @@ -870,8 +870,14 @@ class BlockedLog } if ($returnarray) { - return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature'=>$keyforsignature); + if ($returnarray == 1) { + unset($keyforsignature); + return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash); + } else { // Consume much memory ($keyforsignature is a large var) + return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature'=>$keyforsignature); + } } else { + unset($keyforsignature); return $res; } } From 865554bbde22b1b5ffda407cb360dfbe55326f5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 23:24:59 +0100 Subject: [PATCH 019/119] NEW Can filter on rowid in list of blocked logs. --- htdocs/blockedlog/admin/blockedlog_list.php | 7 +++++-- htdocs/blockedlog/class/blockedlog.class.php | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 52372b0fa94..62f75cc8444 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -43,6 +43,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); if ($search_showonlyerrors < 0) $search_showonlyerrors = 0; +$search_id = GETPOST('search_id', 'alpha'); $search_fk_user = GETPOST('search_fk_user', 'intcomma'); $search_start = -1; if (GETPOST('search_startyear') != '') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear')); @@ -89,6 +90,7 @@ if ($max_time && $max_time < $max_execution_time_for_importexport) // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { + $search_id = ''; $search_fk_user = ''; $search_start = -1; $search_end = -1; @@ -272,7 +274,7 @@ llxHeader('', $langs->trans("BrowseBlockedLog")); $MAXLINES = 50000; -$blocks = $block_static->getLog('all', 0, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); +$blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) { if ($blocks == -2) @@ -305,6 +307,7 @@ print '
'; $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); +if ($search_id != '') $param .= '&search_id='.urlencode($search_id); if ($search_fk_user > 0) $param .= '&search_fk_user='.urlencode($search_fk_user); if ($search_startyear > 0) $param .= '&search_startyear='.urlencode(GETPOST('search_startyear', 'int')); if ($search_startmonth > 0) $param .= '&search_startmonth='.urlencode(GETPOST('search_startmonth', 'int')); @@ -364,7 +367,7 @@ print ''; // Line of filters print ''; -print ''; +print ''; print ''; // ID @@ -497,7 +503,9 @@ if (is_array($blocks)) print ''; // Ref - print ''; + print ''; // Link to source object print ''.$object_link.''; @@ -521,10 +529,14 @@ if (is_array($blocks)) print ''; From 59faccbc60b4636933d675ca6467acedc5161fa8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 00:34:15 +0100 Subject: [PATCH 022/119] Load note_private --- htdocs/compta/paiement/class/paiement.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 2c897968320..fcc27276628 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -192,6 +192,7 @@ class Paiement extends CommonObject $this->amount = $obj->amount; $this->multicurrency_amount = $obj->multicurrency_amount; $this->note = $obj->note; + $this->note_private = $obj->note; $this->type_label = $obj->type_label; $this->type_code = $obj->type_code; $this->statut = $obj->statut; From 48be1f24d79956c9a30341343fc3059212179470 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 00:43:58 +0100 Subject: [PATCH 023/119] Reduce size required to store blockedlogs --- htdocs/blockedlog/class/blockedlog.class.php | 26 +++++++++++--------- htdocs/compta/paiement.php | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 2341f688eb0..1a2868a6a58 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -408,7 +408,7 @@ class BlockedLog 'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6', 'phone', 'fax', 'email', 'barcode', 'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $this->object_data->thirdparty->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->thirdparty->{$key} = $value; } } @@ -424,7 +424,7 @@ class BlockedLog 'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6', 'phone', 'fax', 'email', 'barcode', 'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $this->object_data->mycompany->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->mycompany->{$key} = $value; } } @@ -460,10 +460,12 @@ class BlockedLog $this->object_data->invoiceline[$lineid] = new stdClass(); } - $this->object_data->invoiceline[$lineid]->{$keyline} = $valueline; + if (!is_object($valueline) && !is_null($valueline) && $valueline !== '') { + $this->object_data->invoiceline[$lineid]->{$keyline} = $valueline; + } } } - } elseif (!is_object($value)) $this->object_data->{$key} = $value; + } elseif (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->{$key} = $value; } if (!empty($object->newref)) $this->object_data->ref = $object->newref; @@ -475,7 +477,7 @@ class BlockedLog if (!in_array($key, array( 'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $this->object_data->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->{$key} = $value; } if (!empty($object->newref)) $this->object_data->ref = $object->newref; @@ -487,9 +489,10 @@ class BlockedLog $this->object_data->ref = $object->ref; $this->object_data->date = $datepayment; $this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code'); - $this->object_data->payment_num = $object->num_payment; + + if (!empty($object->num_payment)) $this->object_data->payment_num = $object->num_payment; + if (!empty($object->note_private)) $this->object_data->note_private = $object->note_private; //$this->object_data->fk_account = $object->fk_account; - $this->object_data->note = $object->note; //var_dump($this->object_data);exit; $totalamount = 0; @@ -567,7 +570,7 @@ class BlockedLog 'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6', 'phone', 'fax', 'email', 'barcode', 'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $paymentpart->thirdparty->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $paymentpart->thirdparty->{$key} = $value; } } @@ -583,8 +586,7 @@ class BlockedLog if (!in_array($key, array( 'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) - { + if (!is_object($value) && !is_null($value) && $value !== '') { if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value; elseif ($this->element == 'payment_various') $paymentpart->various->{$key} = $value; else $paymentpart->invoice->{$key} = $value; @@ -612,7 +614,7 @@ class BlockedLog if (!in_array($key, array( 'id', 'datec', 'dateh', 'datef', 'fk_adherent', 'amount', 'import_key', 'statut', 'note' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $this->object_data->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->{$key} = $value; } if (!empty($object->newref)) $this->object_data->ref = $object->newref; @@ -621,7 +623,7 @@ class BlockedLog foreach ($object as $key=>$value) { if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties - if (!is_object($value)) $this->object_data->{$key} = $value; + if (!is_object($value) && !is_null($value) && $value !== '') $this->object_data->{$key} = $value; } if (!empty($object->newref)) $this->object_data->ref = $object->newref; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 83393a52cb6..b8bd1b6c564 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -373,6 +373,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie function setPaiementCode() { var code = $("#selectpaiementcode option:selected").val(); + console.log("setPaiementCode code="+code); if (code == \'CHQ\' || code == \'VIR\') { From 49470ea21610b23e8a1829502cb1111afef86c45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 00:56:44 +0100 Subject: [PATCH 024/119] Trans --- htdocs/langs/en_US/blockedlog.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index 0bba5605d0f..44cb183050a 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -8,7 +8,7 @@ BrowseBlockedLog=Unalterable logs ShowAllFingerPrintsMightBeTooLong=Show all archived logs (might be long) ShowAllFingerPrintsErrorsMightBeTooLong=Show all non-valid archive logs (might be long) DownloadBlockChain=Download fingerprints -KoCheckFingerprintValidity=Archived log entry is not valid. It means someone (a hacker?) has modified some data of this record after it was recorded, or has erased the previous archived record (check that line with previous # exists). +KoCheckFingerprintValidity=Archived log entry is not valid. It means someone (a hacker?) has modified some data of this record after it was recorded, or has erased the previous archived record (check that line with previous # exists) or has modified checksum of the previous record. OkCheckFingerprintValidity=Archived log record is valid. The data on this line was not modified and the entry follows the previous one. OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to previous one but the chain was corrupted previously. AddedByAuthority=Stored into remote authority From 3006cf770c696654456846c54578a57a7aa50856 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 01:06:59 +0100 Subject: [PATCH 025/119] FIX Timeout during import --- htdocs/imports/import.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index c6e2e282778..8cd1b826ab0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1545,6 +1545,14 @@ if ($step == 5 && $datatoimport) } else { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); From 1b559355776147798eceec97db55976bd39a02b7 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 5 Feb 2021 10:39:46 +0100 Subject: [PATCH 026/119] Add critical price patch from 12 to 11. --- htdocs/product/price.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 3f6a89cbddb..c364cd464fc 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1442,11 +1442,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul // Il doit au moins y avoir la ligne de prix initial. // On l'ajoute donc pour remettre a niveau (pb vieilles versions) //$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1); - } else { - $object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); - } + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1); + } else { + $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min)); + } $result = $db->query($sql); $num = $db->num_rows($result); From 54be4f282b59f879d38d7d3be2fde43e41e0224b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 10:56:33 +0100 Subject: [PATCH 027/119] Fix bad function name --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index c95f3e3c1c3..e070633c7af 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -933,7 +933,7 @@ $companystatic = new Societe($db); $invoicerectmp = new FactureRec($db); $now = dol_now(); -$nowlasthour = dol_last_hour($now); +$nowlasthour = dol_get_last_hour($now); /* From 3f862bf43ee33cfc16ce7a193312efcebae092a9 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 5 Feb 2021 11:34:39 +0100 Subject: [PATCH 028/119] FIX 10.0 - before crediting a withdrawal receipt, check whether it has been credited already --- htdocs/compta/prelevement/card.php | 44 ++++++++++++++++++----------- htdocs/langs/en_US/withdrawals.lang | 1 + htdocs/langs/fr_FR/withdrawals.lang | 1 + 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index bf95a35f1fd..1e3f1f49d23 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -85,16 +85,21 @@ if (empty($reshook)) } } - // Seems to no be used and replaced with $action == 'infocredit' - if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') - { - $res=$object->set_credite(); - if ($res >= 0) - { - header("Location: card.php?id=".$id); - exit; - } - } + // Seems to no be used and replaced with $action == 'infocredit' + if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') + { + if ($object->statut == 2) { + $res = -1; + setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors'); + } else { + $res=$object->set_credite(); + } + if ($res >= 0) + { + header("Location: card.php?id=".$id); + exit; + } + } if ($action == 'infotrans' && $user->rights->prelevement->bons->send) { @@ -135,14 +140,19 @@ if (empty($reshook)) { $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $error = $object->set_infocredit($user, $dt); + if ($object->statut == 2) { + $error = 1; + setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors'); + } else { + $error = $object->set_infocredit($user, $dt); + } - if ($error) - { - header("Location: card.php?id=".$id."&error=$error"); - exit; - } - } + if ($error) + { + header("Location: card.php?id=".$id."&error=$error"); + exit; + } + } } diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index cbca2b2f103..45cf89c8592 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -27,6 +27,7 @@ MakeWithdrawRequest=Make a direct debit payment request WithdrawRequestsDone=%s direct debit payment requests recorded ThirdPartyBankCode=Third-party bank code NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode %s. +WithdrawalCantBeCreditedTwice=This withdrawal receipt is already marked as credited; this can't be done twice, as this would potentially create duplicate payments and bank entries. ClassCredited=Classify credited ClassCreditedConfirm=Are you sure you want to classify this withdrawal receipt as credited on your bank account? TransData=Transmission date diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index 468cdd8b9f3..ea8fadeedba 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -27,6 +27,7 @@ MakeWithdrawRequest=Faire une demande de prélèvement WithdrawRequestsDone=%s demandes de prélèvements enregistrées ThirdPartyBankCode=Code banque du tiers NoInvoiceCouldBeWithdrawed=Aucune facture traitée avec succès. Vérifiez que les factures sont sur les sociétés avec un BAN par défaut valide et que le BAN a un RUM avec le mode %s . +WithdrawalCantBeCreditedTwice=Ce bon de prélèvement est déjà classé crédité ; cette opération ne peut pas être réalisée deux fois, car cela pourrait engendrer des doublons dans les paiements et les écritures bancaires. ClassCredited=Classer crédité ClassCreditedConfirm=Êtes-vous sûr de vouloir classer ce bon de prélèvement comme crédité sur votre compte bancaire ? TransData=Date de transmission From cdd2c165ef4b706091d0793348a4534524140d28 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 5 Feb 2021 11:36:12 +0100 Subject: [PATCH 029/119] add missing hook addMoreActionsButtons in viewcat.php --- htdocs/categories/viewcat.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 958b77e42e8..5ad45f6b420 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -269,16 +269,19 @@ dol_fiche_end(); */ print "
\n"; +$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if (empty($reshook)) { + if ($user->rights->categorie->creer) + { + $socid = ($object->socid ? "&socid=".$object->socid : ""); + print "".$langs->trans("Modify").""; + } -if ($user->rights->categorie->creer) -{ - $socid = ($object->socid ? "&socid=".$object->socid : ""); - print "".$langs->trans("Modify").""; -} - -if ($user->rights->categorie->supprimer) -{ - print "".$langs->trans("Delete").""; + if ($user->rights->categorie->supprimer) + { + print "".$langs->trans("Delete").""; + } } print "
"; From c441b54521fc83e965852346fe82c055e292cacd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 12:07:39 +0100 Subject: [PATCH 030/119] NEW If not logo defined, can use squarred logo on login page --- htdocs/compta/facture/card-rec.php | 4 +++- htdocs/compta/facture/prelevement.php | 2 ++ htdocs/core/lib/functions.lib.php | 7 ++---- htdocs/core/lib/security2.lib.php | 11 ++++----- htdocs/core/tpl/contacts.tpl.php | 33 ++++++++++++++------------- htdocs/core/tpl/login.tpl.php | 6 ++--- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e070633c7af..a1471f48482 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1245,7 +1245,9 @@ if ($action == 'create') print '
 '; //print $langs->trans("from").': '; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index c90f6edb165..2341f688eb0 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -975,9 +975,10 @@ class BlockedLog WHERE entity=".$conf->entity." AND certified = 1"; } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."' AND fk_object=".(int) $fk_object; + WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."'"; } + if ($fk_object) $sql .= natural_search("rowid", $fk_object, 1); if ($search_fk_user > 0) $sql .= natural_search("fk_user", $search_fk_user, 2); if ($search_start > 0) $sql .= " AND date_creation >= '".$this->db->idate($search_start)."'"; if ($search_end > 0) $sql .= " AND date_creation <= '".$this->db->idate($search_end)."'"; From 4a2f26415e819c563e91847779cff10cf644a4e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Feb 2021 23:36:41 +0100 Subject: [PATCH 020/119] Fix GETPOST accept < if followed with a number --- htdocs/core/lib/functions.lib.php | 4 ++-- test/phpunit/SecurityTest.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 99a66a9a682..b1129dcfb4f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5786,8 +5786,8 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = // Example of $temp: 0000-021 $temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: 0000-021 $temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021 - // removed '<' into non closing html tags like 'objnotdefined\''; $_POST["param11"]=' Name '; @@ -371,6 +373,14 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($_POST['param8c'], $result, 'Test a string with non closing html tag with alphanohtml'); + $result=GETPOST("param8d", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('abc123 is html to clean', $result, 'Test a string with non closing html tag with alphanohtml'); + + $result=GETPOST("param8e", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals($_POST['param8e'], $result, 'Test a string with non closing html tag with alphanohtml'); + $result=GETPOST("param9", 'alphanohtml'); print __METHOD__." result=".$result."\n"; $this->assertEquals($_POST["param9"], $result); From 12454221ff21575108e1d223a96751dd1c290c55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 00:04:44 +0100 Subject: [PATCH 021/119] Optimize output --- htdocs/blockedlog/admin/blockedlog_list.php | 26 +++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 62f75cc8444..8f7b209cc6e 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -272,7 +272,7 @@ if (GETPOST('withtab', 'alpha')) llxHeader('', $langs->trans("BrowseBlockedLog")); -$MAXLINES = 50000; +$MAXLINES = 10000; $blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) @@ -469,16 +469,22 @@ if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) { if (is_array($blocks)) { $nbshown = 0; + $MAXFORSHOWLINK = 100; + $object_link = ''; foreach ($blocks as &$block) { - $object_link = $block->getObjectLink(); - //if (empty($search_showonlyerrors) || ! $checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) if (empty($search_showonlyerrors) || !$checkresult[$block->id]) { $nbshown++; + if ($nbshown < $MAXFORSHOWLINK) { // For performance and memory purpose, we get/show the link of objects only for the 100 first output + $object_link = $block->getObjectLink(); + } else { + $object_link = $block->element.'/'.$block->fk_object; + } + print '
'.$langs->trans('log'.$block->action).''.$block->ref_object.''; + print $block->ref_object; + print ''; if (!$checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) // If error { - if ($checkresult[$block->id]) print img_picto($langs->trans('OkCheckFingerprintValidityButChainIsKo'), 'statut4'); - else print img_picto($langs->trans('KoCheckFingerprintValidity'), 'statut8'); + if ($checkresult[$block->id]) { + print 'OK'; + } + else { + print 'KO'; + } } else { - print img_picto($langs->trans('OkCheckFingerprintValidity'), 'statut4'); + print 'OK'; } print '
'; - print '"; + print '"; print ''; print ''; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index d50813cbea4..26bab3c1984 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -287,7 +287,9 @@ if ($object->id > 0) // Type print ''; +} + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); From df67de08b143fffb692ef41015b470f695f5fc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:16:07 +0100 Subject: [PATCH 062/119] modules can add prefix for menu --- htdocs/core/class/menubase.class.php | 46 +++++++++++-------- htdocs/core/modules/DolibarrModules.class.php | 1 + .../install/mysql/migration/13.0.0-14.0.0.sql | 2 + htdocs/install/mysql/tables/llx_menu.sql | 9 ++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 8695ef88ef4..a31c5245ce0 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -111,6 +111,11 @@ class Menubase */ public $title; + /** + * @var string Prefix + */ + public $prefix; + /** * @var string Lang file to load for translation */ @@ -248,6 +253,7 @@ class Menubase $sql .= "url,"; $sql .= "target,"; $sql .= "titre,"; + $sql .= "prefix,"; $sql .= "langs,"; $sql .= "perms,"; $sql .= "enabled,"; @@ -266,6 +272,7 @@ class Menubase $sql .= " '".$this->db->escape($this->url)."',"; $sql .= " '".$this->db->escape($this->target)."',"; $sql .= " '".$this->db->escape($this->title)."',"; + $sql .= " '".$this->db->escape($this->prefix)."',"; $sql .= " '".$this->db->escape($this->langs)."',"; $sql .= " '".$this->db->escape($this->perms)."',"; $sql .= " '".$this->db->escape($this->enabled)."',"; @@ -319,6 +326,7 @@ class Menubase $this->url = trim($this->url); $this->target = trim($this->target); $this->title = trim($this->title); + $this->prefix = trim($this->prefix); $this->langs = trim($this->langs); $this->perms = trim($this->perms); $this->enabled = trim($this->enabled); @@ -341,6 +349,7 @@ class Menubase $sql .= " url='".$this->db->escape($this->url)."',"; $sql .= " target='".$this->db->escape($this->target)."',"; $sql .= " titre='".$this->db->escape($this->title)."',"; + $sql .= " prefix='".$this->db->escape($this->prefix)."',"; $sql .= " langs='".$this->db->escape($this->langs)."',"; $sql .= " perms='".$this->db->escape($this->perms)."',"; $sql .= " enabled='".$this->db->escape($this->enabled)."',"; @@ -385,6 +394,7 @@ class Menubase $sql .= " t.url,"; $sql .= " t.target,"; $sql .= " t.titre as title,"; + $sql .= " t.prefix,"; $sql .= " t.langs,"; $sql .= " t.perms,"; $sql .= " t.enabled,"; @@ -416,6 +426,7 @@ class Menubase $this->url = $obj->url; $this->target = $obj->target; $this->title = $obj->title; + $this->prefix = $obj->prefix; $this->langs = $obj->langs; $this->perms = $obj->perms; $this->enabled = str_replace("\"", "'", $obj->enabled); @@ -505,8 +516,7 @@ class Menubase $leftmenu = $myleftmenu; // To export to dol_eval function $newTabMenu = array(); - foreach ($tabMenu as $val) - { + foreach ($tabMenu as $val) { if ($val['type'] == 'top') $newTabMenu[] = $val; } @@ -554,15 +564,13 @@ class Menubase // Now complete $this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu) foreach ($tabMenu as $key => $val) { - //var_dump($tabMenu); if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu { //print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].'
'; //var_dump($this->newmenu->liste);exit; - if (empty($val['fk_leftmenu'])) - { - $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position']); + if (empty($val['fk_leftmenu'])) { + $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position'], '', '', '', $val['prefix']); //var_dump($this->newmenu->liste); } else { // Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu) @@ -579,8 +587,7 @@ class Menubase break; } } - if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu']) - { + if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu']) { //print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).'
'; // Now we look to find last subelement of this parent (we add at end) $searchlastsub = ($valparent['level'] + 1); @@ -589,8 +596,9 @@ class Menubase } } //print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.'
'; - if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position']); - else { + if ($found) { + $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position'], '', '', '', $val['prefix']); + } else { dol_syslog("Error. Modules ".$val['module']." has defined a menu entry with a parent='fk_mainmenu=".$val['fk_leftmenu'].",fk_leftmenu=".$val['fk_leftmenu']."' and position=".$val['position'].'. The parent was not found. May be you forget it into your definition of menu, or may be the parent has a "position" that is after the child (fix field "position" of parent or child in this case).', LOG_WARNING); //print "Parent menu not found !!
"; } @@ -620,7 +628,7 @@ class Menubase $mainmenu = $mymainmenu; // To export to dol_eval function $leftmenu = $myleftmenu; // To export to dol_eval function - $sql = "SELECT m.rowid, m.type, m.module, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.url, m.titre, m.langs, m.perms, m.enabled, m.target, m.mainmenu, m.leftmenu, m.position"; + $sql = "SELECT m.rowid, m.type, m.module, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.url, m.titre, m.prefix, m.langs, m.perms, m.enabled, m.target, m.mainmenu, m.leftmenu, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql .= " WHERE m.entity IN (0,".$conf->entity.")"; $sql .= " AND m.menu_handler IN ('".$this->db->escape($menu_handler)."','all')"; @@ -700,12 +708,15 @@ class Menubase $tabMenu[$b]['module'] = $menu['module']; $tabMenu[$b]['fk_menu'] = $menu['fk_menu']; $tabMenu[$b]['url'] = $menu['url']; - if (!preg_match("/^(http:\/\/|https:\/\/)/i", $tabMenu[$b]['url'])) - { - if (preg_match('/\?/', $tabMenu[$b]['url'])) $tabMenu[$b]['url'] .= '&idmenu='.$menu['rowid']; - else $tabMenu[$b]['url'] .= '?idmenu='.$menu['rowid']; + if (!preg_match("/^(http:\/\/|https:\/\/)/i", $tabMenu[$b]['url'])) { + if (preg_match('/\?/', $tabMenu[$b]['url'])) { + $tabMenu[$b]['url'] .= '&idmenu='.$menu['rowid']; + } else { + $tabMenu[$b]['url'] .= '?idmenu='.$menu['rowid']; + } } $tabMenu[$b]['titre'] = $title; + $tabMenu[$b]['prefix'] = $menu['prefix']; $tabMenu[$b]['target'] = $menu['target']; $tabMenu[$b]['mainmenu'] = $menu['mainmenu']; $tabMenu[$b]['leftmenu'] = $menu['leftmenu']; @@ -750,9 +761,8 @@ class Menubase for ($x = 0; $x < $num; $x++) { //si un element a pour pere : $pere - if ((($tab[$x]['fk_menu'] >= 0 && $tab[$x]['fk_menu'] == $pere)) && $tab[$x]['enabled']) - { - $this->newmenu->add($tab[$x]['url'], $tab[$x]['titre'], ($level - 1), $tab[$x]['perms'], $tab[$x]['target'], $tab[$x]['mainmenu'], $tab[$x]['leftmenu']); + if ((($tab[$x]['fk_menu'] >= 0 && $tab[$x]['fk_menu'] == $pere)) && $tab[$x]['enabled']) { + $this->newmenu->add($tab[$x]['url'], $tab[$x]['titre'], ($level - 1), $tab[$x]['perms'], $tab[$x]['target'], $tab[$x]['mainmenu'], $tab[$x]['leftmenu'], 0, '', '', '', $tab[$x]['prefix']); $this->recur($tab, $tab[$x]['rowid'], ($level + 1)); } } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index cfcb85054d2..0903e5f3b3c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1869,6 +1869,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : ''); $menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : ''; $menu->title = $this->menu[$key]['titre']; + $menu->prefix = $this->menu[$key]['prefix']; $menu->url = $this->menu[$key]['url']; $menu->langs = $this->menu[$key]['langs']; $menu->position = $this->menu[$key]['position']; 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 bfdecd334b7..99fa0263f22 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 @@ -121,4 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL; + ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 9cff110981a..956a9638102 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -30,17 +30,18 @@ CREATE TABLE llx_menu mainmenu varchar(100) NOT NULL, -- Name family/module for top menu (home, companies, ...) leftmenu varchar(100) NULL, -- Name family/module for left menu (setup, info, ...) fk_menu integer NOT NULL, -- 0 or Id of mother menu line, or -1 if we use fk_mainmenu and fk_leftmenu - fk_mainmenu varchar(100), -- - fk_leftmenu varchar(100), -- + fk_mainmenu varchar(100), -- + fk_leftmenu varchar(100), -- position integer NOT NULL, -- Sort order of entry url varchar(255) NOT NULL, -- Relative (or absolute) url to go target varchar(100) NULL, -- Target of Url link - titre varchar(255) NOT NULL, -- Key for menu translation + titre varchar(255) NOT NULL, -- Key for menu translation + prefix varchar(255) NOT NULL, -- prefix langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. perms text, -- Condition to show enabled or disabled enabled text NULL, -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - + ) ENGINE=innodb; From 38863200f21eca359d988ef1dda895fb39039381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:20:35 +0100 Subject: [PATCH 063/119] modules can add prefix for menu --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 99fa0263f22..b3d61af08f7 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 @@ -121,6 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); -ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL; +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; From 874c60035f434a359177ff57f394b4f68792d0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:23:17 +0100 Subject: [PATCH 064/119] modules can add prefix for menu --- htdocs/install/mysql/tables/llx_menu.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 956a9638102..14c36e3a049 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -43,5 +43,4 @@ CREATE TABLE llx_menu enabled text NULL, -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - ) ENGINE=innodb; From b2ea91e0cc52c26b2ddeb8b87623a6e7ad442bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:46:15 +0100 Subject: [PATCH 065/119] prefix can be null --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_menu.sql | 2 +- 2 files changed, 2 insertions(+), 2 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 b3d61af08f7..f12cd42e028 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 @@ -121,6 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); -ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL AFTER titre; +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 14c36e3a049..52b576411cb 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -36,7 +36,7 @@ CREATE TABLE llx_menu url varchar(255) NOT NULL, -- Relative (or absolute) url to go target varchar(100) NULL, -- Target of Url link titre varchar(255) NOT NULL, -- Key for menu translation - prefix varchar(255) NOT NULL, -- prefix + prefix varchar(255) NULL, -- prefix langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. perms text, -- Condition to show enabled or disabled From b487644cb76739ff8da5ac8af22ea696f07d571f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:52:03 +0100 Subject: [PATCH 066/119] sample use for margin module --- htdocs/core/modules/modMargin.class.php | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 3051b68f570..e62e97363c6 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -104,18 +104,20 @@ class modMargin extends DolibarrModules // left menu entry $this->menu[$r] = array( - 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu - 'type'=>'left', // This is a Top menu entry - 'titre'=>'Margins', - 'mainmenu'=>'billing', - 'leftmenu'=>'margins', - 'url'=>'/margin/index.php', - 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu + 'type'=>'left', // This is a Top menu entry + 'titre'=>'Margins', + 'prefix' => '', + 'mainmenu'=>'billing', + 'leftmenu'=>'margins', + 'url'=>'/margin/index.php', + 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>100, + 'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. + 'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; // Permissions From 3dedd81f37dff55c76184d3d43af53d9cc9be2fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 11:56:27 +0100 Subject: [PATCH 067/119] Same width for all picto of menu --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/modules/DolibarrModules.class.php | 14 ++++++-------- htdocs/core/modules/modMargin.class.php | 2 +- htdocs/install/upgrade2.php | 1 + htdocs/theme/eldy/global.inc.php | 3 ++- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a5cb588eff..ae4c843dad8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3267,7 +3267,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', 'help', 'holiday', 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', - 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', + 'margin', 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', @@ -3364,7 +3364,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$pictowithouttext; } if (in_array($pictowithouttext, array('payment', 'loan'))) { - $fasize = '0.85em'; + $fasize = '0.80em'; } // Define $marginleftonlyshort diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 0903e5f3b3c..da1e64ac56e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -353,15 +353,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Enables a module. - * Inserts all informations into database + * Inserts all informations into database. * - * @param array $array_sql SQL requests to be executed when enabling module - * @param string $options String with options when disabling module: - * - 'noboxes' = Do not insert boxes - - * 'newboxdefonly' = For boxes, insert def of - * boxes only and not boxes activation - * - * @return int 1 if OK, 0 if KO + * @param array $array_sql SQL requests to be executed when enabling module + * @param string $options String with options when disabling module: + * - 'noboxes' = Do not insert boxes + * - 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation + * @return int 1 if OK, 0 if KO */ protected function _init($array_sql, $options = '') { diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index e62e97363c6..7a84b401b59 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -107,7 +107,7 @@ class modMargin extends DolibarrModules 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu 'type'=>'left', // This is a Top menu entry 'titre'=>'Margins', - 'prefix' => '', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'billing', 'leftmenu'=>'margins', 'url'=>'/margin/index.php', diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 708d8834123..07c68a498b2 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -477,6 +477,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', + 'MAIN_MODULE_MARGIN'=>'menuonly', 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly', 'MAIN_MODULE_PAYBOX'=>'newboxdefonly', 'MAIN_MODULE_PRINTING'=>'newboxdefonly', diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 48e3e2765b9..83bb7365109 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1937,7 +1937,8 @@ span.widthpictotitle.pictotitle { } .pictofixedwidth { text-align: left; - width: 16px; + width: 18px; + padding-right: 0; } .colorthumb { From 7b72ac5a7a151f3e34b6b7d1a9ba2bad73753091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 12:10:27 +0100 Subject: [PATCH 068/119] Look and feel v14 --- htdocs/comm/action/index.php | 4 ++-- htdocs/core/lib/functions.lib.php | 5 ++++- htdocs/theme/eldy/global.inc.php | 10 ++++++++++ htdocs/theme/md/style.css.php | 11 +++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5396454667b..e969351c41e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1231,11 +1231,11 @@ if (empty($action) || $action == 'show_month') // View by month print '
'.$langs->trans("Author").''.$author->getFullName($langs)."
'.$langs->trans("Author").''; + print $author->getNomUrl(-1); + print "
'.$langs->trans("AmountHT").''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Type').''; + print ''; print $object->getLibType(); + print ''; if ($object->module_source) { print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f4666c37dc8..2a5cb588eff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3363,11 +3363,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $fakey = 'fa-'.$pictowithouttext; } - if ($pictowithouttext == 'payment') { - $fasize = '0.9em'; - } - if ($pictowithouttext == 'loan') { - $fasize = '0.95em'; + if (in_array($pictowithouttext, array('payment', 'loan'))) { + $fasize = '0.85em'; } // Define $marginleftonlyshort diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index fefe0aa19d5..3527d132cde 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -219,15 +219,14 @@ if (!function_exists('dol_loginfunction')) $width = 0; $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) - { + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) - { + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) - { + } elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index a1abc3a9240..e3c45b788c6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -82,9 +82,8 @@ if ($permission) ?>
-
trans("NatureOfContact"); ?>
trans("ThirdParty"); ?>
-
trans("Users").'/'.$langs->trans("Contacts"); ?>
+
trans("Users").' | '.$langs->trans("Contacts"); ?>
trans("ContactType"); ?>
 
 
@@ -96,14 +95,15 @@ if ($permission) { ?> " /> - - - + + + + '; ?> -
trans("Users"); ?>
+
global->MAIN_INFO_SOCIETE_NOM; ?>
-
select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?>
+ +
select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?>
" /> - - - + + + + '; ?> -
trans("ThirdPartyContacts"); ?>
+
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
+
selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp'); + print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp'); $nbofcontacts = $form->num; $newcardbutton = ''; @@ -277,9 +278,9 @@ print ''; //print ''; print ''; -print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty_name", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder); +print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "statut", "", $param, "", $sortfield, $sortorder, 'center '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch '); @@ -289,9 +290,9 @@ foreach ($list as $entry) { print ''; - print ''; print ''; print ''; + print ''; print ''; print ''; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 821b423aab3..7934bb58009 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2013 Laurent Destailleur +/* Copyright (C) 2009-2015 Regis Houssin + * Copyright (C) 2011-2021 Laurent Destailleur * * 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 @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -// Need global variable $title to be defined by caller (like dol_loginfunction) +// Need global variable $urllogo, $title and $titletruedolibarrversion to be defined by caller (like dol_loginfunction in security2.lib.php) // Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...); From 70c9788a8bf97fb3850dcebe7fe6938238851a26 Mon Sep 17 00:00:00 2001 From: werewolf7160 <31860486+werewolf7160@users.noreply.github.com> Date: Fri, 5 Feb 2021 12:44:55 +0100 Subject: [PATCH 031/119] call to createCommon() return int and not bool with generated Object, the post request call to createCommon() in it and taht function return a int (id or -1 if error). but the test on the returned value is a '!', that don't return false on "-1". a post request with an sql error for example(foreign key error for my test), will always return 200 instead of 500 with the error --- htdocs/modulebuilder/template/class/api_mymodule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 05ca7f27d16..2e04e34dcac 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -203,7 +203,7 @@ class MyModuleApi extends DolibarrApi foreach ($request_data as $field => $value) { $this->myobject->$field = $value; } - if (!$this->myobject->create(DolibarrApiAccess::$user)) { + if ($this->myobject->create(DolibarrApiAccess::$user)<0) { throw new RestException(500, "Error creating MyObject", array_merge(array($this->myobject->error), $this->myobject->errors)); } return $this->myobject->id; From 245fd6168d42b5c9ba36d01d6f8aa21850bdc22b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:11:34 +0100 Subject: [PATCH 032/119] Move text into tab --- htdocs/admin/modules.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 78f06b0ee2e..e6a85894fc4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -472,22 +472,22 @@ if ($nbofactivatedmodules <= 1) { print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page +$deschelp = ''; if ($mode == 'common' || $mode == 'commonkanban') { $desc = $langs->trans("ModulesDesc", '{picto}'); $desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc); - print ''.$desc."

\n"; + $deschelp = ''.$desc."

\n"; } if ($mode == 'marketplace') { - print ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; } if ($mode == 'deploy') { - print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; + $deschelp = ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; } if ($mode == 'develop') { - print ''.$langs->trans("ModulesDevelopDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesDevelopDesc")."

\n"; } - $head = modules_prepare_head(); @@ -512,6 +512,8 @@ if ($mode == 'common' || $mode == 'commonkanban') { print dol_get_fiche_head($head, 'modules', '', -1); + print $deschelp; + $moreforfilter = '
'; $moreforfilter .= ''; } else { - $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined - $max_time = @ini_get("max_execution_time"); - if ($max_time && $max_time < $max_execution_time_for_importexport) - { - dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); - @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 - } - // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); @@ -1603,8 +1603,10 @@ if ($step == 5 && $datatoimport) // Show OK if (!count($arrayoferrors) && !count($arrayofwarnings)) { print '
'.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'


'; + print '
'; print $langs->trans("NbInsert", $obj->nbinsert).'
'; print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print '
'; } else print $langs->trans("NbOfLinesOK", $nbok).'

'; // Show Errors @@ -1692,9 +1694,17 @@ if ($step == 5 && $datatoimport) // STEP 6: Real import if ($step == 6 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); - $importid = $_REQUEST["importid"]; + $importid = GETPOST("importid", 'alphanohtml'); // Create classe to use for import @@ -1970,12 +1980,14 @@ if ($step == 6 && $datatoimport) // Show result print '
'; - print '
'; + print '
'; print $langs->trans("NbOfLinesImported", $nbok).'
'; print $langs->trans("NbInsert", $obj->nbinsert).'
'; print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print '
'; + print '
'; print $langs->trans("FileWasImported", $importid).'
'; - print $langs->trans("YouCanUseImportIdToFindRecord", $importid).'
'; + print ''.$langs->trans("YouCanUseImportIdToFindRecord", $importid).'
'; print '
'; } From e9fa5a647d9bf66dd0ac3f6103cb3c5be9602d85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:35:10 +0100 Subject: [PATCH 034/119] Fix import --- htdocs/imports/import.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 8cd1b826ab0..0ad5bbd7873 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1269,6 +1269,14 @@ if ($step == 4 && $datatoimport) // STEP 5: Summary of choices and launch simulation if ($step == 5 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); @@ -1545,14 +1553,6 @@ if ($step == 5 && $datatoimport) } else { - $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined - $max_time = @ini_get("max_execution_time"); - if ($max_time && $max_time < $max_execution_time_for_importexport) - { - dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); - @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 - } - // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); @@ -1726,6 +1726,14 @@ if ($step == 5 && $datatoimport) // STEP 6: Real import if ($step == 6 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); $importid = $_REQUEST["importid"]; From 2851bac0af27a92f717cf849f09c6d2b8a834bfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:46:20 +0100 Subject: [PATCH 035/119] Fix param urlencode --- htdocs/core/class/html.formactions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 629d71897aa..0cccbe6ad8c 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -204,7 +204,7 @@ class FormActions $newcardbutton = ''; if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'), 'tzuser').'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } From dbfeba661d47f9b130aaf370e5c20cb4294c45b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:51:54 +0100 Subject: [PATCH 036/119] Fix value show 0 if empty --- htdocs/imports/import.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 6921db8ce99..344ede7d0cd 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1604,8 +1604,8 @@ if ($step == 5 && $datatoimport) if (!count($arrayoferrors) && !count($arrayofwarnings)) { print '
'.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'


'; print '
'; - print $langs->trans("NbInsert", $obj->nbinsert).'
'; - print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; + print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'

'; print '
'; } else print $langs->trans("NbOfLinesOK", $nbok).'

'; @@ -1982,8 +1982,8 @@ if ($step == 6 && $datatoimport) print '
'; print '
'; print $langs->trans("NbOfLinesImported", $nbok).'
'; - print $langs->trans("NbInsert", $obj->nbinsert).'
'; - print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; + print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'

'; print '
'; print '
'; print $langs->trans("FileWasImported", $importid).'
'; From 7278a8c17f88a574ed5bc1d7a6939ea989b90185 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:07:07 +0100 Subject: [PATCH 037/119] Fix autoselect of category with 'auto' --- htdocs/categories/card.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index feca9c4f204..74e16f9082d 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl); if ($user->rights->categorie->creer) { // Create or add - if ($action == 'create' || $_POST["addcat"] == 'addcat') + if ($action == 'create' || GETPOST("addcat") == 'addcat') { dol_set_focus('#label'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9466228ebc2..e7183d4373e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4249,7 +4249,7 @@ class Form $output .= ''; foreach ($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) + if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1)) { $add = 'selected '; } else { From 653fa38b061875d9a7411f6ce1b77e36e16d72f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:07:07 +0100 Subject: [PATCH 038/119] Fix autoselect of category with 'auto' --- htdocs/categories/card.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index feca9c4f204..74e16f9082d 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl); if ($user->rights->categorie->creer) { // Create or add - if ($action == 'create' || $_POST["addcat"] == 'addcat') + if ($action == 'create' || GETPOST("addcat") == 'addcat') { dol_set_focus('#label'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2482795147a..0348a01de3f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4174,7 +4174,7 @@ class Form $output .= ''; foreach ($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) + if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1)) { $add = 'selected '; } else { From 9843e79bace6ac633a2feeb8293337d49814e158 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:43:03 +0100 Subject: [PATCH 039/119] Trans --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cc10b054606..f5770bad737 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -444,8 +444,8 @@ ExtrafieldParamHelpPassword=Leaving this field blank means this value will be st ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
code3,value3
...

In order to have the list depending on another complementary attribute list:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

In order to have the list depending on another list:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... -ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

- id_field is necessarly a primary int key
- filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter which is the current id of current object
To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

- id_field is necessarly a primary int key
- filtersql is a SQL condition. It can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter which is the current id of current object
To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax: ObjectName:Classpath ExtrafieldParamHelpSeparator=Keep empty for a simple separator
Set this to 1 for a collapsing separator (open by default for new session, then status is kept for each user session)
Set this to 2 for a collapsing separator (collapsed by default for new session, then status is kept fore each user session) LibraryToBuildPDF=Library used for PDF generation From 482ad20a4d6666d4ef25e785e2f9022ffa27d847 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 16:14:42 +0100 Subject: [PATCH 040/119] Log debug before archive logs --- htdocs/core/modules/modBlockedLog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 6a3cd4767f7..7365f55cf7c 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -47,7 +47,7 @@ class modBlockedLog extends DolibarrModules // It is used to group modules in module setup page $this->family = "base"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '75'; + $this->module_position = '76'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries."; From 858e9d1c03b0aafa825c7c7191046feadebe526b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:27:56 +0100 Subject: [PATCH 041/119] update minimum version --- .../doc/pdf_standard_recruitmentjobposition.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 5f257f594cf..9b59eeca09d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -70,9 +70,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * Dolibarr version of the loaded document From 67df1e1b949c7eb39e180235cd5bfe8fd1d3b253 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 17:29:11 +0100 Subject: [PATCH 042/119] Use same visual picto everywhere for nature of thirdparty --- htdocs/comm/card.php | 6 +-- htdocs/fourn/card.php | 5 ++ htdocs/societe/card.php | 14 ++--- htdocs/societe/class/societe.class.php | 74 ++++++++++++++++++++++---- htdocs/societe/index.php | 16 +----- htdocs/societe/list.php | 23 ++------ 6 files changed, 81 insertions(+), 57 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7f4fe6f66c2..1be8d68760e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -273,9 +273,9 @@ if ($object->id > 0) print '
'; print '
'.$entry->nature.''.$entry->thirdparty_html.''.$entry->contact_html.''.$entry->nature.''.$entry->type.''.$entry->status.'
'; - // Prospect/Customer - print ''; // Prefix diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 807996ddd1c..9d18f3cfd1a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -179,6 +179,11 @@ if ($object->id > 0) print '
'; print '
'.$langs->trans('ProspectCustomer').''; - print $object->getLibCustProspStatut(); + // Type Prospect/Customer/Supplier + print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); print '
'; + // Type Prospect/Customer/Supplier + print ''; + if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b9da05980bf..78972bde66c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2398,19 +2398,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; - // Prospect/Customer - print ''; - // Supplier - if (!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) - { - print ''; - } - // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9c8e93b6567..c4d355ab62c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -126,6 +126,33 @@ class Societe extends CommonObject */ public $restrictiononfksoc = 1; + + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ @@ -152,17 +179,8 @@ class Societe extends CommonObject 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - /*'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>165),*/ 'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175), + 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'), 'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180), 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), 'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190), @@ -2589,6 +2607,41 @@ class Societe extends CommonObject return $result; } + /** + * Return link(s) on type of thirdparty (with picto) + * + * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) + * @param string $option ''=All + * @param int $notooltip 1=Disable tooltip + * @return string String with URL + */ + public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0) + { + global $conf, $langs; + + $s = ''; + if (empty($option) || preg_match('/prospect/', $option)) { + if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; + } + } + if (empty($option) || preg_match('/customer/', $option)) { + if (($this->client == 1 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; + } + } + if (empty($option) || preg_match('/supplier/', $option)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) + { + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; + } + } + return $s; + } + + /** * Return label of status (activity, closed) * @@ -4348,6 +4401,7 @@ class Societe extends CommonObject * Return label of status customer is prospect/customer * * @return string Label + * @see getTypeUrl() */ public function getLibCustProspStatut() { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index ddd865521d7..9ce38458c7f 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -289,21 +289,7 @@ if ($result) print "\n"; // Type print ''; // Last modified date print ''; } // Multiprice level @@ -924,7 +925,7 @@ if (!empty($arrayfields['s.tva_intra']['checked'])) print ''; } -// Type (customer/prospect/supplier) +// Nature (customer/prospect/supplier) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; print "\n"; - print ''; if (!empty($arrayfields['s.rowid']['checked'])) print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); @@ -1012,7 +1012,7 @@ if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'], $_SERVER["PHP_SELF"], "region.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, "", $sortfield, $sortorder, 'center '); if (!empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'], $_SERVER["PHP_SELF"], "staff.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s.price_level']['checked'])) print_liste_field_titre($arrayfields['s.price_level']['label'], $_SERVER["PHP_SELF"], "s.price_level", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder); @@ -1266,20 +1266,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; if (!$i) $totalarray['nbfield']++; } From 4477578766bfa1adf6abdfb7fff532b6204a093b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 5 Feb 2021 17:30:41 +0100 Subject: [PATCH 043/119] FIX takepos : load date function fix loading dol_get_first_hour() --- htdocs/takepos/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index b641efd2502..8062368d360 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant or multiple sales $action = GETPOST('action', 'aZ09'); From 03a5f06d50f2bbc055bd8074c187204bd89df218 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 5 Feb 2021 17:37:51 +0100 Subject: [PATCH 044/119] Update libelle as label in shipment method API --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 84d4ddc3679..85a45e9ff45 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -643,7 +643,7 @@ class Setup extends DolibarrApi public function getListOfShipmentMethods($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') { $list = array(); - $sql = "SELECT t.rowid, t.code, t.libelle, t.description, t.tracking"; + $sql = "SELECT t.rowid, t.code, t.libelle as label, t.description, t.tracking"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t"; $sql .= " WHERE t.active = ".$active; // Add sql filters From c96d36cad3b8dd927c13e44207037523ca214989 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:39:22 +0100 Subject: [PATCH 045/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 2b9fb62b1d4..619dcdf84d3 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -55,6 +55,11 @@ class pdf_strato extends ModelePDFContract */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -131,6 +136,7 @@ class pdf_strato extends ModelePDFContract $this->db = $db; $this->name = 'strato'; $this->description = $langs->trans("StandardContractsTemplate"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 998c5b2ec3a3d15c8d662c847124a9226720c5a9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:42:33 +0100 Subject: [PATCH 046/119] Save the name of generated file as the main doc when generating a doc with this template --- .../core/modules/delivery/doc/pdf_storm.modules.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index d6376e6cd17..f6275386cff 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2020 John BOTELLA @@ -54,6 +54,11 @@ class pdf_storm extends ModelePDFDeliveryOrder */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -61,9 +66,9 @@ class pdf_storm extends ModelePDFDeliveryOrder /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * Dolibarr version of the loaded document @@ -127,6 +132,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->db = $db; $this->name = "Storm"; $this->description = $langs->trans("DocumentModelStorm"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From d85c8c44fc673fddef4b75ce3906782546dfe2f9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:49:43 +0100 Subject: [PATCH 047/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 3b8baa107ad..41ed6b22554 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik - * Copyright (C) 2011-2020 Philippe Grand + * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * This program is free software; you can redistribute it and/or modify @@ -53,6 +53,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -126,6 +131,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->db = $db; $this->name = "Typhon"; $this->description = $langs->trans("DocumentModelTyphon"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From c03da95acb10bae0374a582a444b1c73569ff49d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:52:12 +0100 Subject: [PATCH 048/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 165e83a8e87..8441597a967 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -51,6 +51,11 @@ class pdf_espadon extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -122,6 +127,7 @@ class pdf_espadon extends ModelePdfExpedition $this->db = $db; $this->name = "espadon"; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From 7c1342845609ac4aa56854853b2014ff64d30b8f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:53:34 +0100 Subject: [PATCH 049/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index bad252bf799..144167e8912 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -52,6 +52,11 @@ class pdf_merou extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -123,6 +128,7 @@ class pdf_merou extends ModelePdfExpedition $this->db = $db; $this->name = "merou"; $this->description = $langs->trans("DocumentModelMerou"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From e638c238c6ce65a366885cd9de4e9a1c8827cdd0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:54:51 +0100 Subject: [PATCH 050/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index f3cffecdd9c..62213127951 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -52,6 +52,11 @@ class pdf_rouget extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -123,6 +128,7 @@ class pdf_rouget extends ModelePdfExpedition $this->db = $db; $this->name = "rouget"; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From 0f196d7f19b9807b06c5609e3088e46637605d5a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:56:57 +0100 Subject: [PATCH 051/119] Save the name of generated file as the main doc when generating a doc with this template --- .../core/modules/expensereport/doc/pdf_standard.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 176b09264d4..8495aba945d 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -59,6 +59,11 @@ class pdf_standard extends ModeleExpenseReport */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -133,6 +138,7 @@ class pdf_standard extends ModeleExpenseReport $this->db = $db; $this->name = ""; $this->description = $langs->trans('PDFStandardExpenseReports'); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 4170332aeeed7d08811cdc84cbf4bc204a7705b6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:58:54 +0100 Subject: [PATCH 052/119] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 622cd0b2250..844e468a69d 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -54,6 +54,11 @@ class pdf_soleil extends ModelePDFFicheinter */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -124,6 +129,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->db = $db; $this->name = 'soleil'; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 5856f9e5cb6a1d4b0a2aba27c6a1867a288fbad7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:04:46 +0100 Subject: [PATCH 053/119] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_baleine.modules.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 6baf416ed64..431e7b6e85c 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -38,6 +38,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_baleine extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + /** * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.6 = array(5, 6) @@ -50,6 +75,41 @@ class pdf_baleine extends ModelePDFProjects */ public $version = 'dolibarr'; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Issuer * @var Societe Object that emits @@ -71,6 +131,7 @@ class pdf_baleine extends ModelePDFProjects $this->db = $db; $this->name = "baleine"; $this->description = $langs->trans("DocumentModelBaleine"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 5b5ea075e787abb34f2c8245ee7423bc9ce5eaa6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:07:02 +0100 Subject: [PATCH 054/119] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_beluga.modules.php | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 0f877428052..80862ba32d8 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -54,6 +54,78 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; class pdf_beluga extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.6 = array(5, 6) + */ + public $phpmin = array(5, 6); + + /** + * Dolibarr version of the loaded document + * @var string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Page orientation * @var string 'P' or 'Portait' (default), 'L' or 'Landscape' @@ -81,6 +153,7 @@ class pdf_beluga extends ModelePDFProjects $this->db = $db; $this->name = "beluga"; $this->description = $langs->trans("DocumentModelBeluga"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 47ca631193ca561d53b1738dbda89b6514a5a1ee Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:09:36 +0100 Subject: [PATCH 055/119] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_timespent.modules.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 5426e076d33..e6fe76cba16 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -37,6 +37,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_timespent extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + /** * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.6 = array(5, 6) @@ -49,6 +74,41 @@ class pdf_timespent extends ModelePDFProjects */ public $version = 'dolibarr'; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Issuer * @var Societe Object that emits @@ -70,6 +130,7 @@ class pdf_timespent extends ModelePDFProjects $this->db = $db; $this->name = "timespent"; $this->description = $langs->trans("DocumentModelTimeSpent"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From b2e61aa4994b9ed0069e0d640647ceddb5007daa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:23:17 +0100 Subject: [PATCH 056/119] fix typo --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 159898f7256..b9f98adfe04 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4914,7 +4914,7 @@ abstract class CommonObject $this->result['filename']=$ecmfile->filename;*/ //var_dump($obj->update_main_doc_field);exit; - // Update the last_main_doc field into main object (if documenent generator has property ->update_main_doc_field set) + // Update the last_main_doc field into main object (if document generator has property ->update_main_doc_field set) $update_main_doc_field = 0; if (!empty($obj->update_main_doc_field)) $update_main_doc_field = 1; if ($update_main_doc_field && !empty($this->table_element)) From f0e1c02caa040c0e25732ea041c3a856d9094bd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 00:05:24 +0100 Subject: [PATCH 057/119] Look and feel v14 - Use placeholder on combolists --- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formother.class.php | 51 ++++++++++++---------- htdocs/core/js/lib_foot.js.php | 28 ++++++------ htdocs/societe/list.php | 14 +++--- 7 files changed, 54 insertions(+), 47 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 34feb8bbe44..42dfff4ae4d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -263,7 +263,7 @@ print '
'; // ThirdParty Type print '
'; // Category diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 6e7c8ef36fb..1bbe2c11b19 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -271,7 +271,7 @@ print ''; // ThirdParty Type print ''; // Category diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 13378979932..ee96f7c39df 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -264,7 +264,7 @@ print ''; // ThirdParty Type print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e7183d4373e..30a730495e4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6431,7 +6431,7 @@ class Form * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is the text if it is a placeholder string), <0 to add an empty value with key that is this value. + * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 to show key into label with format "[key] value" * @param int $value_as_key 1 to use value as key * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c71029769f2..dc6820c56fc 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -332,13 +332,13 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param integer $selected Preselected value - * @param string $htmlname Name of combo list - * @param int $nocateg Show also an entry "Not categorized" - * @param int $showempty Add also an empty line - * @param string $morecss More CSS - * @return string Html combo list code + * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param integer $selected Preselected value + * @param string $htmlname Name of combo list + * @param int $nocateg Show also an entry "Not categorized" + * @param int|string $showempty Add also an empty line + * @param string $morecss More CSS + * @return string Html combo list code * @see select_all_categories() */ public function select_categories($type, $selected = 0, $htmlname = 'search_categ', $nocateg = 0, $showempty = 1, $morecss = '') @@ -368,7 +368,13 @@ class FormOther // Print a select with each of them $moreforfilter .= ''; - if ($showempty) $out .= ''; + if ($showempty) { + $textforempty = ' '; + if (!empty($conf->use_javascript_ajax)) $textforempty = ' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. + if (!is_numeric($showempty)) $textforempty = $showempty; + $out .= ''."\n"; + } // Get list of users allowed to be viewed $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut as status, u.login, u.photo, u.gender, u.entity, u.admin"; @@ -499,11 +510,7 @@ class FormOther $out .= ''; +} + print "
'.$langs->trans('ProspectCustomer').''; - print $object->getLibCustProspStatut(); + // Type Prospect/Customer/Supplier + print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); print '
'.$langs->trans('Supplier').''; - print yn($object->fournisseur); - print '
'; - $obj = $thirdparty_static; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $thirdparty_static->getTypeUrl(); print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2553179acb8..6d9feac89c6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -829,7 +829,8 @@ if (!empty($arrayfields['country.code_iso']['checked'])) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1); + // We use showempty=0 here because there is already an unknown value into dictionary. + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth100', 1); print ''; @@ -996,7 +997,6 @@ print $searchpicto; print '
'; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $companystatic->getTypeUrl(1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. - print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); + print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. -print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. -print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("NoRecordFound").'
"; print "
"; print ""; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 5b5e9685628..0df74bc166e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1343,6 +1343,14 @@ while ($i < min($num, $limit)) $i++; } +// If no record found +if ($num == 0) +{ + $colspan = 1; + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print '
'.$langs->trans("NoRecordFound").'
'; print ' '; // Column title of weeks numbers - echo ' '; + echo ' '; $i = 0; while ($i < 7) { - print ' '; - print ''; + print ''; @@ -372,7 +375,8 @@ if ($result > 0) } else { - print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail); + $langs->load("errors"); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail).'; } } print ''; From 5712d255b3d639bdb831f9326d94dc71e62b56f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:31:40 +0100 Subject: [PATCH 083/119] Fix bad html --- htdocs/societe/notify/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 7a6e0aaf92e..7f813bba72d 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -231,9 +231,9 @@ if ($result > 0) // Line with titles print '
##'; + print ' '; $numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7); if (!empty($conf->dol_optimize_smallscreen)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ae4c843dad8..4aead28ffda 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3363,7 +3363,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $fakey = 'fa-'.$pictowithouttext; } - if (in_array($pictowithouttext, array('payment', 'loan'))) { + if (in_array($pictowithouttext, array('contract'))) { + $fasize = '0.92em'; + } + if (in_array($pictowithouttext, array('intervention', 'payment', 'loan'))) { $fasize = '0.80em'; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 83bb7365109..1d155bf0cc9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -807,6 +807,10 @@ span.fa.fa-plus-circle.paddingleft { { border-right: 1px solid #DDD; } +.borderleftlight +{ + border-left: 1px solid #DDD; +} #formuserfile { margin-top: 4px; } @@ -3301,6 +3305,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 76fb0692af1..623ecb2a779 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -875,6 +875,11 @@ body[class*="colorblind-"] .text-success{ { border-right: 1px solid #f4f4f4; } +.borderleftlight +{ + border-left: 1px solid #f4f4f4; +} + #formuserfile { margin-top: 4px; } @@ -3254,6 +3259,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ table.listwithfilterbefore { From 4411497112faddaddfa3861e0864dcd8e4a37328 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 12:27:27 +0100 Subject: [PATCH 069/119] FIX #16156 --- htdocs/societe/consumption.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 779bf573341..cc00738ebeb 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -433,15 +433,15 @@ if ($sql_select) // Status print ''; - if ($type_element == 'contract') - { - print $documentstaticline->getLibStatut(2); + if ($type_element == 'contract') { + print $documentstaticline->getLibStatut(5); } else { - print $documentstatic->getLibStatut(2); + print $documentstatic->getLibStatut(5); } print ''; + // Label + print ''; // Define text, description and type $text = ''; $description = ''; $type = 0; From 4647f279d12cba1a83e4a4ea6291a56defb33de9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:04:16 +0100 Subject: [PATCH 070/119] fix typo --- .../doc/pdf_standard_recruitmentjobposition.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 9b59eeca09d..918fc9f727d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -128,7 +128,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From bf211c64233be1de36c27c94b57a472a57dc9710 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:10:00 +0100 Subject: [PATCH 071/119] fix typo --- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 9232797a008..3daa5288d7e 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -84,9 +84,9 @@ class pdf_eratosthene extends ModelePDFCommandes */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -126,7 +126,7 @@ class pdf_eratosthene extends ModelePDFCommandes public $emetteur; /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From 04373fb5311641ea4cb2843ff5cb23288cdffb51 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:11:08 +0100 Subject: [PATCH 072/119] fix typo --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 423aa5b79d1..0edcdec536b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -80,9 +80,9 @@ class pdf_sponge extends ModelePDFFactures */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -128,7 +128,7 @@ class pdf_sponge extends ModelePDFFactures /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From ce7a3ae2f0d3757e9c099a63420fd0f067130586 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:11:58 +0100 Subject: [PATCH 073/119] fix typo --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 760e678e839..bc71116081e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -78,9 +78,9 @@ class pdf_cyan extends ModelePDFPropales */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -120,7 +120,7 @@ class pdf_cyan extends ModelePDFPropales public $emetteur; /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From b77398b47663dbdd4dde3c8ece66f74454f46a3d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:12:39 +0100 Subject: [PATCH 074/119] fix typo --- .../mymodule/doc/pdf_standard_myobject.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index cb9e4f0a6dd..4546d7044bd 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -80,9 +80,9 @@ class pdf_standard_myobject extends ModelePDFMyObject */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -128,7 +128,7 @@ class pdf_standard_myobject extends ModelePDFMyObject /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From 7860ffa28eb8c4060f6038cbb5d95a7d097b209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 13:48:31 +0100 Subject: [PATCH 075/119] update phpmin version --- htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/core/modules/modAccounting.class.php | 2 +- htdocs/core/modules/modAdherent.class.php | 2 +- htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/core/modules/modApi.class.php | 2 +- htdocs/core/modules/modAsset.class.php | 2 +- htdocs/core/modules/modBom.class.php | 2 +- htdocs/core/modules/modCashDesk.class.php | 2 +- htdocs/core/modules/modEmailCollector.class.php | 2 +- htdocs/core/modules/modExpenseReport.class.php | 2 +- htdocs/core/modules/modGeoIPMaxmind.class.php | 2 +- htdocs/core/modules/modGravatar.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/core/modules/modImport.class.php | 2 +- htdocs/core/modules/modIncoterm.class.php | 2 +- htdocs/core/modules/modLabel.class.php | 2 +- htdocs/core/modules/modLdap.class.php | 2 +- htdocs/core/modules/modLoan.class.php | 2 +- htdocs/core/modules/modMailing.class.php | 2 +- htdocs/core/modules/modMailmanSpip.class.php | 2 +- htdocs/core/modules/modMargin.class.php | 2 +- htdocs/core/modules/modMultiCurrency.class.php | 2 +- htdocs/core/modules/modNotification.class.php | 2 +- htdocs/core/modules/modOauth.class.php | 2 +- htdocs/core/modules/modOpenSurvey.class.php | 2 +- htdocs/core/modules/modPaybox.class.php | 2 +- htdocs/core/modules/modPaymentByBankTransfer.class.php | 2 +- htdocs/core/modules/modPaypal.class.php | 2 +- htdocs/core/modules/modPrelevement.class.php | 2 +- htdocs/core/modules/modPrinting.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modProductBatch.class.php | 2 +- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 2 +- htdocs/core/modules/modReceiptPrinter.class.php | 2 +- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modSalaries.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSocialNetworks.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- htdocs/core/modules/modStock.class.php | 2 +- htdocs/core/modules/modStripe.class.php | 2 +- htdocs/core/modules/modSupplierProposal.class.php | 2 +- htdocs/core/modules/modSyslog.class.php | 2 +- htdocs/core/modules/modTakePos.class.php | 2 +- htdocs/core/modules/modTax.class.php | 2 +- htdocs/core/modules/modTicket.class.php | 2 +- htdocs/core/modules/modUser.class.php | 2 +- htdocs/core/modules/modVariants.class.php | 2 +- htdocs/core/modules/modWebServices.class.php | 2 +- htdocs/core/modules/modWebServicesClient.class.php | 2 +- htdocs/core/modules/modWebsite.class.php | 2 +- htdocs/core/modules/modWorkflow.class.php | 2 +- 54 files changed, 54 insertions(+), 54 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index da1e64ac56e..a5b58e17dcb 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -316,7 +316,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.4 = array(5, 4) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ public $phpmin; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 811dd57544e..4ba6c61c5e3 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -66,7 +66,7 @@ class modAccounting extends DolibarrModules $this->depends = array("modFacture", "modBanque", "modTax"); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module $this->langfiles = array("accountancy", "compta"); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 1db3e2b7d50..ca2dac95b78 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -74,7 +74,7 @@ class modAdherent extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array('modMailmanSpip'); // List of module class names as string this module is in conflict with $this->langfiles = array("members", "companies"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 559260a77c2..d77c5acc2c4 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -73,7 +73,7 @@ class modAgenda extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("companies"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Module parts $this->module_parts = array(); diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 32b16a74703..f578c9084c2 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -83,7 +83,7 @@ class modApi extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array('modZapier'); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 50fe71ef390..505ed444f55 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -90,7 +90,7 @@ class modAsset extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("assets"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 092ceb17d79..f79d353edc7 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -108,7 +108,7 @@ class modBom extends DolibarrModules $this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - //$this->phpmin = array(5,4); // Minimum version of PHP required by module + //$this->phpmin = array(5, 6)); // Minimum version of PHP required by module $this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index e3368fb636f..ca9ffa87d53 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -66,7 +66,7 @@ class modCashDesk extends DolibarrModules $this->hidden = false; // A condition to hide module $this->depends = array('always'=>"modBanque", 'always'=>"modFacture", 'always'=>"modProduct", 'FR'=>'modBlockedLog'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 4); // Minimum version of Dolibarr required by module $this->langfiles = array("cashdesk"); $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index f71932c93b9..ac4b55011c9 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -91,7 +91,7 @@ class modEmailCollector extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("admin"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index befafbc6767..2d0036faef9 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -65,7 +65,7 @@ class modExpenseReport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled // $this->conflictwith = array("modDeplacement"); // Deactivate for access on old information $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7); // Minimum version of Dolibarr required by module $this->langfiles = array("companies", "trips"); diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php index 10515a78449..06438eefab8 100644 --- a/htdocs/core/modules/modGeoIPMaxmind.class.php +++ b/htdocs/core/modules/modGeoIPMaxmind.class.php @@ -69,7 +69,7 @@ class modGeoIPMaxmind extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); + $this->phpmin = array(5, 6); $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 5aa0c2de5c6..a7d8899b0c2 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -77,7 +77,7 @@ class modGravatar extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 7); // Minimum version of Dolibarr required by module $this->langfiles = array(); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index ad36253fe22..edaa872a369 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -71,7 +71,7 @@ class modHRM extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(/*"modSalaries, modExpenseReport, modHoliday"*/); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module $this->langfiles = array("hrm"); diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 6c6eaba69e0..79a4280017c 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -87,7 +87,7 @@ class modHoliday extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("holiday"); diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 094e4a87aca..d2a636e2ca6 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -64,7 +64,7 @@ class modImport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. + $this->phpmin = array(5, 6); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php index 70e6c738801..e33dbdd8236 100644 --- a/htdocs/core/modules/modIncoterm.class.php +++ b/htdocs/core/modules/modIncoterm.class.php @@ -68,7 +68,7 @@ class modIncoterm extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("incoterm"); diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 88e044f0444..58e735666ab 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -61,7 +61,7 @@ class modLabel extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages // $this->config_page_url = array("label.php"); diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index f6004f18410..5f4860d0149 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -67,7 +67,7 @@ class modLdap extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array( diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index c29658ae0a7..d45987e840d 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -67,7 +67,7 @@ class modLoan extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("loan"); // Constants diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 75d423e3ecd..1db638e782f 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -66,7 +66,7 @@ class modMailing extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index f8a74072bdd..bfd2e25493a 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -66,7 +66,7 @@ class modMailmanSpip extends DolibarrModules $this->depends = array('modAdherent'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array('mailman.php'); diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 7a84b401b59..185a86a86aa 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -72,7 +72,7 @@ class modMargin extends DolibarrModules $this->depends = array("modPropale", "modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 2); // Minimum version of Dolibarr required by module $this->langfiles = array("margins"); diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 605276dee0e..e20c5c77f9d 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -88,7 +88,7 @@ class modMultiCurrency extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("multicurrency"); diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index dbc355ce53e..f9191ce3c8d 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -63,7 +63,7 @@ class modNotification extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 48c31b15d24..394d1e00655 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -71,7 +71,7 @@ class modOauth extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("oauth"); diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 623c6d7c43e..ee4a1faf0cd 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -76,7 +76,7 @@ class modOpenSurvey extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 4, 0); // Minimum version of Dolibarr required by module // Constants diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index a5cda052656..1dfe76f471a 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -73,7 +73,7 @@ class modPayBox extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 6); // Minimum version of Dolibarr required by module $this->langfiles = array("paybox"); diff --git a/htdocs/core/modules/modPaymentByBankTransfer.class.php b/htdocs/core/modules/modPaymentByBankTransfer.class.php index 0eab52fcdec..5704badf854 100644 --- a/htdocs/core/modules/modPaymentByBankTransfer.class.php +++ b/htdocs/core/modules/modPaymentByBankTransfer.class.php @@ -68,7 +68,7 @@ class modPaymentByBankTransfer extends DolibarrModules $this->depends = array("modFournisseur", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("paymentbybanktransfer.php"); diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 15a92020062..cdf25d24359 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -74,7 +74,7 @@ class modPaypal extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array('modPaypalPlus'); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("paypal"); diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 4ffa8358a06..4bee933376f 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -67,7 +67,7 @@ class modPrelevement extends DolibarrModules $this->depends = array("modFacture", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("prelevement.php"); diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index b918a8b1158..373ca131d2b 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -70,7 +70,7 @@ class modPrinting extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("printing"); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index f92d9b30890..27d44160949 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -70,7 +70,7 @@ class modProduct extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modStock", "modBarcode", "modProductBatch", "modVariants"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 92bfb9b66a5..e82bdbbd638 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -72,7 +72,7 @@ class modProductBatch extends DolibarrModules $this->depends = array("modProduct", "modStock", "modExpedition", "modFournisseur"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("productbatch"); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ff2edd3c787..7f2e695b8a4 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -68,7 +68,7 @@ class modProjet extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array('projects'); // Constants diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index c0ffa6f0811..bb4ba6c1744 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -69,7 +69,7 @@ class modPropale extends DolibarrModules $this->depends = array("modSociete"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->config_page_url = array("propal.php"); $this->langfiles = array("propal", "bills", "companies", "deliveries", "products"); diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 7143dd0d614..fe95a89d9ce 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -71,7 +71,7 @@ class modReceiptPrinter extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("receiptprinter"); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..7b6aee4ffd6 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -95,7 +95,7 @@ class modResource extends DolibarrModules // List of modules id to disable if this one is disabled $this->requiredby = array('modPlace'); // Minimum version of PHP required by module - $this->phpmin = array(5, 4); + $this->phpmin = array(5, 6); $this->langfiles = array("resource"); // langfiles@resource // Constants diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 23c892333d8..131b0f2945f 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -75,7 +75,7 @@ class modSalaries extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("salaries", "bills"); // Constants diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index b4dd93ff3e0..66a8dc76691 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -68,7 +68,7 @@ class modService extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index bf7573a912b..368634083ee 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -69,7 +69,7 @@ class modSocialNetworks extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array(); // Constants diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index e5a3c584adb..2d32ae3f0c4 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -70,7 +70,7 @@ class modSociete extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modExpedition", "modFacture", "modFournisseur", "modFicheinter", "modPropale", "modContrat", "modCommande"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("companies", 'bills', "compta", "admin", "banks"); // Constants diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 5ae6688a31f..0b390b55dc2 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -69,7 +69,7 @@ class modStock extends DolibarrModules $this->depends = array("modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modProductBatch"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("stocks"); // Constants diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 4d95a6329ba..652db701110 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -72,7 +72,7 @@ class modStripe extends DolibarrModules $this->hidden = false; // A condition to hide module $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(5, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("stripe"); diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 6074966b4b1..9fe6df1ae1f 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -70,7 +70,7 @@ class modSupplierProposal extends DolibarrModules $this->depends = array('modFournisseur'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("supplier_proposal"); // Constants diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 01079310e4b..d003108726e 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -71,7 +71,7 @@ class modSyslog extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index e8162ebf570..8a3d4a73776 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -102,7 +102,7 @@ class modTakePos extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("cashdesk"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index 3e2a62e099a..bf064d743f8 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -71,7 +71,7 @@ class modTax extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("compta", "bills"); // Constants diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 7746bf9ca52..bad4457466f 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -96,7 +96,7 @@ class modTicket extends DolibarrModules $this->depends = array('modAgenda'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index dba5f864e8f..df376a6ee61 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -68,7 +68,7 @@ class modUser extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("main", "users", "companies", "members", "salaries", "hrm"); $this->always_enabled = true; // Can't be disabled diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index 72b29230def..b40bd60f786 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -83,7 +83,7 @@ class modVariants extends DolibarrModules $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("products"); diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index e61ed5dc689..a6362a175cc 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -63,7 +63,7 @@ class modWebServices extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index 52a8889fbbb..b59e6cb9e13 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -63,7 +63,7 @@ class modWebServicesClient extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index c452ed9ded2..295e7ccefa4 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -68,7 +68,7 @@ class modWebsite extends DolibarrModules $this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("website"); // Constants diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index c7bd464b9d1..ec1c458ce00 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -72,7 +72,7 @@ class modWorkflow extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 8); // Minimum version of Dolibarr required by module $this->langfiles = array("@workflow"); From 4249abb2dea347386921fc97e4ff43a53931f83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 13:57:11 +0100 Subject: [PATCH 076/119] phpcs --- htdocs/blockedlog/class/blockedlog.class.php | 87 ++++++++++++++------ 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 1a2868a6a58..7844432f3f8 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -133,19 +133,33 @@ class BlockedLog * * @return int Always 1 */ - public function loadTrackedEvents() { + public function loadTrackedEvents() + { global $conf; $this->trackedevents = array(); - if ($conf->facture->enabled) $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; - if ($conf->facture->enabled) $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; - if ($conf->facture->enabled) $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; - if ($conf->facture->enabled) $this->trackedevents['DOC_DOWNLOAD'] = 'BlockedLogBillDownload'; - if ($conf->facture->enabled) $this->trackedevents['DOC_PREVIEW'] = 'BlockedLogBillPreview'; - - if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_CREATE'] = 'logPAYMENT_CUSTOMER_CREATE'; - if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_DELETE'] = 'logPAYMENT_CUSTOMER_DELETE'; + if ($conf->facture->enabled) { + $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; + } + if ($conf->facture->enabled) { + $this->trackedevents['DOC_DOWNLOAD'] = 'BlockedLogBillDownload'; + } + if ($conf->facture->enabled) { + $this->trackedevents['DOC_PREVIEW'] = 'BlockedLogBillPreview'; + } + if ($conf->facture->enabled) { + $this->trackedevents['PAYMENT_CUSTOMER_CREATE'] = 'logPAYMENT_CUSTOMER_CREATE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['PAYMENT_CUSTOMER_DELETE'] = 'logPAYMENT_CUSTOMER_DELETE'; + } /* Supplier if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; @@ -158,12 +172,20 @@ class BlockedLog if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; */ - if ($conf->don->enabled) $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; - if ($conf->don->enabled) $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; + if ($conf->don->enabled) { + $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; + } + if ($conf->don->enabled) { + $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; + } //if ($conf->don->enabled) $this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL'; - if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_CREATE'] = 'logDONATION_PAYMENT_CREATE'; - if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_DELETE'] = 'logDONATION_PAYMENT_DELETE'; + if ($conf->don->enabled) { + $this->trackedevents['DONATION_PAYMENT_CREATE'] = 'logDONATION_PAYMENT_CREATE'; + } + if ($conf->don->enabled) { + $this->trackedevents['DONATION_PAYMENT_DELETE'] = 'logDONATION_PAYMENT_DELETE'; + } /* if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; @@ -171,18 +193,29 @@ class BlockedLog if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; */ - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; - - - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; - + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; + } + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; + } + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; + } // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); - if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + if ($moduleposenabled) { + $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + } // Add more action to track from a conf variable if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) { @@ -968,16 +1001,16 @@ class BlockedLog if ($element == 'all') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity; + WHERE entity=".$conf->entity; } elseif ($element == 'not_certified') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND certified = 0"; + WHERE entity=".$conf->entity." AND certified = 0"; } elseif ($element == 'just_certified') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND certified = 1"; + WHERE entity=".$conf->entity." AND certified = 1"; } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."'"; + WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."'"; } if ($fk_object) $sql .= natural_search("rowid", $fk_object, 1); From eaaefe1382f4ff7b9dad33357aaf19236a8e3f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 14:12:22 +0100 Subject: [PATCH 077/119] 5.5 to 5.6 --- htdocs/core/modules/modMrp.class.php | 2 +- htdocs/core/modules/modRecruitment.class.php | 2 +- htdocs/core/modules/modWorkstation.class.php | 2 +- htdocs/core/modules/modZapier.class.php | 2 +- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- .../doc/doc_generic_recruitmentjobposition_odt.modules.php | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 012bb2d576a..46090c4c5d5 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -122,7 +122,7 @@ class modMrp extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(8, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 8e282a9513d..c85b61c179c 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -122,7 +122,7 @@ class modRecruitment extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("recruitment"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 5f55e2b2207..797f7c8c5e0 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -124,7 +124,7 @@ class modWorkstation extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index ee7589c6537..09abd0e9dc7 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -123,7 +123,7 @@ class modZapier extends DolibarrModules $this->conflictwith = array(); $this->langfiles = array("zapier"); // Minimum version of PHP required by module - //$this->phpmin = array(5, 5); + //$this->phpmin = array(5, 6); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(10, 0); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 9d47069d7da..e4f662c9e99 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -144,7 +144,7 @@ class modMyModule extends DolibarrModules $this->langfiles = array("mymodule@mymodule"); // Prerequisites - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 59ea51466b6..0a8fb1bab0f 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * @var string Dolibarr version of the loaded document From 3bcf795d5576df7140632a2dcce223d9d1bb3fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 14:44:08 +0100 Subject: [PATCH 078/119] add more picto for module --- htdocs/core/modules/modRecruitment.class.php | 1 + htdocs/core/modules/modStripe.class.php | 1 + htdocs/core/modules/modTicket.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 8e282a9513d..02db6a8e075 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -270,6 +270,7 @@ class modRecruitment extends DolibarrModules 'fk_menu'=>'fk_mainmenu=hrm', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Top menu entry 'titre'=>'Recruitment', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'hrm', 'leftmenu'=>'recruitmentjobposition', 'url'=>'/recruitment/recruitmentindex.php', diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 4d95a6329ba..c05323aa34b 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -112,6 +112,7 @@ class modStripe extends DolibarrModules 'fk_menu'=>'fk_mainmenu=bank', 'type'=>'left', 'titre'=>'StripeAccount', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'bank', 'leftmenu'=>'stripe', 'url' => '', diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 7746bf9ca52..2d7a6c7c4e6 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -96,7 +96,7 @@ class modTicket extends DolibarrModules $this->depends = array('modAgenda'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants @@ -208,6 +208,7 @@ class modTicket extends DolibarrModules $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket', 'type' => 'left', 'titre' => 'Ticket', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu' => 'ticket', 'leftmenu' => 'ticket', 'url' => '/ticket/index.php', From 0be168561f8c0badd0482ee6eb1d962a75b50590 Mon Sep 17 00:00:00 2001 From: Raphael Schweizer Date: Sat, 6 Feb 2021 16:10:05 +0100 Subject: [PATCH 079/119] prevent browsers from storing / suggesting old captchas --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7934bb58009..8d9c79f807d 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -177,7 +177,7 @@ if ($captcha) { - " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" /> + " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 44d3c0199ac..2fb21094b4d 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -126,7 +126,7 @@ if (!empty($captcha)) { - " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" /> + " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" /> From b96e405717c84e2ebbee059611b84cfe4ed13f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 17:18:00 +0100 Subject: [PATCH 080/119] add picto member --- htdocs/core/menus/standard/eldy.lib.php | 3 +-- htdocs/core/modules/modAgenda.class.php | 1 + htdocs/core/modules/modOpenSurvey.class.php | 1 + htdocs/core/modules/modResource.class.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f1141140973..43d6c79ced6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1838,7 +1838,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Load translation files required by the page $langs->loadLangs(array("members", "compta")); - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members'); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"')); $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); @@ -1888,7 +1888,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM //print $paramkey; if (!empty($conf->global->$paramkey)) { $link = "/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); } $i++; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 559260a77c2..8cb246d2a2c 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -221,6 +221,7 @@ class modAgenda extends DolibarrModules 'fk_menu'=>'r=0', 'type'=>'left', 'titre'=>'Actions', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 623c6d7c43e..f67b93fbc28 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -126,6 +126,7 @@ class modOpenSurvey extends DolibarrModules 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'Survey', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'tools', 'leftmenu'=>'opensurvey', 'url'=>'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey', diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..c679407c0cc 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -188,6 +188,7 @@ class modResource extends DolibarrModules 'fk_menu'=>'fk_mainmenu=tools', 'type'=>'left', 'titre'=> 'MenuResourceIndex', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'tools', 'leftmenu'=> 'resource', 'url'=> '/resource/list.php', From 0bfe55c3d2f944d1d1305a4a22b44b5b83bd179b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 17:26:16 +0100 Subject: [PATCH 081/119] add picto mail --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 43d6c79ced6..3048dc7837b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1807,11 +1807,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if ($mainmenu == 'tools') { if (empty($user->socid)) { // limit to internal users $langs->load("mails"); - $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); + $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); } if (!empty($conf->mailing->enabled)) { - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); } From d4df62f1da865c83dc57c3c79de77af4973b5b7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:25:41 +0100 Subject: [PATCH 082/119] Look and feel v14 --- htdocs/core/class/html.form.class.php | 16 +++++----------- htdocs/societe/notify/card.php | 10 +++++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 30a730495e4..0cd09c52dbd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -668,7 +668,7 @@ class Form $ret .= ''; - if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.'.$name.'select'); + if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.'.$name.'select'); // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button $ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER. @@ -6447,7 +6447,7 @@ class Form * @return string HTML select string. * @see multiselectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 0, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) + public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 1, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) { global $conf, $langs; @@ -6461,11 +6461,7 @@ class Form $out = ''; // Add code for jquery to use multiselect - if ($addjscombo && $jsbeautify) - { - $minLengthToAutocomplete = 0; - $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? (constant('REQUIRE_JQUERY_MULTISELECT') ?constant('REQUIRE_JQUERY_MULTISELECT') : 'select2') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; - + if ($addjscombo && $jsbeautify) { // Enhance with select2 include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); @@ -6475,16 +6471,14 @@ class Form $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); $out .= '>'; - if ($show_empty) - { + if ($show_empty) { $textforempty = ' '; if (!empty($conf->use_javascript_ajax)) $textforempty = ' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. if (!is_numeric($show_empty)) $textforempty = $show_empty; $out .= ''."\n"; } - if (is_array($array)) - { + if (is_array($array)) { // Translate if ($translate) { diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 5730d8f1ff4..7a6e0aaf92e 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -139,6 +139,7 @@ $result = $object->fetch($socid); $title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Notification"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + llxHeader('', $title, $help_url); @@ -323,7 +324,9 @@ if ($result > 0) $contactstatic->id = $obj->contact_id; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; - print '
'.$contactstatic->getNomUrl(1); + + print '
'.$contactstatic->getNomUrl(1); if ($obj->type == 'email') { if (isValidEmail($obj->email)) @@ -331,7 +334,7 @@ if ($result > 0) print ' <'.$obj->email.'>'; } else { $langs->load("errors"); - print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email).''; } } print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -297,14 +297,14 @@ if ($result > 0) } // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From f62b4c15e8abcf63a0887e6235b498b898c3e7ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:31:40 +0100 Subject: [PATCH 084/119] Fix bad html --- htdocs/societe/notify/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 5730d8f1ff4..bf9ec2e6fa7 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -230,9 +230,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -296,14 +296,14 @@ if ($result > 0) } // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From 36fbba2ac24790128dee75e55d3e9dbe72898c78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:40:14 +0100 Subject: [PATCH 085/119] Make page to setup notification simpler --- htdocs/societe/notify/card.php | 110 +++++++++++++-------------------- 1 file changed, 44 insertions(+), 66 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 7f813bba72d..c5d06f1e756 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; -$langs->loadLangs(array("companies", "mails", "admin", "other")); +$langs->loadLangs(array("companies", "mails", "admin", "other", "errors")); $socid = GETPOST("socid", 'int'); $action = GETPOST('action', 'aZ09'); @@ -219,64 +219,6 @@ if ($result > 0) print '

'."\n"; - // Add notification form - print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); - - print '
'; - print ''; - print ''; - - $param = "&socid=".$socid; - - // Line with titles - print '
'; - print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); - print_liste_field_titre(''); - print "\n"; - - $var = false; - $listofemails = $object->thirdparty_and_contact_email_array(); - if (count($listofemails) > 0) - { - $actions = array(); - - // Load array of available notifications - $notificationtrigger = new InterfaceNotification($db); - $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); - - foreach ($listofmanagedeventfornotification as $managedeventfornotification) - { - $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); - $actions[$managedeventfornotification['rowid']] = $label; - } - print ''; - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - } - - print '
'; - print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 0, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - $type = array('email'=>$langs->trans("EMail")); - print $form->selectarray("typeid", $type); - print '
'; - print $langs->trans("YouMustCreateContactFirst"); - print '
'; - - - print ''; - print '
'; - - // List of notifications enabled for contacts $sql = "SELECT n.rowid, n.type,"; $sql .= " a.code, a.label,"; @@ -296,20 +238,58 @@ if ($result > 0) dol_print_error($db); } - // List of active notifications + + // Add notification form print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print '
'; + print ''; + print ''; + + $param = "&socid=".$socid; + // Line with titles print ''; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); - print_liste_field_titre('', '', ''); - print ''; + print_liste_field_titre(''); + print "\n"; + + // Line to add a new subscription + $listofemails = $object->thirdparty_and_contact_email_array(); + if (count($listofemails) > 0) + { + $actions = array(); + + // Load array of available notifications + $notificationtrigger = new InterfaceNotification($db); + $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); + + foreach ($listofmanagedeventfornotification as $managedeventfornotification) + { + $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); + $actions[$managedeventfornotification['rowid']] = $label; + } + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } - $langs->load("errors"); - $langs->load("other"); if ($num) { @@ -358,7 +338,6 @@ if ($result > 0) foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; From 03124870cd99bd7188e1268c05958618d086d0b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:52:35 +0100 Subject: [PATCH 086/119] Responsive --- htdocs/societe/notify/card.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index c5d06f1e756..10f01e65ea8 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -209,14 +209,15 @@ if ($result > 0) print "\n"; // Help - print '
'; + print '
'; print $langs->trans("NotificationsDesc"); print '
'.$langs->trans("NotificationsDescUser"); print '
'.$langs->trans("NotificationsDescContact"); print '
'.$langs->trans("NotificationsDescGlobal"); + print '
'; print '
'; - print '

'."\n"; + print '
'."\n"; // List of notifications enabled for contacts @@ -249,7 +250,8 @@ if ($result > 0) $param = "&socid=".$socid; // Line with titles - print '
'; + print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + $type = array('email'=>$langs->trans("EMail")); + print $form->selectarray("typeid", $type); + print '
'; + print $langs->trans("YouMustCreateContactFirst"); + print '
'; $listtmp=explode(',',$val); $first=1; @@ -399,7 +378,6 @@ if ($result > 0) /*if ($user->admin) { - $var = ! $var; print '
'; print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; print '
'; + print '
'; + print '
'; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); @@ -272,15 +274,16 @@ if ($result > 0) $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); $actions[$managedeventfornotification['rowid']] = $label; } - print ''; + print ''; - print ''; print ''; print ''; print ''; @@ -318,7 +321,7 @@ if ($result > 0) } } print ''; - print ''; @@ -384,7 +387,8 @@ if ($result > 0) }*/ print '
'; - print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print '
'; + print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); print ''; - print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); print ''; $type = array('email'=>$langs->trans("EMail")); - print $form->selectarray("typeid", $type); + print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); print '
'; + print ''; $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label); print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label; print '
'; - + print '
'; + print ''; print '

'."\n"; @@ -440,7 +444,8 @@ if ($result > 0) print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); // Line with titles - print ''; + print '
'; + print '
'; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder); @@ -499,6 +504,7 @@ if ($result > 0) } print '
'; + print ''; print ''; } else dol_print_error('', 'RecordNotFound'); From a31c930522f9ed0dbfc84a102c720e044edae6e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:53:42 +0100 Subject: [PATCH 087/119] Fix look and feel v13 --- htdocs/societe/notify/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 10f01e65ea8..b911bfb034e 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -158,7 +158,7 @@ if ($result > 0) print '
'; print '
'; - print ''; + print '
'; // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field From 536ddd483211e0439b0f6c200dc7b9953940cae5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:53:42 +0100 Subject: [PATCH 088/119] Fix look and feel v13 --- htdocs/societe/notify/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index bf9ec2e6fa7..665039c6bc0 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -157,7 +157,7 @@ if ($result > 0) print '
'; print '
'; - print '
'; + print '
'; // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field From b74ea17dd2c49ff062ed2151c2f406dae8324d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:14:50 +0100 Subject: [PATCH 089/119] fix html --- htdocs/user/notify/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 3c7395fe1e8..e7fc1cf81ab 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -195,9 +195,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -271,9 +271,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From 51da7273a4c2ee03936731ea3b7cdc04cf853728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:18:45 +0100 Subject: [PATCH 090/119] Update payment.php --- htdocs/admin/payment.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 925c8fd6ff4..d27096df8f9 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -157,9 +157,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) - { - $var = !$var; + if ($module->isEnabled()) { print ''; print "\n"; foreach ($list as $key) { - $var = !$var; - - print ''; + print ''; // Param $label = $langs->trans($key); From 4b6d3d00206c0c998791477f7afe7190f8134695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:25:48 +0100 Subject: [PATCH 095/119] Update dynamic_prices.php --- htdocs/product/admin/dynamic_prices.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index bae21309022..4d2307d17ac 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -170,10 +170,8 @@ if ($action != 'create_updater' && $action != 'edit_updater') print ''; $arrayglobalvars = $price_globals->listGlobalVariables(); - if (!empty($arrayglobalvars)) - { + if (!empty($arrayglobalvars)) { foreach ($arrayglobalvars as $i=>$entry) { - $var = !$var; print ''; print ''; print ''; From b3dc87f3b75687f2335bd9bad449b4f3a90e76d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:31:31 +0100 Subject: [PATCH 096/119] fix phpcs --- htdocs/core/class/html.form.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0cd09c52dbd..3b0432e0f57 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2014-2020 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador @@ -1800,10 +1800,9 @@ class Form } $out .= ' data-html="'; $outhtml = ''; -// if (!empty($obj->photo)) -// { - $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; -// } + // if (!empty($obj->photo)) { + $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; + // } if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; $outhtml .= $labeltoshow; if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; From b4e6a49930efc501eff5f350adbe863475038e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:35:03 +0100 Subject: [PATCH 097/119] Update card.php --- htdocs/user/notify/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index e7fc1cf81ab..d09ee52077f 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -322,10 +322,8 @@ if ($result > 0) // List of notifications enabled for fixed email /* - foreach($conf->global as $key => $val) - { + foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -435,7 +435,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } // Label of permission From 8d49ca9f0d90e92de77711e93b40400ccad28171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:49:46 +0100 Subject: [PATCH 099/119] fix html --- htdocs/admin/commande.php | 6 +++--- htdocs/admin/propal.php | 2 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/supplier_proposal.php | 2 +- htdocs/expedition/card.php | 4 ++-- htdocs/expedition/shipment.php | 4 ++-- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/societe/admin/societe.php | 10 +++++----- htdocs/user/group/perms.php | 4 ++-- htdocs/user/perms.php | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 5e5655f918f..c971cf42091 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -668,7 +668,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_... print ''; print ''; -print ''; +print ''; print ' + (".$value['nb'].")"; } } @@ -1412,7 +1412,7 @@ if ($action == 'create') print ' + (".$value['nb'].")"; print ""; } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 39772360227..1c4e5bf5c25 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -813,8 +813,8 @@ if ($id > 0 || !empty($ref)) } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''."\n"; } } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4175e5064c6..c9150c69792 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -925,7 +925,7 @@ if ($id > 0 || !empty($ref)) { print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, ''); print ''; } - print ''; // Supplier ref + Qty ordered + qty already dispatched + print ''; // Supplier ref + Qty ordered + qty already dispatched } else { $type = 'dispatch'; $colspan = 7; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index aa738f0845b..daaf9fbd623 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -784,7 +784,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; -print ''; +print ''; print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -351,7 +351,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } $permlabel = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 68238b63c29..a05fd76df7b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -424,7 +424,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -435,7 +435,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } // Label of permission From e0b2e26da6c698d8fc990e53239029908a53dfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:05:10 +0100 Subject: [PATCH 100/119] fix html --- htdocs/comm/mailing/cibles.php | 6 +++--- htdocs/comm/propal/list.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/projet/list.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index bcf1e9c1e3b..a2a06c2a038 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -575,17 +575,17 @@ if ($object->fetch($id) >= 0) print ''; // Source print ''; // Date last update print ''; // Date sending print ''; //Statut diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9b585bc54a9..a4aad3afab5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1386,7 +1386,7 @@ if ($resql) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 95c2e721b09..85ee1512924 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -746,7 +746,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 76697359299..b8ab088cf85 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -809,7 +809,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; if (!$i) $totalarray['nbfield']++; From c3d1f3de3c1a9426c7562e084c6460f6197007cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:12:26 +0100 Subject: [PATCH 101/119] fix html --- htdocs/user/clicktodial.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index fff39a3d45f..cb113166cad 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -185,7 +185,7 @@ if ($id > 0) { print '
'; print '
'; - print '     '; + print '     '; print ''; print '
'; } From 0e1353733da063f776ae0e07b8b0029aab49fc8e Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 7 Feb 2021 19:21:52 +0100 Subject: [PATCH 102/119] Fix #15940 mixing different joins --- htdocs/fourn/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0ebfd024658..1f2b55d0628 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -319,6 +319,7 @@ if (!$search_all) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefou if ($search_all || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; // We'll need this table joined to the select in order to filter by sale if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_user > 0) @@ -326,7 +327,6 @@ if ($search_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; From ebe7e1464adfc3112d880afab4835bb046581bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:38:46 +0100 Subject: [PATCH 103/119] fix html --- htdocs/core/boxes/box_dolibarr_state_board.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 833f1c4478f..72693860fae 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -291,9 +291,6 @@ class box_dolibarr_state_board extends ModeleBoxes $boxstat .= '
'; $boxstat .= '
'; - $boxstat .= '
'; - $boxstat .= '
'; echo preg_replace('/\-.*$/', '', preg_replace('/mod_payment_/', '', preg_replace('/\.php$/', '', $file))); print "\n"; From 8d90063e8ffbf576019b66e8183d8e3a4732ea73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:19:57 +0100 Subject: [PATCH 091/119] Update paymentbybanktransfer.php --- htdocs/admin/paymentbybanktransfer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 113c4e18510..cea40f9f840 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -281,9 +281,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name)?$name:$module->name); print "\n"; From e37ca613d267a2cca2f60981534585728f8bd48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:20:46 +0100 Subject: [PATCH 092/119] Update prelevement.php --- htdocs/admin/prelevement.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index a51fc8b39f4..0e6f926cb10 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -287,9 +287,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name)?$name:$module->name); print "\n"; From 9aca5f0535c92b335cc1ec554cd59e716ac2a6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:21:39 +0100 Subject: [PATCH 093/119] Update propal.php --- htdocs/admin/propal.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 6d80aa78211..7a27530320a 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -383,9 +383,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name) ? $name : $module->name); print "\n"; From d5ffbae3b360c7a5795585ea44cb021870f30e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:24:30 +0100 Subject: [PATCH 094/119] Update admin_hrm.php --- htdocs/hrm/admin/admin_hrm.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 4648c2d690a..c4081e1d454 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -88,9 +88,7 @@ print ''.$langs->trans('Parameters').'
'.$entry->code.''.$entry->description.'
'; $listtmp=explode(',',$val); $first=1; From 05c7bcf70fae48c9ad6a51beb561d0e3f70dbb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:45:34 +0100 Subject: [PATCH 098/119] Update perms.php --- htdocs/user/perms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 68238b63c29..a05fd76df7b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -424,7 +424,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print '    
'.$langs->trans("ShippableOrderIconInList").'  '; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; @@ -687,7 +687,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); @@ -717,7 +717,7 @@ if ($conf->stock->enabled) { print '
'; - print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 6d80aa78211..6b0f6f3fabe 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -654,7 +654,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f255a77348a..543a6196469 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -485,7 +485,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER'); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index dac0a733782..9910f08b064 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -511,7 +511,7 @@ print ''; if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c4d646160e5..9e08673f4a7 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1259,7 +1259,7 @@ if ($action == 'create') } print "
      -> ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   ".$value['nb_total']."   ".$value['stock']." ".$img."
'; print "      -> ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   ".$value['nb_total']."   ".$value['stock']." ".$img."
      -> '.$value['fullpath'].' ('.$value['nb'].') '.$value['nb_total'].'    '.$value['stock'].' '.$img.'
  
'.$langs->trans("AddRefInList").'  '; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { @@ -799,7 +799,7 @@ print '
'.$langs->trans("AddAdressInList").'  '; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { @@ -814,7 +814,7 @@ print '
'.$langs->trans("AddEmailPhoneTownInContactList").'  '; if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { print ''; @@ -830,7 +830,7 @@ if (!empty($conf->expedition->enabled)) { if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print '
'.$langs->trans("AskForPreferredShippingMethod").'  '; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { @@ -848,7 +848,7 @@ if (!empty($conf->expedition->enabled)) { // Disable Prospect/Customer thirdparty type print '
'.$langs->trans("DisableProspectCustomerType").'  '; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index badf3840582..ee60b90b994 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -340,7 +340,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print '        '; - print ' '; + print ' '; print ''; - print ' '; + print ' '; print ''; - print ' '; + print ' '; print '
'; - $this->info_box_contents[0][0] = array( 'td' => '', 'textnoformat' => $boxstat From 58a39a263bed3ce449bebb31318a392be0a7514f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:44:09 +0100 Subject: [PATCH 104/119] Update box_produits.php --- htdocs/core/boxes/box_produits.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index f36b0500655..44333683000 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2021 Frederic 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 @@ -196,7 +196,7 @@ class box_produits extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', 'asis' => 1 ); From 8c71c8335e037c14a703daae0de9cabc9df230bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 19:44:22 +0100 Subject: [PATCH 105/119] Fix TZ problems --- htdocs/comm/action/index.php | 56 +++++++++++++-------------- htdocs/comm/action/list.php | 10 ++--- htdocs/comm/action/pertype.php | 38 +++++++++--------- htdocs/comm/action/peruser.php | 56 ++++++++++++++------------- htdocs/core/class/html.form.class.php | 10 +++-- htdocs/core/lib/company.lib.php | 36 ++++++++--------- htdocs/theme/eldy/global.inc.php | 8 ++++ 7 files changed, 112 insertions(+), 102 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e969351c41e..d5f5edbb143 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -280,10 +280,10 @@ if (empty($action) || $action == 'show_month') $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'tzuserrel'); $next_day = 7 - ($max_day_in_month + 1 - $tmpday) % 7; if ($next_day < 6) $next_day += 7; - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } if ($action == 'show_week') { @@ -304,10 +304,10 @@ if ($action == 'show_week') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); - $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); + $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year, 'gmt')); $tmpday = $first_day; } @@ -323,8 +323,8 @@ if ($action == 'show_day') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'gmt'); - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; @@ -607,17 +607,18 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND (a.fk_soc IS if ($socid > 0) $sql .= ' AND a.fk_soc = '.$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; +//var_dump($day.' '.$month.' '.$year); if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -723,9 +724,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); //var_dump($annee.'-'.$mois.'-'.$jour); @@ -1539,9 +1540,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa foreach ($eventarray as $daykey => $notused) { - $annee = date('Y', $daykey); - $mois = date('m', $daykey); - $jour = date('d', $daykey); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { @@ -1703,20 +1704,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (empty($event->fulldayevent)) { // Show hours (start ... end) - $tmpyearstart = date('Y', $event->date_start_in_calendar); - $tmpmonthstart = date('m', $event->date_start_in_calendar); - $tmpdaystart = date('d', $event->date_start_in_calendar); - $tmpyearend = date('Y', $event->date_end_in_calendar); - $tmpmonthend = date('m', $event->date_end_in_calendar); - $tmpdayend = date('d', $event->date_end_in_calendar); - /*var_dump($tmpyearstart.' '.$tmpmonthstart.' '.$tmpdaystart); - var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend); - var_dump($annee.' '.$mois.' '.$jour);*/ + $tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel'); + $tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel'); + $tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel'); + $tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel'); // Hour start if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) { - $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) @@ -1736,7 +1734,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); } } else { if ($showinfo) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ed7caa173b1..b1d864589e8 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,9 +67,9 @@ $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); -$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); -$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); +$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'), 'tzuserrel'); +$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); @@ -566,12 +566,12 @@ if ($resql) if (!empty($arrayfields['a.note']['checked'])) print ''; if (!empty($arrayfields['a.datep']['checked'])) { print ''; - print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); + print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['a.datep2']['checked'])) { print ''; - print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0); + print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['s.nom']['checked'])) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f956b5ae5f7..a399ee3d580 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -265,7 +265,7 @@ $next_month = $month; $next_day = $day; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) -$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); +$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); //print $firstday.'-'.$first_month.'-'.$first_year; //print dol_print_date($firstdaytoshow,'dayhour'); @@ -482,14 +482,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -599,9 +599,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -858,9 +858,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { @@ -931,9 +931,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -944,13 +944,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -990,13 +990,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 2dc62a52e91..6b54a327705 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -404,7 +404,11 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); + if ($begin_h !== '') $newparam .= '&begin_h='.urlencode($begin_h); + if ($end_h !== '') $newparam .= '&end_h='.urlencode($end_h); + if ($begin_d !== '') $newparam .= '&begin_d='.urlencode($begin_d); + if ($end_d !== '') $newparam .= '&end_d='.urlencode($end_d); //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; @@ -487,14 +491,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -605,9 +609,10 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); + //print $daycursor.' '.dol_print_date($daycursor, 'dayhour', 'gmt').' '.$event->id.' -> '.$annee.'-'.$mois.'-'.$jour.'
'; // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -920,7 +925,7 @@ jQuery(document).ready(function() { if (ids == \'none\') /* No event */ { /* alert(\'no event\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'" + url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day.($begin_h !== '' ? '&begin_h='.$begin_h : '').($end_h !== '' ? '&end_h='.$end_h : '').($begin_d !== '' ? '&begin_d='.$begin_d : '').($end_d !== '' ? '&end_d='.$end_d : '')).'" window.location.href = url; } else if (ids.indexOf(",") > -1) /* There is several events */ @@ -979,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2 = array(); // Color second half hour $i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array(); - $ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $nextindextouse = count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... @@ -988,16 +993,16 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { // Scan all event for this date foreach ($eventarray[$daykey] as $index => $event) { - //print $daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; + //print $daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; //var_dump($event); $keysofuserassigned = array_keys($event->userassigned); @@ -1078,7 +1083,6 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // Define color $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } - //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Define all rects with event (cases1 is first half hour, cases2 is second half hour) for ($h = $begin_h; $h < $end_h; $h++) @@ -1087,9 +1091,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -1100,13 +1104,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -1146,13 +1150,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0cd09c52dbd..2b08d83d683 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5586,9 +5586,11 @@ class Form */ public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = 're', $empty = 0) { - $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty); - $ret .= '
'; - $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty); + global $langs; + + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); + $ret .= '
'; + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); return $ret; } @@ -5703,7 +5705,7 @@ class Form if (strval($set_time) != '' && $set_time != -1) { //$formated_date=dol_print_date($set_time,$conf->format_date_short); - $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput"), $gm); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript } // Calendrier popup version eldy diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 133a8fb86cd..a424657e206 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1206,27 +1206,23 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin global $form; global $param, $massactionbutton; - $start_year = GETPOST('dateevent_startyear'); - $start_month = GETPOST('dateevent_startmonth'); - $start_day = GETPOST('dateevent_startday'); - $end_year = GETPOST('dateevent_endyear'); - $end_month = GETPOST('dateevent_endmonth'); - $end_day = GETPOST('dateevent_endday'); + $start_year = GETPOST('dateevent_startyear', 'int'); + $start_month = GETPOST('dateevent_startmonth', 'int'); + $start_day = GETPOST('dateevent_startday', 'int'); + $end_year = GETPOST('dateevent_endyear', 'int'); + $end_month = GETPOST('dateevent_endmonth', 'int'); + $end_day = GETPOST('dateevent_endday', 'int'); $tms_start = ''; $tms_end = ''; if (!empty($start_year) && !empty($start_month) && !empty($start_day)) { - $search_start = $start_year.'-'.$start_month.'-'.$start_day; - $tms_start = strtotime($search_start); + $tms_start = dol_mktime(0, 0, 0, $start_month, $start_day, $start_year, 'tzuserrel'); } if (!empty($end_year) && !empty($end_month) && !empty($end_day)) { - $search_end = $end_year.'-'.$end_month.'-'.$end_day.' 23:59:59'; - $tms_end = strtotime($search_end); + $tms_end = dol_mktime(23, 59, 59, $end_month, $end_day, $end_year, 'tzuserrel'); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers - $search_start = ''; $tms_start = ''; - $search_end = ''; $tms_end = ''; } dol_include_once('/comm/action/class/actioncomm.class.php'); @@ -1328,14 +1324,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep BETWEEN '$search_start' AND '$search_end') OR (a.datep2 BETWEEN '$search_start' AND '$search_end'))"; + if (!empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))"; } - elseif (empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep <= '$search_end') OR (a.datep2 <= '$search_end'))"; + elseif (empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))"; } - elseif (!empty($search_start) && empty($search_end)) { - $sql .= " AND ((a.datep >= '$search_start') OR (a.datep2 >= '$search_start'))"; + elseif (!empty($tms_start) && empty($tms_end)) { + $sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))"; } if (is_array($actioncode) && !empty($actioncode)) { @@ -1491,7 +1487,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1); $out .= ''; $out .= ''; - $out .= ''.$form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1).''; + $out .= ''; + $out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1); + $out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 1d155bf0cc9..d39e7a3e1b5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -816,7 +816,15 @@ span.fa.fa-plus-circle.paddingleft { } #formuserfile input[type='file'] { font-size: 1em; + /* opacity: 0.5em; */ } +/*#formuserfile input[type='file']:valid { + color: #a00; +} +#formuserfile input[type='file']:empty { + color: #0a0; +}*/ + #formuserfile_link { margin-left: 1px; } From dbe5c23ed5547ee38df63a4634503b3cf2379d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:45:18 +0100 Subject: [PATCH 106/119] Update box_produits_alerte_stock.php --- htdocs/core/boxes/box_produits_alerte_stock.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 5d1e944d805..0c6752ec764 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005-2012 Maxime Kohlhaas - * Copyright (C) 2015-2019 Frédéric France + * Copyright (C) 2015-2021 Frédéric France * Copyright (C) 2015 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -206,23 +206,24 @@ class box_produits_alerte_stock extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tobuy, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tobuy, 3, 0).'', 'asis' => 1 ); $line++; } - if ($num == 0) + if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', 'text'=>$langs->trans("NoTooLowStockProducts"), ); + } $this->db->free($result); } else { From 45789ec21ca07bd17a0c62d410532935d6dce3fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 19:44:22 +0100 Subject: [PATCH 107/119] Fix TZ problems Conflicts: htdocs/core/lib/company.lib.php --- htdocs/comm/action/index.php | 56 +++++++++++++-------------- htdocs/comm/action/list.php | 10 ++--- htdocs/comm/action/pertype.php | 38 +++++++++--------- htdocs/comm/action/peruser.php | 56 ++++++++++++++------------- htdocs/core/class/html.form.class.php | 10 +++-- htdocs/core/lib/company.lib.php | 39 ++++++++++--------- htdocs/theme/eldy/global.inc.php | 8 ++++ 7 files changed, 115 insertions(+), 102 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5396454667b..99287ec82d7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -280,10 +280,10 @@ if (empty($action) || $action == 'show_month') $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'tzuserrel'); $next_day = 7 - ($max_day_in_month + 1 - $tmpday) % 7; if ($next_day < 6) $next_day += 7; - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } if ($action == 'show_week') { @@ -304,10 +304,10 @@ if ($action == 'show_week') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); - $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); + $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year, 'gmt')); $tmpday = $first_day; } @@ -323,8 +323,8 @@ if ($action == 'show_day') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'gmt'); - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; @@ -607,17 +607,18 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND (a.fk_soc IS if ($socid > 0) $sql .= ' AND a.fk_soc = '.$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; +//var_dump($day.' '.$month.' '.$year); if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -723,9 +724,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); //var_dump($annee.'-'.$mois.'-'.$jour); @@ -1539,9 +1540,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa foreach ($eventarray as $daykey => $notused) { - $annee = date('Y', $daykey); - $mois = date('m', $daykey); - $jour = date('d', $daykey); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { @@ -1703,20 +1704,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (empty($event->fulldayevent)) { // Show hours (start ... end) - $tmpyearstart = date('Y', $event->date_start_in_calendar); - $tmpmonthstart = date('m', $event->date_start_in_calendar); - $tmpdaystart = date('d', $event->date_start_in_calendar); - $tmpyearend = date('Y', $event->date_end_in_calendar); - $tmpmonthend = date('m', $event->date_end_in_calendar); - $tmpdayend = date('d', $event->date_end_in_calendar); - /*var_dump($tmpyearstart.' '.$tmpmonthstart.' '.$tmpdaystart); - var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend); - var_dump($annee.' '.$mois.' '.$jour);*/ + $tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel'); + $tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel'); + $tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel'); + $tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel'); // Hour start if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) { - $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) @@ -1736,7 +1734,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); } } else { if ($showinfo) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 991e945b16d..2db2d988add 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,9 +67,9 @@ $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); -$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); -$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); +$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'), 'tzuserrel'); +$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); @@ -563,12 +563,12 @@ if ($resql) if (!empty($arrayfields['a.note']['checked'])) print ''; if (!empty($arrayfields['a.datep']['checked'])) { print ''; - print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); + print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['a.datep2']['checked'])) { print ''; - print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0); + print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['s.nom']['checked'])) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f956b5ae5f7..a399ee3d580 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -265,7 +265,7 @@ $next_month = $month; $next_day = $day; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) -$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); +$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); //print $firstday.'-'.$first_month.'-'.$first_year; //print dol_print_date($firstdaytoshow,'dayhour'); @@ -482,14 +482,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -599,9 +599,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -858,9 +858,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { @@ -931,9 +931,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -944,13 +944,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -990,13 +990,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 2dc62a52e91..6b54a327705 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -404,7 +404,11 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); + if ($begin_h !== '') $newparam .= '&begin_h='.urlencode($begin_h); + if ($end_h !== '') $newparam .= '&end_h='.urlencode($end_h); + if ($begin_d !== '') $newparam .= '&begin_d='.urlencode($begin_d); + if ($end_d !== '') $newparam .= '&end_d='.urlencode($end_d); //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; @@ -487,14 +491,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -605,9 +609,10 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); + //print $daycursor.' '.dol_print_date($daycursor, 'dayhour', 'gmt').' '.$event->id.' -> '.$annee.'-'.$mois.'-'.$jour.'
'; // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -920,7 +925,7 @@ jQuery(document).ready(function() { if (ids == \'none\') /* No event */ { /* alert(\'no event\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'" + url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day.($begin_h !== '' ? '&begin_h='.$begin_h : '').($end_h !== '' ? '&end_h='.$end_h : '').($begin_d !== '' ? '&begin_d='.$begin_d : '').($end_d !== '' ? '&end_d='.$end_d : '')).'" window.location.href = url; } else if (ids.indexOf(",") > -1) /* There is several events */ @@ -979,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2 = array(); // Color second half hour $i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array(); - $ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $nextindextouse = count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... @@ -988,16 +993,16 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { // Scan all event for this date foreach ($eventarray[$daykey] as $index => $event) { - //print $daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; + //print $daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; //var_dump($event); $keysofuserassigned = array_keys($event->userassigned); @@ -1078,7 +1083,6 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // Define color $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } - //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Define all rects with event (cases1 is first half hour, cases2 is second half hour) for ($h = $begin_h; $h < $end_h; $h++) @@ -1087,9 +1091,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -1100,13 +1104,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -1146,13 +1150,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0348a01de3f..e75e1eeed44 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5511,9 +5511,11 @@ class Form */ public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = 're', $empty = 0) { - $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty); - $ret .= '
'; - $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty); + global $langs; + + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); + $ret .= '
'; + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); return $ret; } @@ -5628,7 +5630,7 @@ class Form if (strval($set_time) != '' && $set_time != -1) { //$formated_date=dol_print_date($set_time,$conf->format_date_short); - $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput"), $gm); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript } // Calendrier popup version eldy diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1e2be9e856d..10cec80edda 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1206,24 +1206,23 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin global $form; global $param, $massactionbutton; - $start_year = GETPOST('dateevent_startyear'); - $start_month = GETPOST('dateevent_startmonth'); - $start_day = GETPOST('dateevent_startday'); - $end_year = GETPOST('dateevent_endyear'); - $end_month = GETPOST('dateevent_endmonth'); - $end_day = GETPOST('dateevent_endday'); + $start_year = GETPOST('dateevent_startyear', 'int'); + $start_month = GETPOST('dateevent_startmonth', 'int'); + $start_day = GETPOST('dateevent_startday', 'int'); + $end_year = GETPOST('dateevent_endyear', 'int'); + $end_month = GETPOST('dateevent_endmonth', 'int'); + $end_day = GETPOST('dateevent_endday', 'int'); + $tms_start = ''; + $tms_end = ''; + if (!empty($start_year) && !empty($start_month) && !empty($start_day)) { - $search_start = $start_year.'-'.$start_month.'-'.$start_day; - $tms_start = strtotime($search_start); + $tms_start = dol_mktime(0, 0, 0, $start_month, $start_day, $start_year, 'tzuserrel'); } if (!empty($end_year) && !empty($end_month) && !empty($end_day)) { - $search_end = $end_year.'-'.$end_month.'-'.$end_day.' 23:59:59'; - $tms_end = strtotime($search_end); + $tms_end = dol_mktime(23, 59, 59, $end_month, $end_day, $end_year, 'tzuserrel'); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers - $search_start = ''; $tms_start = ''; - $search_end = ''; $tms_end = ''; } dol_include_once('/comm/action/class/actioncomm.class.php'); @@ -1325,14 +1324,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep BETWEEN '$search_start' AND '$search_end') OR (a.datep2 BETWEEN '$search_start' AND '$search_end'))"; + if (!empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))"; } - elseif (empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep <= '$search_end') OR (a.datep2 <= '$search_end'))"; + elseif (empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))"; } - elseif (!empty($search_start) && empty($search_end)) { - $sql .= " AND ((a.datep >= '$search_start') OR (a.datep2 >= '$search_start'))"; + elseif (!empty($tms_start) && empty($tms_end)) { + $sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))"; } if (is_array($actioncode) && !empty($actioncode)) { @@ -1488,7 +1487,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1); $out .= ''; $out .= ''; - $out .= ''.$form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1).''; + $out .= ''; + $out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1); + $out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d9e2a70eab2..bc6bf8327e9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -801,7 +801,15 @@ span.fa.fa-plus-circle.paddingleft { } #formuserfile input[type='file'] { font-size: 1em; + /* opacity: 0.5em; */ } +/*#formuserfile input[type='file']:valid { + color: #a00; +} +#formuserfile input[type='file']:empty { + color: #0a0; +}*/ + #formuserfile_link { margin-left: 1px; } From 1f32d4a815ff033eea843ccb552677fee6e2d652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:21:21 +0100 Subject: [PATCH 108/119] Avoid warning --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4aead28ffda..a8e08ef1440 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4107,21 +4107,21 @@ function dol_print_error($db = '', $error = '', $errors = null) $out .= "".$langs->trans("Date").": ".dol_print_date(time(), 'dayhourlog')."
\n"; $out .= "".$langs->trans("Dolibarr").": ".DOL_VERSION." - https://www.dolibarr.org
\n"; - if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".$conf->global->MAIN_FEATURES_LEVEL."
\n"; + if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".dol_htmlentities($conf->global->MAIN_FEATURES_LEVEL, ENT_COMPAT)."
\n"; if (function_exists("phpversion")) { $out .= "".$langs->trans("PHP").": ".phpversion()."
\n"; } - $out .= "".$langs->trans("Server").": ".dol_htmlentities($_SERVER["SERVER_SOFTWARE"])."
\n"; + $out .= "".$langs->trans("Server").": ".(isset($_SERVER["SERVER_SOFTWARE"]) ? dol_htmlentities($_SERVER["SERVER_SOFTWARE"], ENT_COMPAT) : '')."
\n"; if (function_exists("php_uname")) { $out .= "".$langs->trans("OS").": ".php_uname()."
\n"; } - $out .= "".$langs->trans("UserAgent").": ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8')."
\n"; + $out .= "".$langs->trans("UserAgent").": ".(isset($_SERVER["HTTP_USER_AGENT"]) ? dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT) : '')."
\n"; $out .= "
\n"; - $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."
\n"; - $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."
\n"; - $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu) : '')."
\n"; + $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT)."
\n"; + $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n"; + $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu, ENT_COMPAT) : '')."
\n"; $out .= "
\n"; $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]); $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]); From e474ee4d16ca5d5e40a799da48698f0524a0e08e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:30:46 +0100 Subject: [PATCH 109/119] Fix add missing field --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_expensereport.sql | 1 + htdocs/install/mysql/tables/llx_projet.sql | 9 +++++---- 3 files changed, 10 insertions(+), 4 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 f12cd42e028..e58a197b58b 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 @@ -124,3 +124,7 @@ ALTER TABLE llx_socpeople MODIFY poste varchar(255); ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; + + +ALTER TABLE llx_fichinter ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; +ALTER TABLE llx_projet ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql index d591de78436..36bd5efb50c 100644 --- a/htdocs/install/mysql/tables/llx_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.sql @@ -53,6 +53,7 @@ CREATE TABLE llx_expensereport ( integration_compta integer DEFAULT NULL, -- not used fk_bank_account integer DEFAULT NULL, model_pdf varchar(50) DEFAULT NULL, + last_main_doc varchar(255), -- relative filepath+filename of last main generated document fk_multicurrency integer, multicurrency_code varchar(255), diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 1b95444b3a1..76d254aafd3 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -44,10 +44,11 @@ create table llx_projet --budget_days real, -- budget in days is sum of field planned_workload of tasks opp_amount double(24,8), budget_amount double(24,8), - usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity - usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet - usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices - usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event, receive attendees subscription + usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity + usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet + usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices + usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event, receive attendees subscription model_pdf varchar(255), + last_main_doc varchar(255), -- relative filepath+filename of last main generated document import_key varchar(14) -- Import key )ENGINE=innodb; From fc30b9196097d025266e23b067596e5d2366aa90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:56:57 +0100 Subject: [PATCH 110/119] Fix warning --- htdocs/core/modules/DolibarrModules.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index a5b58e17dcb..485b079d1cd 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1867,9 +1867,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : ''); $menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : ''; $menu->title = $this->menu[$key]['titre']; - $menu->prefix = $this->menu[$key]['prefix']; + $menu->prefix = isset($this->menu[$key]['prefix']) ? $this->menu[$key]['prefix'] : ''; $menu->url = $this->menu[$key]['url']; - $menu->langs = $this->menu[$key]['langs']; + $menu->langs = isset($this->menu[$key]['langs']) ? $this->menu[$key]['langs'] : ''; $menu->position = $this->menu[$key]['position']; $menu->perms = $this->menu[$key]['perms']; $menu->target = isset($this->menu[$key]['target']) ? $this->menu[$key]['target'] : ''; From b43dfe113960ce8bd75dd4a6ee7ac1b7b1a6ff82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 22:04:46 +0100 Subject: [PATCH 111/119] add ecm picto in left menu --- htdocs/core/modules/modECM.class.php | 101 +++++++++++++++------------ 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index d83edc6cf96..847200adc4f 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -123,59 +123,68 @@ class modECM extends DolibarrModules $r = 0; // Top menu - $this->menu[$r] = array('fk_menu'=>0, - 'type'=>'top', - 'titre'=>'MenuECM', - 'mainmenu'=>'ecm', - 'url'=>'/ecm/index.php', - 'langs'=>'ecm', - 'position'=>82, - 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup', - 'enabled'=>'$conf->ecm->enabled', - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>0, + 'type'=>'top', + 'titre'=>'MenuECM', + 'mainmenu'=>'ecm', + 'url'=>'/ecm/index.php', + 'langs'=>'ecm', + 'position'=>82, + 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup', + 'enabled'=>'$conf->ecm->enabled', + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; // Left menu linked to top menu - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=ecm', - 'type'=>'left', - 'titre'=>'ECMArea', - 'mainmenu'=>'ecm', - 'leftmenu'=>'ecm', - 'url'=>'/ecm/index.php?mainmenu=ecm&leftmenu=ecm', - 'langs'=>'ecm', - 'position'=>101, - 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>'fk_mainmenu=ecm', + 'type'=>'left', + 'titre'=>'ECMArea', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'mainmenu'=>'ecm', + 'leftmenu'=>'ecm', + 'url'=>'/ecm/index.php?mainmenu=ecm&leftmenu=ecm', + 'langs'=>'ecm', + 'position'=>101, + 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm', - 'type'=>'left', - 'titre'=>'ECMSectionsManual', - 'mainmenu'=>'ecm', - 'leftmenu'=>'ecm_manual', - 'url'=>'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm', - 'langs'=>'ecm', - 'position'=>102, - 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm', + 'type'=>'left', + 'titre'=>'ECMSectionsManual', + 'mainmenu'=>'ecm', + 'leftmenu'=>'ecm_manual', + 'url'=>'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm', + 'langs'=>'ecm', + 'position'=>102, + 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm', - 'type'=>'left', - 'titre'=>'ECMSectionsAuto', - 'mainmenu'=>'ecm', - 'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm', - 'langs'=>'ecm', - 'position'=>103, - 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm', + 'type'=>'left', + 'titre'=>'ECMSectionsAuto', + 'mainmenu'=>'ecm', + 'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm', + 'langs'=>'ecm', + 'position'=>103, + 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; } } From 3c8ddf917f4a120ea4f69b93f281835b9e88e51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 22:15:20 +0100 Subject: [PATCH 112/119] add barcode picto in left menu --- htdocs/core/modules/modBarcode.class.php | 65 +++++++++++++----------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index 6a894972eb7..93c67f63b3c 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -93,30 +93,35 @@ class modBarcode extends DolibarrModules // Main menu entries $r = 0; - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'mainmenu'=>'tools', - 'leftmenu'=>'barcodeprint', - 'type'=>'left', // This is a Left menu entry - 'titre'=>'BarCodePrintsheet', - 'url'=>'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint', - 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>200, - 'enabled'=>'$conf->barcode->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'mainmenu'=>'tools', + 'leftmenu'=>'barcodeprint', + 'type'=>'left', // This is a Left menu entry + 'titre'=>'BarCodePrintsheet', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'url'=>'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint', + 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>200, + 'enabled'=>'$conf->barcode->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'MassBarcodeInit', - 'url'=>'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools', - 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>300, - 'enabled'=>'$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>0); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r] = array( + 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'MassBarcodeInit', + 'url'=>'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools', + 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>300, + 'enabled'=>'$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>0, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; } @@ -135,14 +140,14 @@ class modBarcode extends DolibarrModules $this->remove($options); $sql = array( - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)", 'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('QRCODE', 'Qr Code', 0, 'www.dolibarr.org', __ENTITY__)", 'ignoreerror'=>1) + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)", 'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('QRCODE', 'Qr Code', 0, 'www.dolibarr.org', __ENTITY__)", 'ignoreerror'=>1) ); return $this->_init($sql, $options); From e1a22b7209b16dd2a11f4a6826388ad9077af6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 22:18:34 +0100 Subject: [PATCH 113/119] add blockedlog picto in left menu --- htdocs/core/modules/modBlockedLog.class.php | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 7365f55cf7c..e36827f2dee 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -124,18 +124,20 @@ class modBlockedLog extends DolibarrModules // ----------------- $r = 0; $this->menu[$r] = array( - 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'mainmenu'=>'tools', - 'leftmenu'=>'blockedlogbrowser', - 'type'=>'left', // This is a Left menu entry - 'titre'=>'BrowseBlockedLog', - 'url'=>'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser', - 'langs'=>'blockedlog', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>200, - 'enabled'=>'$conf->blockedlog->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->blockedlog->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'mainmenu'=>'tools', + 'leftmenu'=>'blockedlogbrowser', + 'type'=>'left', // This is a Left menu entry + 'titre'=>'BrowseBlockedLog', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'url'=>'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser', + 'langs'=>'blockedlog', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>200, + 'enabled'=>'$conf->blockedlog->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->blockedlog->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; } From c83ccb1e0f65a149f0210c44eae75925f8ffd54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 8 Feb 2021 00:46:46 +0100 Subject: [PATCH 114/119] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a8e08ef1440..90840b32a2e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4507,7 +4507,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; print "\n"; - print "\n"; + print "\n"; print ''; // maring bottom must be same than into load_fiche_tire // Left From 13b83e3150c7e726cbd0dd8f80ebfa229ba086aa Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 8 Feb 2021 09:47:43 +0100 Subject: [PATCH 115/119] Fix search by statut in list of holiday module --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index cbd9b76e45e..cb8da24052b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -106,7 +106,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOST('search_statut', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects From 31ca17c619964ddc3b1172f661f6382273002054 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:06:21 +0100 Subject: [PATCH 116/119] fix require once --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23838ea1e62..7fbff101859 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2229,6 +2229,7 @@ class Form { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid "; if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $soc = new Societe($db); $result = $soc->fetch($socid); if ($result > 0 && !empty($soc->default_lang)) { From 1e8117dc8a446ffd68ff600072eebfde285d0b55 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:49:30 +0100 Subject: [PATCH 117/119] fix js --- htdocs/core/class/commonobject.class.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b9f98adfe04..6472ea8673e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7169,9 +7169,6 @@ abstract class CommonObject if ($(this).val() == 0){ $("#"+child_list).hide(); } - - $("select[name=\""+parent_list+"\"]").change(function() { - showOptions(child_list, parent_list, orig_select[child_list]); }); }); } From c0c60475388dbabe272fae177ce6532e3304723d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:54:29 +0100 Subject: [PATCH 118/119] fix ajax product missing condigtion --- htdocs/product/ajax/products.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 5b297cb33a5..89e9419fec0 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -82,14 +82,10 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) $found = false; $price_level = 1; - if ($socid > 0 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { + if ($socid > 0 ) { $thirdpartytemp = new Societe($db); $thirdpartytemp->fetch($socid); - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $price_level = $thirdpartytemp->price_level; - } - //Load translation description and label if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $newlang = $thirdpartytemp->default_lang; @@ -104,6 +100,10 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) $outlabel_trans = $object->label; } } + + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + $price_level = $thirdpartytemp->price_level; + } } // Price by qty From d0bbf5bf35a9638de3ec4a234455ac403a73c638 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 15:08:24 +0100 Subject: [PATCH 119/119] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 90840b32a2e..0ab4f39c52f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4507,7 +4507,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; print "\n"; - print "\n"; + print "\n"; print '
'; // maring bottom must be same than into load_fiche_tire // Left