IVR Menus - Edit: Permission adjustments, code cleanup.

This commit is contained in:
Nate 2020-02-28 07:33:11 -07:00
parent 6c37a5e125
commit cb86601fd4
1 changed files with 10 additions and 11 deletions

View File

@ -566,14 +566,16 @@
echo " <div class='heading'><b>".$text['header-ivr_menu']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'ivr_menus.php']);
$button_margin = 'margin-left: 15px;';
if (permission_exists('ivr_menu_add') && $action == "update" && (!is_numeric($_SESSION['limit']['ivr_menus']['numeric']) || $total_ivr_menus < $_SESSION['limit']['ivr_menus']['numeric'])) {
echo button::create(['type'=>'submit','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'name'=>'action','value'=>'copy','style'=>$button_margin,'onclick'=>"if (!confirm('".$text['confirm-copy']."')) { this.blur(); return false; }"]);
unset($button_margin);
}
if (permission_exists('ivr_menu_delete') && $action == "update") {
echo button::create(['type'=>'submit','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'action','value'=>'delete','style'=>$button_margin,'onclick'=>"if (!confirm('".$text['confirm-delete']."')) { this.blur(); return false; }"]);
unset($button_margin);
if ($action == "update") {
$button_margin = 'margin-left: 15px;';
if (permission_exists('ivr_menu_add') && (!is_numeric($_SESSION['limit']['ivr_menus']['numeric']) || $total_ivr_menus < $_SESSION['limit']['ivr_menus']['numeric'])) {
echo button::create(['type'=>'submit','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'name'=>'action','value'=>'copy','style'=>$button_margin,'onclick'=>"if (!confirm('".$text['confirm-copy']."')) { this.blur(); return false; }"]);
unset($button_margin);
}
if (permission_exists('ivr_menu_delete') || permission_exists('ivr_menu_option_delete')) {
echo button::create(['type'=>'submit','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'action','value'=>'delete','style'=>$button_margin,'onclick'=>"if (!confirm('".$text['confirm-delete']."')) { this.blur(); return false; }"]);
unset($button_margin);
}
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'style'=>'margin-left: 15px']);
echo " </div>\n";
@ -934,9 +936,6 @@
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_options', 'delete_toggle_options');\" onmouseout=\"swap_display('delete_label_options', 'delete_toggle_options');\">\n";
echo " <span id='delete_label_options'>".$text['label-delete']."</span>\n";
echo " <span id='delete_toggle_options'><input type='checkbox' id='checkbox_all_options' name='checkbox_all' onclick=\"edit_all_toggle('options');\"></span>\n";
// echo " <td class='vtable' style='text-align: center;'>\n";
// echo " <label for='checkbox_all_options' style='margin: 0; cursor: pointer;' title=\"".$text['button-toggle']."\">".$text['label-delete']."</label>";
// echo " <input type='checkbox' id='checkbox_all_options' name='checkbox_all' style='display: none;' onchange=\"edit_all_toggle('options');\">";
echo " </td>\n";
}
echo " </tr>\n";