From b4a9a0cafb202def9797bdf44f3d938bb362a8cb Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 8 Sep 2015 13:07:13 +0200 Subject: [PATCH 001/116] Allow contact definition on additionnal modules If additionnal module use contactelement feature, the module is referenced on element list on contact type --- htdocs/admin/dict.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f9137a06acf..6fb9454ce58 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -464,6 +464,9 @@ if ($id == 11) 'fichinter' => $langs->trans('InterventionCard') ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); + + complete_elementList_with_modules($elementList); + asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), From e2a738bf5428f96cc074a1756720f2a928cd9611 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 8 Sep 2015 13:11:26 +0200 Subject: [PATCH 002/116] New fonction complete_elementList_with_modules if contactelement is defined on module definition, add module on definition type of contact --- htdocs/core/lib/admin.lib.php | 121 ++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7469777fa89..571e24bf38a 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1019,6 +1019,127 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql return 1; } +/** + * Add external modules to list of contact element + * + * @param array $elementList elementList + * @return int 1 + */ +function complete_elementList_with_modules(&$elementList) +{ + global $db, $modules, $conf, $langs; + + // Search modules + $filename = array(); + $modules = array(); + $orders = array(); + $categ = array(); + $dirmod = array(); + $modulesdir = array(); + $i = 0; // is a sequencer of modules found + $j = 0; // j is module number. Automatically affected if module number not defined. + + foreach ($conf->file->dol_document_root as $type => $dirroot) + { + $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; + + $handle=@opendir($dirroot); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + { + if (is_dir($dirroot . '/' . $file . '/core/modules/')) + { + $modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/'; + } + } + } + closedir($handle); + } + } + + foreach ($modulesdir as $dir) + { + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
"; + dol_syslog("Scan directory ".$dir." for modules"); + $handle=@opendir(dol_osencode($dir)); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + //print "$i ".$file."\n
"; + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); + + if ($modName) + { + include_once $dir.$file; + $objMod = new $modName($db); + + if ($objMod->numero > 0) + { + $j = $objMod->numero; + } + else + { + $j = 1000 + $i; + } + + $modulequalified=1; + + // We discard modules according to features level (PS: if module is activated we always show it) + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + //If module is not activated disqualified + if (empty($conf->global->$const_name)) $modulequalified=0; + + if ($modulequalified) + { + // Load languages files of module + if (isset($objMod->langfiles) && is_array($objMod->langfiles)) + { + foreach($objMod->langfiles as $langfile) + { + $langs->load($langfile); + } + } + + $modules[$i] = $objMod; + $filename[$i]= $modName; + $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module + //print "x".$modName." ".$orders[$i]."\n
"; + if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories + else $categ[$objMod->special]=1; + $dirmod[$i] = $dirroot; + + if (! empty($objMod->contactelement)) + { + $elementList[$objMod->name] = $langs->trans($objMod->name); + //exit; + } + + $j++; + $i++; + } + else dol_syslog("Module ".get_class($objMod)." not qualified"); + } + } + } + closedir($handle); + } + else + { + dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); + } + } + + return 1; +} /** * Show array with constants to edit From d9693ba2f2d96e14ec184324a2466b0d8eae5f7d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 9 Oct 2015 06:16:43 +0200 Subject: [PATCH 003/116] New : Module HRM --- htdocs/core/modules/modHRM.class.php | 250 +++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 htdocs/core/modules/modHRM.class.php diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php new file mode 100644 index 00000000000..cfc85acff16 --- /dev/null +++ b/htdocs/core/modules/modHRM.class.php @@ -0,0 +1,250 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/modules/modHRM.class.php + * \ingroup HRM + * \brief Description and activation file for module HRM + */ +include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"); + +/** + * \class modHRM + * \brief Class to describe and activate the HRM module + */ +class modiHRM extends DolibarrModules +{ + /** + * Constructor. + * Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db + */ + public function __construct($db) + { + global $langs, $conf; + + $this->db = $db; + + $this->numero = 4000; + $this->rights_class = 'hrm'; + + $this->family = "hr"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace ( '/^mod/i', '', get_class ( $this ) ); + $this->description = "Gestion des ressources humaines"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'develop'; + + $this->const_name = 'MAIN_MODULE_' . strtoupper ( $this->name ); + $this->special = 0; + // $this->picto = ''; + + // define triggers + $this->module_parts = array ( + + // Data directories to create when module is enabled + $this->dirs = array (); + + // Config pages + $this->config_page_url = array('admin_hrm.php'); + + // Dependencies + $this->depends = array(); + $this->requiredby = array(" + modSalaries, + modExpenseReport, + modHoliday + "); + $this->conflictwith = array(); + $this->phpmin = array ( + 5, + 3 + ); // Minimum version of PHP required by module + $this->need_dolibarr_version = array ( + 3, + 8 + ); // Minimum version of Dolibarr required by module + $this->langfiles = array ( + "hrm" + ); + + // Dictionnaries + $this->dictionnaries=array( + 'langs'=>'hrm', + 'tabname'=>array( + MAIN_DB_PREFIX."c_ihrm_department", + MAIN_DB_PREFIX."c_ihrm_function" + ), + 'tablib'=>array( + "DepartmentDict", + "FunctionDict" + ), + 'tabsql'=>array( + 'SELECT rowid, pos, code, label, active FROM '.MAIN_DB_PREFIX.'c_hrm_department', + 'SELECT rowid, pos, code, label, c_level, active FROM '.MAIN_DB_PREFIX.'c_hrm_department' + ), + 'tabsqlsort'=>array( + 'rowid ASC', + 'rowid ASC' + ), + 'tabfield'=>array( + "code,label", + "code,label" + ), + 'tabfieldvalue'=>array( + "code,label", + "code,label" + ), + 'tabfieldinsert'=>array( + "code,label", + "code,label" + ), + 'tabrowid'=>array( + "rowid", + "rowid" + ), + 'tabcond'=>array( + '$conf->hrm->enabled', + '$conf->hrm->enabled' + ) + ); + + // Constantes + $this->const = array (); + $r = 0; + + // Boxes + $this->boxes = array (); + + // Permissions + $this->rights = array(); // Permission array used by this module + $r = 0; + + $this->rights[$r][0] = 4001; + $this->rights[$r][1] = 'See employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'read'; + $r ++; + + $this->rights[$r][0] = 4002; + $this->rights[$r][1] = 'Create employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'write'; + $r ++; + + $this->rights[$r][0] = 4003; + $this->rights[$r][1] = 'Delete employees'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'delete'; + $r ++; + + $this->rights[$r][0] = 4004; + $this->rights[$r][1] = 'Export employees'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'employee'; + $this->rights[$r][5] = 'export'; + $r ++; + + // Main menu entries + $this->menus = array (); // List of menus to add + $r = 0; + + $this->menu[$r] = array ( + 'fk_menu' => 'fk_mainmenu=hrm', + 'type' => 'left', + 'titre' => 'Employees', + 'leftmenu' => 'employee', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/index.php', + 'langs' => 'hrm', + 'position' => 100, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'NewEmployee', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/card.php?action=create', + 'langs' => 'hrm', + 'position' => 101, + 'enabled' => '$user->rights->hrm->employee->write', + 'perms' => '$user->rights->hrm->employee->write', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'List', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/list.php', + 'langs' => 'hrm', + 'position' => 102, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + + $this->menu[$r] = array( + 'fk_menu' => 'fk_mainmenu=hrm,fk_leftmenu=employee', + 'type' => 'left', + 'titre' => 'Statistics', + 'mainmenu' => 'hrm', + 'url' => '/hrm/employee/stats.php', + 'langs' => 'hrm', + 'position' => 103, + 'enabled' => '$user->rights->hrm->employee->read', + 'perms' => '$user->rights->hrm->employee->read', + 'target' => '', + 'user' => 0 + ); + $r ++; + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus + * (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Enabling module ('', 'noboxes') + * @return int if OK, 0 if KO + */ + public function init($options = '') + { + $sql = array(); + + $result = $this->loadTables(); + + return $this->_init($sql, $options); + } +} From 6a7892ca525f25500c72e1e73f66e4c5d203f698 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 9 Oct 2015 06:41:36 +0200 Subject: [PATCH 004/116] Add the first tables --- .../mysql/data/llx_c_hrm_department.sql | 43 +++++++++ .../install/mysql/data/llx_c_hrm_function.sql | 34 +++++++ .../install/mysql/migration/3.9.0-4.0.0.sql | 88 +++++++++++++++++++ .../mysql/tables/llx_c_hrm_department.sql | 26 ++++++ .../mysql/tables/llx_c_hrm_function.sql | 27 ++++++ .../mysql/tables/llx_establishment.sql | 41 +++++++++ 6 files changed, 259 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_c_hrm_department.sql create mode 100644 htdocs/install/mysql/data/llx_c_hrm_function.sql create mode 100644 htdocs/install/mysql/migration/3.9.0-4.0.0.sql create mode 100644 htdocs/install/mysql/tables/llx_c_hrm_department.sql create mode 100644 htdocs/install/mysql/tables/llx_c_hrm_function.sql create mode 100644 htdocs/install/mysql/tables/llx_establishment.sql diff --git a/htdocs/install/mysql/data/llx_c_hrm_department.sql b/htdocs/install/mysql/data/llx_c_hrm_department.sql new file mode 100644 index 00000000000..0129856be95 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_department.sql @@ -0,0 +1,43 @@ +-- ============================================================================ +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- 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 . +-- +-- ============================================================================ +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'Legal', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); diff --git a/htdocs/install/mysql/data/llx_c_hrm_function.sql b/htdocs/install/mysql/data/llx_c_hrm_function.sql new file mode 100644 index 00000000000..f8b56563689 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_function.sql @@ -0,0 +1,34 @@ +-- ============================================================================ +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- 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 . +-- +-- ============================================================================ +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql new file mode 100644 index 00000000000..bea4065fab8 --- /dev/null +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -0,0 +1,88 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 3.9.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To restrict request to Mysql version x.y use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + +CREATE TABLE IF NOT EXISTS llx_c_hrm_function +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + c_level tinyint DEFAULT 0 NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); + +CREATE TABLE IF NOT EXISTS llx_c_hrm_department +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'Legal', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); + +CREATE TABLE IF NOT EXISTS llx_establishment ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + name varchar(50), + address varchar(255), + zip varchar(25), + town varchar(50), + fk_state integer DEFAULT 0, + fk_country integer DEFAULT 0, + profid1 varchar(20), + profid2 varchar(20), + profid3 varchar(20), + phone varchar(20), + fk_user_author integer NOT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + statut tinyint DEFAULT 1, +) ENGINE=InnoDB; + diff --git a/htdocs/install/mysql/tables/llx_c_hrm_department.sql b/htdocs/install/mysql/tables/llx_c_hrm_department.sql new file mode 100644 index 00000000000..f9432d8b821 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_department.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- 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 . + +create table llx_c_hrm_department +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_c_hrm_function.sql b/htdocs/install/mysql/tables/llx_c_hrm_function.sql new file mode 100644 index 00000000000..f3f87461866 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_function.sql @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2013 Jean-François Ferry +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- 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 . + +create table llx_c_hrm_function +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + c_level tinyint DEFAULT 0 NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql new file mode 100644 index 00000000000..2f5c86510e0 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -0,0 +1,41 @@ +-- ============================================================================ +-- Copyright (C) 2015 Alexandre Spangaro +-- +-- 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 . +-- +-- ============================================================================ +-- +-- Structure de la table llx_establishment +-- + +CREATE TABLE IF NOT EXISTS llx_establishment ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + name varchar(50), + address varchar(255), + zip varchar(25), + town varchar(50), + fk_state integer DEFAULT 0, + fk_country integer DEFAULT 0, + profid1 varchar(20), + profid2 varchar(20), + profid3 varchar(20), + phone varchar(20), + fk_user_author integer NOT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + statut tinyint DEFAULT 1, +) ENGINE=InnoDB; + From b571cc86ff91511b8019fa21b831b481000f9afd Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 9 Oct 2015 07:30:48 +0200 Subject: [PATCH 005/116] Add a yn form in user card to know if the user is also an employee --- .../install/mysql/migration/3.9.0-4.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_user.sql | 2 ++ htdocs/user/card.php | 19 +++++++++++++++++++ htdocs/user/class/user.class.php | 9 +++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index bea4065fab8..6120a946ec3 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -86,3 +86,5 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( statut tinyint DEFAULT 1, ) ENGINE=InnoDB; +ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 0 AFTER ref_int; + diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index a11b0ec6b50..f95def7e503 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -25,6 +25,8 @@ create table llx_user ref_ext varchar(50), -- reference into an external system (not used by dolibarr) ref_int varchar(50), -- reference into an internal system (deprecated) + + employee tinyint DEFAULT 0, -- employee 0/1 datec datetime, tms timestamp, diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b74b921c735..9744aebfbbe 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -191,6 +191,7 @@ if ($action == 'add' && $canadduser) { $object->lastname = GETPOST("lastname",'alpha'); $object->firstname = GETPOST("firstname",'alpha'); + $object->employee = GETPOST("employee",'int'); $object->login = GETPOST("login",'alpha'); $object->api_key = GETPOST("api_key",'alpha'); $object->gender = GETPOST("gender",'alpha'); @@ -344,6 +345,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->lastname = GETPOST("lastname",'alpha'); $object->firstname = GETPOST("firstname",'alpha'); + $object->employee = GETPOST("employee",'int'); $object->login = GETPOST("login",'alpha'); $object->gender = GETPOST("gender",'alpha'); $object->pass = GETPOST("password"); @@ -762,6 +764,12 @@ if (($action == 'create') || ($action == 'adduserldap')) { print ''; } + print ''; + + // Employee + print ''; + print ''.fieldLabel('Employee','employee',0).''; + print $form->selectyesno("employee",(isset($_POST['employee'])?GETPOST('employee'):0),1); print ''; // Position/Job @@ -1224,6 +1232,11 @@ else print ''.$object->firstname.''; print ''."\n"; + // Employee + print ''.$langs->trans("Employee").''; + print yn($object->employee); + print ''."\n"; + // Position/Job print ''.$langs->trans("PostOrFunction").''; print ''.$object->job.''; @@ -1803,6 +1816,12 @@ else } print ''; + // Employee + print ''; + print ''.fieldLabel('Employee','employee',0).''; + print $form->selectyesno("employee",$object->employee,1); + print ''; + // Position/Job print ''.$langs->trans("PostOrFunction").''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6dc8de8db8e..d4317a0d919 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013-2014 Philippe Grand - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -46,6 +46,7 @@ class User extends CommonObject var $id=0; var $ldap_sid; var $search_sid; + var $employee; var $gender; var $email; var $skype; @@ -156,7 +157,7 @@ class User extends CommonObject $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; $sql.= " u.admin, u.login, u.note,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,"; $sql.= " u.fk_soc, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid,"; @@ -215,6 +216,8 @@ class User extends CommonObject $this->ldap_sid = $obj->ldap_sid; $this->lastname = $obj->lastname; $this->firstname = $obj->firstname; + + $this->employee = $obj->employee; $this->login = $obj->login; $this->gender = $obj->gender; @@ -1145,6 +1148,7 @@ class User extends CommonObject // Clean parameters $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); + $this->employee = trim($this->employee); $this->login = trim($this->login); $this->gender = trim($this->gender); $this->pass = trim($this->pass); @@ -1185,6 +1189,7 @@ class User extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; $sql.= " lastname = '".$this->db->escape($this->lastname)."'"; $sql.= ", firstname = '".$this->db->escape($this->firstname)."'"; + $sql.= ", employee = ".$this->employee; $sql.= ", login = '".$this->db->escape($this->login)."'"; $sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null"); $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' From bde7279aa1f8ea98612a7893b5d6952a2622878c Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 9 Oct 2015 13:00:51 +0200 Subject: [PATCH 006/116] Review by Rdoursenaud. Tkanks --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_establishment.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 6120a946ec3..5f752358858 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( fk_user_mod integer NOT NULL, datec datetime NOT NULL, tms timestamp NOT NULL, - statut tinyint DEFAULT 1, + status tinyint DEFAULT 1, ) ENGINE=InnoDB; ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 0 AFTER ref_int; diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 2f5c86510e0..517464588a4 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -36,6 +36,6 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( fk_user_mod integer NOT NULL, datec datetime NOT NULL, tms timestamp NOT NULL, - statut tinyint DEFAULT 1, + status tinyint DEFAULT 1, ) ENGINE=InnoDB; From 5d7e05e3137917ad81d98baa2f63f10b387a5c02 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 06:00:55 +0200 Subject: [PATCH 007/116] Correct review --- htdocs/core/modules/modHRM.class.php | 6 +++--- htdocs/install/mysql/data/llx_c_hrm_department.sql | 2 +- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index cfc85acff16..68549d2cd10 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -26,7 +26,7 @@ include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"); * \class modHRM * \brief Class to describe and activate the HRM module */ -class modiHRM extends DolibarrModules +class modHRM extends DolibarrModules { /** * Constructor. @@ -88,8 +88,8 @@ class modiHRM extends DolibarrModules $this->dictionnaries=array( 'langs'=>'hrm', 'tabname'=>array( - MAIN_DB_PREFIX."c_ihrm_department", - MAIN_DB_PREFIX."c_ihrm_function" + MAIN_DB_PREFIX."c_hrm_department", + MAIN_DB_PREFIX."c_hrm_function" ), 'tablib'=>array( "DepartmentDict", diff --git a/htdocs/install/mysql/data/llx_c_hrm_department.sql b/htdocs/install/mysql/data/llx_c_hrm_department.sql index 0129856be95..e6e4921f372 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_department.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_department.sql @@ -29,7 +29,7 @@ INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15, INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'Legal', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 5f752358858..aaa1f28d41b 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -53,7 +53,7 @@ INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15, INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'Legal', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); From 11387a5d38052784331874d42c6886f938b0e26e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 06:37:43 +0200 Subject: [PATCH 008/116] Add language file --- .tx/config | 6 ++++++ htdocs/langs/en_US/hrm.lang | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 htdocs/langs/en_US/hrm.lang diff --git a/.tx/config b/.tx/config index 03301ded378..3c8c49e40e9 100644 --- a/.tx/config +++ b/.tx/config @@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.hrm] +file_filter = htdocs/langs//hrm.lang +source_file = htdocs/langs/en_US/hrm.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.incoterm] file_filter = htdocs/langs//incoterm.lang source_file = htdocs/langs/en_US/incoterm.lang diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang new file mode 100644 index 00000000000..33c6c271261 --- /dev/null +++ b/htdocs/langs/en_US/hrm.lang @@ -0,0 +1,13 @@ +# Dolibarr language file - en_US - hrm +CHARSET=UTF-8 + +Establishments=Establishments +Establishment=Establishment +NewEstablishment=New establishment +DeleteEstablishment=Delete establishment +ConfirmDeleteEstablishment=Are-you sure to delete this establishment ? +OpenEtablishment=Open establishment +CloseEtablishment=Close establishment +Employees=Employees +Employee=Employee +NewEmployee=New employee From cd7c5645c790980298381b2509c24c71c6eaf29f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 06:38:42 +0200 Subject: [PATCH 009/116] Add library --- htdocs/core/lib/hrm.lib.php | 120 ++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 htdocs/core/lib/hrm.lib.php diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php new file mode 100644 index 00000000000..f7f3ed11bd8 --- /dev/null +++ b/htdocs/core/lib/hrm.lib.php @@ -0,0 +1,120 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/lib/hrm.lib.php + * \ingroup HRM + * \brief Library for hrm + */ +$langs->load('hrm'); + +/** + * Return head table for employee tabs screen + * + * @param object $object contact + * @return array head table of tabs + */ +function employee_prepare_head($object) { + global $langs, $conf, $user; + + $h = 0; + $head = array (); + + $head [$h] [0] = DOL_URL_ROOT.'/hrm/employee/card.php?id=' . $object->id; + $head [$h] [1] = $langs->trans("Card"); + $head [$h] [2] = 'card'; + $h ++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'employee'); + + $head [$h] [0] = DOL_URL_ROOT.'/hrm/employee/info.php?id=' . $object->id; + $head [$h] [1] = $langs->trans("Info"); + $head [$h] [2] = 'info'; + $h ++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'employee', 'remove'); + + return $head; +} + +/** + * Return head table for establishment tabs screen + * + * @param Establishment $object Object related to tabs + * @return array Array of tabs to show + */ +function establishment_prepare_head($object) +{ + global $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id=' . $object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment'); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id=' . $object->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment','remove'); + + return $head; +} + +/** + * Return array head with list of tabs to view object informations + * + * @return array head + */ +function hrm_admin_prepare_head() +{ + global $langs, $conf, $user; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php'; + $head[$h][1] = $langs->trans("Parameters"); + $head[$h][2] = 'parameters'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; + $head[$h][1] = $langs->trans("Establishments"); + $head[$h][2] = 'establishments'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab + complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin'); + + complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin','remove'); + + return $head; +} + From 8f8de587b8e8c2049ea721d8a6862aeaa1b3c116 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 06:39:59 +0200 Subject: [PATCH 010/116] Add admin & first version to manage establishment --- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/hrm/admin/admin_establishment.php | 126 +++++++ htdocs/hrm/admin/admin_hrm.php | 58 +++ htdocs/hrm/admin/index.html | 0 htdocs/hrm/class/establishment.class.php | 324 +++++++++++++++++ htdocs/hrm/class/index.html | 0 htdocs/hrm/establishment/card.php | 415 ++++++++++++++++++++++ htdocs/hrm/establishment/index.html | 0 htdocs/hrm/establishment/info.php | 59 +++ htdocs/hrm/index.html | 0 htdocs/theme/eldy/img/object_building.png | Bin 0 -> 563 bytes htdocs/theme/md/img/object_building.png | Bin 0 -> 563 bytes 12 files changed, 983 insertions(+), 1 deletion(-) create mode 100644 htdocs/hrm/admin/admin_establishment.php create mode 100644 htdocs/hrm/admin/admin_hrm.php create mode 100644 htdocs/hrm/admin/index.html create mode 100644 htdocs/hrm/class/establishment.class.php create mode 100644 htdocs/hrm/class/index.html create mode 100644 htdocs/hrm/establishment/card.php create mode 100644 htdocs/hrm/establishment/index.html create mode 100644 htdocs/hrm/establishment/info.php create mode 100644 htdocs/hrm/index.html create mode 100644 htdocs/theme/eldy/img/object_building.png create mode 100644 htdocs/theme/md/img/object_building.png diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 68549d2cd10..c63fa04f65e 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -62,7 +62,7 @@ class modHRM extends DolibarrModules $this->dirs = array (); // Config pages - $this->config_page_url = array('admin_hrm.php'); + $this->config_page_url = array('admin_hrm.php@hrm'); // Dependencies $this->depends = array(); diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php new file mode 100644 index 00000000000..2fb6507d0ba --- /dev/null +++ b/htdocs/hrm/admin/admin_establishment.php @@ -0,0 +1,126 @@ + + * + * 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 . + */ + +/** + * \file htdocs/hrm/admin/admin_establishment.php + * \ingroup HRM + * \brief HRM Establishment module setup page + */ +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; + +$langs->load("admin"); +$langs->load('hrm'); + +if (! $user->admin) + accessforbidden(); + +$error=0; + +$action = GETPOST('action', 'alpha'); + +$object = new Establishment($db); + +/* + * Actions + */ + +/* + * View + */ +$page_name = "Establishments"; +llxHeader('', $langs->trans($page_name)); + +$form = new Form($db); + +dol_htmloutput_mesg($mesg); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans($page_name), $linkback); + +// Configuration header +$head = hrm_admin_prepare_head(); +dol_fiche_head($head, 'establishments', $langs->trans("HRM"), 0, "user"); + +$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.statut"; +$sql.= " FROM ".MAIN_DB_PREFIX."establishment as e"; +$sql.= " WHERE e.entity = ".$conf->entity; + +$result = $db->query($sql); +if ($result) +{ + $var=false; + $num = $db->num_rows($result); + + $i = 0; + + // Load attribute_label + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($num) + { + $establishmentstatic=new Establishment($db); + + while ($i < $num && $i < $max) + { + $obj = $db->fetch_object($result); + $fiscalyearstatic->id=$obj->rowid; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=!$var; + $i++; + } + + } + else + { + print ''; + } + + print '
'.$langs->trans("Ref").''.$langs->trans("Name").''.$langs->trans("Address").''.$langs->trans("Zipcode").''.$langs->trans("Town").''.$langs->trans("Statut").'
'.img_object($langs->trans("ShowEstablishment"),"building").' '.$obj->rowid.''.$obj->name.''.$obj->address.''.$obj->zip.''.$obj->town.''.$establishmentstatic->LibStatut($obj->statut,5).'
'.$langs->trans("None").'
'; +} +else +{ + dol_print_error($db); +} + +dol_fiche_end(); + +// Buttons +print ''; + +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php new file mode 100644 index 00000000000..d66185315eb --- /dev/null +++ b/htdocs/hrm/admin/admin_hrm.php @@ -0,0 +1,58 @@ + + * + * 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 . + */ + +/** + * \file htdocs/hrm/admin/admin_ihrm.php + * \ingroup HRM + * \brief HRM module setup page + */ +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +$langs->load("admin"); +$langs->load('hrm'); + +if (! $user->admin) + accessforbidden(); + +$action = GETPOST('action', 'alpha'); + +/* + * Actions + */ + +/* + * View + */ +$page_name = "Parameters"; +llxHeader('', $langs->trans($page_name)); + +$form = new Form($db); + +dol_htmloutput_mesg($mesg); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans($page_name), $linkback); + +// Configuration header +$head = hrm_admin_prepare_head(); +dol_fiche_head($head, 'parameters', $langs->trans("HRM"), 0, "user"); + +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/admin/index.html b/htdocs/hrm/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php new file mode 100644 index 00000000000..208d38c1fd1 --- /dev/null +++ b/htdocs/hrm/class/establishment.class.php @@ -0,0 +1,324 @@ + + * + * 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 . + */ + +/** + * \file htdocs/custom/ihrm/class/establishment.class.php + * \ingroup iHRM + * \brief File of class to manage establishments + */ + +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; + +/** + * Class to manage establishments + */ +class Establishment extends CommonObject +{ + public $element='establishment'; + public $table_element='ihrm_establishment'; + public $table_element_line = ''; + public $fk_element = 'fk_establishment'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + var $rowid; + + var $name; + var $address; + var $zip; + var $town; + var $statut; // 0=open, 1=closed + var $entity; + + var $statuts=array(); + var $statuts_short=array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + + return 1; + } + + /** + * Create object in database + * + * @param User $user User making creation + * @return int <0 if KO, >0 if OK + */ + function create($user) + { + global $conf; + + $error = 0; + + $now=dol_now(); + + $this->db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."ihrm_establishment ("; + $sql.= "name"; + $sql.= ", address"; + $sql.= ", zip"; + $sql.= ", town"; + $sql.= ", statut"; + $sql.= ", entity"; + $sql.= ", datec"; + $sql.= ", fk_user_author"; + $sql.= ") VALUES ("; + $sql.= " '".$this->name."'"; + $sql.= ", '".$this->address."'"; + $sql.= ", '".$this->zip."'"; + $sql.= ", '".$this->town."'"; + $sql.= ", ".$this->statut; + $sql.= ", ".$conf->entity; + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ", ". $user->id; + $sql.= ")"; + + $this->db->begin(); + + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { + $error ++; + $this->errors[] = "Error " . $this->db->lasterror(); + } + + if (! $error) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ihrm_establishment"); + } + + // Commit or rollback + if ($error) { + foreach ( $this->errors as $errmsg ) { + dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); + $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); + } + $this->db->rollback(); + return - 1 * $error; + } else { + $this->db->commit(); + return $this->id; + } + } + + /** + * Update record + * + * @param User $user User making update + * @return int <0 if KO, >0 if OK + */ + function update($user) + { + global $langs; + + // Check parameters + if (empty($this->name)) + { + $this->error='ErrorBadParameter'; + return -1; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."ihrm_establishment"; + $sql .= " SET name = '".$this->name."'"; + $sql .= ", address = '".$this->address."'"; + $sql .= ", zip = '".$this->zip."'"; + $sql .= ", town = '".$this->town."'"; + $sql .= ", statut = '".$this->statut."'"; + $sql .= ", fk_user_mod = " . $user->id; + $sql .= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $this->db->commit(); + return 1; + } else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return - 1; + } + } + + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + $sql = "SELECT rowid, name, address, zip, town, statut"; + $sql.= " FROM ".MAIN_DB_PREFIX."ihrm_establishment"; + $sql.= " WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ( $result ) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + $this->name = $obj->name; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->statut = $obj->statut; + + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } + + /** + * Delete record + * + * @param int $id Id of record to delete + * @return int <0 if KO, >0 if OK + */ + function delete($id) + { + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."ihrm_establishment WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + + /** + * Give a label from a status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Give a label from a status + * + * @param int $statut Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function LibStatut($statut,$mode=0) + { + global $langs; + + if ($mode == 0) + { + return $langs->trans($this->statuts[$statut]); + } + if ($mode == 1) + { + return $langs->trans($this->statuts_short[$statut]); + } + if ($mode == 2) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); + } + if ($mode == 3) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); + } + if ($mode == 4) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); + } + if ($mode == 5) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); + } + } + + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + function info($id) + { + $sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'ihrm_establishment as e'; + $sql.= ' WHERE e.rowid = '.$id; + + dol_syslog(get_class($this)."::fetch info", LOG_DEBUG); + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + if ($obj->fk_user_modif) + { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_mod); + $this->user_modification = $muser; + } + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->tms); + } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } + +} diff --git a/htdocs/hrm/class/index.html b/htdocs/hrm/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php new file mode 100644 index 00000000000..dc3b29225c2 --- /dev/null +++ b/htdocs/hrm/establishment/card.php @@ -0,0 +1,415 @@ + + * + * 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 . + */ + +/** + * \file htdocs/custom/ihrm/establishment/card.php + * \brief Page to show an establishment + */ +$res = @include ("../../main.inc.php"); // For root directory +if (! $res) + $res = @include ("../../../main.inc.php"); // For "custom" directory +if (! $res) + die("Include of main fails"); + +require_once ('../core/lib/ihrm.lib.php'); +require_once ('../class/establishment.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +$langs->load("admin"); +$langs->load("compta"); + +// Security check +if (! $user->admin) accessforbidden(); + +$error=0; + +$action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$confirm = GETPOST('confirm','alpha'); +$id = GETPOST('id','int'); + +// List of statut +static $tmpstatut2label=array( + '0'=>'OpenEtablishment', + '1'=>'CloseEtablishment' +); +$statut2label=array(''); +foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val); + +$object = new Establishment($db); + +/* + * Actions + */ + +if ($action == 'confirm_delete' && $confirm == "yes") +{ + $result=$object->delete($id); + if ($result >= 0) + { + header("Location: ../admin/admin_establishment.php"); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + } +} + +else if ($action == 'add') +{ + if (! $cancel) + { + $error=0; + + $object->name = GETPOST('name', 'alpha'); + if (empty($object->name)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + $error++; + } + + if (empty($error)) + { + $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); + if (! empty($tmparray['id'])) + { + $object->country_id =$tmparray['id']; + $object->country_code =$tmparray['code']; + $object->country_label=$tmparray['label']; + } + + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); + $object->fk_pays = $object->country_id; + $object->statut = GETPOST('statut','int'); + $object->fk_user_author = $user->id; + $object->datec = dol_now(); + + $id = $object->create($user); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action='create'; + } + } + else + { + $action='create'; + } + } + else + { + header("Location: ../admin/admin_establishment.php"); + exit; + } +} + +// Update record +else if ($action == 'update') +{ + $error = 0; + + if (! $cancel) { + + $name = GETPOST('name', 'alpha'); + if (empty($name)) { + setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('NameProperty')), 'errors'); + $error ++; + } + $typeid = GETPOST('typeid', 'int'); + if (empty($typeid)) { + setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('TypeProperty')), 'errors'); + $error ++; + } + + if (empty($error)) { + $object->name = GETPOST('name', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); + $object->fk_pays = GETPOST('country_id', 'int'); + $object->rowid = GETPOST('id'); + $object->fk_user_mod = $user->id; + + $id = $object->update(); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action='create'; + } + } + } else { + header("Location: card.php?id=" . $id); + exit; + } +} + +/* + * View + */ + +llxHeader(); + +$form = new Form($db); +$formcompany = new FormCompany($db); + +/* + * Action create + */ +if ($action == 'create') +{ + print load_fiche_titre($langs->trans("NewEstablishment")); + + print '
'; + print ''; + print ''; + + dol_fiche_head(); + + print ''; + + // Name + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode + print ''; + print ''; + print ''; + print ''; + + // Town + print ''; + print ''; + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Statut + print ''; + print ''; + print ''; + + print '
'; + print ''; + print '
'; + print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array ( + 'town', + 'selectcountry_id' + ), 6); + print '
'; + print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array ( + 'zipcode', + 'selectcountry_id' + )); + print '
'; + print $form->select_country($mysoc->country_id,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
'; + print $form->selectarray('statut',$statut2label,GETPOST('statut')); + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print '
'; +} +else if ($id) +{ + $result = $object->fetch($id); + if ($result > 0) + { + $head = establishment_prepare_head($object); + + if ($action == 'edit') + { + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm'); + + print '
' . "\n"; + print ''; + print ''; + print ''; + + print ''; + + // Ref + print ""; + print ''; + + // Name + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode / Town + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Statut + print ''; + + print '
'.$langs->trans("Ref").''; + print $object->rowid; + print '
'; + print ''; + print '
'; + print ''; + print '
'; + print $formcompany->select_ziptown($object->zip, 'zipcode', array ( + 'town', + 'selectcountry_id' + ), 6) . '
'; + print $formcompany->select_ziptown($object->town, 'town', array ( + 'zipcode', + 'selectcountry_id' + )) . '
'; + print $form->select_country($object->fk_pays,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
'; + print $form->selectarray('statut',$statut2label,$object->statut); + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print '
'; + } + else + { + /* + * Confirm delete + */ + if ($action == 'delete') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete"); + + } + + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm'); + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Name + print ''; + print ''; + print ''; + print ''; + + // Address + print ''; + print ''; + print ''; + print ''; + + // Zipcode + print ''; + print ''; + print ''; + print ''; + + // Town + print ''; + print ''; + print ''; + print ''; + + // Country + print ''; + print ''; + print ''; + print ''; + + // Statut + print ''; + + print "
'.$langs->trans("Ref").''; + print $object->rowid; + print ''; + print $linkback; + print '
'.$langs->trans("Name").''.$object->name.'
'.$langs->trans("Address").''.$object->address.'
'.$langs->trans("Zipcode").''.$object->zip.'
'.$langs->trans("Town").''.$object->town.'
'.$langs->trans("Country").''.getCountry($object->fk_pays,1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
"; + + dol_fiche_end(); + + /* + * Barre d'actions + */ + + print '
'; + print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Delete').''; + print '
'; + } + } + else + { + dol_print_error($db); + } +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/hrm/establishment/index.html b/htdocs/hrm/establishment/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php new file mode 100644 index 00000000000..06ba9875e58 --- /dev/null +++ b/htdocs/hrm/establishment/info.php @@ -0,0 +1,59 @@ + + * + * 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 . + */ + +/** + * \file htdocs/custom/ihrm/establishment/info.php + * \brief Page to show info of an establishment + */ + +require '../../main.inc.php'; + +require_once ('../core/lib/ihrm.lib.php'); +require_once ('../class/establishment.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +$langs->load("admin"); +$langs->load("compta"); + +// Security check +if (! $user->admin) accessforbidden(); + +$id = GETPOST('id','int'); + +// View +llxHeader(); + +if ($id) +{ + $object = new Establishment($db); + $object->fetch($id); + $object->info($id); + + $head = establishment_prepare_head($object); + + dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building@ihrm'); + + print '
'; + dol_print_object_info($object); + print '
'; + + print ''; +} + +$db->close(); + +llxFooter(); diff --git a/htdocs/hrm/index.html b/htdocs/hrm/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/img/object_building.png b/htdocs/theme/eldy/img/object_building.png new file mode 100644 index 0000000000000000000000000000000000000000..c9d1539dddcdce4f285117d26cab14ee97ddb90b GIT binary patch literal 563 zcmV-30?hr1P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-xk*GpRCwCNlf91;Q541RJl^EZ5JN#8OeT|1NU;U6Fig~f!it1$rN9siV~oU@ zXktZeBVil=09&xJprYJD3wA3E1qDpd|| z^PZ}z+J3*MrfKE|gTb>(rJ^MQgb>hdHet8hK@>%xX&N|=1FcpI=JPq+!~yH~`-5CA zM<}IK2yxCiKN${(ecQH6H@ShRR;y>n<1r(pyh{jqsVItDuh&1XRx3ZTiHOL@(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-xk*GpRCwCNlf91;Q541RJl^EZ5JN#8OeT|1NU;U6Fig~f!it1$rN9siV~oU@ zXktZeBVil=09&xJprYJD3wA3E1qDpd|| z^PZ}z+J3*MrfKE|gTb>(rJ^MQgb>hdHet8hK@>%xX&N|=1FcpI=JPq+!~yH~`-5CA zM<}IK2yxCiKN${(ecQH6H@ShRR;y>n<1r(pyh{jqsVItDuh&1XRx3ZTiHOL@ Date: Sat, 10 Oct 2015 06:58:18 +0200 Subject: [PATCH 011/116] Correct old code --- htdocs/hrm/admin/admin_hrm.php | 2 +- htdocs/hrm/class/establishment.class.php | 18 +++++++++--------- htdocs/hrm/establishment/card.php | 19 +++++++------------ htdocs/hrm/establishment/info.php | 14 ++++++-------- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index d66185315eb..bc0487bad94 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/hrm/admin/admin_ihrm.php + * \file htdocs/hrm/admin/admin_hrm.php * \ingroup HRM * \brief HRM module setup page */ diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 208d38c1fd1..dccb2d6d37e 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -16,8 +16,8 @@ */ /** - * \file htdocs/custom/ihrm/class/establishment.class.php - * \ingroup iHRM + * \file htdocs/hrm/class/establishment.class.php + * \ingroup HRM * \brief File of class to manage establishments */ @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Establishment extends CommonObject { public $element='establishment'; - public $table_element='ihrm_establishment'; + public $table_element='establishment'; public $table_element_line = ''; public $fk_element = 'fk_establishment'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -77,7 +77,7 @@ class Establishment extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."ihrm_establishment ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."establishment ("; $sql.= "name"; $sql.= ", address"; $sql.= ", zip"; @@ -107,7 +107,7 @@ class Establishment extends CommonObject } if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ihrm_establishment"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "establishment"); } // Commit or rollback @@ -143,7 +143,7 @@ class Establishment extends CommonObject $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."ihrm_establishment"; + $sql = "UPDATE ".MAIN_DB_PREFIX."establishment"; $sql .= " SET name = '".$this->name."'"; $sql .= ", address = '".$this->address."'"; $sql .= ", zip = '".$this->zip."'"; @@ -173,7 +173,7 @@ class Establishment extends CommonObject function fetch($id) { $sql = "SELECT rowid, name, address, zip, town, statut"; - $sql.= " FROM ".MAIN_DB_PREFIX."ihrm_establishment"; + $sql.= " FROM ".MAIN_DB_PREFIX."establishment"; $sql.= " WHERE rowid = ".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -208,7 +208,7 @@ class Establishment extends CommonObject { $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."ihrm_establishment WHERE rowid = ".$id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."establishment WHERE rowid = ".$id; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); @@ -286,7 +286,7 @@ class Establishment extends CommonObject function info($id) { $sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'ihrm_establishment as e'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e'; $sql.= ' WHERE e.rowid = '.$id; dol_syslog(get_class($this)."::fetch info", LOG_DEBUG); diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index dc3b29225c2..3df1e1cf3d6 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -16,22 +16,17 @@ */ /** - * \file htdocs/custom/ihrm/establishment/card.php + * \file htdocs/hrm/establishment/card.php * \brief Page to show an establishment */ -$res = @include ("../../main.inc.php"); // For root directory -if (! $res) - $res = @include ("../../../main.inc.php"); // For "custom" directory -if (! $res) - die("Include of main fails"); - -require_once ('../core/lib/ihrm.lib.php'); -require_once ('../class/establishment.class.php'); +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $langs->load("admin"); -$langs->load("compta"); +$langs->load("hrm"); // Security check if (! $user->admin) accessforbidden(); @@ -267,7 +262,7 @@ else if ($id) if ($action == 'edit') { - dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm'); + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building'); print '
' . "\n"; print ''; @@ -344,7 +339,7 @@ else if ($id) } - dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm'); + dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building'); print ''; diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 06ba9875e58..2bf014481ac 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -16,18 +16,16 @@ */ /** - * \file htdocs/custom/ihrm/establishment/info.php + * \file htdocs/hrm/establishment/info.php * \brief Page to show info of an establishment */ -require '../../main.inc.php'; - -require_once ('../core/lib/ihrm.lib.php'); -require_once ('../class/establishment.class.php'); -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require('../../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; $langs->load("admin"); -$langs->load("compta"); +$langs->load("hrm"); // Security check if (! $user->admin) accessforbidden(); @@ -45,7 +43,7 @@ if ($id) $head = establishment_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building@ihrm'); + dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building'); print '
'; print ''; print ''; - print ''; + print ''; print ''; if ($num) @@ -96,7 +96,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; print ''; $var=!$var; $i++; diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index aaa1f28d41b..231b89ee507 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( fk_user_mod integer NOT NULL, datec datetime NOT NULL, tms timestamp NOT NULL, - status tinyint DEFAULT 1, + status tinyint DEFAULT 1 ) ENGINE=InnoDB; ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 0 AFTER ref_int; diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 517464588a4..8ddc71e1fba 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -36,6 +36,6 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( fk_user_mod integer NOT NULL, datec datetime NOT NULL, tms timestamp NOT NULL, - status tinyint DEFAULT 1, + status tinyint DEFAULT 1 ) ENGINE=InnoDB; From 2857d7cfdaedd0e0d77ff1211c13e314d283aa3e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 11 Oct 2015 21:00:41 +0200 Subject: [PATCH 014/116] Correct --- htdocs/hrm/class/establishment.class.php | 40 ++++++++++++------------ htdocs/hrm/establishment/card.php | 26 +++++++-------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index dccb2d6d37e..c5ba77fd547 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -40,7 +40,7 @@ class Establishment extends CommonObject var $address; var $zip; var $town; - var $statut; // 0=open, 1=closed + var $status; // 0=open, 1=closed var $entity; var $statuts=array(); @@ -82,7 +82,7 @@ class Establishment extends CommonObject $sql.= ", address"; $sql.= ", zip"; $sql.= ", town"; - $sql.= ", statut"; + $sql.= ", status"; $sql.= ", entity"; $sql.= ", datec"; $sql.= ", fk_user_author"; @@ -91,7 +91,7 @@ class Establishment extends CommonObject $sql.= ", '".$this->address."'"; $sql.= ", '".$this->zip."'"; $sql.= ", '".$this->town."'"; - $sql.= ", ".$this->statut; + $sql.= ", ".$this->status; $sql.= ", ".$conf->entity; $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ". $user->id; @@ -148,7 +148,7 @@ class Establishment extends CommonObject $sql .= ", address = '".$this->address."'"; $sql .= ", zip = '".$this->zip."'"; $sql .= ", town = '".$this->town."'"; - $sql .= ", statut = '".$this->statut."'"; + $sql .= ", status = '".$this->status."'"; $sql .= ", fk_user_mod = " . $user->id; $sql .= " WHERE rowid = ".$this->id; @@ -172,7 +172,7 @@ class Establishment extends CommonObject */ function fetch($id) { - $sql = "SELECT rowid, name, address, zip, town, statut"; + $sql = "SELECT rowid, name, address, zip, town, status"; $sql.= " FROM ".MAIN_DB_PREFIX."establishment"; $sql.= " WHERE rowid = ".$id; @@ -187,7 +187,7 @@ class Establishment extends CommonObject $this->address = $obj->address; $this->zip = $obj->zip; $this->town = $obj->town; - $this->statut = $obj->statut; + $this->status = $obj->status; return 1; } @@ -231,49 +231,49 @@ class Establishment extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatus($mode=0) { - return $this->LibStatut($this->statut,$mode); + return $this->LibStatus($this->status,$mode); } /** * Give a label from a status * - * @param int $statut Id status + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatus($status,$mode=0) { global $langs; if ($mode == 0) { - return $langs->trans($this->statuts[$statut]); + return $langs->trans($this->statuts[$status]); } if ($mode == 1) { - return $langs->trans($this->statuts_short[$statut]); + return $langs->trans($this->statuts_short[$status]); } if ($mode == 2) { - if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); + if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'status4').' '.$langs->trans($this->statuts_short[$status]); + if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'status8').' '.$langs->trans($this->statuts_short[$status]); } if ($mode == 3) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status4'); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status8'); } if ($mode == 4) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status4').' '.$langs->trans($this->statuts[$status]); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'status8').' '.$langs->trans($this->statuts[$status]); } if ($mode == 5) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); + if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'status4'); + if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'status8'); } } diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 3df1e1cf3d6..533ad5117ff 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -38,13 +38,13 @@ $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm','alpha'); $id = GETPOST('id','int'); -// List of statut -static $tmpstatut2label=array( +// List of status +static $tmpstatus2label=array( '0'=>'OpenEtablishment', '1'=>'CloseEtablishment' ); -$statut2label=array(''); -foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val); +$status2label=array(''); +foreach ($tmpstatus2label as $key => $val) $status2label[$key]=$langs->trans($val); $object = new Establishment($db); @@ -93,7 +93,7 @@ else if ($action == 'add') $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); $object->fk_pays = $object->country_id; - $object->statut = GETPOST('statut','int'); + $object->status = GETPOST('status','int'); $object->fk_user_author = $user->id; $object->datec = dol_now(); @@ -234,11 +234,11 @@ if ($action == 'create') print ''; print ''; - // Statut + // Status print ''; - print ''; + print ''; print ''; print '
'; dol_print_object_info($object); From 8e37da55c36999ba2f2a5c5867bebf90aa0c3fa3 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 08:34:15 +0200 Subject: [PATCH 012/116] Add searchform, language key and correct code --- htdocs/admin/ihm.php | 10 ++++++---- htdocs/core/modules/modHRM.class.php | 21 +++++++++++---------- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/main.inc.php | 6 ++++++ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8d93dfc950c..1cff8cec1a7 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -37,6 +37,7 @@ $langs->load("companies"); $langs->load("products"); $langs->load("members"); $langs->load("projects"); +$langs->load("hrm"); if (! $user->admin) accessforbidden(); @@ -46,10 +47,10 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT); -$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name'); +$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); +$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); +$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees")); +$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name'); if ($action == 'update') @@ -82,6 +83,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index c63fa04f65e..16a0edd0c04 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -56,21 +56,21 @@ class modHRM extends DolibarrModules // $this->picto = ''; // define triggers - $this->module_parts = array ( + $this->module_parts = array(); // Data directories to create when module is enabled - $this->dirs = array (); + $this->dirs = array(); // Config pages $this->config_page_url = array('admin_hrm.php@hrm'); // Dependencies $this->depends = array(); - $this->requiredby = array(" + $this->requiredby = array(/*" modSalaries, modExpenseReport, modHoliday - "); + "*/); $this->conflictwith = array(); $this->phpmin = array ( 5, @@ -78,7 +78,7 @@ class modHRM extends DolibarrModules ); // Minimum version of PHP required by module $this->need_dolibarr_version = array ( 3, - 8 + 7 ); // Minimum version of Dolibarr required by module $this->langfiles = array ( "hrm" @@ -239,12 +239,13 @@ class modHRM extends DolibarrModules * @param string $options Enabling module ('', 'noboxes') * @return int if OK, 0 if KO */ - public function init($options = '') + function init($options='') { + // Permissions + $this->remove($options); + $sql = array(); - - $result = $this->loadTables(); - - return $this->_init($sql, $options); + + return $this->_init($sql,$options); } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f267bd0520..f7d93819e0d 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -539,6 +539,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=GeoIP Maxmind conversions capabilities Module3100Name=Skype Module3100Desc=Add a Skype button into card of adherents / third parties / contacts +Module4000Name=HRM +Module4000Desc=Human resources management Module5000Name=Multi-company Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fcef513130f..d278afd9687 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1584,6 +1584,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'M', 'searchleftproj', img_object('','projectpub')); } + if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) + { + $langs->load("hrm"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); + } + // Execute hook printSearchForm $parameters=array(); $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks From 8b97196c2f0ae2dcc874f552c5cf2a998d0b24bb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 10 Oct 2015 08:50:55 +0200 Subject: [PATCH 013/116] Correct term status & sql error --- htdocs/hrm/admin/admin_establishment.php | 6 +++--- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_establishment.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 2fb6507d0ba..6a9cf961960 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -59,7 +59,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback); $head = hrm_admin_prepare_head(); dol_fiche_head($head, 'establishments', $langs->trans("HRM"), 0, "user"); -$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.statut"; +$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status"; $sql.= " FROM ".MAIN_DB_PREFIX."establishment as e"; $sql.= " WHERE e.entity = ".$conf->entity; @@ -79,7 +79,7 @@ if ($result) print ''.$langs->trans("Address").''.$langs->trans("Zipcode").''.$langs->trans("Town").''.$langs->trans("Statut").''.$langs->trans("Status").'
'.$obj->address.''.$obj->zip.''.$obj->town.''.$establishmentstatic->LibStatut($obj->statut,5).''.$establishmentstatic->LibStatut($obj->status,5).'
'; - print $form->selectarray('statut',$statut2label,GETPOST('statut')); + print $form->selectarray('status',$status2label,GETPOST('status')); print '
'; @@ -311,9 +311,9 @@ else if ($id) print ''; print ''; - // Statut - print ''; - print $form->selectarray('statut',$statut2label,$object->statut); + // Status + print ''; + print $form->selectarray('status',$status2label,$object->status); print ''; print ''; @@ -382,8 +382,8 @@ else if ($id) print ''.getCountry($object->fk_pays,1).''; print ''; - // Statut - print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + // Status + print ''.$langs->trans("Status").''.$object->getLibStatus(4).''; print ""; From fd3ba131307c9cc54f69d8f7186b2786e73da9a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Oct 2015 21:33:47 +0200 Subject: [PATCH 015/116] FIX #3541 Bypass authentication when user was created using LDAP --- htdocs/core/login/functions_dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 36596165191..c421fdb1aeb 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -91,7 +91,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= if (! $passok) { if ((! $passcrypted || $passtyped) - && ($passtyped == $passclear)) + && ($passclear && ($passtyped == $passclear))) { $passok=true; dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database"); From 6a90431cf1d4f0853041538203f461a05ff91d3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 14:04:47 +0200 Subject: [PATCH 016/116] Prepare 3.8.2 --- 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 ea369d8aff3..415a7addf4a 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -30,7 +30,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.2'); if (! defined('EURO')) define('EURO',chr(128)); From 9e9f32e3bf848dc965de0a55c99c89ff6798d7bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:38:28 +0200 Subject: [PATCH 017/116] FIX : project was not retrieved on invoice creation form --- htdocs/compta/facture.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index de0a591cf98..6368dd00831 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1877,7 +1877,7 @@ if ($action == 'create') $objectsrc->fetch_lines(); $objectsrc->fetch_thirdparty(); - $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); + $projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project); $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); @@ -2257,9 +2257,6 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid > 0) { - $projectid = GETPOST('projectid')?GETPOST('projectid'):0; - if ($origin == 'project') $projectid = ($originid ? $originid : 0); - $langs->load('projects'); print '' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0); From 5fb6705b5c57e14523c71f655b3231d0ab394ece Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:53:13 +0200 Subject: [PATCH 018/116] FIX : Search status not saved into list --- htdocs/compta/facture/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2f87ff09e8b..2adab72dc1c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -270,6 +270,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; + if ($search_status != '') $param.='&search_status='.$search_status; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png'); $i = 0; From 572be23fc1e2716b64ae584d5ea288b4b9831e72 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:57:23 +0200 Subject: [PATCH 019/116] FIX : filters on supplier invoices list are not used, search_status instead --- htdocs/fourn/facture/list.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index dc8adddec39..a2b48c253df 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -81,7 +81,6 @@ $year = GETPOST("year","int"); $day_lim = GETPOST('day_lim','int'); $month_lim = GETPOST('month_lim','int'); $year_lim = GETPOST('year_lim','int'); -$filter = GETPOST("filtre"); if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { @@ -91,9 +90,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_company=""; $search_amount_no_tax=""; $search_amount_all_tax=""; + $search_status=""; $year=""; $month=""; - $filter=""; } /* @@ -147,15 +146,6 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } -if ($filter && $filter != -1) // GETPOST('filtre') may be a string -{ - $filtrearr = explode(",", $filter); - foreach ($filtrearr as $fil) - { - $filt = explode(":", $fil); - $sql .= " AND " . $filt[0] . " = " . $filt[1]; - } -} if ($search_ref) { @@ -214,7 +204,7 @@ if ($search_amount_all_tax != '') if ($search_status != '') { - $sql.= " AND fac.fk_statut = '".$db->escape($search_status)."'"; + $sql.= " AND fac.fk_statut = ".$search_status; } $nbtotalofrecords = 0; @@ -248,7 +238,7 @@ if ($resql) if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); - if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter); + if ($search_status >= 0) $param.="&search_status=".$search_status; print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''; @@ -305,8 +295,8 @@ if ($resql) print ''; print ''; print ''; - $liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); - print $form->selectarray('filtre', $liststatus, $filter, 1); + $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('filtre', $liststatus, $search_status, 1); print ''; print ''; print ''; From d79fb7198762e09f0c07055f1086211878dc7f8b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 16:17:47 +0200 Subject: [PATCH 020/116] FIX : search_status not used in mergefusiontool --- htdocs/compta/facture/mergepdftool.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index 5acca49d1b1..ea0eedfa36a 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -417,6 +417,7 @@ $search_societe = GETPOST("search_societe"); $search_paymentmode = GETPOST("search_paymentmode"); $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); +$search_status = GETPOST("search_status"); $late = GETPOST("late"); // Do we click on purge search criteria ? @@ -428,6 +429,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_paymentmode=''; $search_montant_ht=''; $search_montant_ttc=''; + $search_status=''; } $sortfield = GETPOST("sortfield",'alpha'); @@ -483,6 +485,7 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; +if ($search_status) $sql .= " AND f.fk_statut = ".$search_status; if ($month > 0) { if ($year > 0) @@ -528,6 +531,7 @@ if ($resql) if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_status) $param.='&search_status='.urlencode($search_status); if ($late) $param.='&late='.urlencode($late); if ($mode) $param.='&mode='.urlencode($mode); $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; From 158281b14c517acb84485d8ed5ddd43fa6c2ed74 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 17:13:02 +0200 Subject: [PATCH 021/116] Fix : minor typo --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ec3705c825c..4b548a574e0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -886,7 +886,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } else { $morehtmlright.=$object->getLibStatut(2); } - if (! empty($object->name_nalias)) $morehtmlref.='
'.$object->name_alias.'
'; + if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; $morehtmlref.='
'; $morehtmlref.=$object->getBannerAddress('refaddress',$object); $morehtmlref.='
'; From 7d382f7997fec9d9fbdb5e199c8e5befb18dfa11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 18:16:28 +0200 Subject: [PATCH 022/116] FIX Revert option WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES into option WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED for better compatibility with old versions --- htdocs/comm/propal.php | 2 +- htdocs/langs/en_US/workflow.lang | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index bcfaa747cab..fd6794c3d44 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2223,7 +2223,7 @@ if ($action == 'create') } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES)) + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { print ''; } diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 7414fcb7e62..14be1a6ade6 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -3,9 +3,9 @@ WorkflowSetup=Workflow module setup WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in. ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules. descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed -descWORKFLOW_PROPAL_AUTOCREATE_INVOICEAutomatically create a customer invoice after a commercial proposal is signed -descWORKFLOW_CONTRACT_AUTOCREATE_INVOICEAutomatically create a customer invoice after a contract is validated -descWORKFLOW_ORDER_AUTOCREATE_INVOICEAutomatically create a customer invoice after a customer order is closed +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed +descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated +descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated From ec043063483467a17786a7317b0b1e1f7164632f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 18:29:37 +0200 Subject: [PATCH 023/116] Fix #3772 Test lower value to avoid mysql limit --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 8 +++++--- htdocs/install/mysql/tables/llx_ecm_directories.sql | 2 +- htdocs/install/mysql/tables/llx_ecm_files.sql | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index a06736d3ce4..33593e7fac5 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -69,7 +69,7 @@ ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128); ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30); -ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(10000); +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(1000); CREATE TABLE llx_ecm_files ( @@ -77,8 +77,8 @@ CREATE TABLE llx_ecm_files label varchar(64) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id filename varchar(255) NOT NULL, -- file name only without any directory - fullpath varchar(10000) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile - fullpath_orig varchar(10000), -- full path of original filename, when file is uploaded from a local computer + fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile + fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer description text, keywords text, -- list of keywords, separated with comma cover text, -- is this file a file to use for a cover @@ -90,6 +90,8 @@ CREATE TABLE llx_ecm_files acl text -- for future permission 'per file' ) ENGINE=innodb; +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(1000); + ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.sql b/htdocs/install/mysql/tables/llx_ecm_directories.sql index 22f77608029..518fdd4c9e1 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.sql @@ -27,7 +27,7 @@ CREATE TABLE llx_ecm_directories fk_parent integer, description varchar(255) NOT NULL, cachenbofdoc integer NOT NULL DEFAULT 0, - fullpath varchar(10000), + fullpath varchar(750), extraparams varchar(255), -- for stock other parameters with json format date_c datetime, date_m timestamp, diff --git a/htdocs/install/mysql/tables/llx_ecm_files.sql b/htdocs/install/mysql/tables/llx_ecm_files.sql index 1c4451d939a..e984c7c9098 100644 --- a/htdocs/install/mysql/tables/llx_ecm_files.sql +++ b/htdocs/install/mysql/tables/llx_ecm_files.sql @@ -22,8 +22,8 @@ CREATE TABLE llx_ecm_files label varchar(64) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id filename varchar(255) NOT NULL, -- file name only without any directory - fullpath varchar(10000) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile - fullpath_orig varchar(10000), -- full path of original filename, when file is uploaded from a local computer + fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile + fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer description text, keywords text, -- list of keywords, separated with comma cover text, -- is this file a file to use for a cover From a953a66616347229b86ea3747bfbfdfaa2813dcd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 19:05:04 +0200 Subject: [PATCH 024/116] New : allow to define list size for object list on customer card --- htdocs/admin/ihm.php | 12 ++++++++++++ htdocs/comm/card.php | 2 +- htdocs/install/mysql/data/llx_const.sql | 1 + htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8d93dfc950c..fc1cdaf8971 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -57,6 +57,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); @@ -204,6 +205,12 @@ if ($action == 'edit') // Edit print ' '; print ''; + // Max size of short lists on customer card + $var=!$var; + print ''.$langs->trans("DefaultMaxSizeShortListCustomerCard").''; + print ' '; + print ''; + // Disable javascript and ajax $var=!$var; print ''.$langs->trans("DisableJavascript").''; @@ -385,6 +392,11 @@ else // Show print ''.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . ''; print ' '; print ""; + + $var=!$var; + print ''.$langs->trans("DefaultMaxSizeShortListCustomerCard").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ''; + print ' '; + print ""; // Disable javascript/ajax $var=!$var; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a44a79da1f0..edd64d97706 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -491,7 +491,7 @@ if ($id > 0) // Nbre max d'elements des petites listes - $MAXLIST=4; + $MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT; $tableaushown=1; // Lien recap diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 2c25765223e..95dfb2683f9 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -53,6 +53,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M -- IHM -- insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0); insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 4942378e58c..34d75a695d9 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -20,6 +20,7 @@ INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_DELAY_EXPENSEREPORTS_TO_PAY')__,__ENCRYPT('31')__,'chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0); +INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0); ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32); From 55657690bf398b0fa60582f12c77ccc3b82adac7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 19:07:02 +0200 Subject: [PATCH 025/116] Remove unused var --- htdocs/comm/card.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index edd64d97706..5b9ada6c075 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -492,7 +492,6 @@ if ($id > 0) // Nbre max d'elements des petites listes $MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT; - $tableaushown=1; // Lien recap print ''; @@ -684,7 +683,6 @@ if ($id > 0) if ($num > 0) { print '
'; - $tableaushown=1; print ''; print '"; } } + else + { + print ''; + } print "
'; print ''; @@ -868,7 +866,6 @@ if ($id > 0) { print '
'.$langs->trans("LastSendings",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSendings").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; - $tableaushown=1; print ''; print ''; } +// Ask for warehouse during order +if ($conf->stock->enabled) +{ + $var=!$var; + print ''; +} +else +{ + $var=!$var; + print ''; +} + print '
'; print ''; From 4de787411877e22295549bd45c7ab5733010ee6d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 20:36:25 +0200 Subject: [PATCH 026/116] New : review customer account summary and balance --- htdocs/comm/card.php | 26 ++--- htdocs/compta/recap-compta.php | 173 ++++++++++++++++++--------------- 2 files changed, 107 insertions(+), 92 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 5b9ada6c075..3e20d611785 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -376,17 +376,6 @@ if ($id > 0) $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); - // display amount and link to unpaid bill - $outstandingBills = $object->get_OutstandingBill(); - print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency); - if ($object->outstanding_limit != '') - { - if ($outstandingBills > $object->outstanding_limit) - print img_warning($langs->trans("OutstandingBillReached")); - //print ' / ' . price($soc->outstanding_limit); - } - print ')'; print ''; print ''; @@ -494,10 +483,21 @@ if ($id > 0) $MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT; // Lien recap + $outstandingBills = $object->get_OutstandingBill(); + $warn = ''; + if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingBills) + { + $warn = img_warning($langs->trans("OutstandingBillReached")); + } + print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print '
'; - print '
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'.$langs->trans("CurrentOutstandingBill").''.price($outstandingBills).$warn.'
'; print '
'; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index cfcd0a6f746..920419a8769 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; $langs->load("companies"); if (! empty($conf->facture->enabled)) $langs->load("bills"); @@ -43,6 +44,7 @@ if ($user->societe_id > 0) * View */ +$form = new Form($db); $userstatic=new User($db); llxHeader(); @@ -58,28 +60,7 @@ if ($socid > 0) $head = societe_prepare_head($societe); dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); - - print "\n"; - print '
'; - - print ''; - - // Name - print ''; - - // Prefix - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - - print "
'.$langs->trans("Name").''.$societe->name.'
'.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print '
"; - - print "
\n"; - - print ''; + dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { @@ -87,6 +68,18 @@ if ($socid > 0) print load_fiche_titre($langs->trans("CustomerPreview")); print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $TData = array(); + $TDataSort = array(); $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,"; $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; @@ -95,7 +88,7 @@ if ($socid > 0) $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.fk_user_valid = u.rowid"; - $sql.= " ORDER BY f.datef DESC"; + $sql.= " ORDER BY f.datef ASC"; $resql=$db->query($sql); if ($resql) @@ -103,23 +96,6 @@ if ($socid > 0) $var=true; $num = $db->num_rows($resql); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - if (! $num > 0) - { - print ''; - } - - $solde = 0; - // Boucle sur chaque facture for ($i = 0 ; $i < $num ; $i++) { @@ -133,29 +109,18 @@ if ($socid > 0) continue; } $totalpaye = $fac->getSommePaiement(); - - $var=!$var; - print ""; - - print "\n"; - print '\n"; - - print ''; - print '\n"; - if (($fac->statut == Facture::STATUS_ABANDONED ) || ($fac->statut == Facture::STATUS_CLOSED && ! $fact->close_code) ) $solde = $solde = $solde + $totalpaye; - else $solde = $solde + $fac->total_ttc; - - print ''; - print '\n"; - - // Author + $userstatic->id=$objf->userid; $userstatic->login=$objf->login; - print ''; - - print "\n"; + + $TData[] = array( + 'date' => $fac->date, + 'link' => $fac->getNomUrl(1), + 'status' => $fac->getLibStatut(2,$totalpaye), + 'amount' => $fac->total_ttc, + 'author' => $userstatic->getLoginUrl(1) + ); + $TDataSort[] = $fac->date; // Paiements $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,"; @@ -166,6 +131,7 @@ if ($socid > 0) $sql.= " WHERE pf.fk_paiement = p.rowid"; $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND pf.fk_facture = ".$fac->id; + $sql.= " ORDER BY p.datep ASC"; $resqlp = $db->query($sql); if ($resqlp) @@ -176,26 +142,21 @@ if ($socid > 0) while ($j < $nump) { $objp = $db->fetch_object($resqlp); - //$var=!$var; - print ""; - print '\n"; - print ''; - print "\n"; - print "\n"; - print ''; - $solde = $solde - $objp->amount; - print '\n"; - - // Author + + $paymentstatic = new Paiement($db); + $paymentstatic->id = $objp->rowid; + $userstatic->id=$objp->userid; $userstatic->login=$objp->login; - print ''; - - print ''; + + $TData[] = array( + 'date' => $db->jdate($objp->dp), + 'link' => $langs->trans("Payment") .' '. $paymentstatic->getNomUrl(1), + 'status' => '', + 'amount' => -$objp->amount, + 'author' => $userstatic->getLoginUrl(1) + ); + $TDataSort[] = $db->jdate($objp->dp); $j++; } @@ -212,9 +173,63 @@ if ($socid > 0) { dol_print_error($db); } + + if(empty($TData)) { + print ''; + } else { + + // Sort array by date + asort($TDataSort); + array_multisort($TData,$TDataSort); + + // Balance calculation + foreach($TData as &$data1) { + $balance += $data1['amount']; + $data1['balance'] += $balance; + } + + // Reverse array to have last elements on top + $TData = array_reverse($TData); + + $totalDebit = 0; + $totalCredit = 0; + + // Display array + foreach($TData as $data) { + $var=!$var; + print ""; + + print "\n"; + print '\n"; + + print ''; + print '\n"; + $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; + print '\n"; + $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); + print '\n"; + + // Author + print ''; + + print "\n"; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + print "
'.$langs->trans("Date").''.$langs->trans("Element").''.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").''.$langs->trans("Author").'
'.$langs->trans("Date").' '.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").' 
'.$langs->trans("NoInvoice").'
".dol_print_date($fac->date,'day')."'.img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2,$totalpaye).''.price($fac->total_ttc)." '.price($solde)."'; - print $userstatic->getLoginUrl(1); - print '
'.dol_print_date($db->jdate($objp->dp),'day')."'; - print '      '; // Decalage - print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'  '.price($objp->amount).''.price($solde)."'; - print $userstatic->getLoginUrl(1); - print '
'.$langs->trans("NoInvoice").'
".dol_print_date($data['date'],'day')."'.$data['link']."'.$data['status'].''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.price($data['balance'])."'; + print $data['author']; + print '
 '.price($totalDebit).''.price($totalCredit).' 
"; print "
"; } + + print ''; } else { From 2264ecfb2c3fa2b72a302dc7cc7a96660ef0af60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 20:58:36 +0200 Subject: [PATCH 027/116] Update llx_commande.sql --- htdocs/install/mysql/tables/llx_commande.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 3511aa7ec78..3df4e89b910 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -63,6 +63,7 @@ create table llx_commande date_livraison date default NULL, fk_shipping_method integer, -- shipping method id + fk_warehouse date default NULL, fk_availability integer NULL, fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined fk_delivery_address integer, -- delivery address (deprecated) From 1d9f9c7f5bbca2472b2f27bcaf359b943712fa6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 21:00:47 +0200 Subject: [PATCH 028/116] Update llx_commande.sql --- htdocs/install/mysql/tables/llx_commande.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 3df4e89b910..553b2facad7 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -63,7 +63,7 @@ create table llx_commande date_livraison date default NULL, fk_shipping_method integer, -- shipping method id - fk_warehouse date default NULL, + fk_warehouse integer default NULL, fk_availability integer NULL, fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined fk_delivery_address integer, -- delivery address (deprecated) From 6a524eeabb6e58a7a0a8ea2345b945f1cd5c73e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 21:04:05 +0200 Subject: [PATCH 029/116] Update 3.8.0-3.9.0.sql --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 33593e7fac5..573cadceb3d 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -67,7 +67,7 @@ ALTER TABLE llx_prelevement_lignes MODIFY COLUMN code_banque varchar(128); ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128); ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30); - +ALTER TABLE llx_commande ADD COLUMN fk_warehouse integer DEFAULT NULL after fk_shipping_method; ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(1000); From affe067ff1f6e0d39763ec700ef1ef07bb16acbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 21:09:02 +0200 Subject: [PATCH 030/116] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d20d5d82bde..716d705123e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1507,6 +1507,36 @@ abstract class CommonObject } + /** + * Change the warehouse + * + * @param int $warehouse_id Id of warehouse + * @return int 1 if OK, 0 if KO + */ + function setWarehouse($warehouse_id) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setWarehouse was called on objet with property table_element not defined",LOG_ERR); + return -1; + } + if ($warehouse_id<0) $warehouse_id='NULL'; + dol_syslog(get_class($this).'::setWarehouse('.$warehouse_id.')'); + + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; + $sql.= " SET fk_warehouse = ".$warehouse_id; + $sql.= " WHERE rowid=".$this->id; + + if ($this->db->query($sql)) { + $this->warehouse_id = ($warehouse_id=='NULL')?null:$warehouse_id; + return 1; + } else { + dol_syslog(get_class($this).'::setWarehouse Error ', LOG_DEBUG); + $this->error=$this->db->error(); + return 0; + } + } + + /** * Set last model used by doc generator * From fe1931bba88fdebcacd520e6ce21600349a8af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 21:21:27 +0200 Subject: [PATCH 031/116] Update commande.class.php --- htdocs/commande/class/commande.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d2f5c4d799f..40844da3d56 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -702,6 +702,7 @@ class Commande extends CommonOrder $sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int"; $sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address"; $sql.= ", fk_shipping_method"; + $sql.= ", fk_warehouse"; $sql.= ", remise_absolue, remise_percent"; $sql.= ", fk_incoterms, location_incoterms"; $sql.= ", entity"; @@ -724,6 +725,7 @@ class Commande extends CommonOrder $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:'NULL'); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); + $sql.= ", ".($this->warehouse_id>0?$this->warehouse_id:'NULL'); $sql.= ", ".($this->remise_absolue>0?$this->db->escape($this->remise_absolue):'NULL'); $sql.= ", ".($this->remise_percent>0?$this->db->escape($this->remise_percent):0); $sql.= ", ".(int) $this->fk_incoterms; @@ -1063,6 +1065,7 @@ class Commande extends CommonOrder $this->demand_reason_id = $object->demand_reason_id; $this->date_livraison = $object->date_livraison; $this->shipping_method_id = $object->shipping_method_id; + $this->warehouse_id = $object->warehouse_id; $this->fk_delivery_address = $object->fk_delivery_address; $this->contact_id = $object->contactid; $this->ref_client = $object->ref_client; @@ -1432,6 +1435,7 @@ class Commande extends CommonOrder $sql.= ', c.date_commande'; $sql.= ', c.date_livraison'; $sql.= ', c.fk_shipping_method'; + $sql.= ', c.fk_warehouse'; $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; $sql.= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_delivery_address, c.extraparams'; $sql.= ', c.fk_incoterms, c.location_incoterms'; @@ -1499,6 +1503,7 @@ class Commande extends CommonOrder $this->demand_reason_code = $obj->demand_reason_code; $this->date_livraison = $this->db->jdate($obj->date_livraison); $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; + $this->warehouse_id = ($obj->fk_warehouse>0)?$obj->fk_warehouse:null; $this->fk_delivery_address = $obj->fk_delivery_address; //Incoterms From 229fa59f6c3c749acc2c8b969fa61de4c86d32d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 21:57:26 +0200 Subject: [PATCH 032/116] Update commande.php --- htdocs/admin/commande.php | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 860e1a21772..f7e3812d74f 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -251,6 +251,23 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') } } +// Activate ask for warehouse +else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') +{ + $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + /* * View @@ -630,6 +647,36 @@ else print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'
 '.$langs->trans('NotAvailable').'
'; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; + if (! empty($conf->use_javascript_ajax)) + { + print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); + } + else + { + if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } + } + print '
'; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; print '
'; From 3e730cc9e2000f7332a59b626f1540a6a95da97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 22:01:30 +0200 Subject: [PATCH 033/116] Update admin.lang --- htdocs/langs/en_US/admin.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6f720c0a92b..453bfbc946e 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1203,6 +1203,7 @@ AskPriceSupplierPDFModules=Price requests suppliers documents models FreeLegalTextOnAskPriceSupplier=Free text on price requests suppliers WatermarkOnDraftAskPriceSupplier=Watermark on draft price requests suppliers (none if empty) BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER=Ask for bank account destination of price request +WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order ##### Orders ##### OrdersSetup=Order management setup OrdersNumberingModules=Orders numbering models @@ -1692,4 +1693,4 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier MailToSendSupplierOrder=To send supplier order MailToSendSupplierInvoice=To send supplier invoice MailToThirdparty=To send email from thirdparty page -ByDefaultInList=Show by default on list view \ No newline at end of file +ByDefaultInList=Show by default on list view From 50fe3f6ee9293589bf04e7d4c2cd3d819943605d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 22:06:46 +0200 Subject: [PATCH 034/116] Update html.formproduct.class.php --- .../product/class/html.formproduct.class.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0215f20e3c6..f08143c443c 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -134,6 +134,40 @@ class FormProduct return $out; } + /** + * Display form to select warehouse + * + * @param string $page Page + * @param int $selected Id of warehouse + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @return void + */ + function formSelectWarehouses($page, $selected='', $htmlname='warehouse_id', $addempty=0) + { + global $langs; + if ($htmlname != "none") { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $this->selectWarehouses($selected, $htmlname, '', $addempty); + print '
'; + } else { + if ($selected) { + require_once DOL_DOCUMENT_ROOT .'/product/stock/class/entrepot.class.php'; + $warehousestatic=new Entrepot($this->db); + $warehousestatic->fetch($selected); + print $warehousestatic->getNomUrl(); + } else { + print " "; + } + } + } + /** * Output a combo box with list of units * pour l'instant on ne definit pas les unites dans la base From 22f39d2c18f0d2582aba31a53030a53dc7dc565d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 22:18:54 +0200 Subject: [PATCH 035/116] Output log to fix travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 54d937625ba..ec114c753ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,6 +131,7 @@ script: # - cat upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log - php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log + - cat upgrade370380.log - php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log # - cat upgrade370380-2.log - cd ../.. From fcac4c6059fcee19e8cb9296ec4ee57f52dfad26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2015 23:15:13 +0200 Subject: [PATCH 036/116] Output log to fix travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec114c753ae..5d613e1dfca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,9 +131,9 @@ script: # - cat upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log - php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log - - cat upgrade370380.log + - cat upgrade380390.log - php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log -# - cat upgrade370380-2.log +# - cat upgrade380390-2.log - cd ../.. - date - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php From 23d7d60d73dbba58c0ce450fb1555a64625a4aa8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 00:22:00 +0200 Subject: [PATCH 037/116] Better compatibility with old versions --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ec3705c825c..053c285c5de 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1689,10 +1689,10 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) $showgmap=$showomap=0; // TODO Add a hook here - if ($mode=='thirdparty' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; if ($mode=='contact' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) $showgmap=1; if ($mode=='member' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) $showgmap=1; - if ($mode=='thirdparty' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; if ($mode=='contact' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) $showomap=1; if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1; From 921faa04108796b19208d2e7427c562cce6b1b12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 00:25:31 +0200 Subject: [PATCH 038/116] Work on theme md --- htdocs/theme/md/img/filter.png | Bin 206 -> 237 bytes htdocs/theme/md/img/sort_asc.png | Bin 256 -> 248 bytes htdocs/theme/md/img/sort_desc.png | Bin 264 -> 260 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/theme/md/img/filter.png b/htdocs/theme/md/img/filter.png index 917715107bde9b14abbe77024e805b1a03d40153..ee34a22c78e0cd31d74739b7cb8a1bda9aa6e608 100644 GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!2%@pE-d!}QcOwS?k)`f+xyS#2l6-zJR*x3 z7`TN&n2}-D90{Nxdx@v7EBk#eCSE;pf6mhzopr0Ca^+T>t<8 literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CH!VDx|PJVD7NNEN5gt!7}Mn*;v5fO25aambe zAQu7}8X6WXSaA68;iE^79y@mI&Ye5$jrD9mIrfquzhJN$Udfh)Hdld6A5Ry@5RU7m zM-2rV3vq+CoUK~H7~vtEB6V#~9mon#S3j3^P6G6?Z8qBsBm0EJ0JK~y-)?b4wQ!cY{3(Q^@ykT3;~ z88D22M5EaQ24D{qiy-j`3@PSfsA(Er+SHKrPd@kVQ7+Inu)wte)m<>_CxY!z;nh-wZQEV^ f@24HH5gTA1#Wet2_%IXM00000NkvXXu0mjf_YO-w delta 183 zcmV;o07(D%0e}LKBnkm@Qb$4nuFf3kks&dE1p^K=E9l_^c>n+afJsC_R5;7+(lHJ} zK@fo9Sp|v2DRj=DaSWwe?H lro}RMm;UG8zJi({KO)0Fg;VK~y-)?bIO-gFq04;r}7pgoIPn z^$ayV2C}-Ed(Z>)9#vcfiAU5BFoRh|rwdI;ieQpwcHew*WM-^22`kQy?bzQiNx7t6 zQs<+=u3vW|n1IIwdjk3yGYjAer~}jh=V(9n r8NfR*0L5%~0d@dNAf4-Kv&V4+V3ZPE5OdhM00000NkvXXu0mjf9C=JO delta 191 zcmV;w06_nQ0*C^TBnkm@Qb$4nuFf3kks&dE1p^K>AJ9(5jQ{`uh)G02R5;7+)G-bL zQ5Xc^Sp|v2DRj=DaSWwe?H(M!Jyb5D)GIWynoqNpJeFh=ik;+dUS_`XRY+GEq{H-B zkNpx`CaII$3Rfpt6;~+T2nXdHF)8g{VZj{NC+LF3tIa#C!tM#%H}79#!4#(kI%D=K tuHS|QYuvGE>wba_vBkKpTm9|l_yFr5ciURC7Lxz~002ovPDHLkV1mzcQkDP! From e70bb28be7fe5c6f6a362027647dce87e95fb6ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 00:47:35 +0200 Subject: [PATCH 039/116] If firstname not define, use lastname --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 053c285c5de..abaf5d24837 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4384,7 +4384,7 @@ function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $wit * * @param string $firstname Firstname * @param string $lastname Lastname - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname * @return string Firstname + lastname or Lastname + firstname */ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9e6869f7302..199a882d0d5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1492,7 +1492,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Login name with tooltip $toprightmenu.='
'; $toprightmenu.=''; From b5e633ef42d379bd49d9aad9dc718acf0d7dddaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 00:52:53 +0200 Subject: [PATCH 040/116] Size too small --- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/lib/usergroups.lib.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 437637c3bdf..7adabcf819b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -598,7 +598,7 @@ class FormOther include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(colorStringToArray($color,array()),''); - if ($color) print ''; + if ($color) print ''; else print $textifnotdefined; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 243438b0aa6..526f6e48185 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -414,7 +414,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='edf4fb'; else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),''); - if ($color) print ''; + if ($color) print ''; else print $langs->trans("None"); } print '   ('.$langs->trans("Default").': edf4fb, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; @@ -440,7 +440,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); - if ($color) print ''; + if ($color) print ''; else print ''; } if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; @@ -459,7 +459,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); - if ($color) print ''; + if ($color) print ''; else print $langs->trans("Default"); } print '   ('.$langs->trans("Default").': 6e7896, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; From fa138ca5263ec62e470b40c4d1f989999bd86dad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 02:31:24 +0200 Subject: [PATCH 041/116] Fix color of text --- htdocs/main.inc.php | 2 +- htdocs/theme/eldy/style.css.php | 7 +++++-- htdocs/theme/md/style.css.php | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 199a882d0d5..7e7a057e71b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1492,7 +1492,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Login name with tooltip $toprightmenu.='
'; $toprightmenu.=''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e552ca75553..72a7d179f63 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1088,13 +1088,16 @@ div.login_block_other { padding-top: 3px; text-align: right; } padding: 0px 0px 0px 4px !important; height: 16px; } -.alogin, .alogin:hover { +.atoplogin, .atoplogin:hover { color: # !important; font-weight: normal !important; +} +.alogin, .alogin:hover { + font-weight: normal !important; font-size: px !important; padding-top: 2px; } -.alogin:hover { +.alogin:hover, .atoplogin:hover { text-decoration:underline !important; } img.login, img.printer, img.entity { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c01d0198e0b..ef2bb3a93de 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1114,12 +1114,16 @@ div.login_block_other { padding-top: 3px; } .login_block_elem_name { margin-top: 5px; } +.atoplogin, .atoplogin:hover { + color: # !important; + font-weight: normal !important; +} .alogin, .alogin:hover { color: #888 !important; font-weight: normal !important; font-size: px !important; } -.alogin:hover { +.alogin:hover, .atoplogin:hover { text-decoration:underline !important; } img.login, img.printer, img.entity { From 22979523dbad10ba9843bbaef1b8f3eb7bbb6274 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 02:34:53 +0200 Subject: [PATCH 042/116] Try a fix for #3742 --- htdocs/compta/facture.php | 4 +-- htdocs/core/class/commonobject.class.php | 43 +++++++++++++++++------- htdocs/fourn/facture/card.php | 4 +-- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 5105f8196d1..a178abae47c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2347,8 +2347,8 @@ if ($action == 'create') } print '
' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); - //We check if Origin document has already an invoice attached to it - $objectsrc->fetchObjectLinked($originid,'','','facture'); + // We check if Origin document (id and type is known) has already at least one invoice attached to it + $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); $cntinvoice=count($objectsrc->linkedObjects['facture']); if ($cntinvoice>=1) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d20d5d82bde..1094b549fab 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2231,13 +2231,18 @@ abstract class CommonObject /** * Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds - * - * @param int $sourceid Object source id - * @param string $sourcetype Object source type - * @param int $targetid Object target id - * @param string $targettype Object target type + * Possible usage for parameters: + * - all parameters empty -> we look all link to current object (current object can be source or target) + * - one couple id+type is provided -> this will set $justsource or $justtarget + * - one couple id+type is provided and other type is provided -> this will set $justsource or $justtarget + criteria on other type + * + * + * @param int $sourceid Object source id (if not defined, id of object) + * @param string $sourcetype Object source type (if not defined, element name of object) + * @param int $targetid Object target id (if not defined, id of object) + * @param string $targettype Object target type (if not defined, elemennt name of object) * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided - * @param int $alsosametype 0=Return only links to different object than source. 1=Include also link to objects of same type. + * @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type. * @return void * @see add_object_linked, updateObjectLinked, deleteObjectLinked */ @@ -2255,12 +2260,12 @@ abstract class CommonObject if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid)) { - $justsource=true; + $justsource=true; // the source (id and type) is a search criteria if (! empty($targettype)) $withtargettype=true; } if (! empty($targetid) && ! empty($targettype) && empty($sourceid)) { - $justtarget=true; + $justtarget=true; // the target (id and type) is a search criteria if (! empty($sourcetype)) $withsourcetype=true; } @@ -2309,13 +2314,27 @@ abstract class CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - if ($obj->fk_source == $sourceid) + if ($justsource || $justtarget) { - $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + if ($justsource) + { + $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + } + else if ($justtarget) + { + $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + } } - if ($obj->fk_target == $targetid) + else { - $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + if ($obj->fk_source == $sourceid && $obj->sourcetype == $sourcetype) + { + $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; + } + if ($obj->fk_target == $targetid && $obj->targettype == $targettype) + { + $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; + } } $i++; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a8d84c7cd36..f3f9dc6afa3 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1515,8 +1515,8 @@ if ($action == 'create') $txt=$langs->trans("SupplierOrder"); } print '
'.$txt.''.$objectsrc->getNomUrl(1); - //We check if Origin document has already an invoice attached to it - $objectsrc->fetchObjectLinked($originid,'','','invoice_supplier'); + // We check if Origin document (id and type is known) has already at least one invoice attached to it + $objectsrc->fetchObjectLinked($originid,$origin,'','invoice_supplier'); $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); if ($cntinvoice>=1) { From 0d9c0b12158efa79b5ba71110e74cbb5da2c72e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 02:49:34 +0200 Subject: [PATCH 043/116] Disable of image done by css, not dol_optimize_smallscreen option --- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 72a7d179f63..cbdaf1afc10 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -671,7 +671,7 @@ $heightmenu=46; /* height of top menu, part with image */ $heightmenu2=48; /* height of top menu, part with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE) || $dol_optimize_smallscreen) { $disableimages = 1; $maxwidthloginblock = 180; } +if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; } ?> div#id-top { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ef2bb3a93de..0fa988c16e8 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -708,7 +708,7 @@ $heightmenu=48; /* height of top menu, part with image */ $heightmenu2=48; /* height of top menu, ârt with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE) || $dol_optimize_smallscreen) { $disableimages = 1; $maxwidthloginblock = 180; } +if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; } ?> div#tmenu_tooltip { From 72491db6b4d0d24b27c05256164ac0c4938f6e6d Mon Sep 17 00:00:00 2001 From: philippe grand Date: Tue, 20 Oct 2015 09:31:33 +0200 Subject: [PATCH 044/116] [Qual] Uniformize code --- htdocs/accountancy/admin/account.php | 4 ++-- htdocs/accountancy/admin/card.php | 2 +- htdocs/accountancy/admin/export.php | 4 ++-- htdocs/accountancy/admin/fiscalyear_card.php | 6 +++--- htdocs/accountancy/admin/importaccounts.php | 6 +++--- htdocs/accountancy/admin/index.php | 12 ++++++------ htdocs/accountancy/admin/journal.php | 4 ++-- htdocs/accountancy/admin/productaccount.php | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index a56701dada2..d1c4ef409b4 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -76,7 +76,7 @@ if ($action == 'disable') { $action = 'update'; if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } else if ($action == 'enable') { if ($accounting->fetch($id)) { @@ -84,7 +84,7 @@ if ($action == 'disable') { } $action = 'update'; if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 925bf818137..99eb49949e7 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -125,7 +125,7 @@ else if ($action == 'delete') } if ($result < 0) { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } } diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 9bde2d23c14..c0a987ddf82 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -100,9 +100,9 @@ if ($action == 'update') { } if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 657d5b100e6..45e69c991de 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -110,7 +110,7 @@ else if ($action == 'add') { $db->rollback(); - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action='create'; } } @@ -147,7 +147,7 @@ else if ($action == 'update') } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 61e86b7df19..7c38617d66c 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -76,14 +76,14 @@ if ($_POST["action"] == 'import') { $result = $accounting->create($user); if ($result > 0) { - setEventMessage($langs->trans("AccountingAccountAdd"), 'mesgs'); + setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs'); } else { - setEventMessage($accounting->error, 'errors'); + setEventMessages($accounting->error, $accounting->errors, 'errors'); } $cpt ++; } } else { - setEventMessage($langs->trans('AccountPlanNotFoundCheckSetting'), 'errors'); + setEventMessages($langs->trans('AccountPlanNotFoundCheckSetting'), null, 'errors'); } } else { print '
' . $langs->trans("AnyLineImport") . '
'; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index af0bccdf00c..40dff028783 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -111,11 +111,11 @@ if ($action == 'update') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -126,9 +126,9 @@ if ($action == 'setlistsorttodo') { $error ++; if (! $error) { - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'mesgs'); + setEventMessages($langs->trans("Error"), null, 'mesgs'); } } @@ -138,9 +138,9 @@ if ($action == 'setlistsortdone') { if (! $res > 0) $error ++; if (! $error) { - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'mesgs'); + setEventMessages($langs->trans("Error"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php index b55728ee080..18f01abb082 100644 --- a/htdocs/accountancy/admin/journal.php +++ b/htdocs/accountancy/admin/journal.php @@ -68,9 +68,9 @@ if ($action == 'update') { } if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index d79d14e74d1..0bea58fd75c 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -116,7 +116,7 @@ if ($action == 'update') { $result=$accounting->fetch($accounting_account_id,null,1); if ($result<0) { - //setEventMessage(null, $accounting->errors,'errors'); + //setEventMessages(null, $accounting->errors, 'errors'); $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '
' . $sql . '
'; } else { From 3cb2637f25da744249c8f165e6ec4e75ab5d77bd Mon Sep 17 00:00:00 2001 From: All-3kcis Date: Tue, 20 Oct 2015 09:42:02 +0200 Subject: [PATCH 045/116] Correct return value --- htdocs/fourn/class/fournisseur.product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 490b5cf1ea3..cf580459a9c 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -229,7 +229,7 @@ class ProductFournisseur extends Product else { $this->db->rollback(); - return 1; + return -1; } } else @@ -312,7 +312,7 @@ class ProductFournisseur extends Product else { $this->db->rollback(); - return 1; + return -1; } } else From a0fe65266adebd5ac547f2cb3b89b41db267a573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 09:50:09 +0200 Subject: [PATCH 046/116] Update shipment.php --- htdocs/expedition/shipment.php | 35 ++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 82bf1d01e6a..50a231c0898 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -123,6 +123,12 @@ if ($action == 'setshippingmethod' && $user->rights->commande->creer) { $result=$commande->setShippingMethod(GETPOST('shipping_method_id', 'int')); } +// warehouse +if ($action == 'setwarehouse' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result = $commande->setWarehouse(GETPOST('warehouse_id', 'int')); +} /* @@ -164,8 +170,8 @@ if ($id > 0 || ! empty($ref)) } // Onglet commande - $nbrow=8; - if (! empty($conf->projet->enabled)) $nbrow++; + //$nbrow=8; + //if (! empty($conf->projet->enabled)) $nbrow++; print ''; @@ -286,6 +292,27 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + // Warehouse + if (! empty($conf->stock->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + print ''; + print ''; + } + // Terms of payment print '"; } } + else + { + print ''; + } print "
'; + print ''; + if ($action != 'editwarehouse' && $user->rights->commande->creer) + print ''; + print '
'; + print $langs->trans('Warehouse'); + print 'id.'">'.img_edit($langs->trans('SetWarehouse'),1).'
'; + print '
'; + if ($action == 'editwarehouse') { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->warehouse_id, 'warehouse_id', 1); + } else { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->warehouse_id, 'none'); + } + print '
'; print ''; + print ''; // Qty already shipped $qtyProdCom=$objp->qty; @@ -677,7 +704,7 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("WarehouseSource").''; print ' diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 898348d047e..5551d848b5f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -93,7 +93,7 @@ elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') ) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6f720c0a92b..46112d624ce 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -398,6 +398,7 @@ ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value

fo ExtrafieldParamHelpradio=Parameters list have to be like key,value

for example :
1,value1
2,value2
3,value3
... ExtrafieldParamHelpsellist=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpchkbxlst=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax : ObjectName:Classpath
Example : Societe:societe/class/societe.class.php LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.
To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)
2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3 : local tax apply on products without vat (localtax is calculated on amount without tax)
4 : local tax apply on products including vat (localtax is calculated on amount + main vat)
5 : local tax apply on services without vat (localtax is calculated on amount without tax)
6 : local tax apply on services including vat (localtax is calculated on amount + tax) From f123e11c8ee10170d84bc78aa0d5aad489b15fc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 12:53:32 +0200 Subject: [PATCH 050/116] Doxygen --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0f5070f2885..aa2f014c7ba 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -111,7 +111,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not - * @param string $default_value Defaulted value + * @param string $default_value Defaulted value (Example: '', '0', 'null', 'avalue') * @param array $param Params for field * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check From 6f37fef05e9222d82f1eb54ed80e2683c8e3dad0 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Morfin Date: Tue, 20 Oct 2015 14:44:20 +0200 Subject: [PATCH 051/116] fix test against empty amount on book update - amount < 1 was considered as 0 - 0.00 was not considered as empty so $book->sens was always C --- htdocs/accountancy/bookkeeping/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d1bf69a8eee..d4c256dfbf2 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -51,7 +51,7 @@ if ($action == "confirm_update") { $error = 0; - if ((intval($debit) != 0) && (intval($credit) != 0)) { + if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) { setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); $error ++; } @@ -69,11 +69,11 @@ if ($action == "confirm_update") { $book->debit = $debit; $book->credit = $credit; - if (! empty($debit)) { + if (floatval($debit)!=0.0) { $book->montant = $debit; $book->sens = 'D'; } - if (! empty($credit)) { + if (floatval($credit)!=0.0) { $book->montant = $credit; $book->sens = 'C'; } @@ -372,4 +372,4 @@ if ($action == 'create') { } llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); From 8306d93286b833bbb0283828f3e35954cf8ea40a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 16:08:25 +0200 Subject: [PATCH 052/116] NEW Add css on column of detail lines to allow module to easily manipulate fields. --- htdocs/core/class/commonobject.class.php | 34 ++++++++--------- htdocs/core/tpl/objectline_create.tpl.php | 46 +++++++++++------------ htdocs/core/tpl/objectline_view.tpl.php | 40 ++++++++++---------- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 53c9231b19b..f555bd113d9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3005,60 +3005,60 @@ abstract class CommonObject print ''; - if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; // Description - print ''; + print ''; if ($this->element == 'askpricesupplier') { - print ''; + print ''; } // VAT - print ''; + print ''; // Price HT - print ''; + print ''; if ($inputalsopricewithtax) print ''; // Qty - print ''; + print ''; if($conf->global->PRODUCT_USE_UNITS) { - print ''; + print ''; } // Reduction short - print ''; + print ''; if ($this->situation_cycle_ref) { - print ''; + print ''; } if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) { if ($conf->global->MARGIN_TYPE == "1") - print ''; + print ''; else - print ''; + print ''; if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) - print ''; + print ''; if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) - print ''; + print ''; } // Total HT - print ''; + print ''; - print ''; // No width to allow autodim + print ''; // No width to allow autodim - print ''; + print ''; - print ''; + print ''; print "\n"; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 64c49894de1..ccf63983539 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -49,36 +49,36 @@ if (in_array($object->element,array('propal', 'askpricesupplier','facture','invo - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + element == 'askpricesupplier') { ?> - + trans('AskPriceSupplierRefFourn'); ?> - - + + - + - + global->PRODUCT_USE_UNITS) { - print ''; } ?> - + situation_cycle_ref) { - print ''; + print ''; } if (! empty($usemargins)) { ?> - rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''; - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''; } ?> - + > @@ -102,7 +102,7 @@ else { $coldisplay=0; } ?> - + - - - - global->PRODUCT_USE_UNITS) { - print ''; } ?> - + situation_cycle_ref) { $coldisplay++; @@ -246,7 +246,7 @@ else { if (! empty($usemargins)) { ?> - > global->MAIN_VIEW_LINE_NUMBER)) { ?> - + - element == 'askpricesupplier') { ?> - + - + - + - + - - + situation_cycle_ref) { $coldisplay++; - print ''; + print ''; } if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> - + global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> - + special_code == 3) { ?> - + - + statut == 0 && ($object_rights->creer)) { ?> - - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref)) { ?> - - + From d9a56ef418e1eef8f87d317e3de7809302ce0e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 17:00:34 +0200 Subject: [PATCH 053/116] Update index.php --- htdocs/comm/index.php | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 18991f66bba..2c285903cbe 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! $user->rights->societe->lire) accessforbidden(); @@ -65,6 +66,7 @@ $formfile = new FormFile($db); $companystatic=new Societe($db); if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db); if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db); +if (! empty($conf->fournisseur->enabled)) $supplierorderstatic=new CommandeFournisseur($db); llxHeader(); @@ -261,6 +263,84 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $db->free($resql); } + else + { + dol_print_error($db); + } +} + + +/* + * Draft suppliers orders + */ +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) +{ + $langs->load("orders"); + + $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; + $sql.= ", s.code_client"; + $sql.= ", s.code_fournisseur"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE cf.fk_soc = s.rowid"; + $sql.= " AND cf.fk_statut = 0"; + $sql.= " AND cf.entity IN (".getEntity('supplier_order', 1).")"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND cf.fk_soc = ".$socid; + + $resql = $db->query($sql); + if ($resql) + { + $total = 0; + $num = $db->num_rows($resql); + + print '
'; @@ -529,7 +556,7 @@ if ($id > 0 || ! empty($ref)) } // Qty ordered - print ''.$objp->qty.'' . ($objp->qty!=1?''.$objp->qty.'':$objp->qty) . ''; - print $formproduct->selectWarehouses(-1,'entrepot_id','',1); + print $formproduct->selectWarehouses(! empty($commande->warehouse_id)?$commande->warehouse_id:-1,'entrepot_id','',1); if (count($formproduct->cache_warehouses) <= 0) { print '   '.$langs->trans("WarehouseSourceNotDefined").' '.$langs->trans("AddOne").''; From f22b3cdfee24da348694b326673b324b82d19aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 10:31:45 +0200 Subject: [PATCH 047/116] Fix some action has no effect in shipment --- htdocs/expedition/shipment.php | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 82bf1d01e6a..fa2457516ae 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -88,9 +88,7 @@ if ($action == 'setdatedelivery' && $user->rights->commande->creer) $commande->fetch($id); $result=$commande->set_date_livraison($user,$datelivraison); if ($result < 0) - { - $mesg='
'.$commande->error.'
'; - } + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setdeliveryaddress' && $user->rights->commande->creer) @@ -98,6 +96,8 @@ if ($action == 'setdeliveryaddress' && $user->rights->commande->creer) $commande = new Commande($db); $commande->fetch($id); $commande->setDeliveryAddress(GETPOST('delivery_address_id','int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setmode' && $user->rights->commande->creer) @@ -105,7 +105,24 @@ if ($action == 'setmode' && $user->rights->commande->creer) $commande = new Commande($db); $commande->fetch($id); $result = $commande->setPaymentMethods(GETPOST('mode_reglement_id','int')); - if ($result < 0) dol_print_error($db,$commande->error); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); +} + +if ($action == 'setavailability' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result=$commande->availability(GETPOST('availability_id')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); +} + +if ($action == 'setdemandreason' && $user->rights->commande->creer) { + $commande = new Commande($db); + $commande->fetch($id); + $result=$commande->demand_reason(GETPOST('demand_reason_id')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } if ($action == 'setconditions' && $user->rights->commande->creer) @@ -113,7 +130,8 @@ if ($action == 'setconditions' && $user->rights->commande->creer) $commande = new Commande($db); $commande->fetch($id); $result=$commande->setPaymentTerms(GETPOST('cond_reglement_id','int')); - if ($result < 0) dol_print_error($db,$commande->error); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } // shipping method @@ -121,6 +139,8 @@ if ($action == 'setshippingmethod' && $user->rights->commande->creer) { $commande = new Commande($db); $commande->fetch($id); $result=$commande->setShippingMethod(GETPOST('shipping_method_id', 'int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } From 2cb9dd8bf3d328d49454d7b48d2053d6b58f9941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 10:33:46 +0200 Subject: [PATCH 048/116] Update shipment.php --- htdocs/expedition/shipment.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 50a231c0898..ce42107fd79 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -128,6 +128,8 @@ if ($action == 'setwarehouse' && $user->rights->commande->creer) { $commande = new Commande($db); $commande->fetch($id); $result = $commande->setWarehouse(GETPOST('warehouse_id', 'int')); + if ($result < 0) + setEventMessages($commande->error, $commande->errors, 'errors'); } From 0c6441df74dbe2b93a20205fb913326497936957 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2015 12:40:37 +0200 Subject: [PATCH 049/116] FIX Using extrafield with type "Link to object" works correctly. --- htdocs/commande/class/commande.class.php | 2 +- htdocs/core/class/commonobject.class.php | 31 +++++++++++++------ htdocs/core/class/extrafields.class.php | 31 ++++++++++++++----- htdocs/core/tpl/admin_extrafields_add.tpl.php | 9 ++++-- .../core/tpl/admin_extrafields_edit.tpl.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 6 files changed, 55 insertions(+), 21 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d2f5c4d799f..4c2c0f3aea7 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1142,7 +1142,7 @@ class Commande extends CommonOrder * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param array $array_options extrafields array + * @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) * @param string $fk_unit Code of the unit to use. Null to use the default one * @return int >0 if OK, <0 if KO * diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1094b549fab..53c9231b19b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3801,10 +3801,10 @@ abstract class CommonObject foreach ($tab as $key => $value) { - // Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine) + // Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine) if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key)) { - // we can add this attribute to adherent object + // we can add this attribute to object $this->array_options["options_".$key]=$value; } } @@ -3852,7 +3852,7 @@ abstract class CommonObject /** * Add/Update all extra fields values for the current object. * Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) - * This function delte record with all extrafields and insert them again from the array $this->array_options. + * This function delete record with all extrafields and insert them again from the array $this->array_options. * * @return int -1=error, O=did nothing, 1=OK */ @@ -3906,12 +3906,25 @@ abstract class CommonObject // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - if ($value) - { - $object->fetch(0,$value); - $this->array_options[$key]=$object->id; - } + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + if ($value) + { + $res=$object->fetch(0,$value); + if ($res > 0) $this->array_options[$key]=$object->id; + else + { + $this->error="Ref '".$value."' for object '".$object->element."' not found"; + $this->db->rollback(); + return -1; + } + } + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + } break; } } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4d9fec42bf9..0f5070f2885 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1085,10 +1085,19 @@ class ExtraFields // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - $object->fetch($value); - $out=''; - + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + $object->fetch($value); + $valuetoshow=$object->ref; + if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ref is id because name is not unique + $out.=''; + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + $out.='Error bad setup of extrafield'; + } } /* Add comments if ($type == 'date') $out.=' (YYYY-MM-DD)'; @@ -1326,9 +1335,17 @@ class ExtraFields // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); - $object->fetch($value); - $value=$object->getNomUrl(3); + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) + { + $object = new $InfoFieldList[0]($this->db); + $object->fetch($value); + $value=$object->getNomUrl(3); + } + else + { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + $out.='Error bad setup of extrafield'; + } } } elseif ($type == 'text') diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 142c0903212..174da1ae409 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -100,9 +100,12 @@ - +
-textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?>textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> -textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?>
+textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0)?> +
trans("Position"); ?>
  '.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans("AskPriceSupplierRefFourn").''.$langs->trans("AskPriceSupplierRefFourn").''.$langs->trans('VAT').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('Qty').''.$langs->trans('Unit').''.$langs->trans('Unit').''.$langs->trans('ReductionShort').''.$langs->trans('ReductionShort').'' . $langs->trans('Progress') . '' . $langs->trans('Progress') . ''.$langs->trans('BuyingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('CostPrice').''.$langs->trans('CostPrice').''.$langs->trans('MarginRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarkRate').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShort').'
