Add the ability to copy an existing filter.

This commit is contained in:
wn_
2025-01-06 00:25:56 +00:00
parent 93e00d5aab
commit 91496a0d24
2 changed files with 87 additions and 6 deletions

View File

@@ -165,6 +165,28 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
alert(__("No filters selected."));
}
return false;
},
copySelectedFilters: function() {
const sel_rows = this.getSelectedFilters();
if (sel_rows.length > 0) {
if (confirm(__("Copy selected filters?"))) {
Notify.progress("Copying selected filters...");
const query = {
op: "Pref_Filters", method: "copy",
ids: sel_rows.toString()
};
xhr.post("backend.php", query, () => {
this.reload();
});
}
} else {
alert(__("No filters selected."));
}
return false;
},
});