From 468635867db6fc93ad983bb2c9a6ccae98952bd8 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:52:56 +0200 Subject: [PATCH 01/38] Add dateemployementend --- htdocs/install/mysql/tables/llx_user.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 2ecb52511d4..7ae732d51e6 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -84,6 +84,7 @@ create table llx_user salary double(24,8), -- denormalized value coming from llx_user_employment salaryextra double(24,8), -- denormalized value coming from llx_user_employment dateemployment date, -- denormalized value coming from llx_user_employment + dateemploymentend date, -- denormalized value coming from llx_user_employment weeklyhours double(16,8), -- denormalized value coming from llx_user_employment import_key varchar(14), -- import key From fcf6ab6ee5d8872ba02aa51dd65fa8afd78c74ce Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:55:14 +0200 Subject: [PATCH 02/38] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index a57e02455cc..d259da1fe55 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -44,6 +44,7 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; + update llx_propal set fk_statut = 1 where fk_statut = -1; ALTER TABLE llx_inventory ADD COLUMN fk_user_creat integer; @@ -79,6 +80,10 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 + +ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; + + -- delete old permission no more used DELETE FROM llx_rights_def WHERE perms = 'main' and module = 'commercial'; From caa35e03590fb51dc2dcf5ed3b0b20efd599503b Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:59:43 +0200 Subject: [PATCH 03/38] Update user.class.php --- htdocs/user/class/user.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8ac4963f5b5..77b4a59df7a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2013-2014 Philippe Grand * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 charlene Benke * * 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 @@ -131,6 +132,7 @@ class User extends CommonObject public $color; // Define background color for user in agenda public $dateemployment; // Define date of employment by company + public $dateemploymentend; // Define date of employment end by company public $default_c_exp_tax_cat; public $default_range; @@ -201,7 +203,7 @@ class User extends CommonObject $sql.= " u.salaryextra,"; $sql.= " u.weeklyhours,"; $sql.= " u.color,"; - $sql.= " u.dateemployment,"; + $sql.= " u.dateemployment, u.dateemploymentend,"; $sql.= " u.ref_int, u.ref_ext,"; $sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode $sql.= " c.code as country_code, c.label as country,"; @@ -304,6 +306,7 @@ class User extends CommonObject $this->weeklyhours = $obj->weeklyhours; $this->color = $obj->color; $this->dateemployment = $this->db->jdate($obj->dateemployment); + $this->dateemploymentend = $this->db->jdate($obj->dateemploymentend); $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -1376,6 +1379,7 @@ class User extends CommonObject $this->accountancy_code = trim($this->accountancy_code); $this->color = empty($this->color)?'':$this->color; $this->dateemployment = empty($this->dateemployment)?'':$this->dateemployment; + $this->dateemploymentend = empty($this->dateemploymentend)?'':$this->dateemploymentend; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1418,6 +1422,7 @@ class User extends CommonObject $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", color = '".$this->db->escape($this->color)."'"; $sql.= ", dateemployment=".(strval($this->dateemployment)!='' ? "'".$this->db->idate($this->dateemployment)."'" : 'null'); + $sql.= ", dateemploymentend=".(strval($this->dateemploymentend)!='' ? "'".$this->db->idate($this->dateemploymentend)."'" : 'null'); $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); From 0dad083cb529999cd15e29605ace10768406be3b Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 18:05:06 +0200 Subject: [PATCH 04/38] Update card.php --- htdocs/user/card.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 48dc1049706..1823adc8044 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2015-2017 Jean-François Ferry * Copyright (C) 2015 Ari Elbaz (elarifr) - * Copyright (C) 2015 Charlie Benke + * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2016 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify @@ -222,6 +222,9 @@ if (empty($reshook)) { $dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear')); $object->dateemployment = $dateemployment; + $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth'), GETPOST('dateemploymentendday'), GETPOST('dateemploymentendyear')); + $object->dateemploymentend = $dateemploymentend; + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) { @@ -364,6 +367,8 @@ if (empty($reshook)) { $object->color = GETPOST("color",'alpha') != '' ? GETPOST("color",'alpha') : ''; $dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth','int'), GETPOST('dateemploymentday','int'), GETPOST('dateemploymentyear','int')); $object->dateemployment = $dateemployment; + $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth','int'), GETPOST('dateemploymentendday','int'), GETPOST('dateemploymentendyear','int')); + $object->dateemploymentend = $dateemploymentend; if (! empty($conf->multicompany->enabled)) { @@ -1159,6 +1164,13 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print "\n"; + // Date employment END + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + echo $form->select_date(GETPOST('dateemploymentend'),'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1); + print ''; + print "\n"; + // Date birth print ''.$langs->trans("DateToBirth").''; print ''; @@ -1505,6 +1517,13 @@ else print ''; print "\n"; + // Date employment + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + print dol_print_date($object->dateemploymentend); + print ''; + print "\n"; + // Date of birth print ''.$langs->trans("DateToBirth").''; print ''; @@ -2430,6 +2449,14 @@ else print ''; print "\n"; + // Date employmentEnd + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + echo $form->select_date(GETPOST('dateemploymentend')?GETPOST('dateemploymentend'):$object->dateemploymentend,'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1); + print ''; + print "\n"; + + // Date birth print ''.$langs->trans("DateToBirth").''; print ''; From 537048a10a37c8cee123722112835c6193524be0 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 13 May 2018 15:30:32 +0200 Subject: [PATCH 05/38] Update html.formcontract.class.php --- htdocs/core/class/html.formcontract.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f4902e4912e..c6cf20dd5f1 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2018 Charlene BENKE * * 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 @@ -57,7 +57,7 @@ class FormContract global $db,$user,$conf,$langs; $hideunselectables = false; - if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; // Search all contacts $sql = 'SELECT c.rowid, c.ref, c.fk_soc, c.statut'; From 2f1800f3e23dd2fd03d7182c95cfac48efb8ded9 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 13 May 2018 15:34:26 +0200 Subject: [PATCH 06/38] Update html.formprojet.class.php --- htdocs/core/class/html.formprojet.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index a572d546ca7..75ccc1d8245 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Charlene Benke * * 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 @@ -139,10 +140,10 @@ class FormProjets if (empty($htmlid)) $htmlid = $htmlname; $out=''; - $outarray=array(); + $outarray=array(); $hideunselectables = false; - if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; $projectsListId = false; if (empty($user->rights->projet->all->lire)) @@ -317,7 +318,7 @@ class FormProjets $out=''; $hideunselectables = false; - if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; if (empty($projectsListId)) { From b0757916c4731fea9e04048fffb88e08b2d1ee45 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 13 May 2018 16:59:03 +0200 Subject: [PATCH 07/38] Update html.formcontract.class.php --- htdocs/core/class/html.formcontract.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index c6cf20dd5f1..28b256e32ef 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -64,8 +64,18 @@ class FormContract $sql.= ' FROM '.MAIN_DB_PREFIX .'contrat as c'; $sql.= " WHERE c.entity = ".$conf->entity; //if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")"; + if ($socid > 0) + { + // CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. + if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) + $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; + else if ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') + { + $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; + $sql.= " OR p.fk_soc IS NULL)"; + } + } if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; - if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; $sql.= " ORDER BY c.ref "; dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); From f4af9ec22f9b2c55fb9cf73523cb4d8ae05a7bff Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 13 May 2018 19:38:30 +0200 Subject: [PATCH 08/38] Update html.formcontract.class.php --- htdocs/core/class/html.formcontract.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 28b256e32ef..64d28e6b281 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -72,7 +72,7 @@ class FormContract else if ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') { $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; - $sql.= " OR p.fk_soc IS NULL)"; + $sql.= " OR c.fk_soc IS NULL)"; } } if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; From 4bebc8149baae5a744159a046e8a2c074794ec9e Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 13 May 2018 21:17:15 +0200 Subject: [PATCH 09/38] Update html.formcontract.class.php --- htdocs/core/class/html.formcontract.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 64d28e6b281..01ebe66666b 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -108,12 +108,12 @@ class FormContract else { $disabled=0; - if (! $obj->statut > 0) + if ( $obj->statut == 0) { $disabled=1; $labeltoshow.=' ('.$langs->trans("Draft").')'; } - if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) + if ( empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) { $disabled=1; $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany"); From 90881fe488df4bfebcf3c1d43b926de6a5e5b99a Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 18 May 2018 16:32:46 +0100 Subject: [PATCH 10/38] Add link to inventory code --- htdocs/product/stock/mouvement.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index edabf9184da..19aaa6c1289 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -1067,7 +1067,15 @@ if ($resql) if (! empty($arrayfields['m.inventorycode']['checked'])) { // Inventory code - print ''.$objp->inventorycode.''; + print ''.'' + .$objp->inventorycode + .'' + .''; } if (! empty($arrayfields['m.label']['checked'])) { From 4a7ac774f7e328c25775e30e810cd79613d280e2 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:38:11 +0200 Subject: [PATCH 11/38] introduce fichinter rec models --- htdocs/core/lib/fichinter.lib.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8507a85292a..fcb14be9c67 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -2,8 +2,9 @@ /* Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2016 Gilles Poirier - + * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2018 charlene Benke + * * 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 @@ -162,4 +163,23 @@ function fichinter_admin_prepare_head() return $head; } +function fichinter_rec_prepare_head ($object) +{ + global $langs, $conf; //, $user; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id; + $head[$h][1] = $langs->trans("CardFichinter"); + $head[$h][2] = 'card'; + $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention-rec'); + + complete_head_from_modules($conf, $langs, $object, $head, $h,'intervention-rec','remove'); + + + return $head; +} From eef8249ad7189ecdb36633879da061fad4a19405 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:39:40 +0200 Subject: [PATCH 12/38] Create llx_fichinter_rec.sql --- htdocs/install/llx_fichinter_rec.sql | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 htdocs/install/llx_fichinter_rec.sql diff --git a/htdocs/install/llx_fichinter_rec.sql b/htdocs/install/llx_fichinter_rec.sql new file mode 100644 index 00000000000..fa50540ae9f --- /dev/null +++ b/htdocs/install/llx_fichinter_rec.sql @@ -0,0 +1,48 @@ +-- =========================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2012-2014 Laurent Destailleur +-- Copyright (C) 2009 Regis Houssin +-- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2016 Charlie Benke +-- +-- 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_fichinter_rec +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + titre varchar(50) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer DEFAULT NULL, + datec datetime, -- date de creation + + fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche + fk_user_author integer, -- createur + fk_projet integer, -- projet auquel est associe la facture + duree real, -- duree totale de l'intervention + description text, + modelpdf varchar(50), + note_private text, + note_public text, + + frequency integer, -- frequency (for example: 3 for every 3 month) + unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ... + date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date) + date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice) + nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented) + nb_gen_max integer DEFAULT NULL, -- maximum number of generation + auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention + +)ENGINE=innodb; From 8124ea15225797f1cdd3498386a4ba6a035f1b42 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:39:56 +0200 Subject: [PATCH 13/38] Delete llx_fichinter_rec.sql --- htdocs/install/llx_fichinter_rec.sql | 48 ---------------------------- 1 file changed, 48 deletions(-) delete mode 100644 htdocs/install/llx_fichinter_rec.sql diff --git a/htdocs/install/llx_fichinter_rec.sql b/htdocs/install/llx_fichinter_rec.sql deleted file mode 100644 index fa50540ae9f..00000000000 --- a/htdocs/install/llx_fichinter_rec.sql +++ /dev/null @@ -1,48 +0,0 @@ --- =========================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2012-2014 Laurent Destailleur --- Copyright (C) 2009 Regis Houssin --- Copyright (C) 2010 Juanjo Menent --- Copyright (C) 2016 Charlie Benke --- --- 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_fichinter_rec -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - titre varchar(50) NOT NULL, - entity integer DEFAULT 1 NOT NULL, -- multi company id - fk_soc integer DEFAULT NULL, - datec datetime, -- date de creation - - fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche - fk_user_author integer, -- createur - fk_projet integer, -- projet auquel est associe la facture - duree real, -- duree totale de l'intervention - description text, - modelpdf varchar(50), - note_private text, - note_public text, - - frequency integer, -- frequency (for example: 3 for every 3 month) - unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ... - date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date) - date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice) - nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented) - nb_gen_max integer DEFAULT NULL, -- maximum number of generation - auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention - -)ENGINE=innodb; From 17016d03fe5b68793f307f1df738126569054159 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:40:36 +0200 Subject: [PATCH 14/38] Create llx_fichinter_rec.sql --- .../mysql/tables/llx_fichinter_rec.sql | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_fichinter_rec.sql diff --git a/htdocs/install/mysql/tables/llx_fichinter_rec.sql b/htdocs/install/mysql/tables/llx_fichinter_rec.sql new file mode 100644 index 00000000000..10dacbde4ee --- /dev/null +++ b/htdocs/install/mysql/tables/llx_fichinter_rec.sql @@ -0,0 +1,48 @@ +-- =========================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2012-2014 Laurent Destailleur +-- Copyright (C) 2009 Regis Houssin +-- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2018 Charlene Benke +-- +-- 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_fichinter_rec +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + titre varchar(50) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer DEFAULT NULL, + datec datetime, -- date de creation + + fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche + fk_user_author integer, -- createur + fk_projet integer, -- projet auquel est associe la facture + duree real, -- duree totale de l'intervention + description text, + modelpdf varchar(50), + note_private text, + note_public text, + + frequency integer, -- frequency (for example: 3 for every 3 month) + unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ... + date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date) + date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice) + nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented) + nb_gen_max integer DEFAULT NULL, -- maximum number of generation + auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention + +)ENGINE=innodb; From 0b7342f34b833f2376f61241f0dc8c993cd9a7eb Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:41:45 +0200 Subject: [PATCH 15/38] Create llx_fichinter_rec.key.sql --- .../mysql/tables/llx_fichinter_rec.key.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_fichinter_rec.key.sql diff --git a/htdocs/install/mysql/tables/llx_fichinter_rec.key.sql b/htdocs/install/mysql/tables/llx_fichinter_rec.key.sql new file mode 100644 index 00000000000..0c420fd6395 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_fichinter_rec.key.sql @@ -0,0 +1,30 @@ +-- ============================================================================ +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2004-2006 Laurent Destailleur +-- Copyright (C) 2009 Regis Houssin +-- Copyright (C) 2018 Charlene Benke +-- +-- 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 . +-- +-- ============================================================================ + + +ALTER TABLE llx_fichinter_rec ADD UNIQUE INDEX idx_fichinter_rec_uk_titre (titre, entity); + +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_soc (fk_soc); +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_user_author (fk_user_author); +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_projet (fk_projet); + +ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); From a85ba00d2e5bdf7c387c7f204289eb1aea777a58 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:42:19 +0200 Subject: [PATCH 16/38] Create llx_fichinterdet_rec.sql --- .../mysql/tables/llx_fichinterdet_rec.sql | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_fichinterdet_rec.sql diff --git a/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql new file mode 100644 index 00000000000..682453f2dfd --- /dev/null +++ b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql @@ -0,0 +1,63 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2009-2014 Laurent Destailleur +-- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2010-2012 Regis Houssin +-- Copyright (C) 2012 Cédric Salvador +-- Copyright (C) 2016-2018 Charlene Benke +-- +-- 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_fichinterdet_rec +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_fichinter integer NOT NULL, + date datetime, -- date de la ligne d'intervention + description text, -- description de la ligne d'intervention + duree integer, -- duree de la ligne d'intervention + rang integer DEFAULT 0, -- ordre affichage sur la fiche + total_ht DOUBLE(24, 8) NULL DEFAULT NULL, + subprice DOUBLE(24, 8) NULL DEFAULT NULL, + fk_parent_line integer NULL DEFAULT NULL, + fk_product integer NULL DEFAULT NULL, + label varchar(255) NULL DEFAULT NULL, + tva_tx DOUBLE(6, 3) NULL DEFAULT NULL, + localtax1_tx DOUBLE(6, 3) NULL DEFAULT 0, + localtax1_type VARCHAR(1) NULL DEFAULT NULL, + localtax2_tx DOUBLE(6, 3) NULL DEFAULT 0, + localtax2_type VARCHAR(1) NULL DEFAULT NULL, + qty double NULL DEFAULT NULL, + remise_percent double NULL DEFAULT 0, + remise double NULL DEFAULT 0, + fk_remise_except integer NULL DEFAULT NULL, + price DOUBLE(24, 8) NULL DEFAULT NULL, + total_tva DOUBLE(24, 8) NULL DEFAULT NULL, + total_localtax1 DOUBLE(24, 8) NULL DEFAULT 0, + total_localtax2 DOUBLE(24, 8) NULL DEFAULT 0, + total_ttc DOUBLE(24, 8) NULL DEFAULT NULL, + product_type INTEGER NULL DEFAULT 0, + date_start datetime NULL DEFAULT NULL, + date_end datetime NULL DEFAULT NULL, + info_bits INTEGER NULL DEFAULT 0, + buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0, + fk_product_fournisseur_price integer NULL DEFAULT NULL, + fk_code_ventilation integer NOT NULL DEFAULT 0, + fk_export_commpta integer NOT NULL DEFAULT 0, + special_code integer UNSIGNED NULL DEFAULT 0, + fk_unit integer NULL DEFAULT NULL, + import_key varchar(14) NULL DEFAULT NULL + +)ENGINE=innodb; From 0e7c82af95fdb0055fa7622439fa1f71ebc644f5 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:43:23 +0200 Subject: [PATCH 17/38] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 448d3d4870c..876780c1243 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -784,7 +784,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); - + $newmenu->add("/fichinter/card-red.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } From 991c6d97c07a9626a34ee3a8f2e36d9f427b2a25 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:44:49 +0200 Subject: [PATCH 18/38] Update card.php --- htdocs/fichinter/card.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 540f897ffe5..dbd1d3bd71b 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2018 Ferran Marcet - * Copyright (C) 2014-2015 Charlie Benke + * Copyright (C) 2014-2018 Charlene Benke * Copyright (C) 2015-2016 Abbes Bahfir * * This program is free software; you can redistribute it and/or modify @@ -1645,6 +1645,14 @@ else if ($id > 0 || ! empty($ref)) else print ''; } + // create interventional model + if ($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { + print ''; + } + // Proposal if ($conf->service->enabled && ! empty($conf->propal->enabled) && $object->statut > Fichinter::STATUS_DRAFT) { From 7f8132e9715c138c987174fefdec9855e9874330 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Mon, 28 May 2018 16:46:34 +0200 Subject: [PATCH 19/38] Create card-rec.php --- htdocs/fichinter/card-rec.php | 976 ++++++++++++++++++++++++++++++++++ 1 file changed, 976 insertions(+) create mode 100644 htdocs/fichinter/card-rec.php diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php new file mode 100644 index 00000000000..96d7e106b5a --- /dev/null +++ b/htdocs/fichinter/card-rec.php @@ -0,0 +1,976 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016-2018 Charlie Benke + * + * 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 fichinter/card-rec.php + * \ingroup fichinter + * \brief Page to show predefined fichinter + */ + +$res=0; +if (! $res && file_exists("../../main.inc.php")) + $res=@include("../../main.inc.php"); // For root directory +if (! $res && file_exists("../../../main.inc.php")) + $res=@include("../../../main.inc.php"); // For "custom" directory + +require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinterrec.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; + +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +if (! empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +} +if (! empty($conf->contrat->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcontract.class.php'; +} + + +$langs->load('bills'); +$langs->load('compta'); +$langs->load('admin'); +$langs->load("interventions"); + +// Security check +$id=(GETPOST('fichinterid', 'int')?GETPOST('fichinterid', 'int'):GETPOST('id', 'int')); +$action=GETPOST('action', 'alpha'); +if ($user->societe_id) $socid=$user->societe_id; +$objecttype = 'fichinter_rec'; +if ($action == "create" || $action == "add") $objecttype = ''; +$result = restrictedArea($user, 'ficheinter', $id, $objecttype); + +if ($page == -1) + $page = 0 ; + +$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit; +$offset = $limit * $page ; + +if ($sortorder == "") + $sortorder="DESC"; + +if ($sortfield == "") + $sortfield="f.datec"; + +$object = new FichinterRec($db); + + +$arrayfields=array( + 'f.titre'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), + 'f.fk_contrat'=>array('label'=>$langs->trans("Contract"), 'checked'=>1), + 'f.duree'=>array('label'=>$langs->trans("Duration"), 'checked'=>1), + 'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1), + 'f.frequency'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1), + 'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDone"), 'checked'=>1), + 'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1), + 'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1), + 'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), +); + + +/* + * Actions + */ + + +// Create predefined intervention +if ($action == 'add') { + if (! GETPOST('titre')) { + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); + $action = "create"; + $error++; + } + + if (! GETPOST('socid')) { + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Customer")), null, 'errors'); + $action = "create"; + $error++; + } + + // gestion des fréquences et des échéances + $frequency=GETPOST('frequency', 'int'); + $reyear=GETPOST('reyear'); + $remonth=GETPOST('remonth'); + $reday=GETPOST('reday'); + $rehour=GETPOST('rehour'); + $remin=GETPOST('remin'); + $nb_gen_max = (GETPOST('nb_gen_max', 'int')?GETPOST('nb_gen_max', 'int'):0); + if (GETPOST('frequency')) { + if (empty($reyear) || empty($remonth) || empty($reday)) { + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); + $action = "create"; + $error++; + } + if ($nb_gen_max === '') { + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("MaxPeriodNumber")), null, 'errors'); + $action = "create"; + $error++; + } + } + + if (! $error) { + $object->id_origin = $id; + $object->titre = GETPOST('titre', 'alpha'); + $object->description = GETPOST('description', 'alpha'); + $object->socid = GETPOST('socid', 'alpha'); + $object->fk_project = GETPOST('projectid', 'int'); + $object->fk_contract = GETPOST('contractid', 'int'); + + $object->frequency = $frequency; + $object->unit_frequency = GETPOST('unit_frequency', 'alpha'); + $object->nb_gen_max = $nb_gen_max; + $object->auto_validate = GETPOST('auto_validate', 'int'); + + $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); + $object->date_when = $date_next_execution; + + if ($object->create($user) > 0) { + $id = $object->id; + $action = ''; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action = "create"; + } + } +} elseif ($action == 'createfrommodel') { + $newinter = new fichinter($db); + + // on récupère les enregistrements + $object->fetch($id); + + + // on transfert les données de l'un vers l'autre + if ($object->socid > 0) { + $newinter->socid=$object->socid; + $newinter->fk_projet=$object->fk_projet; + $newinter->fk_contrat=$object->fk_contrat; + } else + $newinter->socid=GETPOST("socid"); + + $newinter->entity=$object->entity; + $newinter->duree=$object->duree; + + $newinter->description=$object->description; + $newinter->note_private=$object->note_private; + $newinter->note_public=$object->note_public; + + // on créer un nouvelle intervention + $extrafields = new ExtraFields($db); + $extralabels = $extrafields->fetch_name_optionals_label($newinter->table_element); + $array_options = $extrafields->getOptionalsFromPost($extralabels); + $newinter->array_options = $array_options; + + $newfichinterid = $newinter->create($user); + + if ($newfichinterid > 0) { + // on ajoute les lignes de détail ensuite + foreach ($object->lines as $ficheinterligne) + $newinter->addline($user, $newfichinterid, $ficheinterligne->desc, "", $ficheinterligne->duree, ''); + + // on update le nombre d'inter crée à partir du modèle + $object->updateNbGenDone(); + //on redirige vers la fiche d'intervention nouvellement crée + header('Location: '.DOL_URL_ROOT.'/fichinter/card.php?id='.$newfichinterid); + exit; + } else { + setEventMessages($newinter->error, $newinter->errors, 'errors'); + $action=''; + } +} elseif ($action == 'delete' && $user->rights->ficheinter->supprimer) { + // delete modele + $object->fetch($id); + $object->delete(); + $id = 0 ; + header('Location: '.$_SERVER["PHP_SELF"]); + exit; +} elseif ($action == 'setfrequency' && $user->rights->ficheinter->creer) { + // Set frequency and unit frequency + $object->fetch($id); + $object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha')); +} elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) { + // Set next date of execution + $object->fetch($id); + $date = dol_mktime( + GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, + GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear') + ); + if (!empty($date)) $object->setNextDate($date); +} elseif ($action == 'setnb_gen_max' && $user->rights->ficheinter->creer) { +// Set max period + $object->fetch($id); + $object->setMaxPeriod(GETPOST('nb_gen_max', 'int')); +} + + +/* + * View + */ + +llxHeader('', $langs->trans("RepeatableInterventional"), 'ch-fichinter.html#s-fac-fichinter-rec'); + +$form = new Form($db); +$companystatic = new Societe($db); +if (! empty($conf->contrat->enabled)) + $contratstatic = new Contrat($db); +if (! empty($conf->projet->enabled)) + $projectstatic = new Project($db); + +$now = dol_now(); +$tmparray=dol_getdate($now); +$today = dol_mktime( + 23, 59, 59, + $tmparray['mon'], $tmparray['mday'], $tmparray['year'] +); // Today is last second of current day + + + +/* + * Create mode + */ +if ($action == 'create') { + print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'title_commercial.png'); + + $object = new Fichinter($db); // Source invoice + //$object = new Managementfichinter($db); // Source invoice + + if ($object->fetch($id, $ref) > 0) { + print '
'; + print ''; + print ''; + print ''; + + dol_fiche_head(); + + $rowspan=4; + if (! empty($conf->projet->enabled) && $object->fk_project > 0) $rowspan++; + if (! empty($conf->contrat->enabled) && $object->fk_contrat > 0) $rowspan++; + + print ''; + + $object->fetch_thirdparty(); + + // Third party + print ''; + + // Title + print ''; + + // Note + print ''; + + // Author + print ""; + + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { + // Duration + print ''; + print ''; + print ''; + } + + // Project + if (! empty($conf->projet->enabled)) { + $formproject = new FormProjets($db); + print ""; + } + + // Contrat + if (! empty($conf->contrat->enabled)) { + $formcontract = new FormContract($db); + print ""; + } + print "
'.$langs->trans("Customer").''; + print $form->select_company($object->thirdparty->id, 'socid', '', 0, 1); + +// .$object->thirdparty->getNomUrl(1,'customer'). + print ''; + print $langs->trans("Comment"); + print '
'.$langs->trans("Title").''; + print ''; + print ''; + print ''; + print '
".$langs->trans("Author")."".$user->getFullName($langs)."
'.$langs->trans("TotalDuration").''.convertSecondToTime( + $object->duration, 'all', + $conf->global->MAIN_DURATION_OF_WORKDAY + ).'
".$langs->trans("Project").""; + $projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project; + + $numprojet = $formproject->select_projects( + $object->thirdparty->id, $projectid, 'projectid', + 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '' + ); + print '   '; + print $langs->trans("AddProject").''; + print "
".$langs->trans("Contract").""; + $contractid = GETPOST('contractid')?GETPOST('contractid'):$object->fk_contract; + $numcontract = $formcontract->select_contract($object->thirdparty->id, $contractid, 'contracttid'); + print "
"; + + print '

