Keep filter after saving patching
This commit is contained in:
@@ -157,15 +157,28 @@ class PatchingController extends mfBaseController {
|
||||
|
||||
|
||||
$patch_data["linework_port"] = $r->linework_port;
|
||||
$patch_data["device_type"] = $r->device_type;
|
||||
$patch_data["device_name"] = $r->device_name;
|
||||
$patch_data["device_port"] = $r->device_port;
|
||||
$patch_data["patched"] = ($r->patched == "1") ? 1 : 0;
|
||||
|
||||
if(strlen($patch_data["device_type"])) {
|
||||
$patch_data["device_type"] = $r->device_type;
|
||||
} else {
|
||||
$patch_data["device_type"] = null;
|
||||
}
|
||||
|
||||
if($mode == "add") {
|
||||
$patch_data['create_by'] = 1;
|
||||
$patching = PatchingModel::create($patch_data);
|
||||
if($patch_data["patched"]) {
|
||||
$patch_data["patched_by"] = $this->me->id;
|
||||
$patch_data["patched_date"] = date("U");
|
||||
}
|
||||
} else {
|
||||
if($patch_data["patched"] && !$patchind->patched) {
|
||||
$patch_data["patched_by"] = $this->me->id;
|
||||
$patch_data["patched_date"] = date("U");
|
||||
}
|
||||
$patching->update($patch_data);
|
||||
}
|
||||
|
||||
@@ -175,8 +188,19 @@ class PatchingController extends mfBaseController {
|
||||
return $this->indexAction();
|
||||
}
|
||||
|
||||
$sq = "";
|
||||
$query = [];
|
||||
if(is_numeric($this->request->s) && $this->request->s > 0) {
|
||||
$query["s"] = $this->request->s;
|
||||
}
|
||||
if (is_array($this->request->filter)) {
|
||||
$query["filter"] = $this->request->filter;
|
||||
}
|
||||
|
||||
$qs = http_build_query($query);
|
||||
|
||||
$this->layout()->setFlash("Patchung erfolgreich gespeichert.", "success");
|
||||
$this->redirect("Patching", "Index");
|
||||
$this->redirect("Patching","Index", $qs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user