Commit 48d33f3ce6e5055b4a85f6cd9a5e72a88fb754af

Authored by Darkjeff
2 parents 7217029a 0fc0a4ee
Exists in 3.4

Merge pull request #61 from groolot/patch-3

Meilleure proposition de correction du #59
Showing 1 changed file with 6 additions and 3 deletions   Show diff stats
accountingex/admin/fiche.php
... ... @@ -53,8 +53,10 @@ $accounting = new AccountingAccount ( $db );
53 53  
54 54 // action
55 55 if ($action == 'add') {
56   -
57   -$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
  56 + if(GETPOST('cancel') != '')
  57 + Header ( "Location: account.php" );
  58 + else{
  59 + $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
58 60 $result = $db->query ( $sql );
59 61 $obj = $db->fetch_object ( $result );
60 62 $cpt = 0;
... ... @@ -82,6 +84,7 @@ $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE ro
82 84 }
83 85 }
84 86 Header ( "Location: account.php" );
  87 + }
85 88 } // Update record
86 89 else if ($action == 'edit') {
87 90 if (! GETPOST ( 'cancel', 'alpha' )) {
... ... @@ -323,4 +326,4 @@ if ($action == 'create') {
323 326 llxFooter ();
324 327  
325 328 $db->close ();
326   -?>
327 329 \ No newline at end of file
  330 +?>
... ...