Skip to content

Commit

Permalink
Enhance - More messages::add updates (fusionpbx#2662)
Browse files Browse the repository at this point in the history
convert more messages over to messsagse::add
  • Loading branch information
mafoo authored and markjcrane committed Jun 10, 2017
1 parent bc26ecf commit 3cab440
Show file tree
Hide file tree
Showing 153 changed files with 249 additions and 293 deletions.
4 changes: 2 additions & 2 deletions app/access_controls/access_control_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
unset($sql);

remove_config_from_cache('configuration:acl.conf');
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
header("Location: access_controls.php");
return;

Expand All @@ -95,7 +95,7 @@
unset($sql);

remove_config_from_cache('configuration:acl.conf');
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
header("Location: access_controls.php");
return;

Expand Down
17 changes: 6 additions & 11 deletions app/backup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,14 @@
}
else {
//set response message
$_SESSION["message"] = $text['message-backup_failed_format'] . $response_txt;
$_SESSION['message_mood'] = 'negative';
messages::add($text['message-backup_failed_format'] . $response_txt, 'negative');
header("Location: ".$_SERVER['PHP_SELF']);
exit;
}
}
else {
//set response message
$_SESSION["message"] = $text['message-backup_failed_paths'];
$_SESSION['message_mood'] = 'negative';
messages::add($text['message-backup_failed_paths'], 'negative');
header("Location: ".$_SERVER['PHP_SELF']);
exit;
}
Expand Down Expand Up @@ -126,8 +124,7 @@
}
if (!$valid_format) {
@unlink($backup_path.'/'.$backup_file);
$_SESSION["message"] = $text['message-restore_failed_format'];
$_SESSION['message_mood'] = 'negative';
messages::add($text['message-restore_failed_format'], 'negative');
header("Location: ".$_SERVER['PHP_SELF']);
exit;
}
Expand All @@ -137,21 +134,19 @@
$response_txt = "<br>" . implode("<br>", $response);
if ($restore_errlevel == 0) {
//set response message
$_SESSION["message"] = $text['message-restore_completed'];
messages::add($text['message-restore_completed']);
header("Location: ".$_SERVER['PHP_SELF']);
exit;
} else {
$_SESSION["message"] = $text['message-restore_failed_extract'] . $response_txt;
$_SESSION['message_mood'] = 'negative';
messages::add($text['message-restore_failed_extract'] . $response_txt, 'negative');
header("Location: ".$_SERVER['PHP_SELF']);
exit;
}
}
}
else {
//set response message
$_SESSION["message"] = $text['message-restore_failed_upload'];
$_SESSION['message_mood'] = 'negative';
messages::add($text['message-restore_failed_upload'], 'negative');
header("Location: ".$_SERVER['PHP_SELF']);
exit;
}
Expand Down
2 changes: 1 addition & 1 deletion app/call_block/call_block_cdr_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['label-add-complete'];
messages::add($text['label-add-complete']);

}

Expand Down
2 changes: 1 addition & 1 deletion app/call_block/call_block_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}

//redirect the browser
$_SESSION["message"] = $text['label-delete-complete'];
messages::add($text['label-delete-complete']);
header("Location: call_block.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/call_block/call_block_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function call_block_get_extensions($select_extension) {
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['label-add-complete'];
messages::add($text['label-add-complete']);
header("Location: call_block.php");
return;
} //if ($action == "add")
Expand Down Expand Up @@ -186,7 +186,7 @@ function call_block_get_extensions($select_extension) {
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['label-update-complete'];
messages::add($text['label-update-complete']);
header("Location: call_block.php");
return;
} //if ($action == "update")
Expand Down
2 changes: 1 addition & 1 deletion app/call_broadcast/call_broadcast_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}


$_SESSION["message"] = $text['confirm-delete'];
messages::add($text['confirm-delete']);
header("Location: call_broadcast.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/call_broadcast/call_broadcast_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['confirm-add'];
messages::add($text['confirm-add']);
header("Location: call_broadcast.php");
return;
} //if ($action == "add")
Expand Down Expand Up @@ -201,7 +201,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['confirm-update'];
messages::add($text['confirm-update']);
header("Location: call_broadcast.php");
return;
} //if ($action == "update")
Expand Down
2 changes: 1 addition & 1 deletion app/call_centers/call_center_agent_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
remove_config_from_cache('configuration:callcenter.conf');

//redirect the browser
$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: call_center_agents.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/call_centers/call_center_agent_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
}
header("Location: call_center_agents.php");
return;
Expand Down
2 changes: 1 addition & 1 deletion app/call_centers/call_center_queue_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

