Refactored advanced search to modal popup

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-03-10 18:31:37 +01:00
parent aee8db1b96
commit f22cd3daaa
7 changed files with 95 additions and 121 deletions

View File

@ -17,13 +17,9 @@ class ControllerCommonLayoutAuditRemoval extends Controller {
$this->children = array( $this->children = array(
"common/menu", "common/menu",
"search/folder", "search/folder",
"search/popup",
"common/footer" "common/footer"
); );
$this->render(); $this->render();
} }
} }

View File

@ -17,7 +17,6 @@ class ControllerCommonLayoutAudit extends Controller {
$this->children = array( $this->children = array(
"common/menu", "common/menu",
"search/folder", "search/folder",
"search/popup",
"common/footer" "common/footer"
); );

View File

@ -19,7 +19,6 @@ class ControllerCommonLayoutSearch extends Controller {
$this->children = array( $this->children = array(
"common/menu", "common/menu",
"search/folder", "search/folder",
"search/popup",
"common/footer" "common/footer"
); );

View File

@ -1,17 +0,0 @@
<?php
class ControllerSearchPopup extends Controller {
protected function index() {
$this->id = "popup";
$this->template = "search/popup.tpl";
$this->render();
}
}
?>

View File

@ -357,6 +357,13 @@ var Piler =
}, },
show_advanced_search_modal:function()
{
Piler.log("[show_advanced_search_modal]");
$('#advancedsearch-modal').modal('show');
},
show_bulk_remove_modal:function() show_bulk_remove_modal:function()
{ {
Piler.log("[show_bulk_remove_modal]"); Piler.log("[show_bulk_remove_modal]");
@ -693,7 +700,7 @@ var Piler =
// a = $( a );// a == DOM element // a = $( a );// a == DOM element
// a = Piler.getSource( a );// a == Javascript event // a = Piler.getSource( a );// a == Javascript event
var z = $('div#searchpopup1'); var z = $('div#advancedsearch-modal');
Piler.search = 'Complex'; Piler.search = 'Complex';
@ -730,8 +737,6 @@ var Piler =
$('input#_search').val(''); $('input#_search').val('');
Piler.load_search_results(); Piler.load_search_results();
$('#searchpopup1').hide();
}, },

View File

