mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 23:11:59 +01:00
reintroduced the load saved searches feature
This commit is contained in:
parent
fd27d17d24
commit
5b96cd06ca
@ -257,6 +257,21 @@ create table if not exists `folder_user` (
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `folder_extra` (
|
||||
`id` int unsigned not null auto_increment,
|
||||
`uid` int unsigned not null,
|
||||
`name` char(64) not null,
|
||||
unique(uid, name)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `folder_message` (
|
||||
folder_id bigint not null,
|
||||
id bigint not null,
|
||||
unique(folder_id, id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `note` (
|
||||
`_id` bigint unsigned auto_increment not null,
|
||||
`id` bigint unsigned not null,
|
||||
|
@ -25,6 +25,18 @@ create table if not exists `folder_user` (
|
||||
key `folder_user_idx2` (`uid`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
create table if not exists `folder_extra` (
|
||||
`id` int unsigned not null auto_increment,
|
||||
`uid` int unsigned not null,
|
||||
`name` char(64) not null,
|
||||
unique(uid, name)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
create table if not exists `folder_message` (
|
||||
folder_id bigint not null,
|
||||
id bigint not null,
|
||||
unique(folder_id, id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
create table if not exists `note` (
|
||||
`_id` bigint unsigned auto_increment not null,
|
||||
|
@ -90,6 +90,8 @@ define('TABLE_GROUP_USER', 'group_user');
|
||||
define('TABLE_GROUP_EMAIL', 'group_email');
|
||||
define('TABLE_FOLDER', 'folder');
|
||||
define('TABLE_FOLDER_USER', 'folder_user');
|
||||
define('TABLE_FOLDER_EXTRA', 'folder_extra');
|
||||
define('TABLE_FOLDER_MESSAGE', 'folder_message');
|
||||
define('TABLE_EMAIL', 'email');
|
||||
define('TABLE_META', 'metadata');
|
||||
define('TABLE_ATTACHMENT', 'attachment');
|
||||
|
32
webui/controller/search/load.php
Normal file
32
webui/controller/search/load.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerSearchLoad extends Controller {
|
||||
private $error = array();
|
||||
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "search/load.tpl";
|
||||
$this->layout = "common/layout-empty";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('search/search');
|
||||
$this->load->model('search/message');
|
||||
$this->load->model('user/user');
|
||||
|
||||
if($this->data['hits_to'] > $this->data['n']) { $this->data['hits_to'] = $this->data['n']; }
|
||||
|
||||
$this->data['terms'] = $this->model_search_search->get_search_terms();
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -105,6 +105,26 @@ function load_search_results(url, params, page) {
|
||||
}
|
||||
|
||||
|
||||
function load_saved_search_terms(url) {
|
||||
var http = getXMLHttp();
|
||||
|
||||
if(http == null) { alert("Error creating XMLHttpRequest"); return; }
|
||||
|
||||
http.onreadystatechange = function() {
|
||||
if(http.readyState == 4) {
|
||||
if(http.status == 200) document.getElementById('mailcontframe').innerHTML = http.responseText;
|
||||
else alert("Problem retrieving XML data:" + http.statusText);
|
||||
}
|
||||
}
|
||||
|
||||
http.open("GET", url, true);
|
||||
http.send(null);
|
||||
|
||||
document.body.style.cursor = 'default';
|
||||
|
||||
}
|
||||
|
||||
|
||||
function load_audit_results(url, params, page) {
|
||||
|
||||
document.getElementById('AS').innerHTML = '<img src="/view/theme/default/images/spinner.gif" id="spinner" alt="spinner" />';
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#main { margin: 0px 40px 20px 40px; width: 990px; float: left; clear: both; }
|
||||
|
||||
.aoo { cursor: pointer; position: absolute; left: 915px; top: 0px; width: 10px; margin-left: -5px; }
|
||||
.aoo { cursor: pointer; position: absolute; left: 845px; top: 0px; width: 10px; margin-left: -5px; }
|
||||
.aoq { height: 4px; padding: 11px 5px; width: 7px; background: url("/view/theme/default/images/dark-grey-disclosure-arrow-down.png") no-repeat scroll center center transparent; }
|
||||
|
||||
|
||||
|
@ -93,7 +93,7 @@
|
||||
|
||||
<span style="font-weight: bold;"><?php print $text_search; ?>:</span>
|
||||
|
||||
<input type="text" id="_search" name="_search" class="advtext<?php if(!isset($_search)) { ?>grey<?php } ?>" style="width: 500px;margin: 0px;" value="<?php if(isset($_search)) { print $_search; } else { print $text_enter_search_terms; ?>" onclick="if(expsrc==0){this.value=''; this.className = 'advtext'; expsrc++;}<?php } ?>" />
|
||||
<input type="text" id="_search" name="_search" class="advtext<?php if(!isset($_search)) { ?>grey<?php } ?>" style="width: 528px;margin: 0px;" value="<?php if(isset($_search)) { print $_search; } else { print $text_enter_search_terms; ?>" onclick="if(expsrc==0){this.value=''; this.className = 'advtext'; expsrc++;}<?php } ?>" />
|
||||
|
||||
<div class="aoo" onclick="javascript: document.getElementById('searchpopup1').style.display = ''; return false;">
|
||||
<div class="aoq"></div>
|
||||
@ -102,6 +102,7 @@
|
||||
<button id="button_search" class="active" style="margin-left: 10px; margin-right: 0px; height: 20px; width: 70px;" onclick="script:var a=document.getElementById('ref'); if(a) a.value=''; load_search_results('<?php print SEARCH_HELPER_URL; ?>', assemble_search_term(count, ''), 0);"><?php print $text_search; ?></button>
|
||||
<input type="button" class="advsecondary" style="height: 20px; width: 70px;" onclick="javascript:var a=document.getElementById('_search'); a.value=''; a = document.getElementById('ref'); a.value=''; return false;" value="<?php print $text_cancel; ?>" />
|
||||
<input type="button" class="advsecondary" style="height: 20px; width: 70px;" value="<?php print $text_save; ?>" onclick="javascript:send_ajax_post_request('<?php print SAVE_SEARCH_URL; ?>', assemble_search_term(0, '') + '&save=1'); show_message('messagebox1', '<p><?php print $text_saved; ?></p>', 0.85);" />
|
||||
<input type="button" class="advsecondary" style="height: 20px; width: 70px;" value="<?php print $text_load; ?>" onclick="javascript:load_saved_search_terms('<?php print LOAD_SAVED_SEARCH_URL; ?>');" />
|
||||
|
||||
|
||||
<?php print $popup; ?>
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
<?php foreach ($extra_folders as $folder) { ?>
|
||||
<blockquote style="border: 0px solid red; margin: 0 0 5px 10px;">
|
||||
<img src="<?php print ICON_EMPTY; ?>" width="12" height="12" alt="" /> <input type="checkbox" id="extra_folder_<?php print $folder['id']; ?>" name="extra_folder_<?php print $folder['id']; ?>" /> <span style="color: blue; font-weight: bold;" onmouseover="javascript: copy_message_to_folder('<?php print $folder['id']; ?>', current_message_id); return false;"><?php print $folder['name']; ?>
|
||||
<img src="<?php print ICON_EMPTY; ?>" width="12" height="12" alt="" /> <input type="checkbox" id="extra_folder_<?php print $folder['id']; ?>" name="extra_folder_<?php print $folder['id']; ?>" /> <span style="color: blue; font-weight: bold;" onmouseover="javascript: copy_message_to_folder('<?php print $folder['id']; ?>', current_message_id, '<?php print $text_copied; ?>'); return false;"><?php print $folder['name']; ?>
|
||||
</blockquote>
|
||||
<?php } ?>
|
||||
|
||||
|
30
webui/view/theme/default/templates/search/load.tpl
Normal file
30
webui/view/theme/default/templates/search/load.tpl
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
<div id="messagelistcontainer" class="boxlistcontent" style="top:0">
|
||||
|
||||
<div id="results">
|
||||
|
||||
<div class="resultrow">
|
||||
<?php if(count($terms) > 0){ ?>
|
||||
|
||||
<?php } else if(count($terms) == 0) { ?>
|
||||
<div class="cell3 error"><?php print $text_empty_search_result; ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php foreach($terms as $term) {
|
||||
parse_str($term['term'], $s);
|
||||
?>
|
||||
<div class="resultrow">
|
||||
<a href="#" onclick="javascript:load_search_results('<?php print SEARCH_HELPER_URL; ?>', '<?php print $term['term']; ?>', 0); var a=document.getElementById('_search'); var v=decodeURIComponent('<?php print urlencode($s['search']); ?>'); v = v.replace(/\+/g, ' '); a.value=v; "><?php print $s['search']; ?></a></br />
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
//print_r($terms);
|
||||
|
||||
?>
|
@ -1,4 +1,4 @@
|
||||
<div id="searchpopup1" style="position: absolute; top: 22px; right: 233px; border: 1px solid #999999; display: none; background: #f8f8f8; color: #000000; font-weight: bold; padding: 15px; z-index: 1;">
|
||||
<div id="searchpopup1" style="position: absolute; top: 22px; right: 303px; border: 1px solid #999999; display: none; background: #f8f8f8; color: #000000; font-weight: bold; padding: 15px; z-index: 1;">
|
||||
|
||||
<input type="hidden" name="xsearchtype" id="xsearchtype" value="simple" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user