global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
trans('AddNewLine'); ?>trans("FreeZone"); ?>
trans('AskPriceSupplierRefFourn'); ?>trans('VAT'); ?>trans('PriceUHT'); ?>trans('VAT'); ?>trans('PriceUHT'); ?> trans('PriceUTTC'); ?>trans('PriceUTTC'); ?> trans('Qty'); ?>trans('Qty'); ?> '; + print ''; print ''; print $langs->trans('Unit'); print 'trans('ReductionShort'); ?>trans('ReductionShort'); ?> ' . $langs->trans('Progress') . '' . $langs->trans('Progress') . ' + global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); @@ -87,11 +87,11 @@ if (in_array($object->element,array('propal', 'askpricesupplier','facture','invo ?> '.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').'  
global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> element == 'askpricesupplier') { ?> - tva_assuj == "0") echo ''.vatrate(0, true); else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); ?> + "> + "> "> + "> '; + print ''; print $form->selectUnits($line->fk_unit, "units"); print 'remise_percent); ?>">%remise_percent); ?>">% + product->enabled) || ! empty($conf->service->enabled)) { ?> @@ -277,7 +277,7 @@ else { } } ?> - +
+
info_bits & 2) == 2) { ?> @@ -125,17 +125,17 @@ if (empty($usemargins)) $usemargins=0; ?>
ref_fourn; ?>ref_fourn; ?> tva_tx,'%',$line->info_bits); ?>tva_tx,'%',$line->info_bits); ?>subprice); ?>subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?>pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> + info_bits & 2) != 2) && $line->special_code != 3) { // I comment this because it shows info even when not required // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated @@ -148,7 +148,7 @@ if (empty($usemargins)) $usemargins=0; global->PRODUCT_USE_UNITS) { - print ''; + print ''; $label = $line->getLabelOfUnit('short'); if ($label !== '') { print $langs->trans($label); @@ -158,42 +158,42 @@ if (empty($usemargins)) $usemargins=0; ?> remise_percent) && $line->special_code != 3) { ?> - remise_percent,$langs); ?>    ' . $line->situation_percent . '%' . $line->situation_percent . '%pa_ht); ?>pa_ht); ?> pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?>pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> marque_tx, null, null, null, null, $rounding).'%'; ?>marque_tx, null, null, null, null, $rounding).'%'; ?> trans('Option'); ?>trans('Option'); ?> total_ht); ?>total_ht); ?> + info_bits & 2) == 2) { ?> id.'#line_'.$line->id; ?>"> @@ -202,7 +202,7 @@ if (empty($usemargins)) $usemargins=0; + situation_counter == 1 || !$this->situation_cycle_ref) { print 'id . '">'; @@ -213,7 +213,7 @@ if (empty($usemargins)) $usemargins=0; + 0) { ?> id; ?>"> @@ -226,7 +226,7 @@ if (empty($usemargins)) $usemargins=0; browser->phone)?' class="tdlineupdown"':''); ?>>browser->phone)?' class="linecolmove tdlineupdown"':' class="linecolmove"'); ?>>
'; + print ''; + print ''; + + if ($num) + { + $i = 0; + $var = true; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + $i++; + $total += $obj->total_ttc; + } + if ($total>0) + { + $var=!$var; + print '"; + } + } + print "
'.$langs->trans("DraftSuppliersOrders").' '.$num.'
'; + $supplierorderstatic->id=$obj->rowid; + $supplierorderstatic->ref=$obj->ref; + $supplierorderstatic->ref_supplier=$obj->ref_suppliert; + $supplierorderstatic->total_ht = $obj->total_ht; + $supplierorderstatic->total_tva = $obj->total_tva; + $supplierorderstatic->total_ttc = $obj->total_ttc; + print $supplierorderstatic->getNomUrl(1); + print ''; + $companystatic->id=$obj->socid; + $companystatic->name=$obj->name; + $companystatic->client=$obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1,'customer',16); + print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."

"; + + $db->free($resql); + } else { + dol_print_error($db); + } } From 506b251f24111e59981e60bb6c3fa14e24697830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 17:02:04 +0200 Subject: [PATCH 054/116] Update orders.lang --- htdocs/langs/en_US/orders.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index bd1bb09d40f..e1f84847e5d 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -105,6 +105,7 @@ ClassifyShipped=Classify delivered ClassifyBilled=Classify billed ComptaCard=Accountancy card DraftOrders=Draft orders +DraftSuppliersOrders=Draft suppliers orders RelatedOrders=Related orders RelatedCustomerOrders=Related customer orders RelatedSupplierOrders=Related supplier orders From 5237a2afc7bf155cbdc8a73bcaeefb90264084ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 17:45:24 +0200 Subject: [PATCH 055/116] Fix lost searchstatus on next page list --- htdocs/compta/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2f87ff09e8b..87b27ef8199 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -69,7 +69,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); -$search_status=GETPOST('search_status','alpha'); +$search_status=GETPOST('search_status','int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -270,6 +270,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; + if ($search_status > 0) $param.='&search_status='.$search_status; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png'); $i = 0; From 4062e7474ddde50e9ad1ebbbf77060a8453b7158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 18:05:21 +0200 Subject: [PATCH 056/116] Update index.php --- htdocs/comm/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 2c285903cbe..fcb94392405 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -146,7 +146,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''; - print ''; + print ''; if ($num > 0) { @@ -221,7 +221,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print '
'.$langs->trans("ProposalsDraft").' '.$num.'
'.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').'
'; print ''; - print ''; + print ''; if ($num) { @@ -297,7 +297,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande print '
'.$langs->trans("DraftOrders").' '.$num.'
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'; print ''; - print ''; + print ''; if ($num) { From 2989a9445843f86e92666ed15c4d587f94c8375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 18:19:32 +0200 Subject: [PATCH 057/116] Update index.php --- htdocs/comm/index.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index fcb94392405..49f618a4dd5 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -184,6 +184,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print '"; } } + else + { + print ''; + } print "
'.$langs->trans("DraftSuppliersOrders").' '.$num.'
'.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoProposal").'

