From 469a163f3c34b8b1cd296fbaa72de98d52317a0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Mar 2011 15:42:25 +0000 Subject: [PATCH] New: Support a backtopage parameter on contact creation page --- ChangeLog | 1 + htdocs/compta/paiement/cheque/fiche.php | 14 +++++++------- htdocs/contact/fiche.php | 14 +++++++------- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/societe/soc.php | 22 ++++------------------ 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7cd52038afc0..8f8467ddc7157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ For developers: - New: External modules can overwrite all default language files by forcing priority on langs directories on its own lang directory. - New: External modules can show export list with an "enabled" condition. +- New: Support a backtopage parameter on contact creation page ***** ChangeLog for 3.0 compared to 2.9 ***** diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 1685970dd0869..718df6f595899 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -290,7 +290,7 @@ $sql.= " AND ba.entity = ".$conf->entity; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; - $sql.= " ORDER BY b.emetteur ASC, b.rowid ASC"; + $sql.= $db->order("b.dateo,b.rowid","ASC"); $resql = $db->query($sql); if ($resql) @@ -319,11 +319,11 @@ print ''; print ''; - print '\n"; - print '\n"; - print '\n"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; print "\n"; $var=true; @@ -336,7 +336,7 @@ $accounts[$objp->bid] += 1; print ""; - print ''; + print ''; print '\n"; print '\n"; print '\n"; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 4bbd7c3fe56b3..4bb3496295dee 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -177,7 +177,9 @@ if (! $error && $id > 0) { $db->commit(); - Header("Location: fiche.php?id=".$id); + if (GETPOST('backtopage')) $url=GETPOST('backtopage'); + else $url='fiche.php?id='.$id; + Header("Location: ".$url); exit; } else @@ -385,9 +387,7 @@ // When used in standard mode // ----------------------------------------- - /* - * Confirmation de la suppression du contact - */ + // Confirm deleting contact if ($user->rights->societe->contact->supprimer) { if ($_GET["action"] == 'delete') @@ -411,9 +411,7 @@ $_GET["id"]=0; } - /* - * Affichage onglets - */ + // Show tabs $head = contact_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("ContactsAddresses"), 0, 'contact'); @@ -469,6 +467,8 @@ print ''; print ''; print ''; + print ''; + print ''; print '
'.$langs->trans("DateChequeReceived")."  '.$langs->trans("ChequeNumber")."'.$langs->trans("CheckTransmitter")."'.$langs->trans("Bank")."'.$langs->trans("Amount")."'.$langs->trans("DateChequeReceived")."  '.$langs->trans("ChequeNumber")."'.$langs->trans("CheckTransmitter")."'.$langs->trans("Bank")."'.$langs->trans("Amount")."
'.dol_print_date($value["date"],'day').''.dol_print_date($value["date"],'day').''.$value["numero"]."'.$value["emetteur"]."'.$value["banque"]."
'; // Name diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 75eb32b7535ec..23ded6670c0e7 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -106,6 +106,7 @@ Enabled=Enabled Disable=Disable Disabled=Disabled Add=Add +AddLink=Add link Update=Update AddActionToDo=Add action to do AddActionDone=Add action done diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 3e6f0e30e0cb6..81a0ac85096bd 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -105,6 +105,7 @@ Disable=Désactiver Disabled=Désactivé Create=Créer Add=Ajouter +AddLink=Lier Update=Modifier AddActionToDo=Ajouter action à faire AddActionDone=Ajouter action faite diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cf32c6d4cc2c8..aa352d2913600 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -242,24 +242,10 @@ { $db->commit(); - if ( $soc->client == 1 ) - { - Header("Location: ".DOL_URL_ROOT."/comm/fiche.php?socid=".$soc->id); - return; - } - else - { - if ( $soc->fournisseur == 1 ) - { - Header("Location: ".DOL_URL_ROOT."/fourn/fiche.php?socid=".$soc->id); - return; - } - else - { - Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$soc->id); - return; - } - } + $url=$_SERVER["PHP_SELF"]."?socid=".$soc->id; + if (($soc->client == 1 || $soc->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $url=DOL_URL_ROOT."/comm/fiche.php?socid=".$soc->id; + else if ($soc->fournisseur == 1) $url=DOL_URL_ROOT."/fourn/fiche.php?socid=".$soc->id; + Header("Location: ".$url); exit; } else