Add a name when copying a sip profile

This commit is contained in:
Mark Crane 2014-04-30 22:20:55 +00:00
parent 492452de64
commit 49f04f6188
2 changed files with 6 additions and 4 deletions

View File

@ -47,6 +47,7 @@ else {
//set the http get/post variable(s) to a php variable
if (isset($_REQUEST["id"])) {
$sip_profile_uuid = check_str($_REQUEST["id"]);
$sip_profile_name = check_str($_REQUEST["name"]);
}
//get the sip profile data
@ -57,7 +58,6 @@ else {
$prep_statement->execute();
$result = $prep_statement->fetchAll();
foreach ($result as &$row) {
$sip_profile_name = $row["sip_profile_name"];
$sip_profile_description = $row["sip_profile_description"];
}
unset ($prep_statement);
@ -74,7 +74,7 @@ else {
$sql .= "values ";
$sql .= "(";
$sql .= "'".$sip_profile_uuid_new."', ";
$sql .= "'".$sip_profile_name."-copy', ";
$sql .= "'".$sip_profile_name."', ";
$sql .= "'".$sip_profile_description."' ";
$sql .= ")";
$db->exec(check_sql($sql));

View File

@ -172,7 +172,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-sip_profile']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='sip_profiles.php'\" value='".$text['button-back']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"if (confirm('".$text['confirm-copy']."')){window.location='sip_profile_copy.php?id=".$sip_profile_uuid."';}\" value='".$text['button-copy']."'>\n";
//echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"if (confirm('".$text['confirm-copy']."')){window.location='sip_profile_copy.php?id=".$sip_profile_uuid."';}\" value='".$text['button-copy']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"var name = prompt('".$text['message_device']."'); if (name != null) { window.location='sip_profile_copy.php?id=".$sip_profile_uuid."&name=' + name; }\" value='".$text['button-copy']."'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo "</td>\n";
echo "</tr>\n";