@ -49,6 +49,88 @@
</div> </div>
</div> </div>
<div id="advancedsearch-modal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" role="dialog" aria-hidden="true"><i class="icon-remove"></i></button>
<h3><?php print $text_advanced_search; ?></h3>
</div>
<div class="modal-body">
<input type="hidden" name="xsearchtype" id="xsearchtype" value="simple" />
<input type="hidden" name="xsort" id="xsort" value="date" />
<input type="hidden" name="xorder" id="xorder" value="0" />
<input type="hidden" name="xref" id="xref" value="" />
<table class="table">
<tr>
<td><?php print $text_from; ?></td>
<td><input type="text" name="xfrom" id="xfrom" value="" /></td>
</tr>
<tr>
<td><?php print $text_to; ?></td>
<td><input type="text" name="xto" id="xto" value="<?php if(isset($to)) { print $to; } ?>" /></td>
</tr>
<tr>
<td><?php print $text_subject; ?></td>
<td><input type="text" name="xsubject" id="xsubject" value="<?php if(isset($subject)) { print $subject; } ?>" /></td>
</tr>
<tr>
<td><?php print $text_body; ?></td>
<td><input type="text" name="xbody" id="xbody" value="<?php if(isset($body)) { print $body; } ?>" /></td>
</tr>
<tr>
<td><?php print $text_tags; ?></td>
<td><input type="text" name="xtag" id="xtag" value="<?php if(isset($tag)) { print $tag; } ?>" /></td>
</tr>
<tr>
<td><?php print $text_notes; ?></td>
<td><input type="text" name="xnote" id="xnote" value="<?php if(isset($note)) { print $note; } ?>" /></td>
</tr>
<tr>
<td><?php print $text_attachment; ?></td>
<td>
<img src="view/theme/default/assets/images/fileicons/doc.png" alt="Word" title="Word" />
<input type="checkbox" class="checkbox popup" name="xhas_attachment_doc" id="xhas_attachment_doc" <?php if(isset($has_attachment_doc) && $has_attachment_doc == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/xls.png" alt="Excel" title="Excel" />
<input type="checkbox" class="checkbox popup" name="xhas_attachment_xls" id="xhas_attachment_xls" <?php if(isset($has_attachment_xls) && $has_attachment_xls == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/pdf.png" alt="PDF" title="PDF" />
<input type="checkbox" class="checkbox popup" name="xhas_attachment_pdf" id="xhas_attachment_pdf" <?php if(isset($has_attachment_pdf) && $has_attachment_pdf == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/image.png" alt="image" title="image" />
<input type="checkbox" class="checkbox popup" name="xhas_attachment_image" id="xhas_attachment_image" <?php if(isset($has_attachment_image) && $has_attachment_image == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/file.png" alt="any" title="any" />
<input type="checkbox" class="checkbox popup" name="xhas_attachment_any" id="xhas_attachment_any" <?php if(isset($has_attachment_any) && $has_attachment_any == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_others();" />
</td>
</tr>
<tr>
<td><?php print $text_date_from; ?></td>
<td><input type="text" name="date1" id="date1" size="11" value="<?php if(isset($date1)) { print $date1; } ?>" placeholder="<?php print DATE_FORMAT; ?>" /></td>
</tr>
<tr>
<td><?php print $text_date_to; ?></td>
<td><input type="text" name="date2" id="date2" size="11" value="<?php if(isset($date2)) { print $date2; } ?>" placeholder="<?php print DATE_FORMAT; ?>" /></td>
</tr>
</table>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true"><?php print $text_close; ?></a>
<a href="#" class="btn btn-primary" onclick="Piler.complex();" data-dismiss="modal" aria-hidden="true">OK</a>
</div>
</div>
<?php if(Registry::get('auditor_user') == 1) { ?> <?php if(Registry::get('auditor_user') == 1) { ?>
<div id="deletebox-modal" class="modal hide fade"> <div id="deletebox-modal" class="modal hide fade">
<div class="modal-header"> <div class="modal-header">
@ -92,7 +174,7 @@
<?php if(MOBILE_DEVICE == 0) { ?> <?php if(MOBILE_DEVICE == 0) { ?>
<div class="span6 input-append btn-group"> <div class="span6 input-append btn-group">
<button id="button_search" class="btn btn-large btn-danger" onclick="Piler.expert(this); return false;"><i class="icon-search icon-large"></i>&nbsp;<?php print $text_search; ?></button> <button id="button_search" class="btn btn-large btn-danger" onclick="Piler.expert(this); return false;"><i class="icon-search icon-large"></i>&nbsp;<?php print $text_search; ?></button>
<button id="button_expert" class="btn btn-large btn-inverse" onclick="$('#searchpopup1').show();"><?php print $text_advanced_search; ?> &nbsp;<span class="caret"></span></button> <button id="button_expert" class="btn btn-large btn-inverse" onclick="Piler.show_advanced_search_modal();"><?php print $text_advanced_search; ?> &nbsp;<span class="caret"></span></button>
<button id="button_options" class="btn btn-large btn-inverse dropdown-toggle" data-toggle="dropdown"><?php print $text_options; ?> &nbsp;<span class="caret"></span></button> <button id="button_options" class="btn btn-large btn-inverse dropdown-toggle" data-toggle="dropdown"><?php print $text_options; ?> &nbsp;<span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#" onclick="Piler.saved_search_terms('<?php print $text_saved; ?>');"><?php print $text_save; ?></a></li> <li><a href="#" onclick="Piler.saved_search_terms('<?php print $text_saved; ?>');"><?php print $text_save; ?></a></li>
@ -104,7 +186,7 @@
</div> </div>
</div> </div>
</div> </div>
<?php print $popup; ?>
<div id="mainscreen"> <div id="mainscreen">
<div id="mailleftcontainer"> <div id="mailleftcontainer">
<?php if(ENABLE_FOLDER_RESTRICTIONS == 1) { ?> <?php if(ENABLE_FOLDER_RESTRICTIONS == 1) { ?>

View File

@ -1,90 +0,0 @@
<div id="searchpopup1" class="container">
<input type="hidden" name="xsearchtype" id="xsearchtype" value="simple" />
<input type="hidden" name="xsort" id="xsort" value="date" />
<input type="hidden" name="xorder" id="xorder" value="0" />
<input type="hidden" name="xref" id="xref" value="" />
<div id="popupx" onclick="$('#searchpopup1').hide();"><i class="icon-remove-circle icon-large"></i></div>
<form id="ss1" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="xfrom"><?php print $text_from; ?>:</label>
<div class="controls">
<input type="text" name="xfrom" id="xfrom" value="<?php if(isset($from)) { print $from; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xto"><?php print $text_to; ?>:</label>
<div class="controls">
<input type="text" name="xto" id="xto" value="<?php if(isset($to)) { print $to; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xsubject"><?php print $text_subject; ?>:</label>
<div class="controls">
<input type="text" name="xsubject" id="xsubject" value="<?php if(isset($subject)) { print $subject; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xbody"><?php print $text_body; ?>:</label>
<div class="controls">
<input type="text" name="xbody" id="xbody" value="<?php if(isset($body)) { print $body; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xtag"><?php print $text_tags; ?>:</label>
<div class="controls">
<input type="text" name="xtag" id="xtag" value="<?php if(isset($tag)) { print $tag; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xnote"><?php print $text_notes; ?>:</label>
<div class="controls">
<input type="text" name="xnote" id="xnote" value="<?php if(isset($note)) { print $note; } ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="xhas_attachment"><?php print $text_attachment; ?>:</label>
<div class="controls">
<img src="view/theme/default/assets/images/fileicons/doc.png" alt="Word" title="Word" /> <input type="checkbox" class="checkbox popup" name="xhas_attachment_doc" id="xhas_attachment_doc" <?php if(isset($has_attachment_doc) && $has_attachment_doc == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/xls.png" alt="Excel" title="Excel" /> <input type="checkbox" class="checkbox popup" name="xhas_attachment_xls" id="xhas_attachment_xls" <?php if(isset($has_attachment_xls) && $has_attachment_xls == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/pdf.png" alt="PDF" title="PDF" /> <input type="checkbox" class="checkbox popup" name="xhas_attachment_pdf" id="xhas_attachment_pdf" <?php if(isset($has_attachment_pdf) && $has_attachment_pdf == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/image.png" alt="image" title="image" /> <input type="checkbox" class="checkbox popup" name="xhas_attachment_image" id="xhas_attachment_image" <?php if(isset($has_attachment_image) && $has_attachment_image == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_any();" />
<img src="view/theme/default/assets/images/fileicons/file.png" alt="any" title="any" /> <input type="checkbox" class="checkbox popup" name="xhas_attachment_any" id="xhas_attachment_any" <?php if(isset($has_attachment_any) && $has_attachment_any == 1) { ?>checked="checked"<?php } ?> onclick="Piler.clear_attachment_others();" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="date1"><?php print $text_date_from; ?>:</label>
<div class="controls">
<input type="text" name="date1" id="date1" size="11" value="<?php if(isset($date1)) { print $date1; } ?>" placeholder="<?php print DATE_FORMAT; ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="date2"><?php print $text_date_to; ?>:</label>
<div class="controls">
<input type="text" name="date2" id="date2" size="11" value="<?php if(isset($date2)) { print $date2; } ?>" placeholder="<?php print DATE_FORMAT; ?>" />
</div>
</div>
<div class="form-actions">
<input type="submit" id="button_search" class="btn btn-danger" onclick="Piler.complex();return false;" value="<?php print $text_search; ?>" />
<input type="button" class="btn" onclick="Piler.cancel();" value="<?php print $text_clear; ?>" />
</div>
</form>
</div>