Can now save Network Roles
This commit is contained in:
@@ -29,6 +29,16 @@ class AddressModel {
|
||||
}
|
||||
}
|
||||
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
|
||||
if($model->create_by === null) {
|
||||
$model->create_by = $me->id;
|
||||
}
|
||||
if($model->edit_by === null) {
|
||||
$model->edit_by = $me->id;
|
||||
}
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
@@ -90,47 +100,10 @@ class AddressModel {
|
||||
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 = 'Addresstype'";
|
||||
}
|
||||
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 = "";
|
||||
@@ -139,6 +112,7 @@ class AddressModel {
|
||||
$where .= " AND ( $or )";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($filter);exit;
|
||||
if(array_key_exists("parent_id", $filter)) {
|
||||
$parentid = $filter['parent_id'];
|
||||
|
||||
Reference in New Issue
Block a user