"; $db->free($resql); @@ -259,6 +263,10 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print '
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoOrder").'

"; $db->free($resql); @@ -335,6 +343,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande print '
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoSupplierOrder").'

"; $db->free($resql); From be85943d133d2d2d1095cb0141c8be81df06cfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 18:21:28 +0200 Subject: [PATCH 058/116] Update orders.lang --- htdocs/langs/en_US/orders.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index e1f84847e5d..287a83afba3 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -79,6 +79,8 @@ OrdersOpened=Orders to process NoOpenedOrders=No open orders NoOtherOpenedOrders=No other open orders NoDraftOrders=No draft orders +NoOrder=No Order +NoSupplierOrder=No supplier order OtherOrders=Other orders LastOrders=Last %s customer orders LastCustomerOrders=Last %s customer orders From 15733f5ed09d8aa0d4637d7d78b745242aa05273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 18:23:30 +0200 Subject: [PATCH 059/116] Update propal.lang --- htdocs/langs/en_US/propal.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 168f98a2789..d12d7595f94 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -53,6 +53,7 @@ ListOfProposals=List of commercial proposals ActionsOnPropal=Events on proposal NoOpenedPropals=No open commercial proposals NoOtherOpenedPropals=No other open commercial proposals +NoPropal=No commercial proposal RefProposal=Commercial proposal ref SendPropalByMail=Send commercial proposal by mail AssociatedDocuments=Documents associated with the proposal: @@ -98,4 +99,4 @@ DocModelJauneDescription=Jaune proposal model DefaultModelPropalCreate=Default model creation DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced) DefaultModelPropalClosed=Default template when closing a business proposal (unbilled) -ProposalCustomerSignature=Written acceptance, company stamp, date and signature \ No newline at end of file +ProposalCustomerSignature=Written acceptance, company stamp, date and signature From 73f13045c13eab25a82b0f09bca3c00f81a2b100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 18:24:14 +0200 Subject: [PATCH 060/116] Update index.php --- htdocs/comm/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 49f618a4dd5..86f48d10817 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -127,6 +127,8 @@ if (count($listofsearchfields)) */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { + $langs->load("propal"); + $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; From 9a1ec900bdd4c4288fb024465b7f5ce5683b1d2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Oct 2015 00:31:32 +0200 Subject: [PATCH 061/116] NEW Add into about page, a sample text to use to promote new version release (visible only if version is last stable) --- htdocs/admin/system/about.php | 82 ++++++++++++++++++++++++++++++++++- htdocs/langs/en_US/admin.lang | 8 +++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 737e0712ea6..e9d3f96ad55 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -25,11 +25,15 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; $langs->load("admin"); $langs->load("help"); $langs->load("members"); +$youuselaststable = 0; + /* * View @@ -42,9 +46,54 @@ print load_fiche_titre("Dolibarr",'','title_setup'); print '
'.img_picto_common('', 'dolibarr_box.png','height="120"').'
'; + + +print '
'; + print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':'; print '
    '; -print '
  • '.DOL_VERSION.' / GNU-GPL v3+
  • '; +print '
  • '.DOL_VERSION.''; + +$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); +//var_dump($result['content']); +$sfurl = simplexml_load_string($result['content']); +if ($sfurl) +{ + $title=$sfurl->channel[0]->item[0]->title; + + function word_limiter($text, $limit = 30, $chars = '0123456789.') + { + if (strlen( $text ) > $limit) + { + $words = str_word_count($text, 2, $chars); + $words = array_reverse($words, TRUE); + foreach($words as $length => $word) { + if ($length + strlen( $word ) >= $limit) + { + array_shift($words); + } else { + break; + } + } + $words = array_reverse($words); + $text = implode(" ", $words) . ''; + } + return $text; + } + + $str = word_limiter($title); + $str = preg_replace('/[^0-9\.]/', '', $str); + print ' ('.$langs->trans("LastStableVersion").': '.$str.''; + if (DOL_VERSION == $str) + { + $youuselaststable=1; + print $langs->trans("YouUseLastStableVersion"); + } + print ')'; + print ' / GNU-GPL v3+
  • '; +} + + print '
