From b5d720651968b2ad26418f2a1713e2d34792a464 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 1 May 2018 12:02:33 +0200 Subject: [PATCH 01/38] fix 6.0 accountancy multientity --- htdocs/accountancy/admin/account.php | 45 ++++++++++--------- htdocs/accountancy/admin/journals_list.php | 4 +- .../core/class/html.formaccounting.class.php | 1 + 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 905fd8b97ef..9b1b6746861 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { if (! empty($cancel)) $action = ''; - + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_account = ""; @@ -106,13 +106,13 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options=array(); } - + if (GETPOST('change_chart')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); - + if (! empty($chartofaccounts)) { - + if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -120,12 +120,12 @@ if (empty($reshook)) $error ++; } } - + if ($action == 'disable') { if ($accounting->fetch($id)) { $result = $accounting->account_desactivate($id); } - + $action = 'update'; if ($result < 0) { setEventMessages($accounting->error, $accounting->errors, 'errors'); @@ -165,6 +165,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_vers if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)"; else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)"; $sql .= " WHERE asy.rowid = " . $pcgver; +$sql .= " AND aa.entity = " . $conf->entity; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); @@ -179,7 +180,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); -} +} $sql .= $db->plimit($limit + 1, $offset); @@ -209,11 +210,11 @@ if ($resql) print ''; print ''; print ''; - + $htmlbuttonadd = '' . $langs->trans("Addanaccount") . ''; - + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd); - + // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; print '"; print ''; - print '
'; + print '
'; print '
'; - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -259,7 +260,7 @@ if ($resql) print $searchpicto; print ''; print ''; - + print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); @@ -274,14 +275,14 @@ if ($resql) $accountparent = new AccountingAccount($db); $i=0; - while ($i < min($num, $limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $accountstatic->id = $obj->rowid; $accountstatic->label = $obj->label; $accountstatic->account_number = $obj->account_number; - + print ''; // Account number @@ -310,7 +311,7 @@ if ($resql) $accountparent->id = $obj->rowid2; $accountparent->label = $obj->label2; $accountparent->account_number = $obj->account_number2; - + print "\n"; @@ -371,11 +372,11 @@ if ($resql) } print '' . "\n"; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } - + print "
"; print $accountparent->getNomUrl(1); print "
"; print "
"; print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a3912aebc89..a4718d556f2 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -86,7 +86,7 @@ $tablib[35]= "DictionaryAccountancyJournal"; // Requests to extract data $tabsql=array(); -$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a"; +$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -102,7 +102,7 @@ $tabfieldvalue[35]= "code,label,nature"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[35]= "code,label,nature"; +$tabfieldinsert[35]= "code,label,nature,entity"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index e3e6e9a4f20..3ae53f44fff 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -273,6 +273,7 @@ class FormAccounting extends Form $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; + $sql .= " AND aa.entity=".$conf->entity; $sql .= " ORDER BY aa.account_number"; dol_syslog(get_class($this) . "::select_account", LOG_DEBUG); From 3340598cf8256a74dd9dad0b01646e8ffa4da838 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 May 2018 14:15:11 +0200 Subject: [PATCH 02/38] FIX Projet is not prefilled when created from overwiew page --- htdocs/commande/card.php | 14 ++++++-------- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/supplier_proposal/card.php | 11 +++++------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0844facca69..9f55311444b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -28,9 +28,9 @@ */ /** - * \file htdocs/commande/card.php + * \file htdocs/commande/card.php * \ingroup commande - * \brief Page to show customer order + * \brief Page to show customer order */ require '../main.inc.php'; @@ -76,6 +76,7 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $lineid = GETPOST('lineid', 'int'); +$projectid = GETPOST('projectid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility @@ -228,7 +229,7 @@ if (empty($reshook)) // Link to a project else if ($action == 'classin' && $user->rights->commande->creer) { - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('projectid','int')); } // Add order @@ -259,8 +260,8 @@ if (empty($reshook)) $object->note_private = GETPOST('note_private','none'); $object->note_public = GETPOST('note_public','none'); $object->source = GETPOST('source_id'); - $object->fk_project = GETPOST('projectid'); - $object->ref_client = GETPOST('ref_client'); + $object->fk_project = GETPOST('projectid','int'); + $object->ref_client = GETPOST('ref_client','alpha'); $object->modelpdf = GETPOST('model'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); @@ -1389,7 +1390,6 @@ if ($action == 'create' && $user->rights->commande->creer) if ($socid > 0) $res = $soc->fetch($socid); - $projectid = 0; $remise_absolue = 0; $currency_code = $conf->currency; @@ -1486,7 +1486,6 @@ if ($action == 'create' && $user->rights->commande->creer) $remise_percent = $soc->remise_percent; $remise_absolue = 0; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; - $projectid = 0; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; @@ -1494,7 +1493,6 @@ if ($action == 'create' && $user->rights->commande->creer) $note_public = $object->getDefaultCreateValueFor('note_public'); } - print '
'; print ''; print ''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index b6649250e64..2828963d889 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -349,7 +349,7 @@ if ($action == 'create') print '
'; print ''; print '   '; - print ''; + print ''; print '
'; print '
'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index a5488959016..8c2bfb8090a 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -67,6 +67,7 @@ $action = GETPOST('action', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOST('originid', 'int'); $confirm = GETPOST('confirm', 'alpha'); +$projectid = GETPOST('projectid', 'int'); $lineid = GETPOST('lineid', 'int'); $contactid = GETPOST('contactid','int'); @@ -265,7 +266,7 @@ if (empty($reshook)) $object->remise_percent = GETPOST('remise_percent'); $object->remise_absolue = GETPOST('remise_absolue'); $object->socid = GETPOST('socid'); - $object->fk_project = GETPOST('projectid'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note = GETPOST('note','none'); @@ -283,7 +284,7 @@ if (empty($reshook)) $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->fk_project = GETPOST('projectid'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note = GETPOST('note','none'); @@ -890,7 +891,7 @@ if (empty($reshook)) // Set project else if ($action == 'classin' && $user->rights->supplier_proposal->creer) { - $object->setProject($_POST['projectid']); + $object->setProject(GETPOST('projectid'),'int'); } // Delai de livraison @@ -1103,9 +1104,7 @@ if ($action == 'create') $formproject = new FormProjets($db); - $projectid = 0; - if ($origin == 'project') - $projectid = ($originid ? $originid : 0); + if ($origin == 'project') $projectid = ($originid ? $originid : 0); print ''; print '' . $langs->trans("Project") . ''; From 886ad9d4b644b295bbc673b98ec437d84f5945f5 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 08:45:18 +0200 Subject: [PATCH 03/38] check eldy message --- htdocs/accountancy/admin/account.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 9b1b6746861..1c845716e6b 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -160,12 +160,11 @@ $pcgver = $conf->global->CHARTOFACCOUNTS; $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, "; $sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity; // Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid -if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)"; -else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)"; +if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER) AND a2.entity = " . $conf->entity; +else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED) AND a2.entity = " . $conf->entity; $sql .= " WHERE asy.rowid = " . $pcgver; -$sql .= " AND aa.entity = " . $conf->entity; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); From a20ec7ba1eea98d87297cbe0b6b4699fb3eb584e Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 2 May 2018 14:37:35 +0200 Subject: [PATCH 04/38] NEW cancel orders on massaction --- htdocs/commande/list.php | 3 +++ htdocs/core/actions_massactions.inc.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 872d6f02bfa..ee2fa05656d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -208,6 +208,7 @@ if (empty($reshook)) $uploaddir = $conf->commande->dir_output; $trigger_name='ORDER_SENTBYMAIL'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + } @@ -419,6 +420,8 @@ if ($resql) $arrayofmassactions = array( 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), + 'cancelorders'=>$langs->trans("Cancel"), + ); if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->commande->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 4894212fa07..6303d78d6ef 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -736,6 +736,20 @@ if ($massaction == 'confirm_createbills') } } +if ($massaction == 'cancelorders') +{ + $orders = GETPOST('toselect', 'array'); + foreach ($orders as $id_order) + { + + $cmd = new Commande($db); + if ($cmd->fetch($id_order) <= 0) + continue; + $cmd->cancel(); + } +} + + if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_search')) { if (empty($diroutputmassaction)) From 21b387a4c45d9ff57f943aafed328ab562b40626 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 2 May 2018 15:01:32 +0200 Subject: [PATCH 05/38] NEW thirdparty categ filter on lists --- htdocs/comm/propal/list.php | 20 ++++++++++++++++++++ htdocs/commande/list.php | 17 +++++++++++++++++ htdocs/compta/facture/list.php | 19 +++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 84710999183..d5d155ce0bf 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -76,6 +76,7 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_day=GETPOST("search_day","int"); $search_month=GETPOST("search_month","int"); $search_year=GETPOST("search_year","int"); +$search_categ_cus=trim(GETPOST("search_categ_cus",'int')); $viewstatut=GETPOST('viewstatut','alpha'); $optioncss = GETPOST('optioncss','alpha'); @@ -205,6 +206,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $object_statut=''; $toselect=''; $search_array_options=array(); + $search_categ_cus=0; + } if ($object_statut != '') $viewstatut=$object_statut; @@ -248,6 +251,8 @@ $sql.= ' p.datec as date_creation, p.tms as date_update,'; $sql.= " pr.rowid as project_id, pr.ref as project_ref,"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; +if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -258,6 +263,8 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; +if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ + $sql.= ', '.MAIN_DB_PREFIX.'propal as p'; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."propal_extrafields as ef on (p.rowid = ef.fk_object)"; if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal'; @@ -294,6 +301,9 @@ if ($search_montant_ttc != '') $sql.= natural_search("p.total", $search_montant_ if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } +if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); +if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL"; + if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$db->escape($search_product_category); if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; if ($viewstatut != '' && $viewstatut != '-1') @@ -386,6 +396,8 @@ if ($resql) if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($socid > 0) $param.='&socid='.urlencode($socid); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus); + // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -464,6 +476,14 @@ if ($resql) $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.=''; } + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('CustomersProspectsCategoriesShort').': '; + $moreforfilter.=$formother->select_categories('customer',$search_categ_cus,'search_categ_cus',1); + $moreforfilter.='
'; + } $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 872d6f02bfa..b5e6e0de523 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -73,6 +73,7 @@ $socid=GETPOST('socid','int'); $search_user=GETPOST('search_user','int'); $search_sale=GETPOST('search_sale','int'); $search_total_ht=GETPOST('search_total_ht','alpha'); +$search_categ_cus=trim(GETPOST("search_categ_cus",'int')); $optioncss = GETPOST('optioncss','alpha'); $billed = GETPOST('billed','int'); $viewstatut=GETPOST('viewstatut'); @@ -193,6 +194,7 @@ if (empty($reshook)) $billed=''; $toselect=''; $search_array_options=array(); + $search_categ_cus=0; } if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) @@ -237,6 +239,8 @@ $sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_clie $sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; $sql.= ' c.date_creation as date_creation, c.tms as date_update,'; $sql.= " p.rowid as project_id, p.ref as project_ref"; +if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -247,6 +251,7 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; +if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ $sql.= ', '.MAIN_DB_PREFIX.'commande as c'; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)"; if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande'; @@ -327,6 +332,8 @@ if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$sear if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; if ($search_total_ht != '') $sql.= natural_search('c.total_ht', $search_total_ht, 1); if ($search_project_ref != '') $sql.= natural_search("p.ref",$search_project_ref); +if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); +if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL"; // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -412,6 +419,8 @@ if ($resql) if ($show_files) $param.='&show_files=' .urlencode($show_files); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($billed != '') $param.='&billed='.urlencode($billed); + if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus); + // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -538,6 +547,14 @@ if ($resql) $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.=''; } + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('CustomersProspectsCategoriesShort').': '; + $moreforfilter.=$formother->select_categories('customer',$search_categ_cus,'search_categ_cus',1); + $moreforfilter.='
'; + } $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 61383941c10..29a98c0541b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -96,6 +96,7 @@ $search_year = GETPOST('search_year','int'); $search_day_lim = GETPOST('search_day_lim','int'); $search_month_lim = GETPOST('search_month_lim','int'); $search_year_lim = GETPOST('search_year_lim','int'); +$search_categ_cus=trim(GETPOST("search_categ_cus",'int')); $option = GETPOST('search_option'); if ($option == 'late') { @@ -228,6 +229,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','a $search_month_lim=''; $toselect=''; $search_array_options=array(); + $search_categ_cus=0; + } if (empty($reshook)) @@ -369,6 +372,8 @@ $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label"; // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; +if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -379,6 +384,8 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; +if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ + $sql.= ', '.MAIN_DB_PREFIX.'facture as f'; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_extrafields as ef on (f.rowid = ef.fk_object)"; if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; @@ -435,6 +442,8 @@ if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_va if ($search_montant_localtax1 != '') $sql.= natural_search('f.localtax1', $search_montant_localtax1, 1); if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $search_montant_localtax2, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); +if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); +if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL"; if ($search_status != '' && $search_status >= 0) { if ($search_status == '0') $sql.=" AND f.fk_statut = 0"; // draft @@ -566,6 +575,8 @@ if ($resql) if ($show_files) $param.='&show_files='.urlencode($show_files); if ($option) $param.="&search_option=".urlencode($option); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus); + // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -657,6 +668,14 @@ if ($resql) $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.=''; } + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('CustomersProspectsCategoriesShort').': '; + $moreforfilter.=$formother->select_categories('customer',$search_categ_cus,'search_categ_cus',1); + $moreforfilter.='
'; + } $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; From 942e2f40bf6afe5e16d6dfd9543ad50aa963a626 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 2 May 2018 17:07:27 +0200 Subject: [PATCH 06/38] addline manage rank on its own if not provided --- htdocs/fourn/class/fournisseur.facture.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c1337452d8a..34609a8fa33 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1383,6 +1383,11 @@ class FactureFournisseur extends CommonInvoice if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; + if ($rang < 0) { + $rangmax = $this->line_max(); + $rang = $rangmax + 1; + } + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); // Clean vat code From 3657857d2160ba759f0f2429aa5e119d122b3026 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 19:29:18 +0200 Subject: [PATCH 07/38] fix project and task visibility same as list --- htdocs/projet/activity/perday.php | 3 ++- htdocs/projet/activity/perweek.php | 3 ++- htdocs/projet/class/project.class.php | 19 ++++++++------ htdocs/projet/class/task.class.php | 38 ++++++++++++++------------- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 36b55ea79ff..b4329ac9237 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -49,7 +49,8 @@ $projectid=isset($_GET["id"])?$_GET["id"]:$_POST["projectid"]; // Security check $socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; +// For external user, no check is done on company because readability is managed by public status of project and assignement. +//if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); $now=dol_now(); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 438d71cbdba..591f8b3ab6f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -50,7 +50,8 @@ $projectid=isset($_GET["id"])?$_GET["id"]:$_POST["projectid"]; // Security check $socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; +// For external user, no check is done on company because readability is managed by public status of project and assignement. +// if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); $now=dol_now(); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ea304eaabe0..551bdcb9d5f 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1662,23 +1662,26 @@ class Project extends CommonObject { global $conf, $langs; - $mine=0; $socid=$user->societe_id; - - $projectsListId = $this->getProjectsAuthorizedForUser($user,$mine?$mine:($user->rights->projet->all->lire?2:0),1,$socid); + // For external user, no check is done on company because readability is managed by public status of project and assignement. + //$socid=$user->societe_id; + if (! $user->rights->projet->all->lire) $projectsListId = $this->getProjectsAuthorizedForUser($user,0,1,$socid); + $sql = "SELECT p.rowid, p.fk_statut as status, p.fk_opp_status, p.datee as datee"; $sql.= " FROM (".MAIN_DB_PREFIX."projet as p"; $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; + // For external user, no check is done on company permission because readability is managed by public status of project and assignement. + //if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; $sql.= " WHERE p.fk_statut = 1"; $sql.= " AND p.entity IN (".getEntity('project', 0).')'; - if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - + // For external user, no check is done on company permission because readability is managed by public status of project and assignement. + //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; + + //print $sql; $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1c8b1466483..6beafe71a25 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1701,29 +1701,31 @@ class Task extends CommonObject { global $conf, $langs; - $mine=0; $socid=$user->societe_id; - + // For external user, no check is done on company because readability is managed by public status of project and assignement. + //$socid=$user->societe_id; + $projectstatic = new Project($this->db); - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid); - + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid); + // List of tasks (does not care about permissions. Filtering will be done later) $sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,"; $sql.= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,"; $sql.= " t.dateo as date_start, t.datee as datee"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; - $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; - $sql.= " WHERE p.entity IN (".getEntity('project', 0).')'; - $sql.= " AND p.fk_statut = 1"; - $sql.= " AND t.fk_projet = p.rowid"; - $sql.= " AND t.progress < 100"; // tasks to do - if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; - // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser - //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - //print $sql; + $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; + //if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; + $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; + $sql.= " WHERE p.entity IN (".getEntity('project', 0).')'; + $sql.= " AND p.fk_statut = 1"; + $sql.= " AND t.fk_projet = p.rowid"; + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; + // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser + //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser + // if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; + + //print $sql; $resql=$this->db->query($sql); if ($resql) { From 46e94af5949c233dc165b20af77048d0f9852482 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 19:46:04 +0200 Subject: [PATCH 08/38] fix taskid --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 3d239921c60..c3f1da54a16 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -756,7 +756,7 @@ while ($i < min($num,$limit)) $showlineingray=0;$showproject=1; print ''; if ($showlineingray) print ''; - else print ''; + else print ''; if ($obj->duration_effective) print convertSecondToTime($obj->duration_effective,$timespentoutputformat); else print '--:--'; if ($showlineingray) print ''; From db76fd7895233bb13e1996fd8b800cf1048d9dd5 Mon Sep 17 00:00:00 2001 From: fappels Date: Wed, 2 May 2018 22:33:23 +0200 Subject: [PATCH 09/38] Fix delete all product variants of a parent product User object missing --- htdocs/product/class/product.class.php | 2 +- htdocs/variants/class/ProductCombination.class.php | 9 +++++---- htdocs/variants/generator.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e36d5970e8f..e989b0eb206 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1116,7 +1116,7 @@ class Product extends CommonObject //If it is a parent product, then we remove the association with child products $prodcomb = new ProductCombination($this->db); - if ($prodcomb->deleteByFkProductParent($id) < 0) { + if ($prodcomb->deleteByFkProductParent($user, $id) < 0) { $error++; $this->errors[] = 'Error deleting combinations'; } diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 4f647aa2cb3..92bba2f70f8 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -275,10 +275,11 @@ class ProductCombination /** * Deletes all product combinations of a parent product * - * @param int $fk_product_parent Rowid of parent product + * @param User $user Object user + * @param int $fk_product_parent Rowid of parent product * @return int <0 KO >0 OK */ - public function deleteByFkProductParent($fk_product_parent) + public function deleteByFkProductParent($user, $fk_product_parent) { $this->db->begin(); @@ -289,11 +290,11 @@ class ProductCombination $res = $prodstatic->fetch($prodcomb->fk_product_child); if ($res > 0) { - $res = $prodcomb->delete(); + $res = $prodcomb->delete($user); } if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) { - $res = $prodstatic->delete(); + $res = $prodstatic->delete($user); } if ($res < 0) { diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index d4162899874..4daa2d8f45a 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -95,7 +95,7 @@ if ($_POST) { $delete_prev_comb_res = 1; if (!$donotremove) { - $delete_prev_comb_res = $combination->deleteByFkProductParent($id); + $delete_prev_comb_res = $combination->deleteByFkProductParent($user, $id); } //Current combinations will be deleted From bc7b05537f6f41f1707a0c00f027ec768d4aaf9b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Thu, 3 May 2018 09:26:48 +0200 Subject: [PATCH 10/38] NEW: hidden conf to assign category to thirparty neither customer nor prospect nor supplier --- htdocs/societe/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 204eff383d5..afec096a500 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1321,7 +1321,7 @@ else $langs->load('categories'); // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, @@ -1879,7 +1879,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); @@ -2269,7 +2269,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - if ($object->prospect || $object->client) { + if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { print '' . $langs->trans("CustomersCategoriesShort") . ''; print ''; print $form->showCategories($object->id, 'customer', 1); From f70df3490feb344fe59dfbb6afafac0e2c06299e Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 3 May 2018 10:53:24 +0200 Subject: [PATCH 11/38] FIX add db commit --- htdocs/core/actions_massactions.inc.php | 40 +++++++++++++++++++++++-- htdocs/langs/fr_FR/errors.lang | 1 + 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6303d78d6ef..c2c3467e55c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -736,8 +736,14 @@ if ($massaction == 'confirm_createbills') } } -if ($massaction == 'cancelorders') +if (!$error && $massaction == 'cancelorders') { + + $db->begin(); + + $nbok = 0; + + $orders = GETPOST('toselect', 'array'); foreach ($orders as $id_order) { @@ -745,7 +751,37 @@ if ($massaction == 'cancelorders') $cmd = new Commande($db); if ($cmd->fetch($id_order) <= 0) continue; - $cmd->cancel(); + + if ($cmd->statut != Commande::STATUS_VALIDATED) + { + $langs->load('errors'); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidToBeCanceled", $cmd->ref), null, 'errors'); + $error++; + break; + } + else + $result = $cmd->cancel(); + + if ($result < 0) + { + setEventMessages($cmd->error, $cmd->errors, 'errors'); + $error++; + break; + } + else + $nbok++; + } + if (!$error) + { + if ($nbok > 1) + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); } } diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index c6fe1334436..c3c3f55deb4 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -208,6 +208,7 @@ ErrorFileNotFoundWithSharedLink=Fichier non trouvé. Peut que la clé de partage ErrorProductBarCodeAlreadyExists=Le code-barre du produit %s existe déjà sur une autre référence de produit ErrorNoteAlsoThatSubProductCantBeFollowedByLot=Notez également que l'utilisation d'un produit virtuel pour augmenter ou réduire automatiquement les sous-produits n'est pas possible lorsqu'au moins un sous-produit (ou sous-produit de sous-produits) a besoin d'un numéro de série/lot. ErrorDescRequiredForFreeProductLines=La description est obligatoire pour les lignes avec un produit non prédéfini +ErrorObjectMustHaveStatusValidToBeCanceled=L'objet %s doit être au statut 'Validé' pour être annulé # Warnings WarningPasswordSetWithNoAccount=Un mot de passe a été fixé pour cet adhérent. Cependant, aucun compte d'utilisateur n'a été créé. Donc, ce mot de passe est stocké, mais ne peut être utilisé pour accéder à Dolibarr. Il peut être utilisé par un module/interface externe, mais si vous n'avez pas besoin de définir ni login ni mot de passe pour un adhérent, vous pouvez désactiver l'option «Gérer un login pour chaque adhérent" depuis la configuration du module Adhérents. Si vous avez besoin de gérer un login, mais pas de mot de passe, vous pouvez laisser ce champ vide pour éviter cet avertissement. Remarque: L'email peut également être utilisé comme login si l'adhérent est lié à un utilisateur. From 6245f25deb85cc0ef6cdb92e89ff64fb72e54d79 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 3 May 2018 11:45:41 +0200 Subject: [PATCH 12/38] FIX label in getnomurl projectlist --- htdocs/projet/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6eaf231a5cb..dc3ab9a58ac 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -668,6 +668,7 @@ while ($i < min($num,$limit)) $object->datee = $db->jdate($obj->date_end); $object->statut = $obj->fk_statut; $object->opp_status = $obj->fk_opp_status; + $object->title = $obj->title; $userAccess = $object->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) From 08cf034e2f35db1ce6cc5e40e6e25606f6948426 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 May 2018 13:39:44 +0200 Subject: [PATCH 13/38] FIX to allow IRPF not null even if main VAT is null. From https://www.javierrguez.com/problema-facturas-irpf-sin-iva-dolibarr/ --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a22a9675ff6..78010725086 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4261,7 +4261,8 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller if ($local == 2) { - if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + if (! $mysoc->localtax2_assuj) return 0; // If main vat is 0, IRPF may be different than 0. if ($thirdparty_seller->id == $mysoc->id) { if (! $thirdparty_buyer->localtax2_assuj) return 0; From f3a70a40d7b12cd921edddcf45f03c09c71fbd00 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 3 May 2018 21:27:52 +0200 Subject: [PATCH 14/38] clean and update code --- htdocs/admin/expedition.php | 8 +++---- htdocs/admin/livraison.php | 14 ++++------- htdocs/admin/mailing.php | 9 ++----- htdocs/admin/mailman.php | 10 +++----- htdocs/admin/mails.php | 40 ++++---------------------------- htdocs/admin/mails_emailing.php | 12 ---------- htdocs/admin/mails_templates.php | 6 +---- 7 files changed, 17 insertions(+), 82 deletions(-) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 442a85c9c6a..311398a78e1 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -$langs->load("admin"); -$langs->load("sendings"); -$langs->load("deliveries"); -$langs->load('other'); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4c18069b415..0af26a0a2b7 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,8 +6,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand - * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2015 Claudio Aschieri * * 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 @@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; -$langs->load("admin"); -$langs->load("sendings"); -$langs->load("deliveries"); -$langs->load('other'); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (!$user->admin) accessforbidden(); @@ -216,7 +214,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; while (($file = readdir($handle))!==false) { if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file)-3, 3) == 'php') @@ -337,7 +334,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/livraison/doc/"); @@ -452,7 +448,6 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print ' '; print "\n"; -$var=true; $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); @@ -460,7 +455,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print '
'; print ''; print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 7abb16a0729..3aa3b3364c0 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -27,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; -$langs->load("admin"); -$langs->load("mails"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "mails")); if (!$user->admin) accessforbidden(); @@ -105,29 +105,24 @@ print ''; print ''; print ''; -$var=true; - print ''; print ''; print ''; print ''; print "\n"; - print ''; - print ''; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("MailingEMailFrom").''; print ''; if (!empty($conf->global->MAILING_EMAIL_FROM) && ! isValidEmail($conf->global->MAILING_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; print $langs->trans("MailingEMailError").''; print ''; if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; print $langs->trans("MailingDelay").''; print ''; diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 89416a72e36..bb53349d1b7 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -32,9 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -$langs->load("admin"); -$langs->load("members"); -$langs->load("mailmanspip"); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "members", "mailmanspip")); if (! $user->admin) accessforbidden(); @@ -49,7 +48,7 @@ $testunsubscribeemail = GETPOST("testunsubscribeemail"); * Actions */ -// Action mise a jour ou ajout d'une constante +// Action updated or added a constant if ($action == 'update' || $action == 'add') { foreach($_POST['constname'] as $key => $val) @@ -156,9 +155,6 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup' $head = mailmanspip_admin_prepare_head(); - -$var=true; - if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index f85853f5b97..f4c5a2531ff 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -27,12 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -$langs->load("companies"); -$langs->load("products"); -$langs->load("admin"); -$langs->load("mails"); -$langs->load("other"); -$langs->load("errors"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies", "products", "admin", "mails", "other", "errors")); $action=GETPOST('action','alpha'); @@ -260,13 +256,11 @@ if ($action == 'edit') clearstatcache(); - $var=true; print ''; print ''; // Disable - print ''; @@ -283,11 +277,9 @@ if ($action == 'edit') print ''; // Separator - print ''; // Method - print ''; // Port - print ''; // From - print ''; print ''; @@ -497,22 +486,19 @@ if ($action == 'edit') } else dol_print_error($db);*/ - print ''; // Separator - print ''; // From - print ''; print ''; // Autocopy to - print ''; print ''; @@ -535,15 +521,11 @@ else print $langs->trans("EMailsDesc")."
\n"; print "
\n"; - - - $var=true; - + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); print '
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only @@ -338,7 +330,6 @@ if ($action == 'edit') print '
'; if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { @@ -411,7 +402,6 @@ if ($action == 'edit') } // TLS - print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { @@ -469,7 +459,6 @@ if ($action == 'edit') print '
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; + print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0); print '
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'; print ''; // Disable - print ''; // Force e-mail recipient @@ -555,11 +537,9 @@ else print ''; // Separator - print ''; // Method - print ''; // Host server - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { print ''; @@ -578,7 +557,6 @@ else } // Port - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { print ''; @@ -589,21 +567,18 @@ else } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { print ''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { print ''; } // TLS - print ''; // STARTTLS - print ''; // From - print ''; print ''; // Separator - print ''; // Errors To - print ''; print ''; // Autocopy to - print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").img_warning(); @@ -567,7 +547,6 @@ else print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { @@ -617,7 +592,6 @@ else print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { @@ -634,7 +608,6 @@ else if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') { // DKIM - print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) { @@ -664,11 +637,9 @@ else } // Separator - print '
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); @@ -723,18 +694,15 @@ else print '
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").''.$conf->global->MAIN_MAIL_ERRORS_TO; if (! empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 1202e9817d3..1cb92ae8377 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -228,7 +228,6 @@ if ($action == 'edit') clearstatcache(); - $var=true; print ''; print ''; @@ -341,7 +340,6 @@ if ($action == 'edit') // PW if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { - $mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING)?$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING:''); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -405,14 +403,10 @@ else print $langs->trans("EMailsDesc")."
\n"; print "
\n"; - - $var=true; - print ''; print ''; // Method - print ''; @@ -433,7 +426,6 @@ else } // Port - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { print ''; @@ -444,21 +436,18 @@ else } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { print ''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { print ''; } // TLS - print ''; // STARTTLS - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAIL_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; if (empty($text)) $text=$langs->trans("Undefined").img_warning(); @@ -422,7 +416,6 @@ else if (! empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { // Host server - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { @@ -472,7 +461,6 @@ else print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 4e731021199..60db9fae8c4 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2017 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel @@ -447,7 +447,6 @@ $fieldlist=explode(',',$tabfield[$id]); // Form to add a new line $alabelisused=0; -$var=false; print ''; print ''; @@ -591,9 +590,7 @@ $colspan=count($fieldlist)+1; print '
'; print ''; - print ''; - print '
'; @@ -611,7 +608,6 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; $paramwithsearch = $param; From b5f222f45aca791b65de2264c314fad190318dae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 4 May 2018 14:14:04 +0200 Subject: [PATCH 15/38] Clean and update code --- htdocs/admin/menus.php | 7 ------- htdocs/admin/payment.php | 9 ++------- htdocs/admin/prelevement.php | 1 - htdocs/admin/propal.php | 13 ++++--------- htdocs/admin/proxy.php | 15 ++++++--------- 5 files changed, 12 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 7ffaa9a110a..a5f2fb2a2ff 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -163,8 +163,6 @@ if ($action == 'edit') clearstatcache(); // Gestionnaires de menu - $var=true; - print ''; print ''; print ''; // Menu top - print ''; print ''; // Menu smartphone - print ''; print '
'.$langs->trans("Menu").''; @@ -176,7 +174,6 @@ if ($action == 'edit') print '
'.$langs->trans("DefaultMenuManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled'); @@ -187,7 +184,6 @@ if ($action == 'edit') print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); @@ -202,8 +198,6 @@ if ($action == 'edit') else { // Gestionnaires de menu - $var=true; - print ''; print ''; print ''; print "\n"; // Allow payments on different thirdparties bills but same parent company -$var=! $var; print '\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index c533ea94795..7ee44a93b52 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -33,10 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load('other'); -$langs->load('propal'); + +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "other", "errors", "propal")); if (! $user->admin) accessforbidden(); @@ -266,8 +265,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; - while (($file = readdir($handle))!==false) { if (substr($file, 0, 12) == 'mod_propale_' && substr($file, dol_strlen($file)-3, 3) == 'php') @@ -386,7 +383,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -531,7 +527,6 @@ print ''; print ''; /* -$var=! $var; print ''; print ''; print ''; @@ -631,7 +626,7 @@ print "\n"; print " \n"; print " \n"; print "\n"; -print "\n \n \n\n"; +print "\n \n \n\n"; print "
'.$langs->trans("Menu").''; @@ -267,7 +261,6 @@ if ($action == 'edit') print ''; - if ($action != 'edit') { print '
'; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 339b4fef566..4fe15379629 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -26,10 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load('other'); -$langs->load('bills'); +// Load traductions files requiredby by page +$langs->loadLangs(array("admin", "other", "errors", "bills")); if (! $user->admin) accessforbidden(); @@ -131,8 +129,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; - while (($file = readdir($handle))!==false) { if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) @@ -249,7 +245,6 @@ print '
 
'; print $langs->trans("PaymentOnDifferentThirdBills"); print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 21f34f2a770..203b4ed9bc5 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -274,7 +274,6 @@ print "
".$langs->trans("Name")."".$langs->trans("Value")."
".$langs->trans("PathDirectory")."".$conf->propal->multidir_output[$conf->entity]."
".$langs->trans("PathDirectory")."".$conf->propal->multidir_output[$conf->entity]."
\n
"; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index ee22f377200..a9028635991 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -26,10 +26,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -$langs->load("users"); -$langs->load("admin"); -$langs->load("other"); - +// Load traductions files requiredby by page +$langs->loadLangs(array("other", "users", "admin")); if (!$user->admin) accessforbidden(); @@ -124,7 +122,6 @@ if ($conf->use_javascript_ajax) // Timeout -$var=true; print ''; @@ -163,7 +160,7 @@ print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_HOST").''; print ''; @@ -172,7 +169,7 @@ print '
'.$langs->trans("MAIN_PROXY_PORT").''; print ''; @@ -181,7 +178,7 @@ print '
'.$langs->trans("MAIN_PROXY_USER").''; print ''; @@ -190,7 +187,7 @@ print '
'.$langs->trans("MAIN_PROXY_PASS").''; print ''; From 8e2844b29547a0dd232177c2e299446ff5dac2e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2018 17:55:29 +0200 Subject: [PATCH 16/38] css --- htdocs/projet/ganttview.php | 2 +- htdocs/projet/tasks.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 248eb1a63b3..2f43701c73d 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -209,7 +209,7 @@ else $linktocreatetask = ''.$langs->trans('AddTask').''; } -$linktolist=''.$langs->trans("GoToListOfTasks").' '; +$linktolist=''.$langs->trans("GoToListOfTasks").''; //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); print load_fiche_titre($title, $linktolist.'   '.$linktocreatetask, 'title_generic.png'); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 22fe740a63b..69c62416e9b 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -488,7 +488,7 @@ else if ($id > 0 || ! empty($ref)) print ''; $title=$langs->trans("ListOfTasks"); - $linktotasks=''.$langs->trans("GoToGanttView").' '; + $linktotasks=''.$langs->trans("GoToGanttView").''; //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); print load_fiche_titre($title, $linktotasks.'   '.$linktocreatetask, 'title_generic.png'); From 06bad22b31136e8c938aee6ac37bfda8b37f8f31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2018 18:12:18 +0200 Subject: [PATCH 17/38] FIX function not found --- htdocs/product/class/product.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f36fd59035..f2c59f95925 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3514,6 +3514,7 @@ class Product extends CommonObject } if (! empty($conf->accounting->enabled) && $this->status_buy) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $label.= '
' . $langs->trans('ProductAccountancyBuyCode') . ': '. length_accountg($this->accountancy_code_buy); } if (! empty($this->entity)) From 634e58b7c97a3d48ac8559eb801fa95b1b81ce60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2018 18:12:18 +0200 Subject: [PATCH 18/38] Look and feel v8 --- htdocs/admin/agenda_reminder.php | 6 +----- htdocs/product/class/product.class.php | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index fac49dcfcde..76b69073f25 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -29,9 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("agenda"); +$langs->loadLangs(array("admin","other","agenda")); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); @@ -173,8 +171,6 @@ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); -print "
\n"; - diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f36fd59035..f2c59f95925 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3514,6 +3514,7 @@ class Product extends CommonObject } if (! empty($conf->accounting->enabled) && $this->status_buy) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $label.= '
' . $langs->trans('ProductAccountancyBuyCode') . ': '. length_accountg($this->accountancy_code_buy); } if (! empty($this->entity)) From e34bd1a2228443faa0f45884669b37e87b237c73 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 4 May 2018 18:08:04 +0100 Subject: [PATCH 19/38] Update llx_entrepot add model_pdf --- htdocs/install/mysql/tables/llx_entrepot.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index cfb17c55766..4c6f0480d5a 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -34,6 +34,7 @@ create table llx_entrepot fk_pays integer DEFAULT 0, statut tinyint DEFAULT 1, -- 1 open, 0 close fk_user_author integer, - import_key varchar(14), + model_pdf varchar(255), + import_key varchar(14), fk_parent integer DEFAULT 0 )ENGINE=innodb; From 468f970d32a41150ffd03117f1dc89b6650fe3b7 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 4 May 2018 18:10:55 +0100 Subject: [PATCH 20/38] Update llx_stock_mouvement Add model_pdf --- htdocs/install/mysql/tables/llx_stock_mouvement.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_stock_mouvement.sql b/htdocs/install/mysql/tables/llx_stock_mouvement.sql index 3ac42c0c852..1e78e7a9820 100644 --- a/htdocs/install/mysql/tables/llx_stock_mouvement.sql +++ b/htdocs/install/mysql/tables/llx_stock_mouvement.sql @@ -34,5 +34,6 @@ create table llx_stock_mouvement label varchar(255), -- Comment on movement inventorycode varchar(128), -- Code used to group different movement line into one operation (may be an inventory, a mass picking) fk_origin integer, - origintype varchar(32) + origintype varchar(32), + model_pdf varchar(255) )ENGINE=innodb; From f6ca1eb6248e022288a32d25a1c0fa9c53cda556 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 13:24:46 +0200 Subject: [PATCH 21/38] Fix permission name --- htdocs/core/menus/standard/eldy.lib.php | 24 ++++++++++++------------ htdocs/core/modules/modStock.class.php | 10 +++++----- htdocs/product/inventory/card.php | 6 +++--- htdocs/product/inventory/list.php | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e930a0ab8b9..171c2a52f8d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1257,18 +1257,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->stock->enabled)) { $langs->load("stocks"); - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) - { - $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); - $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); - } - else - { - $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->advance_inventory->read, '', $mainmenu, 'stock'); - $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->advance_inventory->write); - $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->advance_inventory->read); - } + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) + { + $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); + $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); + $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); + } + else + { + $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); + $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); + $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); + } } } diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index c23a02eeac1..daeb948fe4a 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -122,31 +122,31 @@ class modStock extends DolibarrModules $this->rights[5][0] = 1011; $this->rights[5][1] = 'inventoryReadPermission'; // Permission label $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[6][0] = 1012; $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[6][5] = 'create'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[7][0] = 1013; $this->rights[7][1] = 'inventoryWritePermission'; // Permission label $this->rights[7][3] = 0; // Permission by default for new user (0/1) - $this->rights[7][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[7][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[7][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[8][0] = 1014; $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label $this->rights[8][3] = 0; // Permission by default for new user (0/1) - $this->rights[8][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[9][0] = 1015; $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label $this->rights[9][3] = 0; // Permission by default for new user (0/1) - $this->rights[9][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 30bb3312576..aaba9e8cdfe 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -42,7 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $result = restrictedArea($user, 'stock', $id, '', 'advance_inventory'); + $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } // Initialize technical objects @@ -82,8 +82,8 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $permissiontoadd = $user->rights->stock->advance_inventory->create; - $permissiontodelete = $user->rights->stock->advance_inventory->write; + $permissiontoadd = $user->rights->stock->inventory_advance->create; + $permissiontodelete = $user->rights->stock->inventory_advance->write; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index f3089099efe..79f0835e991 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -78,7 +78,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $result = restrictedArea($user, 'stock', $objectid, '', 'advance_inventory'); + $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); } // Initialize array of search criterias From a9c7f905121083354b7b04d4a300c9be87a40c4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 13:36:20 +0200 Subject: [PATCH 22/38] Missing hook after deprecated trigger --- htdocs/user/logout.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 5958c71f295..ceeaf35fddf 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -48,6 +48,13 @@ $result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf); if ($result < 0) { $error++; } // Fin appel triggers +// Hooks on logout +$action=''; +$hookmanager->initHooks(array('logout')); +$parameters=array(); +$reshook=$hookmanager->executeHooks('afterLogout',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { $error++; } + // Define url to go after disconnect $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"]; From bdf4c0704b52c306cf75972573eb8ae3a514ef83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 13:40:45 +0200 Subject: [PATCH 23/38] Removed depreaceted not used method Categorie::get_nb_categories() --- ChangeLog | 2 +- htdocs/categories/class/categorie.class.php | 24 --------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19ab1e0f49b..b800098144b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,7 @@ Following changes may create regressions for some external modules, but were nec * Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better. * The hook contaxt commcard has been renamed thirdpartycomm * The hook contaxt thirdpartycard has been renamed thirdpartycontact - +* Remove method Categorie:get_nb_categories() that was not used. ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 5fa8d267830..0f28a8d1cde 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1207,30 +1207,6 @@ class Categorie extends CommonObject } } - /** - * Returns total number of categories - * - * @return int Number of categories - * @deprecated function not used ? - */ - function get_nb_categories() - { - $sql = "SELECT count(rowid)"; - $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; - $sql.= " WHERE entity IN (".getEntity('category').")"; - $res = $this->db->query($sql); - if ($res) - { - $res = $this->db->fetch_array($res); - return $res[0]; - } - else - { - dol_print_error($this->db); - return -1; - } - } - /** * Check if no category with same label already exists for this cat's parent or root and for this cat's type * From 363eaf0d72196120bb9af4ff96f97cccbb71a6c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 13:44:49 +0200 Subject: [PATCH 24/38] FIX Parameters to triggers must be set into $this->context array. --- htdocs/categories/class/categorie.class.php | 6 ++---- ...interface_50_modMailmanspip_Mailmanspipsynchro.class.php | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 0f28a8d1cde..044f3e68c0f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -761,11 +761,9 @@ class Categorie extends CommonObject dol_syslog(get_class($this).'::del_type', LOG_DEBUG); if ($this->db->query($sql)) { - // Save object we want to unlink category off into category instance to provide information to trigger - $this->unlinkoff=$obj; - // Call trigger - $result=$this->call_trigger('CATEGORY_UNLINK',$user); + $this->context=array('unlinkoff'=>$obj); // Save object we want to link category to into category instance to provide information to trigger + $result=$this->call_trigger('CATEGORY_UNLINK',$user); if ($result < 0) { $error++; } // End call triggers diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 44a6645a6d7..c5f704fdcb1 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -75,10 +75,10 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // We remove subscription if we change category (lessw category may means less mailing-list to subscribe) - if (is_object($object->unlinkoff) && method_exists($object->unlinkoff, 'del_to_abo') && $object->unlinkoff->del_to_abo() < 0) + if (is_object($object->context['unlinkoff']) && method_exists($object->context['unlinkoff'], 'del_to_abo') && $object->context['unlinkoff']->del_to_abo() < 0) { - $this->error=$object->unlinkoff->error; - $this->errors=$object->unlinkoff->errors; + $this->error=$object->context['unlinkoff']->error; + $this->errors=$object->context['unlinkoff']->errors; $return=-1; } else From 17b8de2cdd420a33629c2ee8848e5397a8bcce6d Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Sat, 5 May 2018 12:52:38 +0100 Subject: [PATCH 25/38] New : Option INVOICE_CAN_REMOVE_DRAFT_ONLY to delete draft invoices with precedence over INVOICE_CAN_ALWAYS_BE_REMOVED --- htdocs/compta/facture/list.php | 34 ++++++++++++------------- htdocs/core/actions_massactions.inc.php | 28 +++++++------------- htdocs/core/tpl/massactions_pre.tpl.php | 5 ++++ htdocs/langs/en_US/main.lang | 4 ++- htdocs/langs/fr_FR/main.lang | 2 ++ 5 files changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 29a98c0541b..c90ab660c31 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -585,24 +585,22 @@ if ($resql) 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); - if ($conf->prelevement->enabled) - { - $langs->load("withdrawals"); - $arrayofmassactions['withdrawrequest']=$langs->trans("MakeWithdrawRequest"); - } - if ($user->rights->facture->supprimer) - { - //if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) - if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) - { - // mass deletion never possible on invoices on such situation - } - else - { - $arrayofmassactions['predelete']=$langs->trans("Delete"); - } - } - if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); + if ($conf->prelevement->enabled) { + $langs->load("withdrawals"); + $arrayofmassactions['withdrawrequest'] = $langs->trans("MakeWithdrawRequest"); + } + if ($user->rights->facture->supprimer) { + //if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) + if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) { + $arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft"); + + } + elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { + // mass deletion never possible on invoices on such situation + $arrayofmassactions['predelete'] = $langs->trans("Delete"); + } + } + if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index c2c3467e55c..1952bb0c224 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1079,26 +1079,16 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == $result=$objecttmp->fetch($toselectid); if ($result > 0) { - // Refuse deletion for some status ? - /* - if ($objectclass == 'Facture' && $objecttmp->status == Facture::STATUS_DRAFT) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; - continue; - }*/ + if ($objectclass != 'Facture' || empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) || (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) && $objecttmp->statut == Facture::STATUS_DRAFT) ) { + if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); + else $result = $objecttmp->delete($user); - if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); - - if ($result <= 0) - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - else $nbok++; + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else $nbok++; + } } else { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 48989b2daec..d46e27e28af 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -27,6 +27,11 @@ // $trackid='ord'.$object->id; +if ($massaction == 'predeletedraft') +{ + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDraftDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); +} + if ($massaction == 'predelete') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 418042f1da9..60369b80ea5 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -941,4 +941,6 @@ Local=Local Remote=Remote LocalAndRemote=Local and Remote KeyboardShortcut=Keyboard shortcut -AssignedTo=Assigned to \ No newline at end of file +AssignedTo=Assigned to +Deletedraft=Delete draft +ConfirmMassDraftDeletion=Draft Bulk delete confirmation diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index e8681e72e62..6fba224525e 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -941,3 +941,5 @@ Remote=Distant LocalAndRemote=Local et distant KeyboardShortcut=Raccourci clavier AssignedTo=Assigné à +Deletedraft=Supprimer brouillon +ConfirmMassDraftDeletion=Confirmation de suppression brouillons en masse From aba2ef7ad290b239dc87324625c611874bebc0c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 14:22:18 +0200 Subject: [PATCH 26/38] Update actions_massactions.inc.php --- htdocs/core/actions_massactions.inc.php | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 1952bb0c224..e1d862b6098 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1079,16 +1079,24 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == $result=$objecttmp->fetch($toselectid); if ($result > 0) { - if ($objectclass != 'Facture' || empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) || (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY) && $objecttmp->statut == Facture::STATUS_DRAFT) ) { - if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); + // Refuse deletion for some objects/status + if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT)) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; + continue; + } + + if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); + else $result = $objecttmp->delete($user); + + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else $nbok++; - if ($result <= 0) { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } else $nbok++; - } } else { From 8baa529719d2352ed98ffadd896b311a665e0a5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 14:22:52 +0200 Subject: [PATCH 27/38] Update actions_massactions.inc.php --- htdocs/core/actions_massactions.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e1d862b6098..4d2b6145990 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1091,12 +1091,13 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); else $result = $objecttmp->delete($user); - if ($result <= 0) { + if ($result <= 0) + { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; - } else $nbok++; - + } + else $nbok++; } else { From 97f161b2763767ae376760f2e4922a8e65c85150 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 14:25:44 +0200 Subject: [PATCH 28/38] Update list.php --- htdocs/compta/facture/list.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index c90ab660c31..b6bde6605ad 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -585,22 +585,19 @@ if ($resql) 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); - if ($conf->prelevement->enabled) { - $langs->load("withdrawals"); - $arrayofmassactions['withdrawrequest'] = $langs->trans("MakeWithdrawRequest"); - } - if ($user->rights->facture->supprimer) { - //if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) - if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) { - $arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft"); - - } - elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { - // mass deletion never possible on invoices on such situation - $arrayofmassactions['predelete'] = $langs->trans("Delete"); - } - } - if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); + if ($conf->prelevement->enabled) { + $langs->load("withdrawals"); + $arrayofmassactions['withdrawrequest'] = $langs->trans("MakeWithdrawRequest"); + } + if ($user->rights->facture->supprimer) { + if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) { + $arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft"); + } + elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation + $arrayofmassactions['predelete'] = $langs->trans("Delete"); + } + } + if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; From c34bfc229b9b90088c0cb183a897f3573aee24fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 19:39:58 +0200 Subject: [PATCH 29/38] Fix syntax error --- htdocs/core/actions_massactions.inc.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 4d2b6145990..371dd75a8e2 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1080,18 +1080,18 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == if ($result > 0) { // Refuse deletion for some objects/status - if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT)) - { - $langs->load("errors"); - $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; - continue; - } - + if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT) + { + $langs->load("errors"); + $nbignored++; + $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; + continue; + } + if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); else $result = $objecttmp->delete($user); - if ($result <= 0) + if ($result <= 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; From b958311819231c32d329e96a9d90bf869d49187b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 20:25:06 +0200 Subject: [PATCH 30/38] Prepare 6.0.7 --- ChangeLog | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dcc363d03a9..405aaa9ed9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,22 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 6.0.6 compared to 6.0.6 ***** +***** ChangeLog for 6.0.7 compared to 6.0.6 ***** +FIX: #8023 +FIX: #8259 can't update contact birthday with REST API +FIX: #8478 !empty instead of count to avoid warning +FIX: #8488 +FIX: actioncomm export: type filtering not working +FIX: addline on invoice supplier manage rank on its own if not provided +FIX: issue #8037 +FIX: label in getnomurl projectlist +FIX: payment term doc-specific label was not used +FIX: payment term doc-specific label was not used (issue #8414) +FIX: project category is type 6 not 5 !! +FIX: some localtaxes errors +FIX: weird password autocompletion in Google Chrome (issue #8479) + +***** ChangeLog for 6.0.6 compared to 6.0.5 ***** FIX: #7974 Contract - Invalid reference on the document FIX: #8139 FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php From d4d4f8cc832785b416cf38952272ee32b15c383f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 20:29:06 +0200 Subject: [PATCH 31/38] Prepare 7.0.2 --- ChangeLog | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3ecdc4d0c54..0a2157316b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,96 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 7.0.2 compared to 7.0.1 ***** +FIX: #8023 +FIX: #8259 can't update contact birthday with REST API +FIX: #8359 +FIX: #8389 +FIX: #8478 !empty instead of count to avoid warning +FIX: #8488 +FIX: #8559 Bug to generate cheque receipt +FIX: #8571 +FIX: #8574 +FIX: #8580 +FIX: #8650 +FIX: actioncomm export: type filtering not working +FIX: Add a test to avoid to reset binding by error. +FIX: addline on invoice supplier manage rank on its own if not provided +FIX: Add warning when expense report line not into range +FIX: avoid Error: Call to undefined method mysqli::get_charset() +FIX: avoid focus problem when select2 is in a modal dialog window +FIX: Binding pages must start on fiscal month not calendar month +FIX: button "Classify bill" on supplier order was not visible +FIX: Button receive products not visible +FIX: can bypass the CSRF protection with url with domain inside +FIX: Can't edit option PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY +FIX: commonobject: don't require notnull field if default set +FIX: CommonObject: don't require 'notnull' field if 'default' set +FIX: cron script disabled if module disabled +FIX: CVE-2018-10092 +FIX: CVE-2018-10094 +FIX: CVE-2018-10095 +FIX: CVE-2018-9019 +FIX: CWE-89 +FIX: Data on income/expense report was always 0 +FIX: default addupdatedelete actions: uniformize add/update value checks +FIX: default currency not set on supplier order creation from commercial menu #8459 +FIX: delete all product variants of a parent product +FIX: Detail per account not visible when total < 0 +FIX: DOL_AUTOSET_COOKIE was not correctly setting value of cookie +FIX: don't print empty date in CommonObject::showOutputField +FIX: dont print empty date in CommonObject::showOutputField +FIX: Draft invoice must be excluded from report +FIX: environment shown on cron card +FIX: Error in ContractLigne not return to Contract +FIX: extrafields price and double were lost during a failed post. +FIX: File name not visible in email preview +FIX: filter/sorting on extrafield on contact list from contact tab +FIX: Initial month on report income/expense per predefined group +FIX: issue #8037 +FIX: Issue #8455 +FIX: issue #8470 +FIX: label in getnomurl projectlist +FIX: limit access of email template page to internal users +FIX: look and feel v7 "back to" for bookkeeping record +FIX: Max nb of generation of recurring invoice should not show warning +FIX: missing english name for object +FIX: Missing include +FIX: missing User object with API REST +FIX: modulebuilder: could not create html fields +FIX: modulebuilder: handle 'price' fieldtype +FIX: multiple creation of same event +FIX: Name of user not visible on journalizing expense report payments +FIX: Not approved holidays must not be visible into timesheet +FIX: Only approved expense report must be journalized +FIX: payment term doc-specific label was not used +FIX: payment term doc-specific label was not used (issue #8414) +FIX: project category is type 6 not 5 +FIX: Projet is not prefilled when created from overwiew page +FIX: Related contact printed in societe agenda +FIX: Removed error when no error on accounting setup page +FIX: remove var_dump +FIX: sanitize setup params +FIX: selectForFormsList: entity checked even is object not multi-entity managed +FIX: service creation, right is tested regarding the product type +FIX: some localtaxes errors +FIX: Some report have data when several chart of accounts exists +FIX: sql error using no category +FIX: SQL Injection CWE-89 +FIX: Support or multicompany for sheduled jobs +FIX: Test on mandatory status when closing proposal failed +FIX: to allow IRPF not null even if main VAT is null. +FIX: update wrong datetime extrafield +FIX: Use priority to define order of sheduled jobs +FIX: various modulebuilder-related issues +FIX: view of balance before field +FIX: weird password autocompletion in Goocle Chrome (issue #8479) +FIX: weird password autocompletion in Google Chrome (issue #8479) +FIX: When clearing filter, we must not save tmp criterias in session +FIX: With x extrafields, request for multicompany label was done x times +FIX: several XSS +FIX: zip not filtered + ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php FIX: #8200 From f76df85aec7a18ce137e8f1ef6d9e8629cc93194 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 21:53:02 +0200 Subject: [PATCH 32/38] compatibility with ubuntu 14.04 --- build/makepack-dolibarr.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 7da6d180dcb..62e1b8b6c34 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -849,6 +849,8 @@ if ($nboftargetok) { unlink("$NEWDESTI/${FILENAMEDEB}.changes"); print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n"; unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz"); + print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz"); print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n"; unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz"); @@ -1024,7 +1026,8 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/" 2>/dev/null`; + $ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; } From 19008531bba77484b3fbbe1fefdc5eaf81efffbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 21:56:34 +0200 Subject: [PATCH 33/38] Fix packager --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 62e1b8b6c34..31338e44649 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -466,10 +466,12 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; @@ -1026,7 +1028,6 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/" 2>/dev/null`; $ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; @@ -1171,7 +1172,7 @@ if ($nboftargetok) { "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', @@ -1184,8 +1185,7 @@ if ($nboftargetok) { "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu', - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu', - "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', "$DESTI/standard/$FILENAMETGZ.tgz"=>'standard', From f15da0b980f8c3ed6862d45a654f0ba8ccbe8acf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 22:15:19 +0200 Subject: [PATCH 34/38] Fix chart of account initial data for syscohada --- .../install/mysql/migration/6.0.0-7.0.0.sql | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index efb47ede029..cf0a8c8cc49 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -577,21 +577,21 @@ ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile( -- Add new chart of account entries INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 67,'PC-MIPYME', 'The PYME accountancy Chile plan', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 7,'ENG-BASE', 'England plan', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 66,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 66,'SYSCOHADA-TD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); -- Update old chart of account entries From 7511ba52ae301ca0cfdc1845b6c131a625a13673 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 22:20:33 +0200 Subject: [PATCH 35/38] NEW Suggest link to pay online for customer orders --- htdocs/commande/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d399c83131c..57b98d1a29a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2613,9 +2613,8 @@ if ($action == 'create' && $user->rights->commande->creer) $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); // Show online payment link - //$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); - $useonlinepayment = $conf->global->ORDER_SHOW_ONLINE_PAYMENT_ON_ORDER; - + $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); + if (! empty($conf->global->ORDER_HIDE_ONLINE_PAYMENT_ON_ORDER)) $useonlinepayment = 0; if ($object->statut != Commande::STATUS_DRAFT && $useonlinepayment) { print '
'; From fd53788d2f657064efad986eb2778b0b1a52715c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 22:54:22 +0200 Subject: [PATCH 36/38] Add param autostable into generate_filelist_xml.php --- build/generate_filelist_xml.php | 37 +++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 5f54c95d7e0..86afcd286f9 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -45,7 +45,7 @@ $includeconstants=array(); if (empty($argv[1])) { - print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + print "Usage: ".$script_file." release=autostable|auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; } @@ -68,29 +68,44 @@ while ($i < $argc) $i++; } +$savrelease = $release; + // If release is auto, we take current version $tmpver=explode('-', $release, 2); -if ($tmpver[0] == 'auto') +if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') { $release=DOL_VERSION; - if ($tmpver[1]) $release.='-'.$tmpver[1]; + if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1]; } if (empty($includecustom)) { - $tmpver=explode('-', $release, 2); - if (DOL_VERSION != $tmpver[0]) - { - print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n"; - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; - exit -1; - } + $tmpverbis=explode('-', $release, 2); + if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') + { + if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') + { + print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; + print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; + exit -1; + } + } + else + { + $tmpverter=explode('-', DOL_VERSION, 2); + if ($tmpverter[0] != $tmpverbis[0]) + { + print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; + print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; + exit -1; + } + } } else { if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release)) { - print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n"; + print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; exit -1; } From 8e729c2021f885274e7be81cf32e73897baa907b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 23:12:31 +0200 Subject: [PATCH 37/38] Add param autostable into generate_filelist_xml.php --- build/generate_filelist_xml.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 86afcd286f9..93ee76e3359 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -45,7 +45,7 @@ $includeconstants=array(); if (empty($argv[1])) { - print "Usage: ".$script_file." release=autostable|auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; } @@ -68,6 +68,13 @@ while ($i < $argc) $i++; } +if (empty($release)) +{ + print "Error: Missing release paramater\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + exit -1; +} + $savrelease = $release; // If release is auto, we take current version @@ -86,7 +93,7 @@ if (empty($includecustom)) if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') { print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; } } @@ -96,7 +103,7 @@ if (empty($includecustom)) if ($tmpverter[0] != $tmpverbis[0]) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; } } @@ -106,7 +113,7 @@ else if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release)) { print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; + print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; exit -1; } } From a84217868923b1c38e774483bf4bacb800431145 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 23:20:53 +0200 Subject: [PATCH 38/38] Fix migration missing steps --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 18 ++++++++++++++++++ 1 file changed, 18 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 3ca87e97053..055a38a36b7 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 @@ -59,6 +59,24 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 10, 'PCT', 'The Tunisia plan', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 67,'PC-MIPYME', 'The PYME accountancy Chile plan', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 7,'ENG-BASE', 'England plan', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 66,'SYSCOHADA-TD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); + -- For 8.0 -- delete old permission no more used