Skip to content
Snippets Groups Projects
Commit d640fd34 authored by Robert Anderson's avatar Robert Anderson
Browse files

All AdminGroupAttributes fields for add, edit

parent 85cac08e
No related branches found
No related tags found
No related merge requests found
......@@ -337,6 +337,9 @@
$res->setID('ID');
$res->addField('ID','int');
$res->addField('Name','string');
$res->addField('Operator','string');
$res->addField('Value','string');
$res->addField('Disabled','boolean');
$res->parseHash($rawData);
echo json_encode($res->export());
......
......@@ -6,7 +6,18 @@ include_once("include/db.php");
function addAdminGroupAttribute($params) {
global $db;
$res = DBDo("INSERT INTO group_attributes (GroupID,Name) VALUES (?,?)",array($params[0]['GroupID'],$params[0]['Name']));
$res = DBDo("
INSERT INTO
group_attributes (GroupID,Name,Operator,Value,Disabled)
VALUES
(?,?,?,?,?)",
array( $params[0]['GroupID'],
$params[0]['Name'],
$params[0]['Operator'],
$params[0]['Value'],
$params[0]['Disabled'])
);
if (!is_numeric($res)) {
return $res;
}
......@@ -30,7 +41,14 @@ function removeAdminGroupAttribute($params) {
function updateAdminGroupAttribute($params) {
global $db;
$res = DBDo("UPDATE group_attributes SET Name = ? WHERE ID = ?",array($params[0]['Name'],$params[0]['ID']));
$res = DBDo("UPDATE group_attributes SET Name = ?, Operator = ?, Value = ?, Disabled = ? WHERE ID = ?",
array($params[0]['Name'],
$params[0]['Operator'],
$params[0]['Value'],
$params[0]['Disabled'],
$params[0]['ID'])
);
if (!is_numeric($res)) {
return $res;
}
......@@ -43,7 +61,7 @@ function getAdminGroupAttribute($params) {
global $db;
$res = DBSelect("SELECT ID, Name FROM group_attributes WHERE ID = ?",array($params[0]));
$res = DBSelect("SELECT ID, Name, Operator, Value, Disabled FROM group_attributes WHERE ID = ?",array($params[0]));
if (!is_object($res)) {
return $res;
}
......@@ -54,6 +72,9 @@ function getAdminGroupAttribute($params) {
$resultArray['ID'] = $row->id;
$resultArray['Name'] = $row->name;
$resultArray['Operator'] = $row->operator;
$resultArray['Value'] = $row->value;
$resultArray['Disabled'] = $row->disabled;
return $resultArray;
}
......
......@@ -154,7 +154,10 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
SOAPFunction: 'updateAdminGroupAttribute',
SOAPParams:
'0:ID,'+
'0:Name'
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
};
// We doing an Add
......@@ -164,7 +167,10 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
SOAPFunction: 'addAdminGroupAttribute',
SOAPParams:
'0:GroupID,'+
'0:Name'
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
};
}
......@@ -197,6 +203,21 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
maskRe: usernamePartRe,
allowBlank: false
},
{
fieldLabel: "Operator",
name: "Operator",
allowBlank: false
},
{
fieldLabel: "Value",
name: "Value",
allowBlank: false
},
{
xtype: 'checkbox',
fieldLabel: 'Disabled',
name: 'Disabled'
},
],
},
// Submit button config
......
......@@ -218,7 +218,6 @@ function showAdminUserAttributeAddEditWindow(userID,attrID) {
fieldLabel: 'Disabled',
name: 'Disabled'
},
],
},
// Submit button config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment