From 2c7cf2027563bfc4c862247ddeb1b1c09b0c4b3d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 24 Oct 2015 22:17:06 +0200 Subject: [PATCH] After cloning a profil, show it and select the default tab --- include/profile.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/profile.inc.php b/include/profile.inc.php index 1ba391513..e1ace5e49 100644 --- a/include/profile.inc.php +++ b/include/profile.inc.php @@ -145,7 +145,10 @@ if (isset($_POST['save_name'])) //************************************ if (isset($_POST['clone'])) { - extract($_POST); + $p_id = HtmlInput::default_value_post("p_id", 0); + if ( $p_id == 0 || isNumber($p_id) == 0) { + throw new Exception (_('Argument')); + } try { $cn->start(); @@ -167,12 +170,17 @@ if (isset($_POST['clone'])) where pm_id_dep is null and p_id=$1",array($new_id)); $cn->commit(); $p_id=$new_id; + $_POST['p_id'] = $new_id; + $_GET['p_id'] = $new_id; + $_REQUEST['p_id'] = $new_id; + $_POST['tab']="profile_gen_div"; } catch (Exception $exc) { echo alert($exc->getMessage()); $cn->rollback(); } + } //************************************ // Delete