//redirect the browser
$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: call_center_queues.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/call_centers/call_center_queue_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/call_centers/call_center_tier_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}
unset($prep_statement);

$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
header("Location: call_center_queue_edit.php?id=".$queue_uuid);
return;

Expand Down
2 changes: 1 addition & 1 deletion app/call_flows/call_flow_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
}


$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: call_flows.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/call_flows/call_flow_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
}
header("Location: call_flows.php");
return;
Expand Down
2 changes: 1 addition & 1 deletion app/calls/call_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function destination_select($select_name, $select_value, $select_default) {
}

//redirect the user
$_SESSION["message"] = $text['confirm-update'];
messages::add($text['confirm-update']);
header("Location: ".$_REQUEST['return_url']);
return;

Expand Down
2 changes: 1 addition & 1 deletion app/conference_centers/conference_center_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
}

//redirect the browser
$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: conference_centers.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/conference_centers/conference_center_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
}
header("Location: conference_centers.php");
return;
Expand Down
2 changes: 1 addition & 1 deletion app/conference_centers/conference_room_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
}

//redirect the user
$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: conference_rooms.php");
return;

Expand Down
8 changes: 4 additions & 4 deletions app/conference_centers/conference_room_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function get_meeting_pin($length, $meeting_uuid) {
unset($sql);
}

$_SESSION["message"] = $text['message-delete'];
messages::add($text['message-delete']);
header("Location: conference_room_edit.php?id=".$conference_room_uuid);
return;
}
Expand Down Expand Up @@ -343,7 +343,7 @@ function get_meeting_pin($length, $meeting_uuid) {
unset($sql);
}

$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
} //if ($action == "add")

if ($action == "update" && permission_exists('conference_room_edit')) {
Expand Down Expand Up @@ -409,7 +409,7 @@ function get_meeting_pin($length, $meeting_uuid) {
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
} //if ($action == "update")

//assign the user to the meeting
Expand All @@ -433,7 +433,7 @@ function get_meeting_pin($length, $meeting_uuid) {
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}

header("Location: conference_room_edit.php?id=".$conference_room_uuid);
Expand Down
4 changes: 2 additions & 2 deletions app/conference_controls/conference_control_detail_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
header('Location: conference_control_edit.php?id='.$conference_control_uuid);
return;

Expand All @@ -110,7 +110,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
header('Location: conference_control_edit.php?id='.$conference_control_uuid);
return;

Expand Down
4 changes: 2 additions & 2 deletions app/conference_controls/conference_control_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
}
header("Location: conference_controls.php");
return;
Expand Down
4 changes: 2 additions & 2 deletions app/conference_profiles/conference_profile_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
header("Location: conference_profiles.php");
return;

Expand All @@ -97,7 +97,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
header("Location: conference_profiles.php");
return;

Expand Down
4 changes: 2 additions & 2 deletions app/conference_profiles/conference_profile_param_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-add'];
messages::add($text['message-add']);
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid);
return;

Expand All @@ -111,7 +111,7 @@
$db->exec(check_sql($sql));
unset($sql);

$_SESSION["message"] = $text['message-update'];
messages::add($text['message-update']);
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid);
return;

Expand Down
2 changes: 1 addition & 1 deletion app/conferences/conference_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
}

//redirect the browser
$_SESSION["message"] = $text['confirm-delete'];
messages::add($text['confirm-delete']);
header("Location: conferences.php");
return;

Expand Down
8 changes: 4 additions & 4 deletions app/conferences/conference_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$sql .= "and user_uuid = '".$user_uuid."' ";
$db->exec(check_sql($sql));

$_SESSION["message"] = $text['confirm-delete'];
messages::add($text['confirm-delete']);
header("Location: conference_edit.php?id=".$conference_uuid);
return;
}
Expand All @@ -107,7 +107,7 @@
$sql_insert .= ")";
$db->exec($sql_insert);
//send a message
$_SESSION["message"] = $text['confirm-add'];
messages::add($text['confirm-add']);
header("Location: conference_edit.php?id=".$conference_uuid);
return;
}
Expand Down Expand Up @@ -217,7 +217,7 @@
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);

//add the message
$_SESSION["message"] = $text['confirm-add'];
messages::add($text['confirm-add']);
} //if ($action == "add")

if ($action == "update") {
Expand Down Expand Up @@ -273,7 +273,7 @@
$db->query($sql);

//add the message
$_SESSION["message"] = $text['confirm-update'];
messages::add($text['confirm-update']);
} //if ($action == "update")

//update the dialplan xml
Expand Down
Loading

0 comments on commit 3cab440

Please sign in to comment.