From bfbb1c20bcc92a383fb64e04a1248e33937e1e9c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 27 Apr 2016 09:27:59 +0200 Subject: [PATCH 01/10] FIX bug on email template --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9af2b3fe0af..f84e1913f1a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -229,7 +229,7 @@ $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[24]= "code,label"; -$tabfield[25]= "label,type_template,position,topic,content"; +$tabfield[25]= "label,type_template,private,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; $tabfield[28]= "code,label,delay,newByMonth,country_id,country"; @@ -261,7 +261,7 @@ $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[24]= "code,label"; -$tabfieldvalue[25]= "label,type_template,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; $tabfieldvalue[28]= "code,label,delay,newByMonth,country"; From b280a700d267f5cd481f39002bafd18a023c8704 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Apr 2016 14:05:56 +0200 Subject: [PATCH 02/10] FIX missing column when module was installed before standard integration --- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 068fbc753cb..89f75c1156d 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -797,6 +797,7 @@ ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL; update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; +ALTER TABLE llx_propal_merge_pdf_product ADD COLUMN lang varchar(5) DEFAULT NULL; --Deal with holidays_user that do not have rowid -- Disabled: too dangerous patch. rowid is a primary key. How is it possible to have no rowid ? From d3b3e60d82edc38345473f0c4b478ae1c70310d1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 10 May 2016 22:37:30 +0200 Subject: [PATCH 03/10] Fix email template edition --- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 89f75c1156d..068fbc753cb 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -797,7 +797,6 @@ ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL; update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; -ALTER TABLE llx_propal_merge_pdf_product ADD COLUMN lang varchar(5) DEFAULT NULL; --Deal with holidays_user that do not have rowid -- Disabled: too dangerous patch. rowid is a primary key. How is it possible to have no rowid ? From 4cbab1cf47a4d3fcb99acaf7e6f7cad74bdaa0f7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 12 May 2016 16:58:14 +0200 Subject: [PATCH 04/10] FIX PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH --- htdocs/product/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 6a8ee778590..766b24a941e 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -247,7 +247,8 @@ if ($object->id) if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { - $filearray = dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); + + $filearray = array_merge($filearray,dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1)); } // For each file build select list with PDF extention From 21b639ef168389b2d2a6b92482179b577621f76a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 14 May 2016 00:47:46 +0200 Subject: [PATCH 05/10] Fix issues with entity control --- htdocs/holiday/class/holiday.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 4e5706f94c6..94704451df7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2012-2014 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2016 Juanjo Menent * * 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 @@ -117,7 +118,7 @@ class Holiday extends CommonObject */ function create($user, $notrigger=0) { - global $conf, $langs; + global $conf; $error=0; $now=dol_now(); @@ -137,7 +138,8 @@ class Holiday extends CommonObject $sql.= "statut,"; $sql.= "fk_validator,"; $sql.= "fk_type,"; - $sql.= "fk_user_create"; + $sql.= "fk_user_create,"; + $sql.= "entity"; $sql.= ") VALUES ("; $sql.= "'".$this->fk_user."',"; $sql.= " '".$this->db->idate($now)."',"; @@ -148,7 +150,8 @@ class Holiday extends CommonObject $sql.= " '1',"; $sql.= " '".$this->fk_validator."',"; $sql.= " '".$this->fk_type."',"; - $sql.= " ".$user->id; + $sql.= " ".$user->id.","; + $sql.= " ".$conf->entity; $sql.= ")"; $this->db->begin(); From b3b064d310312b53133ac4cf234d9b7efc3fa916 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Sat, 14 May 2016 18:58:14 +0200 Subject: [PATCH 06/10] FIX hook on group card called but not initialized --- htdocs/user/group/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 3de421e4f4f..75ad04979b6 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -64,6 +64,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +$hookmanager->initHooks(array('groupcard','globalcard')); /** * Action remove group From af8608ab7aa2fe8fc188e53cde6290ce35b7dadf Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 16 May 2016 10:49:43 +0200 Subject: [PATCH 07/10] Fix services dispatch on supplier order only if STOCK_SUPPORTS_SERVICES --- htdocs/fourn/commande/dispatch.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index fd992dbeeb1..9d7d2bfeefe 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -386,6 +386,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid"; $sql.= " WHERE l.fk_commande = ".$commande->id; + if(empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND l.product_type = 0"; $sql.= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql.= " ORDER BY p.ref, p.label"; From f7c9f20b16297c41c002a3cb1e915a98a4f83c9b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 May 2016 17:21:32 +0200 Subject: [PATCH 08/10] Fix: Expensereport not compatible with multicompany. --- htdocs/expensereport/class/expensereport.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 7de680d02f3..cc32f08b0ac 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -149,6 +150,7 @@ class ExpenseReport extends CommonObject $sql.= ",paid"; $sql.= ",note_public"; $sql.= ",note_private"; + $sql.= ",entity"; $sql.= ") VALUES("; $sql.= "'(PROV)'"; $sql.= ", ".$this->total_ht; @@ -165,6 +167,7 @@ class ExpenseReport extends CommonObject $sql.= ", 0"; $sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); + $sql.= ", ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); From 7bbb3a7da10e024d78ad4911bf6f7a730f720ebe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 May 2016 19:15:44 +0200 Subject: [PATCH 09/10] Supplier proposal was missing --- htdocs/langs/en_US/other.lang | 2 ++ htdocs/product/class/product.class.php | 37 ++++++++++++++++++++++++++ htdocs/product/stats/card.php | 23 ++++++++++------ 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 278fa9c77b7..329ab278329 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -157,11 +157,13 @@ StatsByNumberOfEntities=Statistics in number of referring entities NumberOfProposals=Number of proposals on last 12 month NumberOfCustomerOrders=Number of customer orders on last 12 month NumberOfCustomerInvoices=Number of customer invoices on last 12 month +NumberOfSupplierProposals=Number of supplier proposals on last 12 month NumberOfSupplierOrders=Number of supplier orders on last 12 month NumberOfSupplierInvoices=Number of supplier invoices on last 12 month NumberOfUnitsProposals=Number of units on proposals on last 12 month NumberOfUnitsCustomerOrders=Number of units on customer orders on last 12 month NumberOfUnitsCustomerInvoices=Number of units on customer invoices on last 12 month +NumberOfUnitsSupplierProposals=Number of units on supplier proposals on last 12 month NumberOfUnitsSupplierOrders=Number of units on supplier orders on last 12 month NumberOfUnitsSupplierInvoices=Number of units on supplier invoices on last 12 month EMailTextInterventionValidated=The intervention %s has been validated. diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fce31e31923..ba2eac00cd9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2280,6 +2280,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = d.fk_facture"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity IN (".getEntity('facture', 1).")"; @@ -2312,6 +2313,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = d.fk_facture_fourn"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity IN (".getEntity('facture_fourn', 1).")"; @@ -2344,6 +2346,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.rowid = d.fk_propal"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.entity IN (".getEntity('propal', 1).")"; @@ -2355,6 +2358,38 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode); } + /** + * Return nb of units or proposals in which product is included + * + * @param int $socid Limit count on a particular third party id + * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities + * @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only + * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 + */ + function get_nb_propalsupplier($socid, $mode, $filteronproducttype=-1) + { + global $conf; + global $user; + + $sql = "SELECT sum(d.qty), date_format(p.date_valid, '%Y%m')"; + if ($mode == 'bynumber') $sql.= ", count(DISTINCT p.rowid)"; + $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d, ".MAIN_DB_PREFIX."supplier_proposal as p, ".MAIN_DB_PREFIX."societe as s"; + if ($filteronproducttype >= 0) $sql.=", ".MAIN_DB_PREFIX."product as prod"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE p.rowid = d.fk_supplier_proposal"; + if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; + if ($filteronproducttype >= 0) $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype; + $sql.= " AND p.fk_soc = s.rowid"; + $sql.= " AND p.entity IN (".getEntity('propal', 1).")"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid > 0) $sql.= " AND p.fk_soc = ".$socid; + $sql.= " GROUP BY date_format(p.date_valid,'%Y%m')"; + $sql.= " ORDER BY date_format(p.date_valid,'%Y%m') DESC"; + + return $this->_get_stats($sql,$mode); + } + /** * Return nb of units or orders in which product is included * @@ -2374,6 +2409,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = d.fk_commande"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity('commande', 1).")"; @@ -2404,6 +2440,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = d.fk_commande"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity('commande_fournisseur', 1).")"; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 49b700b46ca..d98d8ed31c6 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -210,15 +210,20 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') 'propal' =>array('modulepart'=>'productstats_proposals', 'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals"))), + 'proposalssuppliers'=>array('modulepart'=>'productstats_proposalssuppliers', + 'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', + 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals"):$langs->transnoentitiesnoconv("NumberOfSupplierProposals"))), + 'orders' =>array('modulepart'=>'productstats_orders', 'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders"))), - 'invoices' =>array('modulepart'=>'productstats_invoices', - 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', - 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))), 'orderssuppliers'=>array('modulepart'=>'productstats_orderssuppliers', 'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders"):$langs->transnoentitiesnoconv("NumberOfSupplierOrders"))), + + 'invoices' =>array('modulepart'=>'productstats_invoices', + 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', + 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))), 'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers', 'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))), @@ -243,11 +248,12 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') } else { - if ($key == 'propal') $graph_data = $object->get_nb_propal($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'propal') $graph_data = $object->get_nb_propal($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'proposalssuppliers') $graph_data = $object->get_nb_propalsupplier($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode,((string) $type != '' ? $type : -1)); // TODO Save cachefile $graphfiles[$key]['file'] } @@ -289,6 +295,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue; if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue; if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue; + if ($graphfiles == 'proposals_suppliers' && ! $user->rights->supplier_proposal->lire) continue; if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue; if ($graphfiles == 'orders_suppliers' && ! $user->rights->fournisseur->commande->lire) continue; From c7dda59fbc150eb7c96a7dc7c0e8846af4de5e6f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 May 2016 17:33:51 +0200 Subject: [PATCH 10/10] Fix: doublon (merge problem?) --- htdocs/comm/propal.php | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index fa5619ca204..e1587d30f13 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -562,15 +562,6 @@ if (empty($reshook)) } } - // Reopen proposal - else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) - { - // prevent browser refresh from reopening proposal several times - if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { - $object->reopen($user, 1); - } - } - // Close proposal else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { @@ -591,17 +582,6 @@ if (empty($reshook)) } } - // Classify billed - else if ($action == 'classifybilled' && $user->rights->propal->cloturer) - { - $result=$object->cloture($user, 4, ''); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - } - // Reopen proposal else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { @@ -617,20 +597,6 @@ if (empty($reshook)) } } - // Close proposal - else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) - { - if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); - $action = 'statut'; - } else { - // prevent browser refresh from closing proposal several times - if ($object->statut == Propal::STATUS_VALIDATED) { - $object->cloture($user, GETPOST('statut'), GETPOST('note')); - } - } - } - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';