From 422f028ac9d4b4c747ccb07b75bdecb33893c846 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 29 Sep 2012 12:07:07 +0200 Subject: [PATCH] Fix: use ADHERENT_BANK_USE for check or not bank via invoice Fix: code optimizing --- htdocs/adherents/card_subscriptions.php | 69 +++++++++++-------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 400e386ef8e..6972f32113d 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -1,7 +1,8 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin * * 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 @@ -40,6 +41,7 @@ $langs->load("mails"); $action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); $rowid=GETPOST('rowid','int'); $typeid=GETPOST('typeid','int'); @@ -87,7 +89,7 @@ if ($rowid) */ // Create third party from a member -if ($action == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes' && $user->rights->societe->creer) +if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) { if ($result > 0) { @@ -589,10 +591,10 @@ if ($rowid) print ''; - if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer) print ''; + if ($action != 'editlogin' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrUser"); print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'
'; print ''; - if ($_GET['action'] == 'editlogin') + if ($action == 'editlogin') { /*$include=array(); if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only @@ -748,49 +750,40 @@ if ($rowid) if ($conf->use_javascript_ajax) { print "\n".''."\n"; } // Confirm create third party - if ($_GET["action"] == 'create_thirdparty') + if ($action == 'create_thirdparty') { $name = $object->getFullName($langs); if (! empty($name)) @@ -803,14 +796,14 @@ if ($rowid) } // Create a form array - $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); + $formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); if ($ret == 'html') print '
'; } - print '
'; + print ''; print ''; print ''; print ''; @@ -888,15 +881,15 @@ if ($rowid) print ''.$langs->trans('MoreActions'); print ''; print ''; - print ' '.$langs->trans("None").'
'; + print ' '.$langs->trans("None").'
'; if (! empty($conf->banque->enabled)) { - print ' '.$langs->trans("MoreActionBankDirect").'
'; } if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { - print 'global->ADHERENT_BANK_USE) || $invoiceonly?' checked="checked"':''); if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; @@ -911,7 +904,7 @@ if ($rowid) } if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { - print 'global->ADHERENT_BANK_USE)?' checked="checked"':''); if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';