Contacts: Add view before edit.

This commit is contained in:
Nate
2020-03-31 17:32:12 -06:00
parent b4538ed69d
commit 5b195bbd87
14 changed files with 1330 additions and 11 deletions
+3 -4
View File
@@ -30,7 +30,7 @@
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('contact_view')) {
if (permission_exists('contact_edit')) {
//access granted
}
else {
@@ -42,7 +42,6 @@
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
@@ -146,7 +145,7 @@
}
//update the contact
if ($action == "update" && permission_exists('contact_edit')) {
if ($action == "update") {
$array['contacts'][0]['contact_uuid'] = $contact_uuid;
message::add($text['message-update']);
@@ -522,7 +521,7 @@
)) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','collapse'=>'hide-sm-dn','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
if (permission_exists('contact_edit') || permission_exists('contact_add')) {
if (permission_exists('contact_add')) {
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>($action != 'update' ?: 'margin-left: 15px;'),'collapse'=>'hide-sm-dn','onclick'=>"document.getElementById('frm').submit();"]);
}
echo " </div>\n";