disable depending filters when removing label
This commit is contained in:
parent
184f5092ed
commit
f6f7817d9d
1 changed files with 23 additions and 3 deletions
|
@ -48,12 +48,32 @@
|
|||
|
||||
$ids = split(",", db_escape_string($_GET["ids"]));
|
||||
|
||||
db_query($link, "BEGIN");
|
||||
|
||||
foreach ($ids as $id) {
|
||||
db_query($link, "DELETE FROM ttrss_labels2 WHERE id = '$id'
|
||||
$result = db_query($link, "SELECT caption FROM ttrss_labels2
|
||||
WHERE id = '$id'");
|
||||
|
||||
$caption = db_fetch_result($result, 0, "caption");
|
||||
|
||||
$result = db_query($link, "DELETE FROM ttrss_labels2 WHERE id = '$id'
|
||||
AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
if (db_affected_rows($link, $result) != 0 && $caption) {
|
||||
|
||||
/* Disable filters that reference label being removed */
|
||||
|
||||
db_query($link, "UPDATE ttrss_filters SET
|
||||
enabled = false WHERE action_param = '$caption'
|
||||
AND action_id = 7
|
||||
AND owner_uid = " . $_SESSION["uid"]);
|
||||
}
|
||||
}
|
||||
|
||||
db_query($link, "COMMIT");
|
||||
|
||||
}
|
||||
|
||||
if ($subop == "add") {
|
||||
|
||||
$caption = db_escape_string($_GET["caption"]);
|
||||
|
|
Loading…
Reference in a new issue