diff --git a/webui/controller/search/remove.php b/webui/controller/search/remove.php index 80443226..a1512281 100644 --- a/webui/controller/search/remove.php +++ b/webui/controller/search/remove.php @@ -19,7 +19,9 @@ class ControllerSearchRemove extends Controller { $this->load->model('search/message'); $this->load->model('user/user'); - $this->data['terms'] = $this->model_search_search->remove_search_terms(); + if(isset($this->request->get['ts'])) { + $this->data['terms'] = $this->model_search_search->remove_search_term($this->request->get['ts']); + } } } diff --git a/webui/model/health/health.php b/webui/model/health/health.php index af52c483..ff124422 100644 --- a/webui/model/health/health.php +++ b/webui/model/health/health.php @@ -90,9 +90,9 @@ class ModelHealthHealth extends Model { if(isset($p[5]) && in_array($p[5], $partitions)) { $shortinfo[] = array( 'partition' => $p[5], - 'freespace' => nice_size(1000*$p[3]), - 'total' => nice_size(1000*$p[1]), - 'used' => nice_size(1000*$p[2]), + 'freespace' => $p[3], + 'total' => $p[1], + 'used' => $p[2], 'utilization' => preg_replace("/\%/", "", $p[4]) ); } diff --git a/webui/model/saas/customer.php b/webui/model/saas/customer.php index ad88b28e..5b21d505 100644 --- a/webui/model/saas/customer.php +++ b/webui/model/saas/customer.php @@ -142,6 +142,8 @@ class ModelSaasCustomer extends Model public function get_online_users() { + $query = $this->db->query("DELETE FROM " . TABLE_ONLINE . " WHERE last_activity < ?", array(NOW - 3600)); + $query = $this->db->query("SELECT * FROM " . TABLE_ONLINE . " ORDER BY username ASC"); return $query->rows; diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 4baf5ef2..4e98a084 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -269,7 +269,7 @@ class ModelSearchSearch extends Model { $data['any'] = $this->fixup_sphinx_operators($data['any']); $data['any'] = $this->fix_email_address_for_sphinx($data['any']); $fields = ''; - if($match) { $match = "($match) & "; $fields = '@subject,@body '; } $match .= "($fields " . $data['any'] . ") "; + if($match) { $match = "($match) & "; } $match .= "(@subject " . $data['any'] . " | @body " . $data['any'] . ") "; } @@ -759,7 +759,7 @@ class ModelSearchSearch extends Model { public function get_search_terms() { - $query = $this->db->query("SELECT term FROM " . TABLE_SEARCH . " WHERE email=? ORDER BY ts DESC", array($_SESSION['email'])); + $query = $this->db->query("SELECT term, ts FROM " . TABLE_SEARCH . " WHERE email=? ORDER BY ts DESC", array($_SESSION['email'])); if(isset($query->rows)) { return $query->rows; } return array(); @@ -792,8 +792,8 @@ class ModelSearchSearch extends Model { } - public function remove_search_terms() { - $query = $this->db->query("DELETE FROM " . TABLE_SEARCH . " WHERE email=?", array($_SESSION['email'])); + public function remove_search_term($ts = 0) { + $query = $this->db->query("DELETE FROM " . TABLE_SEARCH . " WHERE email=? AND ts=?", array($_SESSION['email'], $ts)); } diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 44d26773..aff6cda1 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -221,17 +221,15 @@ var Piler = }, - remove_saved_search_terms:function(msg) + remove_saved_search_term:function(ts) { - Piler.log("[load_saved_search_terms]"); + Piler.log("[remove_saved_search_term]"); - jQuery.ajax('/index.php?route=search/remove', {}) - .done(function(a) { - $('#mailcontframe').html(a); - }) + jQuery.ajax('/index.php?route=search/remove&ts=' + ts, {}) + .done(function(a) {}) .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); - Piler.show_message('messagebox1', msg, 0.85); + Piler.load_saved_search_terms(); }, @@ -949,6 +947,19 @@ var Piler = reload_page: function() { location.reload(true); + }, + + + go_to_default_page: function() + { + document.location.href = 'search.php'; + }, + + + change_box_colour: function() + { + var colour = $('#colour').val(); + $('#cp').css('background', colour); } diff --git a/webui/view/theme/default/templates/common/layout-search.tpl b/webui/view/theme/default/templates/common/layout-search.tpl index 97e47e1b..ac19f6bd 100644 --- a/webui/view/theme/default/templates/common/layout-search.tpl +++ b/webui/view/theme/default/templates/common/layout-search.tpl @@ -63,7 +63,6 @@
diff --git a/webui/view/theme/default/templates/customer/list.tpl b/webui/view/theme/default/templates/customer/list.tpl index 69fe24de..4c58091d 100644 --- a/webui/view/theme/default/templates/customer/list.tpl +++ b/webui/view/theme/default/templates/customer/list.tpl @@ -47,7 +47,7 @@