'; //print "
\n"; @@ -114,6 +163,9 @@ print ''; print ''; +print '
'; + + print $langs->trans("HelpCenter").':'; print ''; +print '
'; +print '
'; +print '
'; + + +if ($youuselaststable) +{ + print '
'; + print '
'; + + $tmp=versiondolibarrarray(); + if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0)) + { + print $langs->trans("TitleExampleForMajorRelease").':
'; + print ''; + } + else + { + print $langs->trans("TitleExampleForMaintenanceRelease").':
'; + print ''; + } +} + llxFooter(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 46112d624ce..ed2eb3cdffa 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1693,4 +1693,10 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier MailToSendSupplierOrder=To send supplier order MailToSendSupplierInvoice=To send supplier invoice MailToThirdparty=To send email from thirdparty page -ByDefaultInList=Show by default on list view \ No newline at end of file +ByDefaultInList=Show by default on list view +YouUseLastStableVersion=You use the last stable version +TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) +TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites) +ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read
ChangeLog for complete list of changes. +ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so it contains only fixes of bugs. We recommend everybody using an older version to upgrade to this one. As any maintenance release, no new features, nor data structure change is present into this version. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes. + \ No newline at end of file From 4f519b57475ec7a88ffbdbaea61205d81040b8d8 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 21 Oct 2015 05:06:19 +0200 Subject: [PATCH 062/116] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 109 +++++----------------------------- 1 file changed, 15 insertions(+), 94 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 571e24bf38a..66823ab5d18 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -678,27 +678,7 @@ function activateModule($value,$withdeps=1) $modFile = $modName . ".class.php"; // Loop on each directory to fill $modulesdir - $modulesdir = array(); - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[] = $dirroot."/core/modules/"; - - $handle=@opendir(dol_osencode($dirroot)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } + $modulesdir = dolGetModulesDirs(); // Loop on each directory $found=false; @@ -797,27 +777,7 @@ function unActivateModule($value, $requiredby=1) $modFile = $modName . ".class.php"; // Loop on each directory to fill $modulesdir - $modulesdir = array(); - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[] = $dirroot."/core/modules/"; - - $handle=@opendir(dol_osencode($dirroot)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } + $modulesdir = dolGetModulesDirs(); // Loop on each directory $found=false; @@ -889,31 +849,11 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql $orders = array(); $categ = array(); $dirmod = array(); - $modulesdir = array(); + $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; - - $handle=@opendir($dirroot); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } - + $modulesdir = dolGetModulesDirs(); foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory @@ -955,13 +895,13 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql if ($modulequalified) { // Load languages files of module - if (isset($objMod->langfiles) && is_array($objMod->langfiles)) - { - foreach($objMod->langfiles as $langfile) - { - $langs->load($langfile); - } - } + if (isset($objMod->langfiles) && is_array($objMod->langfiles)) + { + foreach($objMod->langfiles as $langfile) + { + $langs->load($langfile); + } + } $modules[$i] = $objMod; $filename[$i]= $modName; @@ -1035,30 +975,11 @@ function complete_elementList_with_modules(&$elementList) $orders = array(); $categ = array(); $dirmod = array(); - $modulesdir = array(); + $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; - - $handle=@opendir($dirroot); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } + $modulesdir = dolGetModulesDirs(); foreach ($modulesdir as $dir) { @@ -1116,8 +1037,8 @@ function complete_elementList_with_modules(&$elementList) if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories else $categ[$objMod->special]=1; $dirmod[$i] = $dirroot; - - if (! empty($objMod->contactelement)) + $objMod->module_parts['contactelement'] + if (! empty($objMod->module_parts['contactelement'])) { $elementList[$objMod->name] = $langs->trans($objMod->name); //exit; From ec9955986ff25ae89611e4071ad0f6a3fcfc0033 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 21 Oct 2015 05:07:13 +0200 Subject: [PATCH 063/116] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 66823ab5d18..7edf33c89ee 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1037,7 +1037,6 @@ function complete_elementList_with_modules(&$elementList) if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories else $categ[$objMod->special]=1; $dirmod[$i] = $dirroot; - $objMod->module_parts['contactelement'] if (! empty($objMod->module_parts['contactelement'])) { $elementList[$objMod->name] = $langs->trans($objMod->name); From 88ca8d2ace84f336e61466a8091552e1179b1b29 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 21 Oct 2015 05:22:33 +0200 Subject: [PATCH 064/116] Update dict.php --- htdocs/admin/dict.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 6fb9454ce58..b90514fc61c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -34,6 +34,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/function2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load("errors"); From ef79bb3b6759c339916667e684f17676ec05a2c1 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 21 Oct 2015 05:23:49 +0200 Subject: [PATCH 065/116] Update dict.php --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b90514fc61c..889b2e8f4ce 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -34,7 +34,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/function2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load("errors"); From 4689b0cc11846010f43b29aeb64db4d298994c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2015 17:31:51 +0200 Subject: [PATCH 066/116] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 492663295b8..51602cafe1c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1571,6 +1571,7 @@ class CommandeFournisseur extends CommonOrder $result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user); if ($result < 0) { + $this->errors[]='ErrorWhenRunningTrigger'; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); return -1; } @@ -1583,6 +1584,8 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1593,12 +1596,14 @@ class CommandeFournisseur extends CommonOrder if ($this->db->affected_rows($resql) < 1) { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } } else { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1608,6 +1613,8 @@ class CommandeFournisseur extends CommonOrder $result=$this->deleteExtraFields(); if ($result < 0) { + $this->error='FailToDeleteExtraFields'; + $this->errors[]='FailToDeleteExtraFields'; $error++; dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } @@ -1615,7 +1622,11 @@ class CommandeFournisseur extends CommonOrder // Delete linked object $res = $this->deleteObjectLinked(); - if ($res < 0) $error++; + if ($res < 0) { + $this->error='FailToDeleteObjectLinked'; + $this->errors[]='FailToDeleteObjectLinked'; + $error++; + } if (! $error) { @@ -1630,6 +1641,7 @@ class CommandeFournisseur extends CommonOrder if (! dol_delete_file($file,0,0,0,$this)) // For triggers { $this->error='ErrorFailToDeleteFile'; + $this->errors[]='ErrorFailToDeleteFile'; $error++; } } @@ -1639,6 +1651,7 @@ class CommandeFournisseur extends CommonOrder if (! $res) { $this->error='ErrorFailToDeleteDir'; + $this->errors[]='ErrorFailToDeleteDir'; $error++; } } From fd72b4a400277b7e95d5b645de495c7a15256f7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Oct 2015 20:43:11 +0200 Subject: [PATCH 067/116] Work on the new selectArrayAjax widget --- htdocs/core/ajax/selectsearchbox.php | 63 +++++++++++++++++++++++++-- htdocs/core/class/html.form.class.php | 13 ++++-- htdocs/langs/en_US/main.lang | 6 ++- htdocs/main.inc.php | 2 +- 4 files changed, 75 insertions(+), 9 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 1783c4794b5..bbb00e2ce29 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -37,12 +37,69 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $search_boxvalue=GETPOST('q'); -$arrayresult=array('a'=>'aaaa', 'b'=>'bbbb'); +$arrayresult=array(); -if ($conf->projet->enabled) +// Define $searchform +if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { - $arrayresult['searchintoproject']=$langs->trans("SearchIntoProject", $search_boxvalue); + $langs->load("companies"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + $arrayresult['searchintothirdparty']=$langs->trans("SearchIntoThirdparties", $search_boxvalue); } + +if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) +{ + $langs->load("companies"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + $arrayresult['searchintocontact']=$langs->trans("SearchIntoContacts", $search_boxvalue); +} + +if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) +&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) +{ + $langs->load("products"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); + $arrayresult['searchintoproduct']=$langs->trans("SearchIntoProductsOrServices", $search_boxvalue); +} + +/*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) +&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) +{ + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); +}*/ + +if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) +{ + $langs->load("members"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + $arrayresult['searchintomember']=$langs->trans("SearchIntoMembers", $search_boxvalue); +} + +if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) +{ + $langs->load("projects"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + $arrayresult['searchintoprojects']=$langs->trans("SearchIntoProjects", $search_boxvalue); +} + +// Execute hook printSearchForm +$parameters=array(); +$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks +if (empty($reshook)) +{ + $searchform.=$hookmanager->resPrint; +} +else $searchform=$hookmanager->resPrint; + + + + + + + + + print json_encode($arrayresult); if (is_object($db)) $db->close(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1a63cbcca29..f51401c5a38 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4501,7 +4501,7 @@ class Form /** * Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL. - * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. + * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. * * @param string $htmlname Name of html select area * @param string $url Url @@ -4534,9 +4534,14 @@ class Form }; }, results: function (remoteData, pageNumber, query) { - console.log(remoteData); - return {results:[{id:\'none\', text:\'aa\'}, {id:\'rrr\', text:\'Red\'},{id:\'bbb\', text:\'Search a into projects\'}], more:false} - //return {results:[remoteData], more:false} + //console.log(remoteData); + result = [] + $.each( remoteData, function( key, value ) { + result.push({id: key, text: value}); + }); + //console.log(result); + //return {results:[{id:\'none\', text:\'aa\'}, {id:\'rrr\', text:\'Red\'},{id:\'bbb\', text:\'Search a into projects\'}], more:false} + return {results: result, more:false} }, /*processResults: function (data, page) { // parse the results into the format expected by Select2. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7e1dc3ee929..b8c6735be80 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -752,4 +752,8 @@ ShortSaturday=S ShortSunday=S SelectMailModel=Select email template SetRef=Set ref -SearchIntoProject=Search %s into projects \ No newline at end of file +SearchIntoThirdparties=Search %s into thirdparties +SearchIntoContacts=Search %s into contacts +SearchIntoMembers=Search %s into members +SearchIntoProductsOrServices=Search %s into products or services +SearchIntoProjects=Search %s into projects \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7e7a057e71b..f563961ba29 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1606,7 +1606,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) { - $langs->load("members"); + $langs->load("projects"); $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); } From 7daf9d10afd92572207fcafb80510b8e21ffbff9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Oct 2015 20:50:27 +0200 Subject: [PATCH 068/116] Work on the new selectArrayAjax widget --- 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 f51401c5a38..7b472b2a163 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4562,7 +4562,8 @@ class Form $(".'.$htmlname.'").change(function() { alert(\'eee\'); - $(".'.$htmlname.'").select2.clearSearch(); + /* $(".'.$htmlname.'").select2("search",""); */ + $(".'.$htmlname.'").select2("val",""); /* reset combo box */ } ); From 474692e71a4300d44001fb4a4f6a6ba1820728b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 01:10:25 +0200 Subject: [PATCH 069/116] Remove duplicate page fourn/list.php --- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 6 +- htdocs/fourn/list.php | 333 ------------------------ htdocs/index.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 146 +++++++---- htdocs/theme/eldy/style.css.php | 5 +- 7 files changed, 104 insertions(+), 392 deletions(-) delete mode 100644 htdocs/fourn/list.php diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 8d3464464b2..ffcb21e6535 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -69,7 +69,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/soc.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/fourn/list.php?leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/soc.php?leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/prospect/list.php?leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/soc.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e4949b1d973..42701456c6e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -616,10 +616,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled)) { $langs->load("suppliers"); - $newmenu->add("/fourn/list.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire); - //$newmenu->add("/fourn/list.php?leftmenu=suppliers", $langs->trans("List"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire); - //$newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire); } // Contacts @@ -1146,7 +1144,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Security check $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire); - $newmenu->add("/fourn/list.php",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); + $newmenu->add("/societe/list.php?type=f",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); $newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire); $newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); } diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php deleted file mode 100644 index 8fb33850919..00000000000 --- a/htdocs/fourn/list.php +++ /dev/null @@ -1,333 +0,0 @@ - - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2015 Florian Henry - * - * 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 . - */ - -/** - * \file htdocs/fourn/list.php - * \ingroup fournisseur - * \brief Home page of supplier area - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - -$langs->load("suppliers"); -$langs->load("orders"); -$langs->load("companies"); - -$socname = GETPOST("socname"); -$search_name = GETPOST("search_name"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_supplier_code = GETPOST("search_supplier_code"); -$search_supplier_accounting = GETPOST("search_supplier_accounting"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST('search_categ','int'); -$search_status = GETPOST("search_status",'int'); -$catid = GETPOST("catid",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); -$optioncss = GETPOST('optioncss','alpha'); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user,'societe',$socid,''); - -$page = GETPOST('page','int'); -$sortorder = GETPOST('sortorder','alpha'); -$sortfield = GETPOST('sortfield','alpha'); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="nom"; - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('supplierlist')); -$extrafields = new ExtraFields($db); - -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $socname=""; - $search_name=""; - $search_zipcode=""; - $search_town=""; - $search_supplier_code=""; - $search_supplier_accounting=""; - $search_datec=""; - $search_categ=""; - $search_status=''; - $catid=""; - $search_country=""; - $search_type_thirdparty=""; -} - -if ($search_status=='') $search_status=1; // always display activ customer first - -$extrafields->fetch_name_optionals_label('thirdparty'); - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - -/* - * View - */ - -$form=new Form($db); -$htmlother=new FormOther($db); -$thirdpartystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - -$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, "; -$sql.= "code_fournisseur, code_compta_fournisseur"; -$sql.= ",s.fk_pays"; -$sql.= ",typent.code as typent_code"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; -// Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cf ON s.rowid = cf.fk_soc"; // We need this table joined to the select in order to filter by categ -$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur = 1"; -$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql .= " AND s.rowid = ".$socid; -if ($socname) { - $sql .= natural_search('s.nom', $socname); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -if ($search_name) $sql .= natural_search(array('s.nom', 's.name_alias'), $search_name); -if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; -if ($search_town) $sql .= natural_search('s.town', $search_town); -if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'"; -if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'"; -if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; -if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status); -if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL"; -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; - -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} -$sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($conf->liste_limit+1, $offset); -//print $sql; - -dol_syslog('fourn/list.php:', LOG_DEBUG); -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - - $param = "&search_name=".htmlspecialchars($search_name); - $param.="&search_supplier_code=".htmlspecialchars($search_supplier_code); - $param.="&search_zipcode=".htmlspecialchars($search_zipcode); - $param.="&search_town=".htmlspecialchars($search_town); - if ($search_categ != '') $param.='&search_categ='.htmlspecialchars($search_categ); - if ($search_status != '') $param.='&search_status='.htmlspecialchars($search_status); - if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies'); - - print '
'."\n"; - if ($optioncss != '') print ''; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1); - $moreforfilter.='
'; - } - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print ''; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,'valign="middle"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="right"',$sortfield,$sortorder); - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print '\n"; - - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - $thirdpartystatic->id=$obj->socid; - $thirdpartystatic->name=$obj->name; - $thirdpartystatic->status=$obj->status; - $thirdpartystatic->name_alias=$obj->name_alias; - - print ""; - print '\n"; - print ''."\n"; - print ''."\n"; - //Country - print ''; - //Type ent - print ''; - print ''; - print ''; - print ''; - - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - print "
'; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print "
'; - print $thirdpartystatic->getNomUrl(1,'supplier'); - print "'.$obj->zip.''.$obj->town.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.$obj->code_fournisseur.' '.$obj->code_compta_fournisseur.' '.dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3).'
\n"; - print "
\n"; - $db->free($resql); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -} -else -{ - dol_print_error($db); -} - -$db->close(); - -llxFooter(); diff --git a/htdocs/index.php b/htdocs/index.php index ef87f437084..2e1d019d2e7 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -233,7 +233,7 @@ if (empty($user->societe_id)) // Dashboard Link lines $links=array(DOL_URL_ROOT.'/comm/list.php', DOL_URL_ROOT.'/comm/prospect/list.php', - DOL_URL_ROOT.'/fourn/list.php', + DOL_URL_ROOT.'/societe/list.php?type=f', DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members', DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products', DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index d27d6891119..86de804c6a1 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -155,7 +155,7 @@ else if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; - $statstring2.= ''.$langs->trans("Suppliers").''.round($third['supplier']).''; + $statstring2.= ''.$langs->trans("Suppliers").''.round($third['supplier']).''; $statstring2.= ""; } print $statstring; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index f251274b3ad..19301efd6e0 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -57,13 +57,15 @@ $search_idprof3=trim(GETPOST('search_idprof3')); $search_idprof4=trim(GETPOST('search_idprof4')); $search_idprof5=trim(GETPOST('search_idprof5')); $search_idprof6=trim(GETPOST('search_idprof6')); -$search_sale=trim(GETPOST("search_sale")); -$search_categ=trim(GETPOST("search_categ")); +$search_sale=trim(GETPOST("search_sale",'int')); +$search_categ=trim(GETPOST("search_categ",'int')); $search_type=trim(GETPOST('search_type')); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); +$search_type=GETPOST('search_type','alpha'); $search_status=GETPOST("search_status",'int'); +$type=GETPOST('type'); $optioncss=GETPOST('optioncss','alpha'); $mode=GETPOST("mode"); @@ -79,6 +81,15 @@ $pagenext = $page + 1; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $contextpage='thirdpartylist'; +/*if ($search_type == '1,3') { $contextpage='customerlist'; $type='c'; } +if ($search_type == '2,3') { $contextpage='prospectlist'; $type='p'; } +if ($search_type == '4') { $contextpage='supplierlist'; $type='f'; } +*/ +if ($type == 'c') { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; } +if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; } +if ($type == 'f') { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; } + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); @@ -109,10 +120,14 @@ if (!empty($conf->barcode->enabled)) $fieldstosearchall['s.barcode']='Gencod'; * Actions */ +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // special search -if ($mode == 'search') +/*if ($mode == 'search') { $sql = "SELECT s.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -159,7 +174,7 @@ if ($mode == 'search') $db->free($result); } } - +*/ /* @@ -167,7 +182,7 @@ if ($mode == 'search') */ $form=new Form($db); -$htmlother=new FormOther($db); +$formother=new FormOther($db); $companystatic=new Societe($db); $formcompany=new FormCompany($db); @@ -216,6 +231,9 @@ if ($search_status=='') $search_status=1; // always display active thirdparty fi External user socid=x + No permission to see ALL customers => Can see only himself */ $title=$langs->trans("ListOfThirdParties"); +if ($type == 'c' && (empty($search_type) || ($search_type == '1,3'))) $title=$langs->trans("ListOfCustomers"); +if ($type == 'p' && (empty($search_type) || ($search_type == '2,3'))) $title=$langs->trans("ListOfProspects"); +if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) $title=$langs->trans("ListOfSuppliers"); $sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; $sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; @@ -308,29 +326,35 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $param = "&sall=".urlencode($sall); - $param.= "&search_nom=".urlencode($search_nom); - $param.= "&search_town=".urlencode($search_town); - $param.= "&search_zip=".urlencode($search_zip); - $param.= "&search_customer_code=".urlencode($search_customer_code); - $param.= "&search_supplier_code=".urlencode($search_supplier_code); - $param.= "&search_account_customer_code=".urlencode($search_account_customer_code); - $param.= "&search_account_supplier_code=".urlencode($search_account_supplier_code); - $param.= ($search_barcode?"&sbarcode=".urlencode($search_barcode):""); - $param.= '&search_idprof1='.urlencode($search_idprof1); - $param.= '&search_idprof2='.urlencode($search_idprof2); - $param.= '&search_idprof3='.urlencode($search_idprof3); - $param.= '&search_idprof4='.urlencode($search_idprof4); + if ($sall != '') $param = "&sall=".urlencode($sall); + if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ); + if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); + if ($search_nom != '') $param.= "&search_nom=".urlencode($search_nom); + if ($search_town != '') $param.= "&search_town=".urlencode($search_town); + if ($search_zip != '') $param.= "&search_zip=".urlencode($search_zip); + if ($search_country != '') $param.= "&search_country=".urlencode($search_country); + if ($search_customer_code != '') $param.= "&search_customer_code=".urlencode($search_customer_code); + if ($search_supplier_code != '') $param.= "&search_supplier_code=".urlencode($search_supplier_code); + if ($search_account_customer_code != '') $param.= "&search_account_customer_code=".urlencode($search_account_customer_code); + if ($search_account_supplier_code != '') $param.= "&search_account_supplier_code=".urlencode($search_account_supplier_code); + if ($search_barcode != '') $param.= "&sbarcode=".urlencode($search_barcode); + if ($search_idprof1 != '') $param.= '&search_idprof1='.urlencode($search_idprof1); + if ($search_idprof2 != '') $param.= '&search_idprof2='.urlencode($search_idprof2); + if ($search_idprof3 != '') $param.= '&search_idprof3='.urlencode($search_idprof3); + if ($search_idprof4 != '') $param.= '&search_idprof4='.urlencode($search_idprof4); + if ($search_idprof5 != '') $param.= '&search_idprof5='.urlencode($search_idprof5); + if ($search_idprof6 != '') $param.= '&search_idprof6='.urlencode($search_idprof6); if ($search_country != '') $param.='&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_status != '') $params.='&search_status='.urlencode($search_status); + if ($search_status != '') $param.='&search_status='.urlencode($search_status); + if ($type != '') $param.='&type='.urlencode($type); // Add $param from extra fields foreach ($search_array_options as $key => $val) { $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); - $param.='&search_options_'.$tmpkey.'='.urlencode($val); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies'); @@ -368,39 +392,59 @@ if ($resql) } // Filter on categories - /* Not possible in this page because list is for ALL third parties type $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categories::TYPE_CUSTOMER,$search_categ,'search_categ'); - $moreforfilter.='
'; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$htmlother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='
'; - } - */ + if ($type == 'c' || $type == 'p') + { + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1); + $moreforfilter.='
'; + } + // If the user can view prospects other than his' + if ($user->rights->societe->client->voir || $socid) + { + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); + $moreforfilter.='
'; + } + } + if ($type == 'f') + { + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$formother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1); + $moreforfilter.='
'; + } + } if (! empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters=array(); + $parameters=array('type'=>$type); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; } // Define list of fields to show into list - $checkedcustomercode=1; - $checkedsuppliercode=1; - $checkedcustomeraccountcode=0; - $checkedsupplieraccountcode=0; + $checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); + $checkedsuppliercode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); + $checkedcustomeraccountcode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); + $checkedsupplieraccountcode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); + $checkedtypetiers=1; + $checkedprofid4=0; + $checkedprofid5=0; + $checkedprofid6=0; + //$checkedprofid4=((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0); + //$checkedprofid5=((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0); + //$checkedprofid6=((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0); $arrayfields=array( 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), @@ -411,19 +455,19 @@ if ($resql) 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>1), + 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>1), 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>1), 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>1), - 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0)), - 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0)), - 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0)), + 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4), + 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5), + 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>200), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), ); $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print ''; print ''; @@ -459,7 +503,7 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); @@ -596,7 +640,7 @@ if ($resql) if (! empty($arrayfields['s.status']['checked'])) { // Status - print ''; } @@ -614,6 +658,7 @@ if ($resql) } // Action column print ''; @@ -744,7 +789,7 @@ if ($resql) // Status if (! empty($arrayfields['s.status']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['s.datec']['checked'])) { @@ -786,4 +831,3 @@ else llxFooter(); $db->close(); - diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index cbdaf1afc10..45ca3a5b728 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1146,7 +1146,10 @@ div.vmenu, td.vmenu { } -.menu_contenu { padding-top: 3px; padding-top: 2px; } +.menu_contenu { + padding-top: 3px; + padding-bottom: 2px; +} #menu_contenu_logo { padding-right: 4px; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; } From 4453ba53fde29d09fbb3f3bf108d450c2fda8530 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 10:28:59 +0200 Subject: [PATCH 070/116] Fix migration error --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 8 ++++---- htdocs/install/mysql/tables/llx_ecm_directories.key.sql | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 33593e7fac5..d6378a06c6d 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -69,7 +69,7 @@ ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128); ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30); -ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(1000); +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750); CREATE TABLE llx_ecm_files ( @@ -77,8 +77,8 @@ CREATE TABLE llx_ecm_files label varchar(64) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id filename varchar(255) NOT NULL, -- file name only without any directory - fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile - fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer + fullpath varchar(750) NOT NULL, -- relative to dolibarr document dir. example abc/def/myfile. restricted to 750 because of unique key index on it. + fullpath_orig varchar(2048), -- full path of original filename, when file is uploaded from a local computer description text, keywords text, -- list of keywords, separated with comma cover text, -- is this file a file to use for a cover @@ -90,8 +90,8 @@ CREATE TABLE llx_ecm_files acl text -- for future permission 'per file' ) ENGINE=innodb; -ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(1000); +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql index 2da97ec974f..d11985e3be5 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql @@ -19,6 +19,7 @@ ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX idx_ecm_directories (label, fk_parent, entity); +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_c (fk_user_c); ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_m (fk_user_m); From 40adaf716d192607ab1843b9c2802415c02ac75f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 10:33:42 +0200 Subject: [PATCH 071/116] Uniformize index names --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 8 ++++++-- htdocs/install/mysql/tables/llx_ecm_files.key.sql | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d6378a06c6d..b97c9a99fe9 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -71,6 +71,11 @@ ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30); ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750); +ALTER TABLE llx_ecm_directories DROP INDEX idx_ecm_directories; +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories (label, fk_parent, entity); +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); + + CREATE TABLE llx_ecm_files ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -90,8 +95,7 @@ CREATE TABLE llx_ecm_files acl text -- for future permission 'per file' ) ENGINE=innodb; - -ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); +ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); diff --git a/htdocs/install/mysql/tables/llx_ecm_files.key.sql b/htdocs/install/mysql/tables/llx_ecm_files.key.sql index b689bf0b0fb..81cc769d6cd 100644 --- a/htdocs/install/mysql/tables/llx_ecm_files.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_files.key.sql @@ -17,4 +17,5 @@ -- ============================================================================ +ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); From 9cbb9129c2c253d124b28080d24591426e83cebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 12:29:24 +0200 Subject: [PATCH 072/116] FIX #3772 --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 4 ++-- htdocs/install/mysql/tables/llx_ecm_directories.key.sql | 4 ++-- htdocs/install/mysql/tables/llx_ecm_files.key.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index b97c9a99fe9..9bc9d7b8677 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -73,7 +73,7 @@ ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750); ALTER TABLE llx_ecm_directories DROP INDEX idx_ecm_directories; ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories (label, fk_parent, entity); -ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); +--ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); CREATE TABLE llx_ecm_files @@ -96,7 +96,7 @@ CREATE TABLE llx_ecm_files ) ENGINE=innodb; ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); -ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); +--ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql index d11985e3be5..2e96a5f8e95 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.key.sql @@ -18,8 +18,8 @@ -- ============================================================================ -ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX idx_ecm_directories (label, fk_parent, entity); -ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); +ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories (label, fk_parent, entity); +--ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX uk_ecm_directories_fullpath(fullpath); Disabled, mysql limits size of index ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_c (fk_user_c); ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_m (fk_user_m); diff --git a/htdocs/install/mysql/tables/llx_ecm_files.key.sql b/htdocs/install/mysql/tables/llx_ecm_files.key.sql index 81cc769d6cd..9b1f4fcf164 100644 --- a/htdocs/install/mysql/tables/llx_ecm_files.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_files.key.sql @@ -18,4 +18,4 @@ ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); -ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); +--ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath); Disabled, mysql limits size of index From 2615e02e1ee2318f42f38a703116a9bc091abe92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 13:18:51 +0200 Subject: [PATCH 073/116] Update doc --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 0e7f74b32f7..4cfc077f0be 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -74,7 +74,7 @@ function dol_decode($chain) * If constant MAIN_SECURITY_SALT is defined, we use it as a salt. * * @param string $chain String to hash - * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5) + * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0. * @return string Hash of string */ function dol_hash($chain,$type=0) From 77c43ebb26f279a1ad49e1b85269b57e940de215 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 14:05:16 +0200 Subject: [PATCH 074/116] FIX #3558 --- htdocs/main.inc.php | 2 +- htdocs/user/class/user.class.php | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f563961ba29..3a573b23f4d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -515,7 +515,7 @@ if (! defined('NOLOGIN')) exit; } - $resultFetchUser=$user->fetch('',$login); + $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1); if ($resultFetchUser <= 0) { dol_syslog('User not found, connexion refused'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index afdc1fdaecd..fdc3b8577cd 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -146,9 +146,10 @@ class User extends CommonObject * @param string $login Si defini, login a utiliser pour recherche * @param string $sid Si defini, sid a utiliser pour recherche * @param int $loadpersonalconf Also load personal conf of user (in $user->conf->xxx) + * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. * @return int <0 if KO, 0 not found, >0 if OK */ - function fetch($id='', $login='',$sid='',$loadpersonalconf=1) + function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1) { global $conf, $user; @@ -177,15 +178,22 @@ class User extends CommonObject $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - if ((empty($conf->multicompany->enabled) || empty($conf->multicompany->transverse_mode)) && (! empty($user->entity))) + if ($entity < 0) { - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + if ((empty($conf->multicompany->enabled) || empty($conf->multicompany->transverse_mode)) && (! empty($user->entity))) + { + $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + } + else + { + $sql.= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database + } } - else + else // The fetch was forced on an entity { - $sql.= " WHERE u.entity IS NOT NULL"; + $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; } - + if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba { $sql.= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; From 56ef1c7338306ae3e1c6262312be9c86e6dbe1d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 17:05:28 +0200 Subject: [PATCH 075/116] Fix missing ) --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3a573b23f4d..3df62aadcb5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -515,7 +515,7 @@ if (! defined('NOLOGIN')) exit; } - $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1); + $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1)); if ($resultFetchUser <= 0) { dol_syslog('User not found, connexion refused'); From 9f21ea58a374571e31f226f10430d609172960b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 17:51:05 +0200 Subject: [PATCH 076/116] A lot hooks used into PDF generation were not correctly implemented. We had to fix this. The result si that the following hook were set as hook of type "replace". This means if your module implement such hooks, it must return 0 to execute standard code or 1 to replace standard code (value to output should be set into resPrints instead). --- ChangeLog | 8 + htdocs/core/class/hookmanager.class.php | 15 + htdocs/core/lib/pdf.lib.php | 384 +++++++++++++----------- 3 files changed, 226 insertions(+), 181 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57d217f8a38..4cf2322adbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,14 @@ Following changes may create regression for some external modules, but were nece Dolibarr better: - Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use table llx_overwrite_trans instead. - Trigger LINECONTRACT_INSERT has been renamed into LINECONTRACT_CREATE to match common denomination. +- A lot hooks used into PDF generation were not correctly implemented. We had to fix this. The result si that +the following hook were set as hook of type "replace". This means if your module implement such hooks, it must +return 0 to execute standard code or 1 to replace standard code (value to output should be set into resPrints instead). +This is list of hooks modified: +'pdf_getlinenum', 'pdf_getlineref', 'pdf_getlineref_supplier', 'pdf_getlinevatrate', 'pdf_getlineupexcltax', +'pdf_getlineupwithtax', 'pdf_getlineqty', 'pdf_getlineqty_asked', 'pdf_getlineqty_shipped', 'pdf_getlineqty_keeptoship', +'pdf_getlineunit', 'pdf_getlineremisepercent', 'pdf_getlineprogress', 'pdf_getlinetotalexcltax', 'pdf_getlinetotalwithtax' + ***** ChangeLog for 3.8.1 compared to 3.8.0 ***** diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index a497b3cb7e2..249a6665a3f 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -144,6 +144,21 @@ class HookManager 'formBuilddocLineOptions', 'moveUploadedFile', 'pdf_writelinedesc', + 'pdf_getlinenum', + 'pdf_getlineref', + 'pdf_getlineref_supplier', + 'pdf_getlinevatrate', + 'pdf_getlineupexcltax', + 'pdf_getlineupwithtax', + 'pdf_getlineqty', + 'pdf_getlineqty_asked', + 'pdf_getlineqty_shipped', + 'pdf_getlineqty_keeptoship', + 'pdf_getlineunit', + 'pdf_getlineremisepercent', + 'pdf_getlineprogress', + 'pdf_getlinetotalexcltax', + 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', 'printSearchForm', diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index fc3c61fabdd..0d7f18e1c75 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1032,20 +1032,23 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al * @param int $hideref Hide reference * @param int $hidedesc Hide description * @param int $issupplierline Is it a line for a supplier object ? - * @return string|null + * @return string */ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0) { global $db, $conf, $langs, $hookmanager; $reshook=0; - if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code); $action=''; $reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } if (empty($reshook)) { @@ -1054,6 +1057,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide $pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1, false, true, 'J',true); return $labelproductservice; } + return ''; } /** @@ -1250,22 +1254,25 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->num); } + return ''; } @@ -1276,22 +1283,25 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->product_ref); } + return ''; } /** @@ -1301,22 +1311,25 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return null|string + * @return string */ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); // TODO add hook function } - else + if (empty($reshook)) { return dol_htmlentitiesbr($object->lines[$i]->ref_supplier); } + return ''; } /** @@ -1332,7 +1345,9 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1340,13 +1355,13 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) $action=''; $reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); } + return ''; } /** @@ -1365,7 +1380,9 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) $sign=1; if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1373,13 +1390,13 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) $action=''; $reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; + if (!empty($hookmanager->resPrint)) print $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->subprice, 0, $outputlangs); } + return ''; } /** @@ -1389,25 +1406,29 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) - * @return void + * @return string */ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - foreach($object->hooks as $modules) - { - if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails); - } + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineupwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) print $hookmanager->resPrint; } - else + if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); } + return ''; } /** @@ -1423,25 +1444,25 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty; + } + return ''; } /** @@ -1457,24 +1478,24 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_asked; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_asked; + } + return ''; } /** @@ -1490,24 +1511,24 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_shipped; - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->qty_shipped; + } + return ''; } /** @@ -1517,30 +1538,30 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return void + * @return string */ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && (( $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return ($object->lines[$i]->qty_asked - $object->lines[$i]->qty_shipped); - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return ($object->lines[$i]->qty_asked - $object->lines[$i]->qty_shipped); + } + return ''; } /** @@ -1556,31 +1577,32 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false) { global $langs; - if ($object->lines[$i]->special_code != 3) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) { - $special_code = $object->lines[$i]->special_code; - if (!empty($object->lines[$i]->fk_parent_line)) { - $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - } - $parameters = array( - 'i' => $i, - 'outputlangs' => $outputlangs, - 'hidedetails' => $hidedetails, - 'special_code' => $special_code - ); - $action = ''; - $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - - } else { - if (empty($hidedetails) || $hidedetails > 1) { - return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); - } + + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + { + $special_code = $object->lines[$i]->special_code; + if (!empty($object->lines[$i]->fk_parent_line)) { + $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); } + $parameters = array( + 'i' => $i, + 'outputlangs' => $outputlangs, + 'hidedetails' => $hidedetails, + 'special_code' => $special_code + ); + $action = ''; + $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); + } + return ''; } @@ -1599,24 +1621,24 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if ($object->lines[$i]->special_code != 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return dol_print_reduction($object->lines[$i]->remise_percent,$outputlangs); - } + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return dol_print_reduction($object->lines[$i]->remise_percent,$outputlangs); + } + return ''; } /** @@ -1627,24 +1649,28 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param HookManager $hookmanager Hook manager instance - * @return void + * @return string */ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) { - if ($object->lines[$i]->special_code != 3) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) { - $special_code = $object->lines[$i]->special_code; - if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); - $action = ''; - $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } else { - if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; - } + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + { + $special_code = $object->lines[$i]->special_code; + if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); + $action = ''; + $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } + if (empty($reshook)) + { + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; + } + return ''; } /** @@ -1663,27 +1689,25 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0) $sign=1; if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; - if ($object->lines[$i]->special_code == 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - return $outputlangs->transnoentities("Option"); + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code, 'sign'=>$sign); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->total_ht, 0, $outputlangs); - } + if ($object->lines[$i]->special_code == 3) + { + return $outputlangs->transnoentities("Option"); + } + if (empty($hidedetails) || $hidedetails > 1) return price($sign * $object->lines[$i]->total_ht, 0, $outputlangs); } return ''; } @@ -1701,27 +1725,25 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0) { global $hookmanager; - if ($object->lines[$i]->special_code == 3) + $reshook=0; + //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) ) + if (is_object($hookmanager)) // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run { - return $outputlangs->transnoentities("Option"); + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; } - else + if (empty($reshook)) { - if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line))) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - - if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; - else return $reshook; - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); - } + if ($object->lines[$i]->special_code == 3) + { + return $outputlangs->transnoentities("Option"); + } + if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs); } return ''; } From 531ef43a27e00bcd484fa9d8fa8f2fb8affe1506 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 19:13:16 +0200 Subject: [PATCH 077/116] Some minor look fixes. --- htdocs/contrat/list.php | 7 ++++--- htdocs/core/class/html.formfile.class.php | 22 ++++++++++++---------- htdocs/expedition/card.php | 14 ++++++++------ htdocs/langs/en_US/products.lang | 3 ++- htdocs/product/document.php | 19 ++++++++++++------- htdocs/societe/price.php | 13 +++++++------ 6 files changed, 45 insertions(+), 33 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 07d3aa9e1c5..3751906d9fe 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -246,7 +246,7 @@ if ($resql) print ''; print ''; print ''; print ''; //print ''; @@ -292,9 +292,10 @@ if ($resql) $userstatic->id=$val['id']; $userstatic->lastname=$val['lastname']; $userstatic->firstname=$val['firstname']; - print $userstatic->getNomUrl(1); + print '
'.$userstatic->getNomUrl(1); $j++; - if ($j < $nbofsalesrepresentative) print '
'; + if ($j < $nbofsalesrepresentative) print ', '; + print '
'; } } else print $langs->trans("NoSalesRepresentativeAffected"); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 000a2a35c13..230ffa99504 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -176,22 +176,24 @@ class FormFile $out .= ''; $out .= ''; - $out .= '
'; + print ''; print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; + if ($type != '') print ''; print ''; print ''; print ''.$companystatic->getLibStatut(5).''.$companystatic->getLibStatut(3).''; - print ''; + print ''; print '  
'; - $out .= ''; - $out .= ''; - $out .= '
'; - $out .= $langs->trans("URLToLink") . ': '; + $out .= '
'; + $out .= '
'; + $out .= ': '; $out .= ''; - $out .= '   ' . $langs->trans("Label") . ': '; + $out .= '
'; + $out .= '
'; + $out .= ': '; $out .= ''; $out .= ''; $out .= ''; - $out .= ' '; + $out .= '
'; + $out .= '
'; $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; - $out .= '
'; - + $out .= ''; + $out .= ''; + $out .= '
'; $out .= '
'; $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); @@ -492,7 +494,7 @@ class FormFile $out.= ''; $out.= ''; - $out.= '
'.$titletoshow.'
'; + $out.= load_fiche_titre($titletoshow, '', ''); $out.= ''; $out.= ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 91c570a39a7..3ca2c18bf6c 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -520,7 +520,7 @@ if ($action == 'create') dol_fiche_head(''); - print '
'; + print '
'; // Ref print ''; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index fd41c276bf2..e5f89779225 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -447,8 +447,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); - if (count($prodcustprice->lines) > 0) { - print ''; print ''; @@ -467,6 +465,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; + if (count($prodcustprice->lines) > 0) { + print ''; print ''; print ''; @@ -522,13 +522,14 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n"; } + } else { + print ''; + } + print "
'; @@ -662,6 +662,8 @@ if ($action == 'create') print '
'; + + print ''; @@ -1533,9 +1535,9 @@ else if ($id || $ref) */ if ($action != 'presend') { - print '
'; - - $objectref = dol_sanitizeFileName($object->ref); + print '
'; + + $objectref = dol_sanitizeFileName($object->ref); $filedir = $conf->expedition->dir_output . "/sending/" .$objectref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; @@ -1552,14 +1554,14 @@ else if ($id || $ref) //$linktoelem = $form->showLinkToObjectBlock($object); //if ($linktoelem) print '
'.$linktoelem; - print '
'; + print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'shipping',$socid); - print '
'; + print ''; } /* diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 6dcf4ce60f9..e108dfff52b 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -105,6 +105,7 @@ AddPhoto=Add photo ListOfStockMovements=List of stock movements BuyingPrice=Buying price PriceForEachProduct=Products with specific prices +NoPriceSpecificToCustomer=This customer has no specific prices. All standard prices for products/services will be used. SupplierCard=Supplier card CommercialCard=Commercial card AllWays=Path to find your product in stock @@ -298,6 +299,6 @@ LastUpdated=Last updated CorrectlyUpdated=Correctly updated PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is PropalMergePdfProductChooseFile=Select PDF files -IncludingProductWithTag=Including product with tag +IncludingProductWithTag=Including product/service with tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer WarningSelectOneDocument=Please select at least one document diff --git a/htdocs/product/document.php b/htdocs/product/document.php index cb174e5847e..df1afe1db93 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -216,7 +216,7 @@ if ($object->id) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - // Merge propal PDF docuemnt PDF files + // Merge propal PDF document PDF files if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); @@ -233,7 +233,8 @@ if ($object->id) $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); // For each file build select list with PDF extention - if (count($filearray) > 0) { + if (count($filearray) > 0) + { print '
'; // Actual file to merge is : if (count($filetomerge->lines) > 0) { @@ -315,19 +316,23 @@ if ($object->id) $checked = ''; $filename = $filetoadd['name']; - if ($conf->global->MAIN_MULTILANGS) { - if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) { + if ($conf->global->MAIN_MULTILANGS) + { + if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) + { $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang); $checked = ' checked '; } - } else { - if (array_key_exists($filetoadd['name'], $filetomerge->lines)) { + } + else + { + if (array_key_exists($filetoadd['name'], $filetomerge->lines)) + { $checked = ' checked '; } } print '
'; - print '' . $filename . ''; print '
 
 
'.$langs->trans('NoPriceSpecificToCustomer').'
"; print ""; - } else { - print $langs->trans('None'); - } - + /* ************************************************************************** */ /* */ /* Barre d'action */ From 1000fd1b2150bd5a74fb63042debc94bbc423ba3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 19:43:50 +0200 Subject: [PATCH 078/116] Add field employee for hr module --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_user.sql | 1 + 2 files changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 670177d1e55..775a67b27fa 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -100,3 +100,7 @@ ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity); ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; + + +ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1; + diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index a11b0ec6b50..47bbedb1fef 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -74,6 +74,7 @@ create table llx_user nb_holiday integer DEFAULT 0, thm double(24,8), tjm double(24,8), + employee tinyint DEFAULT 1, -- 1 if user is an employee salary double(24,8), salaryextra double(24,8), weeklyhours double(16,8) From 90a221ef6de9d0f1dcd374f1df5f281f322a20d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2015 19:46:30 +0200 Subject: [PATCH 079/116] Fix version of module --- htdocs/core/modules/modHRM.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 16a0edd0c04..1e82db5dfc4 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -23,8 +23,7 @@ include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"); /** - * \class modHRM - * \brief Class to describe and activate the HRM module + * Class to describe and activate the HRM module */ class modHRM extends DolibarrModules { @@ -49,7 +48,7 @@ class modHRM extends DolibarrModules $this->description = "Gestion des ressources humaines"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'develop'; + $this->version = 'development'; $this->const_name = 'MAIN_MODULE_' . strtoupper ( $this->name ); $this->special = 0; From 3767ab437e6ba5cc126977ac5419ef818c4b5819 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Fri, 23 Oct 2015 12:58:30 +0200 Subject: [PATCH 080/116] [Qual] Uniformize code --- htdocs/accountancy/bookkeeping/card.php | 26 +++++----- htdocs/accountancy/bookkeeping/list.php | 4 +- htdocs/accountancy/customer/card.php | 2 +- htdocs/accountancy/customer/index.php | 4 +- htdocs/accountancy/customer/lines.php | 6 +-- htdocs/accountancy/journal/bankjournal.php | 6 +-- .../accountancy/journal/purchasesjournal.php | 8 +-- htdocs/accountancy/journal/sellsjournal.php | 8 +-- htdocs/accountancy/supplier/card.php | 2 +- htdocs/accountancy/supplier/index.php | 4 +- htdocs/accountancy/supplier/lines.php | 6 +-- htdocs/adherents/admin/adherent.php | 6 +-- htdocs/adherents/admin/public.php | 4 +- htdocs/adherents/card.php | 50 +++++++++---------- htdocs/adherents/card_subscriptions.php | 6 +-- htdocs/adherents/ldap.php | 4 +- htdocs/admin/agenda.php | 4 +- htdocs/admin/agenda_extsites.php | 6 +-- htdocs/admin/agenda_xcal.php | 4 +- htdocs/admin/askpricesupplier.php | 28 +++++------ htdocs/admin/bank.php | 4 +- htdocs/admin/barcode.php | 8 +-- htdocs/admin/boxes.php | 4 +- htdocs/admin/clicktodial.php | 4 +- htdocs/admin/commande.php | 34 ++++++------- htdocs/admin/company.php | 12 ++--- htdocs/admin/compta.php | 6 +-- htdocs/admin/const.php | 8 +-- htdocs/admin/contract.php | 18 +++---- htdocs/admin/dict.php | 18 +++---- htdocs/admin/menus/edit.php | 14 +++--- htdocs/admin/menus/index.php | 4 +- htdocs/admin/tools/dolibarr_export.php | 4 +- htdocs/admin/tools/export.php | 10 ++-- htdocs/admin/tools/update.php | 14 +++--- 35 files changed, 175 insertions(+), 175 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d4c256dfbf2..0500ac4a0a7 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -52,7 +52,7 @@ if ($action == "confirm_update") { $error = 0; if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -61,7 +61,7 @@ if ($action == "confirm_update") { $result = $book->fetch($id); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $book->numero_compte = $numero_compte; $book->code_tiers = $code_tiers; @@ -80,9 +80,9 @@ if ($action == "confirm_update") { $result = $book->update(); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -93,7 +93,7 @@ else if ($action == "add") { $error = 0; if ((intval($debit) != 0) && (intval($credit) != 0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -124,9 +124,9 @@ else if ($action == "add") { $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -140,11 +140,11 @@ else if ($action == "confirm_delete") { $piece_num = $book->piece_num; if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $result = $book->delete($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } } $action = ''; @@ -168,9 +168,9 @@ else if ($action == "confirm_create") { $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; $piece_num = $book->piece_num; } @@ -246,7 +246,7 @@ if ($action == 'create') { $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } if (! empty($book->piece_num)) { @@ -277,7 +277,7 @@ if ($action == 'create') { $result = $book->fetch_all_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { print load_fiche_titre($langs->trans("ListeMvts")); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d9b6d66b503..b9164329031 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -74,7 +74,7 @@ if ($action == 'delbookkeeping') { $result = $object->delete_by_importkey($import_key); Header("Location: list.php"); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } // Export @@ -86,7 +86,7 @@ else if ($action == 'export_csv') { $object = new BookKeeping($db); $result = $object->export_bookkeping('ebp'); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } foreach ( $object->linesexport as $line ) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 09e8b24a8ea..a3e179c1701 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -54,7 +54,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ea37f237455..5a6de05691a 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -83,10 +83,10 @@ if ($action == 'validatehistory') { if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 01f34e700cc..a505c91c1c7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -109,14 +109,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 01957fcedf5..cd0c5d06ce5 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -343,7 +343,7 @@ if ($action == 'writeBookKeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } // Third party @@ -420,13 +420,13 @@ if ($action == 'writeBookKeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } // Export diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 28b2dc736b6..538edaa471d 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -185,7 +185,7 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -215,7 +215,7 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -246,14 +246,14 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 4437535738a..aaf3beea8a1 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -220,7 +220,7 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -250,7 +250,7 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -282,14 +282,14 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f0747c8d29c..61b225fbc16 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -55,7 +55,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 954eb60300c..ec18d8b1e23 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -79,10 +79,10 @@ if ($action == 'validatehistory') { if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index f475e7046ad..e703bca6f2d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -115,14 +115,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 5827e1d22d7..8e265eb70f7 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -69,11 +69,11 @@ if ($action == 'update' || $action == 'add') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 58cb7bb2f41..6f5d1de5c87 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -60,11 +60,11 @@ if ($action == 'update') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 355aedb3e68..f998c2f08a3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2013 Philippe Grand + * Copyright (C) 2012-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -133,7 +133,7 @@ if (empty($reshook)) if ($userid != $user->id && $userid != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -169,7 +169,7 @@ if (empty($reshook)) $thirdparty=new Societe($db); $thirdparty->fetch($socid); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } @@ -195,12 +195,12 @@ if (empty($reshook)) if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($nuser->error), 'errors'); + setEventMessages($langs->trans($nuser->error), null, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->errors, $object->error, 'errors'); } } @@ -216,13 +216,13 @@ if (empty($reshook)) if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($company->error), 'errors'); - setEventMessage($company->errors, 'errors'); + setEventMessages($langs->trans($company->error), null, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -236,7 +236,7 @@ if (empty($reshook)) $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $langs->load("mails"); - setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email)); + setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); } } @@ -352,7 +352,7 @@ if (empty($reshook)) $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0) { - setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } else { @@ -368,7 +368,7 @@ if (empty($reshook)) } else { - setEventMessage("ErrorBadImageFormat", 'errors'); + setEventMessages("ErrorBadImageFormat", null, 'errors'); } } else @@ -397,9 +397,9 @@ if (empty($reshook)) else { if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -503,7 +503,7 @@ if (empty($reshook)) if ($num) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors'); + setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors'); } } if (empty($pass)) { @@ -528,7 +528,7 @@ if (empty($reshook)) if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } $public=0; if (isset($public)) $public=1; @@ -554,9 +554,9 @@ if (empty($reshook)) $db->rollback(); if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action = 'create'; @@ -609,7 +609,7 @@ if (empty($reshook)) if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -617,9 +617,9 @@ if (empty($reshook)) { $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -654,7 +654,7 @@ if (empty($reshook)) if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -662,9 +662,9 @@ if (empty($reshook)) $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -683,7 +683,7 @@ if (empty($reshook)) { if (!$mailmanspip->del_to_spip($object)) { - setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } @@ -694,7 +694,7 @@ if (empty($reshook)) { if (!$mailmanspip->add_to_spip($object)) { - setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index fa440c3bac4..9d86f618618 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -110,7 +110,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { $langs->load("errors"); $errmsg=$langs->trans($company->error); - setEventMessage($company->errors, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } else { @@ -131,7 +131,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -167,7 +167,7 @@ if ($action == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST('socid','int')); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index a2848b655b3..4d9a779d579 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -72,12 +72,12 @@ if ($action == 'dolibarr2ldap') if ($result >= 0) { - setEventMessage($langs->trans("MemberSynchronized")); + setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($ldap->error, 'errors'); + setEventMessages($ldap->errors, $ldap->error, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 287f2a897eb..c11cbeff3a4 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -86,12 +86,12 @@ if ($action == "save" && empty($cancel)) if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"),null, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9356674921e..755d1eb23f9 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -72,7 +72,7 @@ if ($actionsave) if (! empty($src) && ! dol_is_url($src)) { - setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); + setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors'); $error++; $errorsaved++; break; @@ -104,12 +104,12 @@ if ($actionsave) if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index dfdac2a8f0f..cd2406e6fdc 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -54,12 +54,12 @@ if ($actionsave) if ($i >= 4) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("SaveFailed"), 'errors'); + setEventMessages($langs->trans("SaveFailed"), null, 'errors'); } } diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php index 9bde4673ace..9afcd1a8f62 100644 --- a/htdocs/admin/askpricesupplier.php +++ b/htdocs/admin/askpricesupplier.php @@ -6,8 +6,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -54,11 +54,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -96,13 +96,13 @@ if ($action == 'specimen') } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -116,11 +116,11 @@ if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -134,11 +134,11 @@ if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -150,11 +150,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -178,12 +178,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 8214755fd2b..048e351044d 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -56,11 +56,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b36a222c165..0a57508c271 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -97,11 +97,11 @@ if ($action == 'setModuleOptions') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'msgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -111,11 +111,11 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6b1eb71fafe..5b6d64801b5 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -85,7 +85,7 @@ if ($action == 'add') { } else { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } @@ -121,7 +121,7 @@ if ($action == 'add') { $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 1550c0ebef7..260a9514375 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -41,11 +41,11 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); if ($result >= 0) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index f7e3812d74f..9e55369dac9 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -64,11 +64,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -106,13 +106,13 @@ else if ($action == 'specimen') } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -137,12 +137,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,11 +214,11 @@ else if ($action == 'set_ORDER_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,9 +228,9 @@ else if ($action=="setshippableiconinlist") { $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); if (! $res > 0) $error++; if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -243,11 +243,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -260,11 +260,11 @@ else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b9660c8a04d..e84bdf2a3fa 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -125,19 +125,19 @@ if ( ($action == 'update' && empty($_POST["cancel"])) $error++; $langs->load("errors"); $tmparray=explode(':',$result); - setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); } else { $error++; - setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } else { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } } @@ -230,7 +230,7 @@ if ($action == 'addthumb') { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); } } @@ -238,7 +238,7 @@ if ($action == 'addthumb') { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); + setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } } diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 633f88b9cfb..38ba28e9fa4 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -87,11 +87,11 @@ if ($action == 'update') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 62f6bbaaf2c..06e3279fa54 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -68,7 +68,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) { if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $constname=""; $constvalue=""; @@ -99,7 +99,7 @@ if (! empty($consts) && $action == 'update') } } } - if ($nbmodified > 0) setEventMessage($langs->trans("RecordSaved")); + if ($nbmodified > 0) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=''; } @@ -122,7 +122,7 @@ if (! empty($consts) && $action == 'delete') } } } - if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted")); + if ($nbdeleted > 0) setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); $action=''; } @@ -131,7 +131,7 @@ if ($action == 'delete') { if (dolibarr_del_const($db, $rowid, $entity) >= 0) { - setEventMessage($langs->trans("RecordDeleted")); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } else { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index a45045a5381..3198ad51448 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2014 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -59,11 +59,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessage($langs->trans("Error"), null, 'errors'); } } @@ -101,13 +101,13 @@ else if ($action == 'specimen') // For contract } else { - setEventMessage($obj->error,'errors'); + setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -132,12 +132,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -194,11 +194,11 @@ else if ($action == 'set_other') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 40b4676ba25..817019cc24b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel @@ -548,20 +548,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible'; if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; - setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } } // Other checks if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { $ok=0; - setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors'); + setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } if (isset($_POST["code"])) { if ($_POST["code"]=='0') { $ok=0; - setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors'); + setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); } /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base { @@ -578,7 +578,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) else { $ok=0; - setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); } } @@ -637,13 +637,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $result = $db->query($sql); if ($result) // Add is ok { - setEventMessage($langs->transnoentities("RecordSaved")); + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST=array('id'=>$id); // Clean $_POST array, we keep only } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } else { dol_print_error($db); @@ -687,7 +687,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->error(),'errors'); + setEventMessage($db->error(), 'errors'); } } //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition @@ -711,7 +711,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } else { diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 7c60a2ee055..b7f4b8d5b73 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -78,16 +78,16 @@ if ($action == 'update') $result=$menu->update($user); if ($result > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } $_GET["menuId"] = $_POST['menuId']; $action = "edit"; @@ -159,13 +159,13 @@ if ($action == 'add') } if (! $error && $_POST['menuId'] && $_POST['type'] == 'top') { - setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors'); + setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors'); $action = 'create'; $error++; } if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left') { - setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors'); + setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; $error++; } @@ -204,7 +204,7 @@ if ($action == 'add') else { $action = 'create'; - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } } @@ -222,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') $this->db->commit(); llxHeader(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); llxFooter(); exit ; } diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index c8699209268..7da0673b196 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -186,7 +186,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') { $db->commit(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); exit ; @@ -359,7 +359,7 @@ if ($conf->use_javascript_ajax) else { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors'); + setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); } print '
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index a460f667e2a..49d229898b8 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -52,8 +52,8 @@ if ($action == 'delete') { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action=''; } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 500c766ed77..cddd42a8623 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -60,8 +60,8 @@ if ($action == 'delete') { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action=''; } @@ -357,7 +357,7 @@ if ($what == 'postgresql') //{ if ($errormsg) { - setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors'); + setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); $resultstring=''; $resultstring.='
'.$langs->trans("Error")." : ".$errormsg.'
'; @@ -368,7 +368,7 @@ if ($what == 'postgresql') { if ($what) { - setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile")); + setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs'); $resultstring='
'; $resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.
'; @@ -379,7 +379,7 @@ if ($what == 'postgresql') } else { - setEventMessage($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user)); + setEventMessages($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user), null, 'mesgs'); } } //} diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 54a6cab9cbd..e1166e96c3d 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -34,7 +34,7 @@ $action=GETPOST('action','alpha'); if (! $user->admin) accessforbidden(); if (GETPOST('msg','alpha')) { - setEventMessage(GETPOST('msg','alpha'), 'errors'); + setEventMessages(GETPOST('msg','alpha'), null, 'errors'); } @@ -63,7 +63,7 @@ if ($action=='install') if (! $original_file) { $langs->load("Error"); - setEventMessage($langs->trans("ErrorFileRequired"), 'warnings'); + setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings'); $error++; } else @@ -71,7 +71,7 @@ if ($action=='install') if (! preg_match('/\.zip/i',$original_file)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors'); + setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); $error++; } } @@ -99,7 +99,7 @@ if ($action=='install') if (! empty($result['error'])) { $langs->load("errors"); - setEventMessage($langs->trans($result['error'],$original_file), 'errors'); + setEventMessages($langs->trans($result['error'],$original_file), null, 'errors'); $error++; } else @@ -116,7 +116,7 @@ if ($action=='install') //var_dump($modulenamedir); if (! dol_is_dir($modulenamedir)) { - setEventMessage($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), 'errors'); + setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); $error++; } } @@ -128,7 +128,7 @@ if ($action=='install') $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); if ($result <= 0) { - setEventMessage($langs->trans("ErrorFailedToCopy"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors'); $error++; } } @@ -142,7 +142,7 @@ if ($action=='install') if (! $error) { - setEventMessage($langs->trans("SetupIsReadyForUse")); + setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs'); } } From 2a412af00b3ea57ed2e2d3e72a77044275d9a44f Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Fri, 23 Oct 2015 13:04:33 +0200 Subject: [PATCH 081/116] Fix: Bug: if $this->employe no exist Fix: if this->employee no exist default 0 --- htdocs/install/mysql/tables/llx_user.sql | 3 +-- htdocs/user/class/user.class.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 796566fb638..c9673ceb360 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -26,7 +26,7 @@ create table llx_user ref_ext varchar(50), -- reference into an external system (not used by dolibarr) ref_int varchar(50), -- reference into an internal system (deprecated) - employee tinyint DEFAULT 0, -- employee 0/1 + employee tinyint DEFAULT 0, -- 1 if user is an employee datec datetime, tms timestamp, @@ -76,7 +76,6 @@ create table llx_user nb_holiday integer DEFAULT 0, thm double(24,8), tjm double(24,8), - employee tinyint DEFAULT 1, -- 1 if user is an employee salary double(24,8), salaryextra double(24,8), weeklyhours double(16,8) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 85a96ebe415..066da9c18da 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1156,7 +1156,7 @@ class User extends CommonObject // Clean parameters $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); - $this->employee = trim($this->employee); + $this->employee = $this->employee?$this->employee:0; $this->login = trim($this->login); $this->gender = trim($this->gender); $this->pass = trim($this->pass); From 8d24adc97ee54640a716258be36c9c5379246dc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 13:52:51 +0200 Subject: [PATCH 082/116] Remove 2 other duplicated pages. There is only one page now for all list of thirdarties (with a parameter type to have it specialized per customer, prospect or supplier profile). --- htdocs/comm/list.php | 348 ------------ htdocs/comm/prospect/list.php | 613 --------------------- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 4 +- htdocs/core/menus/standard/eldy.lib.php | 14 +- htdocs/index.php | 5 +- htdocs/societe/index.php | 4 +- htdocs/societe/list.php | 251 +++++++-- 8 files changed, 233 insertions(+), 1008 deletions(-) delete mode 100644 htdocs/comm/list.php delete mode 100644 htdocs/comm/prospect/list.php diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php deleted file mode 100644 index 1cc0f2fa968..00000000000 --- a/htdocs/comm/list.php +++ /dev/null @@ -1,348 +0,0 @@ - - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013-2015 Florian Henry - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Marcos García - * - * This program is freei 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 . - */ - -/** - * \file htdocs/comm/list.php - * \ingroup commercial societe - * \brief List of customers - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -$langs->load("companies"); -$langs->load("customers"); -$langs->load("suppliers"); -$langs->load("commercial"); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user,'societe',$socid,''); - -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page=GETPOST('page','int'); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; - -$search_company = GETPOST("search_company"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_code = GETPOST("search_code"); -$search_compta = GETPOST("search_compta"); -$search_status = GETPOST("search_status",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); -$optioncss = GETPOST('optioncss','alpha'); - -// Load sale and categ filters -$search_sale = GETPOST("search_sale",'int'); -$search_categ = GETPOST("search_categ",'int'); -$catid = GETPOST("catid",'int'); -// If the internal user must only see his customers, force searching by him -if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('customerlist')); -$extrafields = new ExtraFields($db); - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $search_sale=""; - $search_categ=""; - $catid=""; - $search_company=""; - $search_zipcode=""; - $search_town=""; - $search_code=''; - $search_compta=''; - $search_status=''; - $search_country=""; - $search_type_thirdparty=''; -} - -if ($search_status=='') $search_status=1; // always display activ customer first - - -/* - * view - */ - -$formother=new FormOther($db); -$form = new Form($db); -$thirdpartystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - -$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; -$sql.= " s.datec, s.canvas"; -$sql.= ",s.fk_pays"; -$sql.= ",typent.code as typent_code"; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) -// Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale -$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.client IN (1, 3)"; -$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale -if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_company) $sql.= natural_search(array('s.nom', 's.name_alias'), $search_company); -if ($search_zipcode) $sql.= natural_search("s.zip", $search_zipcode); -if ($search_town) $sql.= natural_search('s.town', $search_town); -if ($search_code) $sql.= natural_search("s.code_client", $search_code); -if ($search_compta) $sql.= natural_search("s.code_compta", $search_compta); -if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status); -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -if ($search_sale > 0) $sql.= " AND sc.fk_user = ".$search_sale; -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; - -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} - -$sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($conf->liste_limit +1, $offset); - -dol_syslog('comm/list.php:', LOG_DEBUG); -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - - $param = "&search_company=".htmlspecialchars($search_company); - $param.="&search_code=".htmlspecialchars($search_code); - $param.="&search_zipcode=".htmlspecialchars($search_zipcode); - $param.="&search_town=".htmlspecialchars($search_town); - if ($search_categ != '') $param.='&search_categ='.htmlspecialchars($search_categ); - if ($search_sale > 0) $param.='&search_sale='.htmlspecialchars($search_sale); - if ($search_status != '') $param.='&search_status='.htmlspecialchars($search_status); - if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - - print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png'); - - $i = 0; - - print '
'."\n"; - if ($optioncss != '') print ''; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); - $moreforfilter.='
'; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='
'; - } - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print ''; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder); - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print ''."\n"; - - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($result); - - $var=!$var; - - print ""; - print ''; - print ''; - print ''; - //Country - print ''; - //Type ent - print ''; - print ''; - print ''; - print ''; - - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - $db->free($result); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print "
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - print ''; - print ''; - print ' '; - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print '
'; - $thirdpartystatic->id=$obj->rowid; - $thirdpartystatic->name=$obj->name; - $thirdpartystatic->client=$obj->client; - $thirdpartystatic->code_client=$obj->code_client; - $thirdpartystatic->canvas=$obj->canvas; - $thirdpartystatic->status=$obj->status; - $thirdpartystatic->name_alias=$obj->name_alias; - print $thirdpartystatic->getNomUrl(1); - print ''.$obj->zip.''.$obj->town.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.$obj->code_client.''.$obj->code_compta.''.dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3); - print '
\n"; - print "
\n"; -} -else -{ - dol_print_error($db); -} - -llxFooter(); -$db->close(); diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php deleted file mode 100644 index 8ec43d955a4..00000000000 --- a/htdocs/comm/prospect/list.php +++ /dev/null @@ -1,613 +0,0 @@ - - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013-2015 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2015 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 . - */ - -/** - * \file htdocs/comm/prospect/list.php - * \ingroup prospect - * \brief Page to list prospects - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -$langs->load("propal"); -$langs->load("companies"); - -// Security check -$socid = GETPOST("socid",'int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'societe',$socid,''); - -$action = GETPOST('action','alpha'); -$socname = GETPOST("socname",'alpha'); -$stcomm = GETPOST("stcomm",'alpha'); // code -$search_stcomm = GETPOST("search_stcomm",'int'); -$search_nom = GETPOST("search_nom"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_state = GETPOST("search_state"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST("search_categ",'int'); -$search_status = GETPOST("search_status",'int'); -$catid = GETPOST("catid",'int'); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; - -$search_level_from = GETPOST("search_level_from","alpha"); -$search_level_to = GETPOST("search_level_to","alpha"); - -// If both parameters are set, search for everything BETWEEN them -if ($search_level_from != '' && $search_level_to != '') -{ - // Ensure that these parameters are numbers - $search_level_from = (int) $search_level_from; - $search_level_to = (int) $search_level_to; - - // If from is greater than to, reverse orders - if ($search_level_from > $search_level_to) - { - $tmp = $search_level_to; - $search_level_to = $search_level_from; - $search_level_from = $tmp; - } - - // Generate the SQL request - $sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range'; -} -// If only "from" parameter is set, search for everything GREATER THAN it -else if ($search_level_from != '') -{ - // Ensure that this parameter is a number - $search_level_from = (int) $search_level_from; - - // Generate the SQL request - $sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range'; -} -// If only "to" parameter is set, search for everything LOWER THAN it -else if ($search_level_to != '') -{ - // Ensure that this parameter is a number - $search_level_to = (int) $search_level_to; - - // Generate the SQL request - $sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range'; -} -// If no parameters are set, dont search for anything -else -{ - $sortwhere = '0 as is_in_range'; -} - -// Select every potentiels, and note each potentiels which fit in search parameters -dol_syslog('prospects::prospects_prospect_level',LOG_DEBUG); -$sql = "SELECT code, label, sortorder, ".$sortwhere; -$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; -$sql.= " WHERE active > 0"; -$sql.= " ORDER BY sortorder"; - -$resql = $db->query($sql); -if ($resql) -{ - $tab_level = array(); - $search_levels = array(); - - while ($obj = $db->fetch_object($resql)) - { - // Compute level text - $level=$langs->trans($obj->code); - if ($level == $obj->code) $level=$langs->trans($obj->label); - - // Put it in the array sorted by sortorder - $tab_level[$obj->sortorder] = $level; - - // If this potentiel fit in parameters, add its code to the $search_levels array - if ($obj->is_in_range == 1) - { - $search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"'; - } - } - - // Implode the $search_levels array so that it can be use in a "IN (...)" where clause. - // If no paramters was set, $search_levels will be empty - $search_levels = implode(',', $search_levels); -} -else dol_print_error($db); - -// Load sale and categ filters -$search_sale = GETPOST('search_sale','int'); -$search_categ = GETPOST('search_categ','int'); -// If the internal user must only see his prospect, force searching by him -if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; - -// List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) -$sts = array(-1,0,1,2,3); - - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$contextpage='prospectlist'; -$hookmanager->initHooks(array($contextpage)); -$extrafields = new ExtraFields($db); - -// fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('thirdparty'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); - -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $socname=""; - $stcomm=""; - $search_stcomm=""; - $search_nom=""; - $search_zipcode=""; - $search_town=""; - $search_state=""; - $search_datec=""; - $search_categ=""; - $search_status=""; - $search_country=""; - $search_type_thirdparty=""; - $search_array_options=array(); -} - -if ($search_status=='') $search_status=1; // always display active customer first - - - -/* - * Actions - */ - -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - -if (empty($reshook)) -{ - if ($action == 'setstcomm') - { - $object = new Client($db); - $result=$object->fetch($socid); - $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm'); - $result=$object->set_commnucation_level($user); - if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); - - $action=''; $socid=0; - } -} - - -/* - * View - */ - -$formother=new FormOther($db); -$form=new Form($db); -$formcompany=new FormCompany($db); -$prospectstatic=new Client($db); -$prospectstatic->client=2; -$prospectstatic->loadCacheOfProspStatus(); - -$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,"; -$sql.= " s.prefix_comm, s.fk_prospectlevel, s.fk_stcomm as stcomm_id,"; -$sql.= " st.libelle as stcomm_label,"; -$sql.= " d.nom as departement"; -$sql.= " ,s.fk_pays"; -$sql.= " ,typent.code as typent_code"; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) -// Add fields for extrafields -if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; -// Add fields from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st"; -$sql.= ", ".MAIN_DB_PREFIX."societe as s"; -if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; -if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.client IN (2, 3)"; -$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; -if ($socid) $sql.= " AND s.rowid = " .$socid; -if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); -if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; -if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; -if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) $sql .= natural_search(array('s.nom','s.name_alias'), $search_nom); -if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'"; -if ($search_town) $sql .= natural_search('s.town', $search_town); -if ($search_state) $sql .= natural_search('d.nom', $search_state); -if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; -if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); -// Insert levels filters -if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; -if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; -if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; -// Insert sale filter -if ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); -if ($socname) -{ - $sql .= natural_search('s.nom', $search_nom); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -// Add where from extra fields -foreach ($search_array_options as $key => $val) -{ - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } -} -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} -$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC"; -$sql.= $db->plimit($conf->liste_limit+1, $offset); -//print $sql; - -dol_syslog('comm/prospect/list.php', LOG_DEBUG); -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - - if ($num == 1 && $socname) - { - $obj = $db->fetch_object($resql); - header("Location: card.php?socid=".$obj->socid); - exit; - } - else - { - $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; - llxHeader('',$langs->trans("ThirdParty"),$help_url); - } - - $param='&search_stcomm='.$search_stcomm; - $param.='&search_nom='.urlencode($search_nom); - $param.='&search_zipcode='.urlencode($search_zipcode); - $param.='&search_town='.urlencode($search_town); - // Store the status filter in the URL - if (isSet($search_setstcomm)) - { - foreach ($search_setstcomm as $key => $value) - { - if ($value == 'true') - $param.='&search_setstcomm['.((int) $key).']=true'; - else - $param.='&search_setstcomm['.((int) $key).']=false'; - } - } - if ($search_level_from != '') $param.='&search_level_from='.$search_level_from; - if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; - if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ); - if ($search_sale > 0) $param.='&search_sale='.$search_sale; - if ($search_status != '') $param.='&search_status='.$search_status; - if ($search_country != '') $param.='&search_country='.$search_country; - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.$search_type_thirdparty; - // Add $param from extra fields - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } - - print_barre_liste($langs->trans("ListOfProspects"), $page, $_SERVER["PHP_SELF"], $param, $sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png'); - - - // Print the search-by-sale and search-by-categ filters - print '
'; - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1); - $moreforfilter.='
'; - } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); - $moreforfilter.='
'; - } - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print ''; - - print ''; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("StateShort"),$_SERVER["PHP_SELF"],"s.fk_departement","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre(''); - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder); - } - } - } - // Hook fields - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Prospect level - print ''; - - // Prospect status - print ''; - - print ''; - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - $crit=$search_array_options['search_options_'.$key]; - print ''; - } - } - } - // Hook fields - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Status - print ''; - - // Print the search button - print '\n"; - - print "\n"; - - $i = 0; - $var=true; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - - $var=!$var; - - print ''; - print ''; - print ""; - print ""; - print ''; - //Country - print ''; - //Type ent - print ''; - // Creation date - print ''; - // Level - print '"; - // Statut - print '"; - - print ''; - - // Extrafields - if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) - { - foreach($extrafields->attribute_list as $key => $val) - { - if ($val) - { - print ''; - } - } - } - // Hook fields - $parameters=array('obj' => $obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; - - print ''; - - print "\n"; - $i++; - } - - if ($num > $conf->liste_limit || $page > 0) print_barre_liste('', $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - - print "
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; - print ''; - print ''; - $options_from = ''; // Generate in $options_from the list of each option sorted - foreach ($tab_level as $tab_level_sortorder => $tab_level_label) - { - $options_from .= ''; - } - array_reverse($tab_level, true); // Reverse the list - $options_to = ''; // Generate in $options_to the list of each option sorted in the reversed order - foreach ($tab_level as $tab_level_sortorder => $tab_level_label) - { - $options_to .= ''; - } - - // Print these two select - print $langs->trans("From").' '; - print ' '; - print $langs->trans("to").' '; - - print ''; - $arraystcomm=array(); - foreach($prospectstatic->cacheprospectstatus as $key => $val) - { - $arraystcomm[$val['id']]=$val['label']; - } - print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); - print ''; - print ' '; - print ''; - print $extrafields->showInputField($key, $crit, '', '', 'search_', 4); - print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; - print ''; - print "
'; - $prospectstatic->id=$obj->socid; - $prospectstatic->name=$obj->name; - $prospectstatic->status=$obj->status; - $prospectstatic->code_client=$obj->code_client; - $prospectstatic->client=$obj->client; - $prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel; - $prospectstatic->name_alias=$obj->name_alias; - print $prospectstatic->getNomUrl(1,'prospect'); - print '".$obj->zip."".$obj->town."'.$obj->departement.''; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''.dol_print_date($db->jdate($obj->datec)).''; - print $prospectstatic->getLibProspLevel(); - print "'; - print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); - print "'; - foreach($prospectstatic->cacheprospectstatus as $key => $val) - { - $titlealt='default'; - if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; - if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; - } - print ''; - $paramkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$paramkey); - print ''; - print $prospectstatic->LibStatut($prospectstatic->status,5); - print '
"; - - print "
"; - - $db->free($resql); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -} -else -{ - dol_print_error($db); -} - - -llxFooter(); -$db->close(); diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7adabcf819b..51cf8a9c7a7 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -302,7 +302,7 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) + * @param int $type Type of categories (0=product, 1=supplier, 2=customer, 3=member, 4=contact) * @param integer $selected Preselected value * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ffcb21e6535..df0b9e46488 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -71,9 +71,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/soc.php?leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/prospect/list.php?leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/soc.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/list.php?leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -- Third parties - Contacts insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 42701456c6e..49c076de4c8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -590,13 +590,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); - $newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); /* no more required, there is a filter that can do more - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); - if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); + if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); */ $newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); @@ -606,7 +606,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $langs->load("commercial"); - $newmenu->add("/comm/list.php?leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); $newmenu->add("/societe/soc.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); diff --git a/htdocs/index.php b/htdocs/index.php index 2e1d019d2e7..5db358aa34b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -231,8 +231,9 @@ if (empty($user->societe_id)) "SuppliersInvoices", "ExpenseReports"); // Dashboard Link lines - $links=array(DOL_URL_ROOT.'/comm/list.php', - DOL_URL_ROOT.'/comm/prospect/list.php', + $links=array( + DOL_URL_ROOT.'/societe/list.php?type=c', + DOL_URL_ROOT.'/societe/list.php?type=p', DOL_URL_ROOT.'/societe/list.php?type=f', DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members', DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products', diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 86de804c6a1..ebe4b4c0342 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -143,13 +143,13 @@ else if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; - $statstring.= ''.$langs->trans("Prospects").''.round($third['prospect']).''; + $statstring.= ''.$langs->trans("Prospects").''.round($third['prospect']).''; $statstring.= ""; } if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring.= ""; - $statstring.= ''.$langs->trans("Customers").''.round($third['customer']).''; + $statstring.= ''.$langs->trans("Customers").''.round($third['customer']).''; $statstring.= ""; } if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 19301efd6e0..98795e27667 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -31,10 +31,12 @@ include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; $langs->load("companies"); $langs->load("customers"); $langs->load("suppliers"); +$langs->load("bills"); // Security check $socid = GETPOST('socid','int'); @@ -64,10 +66,14 @@ $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_type=GETPOST('search_type','alpha'); $search_status=GETPOST("search_status",'int'); +$search_level_from = GETPOST("search_level_from","alpha"); +$search_level_to = GETPOST("search_level_to","alpha"); +$search_stcomm=GETPOST('search_stcomm','int'); $type=GETPOST('type'); $optioncss=GETPOST('optioncss','alpha'); $mode=GETPOST("mode"); +$action=GETPOST('action'); $sortfield=GETPOST("sortfield",'alpha'); $sortorder=GETPOST("sortorder",'alpha'); @@ -116,6 +122,7 @@ if (($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != if (!empty($conf->barcode->enabled)) $fieldstosearchall['s.barcode']='Gencod'; + /* * Actions */ @@ -126,6 +133,20 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; +if (empty($reshook)) +{ + if ($action == 'setstcomm') + { + $object = new Client($db); + $result=$object->fetch(GETPOST('stcommsocid')); + $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm'); + $result=$object->set_commnucation_level($user); + if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); + + $action=''; + } +} + // special search /*if ($mode == 'search') { @@ -176,20 +197,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; } */ - -/* - * View - */ - -$form=new Form($db); -$formother=new FormOther($db); -$companystatic=new Societe($db); -$formcompany=new FormCompany($db); - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - - // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { @@ -212,14 +219,18 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_country=''; $search_type_thirdparty=''; $search_status=''; + $search_stcomm=''; + $search_level_from=''; + $search_level_to=''; $search_array_options=array(); } if ($search_status=='') $search_status=1; // always display active thirdparty first + /* - * Mode List + * View */ /* @@ -230,13 +241,103 @@ if ($search_status=='') $search_status=1; // always display active thirdparty fi External user socid=x + Permission to see ALL customers => Can see only himself External user socid=x + No permission to see ALL customers => Can see only himself */ + +$form=new Form($db); +$formother=new FormOther($db); +$companystatic=new Societe($db); +$formcompany=new FormCompany($db); +$prospectstatic=new Client($db); +$prospectstatic->client=2; +$prospectstatic->loadCacheOfProspStatus(); + +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$langs->trans("ThirdParty"),$help_url); + + $title=$langs->trans("ListOfThirdParties"); if ($type == 'c' && (empty($search_type) || ($search_type == '1,3'))) $title=$langs->trans("ListOfCustomers"); if ($type == 'p' && (empty($search_type) || ($search_type == '2,3'))) $title=$langs->trans("ListOfProspects"); if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) $title=$langs->trans("ListOfSuppliers"); -$sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; -$sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; +// If both parameters are set, search for everything BETWEEN them +if ($search_level_from != '' && $search_level_to != '') +{ + // Ensure that these parameters are numbers + $search_level_from = (int) $search_level_from; + $search_level_to = (int) $search_level_to; + + // If from is greater than to, reverse orders + if ($search_level_from > $search_level_to) + { + $tmp = $search_level_to; + $search_level_to = $search_level_from; + $search_level_from = $tmp; + } + + // Generate the SQL request + $sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range'; +} +// If only "from" parameter is set, search for everything GREATER THAN it +else if ($search_level_from != '') +{ + // Ensure that this parameter is a number + $search_level_from = (int) $search_level_from; + + // Generate the SQL request + $sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range'; +} +// If only "to" parameter is set, search for everything LOWER THAN it +else if ($search_level_to != '') +{ + // Ensure that this parameter is a number + $search_level_to = (int) $search_level_to; + + // Generate the SQL request + $sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range'; +} +// If no parameters are set, dont search for anything +else +{ + $sortwhere = '0 as is_in_range'; +} + +// Select every potentiels, and note each potentiels which fit in search parameters +dol_syslog('societe/list.php',LOG_DEBUG); +$sql = "SELECT code, label, sortorder, ".$sortwhere; +$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; +$sql.= " WHERE active > 0"; +$sql.= " ORDER BY sortorder"; + +$resql = $db->query($sql); +if ($resql) +{ + $tab_level = array(); + $search_levels = array(); + + while ($obj = $db->fetch_object($resql)) + { + // Compute level text + $level=$langs->trans($obj->code); + if ($level == $obj->code) $level=$langs->trans($obj->label); + + // Put it in the array sorted by sortorder + $tab_level[$obj->sortorder] = $level; + + // If this potentiel fit in parameters, add its code to the $search_levels array + if ($obj->is_in_range == 1) + { + $search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"'; + } + } + + // Implode the $search_levels array so that it can be use in a "IN (...)" where clause. + // If no paramters was set, $search_levels will be empty + $search_levels = implode(',', $search_levels); +} +else dol_print_error($db); + +$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; +$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; $sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4,"; $sql.= " s.fk_pays, s.tms as date_update, s.datec as date_creation,"; $sql.= " typent.code as typent_code"; @@ -291,6 +392,8 @@ if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); if (!empty($conf->barcode->enabled) && $search_barcode) $sql.= " AND s.barcode LIKE '%".$db->escape($search_barcode)."%'"; if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; +if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; +if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -348,6 +451,9 @@ if ($resql) if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($search_status != '') $param.='&search_status='.urlencode($search_status); + if ($search_stcomm != '') $param.='&search_stcomm='.$search_stcomm; + if ($search_level_from != '') $param.='&search_level_from='.$search_level_from; + if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; if ($type != '') $param.='&type='.urlencode($type); // Add $param from extra fields foreach ($search_array_options as $key => $val) @@ -400,7 +506,7 @@ if ($resql) require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $moreforfilter.='
'; $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1); + $moreforfilter.=$formother->select_categories('customer',$search_categ,'search_categ',1); $moreforfilter.='
'; } // If the user can view prospects other than his' @@ -419,7 +525,7 @@ if ($resql) require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $moreforfilter.='
'; $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$formother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1); + $moreforfilter.=$formother->select_categories('supplier',$search_categ,'search_categ',1); $moreforfilter.='
'; } } @@ -436,16 +542,21 @@ if ($resql) // Define list of fields to show into list $checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); $checkedsuppliercode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); - $checkedcustomeraccountcode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); + $checkedcustomeraccountcode=(in_array($contextpage, array('customerlist')) ? 1 : 0); $checkedsupplieraccountcode=(in_array($contextpage, array('supplierlist')) ? 1 : 0); $checkedtypetiers=1; + $checkedprofid1=0; + $checkedprofid2=0; + $checkedprofid3=0; $checkedprofid4=0; $checkedprofid5=0; $checkedprofid6=0; //$checkedprofid4=((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0); //$checkedprofid5=((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0); //$checkedprofid6=((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0); - $arrayfields=array( + $checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0); + $checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0); + $arrayfields=array( 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), 's.code_client'=>array('label'=>$langs->trans("CustomerCodeShort"), 'checked'=>$checkedcustomercode), @@ -456,12 +567,14 @@ if ($resql) 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), - 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>1), - 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>1), - 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>1), + 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>$checkedprofid1), + 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>$checkedprofid2), + 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>$checkedprofid3), 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4), 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5), 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), + 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), + 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>200), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -488,7 +601,9 @@ if ($resql) if (! empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof5","",$param,'class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof6","",$param,'class="nowrap"',$sortfield,$sortorder); print_liste_field_titre(''); // type of customer - // Extra fields + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); + // Extra fields if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) { foreach($extrafields->attribute_list as $key => $val) @@ -623,6 +738,7 @@ if ($resql) print ''; print ''; } + // Type (customer/prospect/supplier) print ''; print ''; + + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) + { + // Prospect level + print ''; + $options_from = ''; // Generate in $options_from the list of each option sorted + foreach ($tab_level as $tab_level_sortorder => $tab_level_label) + { + $options_from .= ''; + } + array_reverse($tab_level, true); // Reverse the list + $options_to = ''; // Generate in $options_to the list of each option sorted in the reversed order + foreach ($tab_level as $tab_level_sortorder => $tab_level_label) + { + $options_to .= ''; + } + + // Print these two select + print $langs->trans("From").' '; + print ' '; + print $langs->trans("to").' '; + + print ''; + } + + if (! empty($arrayfields['s.fk_stcomm']['checked'])) + { + // Prospect status + print ''; + $arraystcomm=array(); + foreach($prospectstatic->cacheprospectstatus as $key => $val) + { + $arraystcomm[$val['id']]=$val['label']; + } + print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); + print ''; + } + // Fields from hook $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook @@ -671,18 +829,22 @@ if ($resql) { $obj = $db->fetch_object($resql); $var=!$var; + + $companystatic->id=$obj->rowid; + $companystatic->name=$obj->name; + $companystatic->canvas=$obj->canvas; + $companystatic->client=$obj->client; + $companystatic->status=$obj->status; + $companystatic->fournisseur=$obj->fournisseur; + $companystatic->code_client=$obj->code_client; + $companystatic->code_fournisseur=$obj->code_fournisseur; + $companystatic->fk_prospectlevel=$obj->fk_prospectlevel; + $companystatic->name_alias=$obj->name_alias; + print ""; if (! empty($arrayfields['s.nom']['checked'])) { print ""; - $companystatic->id=$obj->rowid; - $companystatic->name=$obj->name; - $companystatic->canvas=$obj->canvas; - $companystatic->client=$obj->client; - $companystatic->status=$obj->status; - $companystatic->fournisseur=$obj->fournisseur; - $companystatic->code_client=$obj->code_client; - $companystatic->code_fournisseur=$obj->code_fournisseur; print $companystatic->getNomUrl(1,'',100); print "\n"; } @@ -761,6 +923,7 @@ if ($resql) { print "".$obj->idprof6."\n"; } + // Type print ''; $s=''; if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) @@ -782,6 +945,28 @@ if ($resql) } print $s; print ''; + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) + { + // Prospect level + print ''; + print $companystatic->getLibProspLevel(); + print ""; + } + if (! empty($arrayfields['s.fk_stcomm']['checked'])) + { + // Prospect status + print '
'; + print '
'.$companystatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); + print '
-
'; + foreach($prospectstatic->cacheprospectstatus as $key => $val) + { + $titlealt='default'; + if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; + if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; + } + print '
'; + } + // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook From f6d30d8b9e908c7d44ff9862ff7dbe19c990582c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 14:40:45 +0200 Subject: [PATCH 083/116] Fix: W3C no form into table --- htdocs/admin/mailman.php | 30 +++++++++++----- htdocs/admin/spip.php | 66 +++++++++++++++++++++-------------- htdocs/core/lib/admin.lib.php | 6 ++-- 3 files changed, 63 insertions(+), 39 deletions(-) diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 686da7fc68c..e3aab979a41 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -99,7 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if (! isValidEmail($email)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email),'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } else { @@ -118,11 +118,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanCreationSuccess")); + setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } if ($action == 'testunsubscribe') @@ -131,11 +131,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanDeletionSuccess")); + setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } } @@ -156,12 +156,15 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup' $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $var=true; if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { + print '
'; + + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -200,21 +203,30 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) }); '; - form_constantes($constantes,1); - + form_constantes($constantes,2); + print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=img_$langs->trans("Activate") $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + + dol_fiche_end(); } -dol_fiche_end(); if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index e46d9b8f5b7..13d959eb38c 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -54,28 +54,30 @@ if ($action == 'update' || $action == 'add') $constname=GETPOST("constname"); $constvalue=GETPOST("constvalue"); - if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; - if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice - { - if ($constvalue) $constvalue=0; - else $constvalue=1; - } + // Action mise a jour ou ajout d'une constante + if ($action == 'update' || $action == 'add') + { + foreach($_POST['constname'] as $key => $val) + { + $constname=$_POST["constname"][$key]; + $constvalue=$_POST["constvalue"][$key]; + $consttype=$_POST["consttype"][$key]; + $constnote=$_POST["constnote"][$key]; - if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; - $consttype=$_POST["consttype"]; - $constnote=GETPOST("constnote"); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - setEventMessage($langs->trans("SetupSaved")); - } - else - { - setEventMessage($langs->trans("Error"),'errors'); - } + $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + + if (! $res > 0) $error++; + } + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } + } } // Action activation d'un sous module du module adherent @@ -115,7 +117,6 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup' $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $var=true; @@ -124,6 +125,10 @@ $var=true; */ if (! empty($conf->global->ADHERENT_USE_SPIP)) { + print '
'; + + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -139,21 +144,28 @@ if (! empty($conf->global->ADHERENT_USE_SPIP)) print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); print '
'; - form_constantes($constantes); - print '
'; + + form_constantes($constantes,2); + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=$langs->trans("Activate"); $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); + + dol_fiche_end(); } - -dol_fiche_end(); - llxFooter(); $db->close(); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3d887f1bd18..7b22a2e8dbe 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1053,7 +1053,7 @@ function complete_elementList_with_modules(&$elementList) * Show array with constants to edit * * @param array $tableau Array of constants - * @param int $strictw3c Respect W3C (no form into table) + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all * @return void */ function form_constantes($tableau,$strictw3c=0) @@ -1062,7 +1062,7 @@ function form_constantes($tableau,$strictw3c=0) $form = new Form($db); - if (! empty($strictw3c)) print "\n".'
'; + if (! empty($strictw3c) && $strictw3c == 1) print "\n".''; print ''; print ''; @@ -1199,7 +1199,7 @@ function form_constantes($tableau,$strictw3c=0) } print '
'; - if (! empty($strictw3c)) + if (! empty($strictw3c) && $strictw3c == 1) { print '
'; print "
\n"; From a01a85c3f6eb7afc589f7c666a2533647d8e9d32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:13:02 +0200 Subject: [PATCH 084/116] FIX tag object_total_vat_x need x to be a string with unknown decimal lenght. Now use for x the real vat real with no more decimal (x = 20 or x = 8.5 or x = 5.99, ...) --- htdocs/core/class/commondocgenerator.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 41ae45ef638..24c2fe34a93 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -388,11 +388,16 @@ abstract class CommonDocGenerator // Add vat by rates foreach ($object->lines as $line) { + // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); + // $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example) + $vatformated=vatrate($line->tva_tx); + if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; + $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; + $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); } - // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { From 016dbd39ee6535bb8099a9b2a2d3ed31305e951f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:24:47 +0200 Subject: [PATCH 085/116] Fix sql phpunit regression --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 -- htdocs/install/mysql/tables/llx_user.sql | 2 +- htdocs/user/class/user.class.php | 10 +++++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 231b89ee507..accf65266c1 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -86,5 +86,3 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( status tinyint DEFAULT 1 ) ENGINE=InnoDB; -ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 0 AFTER ref_int; - diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index c9673ceb360..e1fc421c911 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -26,7 +26,7 @@ create table llx_user ref_ext varchar(50), -- reference into an external system (not used by dolibarr) ref_int varchar(50), -- reference into an internal system (deprecated) - employee tinyint DEFAULT 0, -- 1 if user is an employee + employee tinyint DEFAULT 1, -- 1 if user is an employee datec datetime, tms timestamp, diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 066da9c18da..ae56be28aec 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -126,13 +126,17 @@ class User extends CommonObject { $this->db = $db; - // Preference utilisateur + // User preference $this->liste_limit = 0; $this->clicktodial_loaded = 0; + // For cache usage $this->all_permissions_are_loaded = 0; - $this->admin=0; - + + // Force some default values + $this->admin = 0; + $this->employee = 1; + $this->conf = new stdClass(); $this->rights = new stdClass(); $this->rights->user = new stdClass(); From 2cbfb69f9b70c851cd2e13a25010d91ab472f843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:28:14 +0200 Subject: [PATCH 086/116] Update template --- .../invoices/template_invoice.odt | Bin 25534 -> 37996 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/install/doctemplates/invoices/template_invoice.odt b/htdocs/install/doctemplates/invoices/template_invoice.odt index e9cd7c836fb0363394d73d3579ca7f84cb33cb01..dad29a292efcae907c1af651f8caae0fba453ec1 100644 GIT binary patch delta 36631 zcmaf4<5%b1+s!q3GADOu+qP}je6x*DZnA5#ZQGMQ*|zO^=Jyvoug;rmt#j5nm-fE) z=^h3@FNHu>l7)oA00V;q1GBT#l#EA~M*iOl=XhBrWdjB#Ws{hOB@Ec0NQ()pd1Rh< z{fr|Yb)`JcGncT+N=_?s)odzXoZFaV#WC^+XA+H*4E$qaNi1BqPWA*EqDbA(&YHcP zTAZ4)yTZPTl66Ym{~-;B1_liV0f{KlxVVtt-l$Mzeth?9q_P@s_BVsv5+clt1syL< z|G>b&$DsF>_vbrz^%=l(tQ58xaQ)N)PWURM8YakdPjz}N8TLb*@bh@4pmczU&G8A6b>PK&SfoV3|Ja*qdPEcSi21v*jWD;Z!n4ga>x|0 zQHb9F52A{-kt?A`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tjO<0u(v!UjlzZu#MPY}%e#WKO z-fJwqPPvV>6LGj0P9n}uXiGEPfaS9Tzbu};e}yOUg6 z7j8Lf`DQsLafe!|gFeHr9+0`&{{FO_n_9#s3uZ{8Wx*{XY$cf8VY?c}jA=H`r7+H4wdl02Jy z!qVtTN)5m@z_xmJ2&E^>fK)_(E?Pma&MGW@kul)Iijnb|Ag$9|^kVNCk$9e|zvy6u z>!bTH|5Jj2Na__N)J0ij6eU^z%-!L+MzOk_-A78m>?+}%>7F4AjSN1WryE#MRQcTr zQQtOSst}N&fR(UDT#sg@sn<@kF}h}QtZTAN6X5%E^kUKXdNGrQBG!I3DWgT2IA-A(|J4?6FE3~yKXg$r5$qgzHX0u%=qz0 z*H!$i*=i5|sWR3P=F-ZswjM+MPTB1tmjTjwDh0Cqc+0kZgIqJga%Cs3mu6Ao9yj@< zo^S_P`p}t?TSTSe+o0@CtX4X>25z08jnQ@_WNzhwpO^?$<#nDuyn_M$q)*C*k;1mv zOdIsA&%x`$tSA|aP<*U+t9J_B$|ia7E;S1gi61@&=TmdXFz=gd-ueV-l096qQIoPx zk!()k^{#v_!CD*Ryp>ldi1v Date: Fri, 23 Oct 2015 19:01:50 +0200 Subject: [PATCH 087/116] Update index.php --- htdocs/accountancy/customer/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ea37f237455..5cf4dac19b1 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -86,7 +86,7 @@ if ($action == 'validatehistory') { setEventMessage($db->lasterror(), 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } @@ -346,4 +346,4 @@ print "\n"; print ''; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); From c007ae9361777c261ac107a3014b6451b39d476c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 13:16:59 +0200 Subject: [PATCH 088/116] Fix php code not executed with some php version --- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 45ca3a5b728..1307304d1d6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -699,7 +699,7 @@ div#tmenu_tooltip { display:none; - padding-: px; + padding-: px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0fa988c16e8..4749d52f89c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -731,7 +731,7 @@ div#tmenu_tooltip { display:none; - /* padding-: px; */ + /* padding-: px; */ } From 43c80bec7d81a61c4f38759e3232562a6826f9fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 13:52:35 +0200 Subject: [PATCH 089/116] A better responsive menu for very small screen --- htdocs/main.inc.php | 12 ++++-------- htdocs/theme/eldy/style.css.php | 21 +++++++++++++++++---- htdocs/theme/md/style.css.php | 20 +++++++++++++++++--- htdocs/user/class/user.class.php | 31 +++++++++++++++++++++---------- 4 files changed, 59 insertions(+), 25 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ffc7d7c4777..4ece8af95c2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1485,14 +1485,10 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Add login user link $toprightmenu.=''; dol_fiche_end(); + + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($db); From b88a28b660f6073416575c2370b69c7ea88366d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 19:45:41 +0200 Subject: [PATCH 093/116] Restore compatibility with old version --- htdocs/user/class/user.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 965ac2544b8..2addea47f87 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1862,6 +1862,7 @@ class User extends CommonObject $result = ''; $companylink = ''; + $link = ''; $label = '' . $langs->trans("User") . ''; $label.= '
'; @@ -1914,7 +1915,7 @@ class User extends CommonObject $link.= '>'; $linkend=''; - if (abs($withpictoimg) == 1) $result.='
'; + //if ($withpictoimg == -1) $result.='
'; $result.=$link; if ($withpictoimg) { @@ -1929,7 +1930,7 @@ class User extends CommonObject $result.='
'.$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen).'
'; } $result.=$linkend; - if (abs($withpictoimg) == 1) $result.='
'; + //if ($withpictoimg == -1) $result.='
'; $result.=$companylink; return $result; } From 9d26d0fa4d09bdd8289e7592d477628099c6cafa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 21:13:28 +0200 Subject: [PATCH 094/116] Restore compatibility with old version --- htdocs/core/class/html.form.class.php | 11 ++++++----- htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b472b2a163..bc26812bd29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5255,9 +5255,10 @@ class Form * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo * @param int $genericifundef Use a generic image if no image avaiable + * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) { global $conf,$langs; @@ -5303,15 +5304,15 @@ class Form $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2addea47f87..ae985b22be5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1922,7 +1922,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 461771d4885892f26df470ce5357785d491f2f93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 21:13:28 +0200 Subject: [PATCH 095/116] Currency is on title only. --- htdocs/compta/bank/account.php | 8 ++++---- htdocs/core/class/html.form.class.php | 11 ++++++----- htdocs/user/class/user.class.php | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 500cf63b021..e3bc2a3fc2c 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref)) if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''; - print ''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total).''; print ' '; print ''; } else { @@ -961,9 +961,9 @@ if ($id > 0 || ! empty($ref)) if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("Total"); print ' '.$object->currency_code.''; - print ''.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).''; - print ''.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).''; - print ''.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total_deb*-1).''; + print ''.price($total_cred).''; + print ''.price($total_cred-($total_deb*-1)).''; print ' '; print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b472b2a163..bc26812bd29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5255,9 +5255,10 @@ class Form * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo * @param int $genericifundef Use a generic image if no image avaiable + * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) { global $conf,$langs; @@ -5303,15 +5304,15 @@ class Form $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2addea47f87..ae985b22be5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1922,7 +1922,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 1b8234d9fe416d531d7951ead1ef830893c672d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 11:09:50 +0100 Subject: [PATCH 096/116] Bette behaviour for blind people --- htdocs/contact/class/contact.class.php | 11 +++++++++-- htdocs/core/boxes/box_contacts.php | 22 +++++++++++++++++----- htdocs/index.php | 4 ++-- htdocs/langs/en_US/companies.lang | 2 +- htdocs/societe/class/societe.class.php | 18 +++++++++++++++--- htdocs/user/class/user.class.php | 16 ++++++++++++++-- 6 files changed, 58 insertions(+), 15 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9a887bf9fdb..723784d9a5d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -908,7 +908,7 @@ class Contact extends CommonObject */ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') { - global $langs; + global $conf, $langs; $result=''; $label = '' . $langs->trans("ShowContact") . ''; @@ -923,7 +923,14 @@ class Contact extends CommonObject $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist); $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs); - $link = ''; + $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowContact"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip">'; $linkend=''; if ($option == 'xxx') diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 18a09af6ace..a1fc2768ba1 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -63,8 +63,9 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; - $sql.= ", s.nom as socname"; - $sql.= ", s.code_client"; + $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile"; + $sql.= ", s.nom as socname, s.name_alias"; + $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -93,10 +94,21 @@ class box_contacts extends ModeleBoxes $contactstatic->firstname=$objp->firstname; $contactstatic->civility_id=$objp->civility_id; $contactstatic->statut=$objp->status; - $societestatic->id = $objp->fk_soc; - $societestatic->code_client = $objp->code_client; + $contactstatic->phone_pro = $objp->phone; + $contactstatic->phone_perso = $objp->phone_perso; + $contactstatic->phone_mobile = $objp->phone_mobile; + $contactstatic->address = $objp->address; + $contactstatic->zip = $objp->zip; + $contactstatic->town = $objp->town; + + $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname; - + $societestatic->name_alias = $objp->name_alias; + $societestatic->code_client = $objp->code_client; + $societestatic->code_fournisseur = $objp->code_fournisseur; + $societestatic->client = $objp->client; + $societestatic->fournisseur = $objp->fournisseur; + $this->info_box_contents[$line][] = array( 'td' => 'align="left"', 'text' => $contactstatic->getNomUrl(1), diff --git a/htdocs/index.php b/htdocs/index.php index 5db358aa34b..818da8f9ecd 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -103,7 +103,7 @@ print '
'; * Informations area */ -print ''; +print '
'; print ''; print ''; print ''; @@ -129,7 +129,7 @@ $langs->load("contracts"); if (empty($user->societe_id)) { print '
'; - print '
'.$langs->trans("Informations").'
'.$langs->trans("User").''.$user->getNomUrl(0).'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index e3fd6fadeec..3e93a48d7b5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -305,7 +305,7 @@ ListOfCustomersContacts=List of customer contacts ListOfSuppliersContacts=List of supplier contacts ListOfCompanies=List of companies ListOfThirdParties=List of third parties -ShowCompany=Show company +ShowCompany=Show thirdparty 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 1f5f10c9178..fb99f819af2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1824,10 +1824,13 @@ class Societe extends CommonObject } if (! empty($this->name)) + { $label.= '
' . $langs->trans('Name') . ': '. $this->name; - if (! empty($this->code_client)) + if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')'; + } + if (! empty($this->code_client) && $this->client) $label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client; - if (! empty($this->code_fournisseur)) + if (! empty($this->code_fournisseur) && $this->fournisseur) $label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; if (! empty($this->logo)) @@ -1841,7 +1844,16 @@ class Societe extends CommonObject // Add type of canvas $link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"'; - $link.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"'); + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowCompany"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.=' class="classfortooltip"'; + } $link.='>'; $linkend=''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ae985b22be5..a165a735f84 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1911,7 +1911,17 @@ class User extends CommonObject } $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $langs->load("users"); + $label=$langs->trans("ShowUser"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } $link.= '>'; $linkend=''; @@ -1927,7 +1937,9 @@ class User extends CommonObject } if (abs($withpictoimg) != 2) { - $result.='
'.$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen).'
'; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; + $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; } $result.=$linkend; //if ($withpictoimg == -1) $result.=''; From 1261ad43a1d30bd3703083aad451bb9e4f52a6d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 18:15:37 +0100 Subject: [PATCH 097/116] NEW Can select which field to show into list of users. --- htdocs/societe/list.php | 44 ++--- htdocs/user/index.php | 426 ++++++++++++++++++++++++++++++---------- 2 files changed, 340 insertions(+), 130 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 98795e27667..0e102af33f9 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -338,8 +338,8 @@ else dol_print_error($db); $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; $sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; -$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4,"; -$sql.= " s.fk_pays, s.tms as date_update, s.datec as date_creation,"; +$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,"; +$sql.= " s.tms as date_update, s.datec as date_creation,"; $sql.= " typent.code as typent_code"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -575,10 +575,10 @@ if ($resql) 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), - 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>200), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - ); + 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + ); $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'.$langs->trans("DolibarrStateBoard").' 
'; @@ -618,9 +618,9 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -795,25 +795,25 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['s.status']['checked'])) - { - // Status - print ''; - } + // Date creation if (! empty($arrayfields['s.datec']['checked'])) { - // Date creation print ''; } + // Date modification if (! empty($arrayfields['s.tms']['checked'])) { - // Date modification print ''; } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; + } // Action column print ''; - } - if (! empty($arrayfields['s.datec']['checked'])) - { - // Date creation print ''; } + // Date modification if (! empty($arrayfields['s.tms']['checked'])) { - // Date modification print ''; + } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; } // Action column print ''; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 921697ade51..40fe8353093 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -47,6 +47,8 @@ $search_lastname=GETPOST('search_lastname','alpha'); $search_firstname=GETPOST('search_firstname','alpha'); $search_statut=GETPOST('search_statut','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); +$search_supervisor=GETPOST('search_supervisor','alpha'); +$search_previousconn=GETPOST('search_previousconn','alpha'); $optioncss = GETPOST('optioncss','alpha'); if ($search_statut == '') $search_statut='1'; @@ -62,6 +64,14 @@ $limit = $conf->liste_limit; if (! $sortfield) $sortfield="u.login"; if (! $sortorder) $sortorder="ASC"; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('userlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('user'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $userstatic=new User($db); $companystatic = new Societe($db); $form = new Form($db); @@ -74,8 +84,35 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_firstname=""; $search_statut=""; $search_thirdparty=""; + $search_supervisor=""; + $search_datelastlogin=""; + $search_datepreviouslogin=""; + $search_date_creation=""; + $search_date_update=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'u.login'=>"Login", + 'u.firstname'=>"Firstname", + 'u.lastname'=>"Lastname", + 'u.accountancy_code'=>"AccountancyCode", + 'u.email'=>"EMail", + 'u.note'=>"Note" +); + + +/* + * Actions + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + /* * View @@ -88,12 +125,17 @@ $buttonviewhierarchy='attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; @@ -106,14 +148,33 @@ else $sql.= " WHERE u.entity IN (".getEntity('user',1).")"; } if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; -if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); -if ($search_login != '') $sql.= natural_search("u.login", $search_login); -if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); -if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_login != '') $sql.= natural_search("u.login", $search_login); +if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); +if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall); +if ($sall) $sql.= natural_search($fieldstosearchall, $sall); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.=$db->order($sortfield,$sortorder); +//$sql.= $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); if ($result) @@ -121,54 +182,153 @@ if ($result) $num = $db->num_rows($result); $i = 0; + $param=''; + if ($sall != '') $param.='&sall='.urlencode($sall); + if ($search_user != '') $param.="&search_user=".$search_user; + if ($search_login != '') $param.="&search_login=".$search_login; + if ($search_lastname != '') $param.="&search_lastname=".$search_lastname; + if ($search_firstname != '') $param.="&search_firstname=".$search_firstname; + if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor; + if ($search_statut != '') $param.="&search_statut=".$search_statut; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print ''."\n"; if ($optioncss != '') print ''; - - $param="search_user=".$search_user."&sall=".$sall; - $param.="&search_statut=".$search_statut; - if ($optioncss != '') $param.='&optioncss='.$optioncss; - + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + + $arrayfields=array( + 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), + 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), + 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), + 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), + 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), + 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), + 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + ); + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; print ''; print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; if ($type != '') print ''; @@ -971,24 +971,24 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - // Status - if (! empty($arrayfields['s.status']['checked'])) + // Date creation + if (! empty($arrayfields['s.datec']['checked'])) { - print ''.$companystatic->getLibStatut(3).''; print dol_print_date($obj->date_creation, 'dayhour'); print ''; print dol_print_date($obj->date_update, 'dayhour'); print ''.$companystatic->getLibStatut(3).'
'; print ''; - print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) - { - print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); - } - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER['PHP_SELF'],"u.datec",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) + { + foreach($extrafields->attribute_list as $key => $val) + { + if ($val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"u.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"u.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"u.statut","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; // Search bar - $colspan=3; - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Status - print ''; - - print ''; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_user']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) + { + // Date creation + print ''; + } + if (! empty($arrayfields['u.tms']['checked'])) + { + // Date modification + print ''; + } + if (! empty($arrayfields['u.statut']['checked'])) + { + // Status + print ''; + } + // Action column + print ''; - + print "\n"; $user2=new User($db); $var=True; + //while ($i < min($num,$conf->liste_limit)) while ($i < $num) { $obj = $db->fetch_object($result); @@ -183,87 +343,137 @@ if ($result) $userstatic->societe_id=$obj->fk_soc; $userstatic->firstname=''; $userstatic->lastname=$obj->login; - + $li=$userstatic->getNomUrl(1,'',0,0,24,1); print ""; - print ''; - print ''; - print ''; - print "'; - + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print "'; + } // Multicompany enabled if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) { - print ''; + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } } - - // Date creation - print ''; - + // Supervisor + if (! empty($arrayfields['u.fk_user']['checked'])) + { + // Resp + print ''; + } + // Date last login - print ''; - - // Resp - print ''; + } + // Date previous login + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['u.datec']['checked'])) { - $user2->login=$obj->login2; - //$user2->lastname=$obj->lastname2; - //$user2->firstname=$obj->firstname2; - $user2->lastname=$user2->login; - $user2->firstname=''; - print $user2->getNomUrl(1); + print ''; } - print ''; + // Date modification + if (! empty($arrayfields['u.tms']['checked'])) + { + print ''; + } + // Status + if (! empty($arrayfields['u.statut']['checked'])) + { + $userstatic->statut=$obj->statut; + print ''; + } + // Action column + print ''; - // Statut - $userstatic->statut=$obj->statut; - print ''; - print ''; print "\n"; $i++; } + + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print "
 '; - print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); - print ''; + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + print ''; + print ''; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; + print ''; print ''; print '
'; - print $li; - if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) - { - print img_picto($langs->trans("SuperAdministrator"),'redstar'); - } - else if ($obj->admin) - { - print img_picto($langs->trans("Administrator"),'star'); - } - print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).'"; - if ($obj->fk_soc) - { - $companystatic->id=$obj->fk_soc; - $companystatic->name=$obj->name; - $companystatic->canvas=$obj->canvas; - print $companystatic->getNomUrl(1); - } - else if ($obj->ldap_sid) - { - print $langs->trans("DomainUser"); - } - else - { - print $langs->trans("InternalUser"); - } - print ''; + print $li; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"),'star'); + } + print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).'"; + if ($obj->fk_soc) + { + $companystatic->id=$obj->fk_soc; + $companystatic->name=$obj->name; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1); + } + else if ($obj->ldap_sid) + { + print $langs->trans("DomainUser"); + } + else + { + print $langs->trans("InternalUser"); + } + print ''; - if (! $obj->entity) - { - print $langs->trans("AllEntities"); - } - else - { - // $mc is defined in conf.class.php if multicompany enabled. - if (is_object($mc)) - { - $mc->getInfo($obj->entity); - print $mc->label; - } - } - print ''; + if (! $obj->entity) + { + print $langs->trans("AllEntities"); + } + else + { + // $mc is defined in conf.class.php if multicompany enabled. + if (is_object($mc)) + { + $mc->getInfo($obj->entity); + print $mc->label; + } + } + print ''.dol_print_date($db->jdate($obj->datec),"dayhour").''; + if ($obj->login2) + { + $user2->login=$obj->login2; + //$user2->lastname=$obj->lastname2; + //$user2->firstname=$obj->firstname2; + $user2->lastname=$user2->login; + $user2->firstname=''; + print $user2->getNomUrl(1); + } + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''; - if ($obj->login2) + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''; + print dol_print_date($obj->date_creation, 'dayhour'); + print ''; + print dol_print_date($obj->date_update, 'dayhour'); + print ''.$userstatic->getLibStatut(3).''.$userstatic->getLibStatut(5).' 
"; print "\n"; $db->free($result); From b49d63c12f2389d310c03d9908f528feae4062a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:31:13 +0100 Subject: [PATCH 098/116] NEW Show photo of user into user list. A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith. --- htdocs/core/class/html.form.class.php | 39 ++++++++++++++++++++------ htdocs/core/lib/functions.lib.php | 30 ++++++++++++++++++++ htdocs/core/lib/images.lib.php | 4 +-- htdocs/theme/eldy/img/object_user.png | Bin 607 -> 651 bytes htdocs/user/class/user.class.php | 12 ++++---- htdocs/user/group/index.php | 2 +- htdocs/user/hierarchy.php | 8 ++++-- htdocs/user/index.php | 33 +++++++++++++++------- 8 files changed, 99 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bc26812bd29..6bb8049f6f6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5254,11 +5254,11 @@ class Form * @param int $height Height of photo (auto if 0) * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo - * @param int $genericifundef Use a generic image if no image avaiable + * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='',$addlinktofullsize=1) { global $conf,$langs; @@ -5272,29 +5272,52 @@ class Form $dir=$conf->societe->multidir_output[$entity]; $smallfile=$object->logo; $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); - if (! empty($object->logo)) $file=$id.'/logos/thumbs/'.$smallfile; + if (! empty($object->logo)) + { + if ($imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); + else if ($imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); + else $file=$id.'/logos/thumbs/'.$smallfile; + } } else if ($modulepart=='contact') { $dir=$conf->societe->multidir_output[$entity].'/contact'; - $file=$id.'/photos/'.$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); + else $file=$id.'/photos/'.$object->photo; + } } else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + if (! empty($object->photo)) + { + //var_dump(getImageFileNameForSize($object->photo, '_mini')); + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } else if ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'invoice_supplier').'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; - } else { + } + else + { $dir=$conf->$modulepart->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; + if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 896cc0824d0..0750d1d24b0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5223,3 +5223,33 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } + +/** + * Return the filename of file to get the thumbs + * + * @param string $file Original filename + * @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini') + * @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image. + * @return string New file name + */ +function getImageFileNameForSize($file, $extName, $extImgTarget='') +{ + $dirName = dirname($file); + if ($dirName == '.') $dirName=''; + + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse + $fileName = basename($fileName); + + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':''); + + if (! $extImgTarget) return $file; + + $subdir=''; + if ($extName) $subdir = 'thumbs/'; + + return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb +} diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 7e47f755a7e..e61dc22eeb0 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -483,7 +483,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ break; case IMAGETYPE_JPEG: // 2 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); - $extImgTarget = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); + $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'.jpg'); $newquality=$quality; break; case IMAGETYPE_PNG: // 3 @@ -512,7 +512,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse $fileName = basename($fileName); - $imgThumbName = $dirthumb.'/'.$fileName.$extName.$extImgTarget; // Chemin complet du fichier de la vignette + $imgThumbName = $dirthumb.'/'.getImageFileNameForSize($file, $extName, $extImgTarget); // Chemin complet du fichier de la vignette // Check if permission are ok //$fp = fopen($imgThumbName, "w"); diff --git a/htdocs/theme/eldy/img/object_user.png b/htdocs/theme/eldy/img/object_user.png index d26d8899ee80f1e4976260b265a3e7d75ebab61d..6452b94da6803fa598cfacb8c6bbe0b61232a0b1 100644 GIT binary patch delta 637 zcmV-@0)qYD1d9cb8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys84(~Mj1>7*0006QNkl$@!A=uV6o$WhXUdeO z&;o*Bi3^BOT@;w25H_+maigwWn7G0xa3@c|Gxz{J0S{nIG=I)Q)EO{dwa3(`vgG%fZGRr z-=|P0xDOw#?##}XUWLsNi?Fm@c`ITIz?(h8usW5uz#!C7~(IXgS+Dy^&{ zc51cSU&oD&wf=4N!o7vEo5|cy(lk~|0bqyp?yGt#;?)qPZnv$3cytbY2uWP@V=X5-X98Sh=(!ms-)DTbSoJ X@GAtI0IY4*00000NkvXXu0mjfk?J6G literal 607 zcmb`C&ubGw6vwx=AvHCnNGddzqJm)cVo^$q7qcXqge1h6Rtz3m7V$@{s9Or@s-SGu z+713-5yjDiFhbKzAmD&0OfSMvQT8CXD&k&R9MjA6)Zh<@v;GZ!c<=jt?;RfR&8AaF z{l1`2k|cjD8qNssbhEux=$=R4R)l#cW66m3i??^{?tMO1d@DwqFGWwPlH^-=vqdf+ zd@P1-XF|!4BvtQq{2BL%el4BIMuz+2@<2u&$i;{Axww+cXo`~0E1Ih4YTi^;O;dGE zH4R-ibi>ers7%BB2Lgr$OdYsD2y_Sx2oQ7;iV-xCs}#9lgeZnU7{($5gg}E}NH8VD zBm@ycDAXx|lv2wAmSx#Cwr$(7f#YDuaTrpWLl}dMA;vIcqP7@goFUFI=a6%ugmcQd z%{gyy+~Bm)5YcEho5dixD85cjW>UvR`~Q&2$={aP{5%#8W!pa~>z+;ioep)mIc>bvd1gCc@!dZp*SqI`po8=photo)) { $label.= '
'; - $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip'); + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small'); $label.= '
'; } @@ -1932,13 +1932,14 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 0, 0, 'mini').'
'; $result.=$picto; } if (abs($withpictoimg) != 2) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; - $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); + else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; } $result.=$linkend; @@ -2398,7 +2399,7 @@ class User extends CommonObject $this->load_parentof(); // Init $this->users array - $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates + $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) { @@ -2429,6 +2430,7 @@ class User extends CommonObject $this->users[$obj->rowid]['email'] = $obj->email; $this->users[$obj->rowid]['gender'] = $obj->gender; $this->users[$obj->rowid]['admin'] = $obj->admin; + $this->users[$obj->rowid]['photo'] = $obj->photo; $i++; } } diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 058f3ac92e2..f515c8307e7 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -94,7 +94,7 @@ if ($resql) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],"g.entity",$param,"",'align="center"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("NbOfUsers"),$_SERVER["PHP_SELF"],"nb",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; $var=True; while ($i < $num) diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index a9aef6ed783..14b8ec4265b 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -82,6 +82,7 @@ foreach($fulltree as $key => $val) { $userstatic->id=$val['id']; $userstatic->ref=$val['label']; + $userstatic->login=$val['login']; $userstatic->firstname=$val['firstname']; $userstatic->lastname=$val['lastname']; $userstatic->statut=$val['statut']; @@ -90,6 +91,7 @@ foreach($fulltree as $key => $val) $userstatic->societe_id=$val['fk_soc']; $userstatic->admin=$val['admin']; $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; $entity=$val['entity']; $entitystring=''; @@ -111,7 +113,7 @@ foreach($fulltree as $key => $val) } } - $li=$userstatic->getNomUrl(1,'',0,1); + $li=$userstatic->getNomUrl(-1,'',0,1); if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity) { $li.=img_picto($langs->trans("SuperAdministrator"),'redstar'); @@ -121,12 +123,12 @@ foreach($fulltree as $key => $val) $li.=img_picto($langs->trans("Administrator"),'star'); } $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; - + $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_user'], 'statut'=>$val['statut'], - 'entry'=>'
'.$li.''.$userstatic->getLibStatut(5).'
' + 'entry'=>'
'.$li.''.$userstatic->getLibStatut(3).'
' ); } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 40fe8353093..7688cadbe05 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -124,11 +124,11 @@ $buttonviewhierarchy='
attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; @@ -341,10 +341,11 @@ if ($result) $userstatic->email=$obj->email; $userstatic->gender=$obj->gender; $userstatic->societe_id=$obj->fk_soc; - $userstatic->firstname=''; - $userstatic->lastname=$obj->login; + $userstatic->firstname=$obj->firstname; + $userstatic->lastname=$obj->lastname; + $userstatic->photo=$obj->photo; - $li=$userstatic->getNomUrl(1,'',0,0,24,1); + $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); print ""; if (! empty($arrayfields['u.login']['checked'])) @@ -418,12 +419,24 @@ if ($result) print ''; if ($obj->login2) { + $user2->id=$obj->id2; $user2->login=$obj->login2; - //$user2->lastname=$obj->lastname2; - //$user2->firstname=$obj->firstname2; - $user2->lastname=$user2->login; - $user2->firstname=''; - print $user2->getNomUrl(1); + $user2->lastname=$obj->lastname2; + $user2->firstname=$obj->firstname2; + $user2->gender=$obj->gender2; + $user2->photo=$obj->photo2; + $user2->admin=$obj->admin2; + $user2->email=$obj->email2; + $user2->societe_id=$obj->fk_soc2; + print $user2->getNomUrl(-1,'',0,0,24,0,''); + if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin2) + { + print img_picto($langs->trans("Administrator"),'star'); + } } print ''; } From 48ed8d440869b64f532c079055660bbb42fefe8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:42:00 +0100 Subject: [PATCH 099/116] FIX The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs. --- htdocs/core/class/html.form.class.php | 10 +++++++-- htdocs/core/lib/functions.lib.php | 29 +++++++++++++++++++++++++++ htdocs/main.inc.php | 2 +- htdocs/user/class/user.class.php | 5 +++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b75bd01d2aa..9b0ef17b465 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5134,10 +5134,11 @@ class Form * @param int $width Width of photo * @param int $height Height of photo (auto if 0) * @param int $caneditfield Add edit fields + * @param string $imagesize 'mini', 'small' or '' (original) * @param string $cssclass CSS name to use on img for photo * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin') + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='') { global $conf,$langs; @@ -5156,7 +5157,12 @@ class Form else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; - if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 290cdb2300b..04c2c02a7d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5118,3 +5118,32 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } +/** + * Return the filename of file to get the thumbs + * + * @param string $file Original filename + * @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini') + * @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image. + * @return string New file name + */ +function getImageFileNameForSize($file, $extName, $extImgTarget='') +{ + $dirName = dirname($file); + if ($dirName == '.') $dirName=''; + + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse + $fileName = basename($fileName); + + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':''); + + if (! $extImgTarget) return $file; + + $subdir=''; + if ($extName) $subdir = 'thumbs/'; + + return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb +} diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 51147a03a9c..92d421d42cb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1443,7 +1443,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // User photo $toprightmenu.='
'; // Login name with tooltip diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e375a3c3d80..4459dfc3fc0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1813,14 +1813,15 @@ class User extends CommonObject * @param int $width Width of image * @param int $height Height of image * @param string $cssclass Force a css class + * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='') + function getPhotoUrl($width, $height, $cssclass='', $imagesize='') { $result=''; $result.=''; - $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass); + $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); $result.=''; return $result; From d7761ece58ea0cfaf8ede926b3e3a5dc42427cdd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:42:54 +0100 Subject: [PATCH 100/116] FIX The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs. --- htdocs/core/class/html.form.class.php | 3 +-- htdocs/user/class/user.class.php | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6bb8049f6f6..a192b54c200 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5258,7 +5258,7 @@ class Form * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='',$addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1) { global $conf,$langs; @@ -5294,7 +5294,6 @@ class Form $dir=$conf->user->dir_output; if (! empty($object->photo)) { - //var_dump(getImageFileNameForSize($object->photo, '_mini')); if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index dd63a144226..e281f4002f3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1825,14 +1825,15 @@ class User extends CommonObject * @param int $width Width of image * @param int $height Height of image * @param string $cssclass Force a css class + * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='') + function getPhotoUrl($width, $height, $cssclass='', $imagesize='') { $result=''; $result.=''; - $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass); + $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); $result.=''; return $result; From 24732cf454405793f35ddae77d02f343bb4824bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:01:39 +0100 Subject: [PATCH 101/116] Fix to avoid duplicate tooltip --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e828117327b..77437667c33 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1575,7 +1575,7 @@ class Adherent extends CommonObject $picto='user'; - if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); + if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend; return $result; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e281f4002f3..d4358bb2b0a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1845,7 +1845,7 @@ class User extends CommonObject * * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) * @param string $option On what the link point to - * @param integer $infologin Add connection info to the tooltip + * @param integer $infologin Add complete info tooltip * @param integer $notooltip 1=Disable tooltip on picto and name * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user From 54883f2d84c788182fadf10a4c11f1bcf990b604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:14:57 +0100 Subject: [PATCH 102/116] FIX Bad picto for expense report --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 920c6aa16d7..0dba68b5b5c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1534,7 +1534,7 @@ class ExpenseReport extends CommonObject $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; - $response->img=img_object($langs->trans("ExpenseReports"),"user"); + $response->img=img_object($langs->trans("ExpenseReports"),"trip"); while ($obj=$this->db->fetch_object($resql)) { From 9a4b62c279dc0c16c1457c787ea0c7a5fdeb67a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:15:52 +0100 Subject: [PATCH 103/116] NEW Introduce use of cache for thumbs images of users --- htdocs/core/class/html.form.class.php | 27 ++++++++++++++++----------- htdocs/user/class/user.class.php | 4 ++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a192b54c200..5f714a85bcd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5256,9 +5256,10 @@ class Form * @param string $cssclass CSS name to use on img for photo * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image + * @param int $cache 1=Accept to use image in cache * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0) { global $conf,$langs; @@ -5274,8 +5275,8 @@ class Form $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); if (! empty($object->logo)) { - if ($imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); - else if ($imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); + if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); else $file=$id.'/logos/thumbs/'.$smallfile; } } @@ -5284,8 +5285,8 @@ class Form $dir=$conf->societe->multidir_output[$entity].'/contact'; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); else $file=$id.'/photos/'.$object->photo; } } @@ -5294,8 +5295,8 @@ class Form $dir=$conf->user->dir_output; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility @@ -5306,8 +5307,8 @@ class Form $dir=$conf->adherent->dir_output; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility @@ -5316,14 +5317,18 @@ class Form else { $dir=$conf->$modulepart->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } if ($dir) { - $cache='0'; if ($file && file_exists($dir."/".$file)) { if ($addlinktofullsize) $ret.=''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d4358bb2b0a..f16af2ee72d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1886,7 +1886,7 @@ class User extends CommonObject if (! empty($this->photo)) { $label.= '
'; - $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small'); + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); $label.= '
'; } @@ -1933,7 +1933,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 0, 0, 'mini').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 080ba15e0de42ec5477be20dfc72fec7f216d8f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 22:50:05 +0100 Subject: [PATCH 104/116] FIX The price per level just never correctly manage the vat. Vat is not per level but depends on seller and supplyer. I kept a hidden option to keep old behaviour that was bugged. --- htdocs/compta/facture.php | 34 +++--- htdocs/langs/en_US/products.lang | 2 + htdocs/product/price.php | 192 +++++++++++++++++++++++-------- 3 files changed, 166 insertions(+), 62 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f2148f8e063..983331bd412 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1283,7 +1283,8 @@ if (empty($reshook)) // Ecrase $txtva par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (! empty($idprod)) { + if (! empty($idprod)) + { $prod = new Product($db); $prod->fetch($idprod); @@ -1304,8 +1305,11 @@ if (empty($reshook)) $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + } } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -1318,26 +1322,30 @@ if (empty($reshook)) $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; } } } - // if price ht is forced (ie: calculated by margin rate and cost price) - if (! empty($price_ht)) { + // if price ht was forced (ie: from gui when calculated by margin rate and cost price) + if (! empty($price_ht)) + { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } - // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - elseif ($tva_tx != $prod->tva_tx) { - if ($price_base_type != 'HT') { + elseif ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); - } else { + } + else + { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index e108dfff52b..1759eb12e9f 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -67,6 +67,8 @@ ProductStatusNotOnBuy=Not for purchase ProductStatusOnBuyShort=For purchase ProductStatusNotOnBuyShort=Not for purchase UpdatePrice=Update price +UpdateVAT=Update vat +UpdateDefaultPrice=Update default price AppliedPricesFrom=Applied prices from SellingPrice=Selling price SellingPriceHT=Selling price (net of tax) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9c7defc4643..ac611faf5c3 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -84,8 +84,37 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($action == 'update_price' && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object->tva_tx = GETPOST('tva_tx'); + + $db->begin(); + + $resql = $object->update($object->id, $user); + if (! $resql) + { + $error++; + } + + if ($error) + { + $object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq); + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + + $action=''; + } + + if (($action == 'update_price') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + { $maxpricesupplier = $object->min_recommended_price(); $object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression @@ -399,6 +428,11 @@ if ($isphoto) { print ''; +// Status (to sell) +print '' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; +print $object->getLibStatut(2, 0); +print ''; + // MultiPrix if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -433,14 +467,32 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]); } print ''; - - // TVA - print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . ''; + + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . ''; + } + else + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; + } + } else { - // We show only vat for level 1 - print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + // We show only vat for level 1 + print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; + } + else + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; + } + print ''.$langs->trans("PriceLevel").''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").''; for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) @@ -551,7 +603,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) } } } -} else { +} +else +{ // TVA print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; @@ -649,11 +703,6 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) } } -// Status (to sell) -print '' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; -print $object->getLibStatut(2, 0); -print ''; - print "\n"; dol_fiche_end(); @@ -669,16 +718,69 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ { print "\n" . '
' . "\n"; - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - + else + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + print "\n
\n"; } + + /* - * Edition du prix + * Edit price area */ + +if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->service->creer)) +{ + print load_fiche_titre($langs->trans("UpdateVAT"), ''); + + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head(''); + + print ''; + + // VAT + print ''; + + print '
' . $langs->trans("VATRate") . ''; + print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr); + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print '

