From 850ec25f23541fefd27814e2eb642782ce96dde3 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 2 Apr 2024 21:29:21 +0200 Subject: [PATCH 01/18] move BILLREC_CREATEBILL to facture because of user can click on button "create" from ui, not only from cron --- htdocs/compta/facture/class/facture-rec.class.php | 10 ---------- htdocs/compta/facture/class/facture.class.php | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index e8c965f5937..aa1a45e0b36 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1367,16 +1367,6 @@ class FactureRec extends CommonInvoice $error++; } } - if (!$error && !$notrigger) { - // Call trigger - $result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user); - if ($result < 0) { - $this->errors = $facturerec->errors; - $this->error = $facturerec->error; - $error++; - } - // End call triggers - } } else { $error++; $this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b610327f7e9..9bb919de5bd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1092,9 +1092,18 @@ class Facture extends CommonInvoice if ($result < 0) { $error++; } + + //special case for recurring invoices, moved from facture-rec.class.php + if (!$error && $this->fac_rec > 0) { + $result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user); + if ($result < 0) { + $error++; + } + } // End call triggers } + if (!$error) { $this->db->commit(); return $this->id; From 6bd2d78fc9d1d2b9f181cd2880b2792943afaa18 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 2 Apr 2024 21:35:25 +0200 Subject: [PATCH 02/18] fix object call --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9bb919de5bd..e01d5442d03 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1095,7 +1095,7 @@ class Facture extends CommonInvoice //special case for recurring invoices, moved from facture-rec.class.php if (!$error && $this->fac_rec > 0) { - $result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user); + $result = $this->call_trigger('BILLREC_CREATEBILL', $user); if ($result < 0) { $error++; } From 50f99a51bbfc19297bf9f0f9d2a3bedc1f64cf97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 02:37:30 +0200 Subject: [PATCH 03/18] Remove trigger BILLREC_CREATEBILL that should not exists as it is duplicate of BILL_CREATE. This trigger was not a CRUD event. If you used it, you can already use the trigger BILL_CREATE and test that ($object->fac_rec > 0) to know if creation trigger is from a recurring invoice or not. Also this old trigger was never enabled into table llx_c_action_trigger. --- ChangeLog | 6 +++++- htdocs/compta/facture/class/facture.class.php | 10 ---------- htdocs/install/mysql/data/llx_c_action_trigger.sql | 2 -- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8efc905db7..00d936e3deb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ English Dolibarr ChangeLog For users: ---------- -NEW: Compatibility with PHP 8.3 +NEW: Compatibility with PHP 8.2 (with no need to disable warnings) ... For developers or integrators: @@ -34,6 +34,10 @@ The following changes may create regressions for some external modules, but were the deprecated field $fk_user_done in actioncomm table is removed. Please use $fk_user_action instead. * The table commande_fournisseur_dispatch has been renamed into receptiondet_batch to better match its goal and the field fk_commande and fk_commandefourndet were renamed into fk_element and fk_elementdet +* Removed trigger BILLREC_CREATEBILL. This trigger was not a CRUD event. If you used it, you can already use the trigger BILL_CREATE and + test that ($object->fac_rec > 0) to know if creation trigger is from a recurring invoice or not. Also this old trigger was never enabled + into table llx_c_action_trigger. + ***** ChangeLog for 19.0.1 compared to 19.0.0 ***** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7b8b534eed8..883019bddc8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1090,18 +1090,8 @@ class Facture extends CommonInvoice if ($result < 0) { $error++; } - - //special case for recurring invoices, moved from facture-rec.class.php - if (!$error && $this->fac_rec > 0) { - $result = $this->call_trigger('BILLREC_CREATEBILL', $user); - if ($result < 0) { - $error++; - } - } - // End call triggers } - if (!$error) { $this->db->commit(); return $this->id; diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 5ed3730adc1..eeda692ce9f 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -192,11 +192,9 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_CREATE','Template invoices created','Executed when a Template invoices is created','facturerec',900); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902); ---insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903); -- partnership module insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PARTNERSHIP_CREATE','Partnership created','Executed when a partnership is created','partnership',58000); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PARTNERSHIP_MODIFY','Partnership modified','Executed when a partnership is modified','partnership',58002); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PARTNERSHIP_SENTBYMAIL','Mails sent from partnership file','Executed when you send email from partnership file','partnership',58004); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PARTNERSHIP_DELETE','Partnership deleted','Executed when a partnership is deleted','partnership',58006); - From 20e0417f3b31196c0d5d7f8c55a08be78564dfb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 02:59:58 +0200 Subject: [PATCH 04/18] Fix warning --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 886d8fded87..3729c2c1f4a 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -63,7 +63,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield $totalarray['nbfield']++; } - if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { + if (!empty($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key])) { if (!$i) { // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; @@ -75,7 +75,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } } - // key 'totalizable' if in extrafields same as 'isameasure' into ->$fields + // The key 'totalizable' on extrafields, is the same as 'isameasure' into ->fields if (!empty($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = $extrafieldsobjectprefix.$tmpkey; @@ -86,7 +86,12 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield if (!isset($totalarray['val'][$extrafieldsobjectprefix.$tmpkey])) { $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] = 0; } - $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] += $obj->$tmpkey; + if (isset($obj->$tmpkey) && is_numeric($obj->$tmpkey)) { + if (!isset($totalarray['val'][$extrafieldsobjectprefix.$tmpkey])) { + $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] = 0; + } + $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] += $obj->$tmpkey; + } } } } From c31c7664315f7f677665927500ddd12ecc6afcdb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 03:27:28 +0200 Subject: [PATCH 05/18] Debug v20 --- htdocs/bom/tpl/objectline_create.tpl.php | 10 +++++----- htdocs/bom/tpl/objectline_view.tpl.php | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index cf927bc763c..f76695eb2c1 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -196,11 +196,11 @@ if ($filtertype != 1) { print ''; } - $coldisplay += $colspan; - print ''; - print ''; - print ''; - print ''; +$coldisplay += $colspan; +print ''; +print ''; +print ''; +print ''; ?> diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 6489f833759..463a92d4ee8 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -351,11 +351,12 @@ if ($resql) { print ''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * (float) $line->qty, 'MT')).''; $total_cost .= $sub_bom_product->pmp * $sub_bom_line->qty * (float) $line->qty; } else { // Minimum purchase price if cost price and PMP aren't defined - $sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; - $sql_supplier_price .= ' WHERE fk_product = '. (int) $sub_bom_product->id; + $sql_supplier_price = "SELECT MIN(price) AS min_price, quantity AS qty FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; + $sql_supplier_price .= " WHERE fk_product = ". (int) $sub_bom_product->id; + $sql_supplier_price .= " GROUP BY quantity ORDER BY quantity ASC"; $resql_supplier_price = $object->db->query($sql_supplier_price); if ($resql_supplier_price) { - $obj = $object->db->fetch_object($resql_supplier_price); + $obj = $object->db->fetch_object($resql_supplier_price); // Take first value so the ref with the smaller minimum quantity if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) { $line_cost = $obj->min_price / $obj->qty * $sub_bom_line->qty * (float) $line->qty; } else { From 5acdcac75d18694dcdff2671614113f5672997f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 12:25:06 +0200 Subject: [PATCH 06/18] Debug v20 --- dev/translation/ignore_translation_keys.lst | 13 ------------ htdocs/admin/modules.php | 2 +- htdocs/compta/paiement/cheque/index.php | 4 ++-- htdocs/core/lib/mailmanspip.lib.php | 4 ++-- htdocs/fourn/commande/card.php | 8 +++---- htdocs/langs/en_US/stripe.lang | 11 +++++++++- htdocs/stripe/admin/stripe.php | 1 - htdocs/theme/eldy/global.inc.php | 22 ++++++++++---------- htdocs/theme/eldy/info-box.inc.php | 23 +++++++++++++++++---- htdocs/theme/md/info-box.inc.php | 11 +++++++++- htdocs/theme/md/style.css.php | 2 +- 11 files changed, 60 insertions(+), 41 deletions(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 4e58e862175..1f6bbe80e59 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -404,11 +404,6 @@ EventFee EventIntoASerie EventOrganizationArea EventParticipant -ExampleOnlyForATBEDEITNLESCustomers -ExampleOnlyForBECustomers -ExampleOnlyForDECustomers -ExampleOnlyForKlarnaCustomers -ExampleOnlyForNLCustomers Expedition Experimental Expired @@ -519,7 +514,6 @@ MO MRP MYDATA_AADE_KEY MYDATA_AADE_USER -Mailman MainAccountForRevenueStampSaleNotDefined Manual Map @@ -755,18 +749,11 @@ Roles Rowid RulesPurchaseTurnoverCollectedOfExpenseAccounts SID -SOAPError -SPIP SQL SQLSort STATE_ STATE_IPP_ STRIPE_APPLICATION_FEE_PLATFORM -STRIPE_BANCONTACT -STRIPE_GIROPAY -STRIPE_IDEAL -STRIPE_KLARNA -STRIPE_SOFORT ST_ SaveFailed Saved diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 0a4dd01d914..dedf6b55677 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -641,7 +641,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= ''; $moreforfilter .= ' '; $moreforfilter .= '
'; - $moreforfilter .= ''; + $moreforfilter .= ''; if ($search_keyword || ($search_nature && $search_nature != '-1') || ($search_version && $search_version != '-1') || ($search_status && $search_status != '-1')) { $moreforfilter .= ' '; $moreforfilter .= ''; diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 98d938a23af..bd110ba8169 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -177,8 +177,8 @@ foreach ($arrayofpaymentmodetomanage as $val) { print ''.$checkdepositstatic->getNomUrl(1).''; print ''.dol_print_date($db->jdate($objp->db), 'day').''; print ''.$accountstatic->getNomUrl(1).''; - print ''.$objp->nbcheque.''; - print ''.price($objp->amount).''; + print ''.dol_escape_htmltag($objp->nbcheque).''; + print ''.price($objp->amount).''; print ''.$checkdepositstatic->LibStatut($objp->status, 3).''; print ''; diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php index 7ddc9b68615..5449da31228 100644 --- a/htdocs/core/lib/mailmanspip.lib.php +++ b/htdocs/core/lib/mailmanspip.lib.php @@ -33,12 +33,12 @@ function mailmanspip_admin_prepare_head() return array( array( DOL_URL_ROOT.'/admin/mailman.php', - $langs->trans('Mailman'), + 'Mailman', 'mailman' ), array( DOL_URL_ROOT.'/admin/spip.php', - $langs->trans('SPIP'), + 'SPIP', 'spip' ) ); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c25d8afbdd6..f56b77ae139 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1502,9 +1502,9 @@ if (empty($reshook)) { $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); if (empty($result_order["result"]["result_code"])) { //No result, check error str - setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors'); + setEventMessages($langs->trans("Error")." '".$soapclient_order->error_str."'", null, 'errors'); } elseif ($result_order["result"]["result_code"] != "OK") { //Something went wrong - setEventMessages($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", null, 'errors'); + setEventMessages($langs->trans("Error")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", null, 'errors'); } else { setEventMessages($langs->trans("RemoteOrderRef")." ".$result_order["ref"], null, 'mesgs'); } @@ -2892,7 +2892,7 @@ if ($action == 'create') { $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $ref_supplier); $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); if (!$result_product) { - setEventMessages($line_id.$langs->trans("SOAPError")." ".$soapclient_product->error_str." - ".$soapclient_product->response, null, 'errors'); + setEventMessages($line_id.$langs->trans("Error")." SOAP ".$soapclient_product->error_str." - ".$soapclient_product->response, null, 'errors'); $error_occurred = true; break; } @@ -2900,7 +2900,7 @@ if ($action == 'create') { // Check the result code $status_code = $result_product["result"]["result_code"]; if (empty($status_code)) { //No result, check error str - setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors'); + setEventMessages($langs->trans("Error")." SOAP '".$soapclient_order->error_str."'", null, 'errors'); } elseif ($status_code != "OK") { //Something went wrong if ($status_code == "NOT_FOUND") { setEventMessages($line_id.$langs->trans("SupplierMissingRef")." '".$ref_supplier."'", null, 'warnings'); diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 239c1cf0345..ac750a737fe 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -77,4 +77,13 @@ TERMINAL_LOCATION=Location (address) for Stripe Terminals RequestDirectDebitWithStripe=Request Direct Debit with Stripe RequesCreditTransferWithStripe=Request Credit Transfer with Stripe STRIPE_SEPA_DIRECT_DEBIT=Enable the Direct Debit payments through Stripe -StripeConnect_Mode=Stripe Connect mode \ No newline at end of file +STRIPE_KLARNA=Enable the payments using Klarna +STRIPE_BANCONTACT=Enable the payments using BANCONTACT +STRIPE_IDEAL=Enable the payments using IDEAL +STRIPE_GIROPAY=Enable the payments using GIROPAY +STRIPE_SOFORT=Enable the payments using SOFORT +StripeConnect_Mode=Stripe Connect mode +ExampleOnlyForBECustomers=Only for belgium customers +ExampleOnlyForDECustomers=Only for german customers +ExampleOnlyForNLCustomers=Only for dutch customers +ExampleOnlyForATBEDEITNLESCustomers=Only for customers from Austria, Belgium, Germany, Italy, Netherlands, Spain diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 919e80088c6..a62cdadb471 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -474,7 +474,6 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // TODO Not used by current c $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("STRIPE_KLARNA", $arrval, $conf->global->STRIPE_KLARNA); } - print '   '.$langs->trans("ExampleOnlyForKlarnaCustomers").''; print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 673f568a7e4..215a2ed46a8 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1815,8 +1815,8 @@ maxscreenheightless200 { .width100p { width:100%; } -/* Force values for small screen 1400 */ -@media only screen and (max-width: 1400px) +/* Force values for small screen 1440 */ +@media only screen and (max-width: 1440px) { .titlefield { /* width: 30% !important; */ } .titlefieldcreate { width: 30% !important; } @@ -1862,8 +1862,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select } -/* Force values for small screen 767 */ -@media only screen and (max-width: 767px) +/* Force values for small screen 768 */ +@media only screen and (max-width: 768px) { div.refidno { font-size: !important; @@ -2393,7 +2393,7 @@ div.secondcolumn div.box { /* Force values on one column for small screen */ -@media only screen and (max-width: 1000px) +@media only screen and (max-width: 1024px) { div.fiche { margin-: px; @@ -2436,7 +2436,7 @@ div.secondcolumn div.box { } /* Force values on one column for small screen */ -@media only screen and (max-width: 1499px) +@media only screen and (max-width: 1440px) { div.fichehalfleft-lg { float: none; @@ -4687,7 +4687,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .tabBar .arearef .pagination.paginationref { max-width: calc(50%); @@ -7279,7 +7279,7 @@ div.tabsElem a.tab { padding-right: 10px; padding-bottom: 2px; } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .menu_choix1 a, .menu_choix2 a { background-size: 36px 36px; @@ -7319,7 +7319,7 @@ div.tabsElem a.tab { color: var(--colortextbackvmenu); } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .publicnewmemberform div.tabBarWithBottom { padding: 10px; @@ -7347,7 +7347,7 @@ div.tabsElem a.tab { padding-right: 50px; padding-top: 30px; } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .ticketlargemargin { padding-left: 5px; padding-right: 5px; @@ -7878,7 +7878,7 @@ table.jPicker { background-size: 22px auto; top: 2px; } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .imgopensurveywizard, .imgautosize { width:95%; height: auto; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 380ce399eb6..013d6d43da6 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -20,7 +20,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { .info-box { display: block; position: relative; - min-height: 90px; + min-height: 92px; /* must be same height than info-box-icon */ background: var(--colorbacklineimpair2); width: 100%; box-shadow: 1px 1px 15px rgba(192, 192, 192, 0.2); @@ -83,11 +83,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { display: block; overflow: hidden; float: left; - height: 90px; + line-height: 92px; /* must be same height as info-box */ + height: 92px; /* must be same height as info-box */ width: 88px; text-align: center; font-size: 2.8em; - line-height: 90px; background: var(--colorbacktitle1) !important; } @@ -540,12 +540,27 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { } } -@media only screen and (max-width: 767px) { +@media only screen and (max-width: 768px) { .info-box-module { min-width: 260px; } + .box-flex-item { + width: 280px; + } } +@media only screen and (max-width: 480px) { + .info-box-module { + min-width: 250px; + } + .box-flex-item { + width: 250px; + } +} + + + + .info-box-module .info-box-content { height: 98px; } diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 98e2e033085..e1959f43f21 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -595,7 +595,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { max-width: 315px; } } -@media only screen and (max-width: 767px) { +@media only screen and (max-width: 768px) { .info-box-module { min-width: 260px; } @@ -616,3 +616,12 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { max-width: calc(100% - 82px); } } + +@media only screen and (max-width: 480px) { + .info-box-module { + min-width: 250px; + } + .box-flex-item { + width: 250px; + } +} diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index bef0116fa62..4bd932b6700 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -363,7 +363,7 @@ print '*/'."\n"; --amountremaintopaybackcolor:none; --productlinestockod: #002200; --productlinestocktoolow: #884400; - --infoboxmoduleenabledbgcolor : linear-gradient(0.4turn, #2b2d2f, #2b2d2f, #2b2d2f, #e4efe8); + --infoboxmoduleenabledbgcolor : linear-gradient(0.4turn, #fff, #fff, #fff, #e4efe8); --tablevalidbgcolor: rgb(252, 248, 227); --butactionbg : #; --textbutaction : #; From f03eb260de61e6c04871ae29e06e49539f32a51c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 13:20:26 +0200 Subject: [PATCH 07/18] Nicer combo of companies for external modules --- htdocs/admin/modules.php | 17 ++++++++++++--- htdocs/core/modules/DolibarrModules.class.php | 21 +++++++++++-------- .../core/modules/modMyModule.class.php | 4 +++- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/style.css.php | 6 ++++++ 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index dedf6b55677..24dc394d0f8 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -361,13 +361,17 @@ llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss, // Search modules dirs $modulesdir = dolGetModulesDirs(); -$arrayofnatures = array('core' => $langs->transnoentitiesnoconv("NativeModules"), 'external' => $langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']'); +$arrayofnatures = array( + 'core' => array('label' => $langs->transnoentitiesnoconv("NativeModules")), + 'external' => array('label' => $langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']') +); $arrayofwarnings = array(); // Array of warning each module want to show when activated $arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module $filename = array(); $modules = array(); $orders = array(); $categ = array(); +$publisherlogoarray = array(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. @@ -427,9 +431,16 @@ foreach ($modulesdir as $dir) { $external = ($objMod->isCoreOrExternalModule() == 'external'); if ($external) { if ($publisher) { - $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; + // Check if there is a logo forpublisher + /* Do not show the company logo in combo. Make combo list dirty. + if (!empty($objMod->editor_squarred_logo)) { + $publisherlogoarray['external_'.$publisher] = img_picto('', $objMod->editor_squarred_logo, 'class="publisherlogoinline"'); + } + $publisherlogo = empty($publisherlogoarray['external_'.$publisher]) ? '' : $publisherlogoarray['external_'.$publisher]; + */ + $arrayofnatures['external_'.$publisher] = array('label' => $langs->trans("External").' - '.$publisher, 'data-html' => $langs->trans("External").' - '.$publisher.''); } else { - $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); + $arrayofnatures['external_'] = array('label' => $langs->trans("External").' - ['.$langs->trans("UnknownPublishers").']'); } } ksort($arrayofnatures); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 801cbe72869..a7589be4860 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -38,30 +38,33 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it into unActivateModule to be able to disable a module whose files were removed. { /** - * @var DoliDB Database handler + * @var DoliDB Database handler */ public $db; /** - * @var int Module unique ID + * @var int Module unique ID * @see https://wiki.dolibarr.org/index.php/List_of_modules_id */ public $numero; /** - * @var string Publisher name - * @since 4.0.0 + * @var string Publisher name */ public $editor_name; /** - * @var string URL of module at publisher site - * @since 4.0.0 + * @var string URL of module at publisher site */ public $editor_url; /** - * @var string Family + * @var string URL of logo of the publisher. Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule'. + */ + public $editor_squarred_logo; + + /** + * @var string Family * @see $familyinfo * * Native values: 'crm', 'financial', 'hr', 'projects', 'products', 'ecm', 'technic', 'other'. @@ -84,12 +87,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $familyinfo; /** - * @var string Module position on 2 digits + * @var string Module position on 2 digits */ public $module_position = '50'; /** - * @var string Module name + * @var string Module name * * Only used if Module[ID]Name translation string is not found. * diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index c288ca7f3d9..7d0f0941b0b 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -42,6 +42,7 @@ class modMyModule extends DolibarrModules public function __construct($db) { global $langs, $conf; + $this->db = $db; // Id for module (must be unique). @@ -70,7 +71,8 @@ class modMyModule extends DolibarrModules // Author $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; + $this->editor_url = 'https://www.example.com'; // Must be an external online web site + $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 215a2ed46a8..6358bc69e3a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1095,6 +1095,12 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before, i.fa-transgender .stockmovement { font-size: 1.4em; } +.publisherlogoinline { + vertical-align: middle; + height: 14px; + width: 14px; + margin-left: 5px; +} body[class*="colorblind-"] .text-warning{ color : diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 4bd932b6700..5f15a6cc082 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1273,6 +1273,12 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before, i.fa-transgender .stockmovement { font-size: 1.4em; } +.publisherlogoinline { + vertical-align: middle; + height: 14px; + width: 14px; + margin-left: 5px; +} .text-warning{ color : From db393711139677603ce7330f8c92994c52e1bbaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 13:35:34 +0200 Subject: [PATCH 08/18] CSS v20 --- htdocs/theme/eldy/info-box.inc.php | 6 +++--- htdocs/theme/md/info-box.inc.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 013d6d43da6..a59ea3bf140 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -20,7 +20,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { .info-box { display: block; position: relative; - min-height: 92px; /* must be same height than info-box-icon */ + min-height: 94px; /* must be same height than info-box-icon */ background: var(--colorbacklineimpair2); width: 100%; box-shadow: 1px 1px 15px rgba(192, 192, 192, 0.2); @@ -83,8 +83,8 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { display: block; overflow: hidden; float: left; - line-height: 92px; /* must be same height as info-box */ - height: 92px; /* must be same height as info-box */ + line-height: 94px; /* must be same height as min-height of .info-box */ + height: 94px; /* must be same height as min-height of .info-box */ width: 88px; text-align: center; font-size: 2.8em; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index e1959f43f21..ec8ced18142 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -146,7 +146,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { .info-box { display: block; position: relative; - min-height: 90px; + min-height: 94px; background: var(--colorbacklineimpair2); width: 100%; /* box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); */ @@ -197,11 +197,11 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { display: block; overflow: hidden; float: left; - /* height: 90px; */ - width: 86px; text-align: center; font-size: 45px; - line-height: 90px; + line-height: 94px;; /* must be same height as min-height of .info-box */ + height: 94px;; /* must be same height as min-height of .info-box */ + width: 86px; background: var(--colorbacktitle1) !important; global->THEME_SATURATE_RATIO)) { ?> filter: saturate(global->THEME_SATURATE_RATIO; ?>); From 3fa5e017e6a9306e9b7ccd4da3c44508dc8b7d4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 13:49:47 +0200 Subject: [PATCH 09/18] Update demo profile --- htdocs/public/demo/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index d9c41aff847..0cfcb635264 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -110,7 +110,7 @@ if (empty($reshook)) { // Visible $alwayscheckedmodules = array('barcode', 'bookmark', 'categorie', 'externalrss', 'fckeditor', 'geoipmaxmind', 'gravatar', 'memcached', 'syslog', 'user', 'webservices'); // Technical module we always want - $alwaysuncheckedmodules = array('dav', 'dynamicprices', 'incoterm', 'loan', 'multicurrency', 'paybox', 'paypal', 'stripe', 'google', 'printing', 'scanner', 'socialnetworks', 'website'); // Module we don't want by default + $alwaysuncheckedmodules = array('ai', 'dav', 'dynamicprices', 'incoterm', 'loan', 'multicurrency', 'paybox', 'paypal', 'stripe', 'google', 'printing', 'scanner', 'socialnetworks', 'webhook', 'webportal', 'website', 'zapier'); // Module we don't want by default // Not visible $alwayshiddencheckedmodules = array('accounting', 'api', 'barcode', 'blockedlog', 'bookmark', 'clicktodial', 'comptabilite', 'cron', 'document', 'domain', 'externalrss', 'externalsite', 'fckeditor', 'geoipmaxmind', 'gravatar', 'label', 'ldap', 'mailmanspip', 'notification', 'oauth', 'syslog', 'user', 'webservices', 'workflow', From fffe74246cda4493f11aad2ef1461c4a21e83ba7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 15:30:10 +0200 Subject: [PATCH 10/18] Fix all short tables must use the setup for the number of rows --- htdocs/bookcal/bookcalindex.php | 6 +- htdocs/comm/index.php | 186 +++++++++++++++++- htdocs/comm/propal/index.php | 24 ++- htdocs/comm/propal/list.php | 14 +- htdocs/commande/index.php | 35 ++-- htdocs/compta/facture/index.php | 3 +- htdocs/compta/index.php | 3 +- htdocs/contrat/index.php | 6 +- htdocs/core/class/conf.class.php | 19 +- htdocs/core/lib/functions.lib.php | 6 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- .../eventorganizationindex.php | 6 +- htdocs/expensereport/index.php | 16 +- htdocs/fichinter/index.php | 7 +- htdocs/fourn/commande/index.php | 13 +- htdocs/fourn/facture/index.php | 3 +- htdocs/hrm/index.php | 2 +- .../modulebuilder/template/mymoduleindex.php | 3 +- htdocs/mrp/index.php | 2 +- htdocs/product/index.php | 2 +- htdocs/projet/index.php | 10 +- htdocs/recruitment/index.php | 6 +- htdocs/societe/index.php | 2 +- 23 files changed, 280 insertions(+), 96 deletions(-) diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index c54181584d0..8248ca44308 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -44,8 +44,9 @@ if (isset($user->socid) && $user->socid > 0) { $socid = $user->socid; } -$max = 5; $now = dol_now(); +$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* @@ -137,9 +138,6 @@ if ($user->hasRight('bookcal', 'availabilities', 'read') && isModEnabled('bookca print '
'; -$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT'); -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject if (isModEnabled('bookcal')) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 4b7aa0ca172..d5567fe9bc4 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -64,7 +64,7 @@ if (isset($user->socid) && $user->socid > 0) { } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); $now = dol_now(); @@ -479,6 +479,7 @@ if ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO $companystatic->name_alias = $obj->name_alias; $companystatic->code_client = $obj->code_client; $companystatic->code_compta = $obj->code_compta; + $companystatic->code_compta_client = $obj->code_compta; $companystatic->client = $obj->client; $companystatic->code_fournisseur = $obj->code_fournisseur; $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; @@ -705,6 +706,189 @@ if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) { } +/* + * Last modified proposals + */ + +if (isModEnabled('proposal')) { + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,"; + $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; + $sql .= " FROM ".MAIN_DB_PREFIX."propal as c,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; + $sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")"; + $sql .= " AND c.fk_soc = s.rowid"; + // If the internal user must only see his customers, force searching by him + $search_sale = 0; + if (!$user->hasRight('societe', 'client', 'voir')) { + $search_sale = $user->id; + } + // Search on sale representative + if ($search_sale && $search_sale != '-1') { + if ($search_sale == -2) { + $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)"; + } elseif ($search_sale > 0) { + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $search_sale).")"; + } + } + // Search on socid + if ($socid) { + $sql .= " AND c.fk_soc = ".((int) $socid); + } + $sql .= " ORDER BY c.tms DESC"; + + $sql .= $db->plimit($max, 0); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + + startSimpleTable($langs->trans("LastModifiedProposals", $max), "comm/propal/list.php", "sortfield=p.tms&sortorder=DESC", 2, -1, 'propal'); + + if ($num) { + $i = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + + $propalstatic->id = $obj->rowid; + $propalstatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$propalstatic->getNomUrl(1).''.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'
'; + print ''; + + print ''.$companystatic->getNomUrl(1, 'customer').''; + + $datem = $db->jdate($obj->datem); + print ''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''; + + print ''.$propalstatic->LibStatut($obj->status, 3).''; + + print ''; + + $i++; + } + } + + finishSimpleTable(true); + $db->free($resql); + } else { + dol_print_error($db); + } +} + + +/* + * Latest modified orders + */ + +if (isModEnabled('order')) { + $commandestatic = new Commande($db); + + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,"; + $sql .= " s.nom as name, s.rowid as socid"; + $sql .= ", s.client"; + $sql .= ", s.code_client"; + $sql .= ", s.canvas"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; + if (!$user->hasRight('societe', 'client', 'voir')) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE c.fk_soc = s.rowid"; + $sql .= " AND c.entity IN (".getEntity('commande').")"; + //$sql.= " AND c.fk_statut > 2"; + if ($socid) { + $sql .= " AND c.fk_soc = ".((int) $socid); + } + if (!$user->hasRight('societe', 'client', 'voir')) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + } + $sql .= " ORDER BY c.tms DESC"; + $sql .= $db->plimit($max, 0); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + + startSimpleTable($langs->trans("LastModifiedOrders", $max), "commande/list.php", "sortfield=c.tms&sortorder=DESC", 2, -1, 'order'); + + if ($num) { + $i = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + + print ''; + print ''; + + $commandestatic->id = $obj->rowid; + $commandestatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->client = $obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->canvas = $obj->canvas; + + print ''; + print ''; + + print ''; + + print '
'; + print $commandestatic->getNomUrl(1); + print ''; + print ' '; + print ''; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->commande->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); + print '
'; + + print ''; + + print ''; + print $companystatic->getNomUrl(1, 'company', 16); + print ''; + + $datem = $db->jdate($obj->datem); + print ''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''; + + print ''.$commandestatic->LibStatut($obj->status, $obj->facture, 3).''; + print ''; + $i++; + } + } + finishSimpleTable(true); + } else { + dol_print_error($db); + } +} + + /* * Last suppliers */ diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 57be7253100..cc1ffc5486e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -39,7 +39,7 @@ $hookmanager->initHooks(array('proposalindex')); $langs->loadLangs(array('propal', 'companies')); $now = dol_now(); -$max = 5; +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); // Security check $socid = GETPOSTINT('socid'); @@ -160,10 +160,10 @@ print '
'; * Last modified proposals */ -$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec"; -$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; -$sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; -$sql .= ", ".MAIN_DB_PREFIX."societe as s"; +$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,"; +$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; +$sql .= " FROM ".MAIN_DB_PREFIX."propal as c,"; +$sql .= " ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND c.fk_soc = s.rowid"; // If the internal user must only see his customers, force searching by him @@ -190,7 +190,8 @@ $sql .= $db->plimit($max, 0); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - startSimpleTable($langs->trans("LastModifiedProposals", $max), "", "", 3); + + startSimpleTable($langs->trans("LastModifiedProposals", $max), "comm/propal/list.php", "sortfield=p.tms&sortorder=DESC", 2, -1, 'propal'); if ($num) { $i = 0; @@ -213,7 +214,7 @@ if ($resql) { print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -224,8 +225,13 @@ if ($resql) { print ''; print ''; - print ''; - print ''; + + $datem = $db->jdate($obj->datem); + print ''; + + print ''; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1769bafaaad..616838c156c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1254,7 +1254,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) { // Company type if (!empty($arrayfields['typent.code']['checked'])) { print ''; } @@ -1525,27 +1525,27 @@ if (!empty($arrayfields['state.nom']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['country.code_iso']['checked'])) { - print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['typent.code']['checked'])) { - print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.date']['checked'])) { - print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.fin_validite']['checked'])) { - print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.date_livraison']['checked'])) { - print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.date_signature']['checked'])) { - print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['ava.rowid']['checked'])) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 564cfcde895..c4c8daddf81 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -56,9 +56,8 @@ if ($user->socid > 0) { $socid = $user->socid; } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - // Maximum elements of the tables +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxLatestEditCount = 5; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; @@ -154,13 +153,11 @@ if (isModEnabled('order')) { print '
'; -$max = 5; - /* * Latest modified orders */ -$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,"; +$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,"; $sql .= " s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -184,12 +181,10 @@ $sql .= $db->plimit($max, 0); $resql = $db->query($sql); if ($resql) { - print '
'; - print '
'.$propalstatic->getNomUrl(1).''.$companystatic->getNomUrl(1, 'customer').''.dol_print_date($db->jdate($obj->datec), 'day').''.$propalstatic->LibStatut($obj->fk_statut, 3).''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''.$propalstatic->LibStatut($obj->status, 3).'
'; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, getDolGlobalString('SOCIETE_SORT_ON_TYPEENT', 'ASC'), 'maxwidth100', 1); print ajax_combobox('search_type_thirdparty'); print '
'; - print ''; - print ''; - $num = $db->num_rows($resql); + + startSimpleTable($langs->trans("LastModifiedOrders", $max), "commande/list.php", "sortfield=c.tms&sortorder=DESC", 2, -1, 'order'); + if ($num) { $i = 0; while ($i < $num) { @@ -228,24 +223,28 @@ if ($resql) { print ''; - print ''; - print ''; + + $datem = $db->jdate($obj->datem); + print ''; + + print ''; print ''; $i++; } } - print "
'.$langs->trans("LastModifiedOrders", $max).'
'; print $companystatic->getNomUrl(1, 'company', 16); print ''.dol_print_date($db->jdate($obj->datem), 'day').''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''.$commandestatic->LibStatut($obj->status, $obj->facture, 3).'

"; + finishSimpleTable(true); } else { dol_print_error($db); } -$max = 10; /* * Orders to process */ if (isModEnabled('order')) { - $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; $sql .= ", s.canvas"; @@ -314,7 +313,7 @@ if (isModEnabled('order')) { print ''.dol_print_date($db->jdate($obj->date), 'day').''."\n"; - print ''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).''; + print ''.$commandestatic->LibStatut($obj->status, $obj->facture, 3).''; print ''; $i++; @@ -334,7 +333,7 @@ if (isModEnabled('order')) { * Orders that are in process */ if (isModEnabled('order')) { - $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; $sql .= ", s.canvas"; @@ -403,7 +402,7 @@ if (isModEnabled('order')) { print ''.dol_print_date($db->jdate($obj->date), 'day').''."\n"; - print ''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).''; + print ''.$commandestatic->LibStatut($obj->status, $obj->facture, 3).''; print ''; $i++; diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index ea2543aeb90..795e54bbc6c 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -41,9 +41,8 @@ if (isset($user->socid) && $user->socid > 0) { $socid = $user->socid; } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - // Maximum elements of the tables +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 0d20375bcb5..1294ad99e78 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -67,9 +67,8 @@ if ($user->socid > 0) { $socid = $user->socid; } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - // Maximum elements of the tables +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxLatestEditCount = 5; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 9f7089afc5f..90bfa1362bd 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -44,6 +44,8 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTI $statut = GETPOST('statut') ? GETPOST('statut') : 1; +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); + // Security check $socid = 0; $id = GETPOSTINT('id'); @@ -58,6 +60,7 @@ $staticcontratligne = new ContratLigne($db); $productstatic = new Product($db); + /* * Action */ @@ -315,7 +318,6 @@ print '
'; // Last modified contracts -$max = 5; $sql = 'SELECT '; $sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,'; $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,'; @@ -353,7 +355,7 @@ if ($result) { print '
'; print ''; - print ''; + print ''; print ''; //print ''; print ''; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 5ade23faf61..711a0bb499d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -158,7 +158,7 @@ class Conf extends stdClass // TODO Remove this part. /** - * @var stdClass Supplier + * @var stdClass Supplier */ public $fournisseur; @@ -582,10 +582,6 @@ class Conf extends stdClass } elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) { // If this is a module constant (must be at end) $modulename = strtolower($reg[1]); - $mapping = $this->deprecatedProperties(); - if (array_key_exists($modulename, $mapping)) { - $modulename = $mapping[$modulename]; - } $this->modules[$modulename] = $modulename; // Add this module in list of enabled modules // deprecated in php 8.2 @@ -594,7 +590,18 @@ class Conf extends stdClass $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... } $this->$modulename->enabled = true; // TODO Remove this - //} + + // Duplicate entry with the new name + $mapping = $this->deprecatedProperties(); + if (array_key_exists($modulename, $mapping)) { + $newmodulename = $mapping[$modulename]; + $this->modules[$newmodulename] = $newmodulename; + + if (!isset($this->$newmodulename) || !is_object($this->$newmodulename)) { + $this->$newmodulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... + } + $this->$newmodulename->enabled = true; // TODO Remove this + } } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d697c7595f3..323262c3727 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12641,14 +12641,14 @@ function getNonce() * @param string $header The first left header of the table (automatic translated) * @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/") * @param string $arguments (optional) Additional arguments for the link (e.g. "search_status=0") - * @param integer $emptyRows (optional) The count of empty columns after the first column + * @param integer $emptyColumns (optional) Number of empty columns to add after the first column * @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList" * @param string $pictofulllist (optional) The picto to use for the full list link * @return void * * @see finishSimpleTable() */ -function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0, $number = -1, $pictofulllist = '') +function startSimpleTable($header, $link = "", $arguments = "", $emptyColumns = 0, $number = -1, $pictofulllist = '') { global $langs; @@ -12656,7 +12656,7 @@ function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0, print '
'.$langs->trans("LastContracts", 5).'
'.$langs->trans("LastContracts", $max).''.$langs->trans("DateModification").''.$langs->trans("Status").''.$langs->trans("Services").'
'; print ''; - print $emptyRows < 1 ? ''; + print ''; } // Note if (!empty($arrayfields['t.note']['checked'])) { - print ''; + print ''; } // Duration if (!empty($arrayfields['t.element_duration']['checked'])) { @@ -1987,6 +1987,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print '' . "\n"; + $totalarray = array(); $totalarray['nbfield'] = 0; @@ -2246,7 +2247,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Task label if (!empty($arrayfields['t.element_label']['checked'])) { if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task - print ''; if (!$i) { @@ -2696,7 +2697,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // User if (!empty($arrayfields['author']['checked'])) { - print '
' : ''; + print ($emptyColumns < 1) ? '' : ''; print $langs->trans($header); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d41472c6528..f8f53593bdc 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1346,7 +1346,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le */ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = 'none', $type_user = 0) { - global $user, $conf, $langs; + global $user, $langs; if ($mainmenu == 'commercial') { $langs->load("companies"); diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index 538782131d1..fe1e16ba5a0 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -33,7 +33,8 @@ $langs->loadLangs(array("eventorganization")); $action = GETPOST('action', 'aZ09'); -$max = 5; +$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', 5); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $now = dol_now(); // Security check @@ -147,9 +148,6 @@ END MODULEBUILDER DRAFT MYOBJECT */ print '
'; -$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT'); -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject if (isModEnabled('eventorganization') && $user->rights->eventorganization->read) diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index ab95b3a5e0b..dfd0ec7a099 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -41,13 +41,6 @@ $hookmanager->initHooks(array('expensereportindex')); // Load translation files required by the page $langs->loadLangs(array('companies', 'users', 'trips')); -// Security check -$socid = GETPOSTINT('socid'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'expensereport', '', ''); - $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -66,7 +59,14 @@ if (!$sortfield) { } $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); + +// Security check +$socid = GETPOSTINT('socid'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expensereport', '', ''); /* diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index cfb5ab3577d..ca8b9349c9e 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -50,6 +50,7 @@ if ($user->socid > 0) { $socid = $user->socid; } +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* @@ -68,9 +69,7 @@ print load_fiche_titre($langs->trans("InterventionsArea"), '', 'intervention'); print '
'; -/* - * Statistics - */ +// Statistics $sql = "SELECT count(f.rowid), f.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -217,8 +216,6 @@ if (isModEnabled('intervention')) { print '
'; -$max = 5; - /* * Last modified interventions */ diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 46fa4f15166..dbf343a0824 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -37,6 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Load translation files required by the page $langs->loadLangs(array("suppliers", "orders")); +$hookmanager = new HookManager($db); + +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('orderssuppliersindex')); + +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); // Security check $orderid = GETPOST('orderid'); @@ -45,12 +51,6 @@ if ($user->socid) { } $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); -$hookmanager = new HookManager($db); - -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array -$hookmanager->initHooks(array('orderssuppliersindex')); - - /* * View @@ -285,7 +285,6 @@ print '
'; /* * Last modified orders */ -$max = 5; $sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 16629f0febd..68f4a06dacc 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -38,9 +38,8 @@ if (isset($user->socid) && $user->socid > 0) { $socid = $user->socid; } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - // Maximum elements of the tables +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500); $maxLatestEditCount = 5; $maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 6790b12942c..cb75f8849e0 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -72,7 +72,7 @@ if (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') || !getDolGlobalString('MAIN_IN $setupcompanynotcomplete = 1; } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 9597abbd11f..6405f5c67d9 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -64,8 +64,7 @@ $langs->loadLangs(array("mymodule@mymodule")); $action = GETPOST('action', 'aZ09'); $now = dol_now(); - -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); // Security check - Protection if external user $socid = GETPOST('socid', 'int'); diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index 409f1847a8b..5f4d49d0263 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -42,7 +42,7 @@ $langs->loadLangs(array("companies", "mrp")); // Security check $result = restrictedArea($user, 'bom|mrp'); -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 02ffb3632f2..51e10cb7d39 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -78,7 +78,7 @@ if (GETPOST('addbox')) { } } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 4712a0b1b92..a7eecde9ef4 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -50,6 +50,11 @@ if ($search_project_user == $user->id) { $mine = 1; } +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); + +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); + // Security check $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment. @@ -57,11 +62,6 @@ if (!$user->hasRight('projet', 'lire')) { accessforbidden(); } -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); - -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - /* * Actions diff --git a/htdocs/recruitment/index.php b/htdocs/recruitment/index.php index c8d525403bf..6be0d7af944 100644 --- a/htdocs/recruitment/index.php +++ b/htdocs/recruitment/index.php @@ -35,7 +35,8 @@ $langs->loadLangs(array("recruitment", "boxes")); $action = GETPOST('action', 'aZ09'); -$max = 5; +$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', 5); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); $now = dol_now(); $socid = GETPOSTINT('socid'); @@ -329,9 +330,6 @@ END MODULEBUILDER DRAFT MYOBJECT */ print '
'; -$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT'); -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); - // Last modified job position if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f2b5fd2b824..0472e85afe0 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -74,7 +74,7 @@ if (GETPOST('addbox')) { } } -$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); +$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); /* From ab093510fb9fa3bf69707ccbb8bd333723ea00f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 15:40:24 +0200 Subject: [PATCH 11/18] Responsive --- htdocs/projet/index.php | 9 +++------ htdocs/projet/tasks/time.php | 9 +++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index a7eecde9ef4..4fff3d0ce52 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -220,11 +220,7 @@ $sql .= $db->plimit($max, 0); $resql = $db->query($sql); if ($resql) { - print '
'; - print ''; - print ''; - print ''; - print ''; + startSimpleTable($langs->trans("LatestModifiedProjects", $max), "projet/list.php", "sortfield=p.tms&sortorder=DESC", 3, -1, 'project'); $num = $db->num_rows($resql); @@ -303,7 +299,8 @@ if ($resql) { } else { print ''; } - print "
'.$langs->trans("LatestModifiedProjects", $max).'
'.$langs->trans("None").'
"; + + finishSimpleTable(true); } else { dol_print_error($db); } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index b2bbf98186f..6d9786d9d14 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1928,11 +1928,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } // Author if (!empty($arrayfields['author']['checked'])) { - print '
'.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150').''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth125').'
'; + print ''; print dol_escape_htmltag($task_time->label); print ''; + print ''; if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { if (empty($object->id)) { $object->fetch($id); From 2947287e3f5da227a92b497d1c85ff7f679189c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Apr 2024 16:22:16 +0200 Subject: [PATCH 12/18] Look and feel v20 --- htdocs/comm/action/index.php | 3 --- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/deplacement/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++++-- htdocs/don/stats/index.php | 2 +- htdocs/expedition/stats/index.php | 2 +- htdocs/expensereport/stats/index.php | 2 +- htdocs/fichinter/list.php | 23 +++++++++++++++++------ htdocs/fichinter/stats/index.php | 2 +- htdocs/projet/stats/index.php | 2 +- htdocs/projet/tasks/stats/index.php | 2 +- htdocs/reception/stats/index.php | 2 +- htdocs/salaries/stats/index.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/ticket/stats/index.php | 2 +- htdocs/website/index.php | 4 ++-- 18 files changed, 37 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d1bd15fdc55..6ddef2ba301 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -489,9 +489,6 @@ if ($optioncss != '') { print ''; print ''; -//print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -//print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); -//print dol_get_fiche_end(); $viewmode = '