Allow user with only contact_view permission to click on contact record to view numbers etc. (#5153)

* Update contacts.php

Added contact_view permission to allow users with only contact view to open contact record to see numbers addresses etc.  See also update to contact_edit.php to remove save buttons if user only has contact view.

* Update contact_edit.php

Added permissions to only show save button if user has permissions contact_add or contact_edit.  This is in conjunction with the update to contacts.php
This commit is contained in:
Adrian Fretwell
2020-02-25 01:29:23 +00:00
committed by GitHub
parent 218b088a92
commit c1ca1b4866
2 changed files with 6 additions and 4 deletions

View File

@@ -495,7 +495,9 @@
}
}
}
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'style'=>($action != 'update' ?: 'margin-left: 15px;'),'collapse'=>'hide-sm-dn','onclick'=>"document.getElementById('frm').submit();"]);
if (permission_exists('contact_edit') || permission_exists('contact_add')) {
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'style'=>($action != 'update' ?: 'margin-left: 15px;'),'collapse'=>'hide-sm-dn','onclick'=>"document.getElementById('frm').submit();"]);
}
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
@@ -858,4 +860,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -305,7 +305,7 @@
if (is_array($contacts) && @sizeof($contacts) != 0) {
$x = 0;
foreach($contacts as $row) {
if (permission_exists('contact_edit')) {
if (permission_exists('contact_edit') || permission_exists('contact_view')) {
$list_row_url = "contact_edit.php?id=".urlencode($row['contact_uuid'])."&query_string=".urlencode($_SERVER["QUERY_STRING"]);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
@@ -370,4 +370,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>