mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Dialplans - List: Fix Admin view.
This commit is contained in:
@@ -390,39 +390,44 @@
|
||||
foreach ($dialplans as $row) {
|
||||
|
||||
//get the application id
|
||||
if (is_uuid($row['app_uuid'])) {
|
||||
$app_uuid = $row['app_uuid'];
|
||||
}
|
||||
// if (is_uuid($row['app_uuid'])) {
|
||||
// $app_uuid = $row['app_uuid'];
|
||||
// }
|
||||
|
||||
// blank app id if doesn't match others, so will return to dialplan manager
|
||||
switch ($app_uuid) {
|
||||
case "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4": // inbound route
|
||||
case "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3": // outbound route
|
||||
case "16589224-c876-aeb3-f59f-523a1c0801f7": // fifo
|
||||
case "4b821450-926b-175a-af93-a03c441818b1": // time condition
|
||||
break;
|
||||
default:
|
||||
unset($app_uuid);
|
||||
}
|
||||
// switch ($app_uuid) {
|
||||
// case "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4": // inbound route
|
||||
// case "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3": // outbound route
|
||||
// case "16589224-c876-aeb3-f59f-523a1c0801f7": // fifo
|
||||
// case "4b821450-926b-175a-af93-a03c441818b1": // time condition
|
||||
// break;
|
||||
// default:
|
||||
// unset($app_uuid);
|
||||
// }
|
||||
|
||||
if ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1" && permission_exists('time_condition_edit')) {
|
||||
$list_row_url = PROJECT_PATH."/app/time_conditions/time_condition_edit.php?id=".urlencode($row['dialplan_uuid']).(is_uuid($app_uuid) ? "&app_uuid=".urlencode($app_uuid) : null);
|
||||
if ($row['app_uuid'] == "4b821450-926b-175a-af93-a03c441818b1") {
|
||||
if (permission_exists('time_condition_edit') || permission_exists('dialplan_edit')) {
|
||||
$list_row_url = PROJECT_PATH."/app/time_conditions/time_condition_edit.php?id=".urlencode($row['dialplan_uuid']).(is_uuid($app_uuid) ? "&app_uuid=".urlencode($app_uuid) : null);
|
||||
}
|
||||
}
|
||||
else if (
|
||||
($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
($row['app_uuid'] == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($row['app_uuid'] == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($row['app_uuid'] == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
permission_exists('dialplan_edit')
|
||||
) {
|
||||
$list_row_url = "dialplan_edit.php?id=".urlencode($row['dialplan_uuid']).(is_uuid($app_uuid) ? "&app_uuid=".urlencode($app_uuid) : null);
|
||||
}
|
||||
else {
|
||||
unset($list_row_url);
|
||||
}
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (
|
||||
(!is_uuid($app_uuid) && (permission_exists('dialplan_add') || permission_exists('dialplan_edit') || permission_exists('dialplan_delete'))) ||
|
||||
($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && (permission_exists('inbound_route_copy') || permission_exists('inbound_route_edit') || permission_exists('inbound_route_delete'))) ||
|
||||
($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && (permission_exists('outbound_route_copy') || permission_exists('outbound_route_edit') || permission_exists('outbound_route_delete'))) ||
|
||||
($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7" && (permission_exists('fifo_add') || permission_exists('fifo_edit') || permission_exists('fifo_delete'))) ||
|
||||
($app_uuid == "4b821450-926b-175a-af93-a03c441818b1" && (permission_exists('time_condition_add') || permission_exists('time_condition_edit') || permission_exists('time_condition_delete'))) ||
|
||||
permission_exists('dialplan_add') || permission_exists('dialplan_edit') || permission_exists('dialplan_delete')
|
||||
($app_uuid == "4b821450-926b-175a-af93-a03c441818b1" && (permission_exists('time_condition_add') || permission_exists('time_condition_edit') || permission_exists('time_condition_delete')))
|
||||
) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='dialplans[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
@@ -452,11 +457,11 @@
|
||||
}
|
||||
echo " <td class='center'>".escape($row['dialplan_order'])."</td>\n";
|
||||
if (
|
||||
($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
($app_uuid == "4b821450-926b-175a-af93-a03c441818b1" && permission_exists('time_condition_edit')) ||
|
||||
permission_exists('dialplan_edit')
|
||||
(!is_uuid($app_uuid) && permission_exists('dialplan_edit')) ||
|
||||
($row['app_uuid'] == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($row['app_uuid'] == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($row['app_uuid'] == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
($row['app_uuid'] == "4b821450-926b-175a-af93-a03c441818b1" && permission_exists('time_condition_edit'))
|
||||
) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['dialplan_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
@@ -467,13 +472,13 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['dialplan_description'])." </td>\n";
|
||||
if ((
|
||||
($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
($app_uuid == "4b821450-926b-175a-af93-a03c441818b1" && permission_exists('time_condition_edit')) ||
|
||||
permission_exists('dialplan_edit')) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true'
|
||||
) {
|
||||
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true' && (
|
||||
(!is_uuid($app_uuid) && permission_exists('dialplan_edit')) ||
|
||||
($row['app_uuid'] == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4" && permission_exists('inbound_route_edit')) ||
|
||||
($row['app_uuid'] == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3" && permission_exists('outbound_route_edit')) ||
|
||||
($row['app_uuid'] == "16589224-c876-aeb3-f59f-523a1c0801f7" && permission_exists('fifo_edit')) ||
|
||||
($row['app_uuid'] == "4b821450-926b-175a-af93-a03c441818b1" && permission_exists('time_condition_edit'))
|
||||
)) {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user