'; + + /// frequency & duration + // Autogeneration + $title = $langs->trans("Recurrence"); + print load_fiche_titre($title, '', 'calendar'); + + print ''; + + // Frequency + print '"; + + // First date of execution for cron + print ""; + + // Number max of generation + print ""; + + print "
'; + print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')); + print ""; + print " "; + print $form->selectarray( + 'unit_frequency', + array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), + (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m') + ); + print "
".$langs->trans('NextDateToExecution').""; + if ($date_next_execution != "") + $date_next_execution = (GETPOST('remonth') ? dol_mktime( + 12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear') + ) : -1); + print $form->select_date($date_next_execution, '', 1, 1, '', "add", 1, 1, 1); + print "
".$langs->trans("MaxPeriodNumber").""; + print ''; + print "
"; + + print '
'; + + $title = $langs->trans("ProductsAndServices"); + if (empty($conf->service->enabled)) + $title = $langs->trans("Products"); + else if (empty($conf->product->enabled)) + $title = $langs->trans("Services"); + + print load_fiche_titre($title, '', ''); + + /* + * Invoice lines + */ + print ''; + print ''; + + print "
'; + + $sql = 'SELECT l.*'; + $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet as l"; + $sql.= " WHERE l.fk_fichinter= ".$object->id; + $sql.= " AND l.fk_product is null "; + $sql.= " ORDER BY l.rang"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; $total = 0; + + echo ''; + if ($num) { + print ''; + print ''; + print ''; + print "\n"; + } + $var=true; + while ($i < $num) { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + + // Show product and description + + print ''; + print ""; + + $i++; + } + $db->free($result); + + } else + print $db->error(); + print "
'.$langs->trans("Description").''.$langs->trans("Duration").'
'; + print ''; // ancre pour retourner sur la ligne + + $text = img_object($langs->trans('Service'), 'service'); + + print $text.' '.nl2br($objp->description); + + // Qty + print ''.convertSecondToTime($objp->duree).'
"; + + print '
\n"; + + dol_fiche_end(); + + print '
'; + print '     '; + print ''; + print '
'; + print "
\n"; + } + else + dol_print_error('', "Error, no invoice ".$object->id); + +} elseif ($action == 'selsocforcreatefrommodel') { + print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'title_commercial.png'); + dol_fiche_head(''); + + print '
'; + print ''; + print ''; + print '
'.$langs->trans("ThirdParty").''; + print $form->select_company('', 'socid', '', 1, 1); + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print ''; + print ''; + print '
'; + + print '
'; +} else { + /* + * View mode + * + */ + if ($id > 0) { + if ($object->fetch($id) > 0) { + $object->fetch_thirdparty(); + + $author = new User($db); + $author->fetch($object->user_author); + + $head = fichinter_rec_prepare_head($object); + + dol_fiche_head($head, 'card', $langs->trans("PredefinedInterventional"), 0, 'intervention'); + + // Intervention card + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
'; + // Thirdparty + + $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) { + $formproject = new FormProjets($db); + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->ficheinter->creer) { + if ($action != 'classify') { + $morehtmlref.=''; + $morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + } + if ($action == 'classify') { + + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects( + $object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1 + ); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project( + $_SERVER['PHP_SELF'].'?id='.$object->id, + $object->socid, $object->fk_project, + 'none', 0, 0, 0, 1 + ); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='trans('ShowProject').'">'; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='
'; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
'; + print '
'; + print '
'; + + print ''; + + print ""; + + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { + // Duration + print ''; + print ''; + } + + print '"; + + // Contrat + if (! empty($conf->contrat->enabled)) { + $langs->load('contrat'); + print ''; + print ''; + print ''; + + } + print "
".$langs->trans("Author").''.$author->getFullName($langs)."
'.$langs->trans("TotalDuration").''; + print convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); + print '
'.$langs->trans("Description").''.nl2br($object->description)."
'; + + print ''; + if ($action != 'contrat') { + print ''; + } + print '
'; + print $langs->trans('Contract'); + print 'id.'">'; + print img_edit($langs->trans('SetContract'), 1); + print '
'; + print '
'; + if ($action == 'contrat') { + $formcontract= new Formcontract($db); + $formcontract->formSelectContract( + $_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, + $object->fk_contrat, 'contratid', 0, 1 + ); + } else { + if ($object->fk_contrat) { + $contratstatic = new Contrat($db); + $contratstatic->fetch($object->fk_contrat); + print $contratstatic->getNomUrl(0, '', 1); + } else + print " "; + + } + print '
"; + print '
'; + + print '
'; + print '
'; + print '
'; + + print ''; + + $title = $langs->trans("Recurrence"); + print load_fiche_titre($title, '', 'calendar'); + + print '
'; + + // if "frequency" is empty or = 0, the reccurence is disabled + print ''; + + // Date when + print ''; + print ''; + + // Max period / Rest period + print ''; + print ''; + + print '
'; + print ''; + if ($action != 'editfrequency' && $user->rights->ficheinter->creer) { + print ''; + } + print '
'; + print $langs->trans('Frequency'); + print ''; + print img_edit($langs->trans('Edit'), 1) . '
'; + print '
'; + if ($action == 'editfrequency') { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print " "; + print $form->selectarray( + 'unit_frequency', + array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), + ($object->unit_frequency?$object->unit_frequency:'m') + ); + print '
'; + } else { + if ($object->frequency > 0) + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); + else + print $langs->trans("NotARecurringInterventionalTemplate"); + } + print '
'; + if ( $user->rights->ficheinter->creer && ($action == 'date_when' || $object->frequency > 0)) { + print $form->editfieldkey( + $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, + $object, $user->rights->facture->creer, 'day' + ); + } else { + print $langs->trans("NextDateToExecution"); + } + print ''; + if ($action == 'date_when' || $object->frequency > 0) { + print $form->editfieldval( + $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, + $object, $user->rights->facture->creer, 'day' + ); + } + print '
'; + if ($user->rights->ficheinter->creer && ($action == 'nb_gen_max' || $object->frequency > 0)) { + print $form->editfieldkey( + $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, + $object, $user->rights->facture->creer + ); + } else + print $langs->trans("MaxPeriodNumber"); + + print ''; + if ($action == 'nb_gen_max' || $object->frequency > 0) { + print $form->editfieldval( + $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', + $object, $user->rights->facture->creer + ); + } + else + print ''; + + print '
'; + + // Frequencry/Recurring section + if ($object->frequency > 0) { + print '
'; + if (empty($conf->cron->enabled)) { + $txtinfoadmin=$langs->trans( + "EnableAndSetupModuleCron", + $langs->transnoentitiesnoconv("Module2300Name") + ); + print info_admin($txtinfoadmin); + } + print '
'; + print ''; + + // Nb of generation already done + print ''; + print ''; + print ''; + + // Date last + print ''; + print ''; + print '
'.$langs->trans("NbOfGenerationDone").''; + print $object->nb_gen_done?$object->nb_gen_done:'0'; + print '
'; + print $langs->trans("DateLastGeneration"); + print ''; + print dol_print_date($object->date_last_gen, 'dayhour'); + print '
'; + print '
'; + } + + print '
'; + print '
'; + print '
'; + + print '

