step 1 to improve delete feature

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2019-07-14 19:20:49 +02:00
parent 7015e76a11
commit d1da0c93e7
23 changed files with 92 additions and 537 deletions

View File

@ -17,6 +17,7 @@ var Piler =
extra_folders: '',
bulkrestore_url: '/bulkrestore.php',
bulkpdf_url: '/bulkpdf.php',
text_successfully_removed: '<?php print $text_successfully_removed; ?>'
/*
* variables used at search listing
@ -357,7 +358,14 @@ var Piler =
},
bulk_remove_messages:function(msg)
show_bulk_remove_modal:function()
{
Piler.log("[show_bulk_remove_modal]");
$('#deletebox-modal').modal('show');
},
bulk_remove_messages:function(reason)
{
Piler.log("[bulk_remove_messages]");
@ -368,13 +376,13 @@ var Piler =
if(!idlist) return;
jQuery.ajax('/bulkremove.php', {
data: { idlist: idlist },
data: { idlist: idlist, reason: reason },
type: "POST"
})
.done( function( a ) {})
.fail(function( a, b ) { alert("Problem retrieving XML data:" + b) });
Piler.show_message('messagebox1', msg, 0.8);
Piler.show_message('messagebox1', text_successfully_removed, 0.8);
},

View File

@ -51,6 +51,22 @@
</div>
</div>
<?php if(Registry::get('auditor_user') == 1) { ?>
<div id="deletebox-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_delete_reason; ?></h3>
</div>
<div class="modal-body">
<input type="text" id="reason" name="reason" />
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true"><?php print $text_close; ?></a>
<a href="#" onclick="var reason = $('#reason').val(); if(reason) { Piler.bulk_remove_messages(reason); }" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">OK</a>
</div>
</div>
<?php } ?>
<?php if(!(OUTLOOK == 1 && SHOW_MENU_FOR_OUTLOOK == 0)) { ?>
<div id="menu">
<?php print $menu; ?>
@ -72,7 +88,7 @@
<div class="controls row-fluid">
<div id="input-span" class="span6">
<label for="_search"><?php print $text_search; ?></label>
<input type="text" id="_search" name="_search" placeholder="<?php print $text_enter_search_terms; ?>" <?php if(ENABLE_DELETE == 1) { ?>style="background: #faafbe;"<?php } ?> />
<input type="text" id="_search" name="_search" placeholder="<?php print $text_enter_search_terms; ?>" />
</div>
<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>

View File

@ -57,10 +57,6 @@
<p><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></p>
<?php } ?>
<?php if(ENABLE_DELETE == 1) { ?>
<p><?php print $text_compliance_warning; ?></p>
<?php } ?>
<p><?php print COMPATIBILITY; ?></p>
</div>

View File

@ -134,8 +134,6 @@
<?php if($page < $total_pages) { ?><a href="#" class="navlink" onclick="Piler.navigation(<?php print $total_pages; ?>);"><i class="icon-double-angle-right icon-large"></i></a><?php } else { ?> <span class="navlink"><i class="icon-double-angle-right icon-large muted"></i></span><?php } ?>
&nbsp;
<?php if(ENABLE_DELETE == 1) { ?><i class="icon-exclamation-sign" title="<?php print $text_compliance_warning; ?>"></i><?php } ?>
<?php if(Registry::get('auditor_user') == 1 && $session->get("sphx_query")) { ?>
<span style="margin-left: 30px;"><a href="#" onclick="Piler.show_message('messagebox1', '<?php print $session->get("sphx_query"); ?>', 5);">sphinx</a></span>
<?php } ?>
@ -155,7 +153,7 @@
<?php } ?>
<a href="#" class="btn btn-custom btn-inverse" onclick="Piler.download_messages();" title="<?php print $text_bulk_download; ?>"><i class="icon-download-alt"></i></a>
<!--a href="#" class="btn btn-custom btn-inverse" onclick="Piler.download_selected_as_pdf();" title="<?php print $text_download_selected_hits_as_pdf; ?>"><i class="icon-file"></i></a-->
<?php if(ENABLE_DELETE == 1 && isAuditorUser() == 1) { ?><a href="#" class="btn btn-custom btn-inverse" onclick="Piler.bulk_remove_messages('<?php print $text_successfully_removed; ?>');" title="<?php print $text_remove; ?>"><i class="icon-remove-sign"></i></a><?php } ?>
<?php if(ENABLE_DELETE == 1 && isAuditorUser() == 1) { ?><a href="#" class="btn btn-custom btn-inverse" onclick="Piler.show_bulk_remove_modal();" title="<?php print $text_remove; ?>"><i class="icon-remove-sign"></i></a><?php } ?>
<input type="text" id="tag_value" name="tag_value" class="tagtext" />
<a href="#" class="btn btn-custom btn-inverse" onclick="Piler.tag_search_results('<?php print $text_tagged; ?>');" title="<?php print $text_tag_selected_messages; ?>"><i class="icon-tags" title="Tag"></i></a>
</div>

View File

@ -50,6 +50,21 @@
</div>
</div>
<?php if(Registry::get('auditor_user') == 1) { ?>
<div id="deletebox-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_delete_reason; ?></h3>
</div>
<div class="modal-body">
<input type="text" id="reason" name="reason" />
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true"><?php print $text_close; ?></a>
<a href="#" onclick="var reason = $('#reason').val(); if(reason) { alert(reason); }" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">OK</a>
</div>
</div>
<?php } ?>
<div id="messagebox1"></div>
@ -71,7 +86,7 @@
<input type="hidden" name="ref" id="ref" value="" />
<input type="hidden" name="prefix" id="prefix" value="" />
<input type="text" id="_search" name="_search" class="input-medium span6" value="" placeholder="<?php print $text_enter_search_terms; ?>" <?php if(ENABLE_DELETE == 1) { ?>style="background: #faafbe;"<?php } ?> />
<input type="text" id="_search" name="_search" class="input-medium span6" value="" placeholder="<?php print $text_enter_search_terms; ?>" />
<?php if(OUTLOOK == 0) { ?>
<a id="advsearch_caret" href="#" onclick="$('#searchpopup1').show();"><b class="caret"></b></a>

View File

@ -60,10 +60,6 @@
<p><a href="<?php print $auth_url; ?>"><?php print $text_login_via_google; ?></a></p>
<?php } ?>
<?php if(ENABLE_DELETE == 1) { ?>
<p><?php print $text_compliance_warning; ?></p>
<?php } ?>
<p><?php print COMPATIBILITY; ?></p>
</div>

View File

@ -115,8 +115,6 @@
<a href="#" onclick="Piler.download_messages();" title="<?php print $text_bulk_download; ?>"><i class="icon-download-alt"></i></a>
<a href="#" onclick="Piler.download_selected_as_pdf();" title="<?php print $text_download_selected_hits_as_pdf; ?>"><i class="icon-file"></i></a>
<?php if(ENABLE_DELETE == 1 && isAuditorUser() == 1) { ?><a href="#" onclick="Piler.bulk_remove_messages('<?php print $text_successfully_removed; ?>');" title="<?php print $text_remove; ?>"><i class="icon-remove-sign"></i></a><?php } ?>
<input type="text" id="tag_value" name="tag_value" class="input-xlarge" placeholder="<?php print $text_tag_selected_messages; ?>" />
<button class="btn" onclick="Piler.tag_search_results('<?php print $text_tagged; ?>'); return false;" >OK</button>