New: Go back to caller page if cancel
This commit is contained in:
parent
d3861356d9
commit
93db51039c
@ -65,14 +65,14 @@ if ($_POST["action"] == 'add_action')
|
||||
|
||||
if ($_POST['cancel'])
|
||||
{
|
||||
$back='';
|
||||
if (! empty($_POST["back"])) $back=$_POST["back"];
|
||||
if (! $back)
|
||||
$backtopage='';
|
||||
if (! empty($_POST["backtopage"])) $backtopage=$_POST["backtopage"];
|
||||
if (! $backtopage)
|
||||
{
|
||||
if ($_POST['socid'] > 0) $back=DOL_URL_ROOT.'/comm/fiche.php?socid='.$_POST['socid'];
|
||||
else $back=DOL_URL_ROOT.'/comm/action/indexactions.php';
|
||||
if ($_POST['socid'] > 0) $backtopage=DOL_URL_ROOT.'/comm/fiche.php?socid='.$_POST['socid'];
|
||||
else $backtopage=DOL_URL_ROOT.'/comm/action/indexactions.php';
|
||||
}
|
||||
header("Location: ".$back);
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -411,9 +411,8 @@ if ($_GET["action"] == 'create')
|
||||
}
|
||||
|
||||
print '<form name="action" action="fiche.php" method="post">';
|
||||
if (! empty($_REQUEST["backtopage"])) print '<input type="hidden" name="from" value="'.($_REQUEST["from"] ? $_REQUEST["from"] : $_SERVER["HTTP_REFERER"]).'">';
|
||||
print '<input type="hidden" name="action" value="add_action">';
|
||||
print '<input type="hidden" name="back" value="'.$_SERVER['HTTP_REFERER'].'">';
|
||||
if (! empty($_REQUEST["backtopage"])) print '<input type="hidden" name="backtopage" value="'.($_REQUEST["backtopage"] != 1 ? $_REQUEST["backtopage"] : $_SERVER["HTTP_REFERER"]).'">';
|
||||
|
||||
if ($_GET["actioncode"] == 'AC_RDV') print_titre ($langs->trans("AddActionRendezVous"));
|
||||
else print_titre ($langs->trans("AddAnAction"));
|
||||
|
||||
@ -676,7 +676,7 @@ if ($socid > 0)
|
||||
// Lien click to dial
|
||||
print '<td>';
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '<a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print '<a href="action/fiche.php?action=create&backtopage=1&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print dolibarr_print_phone($obj->phone);
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '</a>';
|
||||
@ -684,14 +684,14 @@ if ($socid > 0)
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '<a href="action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print '<a href="action/fiche.php?action=create&backtopage=1&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print dolibarr_print_phone($obj->fax);
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '</a>';
|
||||
print ' </td>';
|
||||
print '<td>';
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '<a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print '<a href="action/fiche.php?action=create&backtopage=1&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print $obj->email;
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '</a>';
|
||||
@ -704,7 +704,7 @@ if ($socid > 0)
|
||||
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
print '<td align="center"><a href="action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print '<td align="center"><a href="action/fiche.php?action=create&backtopage=1&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
|
||||
print img_object($langs->trans("Rendez-Vous"),"action");
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
@ -104,8 +104,9 @@ llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom, s.fk_pays,";
|
||||
$sql.= " p.rowid as cidp, p.name, p.firstname, p.email, p.phone, p.phone_mobile, p.fax, p.priv,";
|
||||
$sql = "SELECT s.rowid as socid, s.nom,";
|
||||
$sql.= " p.rowid as cidp, p.name, p.firstname, p.email,";
|
||||
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv,";
|
||||
$sql.= " ".$db->pdate("p.tms")." as tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
@ -312,9 +313,9 @@ if ($result)
|
||||
// Phone
|
||||
print '<td>';
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->cidp.'&socid='.$obj->socid.'">'.dolibarr_print_phone($obj->phone,$obj->fk_pays).'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&backtopage=1&actioncode=AC_TEL&contactid='.$obj->cidp.'&socid='.$obj->socid.'">'.dolibarr_print_phone($obj->phone,$obj->pays_code).'</a>';
|
||||
else
|
||||
print dolibarr_print_phone($obj->phone,$obj->fk_pays);
|
||||
print dolibarr_print_phone($obj->phone,$obj->pays_code);
|
||||
print '</td>';
|
||||
|
||||
if ($_GET["view"] == 'phone')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user