'; + + /* + * Lines + */ + + $title = $langs->trans("ProductsAndServices"); + if (empty($conf->service->enabled)) + $title = $langs->trans("Products"); + else if (empty($conf->product->enabled)) + $title = $langs->trans("Services"); + + print load_fiche_titre($title); + + print ''; + print ''; + print ''; + print ''; + print ''; + + $num = count($object->lines); + $i = 0; + $var=true; + while ($i < $num) { + $var=!$var; + + // Show product and description + if (isset($object->lines[$i]->product_type)) + $type=$object->lines[$i]->product_type; + else + $object->lines[$i]->fk_product_type; + // Try to enhance type detection using date_start and date_end for free lines when type + // was not saved. + if (! empty($objp->date_start)) $type=1; + if (! empty($objp->date_end)) $type=1; + + // Show line + print ""; + print ''; + + print ''; + print "\n"; + $i++; + } + print '
'.$langs->trans("Description").''.$langs->trans("Duration").'
'; + $text = img_object($langs->trans('Service'), 'service'); + print $text.' '.nl2br($object->lines[$i]->desc); + print ''.convertSecondToTime($object->lines[$i]->duree).'
'; + + /** + * Barre d'actions + */ + print '
'; + + if ($user->rights->ficheinter->creer) { + print ''; + } + + if ($user->rights->ficheinter->supprimer) { + print ''; + } + print '
'; + } else + print $langs->trans("ErrorRecordNotFound"); + + } else { + /* + * List mode + */ + $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, "; + $sql.= " f.duree, f.fk_contrat, f.fk_projet, f.frequency, f.nb_gen_done, f.nb_gen_max,"; + $sql.= " f.date_last_gen, f.date_when, f.datec"; + + $sql.= " FROM ".MAIN_DB_PREFIX."fichinter_rec as f"; + $sql.= " , ".MAIN_DB_PREFIX."societe as s "; + if (! $user->rights->societe->client->voir && ! $socid) { + $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql .= " AND s.rowid = ".$socid; + if (! $user->rights->societe->client->voir && ! $socid) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + } + if ($search_ref) $sql .= natural_search('f.titre', $search_ref); + if ($search_societe) $sql .= natural_search('s.nom', $search_societe); + if ($search_frequency == '1') $sql.= ' AND f.frequency > 0'; + if ($search_frequency == '0') $sql.= ' AND (f.frequency IS NULL or f.frequency = 0)'; + + + //$sql .= " ORDER BY $sortfield $sortorder, rowid DESC "; + // $sql .= $db->plimit($limit + 1, $offset); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + print_barre_liste( + $langs->trans("RepeatableInterventional"), $page, + $_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder, + '', $num, '', 'title_commercial.png' + ); + + print $langs->trans("ToCreateAPredefinedInterventional").'

