datatables-std.css für Standard DT erstellt
datatables-std.js für Standard DT erstellt zugewiesen an: Device,Devicetype,Devicemanufactor,Pop,Filestore Pop Detail Ansicht erstellt Filestore auf DT umgebaut Bugfixing: * Bearbeiten aus verschiedenen Ansichten werden nun richtig zurückgeleitet (Devices/Pops) * Sortierung Devicetype in Devices wurde nun per Arraysort durchgeführt
This commit is contained in:
@@ -93,13 +93,11 @@ class DeviceController extends mfBaseController
|
||||
$data = [];
|
||||
$data['name'] = trim($r->name);
|
||||
$data['devicetype_id'] = $r->devicetype_id;
|
||||
|
||||
if (empty(trim($r->pop_id))) {
|
||||
if (trim($r->pop_id)=="0") {
|
||||
$data['pop_id'] = NULL;
|
||||
} else {
|
||||
$data['pop_id'] = $r->pop_id;
|
||||
}
|
||||
|
||||
$data['ip'] = $r->ip;
|
||||
$data['mac'] = $r->mac;
|
||||
$data['serial'] = $r->serial;
|
||||
@@ -139,11 +137,38 @@ class DeviceController extends mfBaseController
|
||||
$this->layout()->setFlash("Device konnte nicht angelegt werden", "error");
|
||||
$this->redirect("Device");
|
||||
}
|
||||
$returnUrl="Device";
|
||||
$returnAction = "Index";
|
||||
$returnVariables = array();
|
||||
$returnAnker = "";
|
||||
if ($this->request->returnto) {
|
||||
|
||||
if (strpos($this->request->returnto, "-") !== false) {
|
||||
$urls = explode('-', $this->request->returnto);
|
||||
$urlCounter = 0;
|
||||
$returnUrlGen = "";
|
||||
foreach ($urls as $url) {
|
||||
if ($urlCounter > 0) {
|
||||
$returnUrlGen .= "/";
|
||||
}
|
||||
$returnUrlGen .= ucfirst($url);
|
||||
$urlCounter++;
|
||||
}
|
||||
$returnAction = "";
|
||||
$returnVariables['id'] = $id;
|
||||
$returnUrl = $returnUrlGen;
|
||||
} else {
|
||||
$returnUrl = ucfirst($this->request->returnto);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($mode == "edit") {
|
||||
$this->layout()->setFlash("Device erfolgreich geändert", "success");
|
||||
} else if ($mode = "add") {
|
||||
$this->layout()->setFlash("Device erfolgreich angelegt", "success");
|
||||
}
|
||||
$this->redirect("Device");
|
||||
$this->redirect($returnUrl, $returnAction, $returnVariables, $returnAnker);
|
||||
}
|
||||
}
|
||||
@@ -100,9 +100,8 @@ class DeviceModel
|
||||
public static function search($filter) {
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$res = $db->select("Device", "*", "$where ORDER BY name, network_id");
|
||||
$res = $db->select("Device", "*", "$where ORDER BY name");
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new Device($data);
|
||||
@@ -115,10 +114,10 @@ class DeviceModel
|
||||
$where = "1=1 ";
|
||||
|
||||
//var_dump($filter);exit;
|
||||
if(array_key_exists("network_id", $filter)) {
|
||||
$networkid = $filter['network_id'];
|
||||
if(is_numeric($networkid)) {
|
||||
$where .= " AND network_id=$networkid";
|
||||
if(array_key_exists("pop_id", $filter)) {
|
||||
$popid = $filter['pop_id'];
|
||||
if(is_numeric($popid)) {
|
||||
$where .= " AND pop_id=$popid";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user