From 5edeeae38487387637c95f4045bd29360fbc3986 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Mar 2016 11:30:15 +0100 Subject: [PATCH 1/4] FIX Bad error and style message when changing its own login --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/langs/en_US/errors.lang | 1 + htdocs/user/card.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index af29858c7bb..19af4885086 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4559,7 +4559,7 @@ function setEventMessage($mesgs, $style='mesgs') */ function setEventMessages($mesg, $mesgs, $style='mesgs') { - if (! in_array((string) $style, array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage'); + if (! in_array((string) $style, array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter style='.$style.' for setEventMessages'); if (empty($mesgs)) setEventMessage($mesg, $style); else { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 8b64c97ba34..50fd77a85e7 100755 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -195,3 +195,4 @@ WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when dis WarningPaymentDateLowerThanInvoiceDate=Payment date (%s) is earlier than invoice date (%s) for invoice %s. WarningTooManyDataPleaseUseMoreFilters=Too many data (more than %s lines). Please use more filters or set the constant %s to a higher limit. WarningSomeLinesWithNullHourlyRate=Some times were recorded by users when their hourly rate was not defined. A value of 0 was used but this may result in wrong valuation of time spent. +WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security purpose you will have to login with your new login before next action. diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 08a4d187a66..b0425b182e0 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -470,7 +470,7 @@ if (empty($reshook)) { { $error++; $langs->load("errors"); - setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); + setEventMessages($langs->transnoentitiesnoconv("WarningYourLoginWasModifiedPleaseLogin"), null, 'warnings'); } } else { $db->rollback(); From c5e744bfc2f8c54a1b79567e0c901c835b32c317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Mar 2016 12:16:40 +0100 Subject: [PATCH 2/4] FIX #4839 --- htdocs/compta/bank/search.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 81a1a493892..b1983a302ae 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -62,6 +62,8 @@ if (dol_strlen($search_dt_start) > 0) $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int'); if (dol_strlen($search_dt_end) > 0) $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int'); +if (GETPOST("req_nb")) $param.='&req_nb='.urlencode(GETPOST("req_nb")); +if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -91,7 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $companystatic=new Societe($db); $bankaccountstatic=new Account($db); -llxHeader(); +llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); $form = new Form($db); $formother = new FormOther($db); @@ -114,12 +116,10 @@ $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; if (GETPOST("req_nb")) { $sql.= " AND b.num_chq LIKE '%".$db->escape(GETPOST("req_nb"))."%'"; - $param.='&req_nb='.urlencode(GETPOST("req_nb")); } if (GETPOST("thirdparty")) { $sql.=" AND s.nom LIKE '%".$db->escape(GETPOST("thirdparty"))."%'"; - $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); } if ($bid) { From 875f4023de7540af17118399e3baabfcfb2d5079 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 18 Mar 2016 13:16:33 +0100 Subject: [PATCH 3/4] FIX: Can not select a commercial on the creation of a third --- htdocs/societe/soc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b492bc3725f..52f30317a3e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2011-2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García @@ -1211,7 +1211,7 @@ else print ''; print ''.fieldLabel('AllocateCommercial','commercial_id').''; print ''; - $form->select_dolusers((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default + print $form->select_dolusers((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default print ''; } From fb625f0ca71f75d03e187be490dcda8fc95f0855 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Mar 2016 13:58:06 +0100 Subject: [PATCH 4/4] FIX #4812 --- htdocs/contact/list.php | 2 +- htdocs/product/list.php | 4 ++-- htdocs/societe/list.php | 2 +- htdocs/user/index.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2ba0d4e4565..5ac3234d6a7 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -212,7 +212,7 @@ $sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.zip, $sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql.= " co.code as country_code"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 1b3ceb04709..8e4f1ac20aa 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -220,7 +220,7 @@ else //$sql.= ' pfp.ref_fourn as ref_supplier, '; $sql.= ' MIN(pfp.unitprice) as minsellprice'; // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; + foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook @@ -274,7 +274,7 @@ else $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; $sql.= ' p.datec, p.tms'; // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key; + foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 087195e2905..3aa18ed5018 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -346,7 +346,7 @@ if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We'll need these fields in order to filter by categ if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/user/index.php b/htdocs/user/index.php index d0ac0aaa66d..8710dc87e04 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -175,7 +175,7 @@ $sql.= " u.tms as date_update, u.datec as date_creation,"; $sql.= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2,"; $sql.= " s.nom as name, s.canvas"; // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook