new export flag to skip default columns

This commit is contained in:
Uwe Steinmann 2025-02-18 21:22:01 +01:00
parent 0fe367820f
commit 4352f95818
2 changed files with 18 additions and 1 deletions

View File

@ -52,6 +52,10 @@ $includecontent = false;
if (isset($_GET["includecontent"]) && $_GET["includecontent"])
$includecontent = true;
$skipdefaultcols = false;
if (isset($_GET["skipdefaultcols"]) && $_GET["skipdefaultcols"])
$skipdefaultcols = true;
$newowner = null;
if (isset($_GET["newowner"]) && is_numeric($_GET["newowner"]) && $_GET['newowner'] > 0) {
$newowner = $dms->getUser((int) $_GET['newowner']);
@ -735,6 +739,7 @@ if($settings->_showSingleSearchHit && count($entries) == 1) {
$view->setParam('accessobject', $accessop);
$view->setParam('query', $query);
$view->setParam('includecontent', $includecontent);
$view->setParam('skipdefaultcols', $skipdefaultcols);
$view->setParam('marks', isset($_GET['marks']) ? $_GET['marks'] : array());
$view->setParam('newowner', $newowner);
$view->setParam('newreviewer', $newreviewer);

View File

@ -57,7 +57,7 @@ $(document).ready( function() {
$('#export').on('click', function(ev) {
ev.preventDefault();
ev.stopPropagation();
var url = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0');
var url = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0')+'&skipdefaultcols='+($('#skipdefaultcols').prop('checked') ? '1' : '0');
var values = {};
$('input[name^=\"marks\"]').each(function() {
if(this.checked)
@ -225,10 +225,12 @@ $(document).ready(function() {
$user = $this->params['user'];
$entries = $this->params['searchhits'];
$includecontent = $this->params['includecontent'];
$skipdefaultcols = $this->params['skipdefaultcols'];
$marks = $this->params['marks'];
include("../inc/inc.ClassDownloadMgr.php");
$downmgr = new SeedDMS_Download_Mgr();
$downmgr->skipDefaultCols($skipdefaultcols);
if($extraheader = $this->callHook('extraDownloadHeader'))
$downmgr->addHeader($extraheader);
foreach($entries as $entry) {
@ -1487,6 +1489,16 @@ $(document).ready(function() {
'value'=>1,
)
);
$this->formField(
getMLText("skip_default_export_cols"),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'skipdefaultcols',
'id'=>'skipdefaultcols',
'value'=>1,
)
);
//$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("batch_export"), false, true)."\n";
$content = ob_get_clean();