Skip to content

Commit

Permalink
New: Support a backtopage parameter on contact creation page
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 20, 2011
1 parent 7e70ea0 commit 469a163
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -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 *****
Expand Down
14 changes: 7 additions & 7 deletions htdocs/compta/paiement/cheque/fiche.php
Expand Up @@ -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)
Expand Down Expand Up @@ -319,11 +319,11 @@

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("DateChequeReceived")." &nbsp;</td>\n";
print '<td width="120">'.$langs->trans("ChequeNumber")."</td>\n";
print '<td>'.$langs->trans("CheckTransmitter")."</td>\n";
print '<td>'.$langs->trans("Bank")."</td>\n";
print '<td align="right">'.$langs->trans("Amount")."</td>\n";
print '<td style="min-width: 120px">'.$langs->trans("DateChequeReceived")." &nbsp;</td>\n";
print '<td style="min-width: 120px">'.$langs->trans("ChequeNumber")."</td>\n";
print '<td style="min-width: 200px">'.$langs->trans("CheckTransmitter")."</td>\n";
print '<td style="min-width: 200px">'.$langs->trans("Bank")."</td>\n";
print '<td align="right" width="100px">'.$langs->trans("Amount")."</td>\n";
print "</tr>\n";

$var=true;
Expand All @@ -336,7 +336,7 @@
$accounts[$objp->bid] += 1;

print "<tr ".$bc[$var].">";
print '<td width="120">'.dol_print_date($value["date"],'day').'</td>';
print '<td>'.dol_print_date($value["date"],'day').'</td>';
print '<td>'.$value["numero"]."</td>\n";
print '<td>'.$value["emetteur"]."</td>\n";
print '<td>'.$value["banque"]."</td>\n";
Expand Down
14 changes: 7 additions & 7 deletions htdocs/contact/fiche.php
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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');
Expand Down Expand Up @@ -469,6 +467,8 @@
print '<form method="post" name="formsoc" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.GETPOST("backtopage").'">';
print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">';

// Name
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/main.lang
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/main.lang
Expand Up @@ -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
Expand Down
22 changes: 4 additions & 18 deletions htdocs/societe/soc.php
Expand Up @@ -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
Expand Down

0 comments on commit 469a163

Please sign in to comment.