From 1fd398234fc0e7d08e0bed0068c9b9adde8adf05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Nov 2018 15:29:49 +0100 Subject: [PATCH 1/7] remove warning --- htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 85592006a14..0f0e3c91a11 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software: you can redistribute it and/or modify @@ -200,7 +201,7 @@ class mymodulewidget1 extends ModeleBoxes * @param array $contents Array with properties of box lines * @return void */ - public function showBox($head = null, $contents = null) + public function showBox($head = null, $contents = null, $nooutput = 0) { // You may make your own code here… // … or use the parent's class function using the provided head and contents templates From 6cd27d8c8076610a2db4593cce775a0169e0b256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Nov 2018 18:08:06 +0100 Subject: [PATCH 2/7] add admin dkim translation --- htdocs/langs/en_US/admin.lang | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d9be14b3cb7..4ccfb04983f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -277,8 +277,12 @@ MAIN_MAIL_ENABLED_USER_DEST_SELECT=Add employee users with email into allowed re MAIN_MAIL_SENDMODE=Email sending method MAIN_MAIL_SMTPS_ID=SMTP ID (if sending server requires authentication) MAIN_MAIL_SMTPS_PW=SMTP Password (if sending server requires authentication) -MAIN_MAIL_EMAIL_TLS= Use TLS (SSL) encryption -MAIN_MAIL_EMAIL_STARTTLS= Use TLS (STARTTLS) encryption +MAIN_MAIL_EMAIL_TLS=Use TLS (SSL) encryption +MAIN_MAIL_EMAIL_STARTTLS=Use TLS (STARTTLS) encryption +MAIN_MAIL_EMAIL_DKIM_ENABLED=Use DKIM to generate email signature +MAIN_MAIL_EMAIL_DKIM_DOMAIN=Email Domain for use with dkim +MAIN_MAIL_EMAIL_DKIM_SELECTOR=Name of dkim selector +MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY=Private key for dkim signing MAIN_DISABLE_ALL_SMS=Disable all SMS sending (for test purposes or demos) MAIN_SMS_SENDMODE=Method to use to send SMS MAIN_MAIL_SMS_FROM=Default sender phone number for SMS sending @@ -1816,7 +1820,7 @@ VATIsUsedIsOff=Note: The option to use sales Tax or VAT has been set to SwapSenderAndRecipientOnPDF=Swap sender and recipient address on PDF FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only EmailCollector=Email collector -EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some record automatically (like leads). +EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some record automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server MailboxSourceDirectory=Mailbox source directory From 172468587d386f76d46c2194ee33df231d8fc26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Nov 2018 18:13:13 +0100 Subject: [PATCH 3/7] Update mymodulewidget1.php --- htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 0f0e3c91a11..edd2f627bb5 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -197,8 +197,9 @@ class mymodulewidget1 extends ModeleBoxes /** * Method to show box. Called by Dolibarr eatch time it wants to display the box. * - * @param array $head Array with properties of box title - * @param array $contents Array with properties of box lines + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string * @return void */ public function showBox($head = null, $contents = null, $nooutput = 0) From b271e1a3b0517a2441f8371524c64f744f3b72bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 10 Nov 2018 07:27:20 +0100 Subject: [PATCH 4/7] The variable $i seems to be never defined. --- htdocs/product/class/api_products.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 30940c95509..6d84a6d1352 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -110,7 +110,7 @@ class Products extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)" * @return array Array of product objects */ - function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode=0, $category=0, $sqlfilters = '') + function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '') { global $db, $conf; @@ -129,11 +129,12 @@ class Products extends DolibarrApi $sql.= " AND c.fk_categorie = ".$db->escape($category); $sql.= " AND c.fk_product = t.rowid "; } - // Show products - if ($mode == 1) { $sql.= " AND t.fk_product_type = 0"; - } - // Show services - if ($mode == 2) { $sql.= " AND t.fk_product_type = 1"; + if ($mode == 1) { + // Show only products + $sql.= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql.= " AND t.fk_product_type = 1"; } // Add sql filters if ($sqlfilters) { @@ -158,6 +159,7 @@ class Products extends DolibarrApi if ($result) { $num = $db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; while ($i < $min) { $obj = $db->fetch_object($result); From 2514cf4a9629b7203ec33393e34cceb6aab10e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 10 Nov 2018 07:32:22 +0100 Subject: [PATCH 5/7] Update actions_ticket.class.php --- htdocs/ticket/class/actions_ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index bf1e73404f1..c53496b674c 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -849,7 +849,7 @@ class ActionsTicket $id = $object->createTicketMessage($user); if ($id <= 0) { $error++; - $this->errors = $object->error; + $this->error = $object->error; $this->errors = $object->errors; $action = 'add_message'; } From c2ee9ba9dba0974f9e276b659b1a9bed98b83e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 10 Nov 2018 07:38:55 +0100 Subject: [PATCH 6/7] Update actions_ticket.class.php --- htdocs/ticket/class/actions_ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index c53496b674c..8f3c6985ac3 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -845,7 +845,7 @@ class ActionsTicket } if (!$error) { - $object->message = GETPOST("message"); + $object->message = (string) GETPOST("message"); $id = $object->createTicketMessage($user); if ($id <= 0) { $error++; From 20acf440a3cfcb84c72412359547f3054fbd02e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 10 Nov 2018 07:55:01 +0100 Subject: [PATCH 7/7] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 6d84a6d1352..afacbb158b5 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -132,7 +132,7 @@ class Products extends DolibarrApi if ($mode == 1) { // Show only products $sql.= " AND t.fk_product_type = 0"; - } elseif ($mode == 2) { + } elseif ($mode == 2) { // Show only services $sql.= " AND t.fk_product_type = 1"; }