'; +} + if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer)) { print load_fiche_titre($langs->trans("NewPrice"), ''); @@ -785,26 +887,31 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } else { - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + dol_fiche_head(''); + + for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { + if ($i > 1) print '
'; + print '
'; - print ''; + print ''; print ''; print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { + print ''; + } - dol_fiche_head(''); - print ''; // VAT - if ($i == 1) { + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { print ''; - } else { // We always use the vat rate of price level 1 (A vat rate does not depends on customer) - print ''; } - + // Selling price print '
' . $langs->trans("VATRate") . ''; - print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx ["$i"], $mysoc, '', $object->id); + print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx["$i"], $mysoc, '', $object->id); print '
'; $text = $langs->trans('SellingPrice') . ' ' . $i; @@ -839,10 +946,10 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print '
'; - dol_fiche_end(); - print '
'; } + + dol_fiche_end(); } } @@ -886,14 +993,14 @@ if ($result) print '' . $langs->trans("AppliedPricesFrom") . ''; if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - print '' . $langs->trans("MultiPriceLevelsName") . ''; + print '' . $langs->trans("PriceLevel") . ''; } if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { print '' . $langs->trans("Type") . ''; } print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; if (! empty($conf->dynamicprices->enabled)) { @@ -928,7 +1035,7 @@ if ($result) } print '' . $langs->trans($objp->price_base_type) . ""; - print '' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . ""; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . ""; //Price if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled)) @@ -942,14 +1049,14 @@ if ($result) } else { - print '' . price($objp->price) . ""; - print '' . price($objp->price_ttc) . ""; + print '' . ($objp->price_base_type != 'TTC' ? price($objp->price) : ''). ""; + print '' . ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '') . ""; if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled print ''; } } - print '' . price($objp->price_min) . ''; - print '' . price($objp->price_min_ttc) . ''; + print '' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . ''; + print '' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . ''; // User print '' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . ''; @@ -1202,7 +1309,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("ThirdParty") . ''; print '' . $langs->trans("AppliedPricesFrom") . ''; print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; @@ -1275,7 +1382,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("ThirdParty") . ''; print '' . $langs->trans("AppliedPricesFrom") . ''; print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; @@ -1355,19 +1462,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ""; print ""; - - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - - print "\n" . '
' . "\n"; - - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - print "\n

