Skip to content
Snippets Groups Projects
Commit bec19d7d authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge remote branch 'upstream/develop-next' into develop-next

parents a8d1e0ec e5a5287b
Branches
Tags
No related merge requests found
......@@ -14,7 +14,8 @@ class TicketApiController extends ApiController {
"attachments" => array("*" =>
array("name", "type", "data", "encoding", "size")
),
"message", "ip", "priorityId"
"message", "ip", "priorityId",
"system_emails", "thread_entry_recipients"
);
# Fetch dynamic form field names for the given help topic and add
# the names to the supported request structure
......
......@@ -30,10 +30,6 @@ class Config {
# new settings and the corresponding default values.
var $defaults = array(); # List of default values
# Items
var $items = null;
function __construct($section=null, $defaults=array()) {
if ($section)
$this->section = $section;
......@@ -133,18 +129,11 @@ class Config {
function destroy() {
unset($this->session);
if ($this->items)
$this->items->delete();
return true;
return $this->items()->delete() > 0;
}
function items() {
if (!isset($this->items))
$this->items = ConfigItem::items($this->section, $this->section_column);
return $this->items;
return ConfigItem::items($this->section, $this->section_column);
}
}
......
......@@ -76,7 +76,7 @@ class Export {
->aggregate(array('count' => SqlAggregate::COUNT('entries__attachments__id'))),
'reopen_count' => TicketThread::objects()
->filter(array('ticket__ticket_id' => new SqlField('ticket_id', 1)))
->filter(array('events__annulled' => 0, 'events__state' => 'reopened'))
->filter(array('events__annulled' => 0, 'events__event_id' => Event::getIdByName('reopened')))
->aggregate(array('count' => SqlAggregate::COUNT('events__id'))),
'thread_count' => TicketThread::objects()
->filter(array('ticket__ticket_id' => new SqlField('ticket_id', 1)))
......
......@@ -1637,7 +1637,7 @@ extends QueueColumnAnnotation {
return $query->annotate(array(
$name => TicketThread::objects()
->filter(array('ticket__ticket_id' => new SqlField('ticket_id', 1)))
->filter(array('events__annulled' => 0, 'events__state' => 'reopened'))
->filter(array('events__annulled' => 0, 'events__event_id' => Event::getIdByName('reopened')))
->aggregate(array('count' => SqlAggregate::COUNT('events__id')))
));
}
......
......@@ -635,12 +635,11 @@ implements TemplateVariable, Searchable {
}
function deleteAllTickets() {
$event_id = Event::getIdByName('deleted');
$deleted = TicketStatus::lookup(array('event_id' => $event_id));
$status_id = TicketStatus::lookup(array('state' => 'deleted'));
foreach($this->tickets as $ticket) {
if (!$T = Ticket::lookup($ticket->getId()))
continue;
if (!$T->setStatus($deleted))
if (!$T->setStatus($status_id))
return false;
}
$this->tickets->reset();
......
......@@ -51,12 +51,12 @@ class CliUpgrader extends Module {
$cfg = $ost->getConfig();
while (true) {
if ($upgrader->getTask()) {
// If there's anythin in the model cache (like a Staff
// object or something), ensure that changes to the database
// model won't cause crashes
ModelInstanceManager::flushCache();
// If there's anythin in the model cache (like a Staff
// object or something), ensure that changes to the database
// model won't cause crashes
ModelInstanceManager::flushCache();
if ($upgrader->getTask()) {
// More pending tasks - doTasks returns the number of pending tasks
$this->stdout->write("... {$upgrader->getNextAction()}\n");
$upgrader->doTask();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment