From 9949713d2043803bdf99758caf0f560cdf28768a Mon Sep 17 00:00:00 2001 From: frederic34 Date: Mon, 7 Jul 2014 18:40:18 +0200 Subject: [PATCH] Some cleaning --- htdocs/comm/propal.php | 32 +++++++++++------------- htdocs/commande/fiche.php | 9 +++---- htdocs/core/class/commonobject.class.php | 10 +++----- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index caf27c0aced..994894f2b4c 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1976,25 +1976,23 @@ if ($action == 'create') { } } } - // Bank Account - print ''; - print '"; - print ''; + print '
'; - print $langs->trans('BankAccount'); - print ''; + + // Bank Account + print '
'; + print ''; - print '
'; + print $langs->trans('BankAccount'); + print ''; if (($action != 'editbankaccount') && $user->rights->propal->creer && ! empty($object->brouillon)) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; - print '
'; - if ($action == 'editbankaccount') - { - $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } - else - { - $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print "
'; + print ''; + if ($action == 'editbankaccount') { + $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print ''; + print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index aeba517270b..58fede8e275 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2142,15 +2142,12 @@ if ($action == 'create' && $user->rights->commande->creer) { print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).''; print ''; print ''; - if ($action == 'editbankaccount') - { + if ($action == 'editbankaccount') { $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } - else - { + } else { $form->form_select_comptes($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } - print ""; + print ''; print ''; // Total HT diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 44554d39180..fd6f83564ad 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1087,8 +1087,7 @@ abstract class CommonObject */ function setBankAccount($fk_account) { - if (! $this->table_element) - { + if (! $this->table_element) { dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined",LOG_ERR); return -1; } @@ -1099,13 +1098,10 @@ abstract class CommonObject $sql.= " SET fk_account = ".$fk_account; $sql.= " WHERE rowid=".$this->id; - if ($this->db->query($sql)) - { + if ($this->db->query($sql)) { $this->fk_account = ($fk_account=='NULL')?null:$fk_account; return 1; - } - else - { + } else { dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error()); $this->error=$this->db->error(); return 0;