mirror of
https://github.com/itflow-org/itflow
synced 2026-03-09 15:24:51 +00:00
Fix Tags
This commit is contained in:
@@ -120,9 +120,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
LEFT JOIN contact_tags ON contact_tags.tag_id = tags.tag_id
|
LEFT JOIN contact_tags ON contact_tags.tag_id = tags.tag_id
|
||||||
LEFT JOIN contacts ON contact_tags.contact_id = contacts.contact_id
|
LEFT JOIN contacts ON contact_tags.contact_id = contacts.contact_id
|
||||||
WHERE tag_type = 3
|
WHERE tag_type = 3
|
||||||
$client_query OR tags.tag_id IN ($tag_filter) -- This ensures we only get tags relevant to the selected client or Include the tags in the URL, even if no contacts are associated with them
|
$client_query OR tags.tag_id IN ($tag_filter)
|
||||||
GROUP BY tags.tag_id
|
GROUP BY tags.tag_id
|
||||||
HAVING COUNT(contact_tags.contact_id) > 0
|
HAVING COUNT(contact_tags.contact_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||||
");
|
");
|
||||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||||
$tag_id = intval($row['tag_id']);
|
$tag_id = intval($row['tag_id']);
|
||||||
|
|||||||
@@ -129,14 +129,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$sql_tags_filter = mysqli_query($mysqli, "
|
$sql_tags_filter = mysqli_query($mysqli, "
|
||||||
SELECT tags.tag_id, tags.tag_name, tag_type
|
SELECT tags.tag_id, tags.tag_name
|
||||||
FROM tags
|
FROM tags
|
||||||
LEFT JOIN credential_tags ON credential_tags.tag_id = tags.tag_id
|
LEFT JOIN credential_tags ON credential_tags.tag_id = tags.tag_id
|
||||||
LEFT JOIN credentials ON credential_tags.credential_id = credentials.credential_id
|
LEFT JOIN credentials ON credential_tags.credential_id = credentials.credential_id
|
||||||
WHERE tag_type = 4
|
WHERE tag_type = 4
|
||||||
$client_query OR tags.tag_id IN ($tag_filter) -- This ensures we only get tags relevant to the selected client or Include the tags in the URL, even if no contacts are associated with them
|
$client_query OR tags.tag_id IN ($tag_filter)
|
||||||
GROUP BY tags.tag_id
|
GROUP BY tags.tag_id
|
||||||
HAVING COUNT(credential_tags.credential_id) > 0
|
HAVING COUNT(credential_tags.credential_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||||
");
|
");
|
||||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||||
$tag_id = intval($row['tag_id']);
|
$tag_id = intval($row['tag_id']);
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
LEFT JOIN location_tags ON location_tags.tag_id = tags.tag_id
|
LEFT JOIN location_tags ON location_tags.tag_id = tags.tag_id
|
||||||
LEFT JOIN locations ON location_tags.location_id = locations.location_id
|
LEFT JOIN locations ON location_tags.location_id = locations.location_id
|
||||||
WHERE tag_type = 2
|
WHERE tag_type = 2
|
||||||
$client_query OR tags.tag_id IN ($tag_filter) -- This ensures we only get tags relevant to the selected client or Include the tags in the URL, even if no contacts are associated with them
|
$client_query OR tags.tag_id IN ($tag_filter)
|
||||||
GROUP BY tags.tag_id
|
GROUP BY tags.tag_id
|
||||||
HAVING COUNT(location_tags.location_id) > 0
|
HAVING COUNT(location_tags.location_id) > 0 OR tags.tag_id IN ($tag_filter)
|
||||||
");
|
");
|
||||||
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
while ($row = mysqli_fetch_array($sql_tags_filter)) {
|
||||||
$tag_id = intval($row['tag_id']);
|
$tag_id = intval($row['tag_id']);
|
||||||
|
|||||||
Reference in New Issue
Block a user