9696 <div class="card-header py-2">
9797 <h3 class="card-title mt-2"><i class="fa fa-fw fa-user-friends mr-2"></i><?php if ($ leads == 0 ){ echo "Client " ; } else { echo "Lead " ; } ?> Management</h3>
9898 <div class="card-tools">
99- <?php if ($ session_user_role == 3 ) { ?>
99+ <?php if (lookupUserPermission ( " module_client " ) >= 2 ) { ?>
100100 <div class="btn-group">
101101 <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addClientModal">
102102 <i class="fas fa-plus mr-2"></i>New
103- <?php if ($ leads == 0 ){ echo "Client " ; } else { echo "Lead " ; } ?>
103+ <?php if ($ leads == 0 ) { echo "Client " ; } else { echo "Lead " ; } ?>
104104 </button>
105105 <button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
106106 <div class="dropdown-menu">
134134 <div class="col-md-8">
135135 <div class="btn-toolbar float-right">
136136 <div class="btn-group mr-2">
137- <a href="?leads=0" class="btn btn-<?php if ($ leads == 0 ){ echo "primary " ; } else { echo "default " ; } ?> "><i class="fa fa-fw fa-user-friends mr-2"></i>Clients</a>
138- <a href="?leads=1" class="btn btn-<?php if ($ leads == 1 ){ echo "primary " ; } else { echo "default " ; } ?> "><i class="fa fa-fw fa-bullhorn mr-2"></i>Leads</a>
137+ <a href="?leads=0" class="btn btn-<?php if ($ leads == 0 ){ echo "primary " ; } else { echo "default " ; } ?> "><i class="fa fa-fw fa-user-friends mr-2"></i>Clients</a>
138+ <a href="?leads=1" class="btn btn-<?php if ($ leads == 1 ){ echo "primary " ; } else { echo "default " ; } ?> "><i class="fa fa-fw fa-bullhorn mr-2"></i>Leads</a>
139139 </div>
140140
141141 <div class="btn-group mr-2">
142142 <a href="?<?php echo $ url_query_strings_sort ?> &archived=<?php if ($ archived == 1 ){ echo 0 ; } else { echo 1 ; } ?> "
143- class="btn btn-<?php if ($ archived == 1 ){ echo "primary " ; } else { echo "default " ; } ?> ">
143+ class="btn btn-<?php if ($ archived == 1 ) { echo "primary " ; } else { echo "default " ; } ?> ">
144144 <i class="fa fa-fw fa-archive mr-2"></i>Archived
145145 </a>
146146 </div>
@@ -270,8 +270,8 @@ class="collapse mt-3
270270 <?php if ($ sort == 'contact_name ' ) { echo $ order_icon ; } ?>
271271 </a>
272272 </th>
273- <?php if (($ session_user_role == 3 || $ session_user_role = = 1 ) && $ config_module_enable_accounting == 1 ) { ?> <th class="text-right">Billing</th> <?php } ?>
274- <?php if ($ session_user_role == 3 ) { ?> <th class="text-center">Action</th> <?php } ?>
273+ <?php if ((lookupUserPermission ( " module_financial " ) > = 1 ) && $ config_module_enable_accounting == 1 ) { ?> <th class="text-right">Billing</th> <?php } ?>
274+ <?php if (lookupUserPermission ( " module_client " ) >= 2 ) { ?> <th class="text-center">Action</th> <?php } ?>
275275 </tr>
276276 </thead>
277277 <tbody>
@@ -387,7 +387,7 @@ class="collapse mt-3
387387 </div>
388388 <?php } ?>
389389 <div class="mt-1 text-secondary">
390- <small><strong>Created:</strong> <?php echo $ client_created_at ; ?> </small>
390+ <small><strong>Created: </strong> <?php echo $ client_created_at ; ?> </small>
391391 </div>
392392
393393 </td>
@@ -425,8 +425,8 @@ class="collapse mt-3
425425 <?php } ?>
426426 </td>
427427
428- <!-- Show Billing for Admin/Accountant roles only and if accounting module is enabled -->
429- <?php if (($ session_user_role == 3 || $ session_user_role = = 1 ) && $ config_module_enable_accounting == 1 ) { ?>
428+ <!-- Show Billing if perms & if accounting module is enabled -->
429+ <?php if ((lookupUserPermission ( " module_financial " ) > = 1 ) && $ config_module_enable_accounting == 1 ) { ?>
430430 <td class="text-right">
431431 <div class="mt-1">
432432 <span class="text-secondary">Balance</span> <span class="<?php echo $ balance_text_color ; ?> "><?php echo numfmt_format_currency ($ currency_format , $ balance , $ session_company_currency ); ?> </span>
@@ -443,8 +443,8 @@ class="collapse mt-3
443443 </td>
444444 <?php } ?>
445445
446- <!-- Show actions for Admin role only -->
447- <?php if ($ session_user_role == 3 ) { ?>
446+ <!-- Actions -->
447+ <?php if (lookupUserPermission ( " module_client " ) >= 2 ) { ?>
448448 <td>
449449 <div class="dropdown dropleft text-center">
450450 <button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
@@ -457,7 +457,7 @@ class="collapse mt-3
457457
458458 <?php if (empty ($ client_archived_at )) { ?>
459459 <div class="dropdown-divider"></div>
460- <a class="dropdown-item text-danger confirm-link" href="post.php?archive_client=<?php echo $ client_id ; ?> ">
460+ <a class="dropdown-item text-danger confirm-link" href="post.php?archive_client=<?php echo $ client_id ; ?> &csrf_token= <?php echo $ _SESSION [ ' csrf_token ' ] ?> ">
461461 <i class="fas fa-fw fa-archive mr-2"></i>Archive
462462 </a>
463463 <?php } ?>
0 commit comments