\n"; } } From 132bc610b6ccd5ba7a8616289454aba76315aa98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 23:32:49 +0100 Subject: [PATCH 105/116] Icon for contact contains a part of thirdparty icon to make things easier to understand --- htdocs/comm/card.php | 2 +- htdocs/societe/soc.php | 12 +++++++++++- htdocs/theme/eldy/img/object_contact.png | Bin 593 -> 666 bytes htdocs/theme/eldy/img/object_group.png | Bin 912 -> 655 bytes htdocs/theme/eldy/img/object_user.png | Bin 651 -> 581 bytes htdocs/theme/md/img/object_contact.png | Bin 593 -> 666 bytes htdocs/theme/md/img/object_group.png | Bin 912 -> 655 bytes htdocs/theme/md/img/object_user.png | Bin 607 -> 581 bytes 8 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fe164006a29..b874eeefde5 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -226,7 +226,7 @@ if ($id > 0) print ''; // Alias name (commercial, trademark or alias name) - print '"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 93fff61d1f1..71fa3b66a74 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1908,7 +1908,17 @@ else print $object->name_alias; print ""; - // Prefix + // Prospect/Customer + print ''; + + // Prospect/Customer + print ''; + + // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; diff --git a/htdocs/theme/eldy/img/object_contact.png b/htdocs/theme/eldy/img/object_contact.png index e98202b367d15cdb2509122e8d4f0e009396f2ba..d4272f367c6e5eae37c9ddc745fd8a9be7d05bb7 100644 GIT binary patch delta 653 zcmV;80&@M)1eyhq8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys85SN9?nlG{0006fNklN=8P8; z^8?E@F+mzhZ3`l;h$*;~4qbGqNS6*yb@4B7@~?2If;cpTyMJATZZ?RJLb1I?nrvxo z^sXi)?_KV_*CC`-5Pjz7^ZkCGhp)kZrqMXk4X26cO0eMZ@?CD;EEwWnP`mAF$2q2) z&jFHlv(2m82aejVHpffz^Yhmh7Z+a^i^V5OsaUJkdi(nQM;_d+u)X6T<$$*5;klAp zb_Zi?YuDP`e18#EtJOE9Qt7Gdx@fJ*WHM+SV`=FTPV@LYMZS=w-f%Fn2p1L>uEgW< z^=`LI7=|dN==FM}(`okh4mmtJ1;CRomSs^WHa2YAwmV}eiXw)?A(NAn%*@;) z2+|A~0FcWjaGW+KK&R7@LWo{EoxU0b0bv*tMG>Cok$=hLI5|NSs54@nF4%5TlQt)Tl}G6#jD1Z-zW8T z&YspcYu2oFE0^xrx@rI3JspcK^{>3yvF3Tl#!uawKD2K9(YO2mqKzk4?!3Qu@1bS8 zKP@}-ebbSbyH3A5b>_<5>lg0czIp5JqeEA}AHDnk?&Hr-9^d`><;DO1zyJULZ<^0> z92h!bB|(0{KrZzGgO_j4O`r`0o-U3d9M_XMSeX@FT@B7MJj^<|uxRUqok@OvR*MSO zE!wtr+gu^}DcUO*EnT^6p{5$g!&MnAQqtNjuRb^JRIu)mIdXt!#mQygqCC{3ttBk9 zm3FkT{W0006UNklgsC0-EKb;k*p|+SJUaVzqz^T_>c0Pot?bf?Y?NY+mGwI z2B6dFJXh6Az|;SMW^ZrrVzb#SthISc2~{PfgoyC&-P@O)PUm4tk_`rfSHt13zrVll z0CMmBQlrtxV}Fc@2qHp^k>T(MH#d4u%1Mc!+_`)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lep^xG*`R%)*RWab7hCzBL2 zdrB!Nt)aDs)(Rv93i(29?yLQNKPExrTrQK4Fz|XnCpG`*Kz&tvJ7!|DMTa zo8+066FV$t5#`!5~NQ{lqf>@TS&C xV+?!Ny8xH~5c6McGZ7eoBO=Glej$G|^9Mvg*wk5w1(*N;002ovPDHLkV1jqH=U4y$ delta 578 zcmV-I0=@mk1d9cbRDTg5A&eCHRR9127)eAyR4C7FlEF?BQ51&1duPg&rqBX{V2KNe zP+b(5q7XK+H*uq`T$s4RCvYcEz%%#&JOK}2Of=3y)EO{dwa3(`+o#M0D#*EeBY-~D7X(F zt?taumR^O;5R0(1TzM;E3&5K`1fcsx5CkkQFXcSXds%NZFtH)-b~!#dW`2Hd3&;;9 z(}PXt`Z_BjZXCzN#$b%Wm>8usW5uz#!C7~(IXgS+Dy^&{c51cSU&oD& zwf=4N!o7vEo5|cy(lk~|0bqDPY)ItNM{d1QaygQY5o2_=|;-a}FV#h&^pmbgoIZ&PkED|e`j##<0B9~gxo?DpbH}ES2oB*tC Q)c^nh07*qoM6N<$f(Stpr2qf` diff --git a/htdocs/theme/md/img/object_contact.png b/htdocs/theme/md/img/object_contact.png index e98202b367d15cdb2509122e8d4f0e009396f2ba..d4272f367c6e5eae37c9ddc745fd8a9be7d05bb7 100644 GIT binary patch delta 653 zcmV;80&@M)1eyhq8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys85SN9?nlG{0006fNklN=8P8; z^8?E@F+mzhZ3`l;h$*;~4qbGqNS6*yb@4B7@~?2If;cpTyMJATZZ?RJLb1I?nrvxo z^sXi)?_KV_*CC`-5Pjz7^ZkCGhp)kZrqMXk4X26cO0eMZ@?CD;EEwWnP`mAF$2q2) z&jFHlv(2m82aejVHpffz^Yhmh7Z+a^i^V5OsaUJkdi(nQM;_d+u)X6T<$$*5;klAp zb_Zi?YuDP`e18#EtJOE9Qt7Gdx@fJ*WHM+SV`=FTPV@LYMZS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b9#&v83H>uCAr2 zsj925uCA`GudlDAp}L^Fw5zhQthKVUvaPeTv$L|bwzadhwYa*vx|+kdn#8!Cz_`-N zi_yrP*niTS+0&lf)||=1rO3yi#m2GD%&^qXqt?@;*wm!l*P!3prQ6!D;Mt(#+pXf> zso~zN<=w02;h^f}sOjXb=;W^K=%?=Jtnccz@a(tn=(zFhx$^G1^Y6R#?7YUs%gW2f z$jHvi%FfQr&(+$*+t$_L<<{ir+2-uo_V32^@_)i0C2-LI0004WQchC;>)nZ0z?nn{zFtXME>=G-g>h8gqM z?|oW5Z`sPV>vm6{&cG0#)X<$8zjgc09UFm?3@+J??UhctwbQadyzGRk`j*x>ql~-| zbs*O{xuChP$i_asx-J;#4Cj=>-ku!o#EuP{I!zcDtSqf<9V~*nHgDUur41+z0>MEL a5DWnIMoJ6<)(Eu#0000$5C=4EXOx<1JF^TNnK)5L4on>B6F9R^&}Z-g`UE_HF@MpNq;^cCR#EDu7o_Fh zb2#U0XAL$oanIJyTG=}*AMl?;*B6_2H%mL)+k2Ht<*Bt!cDvnoylAT6qx;LpU%t8ud5KZV|xiS+AHCjmAdW_xQa;YZ@Zfs;a#kp< zIKPV+?!Ny8xH~5c6McGZ7eoBO=Glej$G|^9Mvg*wk5w1(*N;002ovPDHLk FV1lvm^ers7%BB2Lgr$OdYsD2y_Sx2oQ7;iV-xCs}#9lgeZnU7{($5gg}E}NH8VD zBm@ycDAXx|lv2wAmSx#Cwr$(7f#YDuaTrpWLl}dMA;vIcqP7@goFUFI=a6%ugmcQd z%{gyy+~Bm)5YcEho5dixD85cjW>UvR`~Q&2$={aP{5%#8W!pa~>z+;ioep)mIc>bvd1gCc@!dZp*SqI`po8= Date: Mon, 26 Oct 2015 05:40:34 +0100 Subject: [PATCH 106/116] Typo --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 71fa3b66a74..8b640040b80 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1915,7 +1915,7 @@ else // Prospect/Customer print ''; // Prefix From 71da059ef09642143407e992e911acaab0810538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 11:23:31 +0100 Subject: [PATCH 107/116] NEW Add a new widget $form->selectArrayAjax() to use combo list with content coming from an Ajax URL. --- htdocs/core/ajax/selectsearchbox.php | 10 +++---- htdocs/core/class/html.form.class.php | 41 +++++++++++++++++---------- htdocs/public/test/test_forms.php | 4 +-- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 4fe9b905eda..565866e2d90 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -44,14 +44,14 @@ if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); - $arrayresult['searchintothirdparty']=img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue); + $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); - $arrayresult['searchintocontact']=img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue); + $arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) @@ -59,7 +59,7 @@ if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! em { $langs->load("products"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); - $arrayresult['searchintoproduct']=img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue); + $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } /*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) @@ -73,14 +73,14 @@ if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ { $langs->load("members"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - $arrayresult['searchintomember']=img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue); + $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) { $langs->load("projects"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - $arrayresult['searchintoprojects']=img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue); + $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } // Execute hook printSearchForm diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5f714a85bcd..1e11f103a39 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4504,16 +4504,17 @@ class Form * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. * * @param string $htmlname Name of html select area - * @param string $url Url + * @param string $url Url. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...) * @param string $id Preselected key * @param string $moreparam Add more parameters onto the select tag * @param string $moreparamtourl Add more parameters onto the Ajax called URL * @param int $disabled Html select box is disabled * @param int $minimumInputLength Minimum Input Length * @param string $morecss Add more class to css styles + * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. * @return string HTML select string. */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='') + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0) { $out = ''; @@ -4521,7 +4522,10 @@ class Form $out.=' '; diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index 5e7b2f2434f..a189ee836b1 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -64,11 +64,11 @@ print $form->selectarray('selectarray',$array); print '

