From 35ed89a51709296af1e8e942f9a0c4765b22c872 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jul 2018 10:11:52 +0200 Subject: [PATCH 1/5] Fix scrutinizer --- htdocs/admin/dolistore/class/dolistore.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 1740c20edce..660886c835d 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -90,10 +90,10 @@ class Dolistore // Here we set the option array for the Webservice : we want products resources $opt = array(); $opt['resource'] = 'products'; + $opt2 = array(); // make a search to limit the id returned. if ($this->search != '') { - $opt2 = array(); $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; // Call @@ -109,7 +109,6 @@ class Dolistore } $opt['filter[id]'] = '['.implode('|', $products).']'; } elseif ($this->categorie != 0) { - $opt2 = array(); $opt2['resource'] = 'categories'; $opt2['id'] = $this->categorie; // Call From c94437c3cfaf1e212e64423dcc6935564e8d395c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jul 2018 10:14:51 +0200 Subject: [PATCH 2/5] Fix file in wrong dir --- htdocs/core/modules/modules_ticketsup.php | 120 ---------------------- 1 file changed, 120 deletions(-) delete mode 100644 htdocs/core/modules/modules_ticketsup.php diff --git a/htdocs/core/modules/modules_ticketsup.php b/htdocs/core/modules/modules_ticketsup.php deleted file mode 100644 index 9049e2f7e09..00000000000 --- a/htdocs/core/modules/modules_ticketsup.php +++ /dev/null @@ -1,120 +0,0 @@ - - * Copyright (C) 2014 Marcos GarcĂ­a - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/project/modules_project.php - * \ingroup project - * \brief File that contain parent class for projects models - * and parent class for projects numbering models - */ - -/** - * Classe mere des modeles de numerotation des references de projets - */ -abstract class ModeleNumRefTicket -{ - public $error = ''; - - /** - * Return if a module can be used or not - * - * @return boolean true if module can be used - */ - public function isEnabled() - { - return true; - } - - /** - * Renvoi la description par defaut du modele de numerotation - * - * @return string Texte descripif - */ - public function info() - { - global $langs; - $langs->load("ticket"); - return $langs->trans("NoDescription"); - } - - /** - * Renvoi un exemple de numerotation - * - * @return string Example - */ - public function getExample() - { - global $langs; - $langs->load("ticket"); - return $langs->trans("NoExample"); - } - - /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. - * - * @return boolean false si conflit, true si ok - */ - public function canBeActivated() - { - return true; - } - - /** - * Renvoi prochaine valeur attribuee - * - * @param Societe $objsoc Object third party - * @param Project $project Object project - * @return string Valeur - */ - public function getNextValue($objsoc, $project) - { - global $langs; - return $langs->trans("NotAvailable"); - } - - /** - * Renvoi version du module numerotation - * - * @return string Valeur - */ - public function getVersion() - { - global $langs; - $langs->load("admin"); - - if ($this->version == 'development') { - return $langs->trans("VersionDevelopment"); - } - - if ($this->version == 'experimental') { - return $langs->trans("VersionExperimental"); - } - - if ($this->version == 'dolibarr') { - return DOL_VERSION; - } - - if ($this->version) { - return $this->version; - } - - return $langs->trans("NotAvailable"); - } -} From 89cc048fff694445722f0bf5c754db22ea385cdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jul 2018 10:46:10 +0200 Subject: [PATCH 3/5] FIX Init of contact in combo list when thirdparty not yet known --- htdocs/core/class/html.form.class.php | 14 ++++++++------ htdocs/core/class/html.formticket.class.php | 6 +++--- htdocs/core/tpl/contacts.tpl.php | 2 +- htdocs/langs/en_US/main.lang | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fdc3ddb1a05..1120b78d038 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1287,7 +1287,7 @@ class Form * @param int $socid Id ot third party or 0 for all * @param string $selected Id contact pre-selectionne * @param string $htmlname Name of HTML field ('none' for a not editable field) - * @param int $showempty 0=no empty value, 1=add an empty value + * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list * @param string $exclude List of contacts id to exclude * @param string $limitto Disable answers that are not id in this array list * @param integer $showfunction Add function into label @@ -1311,10 +1311,10 @@ class Form * Return HTML code of the SELECT of list of all contacts (for a third party or all). * This also set the number of contacts found into $this->num * - * @param int $socid Id ot third party or 0 for all + * @param int $socid Id ot third party or 0 for all or -1 for empty list * @param array|int $selected Array of ID of pre-selected contact id * @param string $htmlname Name of HTML field ('none' for a not editable field) - * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit) + * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list * @param string $exclude List of contacts id to exclude * @param string $limitto Disable answers that are not id in this array list * @param integer $showfunction Add function into label @@ -1342,7 +1342,7 @@ class Form $sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp"; if ($showsoc > 0) $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc"; $sql.= " WHERE sp.entity IN (".getEntity('socpeople').")"; - if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid; + if ($socid > 0 || $socid == -1) $sql.= " AND sp.fk_soc=".$socid; if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut <> 0"; $sql.= " ORDER BY sp.lastname ASC"; @@ -1359,7 +1359,7 @@ class Form } if ($htmlname != 'none' || $options_only) $out.= '