From 4ac978303b0ea16aab239305e824fef9b9fbd9c1 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 10 Apr 2020 08:36:16 +0200 Subject: [PATCH 01/28] FIX TakePOS buying price --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f684d18741d..402516d2eaf 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -281,7 +281,7 @@ if ($action == "addline") $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', null, 0); + $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } @@ -295,7 +295,7 @@ if ($action == "freezone") { $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', null, 0); + $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } From 28fa0e4e5d26f1c43ac0dd5aef8bbbb79a2c1942 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 10 Apr 2020 11:49:20 +0200 Subject: [PATCH 02/28] FIX missing selectedlines on supplier order but checkbox are displayed --- htdocs/fourn/commande/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 981279db9dc..00843a07118 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1086,7 +1086,7 @@ if (empty($reshook)) if ($action == 'add' && $user->rights->fournisseur->commande->creer) { $error = 0; - + $selectedLines = GETPOST('toselect', 'array'); if ($socid < 1) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors'); @@ -1178,6 +1178,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { + if (!in_array($lines[$i]->id, $selectedLines)) continue; if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; @@ -1756,7 +1757,7 @@ if ($action == 'create') print ''; print ''; - print "\n"; + // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) @@ -1766,10 +1767,11 @@ if ($action == 'create') print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } + print "\n"; } elseif (!empty($object->id)) { From 83f3c9ab6e61f25cf9922d7194993b6bcf061456 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 10 Apr 2020 12:09:18 +0200 Subject: [PATCH 03/28] use only 1 if --- htdocs/fourn/commande/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 00843a07118..43964b38431 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1178,8 +1178,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { - if (!in_array($lines[$i]->id, $selectedLines)) continue; - if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) + if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0 || !in_array($lines[$i]->id, $selectedLines)) continue; $label = (!empty($lines[$i]->label) ? $lines[$i]->label : ''); From 1f471d46eb6445d3a736773e019716523b14a9cc Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 10 Apr 2020 15:51:51 +0200 Subject: [PATCH 04/28] FIX : some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report --- htdocs/compta/stats/cabyprodserv.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 786521c0511..f9057e1066c 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -243,6 +243,7 @@ if ($modecompta == 'CREANCES-DETTES') } $sql.= " WHERE l.fk_facture = f.rowid"; $sql.= " AND f.fk_statut in (1,2)"; + $sql.= " AND l.product_type in (0,1)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql.= " AND f.type IN (0,1,2,5)"; } else { From 63d41fa3564bd4f73f807dbe6cdc42903e54ec57 Mon Sep 17 00:00:00 2001 From: philazerty Date: Fri, 10 Apr 2020 16:48:18 +0200 Subject: [PATCH 05/28] Update list.php Bug #13519 --- htdocs/public/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index edb89257e3e..1a18954994f 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -215,7 +215,7 @@ if ($action == "view_ticketlist") 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0), 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0), - 't.fk_statut' => array('label' => $langs->trans("Statut"), 'checked' => 1), + 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1), 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1), 'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1), 'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1), From 450b1761b125a641e2ed0fe7f367aa52403238dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Apr 2020 01:09:26 +0200 Subject: [PATCH 06/28] Fix label --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 6f3994572c6..14fa17480d9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -165,7 +165,7 @@ SuppliersPrices=Vendor prices SuppliersPricesOfProductsOrServices=Vendor prices (of products or services) CustomCode=Customs / Commodity / HS code CountryOrigin=Origin country -Nature=Nature of produt (material/finished) +Nature=Nature of product (material/finished) ShortLabel=Short label Unit=Unit p=u. From 9270e2c614d11d61c74961e351eae86eb1a54222 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 16:31:08 +0200 Subject: [PATCH 07/28] 4 rows of actions buttons in TakePOS --- htdocs/takepos/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4f5ef29bc70..04281bbd61b 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -648,14 +648,14 @@ function MoreActions(totalactions){ if (pageactions==0){ pageactions=1; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).hide(); + if (i<12) $("#action"+i).hide(); else $("#action"+i).show(); } } else if (pageactions==1){ pageactions=0; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).show(); + if (i<12) $("#action"+i).show(); else $("#action"+i).hide(); } } @@ -935,12 +935,12 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { foreach ($menus as $menu) { $i++; - if (count($menus) > 9 and $i == 9) + if (count($menus) > 12 and $i == 12) { echo ''; echo ''; } - elseif ($i > 9) echo ''; + elseif ($i > 12) echo ''; else echo ''; } From fecfe2e3a18d7b5cdf2caf76d03ed3ea2f53329e Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 11 Apr 2020 18:37:06 +0200 Subject: [PATCH 08/28] Keep compatibility with old object declaration --- htdocs/core/class/html.form.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4be8c74ffac..9b89a1bfc09 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6032,6 +6032,11 @@ class Form } if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow; } + else + { + $fieldstoshow = 't.ref'; // Keep compatibility with old object not declare yet fields + } + if (empty($fieldstoshow)) { if (isset($objecttmp->fields['ref'])) { From b6ffcd0a6ba6a5fdc4c1f47e86d3abfe5586ae76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 21:10:21 +0200 Subject: [PATCH 09/28] Update fichinterrec.class.php --- htdocs/fichinter/class/fichinterrec.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 787a0379cfa..679d231d6a8 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -43,6 +43,11 @@ class FichinterRec extends Fichinter public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'titre'; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From 78b43ddb1f19ffa7ccd0cd4983fcdbf3774ae4f1 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sat, 11 Apr 2020 22:19:36 +0200 Subject: [PATCH 10/28] TakePOS connector update --- htdocs/takepos/admin/receipt.php | 2 +- htdocs/takepos/css/colorful.css | 4 ++++ htdocs/takepos/index.php | 3 ++- htdocs/takepos/invoice.php | 17 ++++++++++++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 79d6277c761..83b31569a7b 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -155,7 +155,7 @@ print "\n"; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print ''; - print $langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; + print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; print ''; print ''; print ''; diff --git a/htdocs/takepos/css/colorful.css b/htdocs/takepos/css/colorful.css index 298a29ce4cf..4df43a70334 100644 --- a/htdocs/takepos/css/colorful.css +++ b/htdocs/takepos/css/colorful.css @@ -31,3 +31,7 @@ tr.selected, tr.selected td { .topnav{ background: rgb(0,0,0) !important; } + +.fa-trash { + color: #fff !important; +} diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4f5ef29bc70..39515e72d21 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -874,7 +874,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + else $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 95766802b76..c6d59323e6c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -590,7 +590,8 @@ if ($action == "valid" || $action == "history") } $sectionwithinvoicelink .= ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $sectionwithinvoicelink .= ' '; + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $sectionwithinvoicelink .= ' '; + else $sectionwithinvoicelink .= ' '; } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { @@ -708,6 +709,20 @@ function TakeposPrinting(id){ }); }); } + +function TakeposConnector(id){ + var invoice=''; + $.ajax({ + type: "POST", + url: 'global->TAKEPOS_PRINT_SERVER; ?>/print.php', + data: 'invoice='+invoice + }); +} + function DolibarrTakeposPrinting(id) { console.log('Printing invoice ticket ' + id) $.ajax({ From 5dc3b8dfd5cc194387b0c7de751601628f7f0888 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 22:36:46 +0200 Subject: [PATCH 11/28] Travis fix --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 39515e72d21..e19d9181d8e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -874,7 +874,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); else $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); From e2660fd31c7c14bb5344a77ed14880ef598d85a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 11 Apr 2020 22:38:28 +0200 Subject: [PATCH 12/28] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 392cd9255d9..98b910fdfca 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -774,7 +774,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } @@ -785,7 +785,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } From 323a62f1e7bdfd4521054edf2e21961cbc6b3b85 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 11 Apr 2020 22:38:59 +0200 Subject: [PATCH 13/28] travis fix --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index c6d59323e6c..aa06addc5ff 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -590,8 +590,8 @@ if ($action == "valid" || $action == "history") } $sectionwithinvoicelink .= ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == TRUE) $sectionwithinvoicelink .= ' '; - else $sectionwithinvoicelink .= ' '; + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $sectionwithinvoicelink .= ' '; + else $sectionwithinvoicelink .= ' '; } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { From 9a1e3c1a747d9636af39ee599abe5373713366d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 08:59:56 +0200 Subject: [PATCH 14/28] Update llx_blockedlog.sql --- htdocs/install/mysql/tables/llx_blockedlog.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 80a4c150150..889b28d7a73 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, object_data mediumtext, - object_version varchar(32) DEFAULT ''; + object_version varchar(32) DEFAULT '', certified integer ) ENGINE=innodb; From 33a926e2512a606b2f87cb53a31b90ef2f068c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 09:08:27 +0200 Subject: [PATCH 15/28] Update llx_categorie_website_page.key.sql --- .../install/mysql/tables/llx_categorie_website_page.key.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql index b2af52d8fe9..f819663fd31 100644 --- a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql +++ b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql @@ -16,9 +16,9 @@ -- -- ============================================================================ -ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_website_page); ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_categorie (fk_categorie); -ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_website_page); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid); From 3f59ca6418d86f7f34f9c7ce7ee7a4f2aea21243 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 10:13:37 +0200 Subject: [PATCH 16/28] Fix #13576 : links on variants --- htdocs/variants/combinations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 306586ec504..b39991e7f31 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -777,8 +777,8 @@ if (!empty($id) || !empty($ref)) print ''.$prodstatic->getLibStatut(2, 0).''; print ''.$prodstatic->getLibStatut(2, 1).''; print ''; - print ''.img_edit().''; - print ''.img_delete().''; + print 'id.'">'.img_edit().''; + print 'id.'">'.img_delete().''; print ''; print ''; if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined From 8bca68cfba3c0e08cb9d4e17851b446c54ccfa28 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 10:39:16 +0200 Subject: [PATCH 17/28] Fix missing token on product composition --- htdocs/product/composition/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 88945342af5..f67910cbef4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -317,6 +317,7 @@ if ($id > 0 || ! empty($ref)) print load_fiche_titre($langs->trans("ProductAssociationList"), '', ''); print '
'; + print ''; print ''; print ''; From 6b16a3ad390587f3e2e51e30445c0e17d1bea218 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 13:25:19 +0200 Subject: [PATCH 18/28] NEW Can check all events in one click in setup of audited events --- htdocs/admin/events.php | 34 +++++++++++++++++++++------ htdocs/admin/perms.php | 4 +--- htdocs/core/class/html.form.class.php | 2 +- htdocs/langs/en_US/errors.lang | 1 + htdocs/website/index.php | 14 +++++------ 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 65a03adc4f1..c3b9b372915 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -28,14 +28,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; -if (!$user->admin) -accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} // Load translation files required by the page $langs->loadLangs(array("users", "admin", "other")); $action = GETPOST('action', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; @@ -44,6 +56,7 @@ $eventstolog = $securityevent->eventstolog; /* * Actions */ + if ($action == "save") { $i = 0; @@ -67,6 +80,12 @@ if ($action == "save") * View */ +$form = new Form($db); + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ''; +$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); + $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; llxHeader('', $langs->trans("Audit"), $wikihelp); @@ -85,9 +104,10 @@ $head = security_prepare_head(); dol_fiche_head($head, 'audit', $langs->trans("Security"), -1); -print ""; +print '
'; print ""; -print ""; +print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print "\n"; // Loop on each event type foreach ($eventstolog as $key => $arr) @@ -96,10 +116,10 @@ foreach ($eventstolog as $key => $arr) { print ''; print ''; - print ''."\n"; } } @@ -109,7 +129,7 @@ dol_fiche_end(); print '
'; print "trans("Save")."\">"; -print "
"; +print ''; print "\n"; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 60bd157d283..0486edebeec 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -203,7 +203,7 @@ if ($result) // Show break line print ''; print ''; print ''; @@ -218,8 +218,6 @@ if ($result) // Picto and label of module print ''; // Tick diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 965bca72824..f59e57d3516 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7788,7 +7788,7 @@ class Form $(document).ready(function() { $("#checkallactions'.$id.'").click(function() { if($(this).is(\':checked\')){ - console.log("We check all"); + console.log("We check all '.$cssclass.'"); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 88e18c62943..0ea2940911b 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -236,6 +236,7 @@ ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in w ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s". ErrorOnlyOneFieldForGroupByIsPossible=Only 1 field for the 'Group by' is possible (others are discarded) ErrorTooManyDifferentValueForSelectedGroupBy=Found too many different value (more than %s) for the field '%s', so we can't user it as a 'Group by' for graphics. The field 'Group By' has been removed. May be you wanted to use it as an X-Axis ? +ErrorReplaceStringEmpty=Error, the string to replace into is empty # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 629e4b91584..c724ab4e3cf 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -369,7 +369,11 @@ if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchke if ($massaction == 'replace') { $replacestring = GETPOST('replacestring', 'alphanohtml'); - if (! $replacestring) { + + if (empty($user->rights->website->writephp)) { + setEventMessages("NotAllowedToAddDynamicContent", null, 'errors'); + } + elseif (! $replacestring) { setEventMessages("ErrorReplaceStringEmpty", null, 'errors'); } else { @@ -3531,12 +3535,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $permissiontodelete = 0; // List of mass actions available - $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - 'replace'=>$langs->trans("Replace"), - ); + $arrayofmassactions = array(); + if ($user->rights->website->writephp) $arrayofmassactions['replace'] = $langs->trans("Replace"); if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From d7784887d15fbb45ebd9667d4f25a81aee55a258 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 14:58:50 +0200 Subject: [PATCH 19/28] More font awesome picto --- htdocs/contact/class/contact.class.php | 2 +- htdocs/core/lib/functions.lib.php | 22 ++++++++++++---------- htdocs/core/modules/modFckeditor.class.php | 2 +- htdocs/core/modules/modSalaries.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8d880226ff4..9cad793ba3d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1348,7 +1348,7 @@ class Contact extends CommonObject } $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valigntextbottom"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)); $result .= $linkend; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index de8c73db44a..8256e268dc6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3134,13 +3134,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', - 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', + 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', + 'delete', 'dolly', 'edit', 'ellipsis-h', 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', - 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_holiday', 'object_hrm', 'object_accounting', 'object_category', 'object_multicurrency', - 'object_printer', 'object_resource', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', - 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', + 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', + 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', @@ -3163,6 +3164,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', + 'company'=>'building', 'contact'=>'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3175,7 +3177,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3234,8 +3236,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', 'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', - 'holiday'=>'bg-infoxbox-holiday', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', - 'title_agenda'=>'bg-infoxbox-action', + 'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', + 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { @@ -3244,9 +3246,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Define $color $arrayconvpictotocolor = array( - 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'address'=>'#37a', 'building'=>'#37a', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', 'other'=>'#ddd', - 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', + 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 541615065bb..8f2d164e9ca 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -54,7 +54,7 @@ class modFckeditor extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. - $this->picto = 'list'; + $this->picto = 'paragraph'; // Data directories to create when module is enabled $this->dirs = array("/medias/temp", "/medias/image"); diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 0a3ff8f5591..7159ca634d5 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -62,7 +62,7 @@ class modSalaries extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'bill'; + $this->picto = 'payment'; // Data directories to create when module is enabled $this->dirs = array("/salaries/temp"); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6426d9ab98b..cd7ad23af7f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2480,7 +2480,7 @@ class Societe extends CommonObject } $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valignmiddle"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($name, $maxlen) : $name); $result .= $linkend; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a1ca78fe67a..52ce0dc0ab0 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1148,7 +1148,7 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['s.email']['checked'])) { - print "\n"; + print "\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4e77fc7fe2d..a05b0319ba3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1573,7 +1573,7 @@ div.nopadding { td.nobordernopadding.widthpictotitle.col-picto { color: var(--colortexttitlenotab); - opacity: 0.7; + opacity: 0.85; } .pictotitle { margin-: 8px; From 0916017519c4a38c1de79b8e51f1375f55126bf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 15:29:13 +0200 Subject: [PATCH 20/28] Fix addreplace hook --- htdocs/core/lib/functions.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8256e268dc6..35869df46f1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2269,10 +2269,15 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } } - $rep = '
'.($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail.'
'; + //$rep = '
'; + $rep .= ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; + //$rep .= '
'; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email); + if ($reshook > 0) { + $rep = ''; + } $rep .= $hookmanager->resPrint; } @@ -3140,7 +3145,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', - 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', @@ -3177,7 +3182,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3237,7 +3242,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', - 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', + 'ticket'=>'bg-infoxbox-contrat', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { From 20e684ec69691c550db997f7629f04a398f82a61 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 12 Apr 2020 15:30:58 +0200 Subject: [PATCH 21/28] Fix #13468 setup working days and hours --- htdocs/admin/ihm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 83f7b03d67f..19c0bab7150 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -154,8 +154,8 @@ if ($action == 'update') //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); From 7c72e406591dee6576de972270c8516219117654 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Sun, 12 Apr 2020 15:21:14 +0100 Subject: [PATCH 22/28] Installation issue Installation SQL issue due to a ';' instead of a ','. --- htdocs/install/mysql/tables/llx_blockedlog.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 80a4c150150..889b28d7a73 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, object_data mediumtext, - object_version varchar(32) DEFAULT ''; + object_version varchar(32) DEFAULT '', certified integer ) ENGINE=innodb; From 044a6192b60999af6ea7ae7ffa1a3d5aba1306cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Apr 2020 16:26:19 +0200 Subject: [PATCH 23/28] doxygen --- htdocs/admin/system/phpinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index db9a893ff9f..ce21c1f3ad8 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -401,7 +401,7 @@ function getTableColumnFunction(array $functions) * @param array $loaded A list with all loaded PHP extensions * @param array $functions A list with all PHP functions to check * - * @return array + * @return string */ function getResultColumn($name, array $activated, array $loaded, array $functions) { From 7d430c08d02c0064c7e300fced85c199f9ef0040 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:36:25 +0200 Subject: [PATCH 24/28] Look and feel v12 --- htdocs/core/class/hookmanager.class.php | 3 +- htdocs/core/lib/functions.lib.php | 5 +- .../class/api_interventions.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/index.php | 110 ++++++++++------- htdocs/langs/en_US/companies.lang | 1 - htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/list.php | 2 +- .../class/supplier_proposal.class.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 +- htdocs/theme/eldy/info-box.inc.php | 42 ++----- htdocs/theme/md/info-box.inc.php | 6 +- htdocs/ticket/card.php | 4 +- htdocs/ticket/class/ticket.class.php | 116 ++++++++++++++++++ 14 files changed, 207 insertions(+), 94 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bffbfec9c50..e24bce5e247 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -149,7 +149,7 @@ class HookManager $parameters['context'] = join(':', $this->contextarray); //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); - // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). + // Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). $hooktype = 'output'; if (in_array( $method, @@ -199,6 +199,7 @@ class HookManager 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', + 'printEmail', 'printSearchForm', 'printTabsHead', 'printObjectLine', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35869df46f1..092e36cef72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3144,7 +3144,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_company', 'object_contact', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3169,7 +3169,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', - 'company'=>'building', 'contact'=>'address-book', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3236,6 +3236,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Add CSS $arrayconvpictotomorcess = array( 'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account', + 'contract'=>'bg-infoxbox-contrat', 'multicurrency'=>'bg-infoxbox-bank_account', 'check'=>'font-status4', 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 7dd6045b19b..4f81930355e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -21,7 +21,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; /** - * API class for fichinters + * API class for Interventions * * @access protected * @class DolibarrApiAccess {@requires user,external} diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 118e21a841c..ff88847140b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -202,7 +202,7 @@ class Fichinter extends CommonObject { while ($obj = $this->db->fetch_object($resql)) { - $this->nb["fichinters"] = $obj->nb; + $this->nb["interventions"] = $obj->nb; } $this->db->free($resql); return 1; diff --git a/htdocs/index.php b/htdocs/index.php index 110de972f2b..24330736287 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -108,7 +108,6 @@ if (!empty($conf->global->MAIN_MOTD)) * Hidden for external users */ - $boxstatItems = array(); $boxstatFromHook = ''; @@ -128,26 +127,27 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { // Condition to be checked for each display line dashboard $conditions = array( - $user->rights->user->user->lire, - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - !empty($conf->adherent->enabled) && $user->rights->adherent->lire, - !empty($conf->product->enabled) && $user->rights->produit->lire, - !empty($conf->service->enabled) && $user->rights->service->lire, - !empty($conf->propal->enabled) && $user->rights->propale->lire, - !empty($conf->commande->enabled) && $user->rights->commande->lire, - !empty($conf->facture->enabled) && $user->rights->facture->lire, - !empty($conf->contrat->enabled) && $user->rights->contrat->lire, - !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - !empty($conf->projet->enabled) && $user->rights->projet->lire, - !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - !empty($conf->holiday->enabled) && $user->rights->holiday->read, - !empty($conf->don->enabled) && $user->rights->don->lire + $user->rights->user->user->lire, + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, + !empty($conf->adherent->enabled) && $user->rights->adherent->lire, + !empty($conf->product->enabled) && $user->rights->produit->lire, + !empty($conf->service->enabled) && $user->rights->service->lire, + !empty($conf->propal->enabled) && $user->rights->propale->lire, + !empty($conf->commande->enabled) && $user->rights->commande->lire, + !empty($conf->facture->enabled) && $user->rights->facture->lire, + !empty($conf->contrat->enabled) && $user->rights->contrat->lire, + !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, + !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + !empty($conf->projet->enabled) && $user->rights->projet->lire, + !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + !empty($conf->holiday->enabled) && $user->rights->holiday->read, + !empty($conf->don->enabled) && $user->rights->don->lire, + !empty($conf->ticket->enabled) && $user->rights->ticket->read ); // Class file containing the method load_state_board for each line $includes = array( @@ -170,7 +170,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_DOCUMENT_ROOT."/projet/class/project.class.php", DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php", - DOL_DOCUMENT_ROOT."/don/class/don.class.php" + DOL_DOCUMENT_ROOT."/don/class/don.class.php", + DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php" ); // Name class containing the method load_state_board for each line $classes = array('User', @@ -192,7 +193,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'Project', 'ExpenseReport', 'Holiday', - 'Don' + 'Don', + 'Ticket', ); // Cle array returned by the method load_state_board for each line $keys = array('users', @@ -206,15 +208,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'proposals', 'orders', 'invoices', - 'Contracts', - 'fichinters', + 'contracts', + 'interventions', 'supplier_orders', 'supplier_invoices', 'askprice', 'projects', 'expensereports', 'holidays', - 'donations' + 'donations', + 'ticket' ); // Dashboard Icon lines $icons = array('user', @@ -228,15 +231,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'propal', 'order', 'bill', - 'order', - 'order', + 'contract', + 'intervention', 'order', 'bill', 'propal', 'projectpub', 'trip', 'holiday', - 'generic' + 'generic', + 'ticket', ); // Translation keyword $titres = array("Users", @@ -258,7 +262,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "Projects", "ExpenseReports", "Holidays", - "Donations" + "Donations", + "Ticket", ); // Dashboard Link lines $links = array( @@ -282,7 +287,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday', - DOL_URL_ROOT.'/don/list.php?leftmenu=donations' + DOL_URL_ROOT.'/don/list.php?leftmenu=donations', + DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket' ); // Translation lang files $langfile = array( @@ -306,12 +312,13 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "trips", "holiday", "donations", + "ticket" ); // Loop and displays each line of table $boardloaded = array(); - foreach ($keys as $key=>$val) + foreach ($keys as $key => $val) { if ($conditions[$key]) { @@ -331,7 +338,6 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) $board = $boardloaded[$classe]; } - if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text = $langs->trans($titres[$key]); $boxstatItem .= ''; @@ -415,7 +421,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting'); } - // Number of services enabled (delayed) + // Number of contract / services enabled (delayed) if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); @@ -423,6 +429,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of active services (expired) $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); } + + // Number of tickets open + if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) { + include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $board = new Ticket($db); + $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); + // Number of active services (expired) + //$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); + } + // Number of invoices customers (has paid) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -526,13 +542,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('facture'), ), - 'contrat' => - array( - 'groupName' => 'Contracts', - 'globalStatsKey' => 'Contracts', - 'stats' => - array('contrat_inactive', 'contrat_active'), - ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', @@ -554,7 +563,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('invoice_supplier'), ), - 'bank_account' => + 'contrat' => + array( + 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', + 'stats' => + array('contrat_inactive', 'contrat_active'), + ), + 'ticket' => + array( + 'groupName' => 'Tickets', + 'globalStatsKey' => 'OpenTickets', + 'stats' => + array('ticket_opened'), + ), + 'bank_account' => array( 'groupName' => 'BankAccount', 'stats' => @@ -587,8 +610,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $parameters = array( 'dashboardgroup' => $dashboardgroup ); - $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index c569a48c84a..609ea0efdf2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -325,7 +325,6 @@ CompanyDeleted=Company "%s" deleted from database. ListOfContacts=List of contacts/addresses ListOfContactsAddresses=List of contacts/addresses ListOfThirdParties=List of Third Parties -ShowCompany=Show Third Party ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cd7ad23af7f..6c5889b89fe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2407,7 +2407,7 @@ class Societe extends CommonObject // By default if (empty($linkstart)) { - $label .= ''.$langs->trans("ShowCompany").''; + $label .= ''.$langs->trans("ThirdParty").''; $linkstart = '".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1)."\n"; + print '
\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 2f7d4b39cf3..21c7ea4c6dc 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2436,7 +2436,7 @@ class SupplierProposal extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Charge indicateurs this->nb de tableau de bord + * Load indicator this->nb of global stats widget * * @return int <0 if ko, >0 if ok */ diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a05b0319ba3..3bf20f74c4e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3826,8 +3826,8 @@ div.boximport { .fieldrequired { font-weight: bold; color: var(--fieldrequiredcolor); } -.widthpictotitle { width: 32px; text-align: ; } -span.widthpictotitle { font-size: 2em; }; +.widthpictotitle { width: 26px; text-align: ; } +span.widthpictotitle { font-size: 1.7em; }; .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } .dolgraphtitlecssboxes { /* margin: 0px; */ } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 9f958943080..312521fe829 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -77,7 +77,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-icon-text{ @@ -220,11 +220,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; +.bg-infoxbox-contrat, .bg-infoxbox-ticket{ + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; @@ -258,6 +258,9 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .fa-dol-contrat:before { content: "\f1e6"; } +.fa-dol-ticket:before { + content: "\f3ff"; +} .fa-dol-bank_account:before { content: "\f19c"; } @@ -297,37 +300,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES color : #b91f1f; } -/* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */ -/* For other themes just uncomment this part */ -/*.info-box-weather-level0, -.info-box-weather-level1, -.info-box-weather-level2, -.info-box-weather-level3, -.info-box-weather-level4 { - background-position: 15px 50%; - background-repeat: no-repeat; -} - -.info-box-weather .info-box-icon{ - display: none !important; -} -.info-box-weather-level0 { - background-image: url("img/weather/weather-clear.png"); -} -.info-box-weather-level1 { - background-image: url("img/weather/weather-few-clouds.png"); -} -.info-box-weather-level2 { - background-image: url("img/weather/weather-clouds.png"); -} -.info-box-weather-level3 { - background-image: url("img/weather/weather-many-clouds.png"); -} -.info-box-weather-level4 { - background-image: url("img/weather/weather-storm.png"); -}*/ - - .box-flex-container{ display: flex; /* or inline-flex */ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 6104c623c00..ad1f037ab1e 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -61,7 +61,7 @@ span.info-box-icon-text { /* hide box text number due to problems */ max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-content { padding: 5px 10px; @@ -126,11 +126,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat i.fa{ +.bg-infoxbox-contrat i.fa, .bg-infoxbox-ticket i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account i.fa{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d59581fa914..8b8ba741ad3 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -742,7 +742,9 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $head = societe_prepare_head($object->thirdparty); dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company'); + dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); + dol_fiche_end(); } @@ -790,7 +792,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (!empty($conf->projet->enabled)) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project'); + $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d4f080bc3e2..8ee299f6f78 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2781,6 +2781,122 @@ class Ticket extends CommonObject setEventMessages($langs->trans('ErrorMailRecipientIsEmptyForSendTicketMessage'), null, 'warnings'); } } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice + * @return int <0 if KO, >0 if OK + */ + public function load_board($user, $mode) + { + // phpcs:enable + global $conf, $user, $langs; + + $now = dol_now(); + + $this->nbtodo = $this->nbtodolate = 0; + $clause = " WHERE"; + + $sql = "SELECT p.rowid, p.ref, p.datec as datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = " AND"; + } + $sql .= $clause." p.entity IN (".getEntity('ticket').")"; + if ($mode == 'opened') $sql .= " AND p.fk_statut in (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")"; + if ($user->socid) $sql .= " AND p.fk_soc = ".$user->socid; + + $resql = $this->db->query($sql); + if ($resql) + { + $label = $labelShort = ''; + $status = ''; + if ($mode == 'opened') { + $status = 'openall'; + //$delay_warning = $conf->ticket->warning_delay; + $delay_warning = 0; + $label = $langs->trans("MenuListNonClosed"); + $labelShort = $langs->trans("MenuListNonClosed"); + } + + $response = new WorkboardResponse(); + $response->warning_delay = $delay_warning / 60 / 60 / 24; + $response->label = $label; + $response->labelShort = $labelShort; + $response->url = DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.$status; + $response->img = img_object('', "ticket"); + + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $response->nbtodo++; + if ($mode == 'opened') + { + $datelimit = $this->db->jdate($obj->datefin); + if ($datelimit < ($now - $delay_warning)) + { + //$response->nbtodolate++; + } + } + } + return $response; + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicator this->nb of global stats widget + * + * @return int <0 if ko, >0 if ok + */ + public function load_state_board() + { + // phpcs:enable + global $conf, $user; + + $this->nb = array(); + $clause = "WHERE"; + + $sql = "SELECT count(p.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = "AND"; + } + $sql .= " ".$clause." p.entity IN (".getEntity('ticket').")"; + + $resql = $this->db->query($sql); + if ($resql) + { + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $this->nb["ticket"] = $obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + return -1; + } + } } From acab0200a692544bf66e6380af73e4c11368f9b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:46:21 +0200 Subject: [PATCH 25/28] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9b89a1bfc09..d08d230b3bd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6034,7 +6034,7 @@ class Form } else { - $fieldstoshow = 't.ref'; // Keep compatibility with old object not declare yet fields + $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref'); } if (empty($fieldstoshow)) From 697043bbd378a557755fd0f06efb9544747df446 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:47:56 +0200 Subject: [PATCH 26/28] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d08d230b3bd..6f911260afd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6034,7 +6034,8 @@ class Form } else { - $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref'); + // For backward compatibility + $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); } if (empty($fieldstoshow)) From 2e27355dec0b23c0722806a0e5e693d0470b2d1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:51:35 +0200 Subject: [PATCH 27/28] FIX #13569 --- htdocs/compta/bank/class/account.class.php | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 6fc0efbd6e0..d030d523734 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -214,6 +214,76 @@ class Account extends CommonObject */ public $date_solde; + + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), + 'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1), + 'bank' =>array('type'=>'varchar(60)', 'label'=>'Bank', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'code_banque' =>array('type'=>'varchar(128)', 'label'=>'Code banque', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'code_guichet' =>array('type'=>'varchar(6)', 'label'=>'Code guichet', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'number' =>array('type'=>'varchar(255)', 'label'=>'Number', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'cle_rib' =>array('type'=>'varchar(5)', 'label'=>'Cle rib', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'bic' =>array('type'=>'varchar(11)', 'label'=>'Bic', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'iban_prefix' =>array('type'=>'varchar(34)', 'label'=>'Iban prefix', 'enabled'=>1, 'visible'=>-1, 'position'=>70), + 'country_iban' =>array('type'=>'varchar(2)', 'label'=>'Country iban', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'cle_iban' =>array('type'=>'varchar(2)', 'label'=>'Cle iban', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'domiciliation' =>array('type'=>'varchar(255)', 'label'=>'Domiciliation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'state_id' =>array('type'=>'integer', 'label'=>'State id', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>95), + 'proprio' =>array('type'=>'varchar(60)', 'label'=>'Proprio', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'owner_address' =>array('type'=>'text', 'label'=>'Owner address', 'enabled'=>1, 'visible'=>-1, 'position'=>105), + 'courant' =>array('type'=>'smallint(6)', 'label'=>'Courant', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>110), + 'clos' =>array('type'=>'smallint(6)', 'label'=>'Clos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>115), + 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), + 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'min_desired' =>array('type'=>'integer', 'label'=>'Min desired', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'comment' =>array('type'=>'text', 'label'=>'Comment', 'enabled'=>1, 'visible'=>-1, 'position'=>155), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>156), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), + 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + ); + // END MODULEBUILDER PROPERTIES + /** * Current account */ From 8e246f2a18b6eb914dd167d202600fcb74fd36a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Apr 2020 16:54:54 +0200 Subject: [PATCH 28/28] Prepare 11.0.4 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 6463736ac93..0352963b13e 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128));
".$langs->trans("LogEvents")."
'.$arr['id'].''; + print ''; $key = 'MAIN_LOGEVENTS_'.$arr['id']; $value = $conf->global->$key; - print ''; + print ''; print '
'; - print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName(); print ''; print ' '; - //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); - //print ' '; print '".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1)."'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."