diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index 6c645b6f4..f228f4f75 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -31,7 +31,23 @@
">
- + + is("preorderfront")): ?> +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+
@@ -129,7 +148,7 @@ - + is("preorderfront")): ?> @@ -144,13 +163,13 @@ - + is("preorderfront")): ?>building_id): ?> adb_hausnummer_id): ?> - - + @@ -224,7 +245,7 @@ }, function(success) { if(success.status == "OK") { - attributeSuccess(success.result.id, success.result.attribute); + attributeSuccess(success.result); } else { attributeError(success.result.id, success.result.attribute); } @@ -236,11 +257,20 @@ }); }); - function attributeSuccess(id, attribute) { + function attributeSuccess(result) { + var id = result.id + var attribute = result.attribute + var update = result.update + $("#attributes_" + attribute + "-" + id).parent().removeClass("text-danger"); $("#attributes_" + attribute + "-" + id).parent().addClass("text-success"); + if(update) { + $("#update-" + id).text(update); + $("#update-" + id).addClass("text-success") + } setTimeout(function() { $("#attributes_" + attribute + "-" + id).parent().removeClass("text-success"); + $("#update-" + id).removeClass("text-success") }, 2000, id, attribute); } diff --git a/Layout/default/User/Form.php b/Layout/default/User/Form.php index 0a5fd586f..d95a99745 100644 --- a/Layout/default/User/Form.php +++ b/Layout/default/User/Form.php @@ -64,6 +64,13 @@ +
+ + +
diff --git a/Layout/default/menu.php b/Layout/default/menu.php index f25295d89..643e03288 100644 --- a/Layout/default/menu.php +++ b/Layout/default/menu.php @@ -4,122 +4,135 @@ diff --git a/application/Dashboard/DashboardController.php b/application/Dashboard/DashboardController.php index da9f03ee7..9853a10ba 100644 --- a/application/Dashboard/DashboardController.php +++ b/application/Dashboard/DashboardController.php @@ -11,8 +11,14 @@ class DashboardController extends mfBaseController { } protected function indexAction() { + + if($this->me->is("preorderfront")) { + $this->redirect("Preorder"); + } + $newss = NewsModel::getAll(); $this->layout()->set("newss", $newss); + } diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 64530d74e..e6451f67d 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -106,6 +106,11 @@ class PreorderController extends mfBaseController { $new_filter['add-where'] .= " AND (adb_hausnummer.gemeinde like '%$address%' OR adb_hausnummer.plz like '%$address%' OR adb_hausnummer.strasse like '%$address%')"; } + if(array_key_exists("hausnummer", $filter)) { + $hausnummer = $this->db()->escape($filter['hausnummer']); + $new_filter['hausnummer'] = $hausnummer; + } + if(array_key_exists("kunde", $filter)) { $kunde = $this->db()->escape($filter['kunde']); $new_filter['add-where'] .= " AND (company like '%$kunde%' OR firstname like '%$kunde%' OR lastname like '%$kunde%' OR street like '%$kunde%' OR zip like '%$kunde%' OR city like '%$kunde%')"; @@ -638,7 +643,7 @@ class PreorderController extends mfBaseController { $attribs[$attribute] = $value ? 1 : 0; $preorder->attributes = json_encode($attribs); if($preorder->save()) { - return ["id" => $preorder_id, "attribute" => $attribute]; + return ["id" => $preorder_id, "attribute" => $attribute, "update" => date("d.m.Y H:i", $preorder->edit)]; } else { $this->returnJson(["status" => "error", "result" => ["id" => $preorder_id, "attribute" => $attribute]]); } diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index f22b93bab..9564c1695 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -217,6 +217,7 @@ class PreorderModel { $where = self::getSqlFilter($filter); $sql = "SELECT COUNT(*) as cnt FROM `".FRONKDB_DBNAME."`.Preorder tt_preorder + LEFT JOIN `".FRONKDB_DBNAME."`.Preorderstatus tt_preorderstatus ON (tt_preorder.status_id = tt_preorderstatus.id) LEFT JOIN `".ADDRESSDB_DBNAME."`.view_hausnummer as adb_hausnummer ON (tt_preorder.adb_hausnummer_id = adb_hausnummer.hausnummer_id) WHERE $where "; @@ -443,6 +444,13 @@ class PreorderModel { } } + if(array_key_exists("hausnummer", $filter)) { + $hausnummer = FronkDB::singleton()->escape($filter['hausnummer']); + if($hausnummer) { + $where .= " AND adb_hausnummer.hausnummer like '%$hausnummer%'"; + } + } + if(array_key_exists("attributes", $filter)) { $attributes = FronkDB::singleton()->escape($filter['attributes']); if(is_array($attributes) && count($attributes)) { diff --git a/application/User/UserController.php b/application/User/UserController.php index e5cc98f9b..be0e617fb 100644 --- a/application/User/UserController.php +++ b/application/User/UserController.php @@ -178,6 +178,12 @@ class UserController extends mfBaseController { $user->permissions->technician = "false"; } + if($r->preorderfront == "true") { + $user->permissions->preorderfront = "true"; + } else { + $user->permissions->preorderfront = "false"; + } + $user->permissions->save(); } diff --git a/application/WorkerPermission/WorkerPermission.php b/application/WorkerPermission/WorkerPermission.php index 51307fac2..8467a9457 100644 --- a/application/WorkerPermission/WorkerPermission.php +++ b/application/WorkerPermission/WorkerPermission.php @@ -4,6 +4,7 @@ class WorkerPermission extends mfBaseModel { public $isAdmin = false; public $isTicketadmin = false; public $isTechnician = false; + public $isPreorderfront = false; public function loadByUserId($userid) { $res = $this->db->select($this->table,"*","worker_id=$userid"); @@ -29,6 +30,9 @@ class WorkerPermission extends mfBaseModel { if($this->technician == 'true') { $this->isTechnician = true; } + if($this->preorderfront == 'true') { + $this->isPreorderfront= true; + } } } \ No newline at end of file
KampagneKampagne Bestelltyp Status Anschlussadresse
campaign->name?>campaign->name?> type, "preorder")?> Aufgenommen building->street?>
building->zip?> building->city?>
address_created) ? "class='alert-warning' title='Manuell angelegt'" : ""?>"> + address_created) ? "class='alert-warning' title='Adresse manuell angelegt'" : ""?>"> adb_hausnummer->strasse->name?> adb_hausnummer->hausnummer?>
adb_wohneinheit_id) ? ((string)$preorder->adb_wohneinheit ? $preorder->adb_wohneinheit."
" : "") : "<keine Wohneinheit>
"?> @@ -178,10 +197,12 @@
create)?>edit)?>edit)?> + is("preorderfront")): ?> $preorder->id])?>"> $preorder->id, "filter" => $filter])?>" class="text-danger" onclick="if(!confirm('Vorbestellung wirklich löschen?')) return false;" title="Vorbestellung Löschen"> +