Skip to content
Snippets Groups Projects
Commit b6c9d9bb authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #1396 from protich/issue/custom-ticket-status


bug: Custom ticket statuses

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 209379c9 871d8b38
No related branches found
No related tags found
No related merge requests found
...@@ -109,10 +109,15 @@ abstract class CustomListHandler { ...@@ -109,10 +109,15 @@ abstract class CustomListHandler {
return $rv; return $rv;
} }
function __get($field) {
return $this->_list->{$field};
}
function update($vars, &$errors) { function update($vars, &$errors) {
return $this->_list->update($vars, $errors); return $this->_list->update($vars, $errors);
} }
abstract function getListOrderBy();
abstract function getNumItems(); abstract function getNumItems();
abstract function getAllItems(); abstract function getAllItems();
abstract function getItems($criteria); abstract function getItems($criteria);
...@@ -334,6 +339,7 @@ class DynamicList extends VerySimpleModel implements CustomList { ...@@ -334,6 +339,7 @@ class DynamicList extends VerySimpleModel implements CustomList {
$this->set('updated', new SqlFunction('NOW')); $this->set('updated', new SqlFunction('NOW'));
if (isset($this->dirty['notes'])) if (isset($this->dirty['notes']))
$this->notes = Format::sanitize($this->notes); $this->notes = Format::sanitize($this->notes);
return parent::save($refetch); return parent::save($refetch);
} }
...@@ -656,6 +662,14 @@ class TicketStatusList extends CustomListHandler { ...@@ -656,6 +662,14 @@ class TicketStatusList extends CustomListHandler {
var $_items; var $_items;
var $_form; var $_form;
function getListOrderBy() {
switch ($this->getSortMode()) {
case 'Alpha': return 'name';
case '-Alpha': return '-name';
case 'SortCol': return 'sort';
}
}
function getNumItems() { function getNumItems() {
return TicketStatus::objects()->count(); return TicketStatus::objects()->count();
} }
...@@ -774,8 +788,6 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { ...@@ -774,8 +788,6 @@ class TicketStatus extends VerySimpleModel implements CustomListItem {
const ENABLED = 0x0001; const ENABLED = 0x0001;
const INTERNAL = 0x0002; // Forbid deletion or name and status change. const INTERNAL = 0x0002; // Forbid deletion or name and status change.
function __construct() { function __construct() {
call_user_func_array(array('parent', '__construct'), func_get_args()); call_user_func_array(array('parent', '__construct'), func_get_args());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment