Skip to content

Commit

Permalink
Some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Jul 7, 2014
1 parent 83d3af9 commit 9949713
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
32 changes: 15 additions & 17 deletions htdocs/comm/propal.php
Expand Up @@ -1976,25 +1976,23 @@
}
}
}
// Bank Account
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
print '<td>';

// Bank Account
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
print '<td>';
if (($action != 'editbankaccount') && $user->rights->propal->creer && ! empty($object->brouillon))
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
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 "</td>";
print '</tr>';
print '</tr></table>';
print '</td><td colspan="3">';
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 '</td>';
print '</tr>';

// Amount HT
print '<tr><td height="10" width="25%">' . $langs->trans('AmountHT') . '</td>';
Expand Down
9 changes: 3 additions & 6 deletions htdocs/commande/fiche.php
Expand Up @@ -2142,15 +2142,12 @@
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
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 "</td>";
print '</td>';
print '</tr>';

// Total HT
Expand Down
10 changes: 3 additions & 7 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -1087,8 +1087,7 @@ function setDocModel($user, $modelpdf)
*/
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;
}
Expand All @@ -1099,13 +1098,10 @@ function setBankAccount($fk_account)
$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;
Expand Down

0 comments on commit 9949713

Please sign in to comment.