Preorder: Status can now be changed manually

This commit is contained in:
Frank Schubert
2023-11-07 13:00:29 +01:00
parent bd3489f6e4
commit 79fe0aa00e
18 changed files with 367 additions and 69 deletions
@@ -70,8 +70,12 @@ class VoiceplandestinationModel {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$sql = "SELECT COUNT(*) as cnt FROM Voiceplandestination
WHERE $where
$sql = "SELECT COUNT(*) as cnt FROM (
SELECT Voiceplandestination.id FROM Voiceplandestination
LEFT JOIN Voiceplanzone ON (Voiceplanzone.id = Voiceplandestination.voiceplanzone_id)
WHERE $where
GROUP BY Voiceplandestination.id
) as v
";
$res = $db->query($sql);
@@ -87,7 +91,8 @@ class VoiceplandestinationModel {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$sql = "SELECT * FROM Voiceplandestination
$sql = "SELECT Voiceplandestination.* FROM Voiceplandestination
LEFT JOIN Voiceplanzone ON (Voiceplanzone.id = Voiceplandestination.voiceplanzone_id)
WHERE $where
ORDER BY destination,prefix";
@@ -126,6 +131,13 @@ class VoiceplandestinationModel {
}
}
if(array_key_exists("voiceplan_id", $filter)) {
$voiceplan_id = $filter['voiceplan_id'];
if(is_numeric($voiceplan_id)) {
$where .= " AND Voiceplanzone.voiceplan_id = $voiceplan_id";
}
}
if(array_key_exists("name", $filter)) {
$name = $db->escape($filter['name']);
if($name) {