mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 22:41:59 +01:00
added download all hits feature
This commit is contained in:
parent
f12ae31881
commit
e537ff5461
@ -35,6 +35,9 @@ $config['SITE_URL'] = 'http://piler.yourdomain.com/';
|
||||
$config['ENABLE_SAAS'] = 0;
|
||||
$config['CAPTCHA_FAILED_LOGIN_COUNT'] = 0;
|
||||
|
||||
$config['ENABLE_REFERENCES'] = 1;
|
||||
$config['ENABLE_DOWNLOADING_ALL_SEARCH_HITS'] = 0;
|
||||
|
||||
$config['ENABLE_TABLE_RESIZE'] = 0;
|
||||
$config['DEMO_MODE'] = 0;
|
||||
|
||||
|
33
webui/controller/message/dl.php
Normal file
33
webui/controller/message/dl.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerMessageDl extends Controller {
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "message/headers.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('message/restore');
|
||||
|
||||
$session = Registry::get('session');
|
||||
$a = $session->get('last_search');
|
||||
if($a) {
|
||||
$a = unserialize($a);
|
||||
}
|
||||
|
||||
$idlist = $this->model_search_search->check_your_permission_by_id_list($a);
|
||||
print implode(",", $idlist);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -457,4 +457,7 @@ $_['text_ldap_delete_confirm_message'] = 'Soll dieser LDAP-Eintrag wirklich gel
|
||||
$_['text_customer_delete_confirm_message'] = 'Soll dieser Kunde wirklich gelöscht werden';
|
||||
$_['text_with_selected'] = 'mit ausgewählten';
|
||||
|
||||
|
||||
$_['text_download_all_hits'] = "Download all";
|
||||
|
||||
?>
|
||||
|
@ -87,6 +87,7 @@ $_['text_dn_asterisk_means_skip_sync'] = "Asterisk (*) means this user entry wil
|
||||
$_['text_domain'] = "Domain";
|
||||
$_['text_domains'] = "Domain(s)";
|
||||
$_['text_domainname'] = "Domain name";
|
||||
$_['text_download_all_hits'] = "Download all";
|
||||
$_['text_download_attachment2'] = "download attachment";
|
||||
$_['text_download_message'] = "Download message (EML)";
|
||||
$_['text_download_message2'] = "download message";
|
||||
|
@ -457,4 +457,6 @@ $_['text_ldap_delete_confirm_message'] = 'Desea borrar la entrada LDAP';
|
||||
$_['text_customer_delete_confirm_message'] = 'Desea borrar el cliente';
|
||||
$_['text_with_selected'] = 'Con seleccionado';
|
||||
|
||||
$_['text_download_all_hits'] = "Download all";
|
||||
|
||||
?>
|
||||
|
@ -87,6 +87,7 @@ $_['text_dn_asterisk_means_skip_sync'] = "A csillag (*) azt jelenti, hogy ez a f
|
||||
$_['text_domain'] = "Domain";
|
||||
$_['text_domains'] = "Domain(ek)";
|
||||
$_['text_domainname'] = "Domainnév";
|
||||
$_['text_download_all_hits'] = "Összes találat letöltése";
|
||||
$_['text_download_attachment2'] = "melléklet letöltés";
|
||||
$_['text_download_message'] = "Levél letöltése (EML)";
|
||||
$_['text_download_message2'] = "levél letöltése";
|
||||
|
@ -87,6 +87,7 @@ $_['text_dn_asterisk_means_skip_sync'] = "A csillag (*) azt jelenti, hogy ez a f
|
||||
$_['text_domain'] = "Domain";
|
||||
$_['text_domains'] = "Domain(ek)";
|
||||
$_['text_domainname'] = "Domainnév";
|
||||
$_['text_download_all_hits'] = "Összes találat letöltése";
|
||||
$_['text_download_attachment2'] = "melléklet letöltés";
|
||||
$_['text_download_message'] = "Levél letöltése (EML)";
|
||||
$_['text_download_message2'] = "levél letöltése";
|
||||
|
@ -450,4 +450,6 @@ $_['text_ldap_delete_confirm_message'] = 'Do you wish to delete the LDAP entry';
|
||||
$_['text_customer_delete_confirm_message'] = 'Do you wish to delete the customer';
|
||||
$_['text_with_selected'] = 'With Selected';
|
||||
|
||||
$_['text_download_all_hits'] = "Download all";
|
||||
|
||||
?>
|
||||
|
@ -13,6 +13,8 @@ class ModelSearchSearch extends Model {
|
||||
$s = "";
|
||||
$all_ids_csv = "";
|
||||
|
||||
$session = Registry::get('session');
|
||||
|
||||
while(list($k,$v) = each($data)) {
|
||||
if($v) { $s .= '&' . $k . '=' . $v; }
|
||||
}
|
||||
@ -56,6 +58,12 @@ class ModelSearchSearch extends Model {
|
||||
$total_hits = count($all_ids);
|
||||
|
||||
|
||||
if($total_hits > 0) {
|
||||
$session->set('last_search', serialize($all_ids));
|
||||
} else {
|
||||
$session->set('last_search', '');
|
||||
}
|
||||
|
||||
$data['page_len'] = get_page_length();
|
||||
|
||||
if($total_hits > 0) {
|
||||
|
@ -769,11 +769,9 @@ var Piler =
|
||||
},
|
||||
|
||||
|
||||
download_messages:function()
|
||||
download_messages_real:function(idlist)
|
||||
{
|
||||
var idlist = Piler.get_selected_messages_list();
|
||||
|
||||
Piler.log("[download_selected_emails]", idlist);
|
||||
Piler.log("[download_messages_real]", idlist);
|
||||
|
||||
if(idlist) {
|
||||
var form = document.createElement("form");
|
||||
@ -804,6 +802,34 @@ var Piler =
|
||||
},
|
||||
|
||||
|
||||
download_messages:function()
|
||||
{
|
||||
var idlist = Piler.get_selected_messages_list();
|
||||
Piler.download_messages_real(idlist);
|
||||
},
|
||||
|
||||
|
||||
download_all_search_hits:function()
|
||||
{
|
||||
var url;
|
||||
|
||||
url = '/index.php?route=message/dl';
|
||||
|
||||
jQuery.ajax( url, {
|
||||
type: "POST"
|
||||
})
|
||||
.done( function( a )// data, textStatus, jqXHR
|
||||
{
|
||||
Piler.download_messages_real(a);
|
||||
})
|
||||
.fail(function( a, b )// jqXHR, textStatus, errorThrown
|
||||
{
|
||||
alert("Problem retrieving XML data:" + b)
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
auditexpert:function()
|
||||
{
|
||||
Piler.log("[auditexpert]");
|
||||
|
@ -50,7 +50,7 @@
|
||||
<td id="c4_r<?php print $i; ?>" class="resultcell from"><?php if($message['from'] != $message['shortfrom']) { ?><span title="<?php print $message['from']; ?>"><?php print $message['shortfrom']; ?></span><?php } else { print $message['from']; } ?></td>
|
||||
<td id="c5_r<?php print $i; ?>" class="resultcell to"><?php if($message['to'] != $message['shortto']) { ?><span title="<?php print $message['to']; ?>"><?php print $message['shortto']; ?> <i class=" muted icon-group"></i></span><?php } else { print $message['to']; } ?></td>
|
||||
|
||||
<td id="c6_r<?php print $i; ?>" class="resultcell subject"><a href="#" onclick="Piler.view_message_by_pos(<?php print $i; ?>);"><?php print $message['subject']; ?></a><?php if($message['reference']) { ?> <a href="#" title="<?php print $text_conversation_available; ?>" onclick="$('#ref').val('<?php print $message['reference']; ?>'); Piler.expert(this);">[+]</span></a><?php } ?></td>
|
||||
<td id="c6_r<?php print $i; ?>" class="resultcell subject"><a href="#" onclick="Piler.view_message_by_pos(<?php print $i; ?>);"><?php print $message['subject']; ?></a><?php if(ENABLE_REFERENCES == 1 && $message['reference']) { ?> <a href="#" title="<?php print $text_conversation_available; ?>" onclick="$('#ref').val('<?php print $message['reference']; ?>'); Piler.expert(this);">[+]</span></a><?php } ?></td>
|
||||
|
||||
<td id="c7_r<?php print $i; ?>" class="resultcell size"><?php print $message['size']; ?></td>
|
||||
<td id="c8_r<?php print $i; ?>" class="resultcell end"><?php if($message['spam'] == 1) { ?><i class="spam icon-warning-sign icon-large" title="<?php print $text_spam_flag; ?>"></i><?php } else { ?> <?php } ?></td>
|
||||
@ -137,6 +137,11 @@
|
||||
<input type="hidden" id="tag_keys" name="tag_keys" value="<?php print $all_ids; ?>" />
|
||||
<input type="hidden" id="_ref" name="_ref" value="<?php if(isset($_ref)) { print $_ref; } ?>" />
|
||||
<div id="functionbox" class="input-prepend input-append pull-right">
|
||||
|
||||
<?php if(ENABLE_DOWNLOADING_ALL_SEARCH_HITS == 1) { ?>
|
||||
<button id="download_all_search_hits" name="download_all_search_hits" class="btn btn-custom btn-inverse" onclick="Piler.download_all_search_hits();"><?php print $text_download_all_hits; ?></button>
|
||||
<?php } ?>
|
||||
|
||||
<span class="add-on"><?php print $text_with_selected; ?>: </span>
|
||||
<a href="#" class="btn btn-custom btn-inverse" onclick="Piler.bulk_restore_messages('<?php print $text_restored; ?>'); " title="<?php print $text_bulk_restore_selected_emails; ?>"><i class="icon-share-alt"></i></a>
|
||||
<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>
|
||||
|
@ -59,7 +59,7 @@
|
||||
<td class="center sleek"><?php print $message['date']; ?></td>
|
||||
<td><?php if($message['from'] != $message['shortfrom']) { ?><span title="<?php print $message['from']; ?>"><?php print $message['shortfrom']; ?></span><?php } else { print $message['from']; } ?></td>
|
||||
<td><?php if($message['to'] != $message['shortto']) { ?><span title="<?php print $message['to']; ?>"><?php print $message['shortto']; ?><i class="icon-user"></i></span><?php } else { print $message['to']; } ?></td>
|
||||
<td><a href="#" <?php if($message['spam'] == 1) { ?>class="spam"<?php } ?> <?php if($message['subject'] != $message['shortsubject']) { ?>title="<?php print $message['subject']; ?>"<?php } ?> onclick="Piler.view_message_by_pos(<?php print $i; ?>);"><?php if($message['subject'] != $message['shortsubject'] && MOBILE_DEVICE == 1) { print $message['shortsubject']; } else { print $message['subject']; } ?></a><?php if($message['reference']) { ?> <a href="#" title="<?php print $text_conversation_available; ?>" onclick="$('#ref').val('<?php print $message['reference']; ?>'); Piler.expert(this);">[+]</a><?php } ?></td>
|
||||
<td><a href="#" <?php if($message['spam'] == 1) { ?>class="spam"<?php } ?> <?php if($message['subject'] != $message['shortsubject']) { ?>title="<?php print $message['subject']; ?>"<?php } ?> onclick="Piler.view_message_by_pos(<?php print $i; ?>);"><?php if($message['subject'] != $message['shortsubject'] && MOBILE_DEVICE == 1) { print $message['shortsubject']; } else { print $message['subject']; } ?></a><?php if(ENABLE_REFERENCES == 1 && $message['reference']) { ?> <a href="#" title="<?php print $text_conversation_available; ?>" onclick="$('#ref').val('<?php print $message['reference']; ?>'); Piler.expert(this);">[+]</a><?php } ?></td>
|
||||
<td><?php print $message['size']; ?></td>
|
||||
<td><?php if($message['attachments'] > 0) { ?><i class="icon-file sleek"></i><?php } ?></td>
|
||||
<td><?php if($message['note']) { ?><i class="icon-bookmark sleek" title="<?php print $message['note']; ?>"></i><?php } ?></td>
|
||||
@ -103,6 +103,9 @@
|
||||
</span>
|
||||
|
||||
<?php } else { ?> <?php } ?>
|
||||
<?php if(ENABLE_DOWNLOADING_ALL_SEARCH_HITS == 1) { ?>
|
||||
<button id="download_all_search_hits" name="download_all_search_hits" class="btn btn-custom btn-inverse" onclick="Piler.download_all_search_hits();"><?php print $text_download_all_hits; ?></button>
|
||||
<?php } ?>
|
||||
|
||||
<button class="btn piler-right-margin" onclick="Piler.bulk_restore_messages('<?php print $text_restored; ?>'); return false;"><?php print $text_bulk_restore_selected_emails; ?></button>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user