From a6ec22d7fee41c954b37249909271c6370047eff Mon Sep 17 00:00:00 2001 From: altatof Date: Fri, 7 Apr 2017 12:06:15 +0200 Subject: [PATCH 01/12] FIX: dont lose supplier ref if no supplier price in database --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b2f2d3dc3c3..44364a884eb 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1373,7 +1373,7 @@ class CommandeFournisseur extends CommonOrder if ($result > 0) { $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice - $ref = $prod->ref_fourn; // Ref supplier price set by get_buyprice + $fourn_ref = $prod->ref_fourn; // Ref supplier price set by get_buyprice } if ($result == 0) // If result == 0, we failed to found the supplier reference price { @@ -1457,7 +1457,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", '".$localtax1_type."',"; $sql.= " '".$localtax2_type."'"; - $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$ref."',"; + $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$fourn_ref."',"; $sql.= "'".price2num($total_ht)."',"; $sql.= "'".price2num($total_tva)."',"; $sql.= "'".price2num($total_localtax1)."',"; From 919633b2beb65208d4b9c309b3dbf28a4ffd8d36 Mon Sep 17 00:00:00 2001 From: altatof Date: Fri, 7 Apr 2017 12:10:01 +0200 Subject: [PATCH 02/12] escape supplier ref --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 44364a884eb..99babcda7fe 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1457,7 +1457,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", '".$localtax1_type."',"; $sql.= " '".$localtax2_type."'"; - $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$fourn_ref."',"; + $sql.= ", ".$remise_percent.",'".price2num($subprice,'MU')."','".$this->db->escape($fourn_ref)."',"; $sql.= "'".price2num($total_ht)."',"; $sql.= "'".price2num($total_tva)."',"; $sql.= "'".price2num($total_localtax1)."',"; From d892a89f453e7a1be99d0a8fa3b620d8fa04c0bf Mon Sep 17 00:00:00 2001 From: altatof Date: Fri, 7 Apr 2017 14:15:51 +0200 Subject: [PATCH 03/12] FIX: dont get empty "Incoterms : - " string if no incoterm --- htdocs/core/class/commonobject.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 018aef19519..60247186734 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3073,8 +3073,16 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { - $res = $this->db->fetch_object($resql); - return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; + $num = $this->db->num_rows($resql); + if ($num > 0) + { + $res = $this->db->fetch_object($resql); + return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; + } + else + { + return ''; + } } else { From 74f0ae5bbb8a3a8660b7e6fbfff50605153d42e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 14:09:33 +0200 Subject: [PATCH 04/12] FIX #6623 User card shows "Return to list" link even if the user has no rights to list users Close #6623 --- htdocs/user/agenda_extsites.php | 6 +++++- htdocs/user/bank.php | 6 +++++- htdocs/user/card.php | 6 +++++- htdocs/user/clicktodial.php | 6 +++++- htdocs/user/document.php | 6 +++++- htdocs/user/info.php | 6 +++++- htdocs/user/ldap.php | 6 +++++- htdocs/user/note.php | 6 +++++- htdocs/user/param_ihm.php | 8 ++++++-- htdocs/user/perms.php | 6 +++++- 10 files changed, 51 insertions(+), 11 deletions(-) diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 823f5ad307e..52f67aaac0c 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -153,7 +153,11 @@ $head=user_prepare_head($object); dol_fiche_head($head, 'extsites', $langs->trans("User"), 0, 'user'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''; + +if ($user->rights->user->user->lire || $user->admin) { + $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 951c3a6ef7e..f8ff1aab18b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -133,7 +133,11 @@ if ($id && $action != 'edit') $title = $langs->trans("User"); dol_fiche_head($head, 'bank', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $linkback = ''.$langs->trans("BackToList").''; + } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 1728b0b170b..a225edc1873 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1183,7 +1183,11 @@ else else { $title = $langs->trans("User"); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $linkback = ''.$langs->trans("BackToList").''; + } } $head = user_prepare_head($object); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index cb1e9f875aa..159cf038a01 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -98,7 +98,11 @@ if ($id > 0) dol_fiche_head($head, 'clicktodial', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $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 36338f03e10..b77cc400e56 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -129,7 +129,11 @@ if ($object->id) dol_fiche_head($head, 'document', $langs->trans("User"),0,'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $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 1d10875b3eb..4b5ea6506c3 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -67,7 +67,11 @@ $title = $langs->trans("User"); dol_fiche_head($head, 'info', $title, 0, 'user'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''; + +if ($user->rights->user->user->lire || $user->admin) { + $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 1da5911861c..0f0cc6b4ed7 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -96,7 +96,11 @@ $head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'ldap', $title, 0, 'user'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''; + +if ($user->rights->user->user->lire || $user->admin) { + $linkback = ''.$langs->trans("BackToList").''; +} dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/note.php b/htdocs/user/note.php index ccd7eb153a4..4fc274208d7 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -89,7 +89,11 @@ if ($id) $title = $langs->trans("User"); dol_fiche_head($head, 'note', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $linkback = ''.$langs->trans("BackToList").''; + } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 4d254349a7d..f71934be80f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -161,8 +161,12 @@ if ($action == 'edit') if ($action == 'edit') { dol_fiche_head($head, 'guisetup', $title, 0, 'user'); - - $linkback = ''.$langs->trans("BackToList").''; + + $linkback = ''; + + if ($user->rights->user->user->lire || $user->admin) { + $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 3240ae2d5ec..3dd6e329380 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -257,7 +257,11 @@ else * Ecran ajout/suppression permission */ -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''; + +if ($user->rights->user->user->lire || $user->admin) { + $linkback = ''.$langs->trans("BackToList").''; +} dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); From a8da0776132cb31314a13f83093939dbf96ac65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 14:13:04 +0200 Subject: [PATCH 05/12] FIX #6613 Default subject for Supplier proposal emails is filled with a non-existing key Close #6613 --- htdocs/supplier_proposal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index b0792defc8f..9ed38461180 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1907,7 +1907,7 @@ if ($action == 'create') $formmail->withtocc = $liste; $formmail->withtoccc = (! empty($conf->global->MAIN_EMAIL_USECCC) ? $conf->global->MAIN_EMAIL_USECCC : false); - $formmail->withtopic = $outputlangs->trans('SendAskRef', '__ASKREF__'); + $formmail->withtopic = $outputlangs->trans('SendAskRef', '__SUPPLIERPROPREF__'); $formmail->withfile = 2; $formmail->withbody = 1; From 411d276ed2dea990fee8d6e5266b02f569b4fe71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 14:29:40 +0200 Subject: [PATCH 06/12] FIX #6669 User with no permission to edit customer invoices can see a edit button in project entry Close #6669 --- htdocs/compta/facture.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f900e2889a3..8a80fa4bf96 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3744,7 +3744,9 @@ else if ($id > 0 || ! empty($ref)) print ''; if ($action != 'classify') { print 'id . '">'; - print img_edit($langs->trans('SetProject'), 1); + if ($user->rights->facture->creer) { + print img_edit($langs->trans('SetProject'), 1); + } print ''; } print ''; From da0af36086ab39407da9b3fdaee47ff68487a69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 14:51:15 +0200 Subject: [PATCH 07/12] FIX #6671 Cannot remove thirdparty type with "#" in its name Close #6671 --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 211b2a1dc71..caff34f8c9b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -909,7 +909,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); From 2d83efc7e303778a595e6cfe31979bdbe0ee07f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 15:02:04 +0200 Subject: [PATCH 08/12] FIX #6673 Missing "nature" table header in thirdparty list Close #6673 --- htdocs/societe/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index b7125da21e2..f3ef24d12d2 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -40,6 +40,7 @@ $langs->load("customers"); $langs->load("suppliers"); $langs->load("bills"); $langs->load("compta"); +$langs->load('commercial'); // Security check $socid = GETPOST('socid','int'); @@ -160,7 +161,7 @@ $arrayfields=array( 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4), 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5), 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), - 'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1), + 'customerorsupplier'=>array('label'=>$langs->trans('Nature'), 'checked'=>1), 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), @@ -592,7 +593,7 @@ if (! empty($arrayfields['s.ape']['checked'])) print_liste_field_titr if (! empty($arrayfields['s.idprof4']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$param,'class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof5","",$param,'class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof6","",$param,'class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer +if (! empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre($arrayfields['customerorsupplier']['label']); // type of customer if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); // Extra fields From 2057613ad91bed05e3843151baedb1b6b656b95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 15:18:02 +0200 Subject: [PATCH 09/12] FIX #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list Close #6675 --- htdocs/contact/list.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index af9be04a207..78664a795c7 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -129,7 +129,7 @@ $fieldstosearchall = array( $arrayfields=array( 'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'p.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'p.poste'=>array('label'=>$langs->trans("Post"), 'checked'=>1), + 'p.poste'=>array('label'=>$langs->trans("PostOrFunction"), 'checked'=>1), 'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), 'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), 'p.phone'=>array('label'=>$langs->trans("PhonePro"), 'checked'=>1), @@ -761,8 +761,10 @@ if ($result) } // Action column - Links Add action and Export vcard print ''; - print ''.img_object($langs->trans("AddAction"),"action").''; - print '   '; + if ($user->rights->agenda->myactions->create) { + print ''.img_object($langs->trans("AddAction"),"action").''; + print '   '; + } print ''; print img_picto($langs->trans("VCard"),'vcard.png').' '; print ''; From 59fa5c2fe69d42ac84d545068c4b2ea2ae88590f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 17:38:59 +0200 Subject: [PATCH 10/12] FIX #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it Close #6680 --- htdocs/fourn/facture/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2a1f1dab8bc..ebe198613c2 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2135,13 +2135,17 @@ else // Reopen a standard paid invoice if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) { - if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice + if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice { print ''.$langs->trans('ReOpen').''; } else { - print ''.$langs->trans('ReOpen').''; + if ($user->rights->fournisseur->facture->creer) { + print ''.$langs->trans('ReOpen').''; + } elseif (!$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) { + print ''.$langs->trans('ReOpen').''; + } } } From 12df7b6ab904bdcb11dcf5b818528fcfc3e3a7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 18:09:08 +0200 Subject: [PATCH 11/12] FIX #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode Close #6679 --- htdocs/fourn/facture/card.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2a1f1dab8bc..d91f341b278 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -870,7 +870,7 @@ if (empty($reshook)) $action = ''; } - elseif ($action == 'classin') + elseif ($action == 'classin' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); $result=$object->setProject($projectid); @@ -1844,7 +1844,9 @@ else print ''; + if ($action != 'editconditions' && $user->rights->fournisseur->facture->creer) { + print ''; + } print '
'; print $langs->trans('PaymentConditions'); print ''; - if ($action != 'editconditions') print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; print ''; if ($action == 'editconditions') @@ -1864,7 +1866,9 @@ else print ''; - if ($action != 'editmode') print ''; + if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { + print ''; + } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; print ''; if ($action == 'editmode') @@ -1994,7 +1998,7 @@ else print ''; - if ($action != 'classify') + if ($action != 'classify' && $user->rights->fournisseur->facture->creer) { print '"; } @@ -1111,7 +1111,7 @@ else print '
'; print $langs->trans('Project'); print 'id.'">'; print img_edit($langs->trans('SetProject'),1); From 996b5e9f874e47f68a46e34886df06c6eefb01ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 18:17:46 +0200 Subject: [PATCH 12/12] Corrected translation errors and little bug showing a non-available button to a restricted user --- htdocs/compta/facture/fiche-rec.php | 8 +++++--- htdocs/core/class/html.form.class.php | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 3a55c8b57c2..289ac8d704a 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -899,7 +899,7 @@ if ($action == 'create') // Bank account if ($object->fk_account > 0) { - print "
".$langs->trans('BankAccount').""; + print "
".$langs->trans('RIB').""; $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); print "
'; - if ($action != 'classify') { + if ($action != 'classify' && $user->rights->facture->creer) { print ''; @@ -1129,9 +1129,11 @@ else } // Bank Account + $langs->load('banks'); + print '
'; print $langs->trans('Project'); print 'id . '">'; print img_edit($langs->trans('SetProject'), 1); print '
'; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f8ed836f44..e787b3a65cc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3150,11 +3150,14 @@ class Form print ''; print '
'; - print $langs->trans('BankAccount'); + print $langs->trans('RIB'); print ''; if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon)) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; } else { + + $langs->load('banks'); + if ($selected) { require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; $bankstatic=new Account($this->db); $bankstatic->fetch($selected); - print $this->textwithpicto($bankstatic->label,$langs->trans("AccountCurrency").' '.$bankstatic->currency_code); + print $this->textwithpicto($bankstatic->getNomUrl(1),$langs->trans("AccountCurrency").' '.$bankstatic->currency_code); } else { print " "; }