FIX The backtopage
This commit is contained in:
parent
fdc1aa2a03
commit
6bdfa99fc2
@ -396,6 +396,15 @@ if (empty($reshook))
|
||||
$action = 'edit';
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error && empty($errors))
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +52,17 @@ function societe_prepare_head(Societe $object)
|
||||
{
|
||||
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
|
||||
$nbContact = 0; // TODO
|
||||
|
||||
$sql = "SELECT COUNT(p.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $nbContact = $obj->nb;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans('ContactsAddresses');
|
||||
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
|
||||
|
||||
@ -117,9 +117,9 @@ if (! ($result >= 0))
|
||||
if ($cancel)
|
||||
{
|
||||
$action ='';
|
||||
if ($backtourl)
|
||||
if ($backtopage)
|
||||
{
|
||||
header("Location: ".$backtourl);
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -387,7 +387,7 @@ if ($action != 'edit')
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit§ion='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
|
||||
|
||||
//print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=cancel§ion='.$section.'&urlfile='.urlencode($urlfile).'&backtourl='.urlencode($backtourl).'">'.$langs->trans('Cancel').'</a>';
|
||||
//print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=cancel§ion='.$section.'&urlfile='.urlencode($urlfile).'&backtopage='.urlencode($backtourl).'">'.$langs->trans('Cancel').'</a>';
|
||||
}
|
||||
/*
|
||||
if ($user->rights->ecm->setup)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user