'."\n"; -print "Test 4d: a select with ajax refresh
\n"; +print "Test 4d: a select with ajax refresh and with onchange call of url
\n"; //$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); $array=array(); $selected=-1; -print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, ''); +print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1); print '

'."\n"; From 4fd0086862af66e5a67530ee9903088f8d24772b Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Mon, 26 Oct 2015 11:33:43 +0100 Subject: [PATCH 108/116] Fix: error this.price > 0 if no parse this.price when compare this.price and 0 always false --- htdocs/core/tpl/objectline_create.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ccf63983539..e8bacede84a 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -521,6 +521,7 @@ jQuery(document).ready(function() { if (this.id != 'pmpprice') { i++; + this.price = parseFloat(this.price);//fix this.price >0 // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) var defaultbuyprice = 'global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1')?'bestsupplierprice':''); ?>'; From 5c4ac0bf62d65b788a8add89953831346b95253a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:16:40 +0100 Subject: [PATCH 109/116] NEW Merge all left menu search boxes into one. --- htdocs/core/ajax/selectsearchbox.php | 52 +++++++++++++++------------ htdocs/core/class/html.form.class.php | 6 +++- htdocs/langs/en_US/main.lang | 1 + htdocs/main.inc.php | 22 +++++++----- htdocs/public/test/test_forms.php | 2 -- htdocs/theme/eldy/style.css.php | 14 +++++--- htdocs/theme/md/style.css.php | 4 +++ htdocs/user/index.php | 44 ++++++++++++++++++----- 8 files changed, 99 insertions(+), 46 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 565866e2d90..a7149400f80 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -40,14 +40,14 @@ $search_boxvalue=GETPOST('q'); $arrayresult=array(); // Define $searchform -if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) +if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } -if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) +if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); @@ -55,42 +55,50 @@ if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_C } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) -&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) +&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { $langs->load("products"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } -/*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) -&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) -{ - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); -}*/ - -if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) -{ - $langs->load("members"); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); -} - -if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) +if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { $langs->load("projects"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } -// Execute hook printSearchForm +if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) +{ + $langs->load("members"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire) +{ + $langs->load("users"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + $arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); +} + +/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag +if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) +{ + $langs->load("hrm"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); +} +*/ + +// Execute hook addSearchEntry $parameters=array(); -$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters); if (empty($reshook)) { - $searchform.=$hookmanager->resPrint; + $arrayresult=array_merge($arrayresult, $hookmanager->resArray); } -else $searchform=$hookmanager->resPrint; +else $arrayresult=$hookmanager->resArray; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e11f103a39..a9f66d80f22 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4512,10 +4512,13 @@ class Form * @param int $minimumInputLength Minimum Input Length * @param string $morecss Add more class to css styles * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. + * @param string $placeholder String to use as placeholder * @return string HTML select string. */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0) + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='') { + global $langs; + $out = ''; $tmpplugin='select2'; @@ -4559,6 +4562,7 @@ class Form },*/ cache: true }, + placeholder: "'.dol_escape_js($placeholder).'", escapeMarkup: function (markup) { return markup; }, // let our custom formatter work minimumInputLength: '.$minimumInputLength.', formatResult: function(result, container, query, escapeMarkup) { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b8c6735be80..648ce25b9ce 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -755,5 +755,6 @@ SetRef=Set ref SearchIntoThirdparties=Search %s into thirdparties SearchIntoContacts=Search %s into contacts SearchIntoMembers=Search %s into members +SearchIntoUsers=Search %s into users SearchIntoProductsOrServices=Search %s into products or services SearchIntoProjects=Search %s into projects \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 608957aa52d..8db9b6aa2ac 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1551,7 +1551,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a */ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='') { - global $user, $conf, $langs, $db; + global $user, $conf, $langs, $db, $form; global $hookmanager, $menumanager; $searchform=''; @@ -1567,7 +1567,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; + if (! is_object($form)) $form=new Form($db); + $selected=-1; + $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); + // Define $searchform + /* if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); @@ -1594,18 +1599,18 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); } + if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) + { + $langs->load("projects"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + } + if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members"); $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); } - if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - } - if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) { $langs->load("hrm"); @@ -1620,7 +1625,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=$hookmanager->resPrint; } else $searchform=$hookmanager->resPrint; - + */ + // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) { diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index a189ee836b1..f1c00f94acf 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -65,8 +65,6 @@ print $form->selectarray('selectarray',$array); print '

'."\n"; print "Test 4d: a select with ajax refresh and with onchange call of url
\n"; -//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); -$array=array(); $selected=-1; print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c152e1d93a3..641b13030ee 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1145,6 +1145,10 @@ div.vmenu, td.vmenu { } +.vmenusearchselectcombo { + width: 172px; +} + .menu_contenu { padding-top: 3px; padding-bottom: 2px; @@ -1219,17 +1223,17 @@ div.blockvmenusearch color: #000000; text-align: ; text-decoration: none; - padding-left: 5px; + /*padding-left: 5px; padding-right: 1px; padding-top: 3px; - padding-bottom: 3px; - margin: 1px 0px 8px 2px; + padding-bottom: 3px; */ + margin: 1px 0px 4px 2px; background: rgb(); - border-left: 1px solid #AAA; + /*border-left: 1px solid #AAA; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; - border-top: 1px solid #BBB; + border-top: 1px solid #BBB;*/ /*border-radius: 4px; -moz-border-radius: 4px; -moz-box-shadow: 3px 3px 4px #DDD; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index db6cfa50f86..55ef8a3b991 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1173,6 +1173,10 @@ div.vmenu, td.vmenu { } +.vmenusearchselectcombo { + width: 170px; +} + .menu_contenu { padding-top: 4px; padding-bottom: 3px;} #menu_contenu_logo { padding-right: 4px; } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 7688cadbe05..6b618552dc6 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -45,6 +45,8 @@ $search_user=GETPOST('search_user','alpha'); $search_login=GETPOST('search_login','alpha'); $search_lastname=GETPOST('search_lastname','alpha'); $search_firstname=GETPOST('search_firstname','alpha'); +$search_accountancy_code=GETPOST('search_accountancy_code','alpha'); +$search_email=GETPOST('search_email','alpha'); $search_statut=GETPOST('search_statut','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); $search_supervisor=GETPOST('search_supervisor','alpha'); @@ -82,6 +84,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_login=""; $search_lastname=""; $search_firstname=""; + $search_accountancy_code=""; + $search_email=""; $search_statut=""; $search_thirdparty=""; $search_supervisor=""; @@ -94,8 +98,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'u.login'=>"Login", - 'u.firstname'=>"Firstname", 'u.lastname'=>"Lastname", + 'u.firstname'=>"Firstname", 'u.accountancy_code'=>"AccountancyCode", 'u.email'=>"EMail", 'u.note'=>"Note" @@ -124,7 +128,7 @@ $buttonviewhierarchy='
0) $sql.= " AND u.fk_soc = ".$socid; -if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); if ($search_login != '') $sql.= natural_search("u.login", $search_login); if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); +if ($search_email != '') $sql.= natural_search("u.email", $search_email); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search($fieldstosearchall, $sall); +if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -188,6 +194,8 @@ if ($result) if ($search_login != '') $param.="&search_login=".$search_login; if ($search_lastname != '') $param.="&search_lastname=".$search_lastname; if ($search_firstname != '') $param.="&search_firstname=".$search_firstname; + if ($search_accountancy_code != '') $param.="&search_accountancy_code=".$search_accountancy_code; + if ($search_email != '') $param.="&search_email=".$search_email; if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor; if ($search_statut != '') $param.="&search_statut=".$search_statut; if ($optioncss != '') $param.='&optioncss='.$optioncss; @@ -217,7 +225,9 @@ if ($result) 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), + 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), @@ -233,6 +243,8 @@ if ($result) if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder); @@ -273,6 +285,14 @@ if ($result) { print '
'; } + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } if (! empty($arrayfields['u.fk_soc']['checked'])) { print ''; @@ -364,13 +384,21 @@ if ($result) } if (! empty($arrayfields['u.lastname']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.firstname']['checked'])) { - print ''; + print ''; } - if (! empty($arrayfields['u.fk_soc']['checked'])) + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) { print "'; + print ''; print ''; print ''; @@ -357,20 +360,23 @@ else // Show print '
'; - // Liste des zone de recherches permanentes supportees - print '
'.$langs->trans('AliasNameShort').''; + print '
'.$langs->trans('AliasNames').''; print $object->name_alias; print "
'.$langs->trans('ProspectCustomer').''; + print $object->getLibCustProspStatut(); + print '
'.$langs->trans('Supplier').''; + print yn($object->fournsseur); + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'.$langs->trans('Supplier').''; - print yn($object->fournsseur); + print yn($object->fournisseur); print '
'.ucfirst($obj->lastname).''.$obj->lastname.''.ucfirst($obj->firstname).''.$obj->firstname.''.$obj->accountancy_code.''.$obj->email.'"; if ($obj->fk_soc) From d5e42478a999246a713de7ba0594ed211dbfa245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:37:36 +0100 Subject: [PATCH 110/116] Removed deprecated options to show or not forms. Such forms does not exists anymore. --- htdocs/admin/ihm.php | 40 ++++++++++++++++++++--------------- htdocs/langs/en_US/admin.lang | 3 ++- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 6e7a4f7d868..38d766e77fb 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -47,11 +47,12 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area +/* $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees")); $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name'); - +*/ if ($action == 'update') { @@ -78,6 +79,7 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity); + /* dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); @@ -85,7 +87,8 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity); - + */ + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); @@ -209,7 +212,7 @@ if ($action == 'edit') // Edit // Max size of short lists on customer card $var=!$var; - print '
'.$langs->trans("DefaultMaxSizeShortListCustomerCard").'
'.$langs->trans("DefaultMaxSizeShortList").' 
'; - print ''; - $var=true; - foreach ($searchform as $key => $value) + // List of search forms to show + /* + if (! empty($searchform)) { - $var=!$var; - print ''; - print ''; - } - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); - print '
'; - print '
'; - + print ''; + print ''; + $var=true; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print '
'; + print '
'; + }*/ // Other $var=true; @@ -396,7 +402,7 @@ else // Show print ""; $var=!$var; - print ''.$langs->trans("DefaultMaxSizeShortListCustomerCard").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ''; + print ''.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ''; print ' '; print ""; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9bf9233f76b..c924d80639e 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -936,7 +936,8 @@ DefaultMenuSmartphoneManager=Smartphone menu manager Skin=Skin theme DefaultSkin=Default skin theme MaxSizeList=Max length for list -DefaultMaxSizeList=Default max length for list +DefaultMaxSizeList=Default max length for lists +DefaultMaxSizeShortList=Default max length for short lists (ie in customer card) MessageOfDay=Message of the day MessageLogin=Login page message PermanentLeftSearchForm=Permanent search form on left menu From 4b2db78c3ade9da7ecca14814c6ecc5005d4788d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:50:32 +0100 Subject: [PATCH 111/116] Keep deprecated options to show or not forms for blind people. --- htdocs/admin/ihm.php | 45 +++++++++-------- htdocs/main.inc.php | 113 ++++++++++++++++++++++--------------------- 2 files changed, 83 insertions(+), 75 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 38d766e77fb..6907e30f979 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -47,12 +47,14 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -/* -$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); -$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name'); -*/ +$searchform=array(); +if (empty($conf->use_javascript_ajax)) +{ + $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); + $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); + $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users")); + $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name'); +} if ($action == 'update') { @@ -167,19 +169,22 @@ if ($action == 'edit') // Edit print '
'; // Liste des zone de recherche permanantes supportees - print ''; - print ''; - $var=True; - foreach ($searchform as $key => $value) + if (! empty($searchform)) { - $var=!$var; - print ''; + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; - print $form->selectyesno($searchform[$key],$searchformconst[$key],1); - print '
'; + print ''; + $var=True; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; + print $form->selectyesno($searchform[$key],$searchformconst[$key],1); + print '
'; + print '
'; } - print ''; - print '
'; - + // Other print ''; print ''; @@ -361,7 +366,6 @@ else // Show // List of search forms to show - /* if (! empty($searchform)) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; @@ -371,12 +375,13 @@ else // Show { $var=!$var; print ''; - print ''; } print '
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print ''; + if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); print '
'; print '
'; - }*/ + } // Other $var=true; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8db9b6aa2ac..dd4cd684970 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1567,65 +1567,68 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; - if (! is_object($form)) $form=new Form($db); - $selected=-1; - $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); - - // Define $searchform - /* - if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) + if ($conf->use_javascript_ajax) { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + if (! is_object($form)) $form=new Form($db); + $selected=-1; + $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); } - - if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) + else { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + // Define $searchform + if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + } + + if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + } + + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); + } + + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); + } + + if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) + { + $langs->load("projects"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + } + + if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) + { + $langs->load("members"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + } + + if (! empty($conf->user->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_USER) && $user->rights->user->user->lire) + { + $langs->load("users"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); + } + + // Execute hook printSearchForm + $parameters=array(); + $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + $searchform.=$hookmanager->resPrint; + } + else $searchform=$hookmanager->resPrint; } - - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) - && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); - } - - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) - && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); - } - - if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - } - - if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) - { - $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - } - - if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) - { - $langs->load("hrm"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); - } - - // Execute hook printSearchForm - $parameters=array(); - $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - $searchform.=$hookmanager->resPrint; - } - else $searchform=$hookmanager->resPrint; - */ // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) From 07b277b23f262b5ef86c7928d8f4cb7a50902d7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 15:21:22 +0100 Subject: [PATCH 112/116] Prepare fields in dtabase to store if time spent was invoiced or not. --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 5 +++++ htdocs/install/mysql/tables/llx_projet_task_time.sql | 2 ++ 2 files changed, 7 insertions(+) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d426cd72105..92ab08d141d 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -105,3 +105,8 @@ ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1; + +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL; +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL; + + diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 6c34440a58b..3ca161ed07d 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -26,5 +26,7 @@ create table llx_projet_task_time task_duration double, fk_user integer, thm double(24,8), + invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here + invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here note text )ENGINE=innodb; From 6493438e876168be2f31795d697197340125a591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 16:20:09 +0100 Subject: [PATCH 113/116] NEW The clicktodial module is now able to provide link "tel:" on phone numbers. So it is also possible to use clicktodial with a client solution like the "xivo" local client. --- htdocs/admin/clicktodial.php | 22 +++++++++++++++++----- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/langs/en_US/admin.lang | 4 +++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 1550c0ebef7..6b82c5237ea 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -36,10 +36,13 @@ $action = GETPOST("action"); /* * Actions */ + if ($action == 'setvalue' && $user->admin) { - $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); - if ($result >= 0) + $result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity); + $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity); + + if ($result1 >= 0 && $result2 >= 0) { setEventMessage($langs->trans("SetupSaved")); } @@ -73,13 +76,22 @@ $var=true; print ''; print ''; -print ''; +print ''; print ''; print "\n"; + $var=!$var; -print ''; + +$var=!$var; +print '
'.$langs->trans("Name").''.$langs->trans("Name").''.$langs->trans("Value").'
'; +print '
'; +print $langs->trans("ClickToDialUseTelLink").''; +print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'
'; +print '
'; +print $langs->trans("ClickToDialUseTelLinkDesc"); +print '
'; print $langs->trans("DefaultLink").''; -print '
'; +print 'global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'">
'; print '
'; print $langs->trans("ClickToDialUrlDesc").'
'; print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b7db522458e..5b990ac509c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1544,9 +1544,9 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep } } - if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set) + if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) { - if (! empty($conf->browser->phone)) // If phone, we use link of phone + if (! empty($conf->browser->phone) || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone { $newphone =''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c924d80639e..f6399bffa6b 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1560,7 +1560,9 @@ AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filt AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda ##### ClickToDial ##### -ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialDesc=This module allows to make phone numbers clickable. A click on this icon will call make your phone to call the phone number. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialUseTelLink=Use just a link "tel:" on phone numbers +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or an interface install on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution, you must set this to "No" and fill next field. ##### Point Of Sales (CashDesk) ##### CashDesk=Point of sales CashDeskSetup=Point of sales module setup From 6f1d758eaecd2105fab08f2f676a5f8e657baa24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 16:42:31 +0100 Subject: [PATCH 114/116] Fix print feature for md theme --- htdocs/theme/md/style.css.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 55ef8a3b991..a4da1e4205b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -560,11 +560,16 @@ td.showDragHandle { } #id-right { /* This must stay id-right and not be replaced with echo $right */ width: 100%; + padding-left: 194px; padding-top: 12px; + } .side-nav { + + display: none; + background: #FFF; border-right: 1px solid rgba(0,0,0,0.2); bottom: 0; @@ -600,6 +605,7 @@ td.showDragHandle { -webkit-overflow-scrolling: touch; overflow-x: hidden; overflow-y: auto; + } .side-nav-vert { margin-left: 194px; From 24c3491ff74bb2a81dc32e49f5a75960aee3ae16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 22:56:54 +0100 Subject: [PATCH 115/116] Code comment --- htdocs/install/mysql/tables/llx_actioncomm_resources.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql index 484cd39fb82..7632b1fd810 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql @@ -16,8 +16,8 @@ -- along with this program. If not, see . -- -- ============================================================================ --- Table used for relations between elements of different types: --- invoice-propal, propal-order, etc... +-- Table used for relations between an action event and a resource (in most cases +-- a 'user', but can also be a 'resource' like a room, or a hardware) -- ============================================================================ create table llx_actioncomm_resources From 0a3ba3a0c601afd5293d2124f920ada4f38cf0aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 23:36:05 +0100 Subject: [PATCH 116/116] Fix picto --- htdocs/theme/md/img/search.png | Bin 432 -> 215 bytes htdocs/theme/md/img/searchclear.png | Bin 436 -> 356 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/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