Skip to content
Snippets Groups Projects
Commit ef4dce88 authored by Tim Steiner's avatar Tim Steiner
Browse files

Basic support for customizing which decisions are available to each approval action.

parent 6d6c7126
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,19 @@ class Requests_ApprovalActionModel extends Unl_Model
$object->_data = array_merge($object->_data, $record);
}
$select = new Zend_Db_Select($db);
$select->from(array('o' => 'creqApprovalActionsOptions'));
if (Unl_Util::isArray($id)) {
$select->where('o.approvalActionId IN (?)', $id);
} else {
$select->where('o.approvalActionId = ?', $id);
}
$records = $select->query()->fetchAll();
foreach ($records as $record) {
$objects[$record['approvalActionId']]->_data['options'][$record['approvalActionsOptionId']] = $record['name'];
}
if (Unl_Util::isArray($id)) {
return $objects;
} else {
......@@ -241,7 +254,16 @@ class Requests_ApprovalActionModel extends Unl_Model
public function getResultStatusStrings()
{
return self::getDefaultStatusStrings();
if (Unl_Util::isArray($this->_data['options'])) {
$optinos = array();
foreach ($this->_data['options'] as $option)
{
$options[$option] = $option;
}
} else {
$options = self::getDefaultStatusStrings();
}
return $options;
}
public function getCurrentApprovalBody()
......
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