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

Merge remote branch 'upstream/develop' into develop

parents 9ae093da c4669d77
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,7 @@ class UsersAjaxAPI extends AjaxController {
'emails__address__contains' => $q,
'name__contains' => $q,
'org__name__contains' => $q,
'cdata__phone__contains' => $q,
)));
}
......
......@@ -51,6 +51,11 @@ class Cron {
AttachmentFile::deleteOrphans();
}
function CleanExpiredSessions() {
require_once(INCLUDE_DIR.'class.ostsession.php');
DbSessionBackend::cleanup();
}
function MaybeOptimizeTables() {
// Once a week on a 5-minute cron
$chance = rand(1,2000);
......@@ -100,6 +105,7 @@ class Cron {
self::MailFetcher();
self::TicketMonitor();
self::PurgeLogs();
self::CleanExpiredSessions();
// Run file purging about every 10 cron runs
if (mt_rand(1, 9) == 4)
self::CleanOrphanedFiles();
......
......@@ -158,6 +158,10 @@ abstract class SessionBackend {
return $this->update($id, $i['touched'] ? session_encode() : $data);
}
function cleanup() {
$this->gc(0);
}
abstract function read($id);
abstract function update($id, $data);
abstract function destroy($id);
......@@ -220,6 +224,10 @@ extends SessionBackend {
return SessionData::objects()->filter(['session_id' => $id])->delete();
}
function cleanup() {
self::gc(0);
}
function gc($maxlife){
SessionData::objects()->filter([
'session_expire__lte' => SqlFunction::NOW()
......
......@@ -1246,6 +1246,8 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
$thisstaff);
}
$this->updated = SqlFunction::NOW();
if ($changes)
$this->logEvent('edited', array('fields' => $changes));
......
......@@ -268,7 +268,7 @@ if ($task->isOverdue())
<?php
foreach ($actions as $action) {?>
<span class="action-button <?php echo $action['class'] ?: ''; ?>">
<a class="task-action"
<a class="<?php echo ($action['class'] == 'no-pjax') ? '' : 'task-action'; ?>"
<?php
if ($action['dialog'])
echo sprintf("data-dialog-config='%s'", $action['dialog']);
......
......@@ -14,6 +14,7 @@ if ($_REQUEST['query']) {
'emails__address__contains' => $search,
'name__contains' => $search,
'org__name__contains' => $search,
'cdata__phone__contains' => $search,
// TODO: Add search for cdata
)));
$qs += array('query' => $_REQUEST['query']);
......
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