Contacts: Add view before edit.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user