mirror of
https://github.com/itflow-org/itflow
synced 2026-03-06 13:54:51 +00:00
Added the option to bulk remove contact tags
This commit is contained in:
@@ -9,6 +9,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
<input type="hidden" name="bulk_remove_tags" value="0">
|
||||||
|
|
||||||
|
<div class="form-group form-check">
|
||||||
|
<input type="checkbox" class="form-check-input" name="bulk_remove_tags" value="1">
|
||||||
|
<label class="form-check-label text-danger">Remove Existing Tags</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Tags</label>
|
<label>Tags</label>
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ if (isset($_POST['bulk_assign_contact_tags'])) {
|
|||||||
|
|
||||||
// Get Selected Contacts Count
|
// Get Selected Contacts Count
|
||||||
$count = count($_POST['contact_ids']);
|
$count = count($_POST['contact_ids']);
|
||||||
|
|
||||||
// Assign Location to Selected Contacts
|
// Assign Location to Selected Contacts
|
||||||
if (!empty($_POST['contact_ids'])) {
|
if (!empty($_POST['contact_ids'])) {
|
||||||
foreach($_POST['contact_ids'] as $contact_id) {
|
foreach($_POST['contact_ids'] as $contact_id) {
|
||||||
@@ -352,6 +352,11 @@ if (isset($_POST['bulk_assign_contact_tags'])) {
|
|||||||
$contact_name = sanitizeInput($row['contact_name']);
|
$contact_name = sanitizeInput($row['contact_name']);
|
||||||
$client_id = intval($row['contact_client_id']);
|
$client_id = intval($row['contact_client_id']);
|
||||||
|
|
||||||
|
if($_POST['bulk_remove_tags']) {
|
||||||
|
// Delete tags if chosed to do so
|
||||||
|
mysqli_query($mysqli, "DELETE FROM contact_tags WHERE contact_id = $contact_id");
|
||||||
|
}
|
||||||
|
|
||||||
// Add new tags
|
// Add new tags
|
||||||
foreach($_POST['bulk_tags'] as $tag) {
|
foreach($_POST['bulk_tags'] as $tag) {
|
||||||
$tag = intval($tag);
|
$tag = intval($tag);
|
||||||
|
|||||||
Reference in New Issue
Block a user