add pdf export support

This commit is contained in:
SJ
2013-11-16 15:34:30 +01:00
parent 0c7a366edf
commit 04ab9c7b38
308 changed files with 87020 additions and 7343 deletions

View File

@ -15,6 +15,8 @@ var Piler =
current_message_id: 0,
folders: '',
extra_folders: '',
bulkrestore_url: '/bulkrestore.php',
bulkpdf_url: '/bulkpdf.php',
/*
* variables used at search listing
@ -427,6 +429,19 @@ var Piler =
},
get_messages_list:function()
{
var idlist = '';
for(i=0; i<Piler.Messages.length; i++) {
if(idlist) idlist += ",";
idlist += Piler.Messages[i];
}
return idlist;
},
/*
* fill Messages array with search results
*/
@ -768,7 +783,7 @@ var Piler =
},
download_messages_real:function(idlist)
download_messages_real:function(idlist, url)
{
Piler.log("[download_messages_real]", idlist);
@ -776,7 +791,7 @@ var Piler =
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", '/bulkrestore.php');
form.setAttribute("action", url);
form.setAttribute("name", "download");
var hiddenField = document.createElement("input");
@ -804,7 +819,7 @@ var Piler =
download_messages:function()
{
var idlist = Piler.get_selected_messages_list();
Piler.download_messages_real(idlist);
Piler.download_messages_real(idlist, Piler.bulkrestore_url);
},
@ -819,7 +834,7 @@ var Piler =
})
.done( function( a )// data, textStatus, jqXHR
{
Piler.download_messages_real(a);
Piler.download_messages_real(a, Piler.bulkrestore_url);
})
.fail(function( a, b )// jqXHR, textStatus, errorThrown
{
@ -829,6 +844,15 @@ var Piler =
},
download_selected_as_pdf:function()
{
var idlist = Piler.get_selected_messages_list();
if(idlist) {
Piler.download_messages_real(idlist, Piler.bulkpdf_url);
}
},
auditexpert:function()
{
Piler.log("[auditexpert]");

View File

@ -54,5 +54,10 @@
<?php print $message['message']; ?>
</div>
<?php foreach($images as $img) { ?>
<p><img src="<?php print SITE_URL; ?>/tmp/<?php print $img['name']; ?>" alt="" /></p>
<?php } ?>
</div>

View File

@ -139,7 +139,8 @@
<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>
<button id="download_all_search_hits_as_eml" name="download_all_search_hits_as_eml" class="btn btn-custom btn-inverse" onclick="Piler.download_all_search_hits();"><?php print $text_download_all_hits_as_eml; ?></button>
<button id="download_all_search_hits_as_pdf" name="download_all_search_hits_as_pdf" class="btn btn-custom btn-warning" onclick="Piler.download_selected_as_pdf();"><?php print $text_download_selected_hits_as_pdf; ?></button>
<?php } ?>
<span class="add-on"><?php print $text_with_selected; ?>:&nbsp;</span>

View File

@ -55,5 +55,10 @@
<?php print $message['message']; ?>
</div>
<?php foreach($images as $img) { ?>
<p><img src="<?php print SITE_URL; ?>/tmp/<?php print $img['name']; ?>" alt="" /></p>
<?php } ?>
</div>

View File

@ -104,7 +104,8 @@
<?php } else { ?>&nbsp;<?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>
<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_as_eml; ?></button>
<button id="download_all_search_hits_as_pdf" name="download_all_search_hits_as_pdf" class="btn btn-custom btn-warning" onclick="Piler.download_selected_as_pdf(); return false;"><?php print $text_download_selected_hits_as_pdf; ?></button>
<?php } ?>
<?php if(SMARTHOST || ENABLE_IMAP_AUTH == 1) { ?>