diff --git a/agent/clients.php b/agent/clients.php index 61d6749e2..7bc51edb6 100644 --- a/agent/clients.php +++ b/agent/clients.php @@ -446,9 +446,9 @@ $total_leads = intval($row['leads']);
- "> + table-light"> - - -
+
@@ -502,22 +502,23 @@ $total_leads = intval($row['leads']); } ?>
+
+ +
- - -
- - - + + +
+ + +
" aria-hidden="true"> + + + TagAdd tags + +
diff --git a/agent/modals/client/client_bulk_assign_tags.php b/agent/modals/client/client_bulk_assign_tags.php index 5083c6d18..d9191de55 100644 --- a/agent/modals/client/client_bulk_assign_tags.php +++ b/agent/modals/client/client_bulk_assign_tags.php @@ -2,16 +2,32 @@ require_once '../../../includes/modal_header.php'; +enforceUserPermission('module_client', 2); + $client_ids = array_map('intval', $_GET['client_ids'] ?? []); $count = count($client_ids); +// Opened from the + beside one client's tags on the clients list: name the +// client, and offer only the tags it doesn't already have +$single_client_id = $count === 1 ? $client_ids[0] : 0; +$existing_tags_query = ''; +if ($single_client_id) { + enforceClientAccess($single_client_id); + $single_client_name = escapeHtml(getFieldById('clients', $single_client_id, 'client_name')); + $existing_tags_query = "AND tag_id NOT IN (SELECT tag_id FROM client_tags WHERE client_id = $single_client_id)"; +} + ob_start(); ?> @@ -22,10 +38,12 @@ ob_start();