From d776fc423e4066901d231ec4c7f5e0ffe48e287b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 00:51:08 +0200 Subject: [PATCH 01/15] Fix search criterai of contract --- htdocs/contrat/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 18e78c7ff0a..b4255046ad4 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -107,7 +107,6 @@ $fieldstosearchall = array( 'c.ref_customer'=>'RefCustomer', 'c.ref_supplier'=>'RefSupplier', 's.nom'=>"ThirdParty", - 'cd.description'=>'Description', 'c.note_public'=>'NotePublic', ); if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; @@ -252,7 +251,7 @@ else if ($year > 0) $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } if ($search_name) $sql .= natural_search('s.nom', $search_name); -if ($search_email) $sql .= natural_search('s.email', $search_name); +if ($search_email) $sql .= natural_search('s.email', $search_email); if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer); if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); From 7be9b6d94e353da111e813d2575c4ca884495b07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 14:04:22 +0200 Subject: [PATCH 02/15] Fix translation of source of proposals --- htdocs/core/class/html.form.class.php | 8 ++++++-- htdocs/langs/en_US/dict.lang | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 89c45ec2bfc..6f331c42896 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2971,7 +2971,10 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label=($langs->trans("DemandReasonType".$obj->code)!=("DemandReasonType".$obj->code)?$langs->trans("DemandReasonType".$obj->code):($obj->label!='-'?$obj->label:'')); + $label=($obj->label!='-'?$obj->label:''); + if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work + if ($langs->trans($obj->code) != $obj->code) $label=$langs->trans($obj->code); // So translation key SRC_XXX will work + $tmparray[$obj->rowid]['id'] =$obj->rowid; $tmparray[$obj->rowid]['code'] =$obj->code; $tmparray[$obj->rowid]['label']=$label; @@ -3020,7 +3023,8 @@ class Form { print ''; } print ''; diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index 81f62469896..bb79cd59d7d 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -295,7 +295,7 @@ CurrencyCentINR=paisa CurrencyCentSingINR=paise CurrencyThousandthSingTND=thousandth #### Input reasons ##### -DemandReasonTypeSRC_INTE=Internet +DemandReasonTypeSRC_INTE=Internetaaa DemandReasonTypeSRC_CAMP_MAIL=Mailing campaign DemandReasonTypeSRC_CAMP_EMAIL=EMailing campaign DemandReasonTypeSRC_CAMP_PHO=Phone campaign From 0c7b7ed7f46b8fa2d1954ec733dbf44802d8f3d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 14:26:18 +0200 Subject: [PATCH 03/15] FIX Required extrafield value numeric should accept '0' --- htdocs/core/class/extrafields.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 200c869f5e8..ae859181f67 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1847,11 +1847,16 @@ class ExtraFields if (empty($enabled)) continue; if (empty($perms)) continue; - if ($this->attributes[$object->table_element]['required'][$key] && empty($_POST["options_".$key])) // Check if empty without GETPOST, value can be alpha, int, array, etc... + if ($this->attributes[$object->table_element]['required'][$key]) // Value is required { - //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; - $nofillrequired++; - $error_field_required[] = $langs->transnoentitiesnoconv($value); + // Check if empty without using GETPOST, value can be alpha, int, array, etc... + if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0') + || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) + { + //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; + $nofillrequired++; + $error_field_required[] = $langs->transnoentitiesnoconv($value); + } } if (in_array($key_type,array('date'))) From c26fe00362b37f97cb781db73154e59f23a79cd8 Mon Sep 17 00:00:00 2001 From: Nicolas Aupetit Date: Tue, 9 Oct 2018 02:15:38 +1100 Subject: [PATCH 04/15] fix bank ref override "bordereau cheque" ref --- htdocs/compta/paiement/cheque/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 527bd05e3a1..826a4333147 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -91,7 +91,7 @@ $max=10; $sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,"; $sql.= " bc.statut, bc.nbcheque,"; -$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,"; +$sql.= " ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,"; $sql.= " aj.code"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal"; @@ -120,7 +120,7 @@ if ($resql) $checkdepositstatic->statut=$objp->statut; $accountstatic->id=$objp->bid; - $accountstatic->ref=$objp->ref; + $accountstatic->ref=$objp->bref; $accountstatic->label=$objp->label; $accountstatic->number=$objp->number; $accountstatic->currency_code=$objp->currency_code; From c930218dd28f9d9e73dc07cea0ab5891cd204926 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 17:40:17 +0200 Subject: [PATCH 05/15] FIX Missing transaction around action --- htdocs/comm/propal/card.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 802e255fb36..ee48650ef04 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -609,12 +609,23 @@ if (empty($reshook)) // Classify billed else if ($action == 'classifybilled' && $usercanclose) { + $db->begin(); + $result=$object->cloture($user, 4, ''); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } // Close proposal @@ -627,12 +638,23 @@ if (empty($reshook)) // prevent browser refresh from closing proposal several times if ($object->statut == Propal::STATUS_VALIDATED) { + $db->begin(); + $result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','none')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } } } @@ -643,12 +665,23 @@ if (empty($reshook)) // prevent browser refresh from reopening proposal several times if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { + $db->begin(); + $result=$object->reopen($user, 1); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } } From 91038af84d2f0c5c178d60607ddc4f0a388175c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 18:15:46 +0200 Subject: [PATCH 06/15] FIX properties on proposal must not be modified if error --- htdocs/comm/propal/class/propal.class.php | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index bd6a85a06ad..fabb43ce846 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2420,16 +2420,16 @@ class Propal extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); + $outputlangs->setDefaultLang($newlang); + } + //$ret=$object->fetch($id); // Reload to get new records + $this->generateDocument($modelpdf, $outputlangs); } if (! $error) @@ -2437,7 +2437,7 @@ class Propal extends CommonObject $this->oldcopy= clone $this; $this->statut = $statut; $this->date_cloture = $now; - $this->note_private = $note; + $this->note_private = $newprivatenote; } if (! $notrigger && empty($error)) @@ -2448,13 +2448,17 @@ class Propal extends CommonObject // End call triggers } - if ( ! $error ) + if (! $error) { $this->db->commit(); return 1; } else { + $this->statut = $this->oldcopy->statut; + $this->date_cloture = $this->oldcopy->date_cloture; + $this->note_private = $this->oldcopy->note_private; + $this->db->rollback(); return -1; } From 923b561aff06be4bdbe9e98d9dff223758af9f96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Oct 2018 20:01:45 +0200 Subject: [PATCH 07/15] FIX Option for prof id mandatory not working with custom type of company --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/companies.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 2 +- htdocs/langs/fr_FR/companies.lang | 2 +- htdocs/societe/class/societe.class.php | 8 ++++++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index aade72a64bb..cbe085f3149 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1207,7 +1207,7 @@ WatermarkOnDraft=Watermark on draft document JSOnPaimentBill=Activate feature to autofill payment lines on payment form CompanyIdProfChecker=Rules for Professional IDs MustBeUnique=Must be unique? -MustBeMandatory=Mandatory to create third parties? +MustBeMandatory=Mandatory to create third parties (if vat number or type of company defined) ? MustBeInvoiceMandatory=Mandatory to validate invoices? TechnicalServicesProvided=Technical services provided #####DAV ##### diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 19cc993876c..78762e542e2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -38,7 +38,7 @@ ThirdPartyCustomers=Customers ThirdPartyCustomersStats=Customers ThirdPartyCustomersWithIdProf12=Customers with %s or %s ThirdPartySuppliers=Vendors -ThirdPartyType=Third Party Type +ThirdPartyType=Type of company Individual=Private individual ToCreateContactWithSameName=Will create automatically a contact/address with same information than third party under the third party. In most cases, even if your third party is a physical people, creating a third party alone is enough. ParentCompany=Parent company diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index cd048e908f8..58cd1d09b11 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1207,7 +1207,7 @@ WatermarkOnDraft=Filigrane sur les documents brouillons JSOnPaimentBill=Activer la fonctionnalité de remplissage automatique des lignes de paiement sur le formulaire de paiement CompanyIdProfChecker=Règles sur les Identifiants professionnels MustBeUnique=Doit être unique ? -MustBeMandatory=Obligatoire pour créer des tiers ? +MustBeMandatory=Obligatoire pour créer des tiers (si num tva ou type de société défini) ? MustBeInvoiceMandatory=Obligatoire pour valider des factures ? TechnicalServicesProvided=Services techniques fournis #####DAV ##### diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index fbd8bb87e4e..548a7f6e0dd 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -38,7 +38,7 @@ ThirdPartyCustomers=Clients ThirdPartyCustomersStats=Clients ThirdPartyCustomersWithIdProf12=Clients avec %s ou %s ThirdPartySuppliers=Fournisseurs -ThirdPartyType=Type du tiers +ThirdPartyType=Type du société Individual=Individu privé ToCreateContactWithSameName=Crée automatiquement un contact/adresse, sous le tiers, avec la même information que le tiers. Dans la plupart des cas, même si votre tiers est une personne physique, la création d'un tiers seul suffit. ParentCompany=Maison mère diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2125d0e6627..bae4a0a4495 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3127,8 +3127,12 @@ class Societe extends CommonObject // Define if third party is treated as company (or not) when nature is unknown $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default if (! empty($this->tva_intra)) $isacompany=1; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE','TE_GROUP'))) $isacompany=1; + else if (! empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') + { + // TODO Add a field is_a_company into dictionary + if (preg_match('/^TE_PRIVATE/', $this->typent_code)) $isacompany=0; + else $isacompany=1; + } return $isacompany; } From 4d959bbea754238c8095f231b9bed6bf5186f606 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:06:45 +0200 Subject: [PATCH 08/15] Fix consistency of label of proposal status --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/langs/en_US/propal.lang | 2 +- htdocs/langs/fr_FR/propal.lang | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index fabb43ce846..e68b18ae820 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3109,7 +3109,7 @@ class Propal extends CommonObject $this->labelstatut[3]=$langs->trans("PropalStatusNotSigned"); $this->labelstatut[4]=$langs->trans("PropalStatusBilled"); $this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort"); - $this->labelstatut_short[1]=$langs->trans("Opened"); + $this->labelstatut_short[1]=$langs->trans("PropalStatusValidatedShort"); $this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort"); $this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort"); $this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort"); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a40a6e25b97..65d132d5654 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -990,7 +990,7 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield']) + if (isset($totalarray['totalhtfield']) || isset($totalarray['totalvatfield']) || isset($totalarray['totalttcfield']) || isset($totalarray['totalamfield']) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 5a7169ac925..3552076a4e7 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signed (needs billing) PropalStatusNotSigned=Not signed (closed) PropalStatusBilled=Billed PropalStatusDraftShort=Draft -PropalStatusValidatedShort=Validated +PropalStatusValidatedShort=Validated (open) PropalStatusClosedShort=Closed PropalStatusSignedShort=Signed PropalStatusNotSignedShort=Not signed diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index f35f63cf34d..a575824fc72 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signée (à facturer) PropalStatusNotSigned=Non signée (fermée) PropalStatusBilled=Facturée PropalStatusDraftShort=Brouillon -PropalStatusValidatedShort=Validé +PropalStatusValidatedShort=Validée (ouverte) PropalStatusClosedShort=Fermée PropalStatusSignedShort=Signée PropalStatusNotSignedShort=Non signée From 603c70ffc740599d63aef0b8409aa34764f864bc Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Tue, 9 Oct 2018 00:25:42 +0100 Subject: [PATCH 09/15] Fix: Searching on employee field disables employee mode --- htdocs/user/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 869e5d272ce..5a8661663f6 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -126,6 +126,7 @@ $optioncss = GETPOST('optioncss','alpha'); // Default search if ($search_statut == '') $search_statut='1'; +if(!empty($search_employee))$mode =''; if ($mode == 'employee') $search_employee=1; From f365a987c43f934a5ae165a2fa2f4207f6d4c0a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:20:53 +0200 Subject: [PATCH 10/15] FIX restore last seach criteria FIX filter on employee --- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/bank.php | 2 +- htdocs/user/clicktodial.php | 2 +- htdocs/user/document.php | 2 +- htdocs/user/info.php | 2 +- htdocs/user/ldap.php | 2 +- htdocs/user/list.php | 3 +-- htdocs/user/note.php | 2 +- htdocs/user/notify/card.php | 2 +- htdocs/user/param_ihm.php | 2 +- htdocs/user/perms.php | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 1764ab5baf4..2d94711aae8 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -157,7 +157,7 @@ dol_fiche_head($head, 'extsites', $langs->trans("User"), -1, 'user'); $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 7f4084ab4fe..2f9fb787c72 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -194,7 +194,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index a4c4e90f99d..a6c43e2dc62 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -102,7 +102,7 @@ if ($id > 0) $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 8425c696382..2c41c1bf922 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -133,7 +133,7 @@ if ($object->id) $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 19ecf15eb65..3cecf94543b 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -72,7 +72,7 @@ dol_fiche_head($head, 'info', $title, -1, 'user'); $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 4f9eac61d9f..6b8d0b2502e 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -98,7 +98,7 @@ dol_fiche_head($head, 'ldap', $title, 0, 'user'); $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 5a8661663f6..c4664b07fb7 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -126,8 +126,7 @@ $optioncss = GETPOST('optioncss','alpha'); // Default search if ($search_statut == '') $search_statut='1'; -if(!empty($search_employee))$mode =''; -if ($mode == 'employee') $search_employee=1; +if ($mode == 'employee' && ! GETPOSTISSET('search_employee')) $search_employee=1; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 5b787ded7b0..87a6785615e 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -93,7 +93,7 @@ if ($id) $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 307b8ae5bc9..9403694faa9 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -137,7 +137,7 @@ if ($result > 0) dol_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 0, ''); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 76b25751806..60f1e23334f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -182,7 +182,7 @@ if ($action == 'edit') $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 0a8e2bbbb80..574aa44f89d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -239,7 +239,7 @@ else $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); From 073914572c7abc84eabed684318dbd908840ddae Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Mon, 8 Oct 2018 23:17:44 +0100 Subject: [PATCH 11/15] Fix: users categories type is Categorie::TYPE_USER --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 6e1e80223f6..a7282783166 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2262,7 +2262,7 @@ else { print '' . fieldLabel( 'Categories', 'usercats' ) . ''; print ''; - $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, null, null, null, 1 ); + $cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, null, null, null, 1 ); $c = new Categorie( $db ); $cats = $c->containing($object->id, Categorie::TYPE_USER); foreach ($cats as $cat) { From a2a53a32f1069a5b08ed79c1b2530a79ee06f368 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:34:25 +0200 Subject: [PATCH 12/15] FIX Look and feel v8. Missing button "Create category" --- htdocs/categories/index.php | 5 ++++- htdocs/langs/en_US/categories.lang | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index e57e51caf62..9f41c0b016a 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -65,8 +65,11 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css') llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss); +$newcardbutton = ''.$langs->trans("NewCategory").''; +$newcardbutton.= ''; +$newcardbutton.= ''; -print load_fiche_titre($title); +print load_fiche_titre($title, $newcardbutton); //print ''; //print '
'; diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 47b5ea92d12..bd1fd78a0c8 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -16,6 +16,7 @@ MembersCategoriesArea=Members tags/categories area ContactsCategoriesArea=Contacts tags/categories area AccountsCategoriesArea=Accounts tags/categories area ProjectsCategoriesArea=Projects tags/categories area +UsersCategoriesArea=Users tags/categories area SubCats=Sub-categories CatList=List of tags/categories NewCategory=New tag/category From 9bea9edfd7924904fb89163c646e71299fed5da6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:41:21 +0200 Subject: [PATCH 13/15] FIX Menu to show/edit Users categories was missing --- htdocs/core/menus/standard/eldy.lib.php | 1 + htdocs/langs/en_US/categories.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index eb630739fe5..1e20d615974 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -602,6 +602,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"),2, ($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index bd1fd78a0c8..ee019d0ebbb 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -61,6 +61,7 @@ MembersCategoriesShort=Members tags/categories ContactCategoriesShort=Contacts tags/categories AccountsCategoriesShort=Accounts tags/categories ProjectsCategoriesShort=Projects tags/categories +UsersCategoriesShort=Users tags/categories ThisCategoryHasNoProduct=This category does not contain any product. ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoCustomer=This category does not contain any customer. From dd0cbabc913792720a61b1a7e8ce084c3aff4731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:44:13 +0200 Subject: [PATCH 14/15] Fix translation --- htdocs/core/menus/standard/eldy.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1e20d615974..6325643cf87 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -602,7 +602,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"),2, ($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + if (! empty($conf->categorie->enabled)) + { + $langs->load("categories"); + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + } $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); From 387d9d685aba3fbe1cafbb7cc5278f40a1d6281b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 14:52:53 +0200 Subject: [PATCH 15/15] Update auguria menu --- htdocs/core/menus/init_menu_auguria.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 86942478969..c8d2692c2f5 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -63,10 +63,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 15, __ENTITY__); -- Home - Menu users and groups insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 403__+MAX_llx_menu__, '/user/group/card.php?leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?leftmenu=users', 'HierarchicView', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); + -- Third parties insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);