'; + + $i = 0; + print ''; + print ''; + print_liste_field_titre( + $langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "", + 'width="200px" align="left"', $sortfiled, $sortorder + ); + + print_liste_field_titre( + $langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "", + 'width="200px" align="left"', $sortfiled, $sortorder + ); + if (! empty($conf->contrat->enabled)) + print_liste_field_titre( + $langs->trans("Contract"), $_SERVER['PHP_SELF'], + "f.fk_contrat", "", "", + 'width="100px" align="left"', $sortfiled, $sortorder + ); + + if (! empty($conf->projet->enabled)) + print_liste_field_titre( + $langs->trans("Project"), $_SERVER['PHP_SELF'], + "f.fk_project", "", "", + 'width="100px" align="left"', $sortfiled, $sortorder + ); + print_liste_field_titre( + $langs->trans("Duration"), $_SERVER['PHP_SELF'], + 'f.duree', '', '', + 'width="50px" align="right"', $sortfiled, $sortorder + ); + // Recurring or not + print_liste_field_titre( + $langs->trans("Frequency"), $_SERVER['PHP_SELF'], + "f.frequency", "", "", + 'width="100px" align="center"', $sortfiled, $sortorder + ); + print_liste_field_titre( + $langs->trans("NbOfGenerationDone"), $_SERVER['PHP_SELF'], + "f.nb_gen_done", "", "", + 'width="100px" align="center"', $sortfiled, $sortorder + ); + + print_liste_field_titre( + $langs->trans("DateLastGeneration"), $_SERVER['PHP_SELF'], + "f.date_last_gen", "", "", + 'width="100px" align="center"', $sortfiled, $sortorder + ); + print_liste_field_titre( + $langs->trans("NextDateToIntervention"), $_SERVER['PHP_SELF'], + "f.date_when", "", "", + 'width="100px" align="center"', $sortfiled, $sortorder + ); + print ''; + print "\n"; + + +// les filtres à faire ensuite + + if ($num > 0) { + $var=true; + while ($i < min($num, $limit)) { + $objp = $db->fetch_object($resql); + $var=!$var; + + print ""; + print '\n"; + if ($objp->socid) { + $companystatic->id=$objp->socid; + $companystatic->name=$objp->name; + print ''; + } else + print ''; + + if (! empty($conf->contrat->enabled)) { + print ''; + } + if (! empty($conf->projet->enabled)) { + print ''; + } + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + } else { + print ''.$langs->trans('NA').''; + print ''; + print ''; + print ''; + } + + if ($user->rights->ficheinter->creer) { + // Action column + print '"; + + print "\n"; + $i++; + } + } + } else + print ''; + + print "
'; + print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; + print "'.$companystatic->getNomUrl(1, 'customer').''.$langs->trans("None").''; + if ($objp->fk_contrat >0) { + $contratstatic->fetch($objp->fk_contrat); + print $contratstatic->getNomUrl(1); + } + print ''; + if ($objp->fk_project >0) { + $projectstatic->fecth($objp->fk_projet); + print $projectstatic->getNomUrl(1); + } + print ''.convertSecondToTime($objp->duree).''.yn($objp->frequency?1:0).''; + if ($objp->frequency) { + print $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') ; + print ''; + print dol_print_date($db->jdate($objp->date_last_gen), 'day') ; + print ''; + print dol_print_date($db->jdate($objp->date_when), 'day'); + print ''; + print ''.$langs->trans('NA').''; + print ''; + print ''.$langs->trans('NA').''; + print ''; + if ($user->rights->ficheinter->creer) { + if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { + print ''; + print $langs->trans("CreateFichInter").''; + } else + print $langs->trans("DateIsNotEnough"); + } else + print " "; + + print "
'.$langs->trans("NoneF").'
"; + $db->free($resql); + } else + dol_print_error($db); + } +} +llxFooter(); +$db->close(); From e0c1e330125287e719cd96cd27f09529d50474c7 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Wed, 30 May 2018 00:20:31 +0200 Subject: [PATCH 20/38] NEW: ADD url to see the last version of a external module --- htdocs/admin/modules.php | 9 ++++++++- .../template/core/modules/modMyModule.class.php | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 10a9ccb5fc3..4b9de2568c7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -7,7 +7,8 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud - * + * Copyright (C) 2018 Nicolas ZABOURI + * * 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 @@ -666,6 +667,12 @@ if ($mode == 'common') // Version print ''; print $versiontrans; + if (!empty($objMod->url_last_version)) { + $newversion = file_get_contents($objMod->url_last_version); + if (version_compare($newversion, $versiontrans) > 0) { + print " $newversion"; + } + } print "\n"; // Activate/Disable and Setup (2 columns) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 0ca707daa1c..1a3d8569dc8 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -73,6 +74,9 @@ class modMyModule extends DolibarrModules // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; + + //Url to the file with your last numberversion of this module + $this->url_last_version = 'http://www.example.com/versionmodule.txt'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. From 7c57b360a301476c7451c1a9f09cac440d2645c1 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Wed, 30 May 2018 13:45:17 +0200 Subject: [PATCH 21/38] Auto stash before merge of "develop" and "Dolibarr/develop" --- htdocs/modulebuilder/admin/setup.php | 159 +++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 htdocs/modulebuilder/admin/setup.php diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php new file mode 100644 index 00000000000..f84bf8989ad --- /dev/null +++ b/htdocs/modulebuilder/admin/setup.php @@ -0,0 +1,159 @@ + + * + * 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/modulebuilder/admin/setup.php + * \ingroup modulebuilder + * \brief Page setup for modulebuilder module + */ +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; + +global $conf,$langs,$user, $db; +$langs->loadLangs(array("admin", "other", "modulebuilder")); + +if (!$user->admin || empty($conf->modulebuilder->enabled)) + accessforbidden(); + +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + +/* + * Actions + */ +if($action=="update"){ + $res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity); + if ($res1 < 0) + { + setEventMessages('ErrorFailedToSaveDate', null, 'errors'); + $db->rollback(); + } + else + { + setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); + $db->commit(); + } +} + +if (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $values = GETPOST($code); + if (is_array($values)) + $values = implode(',', $values); + + if (dolibarr_set_const($db, $code, $values, 'chaine', 0, '', $conf->entity) > 0) { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } else { + dol_print_error($db); + } +} + +if (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + if (dolibarr_del_const($db, $code, 0) > 0) { + Header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$form = new Form($db); + +llxHeader('', $langs->trans("ModulebuilderSetup")); + +$linkback = ''; +if (GETPOST('withtab', 'alpha')) { + $linkback = '' . $langs->trans("BackToModuleList") . ''; +} + +print load_fiche_titre($langs->trans("ModuleSetup") . ' ' . $langs->trans('Modulebuilder'), $linkback); + +if (GETPOST('withtab', 'alpha')) { + dol_fiche_head($head, 'modulebuilder', '', -1); +} + + +print '' . $langs->trans("ModuleBuilderDesc") . "
\n"; + +print '
'; + +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; +print ''; + + + +print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; +print '
' . $langs->trans("Key") . '' . $langs->trans("Value") . '
' . $langs->trans("UseAboutPage") . ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MODULEBUILDER_USE_ABOUT'); +} else { + if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) { + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; + } else { + print '' . img_picto($langs->trans("Enabled"), 'on') . ''; + } +} +print '
' . $langs->trans("UseDocFolder") . ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MODULEBUILDER_USE_DOCFOLDER'); +} else { + if (empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)) { + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; + } else { + print '' . img_picto($langs->trans("Enabled"), 'on') . ''; + } +} +print '
' . $langs->trans("UseSpecificReadme") . ''; +print ''; +print '
'; +print ''; +print '
'; + +if (GETPOST('withtab', 'alpha')) { + dol_fiche_end(); +} + +print '

