mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-07-15 08:58:10 +00:00
fix export, export xlsx, do not collapse search form anymore
This commit is contained in:
parent
20dd55840e
commit
50d528a831
|
@ -83,6 +83,7 @@ $(document).ready(function() {
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$entries = $this->params['searchhits'];
|
$entries = $this->params['searchhits'];
|
||||||
|
$includecontent = $this->params['includecontent'];
|
||||||
|
|
||||||
include("../inc/inc.ClassDownloadMgr.php");
|
include("../inc/inc.ClassDownloadMgr.php");
|
||||||
$downmgr = new SeedDMS_Download_Mgr();
|
$downmgr = new SeedDMS_Download_Mgr();
|
||||||
|
@ -91,14 +92,14 @@ $(document).ready(function() {
|
||||||
foreach($entries as $entry) {
|
foreach($entries as $entry) {
|
||||||
if($entry->isType('document')) {
|
if($entry->isType('document')) {
|
||||||
$extracols = $this->callHook('extraDownloadColumns', $entry);
|
$extracols = $this->callHook('extraDownloadColumns', $entry);
|
||||||
if(isset($_GET['includecontent']) && $_GET['includecontent'] && $rawcontent = $this->callHook('rawcontent', $entry->getLatestContent())) {
|
if($includecontent && $rawcontent = $this->callHook('rawcontent', $entry->getLatestContent())) {
|
||||||
$downmgr->addItem($entry->getLatestContent(), $extracols, $rawcontent);
|
$downmgr->addItem($entry->getLatestContent(), $extracols, $rawcontent);
|
||||||
} else
|
} else
|
||||||
$downmgr->addItem($entry->getLatestContent(), $extracols);
|
$downmgr->addItem($entry->getLatestContent(), $extracols);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$filename = tempnam(sys_get_temp_dir(), '');
|
$filename = tempnam(sys_get_temp_dir(), '');
|
||||||
if(isset($_GET['includecontent']) && $_GET['includecontent']) {
|
if($includecontent) {
|
||||||
$downmgr->createArchive($filename);
|
$downmgr->createArchive($filename);
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
header("Content-Length: " . filesize($filename));
|
header("Content-Length: " . filesize($filename));
|
||||||
|
@ -109,8 +110,8 @@ $(document).ready(function() {
|
||||||
$downmgr->createToc($filename);
|
$downmgr->createToc($filename);
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
header("Content-Length: " . filesize($filename));
|
header("Content-Length: " . filesize($filename));
|
||||||
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".xls\"");
|
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".xlsx\"");
|
||||||
header("Content-Type: application/vnd.ms-excel");
|
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
header("Cache-Control: must-revalidate");
|
header("Cache-Control: must-revalidate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,9 +242,10 @@ function typeahead() { /* {{{ */
|
||||||
|
|
||||||
$this->rowStart();
|
$this->rowStart();
|
||||||
$this->columnStart(4);
|
$this->columnStart(4);
|
||||||
$this->contentHeading("<button class=\"btn btn-primary\" id=\"searchform-toggle\" data-toggle=\"collapse\" href=\"#searchform\"><i class=\"fa fa-exchange\"></i></button> ".getMLText('search'), true);
|
//$this->contentHeading("<button class=\"btn btn-primary\" id=\"searchform-toggle\" data-toggle=\"collapse\" href=\"#searchform\"><i class=\"fa fa-exchange\"></i></button> ".getMLText('search'), true);
|
||||||
|
$this->contentHeading(getMLText('search'), true);
|
||||||
if($this->query) {
|
if($this->query) {
|
||||||
echo "<div id=\"searchform\" class=\"collapse mb-sm-4\">";
|
echo "<div id=\"searchform\" class=\"_collapse mb-sm-4\">";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<ul class="nav nav-pills" id="searchtab">
|
<ul class="nav nav-pills" id="searchtab">
|
||||||
|
@ -387,10 +389,12 @@ function typeahead() { /* {{{ */
|
||||||
'element'=>'input',
|
'element'=>'input',
|
||||||
'type'=>'checkbox',
|
'type'=>'checkbox',
|
||||||
'name'=>'includecontent',
|
'name'=>'includecontent',
|
||||||
|
'id'=>'includecontent',
|
||||||
'value'=>1,
|
'value'=>1,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->formSubmit("<i class=\"fa fa-download\"></i> ".getMLText('export'));
|
//$this->formSubmit("<i class=\"fa fa-download\"></i> ".getMLText('export'));
|
||||||
|
print $this->html_link('Search', array_merge($_GET, array('action'=>'export')), array('class'=>'btn btn-primary', 'id'=>'export'), "<i class=\"fa fa-download\"></i> ".getMLText("export"), false, true)."\n";
|
||||||
$content = ob_get_clean();
|
$content = ob_get_clean();
|
||||||
$this->printAccordion(getMLText('export'), $content);
|
$this->printAccordion(getMLText('export'), $content);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user