From 6765a14a58ec692021f887522f266c266ab731cb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 30 Jan 2023 11:36:00 +0100 Subject: [PATCH 01/42] fix : Warning: Undefined property: BOM:: in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/class/commondocgenerator.class.php on line 446 --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index e1780985c7c..b94fcccd99c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -443,7 +443,7 @@ abstract class CommonDocGenerator } } - $date = ($object->element == 'contrat' ? $object->date_contrat : $object->date); + $date = (isset($object->element) && $object->element == 'contrat' && isset($object->date_contrat)) ? $object->date_contrat : (isset($object->date) ? $object->date : null); $resarray = array( $array_key.'_id'=>$object->id, From 665acb45cf3539559e6b5a3212959958c6adeea3 Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Sun, 29 Jan 2023 23:05:39 +0100 Subject: [PATCH 02/42] filter on extrafields --- htdocs/projet/class/api_projects.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 6a522346210..9ed1bbf1441 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -123,6 +123,7 @@ class Projects extends DolibarrApi $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } $sql .= " FROM ".MAIN_DB_PREFIX."projet as t"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields if ($category > 0) { $sql .= ", ".MAIN_DB_PREFIX."categorie_project as c"; } From cd9db0067c157514e4ae98ce2affcf24ad6086de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 28 Jan 2023 18:45:37 +0100 Subject: [PATCH 03/42] input is too small --- htdocs/admin/mails_senderprofile_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 95f57d5dfc5..a73b899dd00 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -416,7 +416,7 @@ if ($action != 'create') { print ''.$langs->trans("Label").''; print ''.$langs->trans("Email").''; print img_picto('', 'email', 'class="pictofixedwidth"'); - print ''; + print ''; print ''.$langs->trans("Signature").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); From 7e9d3c22e288a773b5c6a53c91cb6ad9e74ed16a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 28 Jan 2023 10:36:34 +0100 Subject: [PATCH 04/42] fix : Warning: Undefined array key label --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index b94fcccd99c..74d0c9fa6b5 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1618,7 +1618,7 @@ abstract class CommonDocGenerator $extrafields = $this->extrafieldsCache; - if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { + if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]) && array_key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Dont display separator yet even is set to be displayed (not compatible yet) if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { From 5d787a0ba93c46dfdfdd3250c6ed207d35a8f278 Mon Sep 17 00:00:00 2001 From: hystepik Date: Fri, 27 Jan 2023 11:01:16 +0100 Subject: [PATCH 05/42] Fix : php 8.1 warning --- htdocs/compta/paiement/card.php | 4 ++++ htdocs/compta/paiement/list.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 4930ce9e53c..29d9ce25bb6 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -46,6 +46,10 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); +$socid = GETPOST('socid', 'int'); if ($socid < 0) { + $socid = 0; +} + $object = new Paiement($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('paymentcard', 'globalcard')); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 658f2c150f1..6db18f6aa55 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -513,6 +513,7 @@ foreach ($arrayfields as $column) { $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); @@ -620,7 +621,11 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } $totalarray['pos'][$checkedCount] = 'amount'; - $totalarray['val']['amount'] += $objp->amount; + if (empty($totalarray['val']['amount'])) { + $totalarray['val']['amount'] = $objp->amount; + } else { + $totalarray['val']['amount'] += $objp->amount; + } } // Status From 3a7552431fc79820e41ffaa2d5239f580801ab57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jan 2023 01:03:44 +0100 Subject: [PATCH 06/42] Fix duplicate --- htdocs/contrat/class/contrat.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 1e8f0e1f7e5..8f66cbdef2e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -242,7 +242,6 @@ class Contrat extends CommonObject 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>120), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'ref_customer' =>array('type'=>'varchar(50)', 'label'=>'Ref customer', 'enabled'=>1, 'visible'=>-1, 'position'=>130), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'notnull'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Closed')) From 3692f9534ee52e9ddf5f49b453979faae3036e69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Jan 2023 19:23:43 +0100 Subject: [PATCH 07/42] Fix properties --- htdocs/comm/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index e6162b45b52..b64673f0670 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1458,6 +1458,8 @@ if ($object->id > 0) { $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; $facturestatic->statut = $objp->status; + $facturestatic->date = $db->jdate($objp->df); + $facturestatic->date_lim_reglement = $db->jdate($objp->dl); print ''; print ''; From 47d241bf502a3b35f579ff0832293b50cbb8109f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Jan 2023 21:56:49 +0100 Subject: [PATCH 08/42] fix php8.2 warnings --- htdocs/debugbar/class/DataCollector/DolLogsCollector.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index d21cdd6233f..893804ae865 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -20,6 +20,11 @@ class DolLogsCollector extends MessagesCollector */ protected $maxnboflines; + /** + * @var int number of lines + */ + protected $nboflines; + /** * Constructor * @@ -33,7 +38,7 @@ class DolLogsCollector extends MessagesCollector parent::__construct($name); $this->nboflines = 0; - $this->maxnboflines = empty($conf->global->DEBUGBAR_LOGS_LINES_NUMBER) ? 250 : $conf->global->DEBUGBAR_LOGS_LINES_NUMBER; // High number slows seriously output + $this->maxnboflines = getDolGlobalInt('DEBUGBAR_LOGS_LINES_NUMBER', 250); // High number slows seriously output $this->path = $path ?: $this->getLogsFile(); } From d52d39318548bd0b67e61b31d662c340e6a825bb Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 25 Jan 2023 15:35:09 +0100 Subject: [PATCH 09/42] FIX - PHP8 Warnning admin commande --- htdocs/admin/commande.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 79c42f6e2db..20064ca099c 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -117,7 +117,7 @@ if ($action == 'updateMask') { } elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->COMMANDE_ADDON_PDF == "$value") { + if (getDolGlobalString('COMMANDE_ADDON_PDF') == $value) { dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity); } } From a8bb58f2989a4b1d8e6c28dc59a2548373d8f291 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Wed, 25 Jan 2023 15:28:34 +0100 Subject: [PATCH 10/42] FIX: Rights on action for payments by bank transfer --- htdocs/compta/prelevement/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index c9f90b8b240..33a4409bac9 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -272,7 +272,7 @@ if ($id > 0 || $ref) { print $formconfirm; - if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action == 'settransmitted') { + if (empty($object->date_trans) && (($user->rights->prelevement->bons->send && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->send && $object->type == 'bank-transfer')) && $action == 'settransmitted') { print '
'; print ''; print ''; @@ -291,7 +291,7 @@ if ($id > 0 || $ref) { print '
'; } - if (!empty($object->date_trans) && empty($object->date_credit) && $user->rights->prelevement->bons->credit && $action == 'setcredited') { + if (!empty($object->date_trans) && empty($object->date_credit) && (($user->rights->prelevement->bons->credit && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->debit && $object->type == 'bank-transfer')) && $action == 'setcredited') { $btnLabel = ($object->type == 'bank-transfer') ? $langs->trans("ClassDebited") : $langs->trans("ClassCredited"); print ''; print ''; From 6ab7ca1279354787e5b64a3f6cad4ff35c1caced Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 30 Jan 2023 12:28:20 +0100 Subject: [PATCH 11/42] fix : Warning: Undefined variable in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/class/commondocgenerator.class.php on line 455 --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 74d0c9fa6b5..f6725c6aef1 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -452,7 +452,7 @@ abstract class CommonDocGenerator $array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''), $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), - $array_key.'_source_invoice_ref'=>$invoice_source->ref, + $array_key.'_source_invoice_ref'=>(!empty($invoice_source->ref) ? $invoice_source->ref : (empty($invoice_source->ref) ? '' : $invoice_source->ref)), // Dates $array_key.'_hour'=>dol_print_date($date, 'hour'), $array_key.'_date'=>dol_print_date($date, 'day'), From 3349cd392edebf5570adc765d1a7406a6929c396 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Jan 2023 13:22:44 +0100 Subject: [PATCH 12/42] Update commondocgenerator.class.php --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index f6725c6aef1..5799a1607e9 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -452,7 +452,7 @@ abstract class CommonDocGenerator $array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''), $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), - $array_key.'_source_invoice_ref'=>(!empty($invoice_source->ref) ? $invoice_source->ref : (empty($invoice_source->ref) ? '' : $invoice_source->ref)), + $array_key.'_source_invoice_ref'=>((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref), // Dates $array_key.'_hour'=>dol_print_date($date, 'hour'), $array_key.'_date'=>dol_print_date($date, 'day'), From 95cb4237bf3376e88e4342f92c9ae4b082a4eca1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Jan 2023 15:51:34 +0100 Subject: [PATCH 13/42] Fix css --- htdocs/admin/emailcollector_list.php | 6 +++++- htdocs/emailcollector/class/emailcollector.class.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 3be38cca113..fb09143412f 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -601,13 +601,17 @@ while ($i < $imaxinloop) { //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'lastresult') { + print '
'; + print $object->showOutputField($val, $key, $object->$key, ''); + print '
'; } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, $object->id, ''); } else { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b2b3cb70f39..ba274fba2c2 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -128,7 +128,7 @@ class EmailCollector extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax150'), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'), 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'), @@ -145,7 +145,7 @@ class EmailCollector extends CommonObject 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>100), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), 'codelastresult' => array('type'=>'varchar(16)', 'label'=>'CodeLastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>122, 'notnull'=>-1,), - 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'csslist'=>'small'), + 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'csslist'=>'small tdoverflowmax200'), 'datelastok' => array('type'=>'datetime', 'label'=>'DateLastcollectResultOk', 'visible'=>1, 'enabled'=>'$action != "create"', 'position'=>125, 'notnull'=>-1, 'csslist'=>'nowraponall'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>0, 'enabled'=>1, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,), diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 66aa7b0b35e..78e7c31077b 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -737,7 +737,7 @@ while ($i < $imaxinloop) { //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ' Date: Mon, 30 Jan 2023 15:51:34 +0100 Subject: [PATCH 14/42] Fix css --- htdocs/admin/emailcollector_list.php | 6 +++++- htdocs/emailcollector/class/emailcollector.class.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 3be38cca113..fb09143412f 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -601,13 +601,17 @@ while ($i < $imaxinloop) { //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'lastresult') { + print '
'; + print $object->showOutputField($val, $key, $object->$key, ''); + print '
'; } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, $object->id, ''); } else { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 7bf8306f4fd..6d8a8a048d3 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -128,7 +128,7 @@ class EmailCollector extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax150'), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'), 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'), @@ -145,7 +145,7 @@ class EmailCollector extends CommonObject 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>100), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), 'codelastresult' => array('type'=>'varchar(16)', 'label'=>'CodeLastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>122, 'notnull'=>-1,), - 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'csslist'=>'small'), + 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'csslist'=>'small tdoverflowmax200'), 'datelastok' => array('type'=>'datetime', 'label'=>'DateLastcollectResultOk', 'visible'=>1, 'enabled'=>'$action != "create"', 'position'=>125, 'notnull'=>-1, 'csslist'=>'nowraponall'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>0, 'enabled'=>1, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,), diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 95442195ff9..44e870b12de 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -730,7 +730,7 @@ while ($i < $imaxinloop) { //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ' Date: Mon, 30 Jan 2023 16:16:36 +0100 Subject: [PATCH 15/42] NEW The refresh link for imap collector is always visible --- htdocs/admin/emailcollector_card.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index b3d6e045470..034997b1716 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -387,7 +387,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref = '
'; $morehtmlref .= '
'; - $morehtml = $langs->trans("NbOfEmailsInInbox").' : '; + $morehtml = ''; $sourcedir = $object->source_directory; $targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' @@ -404,6 +404,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $connectstringserver = $object->getConnectStringIMAP($usessl); if ($action == 'scan') { + $nbemail = ''; if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { if ($object->acces_type == 1) { // Mode OAUth2 with PHP-IMAP @@ -493,7 +494,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $f = $client->getFolders(false, $object->source_directory); $nbemail = $f[0]->examine()["exists"]; - $morehtml .= $nbemail; } else { try { if ($sourcedir) { @@ -525,15 +525,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!$connection) { - $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; + $nbemail .= 'Failed to open IMAP connection '.$connectstringsource; if (function_exists('imap_last_error')) { - $morehtml .= '
'.imap_last_error(); + $nbemail .= '
'.imap_last_error(); } dol_syslog("Error ".$morehtml, LOG_WARNING); //var_dump(imap_errors()) } else { dol_syslog("Imap connected. Now we call imap_num_msg()"); - $morehtml .= imap_num_msg($connection); + $nbemail .= imap_num_msg($connection); } if ($connection) { @@ -541,12 +541,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea imap_close($connection); } } - } else { - $morehtml .= ''.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").''; } - $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); + $morehtml .= $form->textwithpicto($langs->trans("NbOfEmailsInInbox"), 'connect string '.$connectstringserver).': '; + + $morehtml .= ($nbemail != '' ? $nbemail : '?'); + + $morehtml .= '   '.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").''; } else { + $morehtml .= $langs->trans("NbOfEmailsInInbox").': '; $morehtml .= 'IMAP functions not available on your PHP. '; } From cc9cd3e3c7cc468b6c287012de088501c1dd9014 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Jan 2023 19:06:18 +0100 Subject: [PATCH 16/42] NEW Can set background style with MAIN_LOGIN_BACKGROUND_STYLE --- htdocs/core/tpl/login.tpl.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7f97e751ded..4900acc9ec2 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -133,9 +133,15 @@ $(document).ready(function () { -