'; + +llxFooter(); +$db->close(); From 78b3067de352644dd00359a691d64e4258be98d2 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Wed, 30 May 2018 13:54:43 +0200 Subject: [PATCH 22/38] NEW: ADD admin page for modulebuilder ADD custom README ADD choice to generate about page and documentation folder --- htdocs/core/modules/modModuleBuilder.class.php | 3 ++- htdocs/langs/en_US/modulebuilder.lang | 5 ++++- htdocs/modulebuilder/admin/setup.php | 2 +- htdocs/modulebuilder/index.php | 12 ++++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index 2c7b917d6d2..d5c333c4ade 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Nicolas ZABOURI * * 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,7 +60,7 @@ class modModuleBuilder extends DolibarrModules // Config pages //------------- - $this->config_page_url = array(); + $this->config_page_url = array('setup@modulebuilder'); // Dependancies //------------- diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 6638e1fa674..ed3a872d3c6 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -94,4 +94,7 @@ YouCanUseTranslationKey=You can use here a key that is the translation key found DropTableIfEmpty=(Delete table if empty) TableDoesNotExists=The table %s does not exists TableDropped=Table %s deleted -InitStructureFromExistingTable=Build the structure array string of an existing table \ No newline at end of file +InitStructureFromExistingTable=Build the structure array string of an existing table +UseAboutPage=Disallow the about page +UseDocFolder=Disallow the documentation folder +UseSpecificReadme=Use a specific ReadMe \ No newline at end of file diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index f84bf8989ad..5bc1fb7c206 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -73,7 +73,7 @@ if (preg_match('/del_(.*)/', $action, $reg)) { } } - + /* * View */ diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e844793b601..1d0c7960fda 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -120,6 +120,13 @@ if ($dirins && $action == 'initmodule' && $modulename) setEventMessages($langs->trans("AllFilesDidAlreadyExist", $srcdir, $destdir), null, 'warnings'); } } + + if(!empty($conf->global->MODULEBUILDER_USE_ABOUT)){ + dol_delete_file($destdir.'/admin/about.php'); + } + if(!empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)){ + dol_delete_dir($destdir.'/doc/'); + } // Delete some files dol_delete_file($destdir.'/myobject_card.php'); @@ -165,6 +172,11 @@ if ($dirins && $action == 'initmodule' && $modulename) setEventMessages($langs->trans("ErrorFailToMakeReplacementInto", $phpfileval['fullname']), null, 'errors'); } } + + if(!empty($conf->global->MODULEBUILDER_SPECIFIC_README)){ + dol_delete_file($destdir.'/README.md'); + file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README); + } } if (! $error) From 0f9fa09d3f0a33bc6c87cfe02e41772b21f806dd Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Thu, 31 May 2018 09:13:18 +0200 Subject: [PATCH 23/38] Fix after the comment --- htdocs/admin/modules.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 4b9de2568c7..b466a3cba54 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -667,10 +667,15 @@ if ($mode == 'common') // Version print ''; print $versiontrans; - if (!empty($objMod->url_last_version)) { - $newversion = file_get_contents($objMod->url_last_version); - if (version_compare($newversion, $versiontrans) > 0) { - print " $newversion"; + if(!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)){ + require_once(DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'); + if (!empty($objMod->url_last_version)) { + $newversion = getURLContent($objMod->url_last_version); + if(isset($newversion['content'])){ + if (version_compare($newversion['content'], $versiontrans) > 0) { + print " ".$newversion['content'].""; + } + } } } print "\n"; From 083acb1af578c7e9150b0773a1bf100ba3423ba8 Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Thu, 7 Jun 2018 16:24:45 +0100 Subject: [PATCH 24/38] Added MAIN_DOCUMENTS_DESCRIPTION_FIRST option to allow desc to appear before product/service label in documents --- htdocs/core/lib/pdf.lib.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index b0cda2ecd6a..ad2b1066fbd 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1228,7 +1228,17 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl { if ($idprod) { - if (empty($hidedesc)) $libelleproduitservice.=$desc; + if (empty($hidedesc)) + { + if (!empty($conf->global->MAIN_DOCUMENTS_DESCRIPTION_FIRST)) + { + $libelleproduitservice=$desc."\n".$libelleproduitservice; + } + else + { + $libelleproduitservice.=$desc; + } + } } else { From 74d92dd91f35a70cfec0c9806c02798ddc94930b Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Mon, 11 Jun 2018 23:09:12 +0100 Subject: [PATCH 25/38] New: Optiopn to see line numbers in modules page --- htdocs/admin/modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 588bdb856db..df1cd2a61f4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -637,6 +637,7 @@ if ($mode == 'common') } print ''."\n"; + if(!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''.++$linenum.''; // Picto + Name of module print ' '; From 933a6a5ba353306fc599a27c8918ed6ff487353d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jun 2018 22:11:44 +0200 Subject: [PATCH 26/38] Update html.formcontract.class.php --- htdocs/core/class/html.formcontract.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 01ebe66666b..a3a3696e5f4 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -57,7 +57,7 @@ class FormContract global $db,$user,$conf,$langs; $hideunselectables = false; - if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true; // Search all contacts $sql = 'SELECT c.rowid, c.ref, c.fk_soc, c.statut'; From e18717aa8575bbc78ee334c3917c73dd470743e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jun 2018 22:12:16 +0200 Subject: [PATCH 27/38] Update html.formprojet.class.php --- htdocs/core/class/html.formprojet.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 75ccc1d8245..f437920caf9 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -143,7 +143,7 @@ class FormProjets $outarray=array(); $hideunselectables = false; - if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true; $projectsListId = false; if (empty($user->rights->projet->all->lire)) @@ -318,7 +318,7 @@ class FormProjets $out=''; $hideunselectables = false; - if (! empty($conf->global->SELECT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true; if (empty($projectsListId)) { From 3b33dad8fdb41cdb09f77aade27c98f437cae4ee Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Wed, 20 Jun 2018 14:40:32 +0200 Subject: [PATCH 28/38] Add supplier ref Hi In all common case the supplier send a receipt with the parcel on which is writen his product ref (because this is his reference) with the quantity in the parcel and if he is smart/nice our reference. By adding the supplier ref column the supplier order dispatch is easier. Tks. --- htdocs/fourn/commande/dispatch.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 5b4adc39638..2c4fbe9e799 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -492,7 +492,7 @@ if ($id > 0 || ! empty($ref)) { $db->free($resql); } - $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty,"; + $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty, l.ref AS sref,"; $sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse"; $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid"; @@ -514,6 +514,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; + print '' . $langs->trans("SupplierRef") . ''; print '' . $langs->trans("QtyOrdered") . ''; print '' . $langs->trans("QtyDispatchedShort") . ''; print '' . $langs->trans("QtyToDispatchShort") . ''; @@ -590,6 +591,9 @@ if ($id > 0 || ! empty($ref)) { if (! empty($objp->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) $up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU'); + // Supplier ref + print ''.$objp->sref.''; + // Qty ordered print '' . $objp->qty . ''; From 62f2108101b98d50853cde4617a41f85817858d9 Mon Sep 17 00:00:00 2001 From: "STAGIAIRE-PC\\Pierre" Date: Wed, 27 Jun 2018 10:33:57 +0200 Subject: [PATCH 29/38] ajout de la gestion des comptes bancaires des tiers via l'api --- .../societe/class/api_thirdparties.class.php | 172 ++++++++++++++++++ .../class/companybankaccount.class.php | 57 ++++++ 2 files changed, 229 insertions(+) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 73c782ddf7c..fa2c44078cd 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -996,6 +996,178 @@ class Thirdparties extends DolibarrApi return $result; } + /** + * Get CompanyBankAccount objects for thirdparty + * + * @param int $socid + * + * @return array + */ + function getCompanyBankAccount($socid){ + + global $db, $conf; + + if(! DolibarrApiAccess::$user->rights->facture->lire) { + throw new RestException(401); + } + if(empty($socid)) { + throw new RestException(400, 'Thirdparty ID is mandatory'); + } + + if( ! DolibarrApi::_checkAccessToResource('societe',$socid)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + /** + * On requete sur tous les enregistrements qui ont comme fk_soc, la société passée en paramètre + */ + + $sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; + $sql.= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_rib"; + if ($socid) $sql.= " WHERE fk_soc = ".$socid." "; + + + $result = $db->query($sql); + + if($result->num_rows == 0 ){ + throw new RestException(404, 'Account not found'); + } + + $i=0; + + $accounts =[]; + + if ($result) + { + $num = $db->num_rows($result); + while ($i < $num) + { + $obj = $db->fetch_object($result); + $account = new CompanyBankAccount($db); + if($account->fetch($obj->rowid)) { + $accounts[] = $account; + } + $i++; + } + } + else{ + throw new RestException(404, 'Account not found'); + } + + + $fields = ['socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id']; + + $returnAccounts = []; + + foreach($accounts as $account){ + $object= []; + foreach($account as $key => $value) + if(in_array($key, $fields)){ + $object[$key] = $value; + + } + $returnAccounts[] = $object; + } + + return $returnAccounts; + } + + + /** + * Create CompanyBankAccount object for thirdparty + * @param int $socid id de l'entreprise + * @param array $request_data Request datas + * + * @return object ID of thirdparty + * + * @url POST {socid}/CompanyBankAccount + */ + function createCompanyBankAccount($socid, $request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $account = new CompanyBankAccount($this->db); + + $account->socid = $socid; + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + if ($account->create(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error creating Company Bank account'); + + + if ($account->update(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error updating values'); + + return $account; + } + + + /** + * Update CompanyBankAccount object for thirdparty + * @param int $id Id du compte + * @param int $socid + * @param array $request_data Request datas + * + * @return object ID of thirdparty + * + * @url PUT {socid}/CompanyBankAccount/{id} + */ + function updateCompanyBankAccount($socid, $id, $request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $account = new CompanyBankAccount($this->db); + + $account->fetchFromApi($id, $socid); + + + + if($account->socid != $socid){ + throw new RestException(401); + } + + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + if ($account->update(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error updating values'); + + return $account; + } + + /** + * @param int $id Id du compte + * @param int $socid Id de l'entreprise + * + * @return int -1 si erreur 1 si suppression + * + * @url DELETE {socid}/CompanyBankAccount/{id} + */ + function deleteCompanyBankAccount($id, $socid){ + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $account = new CompanyBankAccount($this->db); + + $account->fetch($id); + + if(!$account->socid == $socid) + throw new RestException(401); + + return $account->delete(DolibarrApiAccess::$user); + } /** diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 187f7c5ec65..68dd8f51c3b 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -250,6 +250,63 @@ class CompanyBankAccount extends Account } } + /** + * Load record from database for the API + * + * @param int $id Id of record + * @param int $socid Id of company. If this is filled, function will return the first default RIB of company + * @return int <0 if KO, >0 if OK + */ + function fetchFromApi($id, $socid=0) + { + if (empty($id) && empty($socid)) return -1; + + $sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; + $sql.= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_rib"; + if ($id) $sql.= " WHERE rowid = ".$id; + if ($socid) $sql.= " AND fk_soc = ".$socid; + + $resql = $this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + + $this->ref = $obj->fk_soc.'-'.$obj->label; // Generate an artificial ref + + $this->id = $obj->rowid; + $this->type = $obj->type; + $this->socid = $obj->fk_soc; + $this->bank = $obj->bank; + $this->code_banque = $obj->code_banque; + $this->code_guichet = $obj->code_guichet; + $this->number = $obj->number; + $this->cle_rib = $obj->cle_rib; + $this->bic = $obj->bic; + $this->iban = $obj->iban; + $this->domiciliation = $obj->domiciliation; + $this->proprio = $obj->proprio; + $this->owner_address = $obj->owner_address; + $this->label = $obj->label; + $this->default_rib = $obj->default_rib; + $this->datec = $this->db->jdate($obj->datec); + $this->datem = $this->db->jdate($obj->datem); + $this->rum = $obj->rum; + $this->frstrecur = $obj->frstrecur; + } + $this->db->free($resql); + + return 1; + } + else + { + dol_print_error($this->db); + return -1; + } + } + /** * Delete a rib from database * From a94eeaa5005e71a41e5a413b86c22e8f5f0c3624 Mon Sep 17 00:00:00 2001 From: "STAGIAIRE-PC\\Pierre" Date: Wed, 27 Jun 2018 10:53:45 +0200 Subject: [PATCH 30/38] adding the possibility to personnalize ent_to_end and ustrd of a bank levy --- htdocs/admin/prelevement.php | 12 ++++++++++++ .../prelevement/class/bonprelevement.class.php | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 6fd40cf2825..7b7bbd8e2b4 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -221,6 +221,18 @@ print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER' print ''; print ''; +//EntToEnd +print ''.$langs->trans("END_TO_END").''; +print ''; +print ''; +print ''; + +//USTRD +print ''.$langs->trans("USTRD").''; +print ''; +print ''; +print ''; + print ''; print '
'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 245b25be3b6..a6b0ec84317 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1575,7 +1575,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR =''; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.('AS-'.dol_trunc($row_facnumber,20).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters + // $XML_DEBITOR .=' '.('AS-'.dol_trunc($row_facnumber,20).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters + $XML_DEBITOR .=' '.(($conf->global->END_TO_END != "" ) ? $conf->global->END_TO_END : ('AS-'.dol_trunc($row_facnumber,20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1607,7 +1608,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; // $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; - $XML_DEBITOR .=' '.dol_trunc($row_facnumber, 135).''.$CrLf; // 140 max + // $XML_DEBITOR .=' '.dol_trunc($row_facnumber, 135).''.$CrLf; // 140 max + $XML_DEBITOR .=' '.(($conf->global->USTRD != "" ) ? $conf->global->USTRD : dol_trunc($row_facnumber, 135) ).''.$CrLf; // 140 max $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; return $XML_DEBITOR; From 8a780b3910a0c94faa5008b3127c409dfecb7805 Mon Sep 17 00:00:00 2001 From: "STAGIAIRE-PC\\Pierre" Date: Wed, 27 Jun 2018 11:01:20 +0200 Subject: [PATCH 31/38] Code refactorisation --- .../societe/class/api_thirdparties.class.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index fa2c44078cd..3faf2f14994 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -999,7 +999,7 @@ class Thirdparties extends DolibarrApi /** * Get CompanyBankAccount objects for thirdparty * - * @param int $socid + * @param int $socid Thirdparty id * * @return array */ @@ -1019,7 +1019,7 @@ class Thirdparties extends DolibarrApi } /** - * On requete sur tous les enregistrements qui ont comme fk_soc, la société passée en paramètre + * We select all the records that match the socid */ $sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; @@ -1076,14 +1076,14 @@ class Thirdparties extends DolibarrApi /** * Create CompanyBankAccount object for thirdparty - * @param int $socid id de l'entreprise + * @param int $socid thirdparty id * @param array $request_data Request datas * * @return object ID of thirdparty * * @url POST {socid}/CompanyBankAccount */ - function createCompanyBankAccount($socid, $request_data = NULL) + function createCompanyBankAccount($socid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->societe->creer) { throw new RestException(401); @@ -1110,15 +1110,16 @@ class Thirdparties extends DolibarrApi /** * Update CompanyBankAccount object for thirdparty - * @param int $id Id du compte - * @param int $socid + * + * @param int $socid Thirdparty id + * @param int $id CompanyBankAccount's id * @param array $request_data Request datas * * @return object ID of thirdparty * * @url PUT {socid}/CompanyBankAccount/{id} */ - function updateCompanyBankAccount($socid, $id, $request_data = NULL) + function updateCompanyBankAccount($socid, $id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->societe->creer) { throw new RestException(401); @@ -1146,10 +1147,10 @@ class Thirdparties extends DolibarrApi } /** - * @param int $id Id du compte - * @param int $socid Id de l'entreprise + * @param int $id CompanyBankAccount's id + * @param int $socid Thirdparty id * - * @return int -1 si erreur 1 si suppression + * @return int -1 if error 1 if correct deletion * * @url DELETE {socid}/CompanyBankAccount/{id} */ From 19eaa3df669ade3f013ab4a897750cba0a28c952 Mon Sep 17 00:00:00 2001 From: "STAGIAIRE-PC\\Pierre" Date: Wed, 27 Jun 2018 11:29:46 +0200 Subject: [PATCH 32/38] =?UTF-8?q?ajout=20de=20la=20modification=20dans=20l?= =?UTF-8?q?a=20base=20de=20donn=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/prelevement.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 7b7bbd8e2b4..56e1e7f2039 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -80,6 +80,16 @@ if ($action == "set") $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"),'chaine',0,'',$conf->entity); if (! $res > 0) $error++; } + if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") + { + $res = dolibarr_set_const($db, "END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"),'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") + { + $res = dolibarr_set_const($db, "USTRD", GETPOST("PRELEVEMENT_USTRD"),'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } if (! $error) { From a952b46d8b58c312ab3b39adb78d89dd9cb3b450 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 27 Jun 2018 12:37:31 +0200 Subject: [PATCH 33/38] clean and update code --- htdocs/install/repair.php | 1 - htdocs/livraison/card.php | 3 --- htdocs/loan/index.php | 2 -- htdocs/margin/admin/margin.php | 5 ----- htdocs/margin/agentMargins.php | 3 --- htdocs/printing/admin/printing.php | 4 ---- htdocs/product/admin/product.php | 8 -------- htdocs/product/admin/product_tools.php | 2 -- htdocs/product/canvas/product/tpl/list.tpl.php | 3 +-- htdocs/product/composition/card.php | 2 -- htdocs/product/fournisseurs.php | 3 --- htdocs/product/index.php | 4 ---- htdocs/product/stock/massstockmove.php | 4 ---- htdocs/product/stock/productlot_list.php | 2 -- htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php | 3 +-- 15 files changed, 2 insertions(+), 47 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 896d6964bdd..97f9a71bb87 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -648,7 +648,6 @@ if ($ok && GETPOST('clean_orphelin_dir','alpha')) $object_instance=new ChargeSociales($db); } - $var=true; foreach($filearray as $key => $file) { if (!is_dir($file['name']) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index d6cefb24d83..072c53aa3cb 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -604,11 +604,8 @@ else print ''.$langs->trans("QtyReceived").''; print "\n"; } - $var=true; while ($i < $num_prod) { - - print ''; if ($object->lines[$i]->fk_product > 0) { diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 03e3ab482f4..660189fbc9d 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -104,7 +104,6 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); @@ -167,7 +166,6 @@ if ($resql) $loan_static->ref = $obj->rowid; $loan_static->label = $obj->label; - $var = !$var; print ''; // Ref diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index d37dfe0c83b..eaa53aa8490 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -129,11 +129,9 @@ print ''.$langs->trans("Value").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''; -$var=true; $form = new Form($db); // GLOBAL DISCOUNT MANAGEMENT - print ''; print ''; print ""; @@ -165,7 +163,6 @@ print ''; print ''; // DISPLAY MARGIN RATES - print ''; print ''.$langs->trans("DisplayMarginRates").''; print ''; @@ -189,7 +186,6 @@ print ''.$langs->trans('MarginRate').' = '.$langs->trans('Margin').' / '.$la print ''; // DISPLAY MARK RATES - print ''; print ''.$langs->trans("DisplayMarkRates").''; print ''; @@ -259,7 +255,6 @@ print ''; print ''; // INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT - print '
'; print ''; print ""; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 2e80fe5ced2..8c62b4dd6fe 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -208,7 +208,6 @@ if ($result) if ($num > 0) { - $var=true; while ($i < $num /*&& $i < $conf->liste_limit*/) { @@ -229,8 +228,6 @@ if ($result) $markRate = ($pv != 0)?(100 * $marge / $pv):'' ; } - - print ''; if ($agentid > 0) { $companystatic->id=$objp->socid; diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 96b9cad3849..96dd916290e 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -127,7 +127,6 @@ if ($mode == 'setup' && $user->admin) print $langs->trans("PrintingDriverDesc".$driver)."

\n"; print ''."\n"; - $var=true; print ''; print ''; print ''; @@ -146,7 +145,6 @@ if ($mode == 'setup' && $user->admin) $submit_enabled=0; foreach ($printer->conf as $key) { - switch ($key['type']) { case "text": case "password": @@ -248,7 +246,6 @@ if ($mode == 'config' && $user->admin) print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'."\n"; - $var=true; print ''; print ''; print ''; @@ -333,7 +330,6 @@ if ($mode == 'userconf' && $user->admin) print $langs->trans('PrintUserConfDesc'.$driver)."

\n"; print '
'.$langs->trans("Description").''.$langs->trans("Active").'
'; - $var=true; print ''; print ''; print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index bb214ffc06a..2e57e452928 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -401,7 +401,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -438,7 +437,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print '
'.$langs->trans("User").''.$langs->trans("PrintModule").'
'; print (empty($module->name)?$name:$module->name); print "\n"; @@ -524,12 +522,10 @@ print "
"; print load_fiche_titre($langs->trans("ProductOtherConf"), '', ''); - print ''; print ''; print ''; -$var=true; print ''; print ''; print ''."\n"; @@ -569,7 +565,6 @@ print ''; // multiprix nombre de prix a proposer if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - print ''; print ''; print ''; @@ -611,7 +606,6 @@ print ''; if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { - print ''; print ''; print ''; @@ -619,7 +613,6 @@ if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) } // Visualiser description produit dans les formulaires activation/desactivation - print ''; print ''; print ''; // View product description in thirdparty language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; print '> + $value) { foreach($fieldlist as $field) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a1cd63eea12..c3f568a958c 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -551,7 +551,6 @@ if ($id > 0 || ! empty($ref)) { $num = $db->num_rows($resql); $i=0; - $var=true; if($num == 0) print ''; @@ -655,7 +654,6 @@ if ($id > 0 || ! empty($ref)) print ''; } - } } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b2713d65304..ddda73d0add 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -759,12 +759,9 @@ SCRIPT; if (is_array($product_fourn_list)) { - $var=true; foreach($product_fourn_list as $productfourn) { - - print ''; // Supplier diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 9f11813fdee..89330618879 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -457,8 +457,6 @@ function activitytrim($product_type) } $i = 0; - $var=true; - while ($i < $num) { $objp = $db->fetch_object($result); @@ -466,7 +464,6 @@ function activitytrim($product_type) { if ($trim1+$trim2+$trim3+$trim4 > 0) { - print ''; print ''; print ''; @@ -500,7 +497,6 @@ function activitytrim($product_type) } if ($trim1+$trim2+$trim3+$trim4 > 0) { - print ''; print ''; print ''; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index eae89aca648..51692a3e9a1 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -334,8 +334,6 @@ $buttonrecordnoent=$langs->transnoentitiesnoconv("RecordMovement"); print ''.$langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'
'; print '
'."\n"; -$var=true; - // Form to add a line print ''; print ''; @@ -402,8 +400,6 @@ print ''; foreach($listofdata as $key => $val) { - - $productstatic->fetch($val['id_product']); $warehousestatics->fetch($val['id_sw']); $warehousestatict->fetch($val['id_tw']); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 7c15b3fa7c5..08289ec11e4 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -396,14 +396,12 @@ if ($resql) $productlot = new Productlot($db); $i=0; - $var=true; $totalarray=array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); if ($obj) { - $var = !$var; $productlot->id = $obj->rowid; $productlot->batch = $obj->batch; diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index ca604e61fcc..794ed96f3ec 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -36,12 +36,11 @@ $langs = $GLOBALS['langs']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $total=0; $ilink=0; -$var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass=($var?'pair':'impair'); + $trclass='oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> From 41a516f1c476abade8fddf6ee3cb5b873ee8f301 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 29 Jun 2018 11:48:54 +0200 Subject: [PATCH 34/38] New parameter to transform select into multiselect --- htdocs/core/class/html.form.class.php | 63 +++++++++++++++++---------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9a9d3279e03..99f567f5434 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1001,9 +1001,10 @@ class Form * @param string $selected_input_value Value of preselected input text (for use with ajax) * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) * @param array $ajaxoptions Options for ajax_autocompleter + * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array()) + function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false) { global $conf,$user,$langs; @@ -1040,7 +1041,7 @@ class Form else { // Immediate load of all database - $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam); + $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple); } return $out; @@ -1062,16 +1063,20 @@ class Form * @param int $limit Limit number of answers * @param string $morecss Add more css styles to the SELECT component * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML string with */ - function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='') + function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false) { global $conf,$user,$langs; $out=''; $num=0; $outarray=array(); - + + if ($selected === '') $selected = array(); + else if (!is_array($selected)) $selected = array($selected); + // Clean $filter that may contains sql conditions so sql code if (function_exists('test_sql_and_script_inject')) $filter = test_sql_and_script_inject($filter, 3); @@ -1120,7 +1125,7 @@ class Form } // Construct $out and $outarray - $out.= ''."\n"; $textifempty=''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. @@ -1169,7 +1174,7 @@ class Form if (empty($outputmode)) { - if ($selected > 0 && $selected == $obj->rowid) + if (in_array($obj->rowid,$selected)) { $out.= ''; } @@ -1320,15 +1325,19 @@ class Form * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param string $htmlid Html id to use instead of htmlname + * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return int <0 if KO, Nb of contact in list if OK */ - function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='') + function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $multiple=false) { global $conf,$langs; $langs->load('companies'); if (empty($htmlid)) $htmlid = $htmlname; + + if ($selected === '') $selected = array(); + else if (!is_array($selected)) $selected = array($selected); $out=''; // On recherche les societes @@ -1353,9 +1362,9 @@ class Form $out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); } - if ($htmlname != 'none' || $options_only) $out.= ''; + if ($showempty == 1 && !$multiple) $out.= ''; + if ($showempty == 2) $out.= ''; $num = $this->db->num_rows($resql); $i = 0; if ($num) @@ -1363,7 +1372,6 @@ class Form include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $contactstatic=new Contact($this->db); - if (!is_array($selected)) $selected = array($selected); while ($i < $num) { $obj = $this->db->fetch_object($resql); @@ -1413,7 +1421,7 @@ class Form } else { - $out.= ''; + $out.= ''; } if ($htmlname != 'none' || $options_only) { @@ -1469,16 +1477,20 @@ class Form * @param string $morecss More css * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). * @param int $outputmode 0=HTML select string, 1=Array + * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML select string * @see select_dolgroups */ - function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0) + function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false) { global $conf,$user,$langs; - + // If no preselected user defined, we take current user if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected=$user->id; + if ($selected === '') $selected = array(); + else if (!is_array($selected)) $selected = array($selected); + $excludeUsers=null; $includeUsers=null; @@ -1551,12 +1563,12 @@ class Form $out .= ajax_combobox($htmlname); // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined - $out.= ''; + if ($show_empty && !$multiple) $out.= ''."\n"; + if ($show_every) $out.= ''."\n"; $userstatic=new User($this->db); - + while ($i < $num) { $obj = $this->db->fetch_object($resql); @@ -1568,7 +1580,7 @@ class Form $disableline=''; if (is_array($enableonly) && count($enableonly) && ! in_array($obj->rowid,$enableonly)) $disableline=($enableonlytext?$enableonlytext:'1'); - if ((is_object($selected) && $selected->id == $obj->rowid) || (! is_object($selected) && $selected == $obj->rowid)) + if ((is_object($selected) && $selected->id == $obj->rowid) || (! is_object($selected) && in_array($obj->rowid,$selected) )) { $out.= ''."\n"; - if(!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''; + if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''; // Picto + Name of module print '
'.$langs->trans("Parameters").'
'.$langs->trans("MultiPricesNumPrices").'
'.$langs->trans("NumberOfProductShowInSelect").'
'.$langs->trans("ViewProductDescInFormAbility").''; @@ -652,7 +645,6 @@ print '
'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").''; diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index 291aba9bcf1..ed4480aeaa2 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -294,8 +294,6 @@ if (empty($mysoc->country_code)) else { - $var=true; - print ''; print ''; print ''; diff --git a/htdocs/product/canvas/product/tpl/list.tpl.php b/htdocs/product/canvas/product/tpl/list.tpl.php index e5c315e8148..070f58dd481 100644 --- a/htdocs/product/canvas/product/tpl/list.tpl.php +++ b/htdocs/product/canvas/product/tpl/list.tpl.php @@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf)) -
'.$langs->trans("NoMatchFound").'
'.$tmpyear.''.price($trim1).''.price($trim2).'
'.$tmpyear.''.price($trim1).''.price($trim2).'
'.++$linenum.''.++$linenum.''; From 7984316142b6b122ceaecd00dadd7c81572dcb6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jun 2018 01:20:44 +0200 Subject: [PATCH 37/38] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index d259da1fe55..471b73b894b 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -44,7 +44,6 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; - update llx_propal set fk_statut = 1 where fk_statut = -1; ALTER TABLE llx_inventory ADD COLUMN fk_user_creat integer; @@ -81,7 +80,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 -ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; -- delete old permission no more used From 202ab93c5f4c60176df63c992d275c39b83c4c19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jun 2018 01:20:57 +0200 Subject: [PATCH 38/38] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 471b73b894b..a57e02455cc 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -79,9 +79,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 - - - -- delete old permission no more used DELETE FROM llx_rights_def WHERE perms = 'main' and module = 'commercial';