Can now save Network Roles
This commit is contained in:
@@ -67,13 +67,12 @@ class AddresstypeModel {
|
||||
|
||||
public static function getFirst($filter) {
|
||||
$db = FronkDB::singleton();
|
||||
$log = mfLoghandler::singleton();
|
||||
$log->debug(print_r($filter,true));
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT Addresstype.* FROM Addresstype
|
||||
WHERE $where
|
||||
ORDER BY address_id ASC, `primary` DESC, type ASC";
|
||||
$log->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
@@ -118,47 +117,10 @@ class AddresstypeModel {
|
||||
if(is_array($filter['addresstype']) && count($filter['addresstype'])) {
|
||||
$at = $filter['addresstype'];
|
||||
$in = [];
|
||||
if(in_array("systemowner", $at)) {
|
||||
$in[] = "Addresstype.type = 'systemowner'";
|
||||
}
|
||||
if(in_array("netowner", $at)) {
|
||||
$in[] = "Addresstype.type = 'netowner'";
|
||||
}
|
||||
if(in_array("salespartner", $at)) {
|
||||
$in[] = "Addresstype.type = 'salespartner'";
|
||||
}
|
||||
if(in_array("pipeworker", $at)) {
|
||||
$in[] = "Addresstype.type = 'pipeworker'";
|
||||
}
|
||||
if(in_array("lineworker", $at)) {
|
||||
$in[] = "Addresstype.type = 'lineworker'";
|
||||
}
|
||||
if(in_array("pipeplanner", $at)) {
|
||||
$in[] = "Addresstype.type = 'pipeplanner'";
|
||||
}
|
||||
if(in_array("lineplanner", $at)) {
|
||||
$in[] = "Addresstype.type = 'lineplanner'";
|
||||
}
|
||||
if(in_array("netoperator", $at)) {
|
||||
$in[] = "Addresstype.type = 'netoperator'";
|
||||
}
|
||||
if(in_array("support", $at)) {
|
||||
$in[] = "Addresstype.type = 'support'";
|
||||
}
|
||||
if(in_array("billing", $at)) {
|
||||
$in[] = "Addresstype.type = 'billing'";
|
||||
}
|
||||
if(in_array("employee", $at)) {
|
||||
$in[] = "Addresstype.type = 'employee'";
|
||||
}
|
||||
if(in_array("customer", $at)) {
|
||||
$in[] = "Addresstype.type = 'customer'";
|
||||
}
|
||||
if(in_array("supplier", $at)) {
|
||||
$in[] = "Addresstype.type = 'supplier'";
|
||||
}
|
||||
if(in_array("contact", $at)) {
|
||||
$in[] = "Addresstype.type = 'contact'";
|
||||
foreach(TT_ROLES as $role) {
|
||||
if(in_array($role, $at)) {
|
||||
$in[] = "Addresstype.type = '$role'";
|
||||
}
|
||||
}
|
||||
|
||||
$or = "";
|
||||
|
||||
Reference in New Issue
Block a user