Preorder: Status can now be changed manually
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user