mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
0539945bf1
|
@ -595,6 +595,7 @@ if($settings->_showSingleSearchHit && count($entries) == 1) {
|
||||||
$view->setParam('accessobject', $accessop);
|
$view->setParam('accessobject', $accessop);
|
||||||
$view->setParam('query', $query);
|
$view->setParam('query', $query);
|
||||||
$view->setParam('includecontent', $includecontent);
|
$view->setParam('includecontent', $includecontent);
|
||||||
|
$view->setParam('marks', isset($_GET['marks']) ? $_GET['marks'] : array());
|
||||||
$view->setParam('newowner', $newowner);
|
$view->setParam('newowner', $newowner);
|
||||||
$view->setParam('searchhits', $entries);
|
$view->setParam('searchhits', $entries);
|
||||||
$view->setParam('totalpages', $totalPages);
|
$view->setParam('totalpages', $totalPages);
|
||||||
|
|
|
@ -1462,7 +1462,7 @@ function getOverallStatusIcon($status) { /* {{{ */
|
||||||
$icon = 'fa fa-question';
|
$icon = 'fa fa-question';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return '<i class="fa '.$icon.'"'.($color ? ' style="color: '.$color.';"' : '').' title="'.getOverallStatusText($status).'"></i>';
|
return '<div style="display: inline-block; white-space: nowrap;"><i class="fa '.$icon.'"'.($color ? ' style="color: '.$color.';"' : '').' title="'.getOverallStatusText($status).'"></i> <span class="visible-desktop">'.getOverallStatusText($status).'</span></div>';
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,10 @@ class SeedDMS_View_Search extends SeedDMS_Theme_Style {
|
||||||
*/
|
*/
|
||||||
function markQuery($str, $tag = "b") { /* {{{ */
|
function markQuery($str, $tag = "b") { /* {{{ */
|
||||||
$querywords = preg_split("/ /", $this->query);
|
$querywords = preg_split("/ /", $this->query);
|
||||||
|
|
||||||
foreach ($querywords as $queryword)
|
foreach ($querywords as $queryword)
|
||||||
$str = str_ireplace("($queryword)", "<" . $tag . ">\\1</" . $tag . ">", $str);
|
$str = str_ireplace("($queryword)", "<" . $tag . ">\\1</" . $tag . ">", $str);
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -61,16 +61,39 @@ class SeedDMS_View_Search extends SeedDMS_Theme_Style {
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
$('#export').on('click', function(e) {
|
$('#export').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.location.href = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0');
|
var url = "";
|
||||||
|
url = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0');
|
||||||
|
|
||||||
|
var inputs = $('input[name^=\"marks\"]');
|
||||||
|
var values = {};
|
||||||
|
inputs.each(function() {
|
||||||
|
console.log(this.name+'='+this.checked);
|
||||||
|
if(this.checked)
|
||||||
|
values[this.name] = 1;
|
||||||
|
});
|
||||||
|
url += '&'+$.param(values);
|
||||||
|
window.location.href = url;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#changeowner').on('click', function(e) {
|
$('#changeowner').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.location.href = $(this).attr('href')+'&newowner='+($('#newowner').val());
|
var url = "";
|
||||||
|
url = $(this).attr('href')+'&newowner='+($('#newowner').val());
|
||||||
|
var inputs = $('input[name^=\"marks\"]');
|
||||||
|
var values = {};
|
||||||
|
inputs.each(function() {
|
||||||
|
console.log(this.name+'='+this.checked);
|
||||||
|
if(this.checked)
|
||||||
|
values[this.name] = 1;
|
||||||
|
});
|
||||||
|
url += '&'+$.param(values);
|
||||||
|
window.location.href = url;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
// $this->printFolderChooserJs("form1");
|
// $this->printFolderChooserJs("form1");
|
||||||
$this->printDeleteFolderButtonJs();
|
$this->printDeleteFolderButtonJs();
|
||||||
|
$this->printMarkDocumentButtonJs();
|
||||||
$this->printDeleteDocumentButtonJs();
|
$this->printDeleteDocumentButtonJs();
|
||||||
/* Add js for catching click on document in one page mode */
|
/* Add js for catching click on document in one page mode */
|
||||||
$this->printClickDocumentJs();
|
$this->printClickDocumentJs();
|
||||||
|
@ -83,11 +106,64 @@ $(document).ready(function() {
|
||||||
<?php
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print button with icon for marking a document
|
||||||
|
*
|
||||||
|
* @param object $document document to be marked
|
||||||
|
* @param boolean $return return html instead of printing it
|
||||||
|
* @return string html content if $return is true, otherwise an empty string
|
||||||
|
*/
|
||||||
|
function printMarkDocumentButton($document, $return=false){ /* {{{ */
|
||||||
|
$docid = $document->getID();
|
||||||
|
$content = '';
|
||||||
|
$content .= '<br /><span class="mark-btn document-unmarked" title="'.getMLText('mark_document').'" rel="D'.$docid.'"><i class="fa fa-square-o"></i></span><input type="checkbox" id="marks_D'.$docid.'" name="marks[D'.$docid.']" value="1" style="display: none;">';
|
||||||
|
if($return)
|
||||||
|
return $content;
|
||||||
|
else
|
||||||
|
echo $content;
|
||||||
|
return '';
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print button with icon for marking a folder
|
||||||
|
*
|
||||||
|
* @param object $folder folder to be marked
|
||||||
|
* @param boolean $return return html instead of printing it
|
||||||
|
* @return string html content if $return is true, otherwise an empty string
|
||||||
|
*/
|
||||||
|
function printMarkFolderButton($folder, $return=false){ /* {{{ */
|
||||||
|
$folderid = $folder->getID();
|
||||||
|
$content = '';
|
||||||
|
$content .= '<br /><span class="mark-btn folder-unmarked" title="'.getMLText('mark_folder').'" rel="F'.$folderid.'"><i class="fa fa-square-o"></i></span><input type="checkbox" id="marks_F'.$folderid.'" name="marks[F'.$folderid.']" value="1" style="display: none;">';
|
||||||
|
if($return)
|
||||||
|
return $content;
|
||||||
|
else
|
||||||
|
echo $content;
|
||||||
|
return '';
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function printMarkDocumentButtonJs(){ /* {{{ */
|
||||||
|
$url = $this->html_url('Search', array_merge($_GET, array('action'=>null)));
|
||||||
|
echo "
|
||||||
|
// ".$url."
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('body').on('click', 'span.mark-btn', function(ev){
|
||||||
|
ev.stopPropagation();
|
||||||
|
id = $(ev.currentTarget).attr('rel');
|
||||||
|
$('#marks_'+id).each(function () { this.checked = !this.checked; });
|
||||||
|
$(this).parents('tr').toggleClass('table-info');
|
||||||
|
$(this).find('i').toggleClass('fa-square-o fa-check-square-o')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
";
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function export() { /* {{{ */
|
function export() { /* {{{ */
|
||||||
$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'];
|
$includecontent = $this->params['includecontent'];
|
||||||
|
$marks = $this->params['marks'];
|
||||||
|
|
||||||
include("../inc/inc.ClassDownloadMgr.php");
|
include("../inc/inc.ClassDownloadMgr.php");
|
||||||
$downmgr = new SeedDMS_Download_Mgr();
|
$downmgr = new SeedDMS_Download_Mgr();
|
||||||
|
@ -95,12 +171,14 @@ $(document).ready(function() {
|
||||||
$downmgr->addHeader($extraheader);
|
$downmgr->addHeader($extraheader);
|
||||||
foreach($entries as $entry) {
|
foreach($entries as $entry) {
|
||||||
if($entry->isType('document')) {
|
if($entry->isType('document')) {
|
||||||
$extracols = $this->callHook('extraDownloadColumns', $entry);
|
if(empty($marks) || !empty($marks['D'.$entry->getId()])) {
|
||||||
$filename = $this->callHook('filenameDownloadItem', $entry->getLatestContent());
|
$extracols = $this->callHook('extraDownloadColumns', $entry);
|
||||||
if($includecontent && $rawcontent = $this->callHook('rawcontent', $entry->getLatestContent())) {
|
$filename = $this->callHook('filenameDownloadItem', $entry->getLatestContent());
|
||||||
$downmgr->addItem($entry->getLatestContent(), $extracols, $rawcontent, $filename);
|
if($includecontent && $rawcontent = $this->callHook('rawcontent', $entry->getLatestContent())) {
|
||||||
} else
|
$downmgr->addItem($entry->getLatestContent(), $extracols, $rawcontent, $filename);
|
||||||
$downmgr->addItem($entry->getLatestContent(), $extracols, null, $filename);
|
} else
|
||||||
|
$downmgr->addItem($entry->getLatestContent(), $extracols, null, $filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$filename = tempnam(sys_get_temp_dir(), '');
|
$filename = tempnam(sys_get_temp_dir(), '');
|
||||||
|
@ -129,16 +207,18 @@ $(document).ready(function() {
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$entries = $this->params['searchhits'];
|
$entries = $this->params['searchhits'];
|
||||||
$newowner = $this->params['newowner'];
|
$newowner = $this->params['newowner'];
|
||||||
|
$marks = $this->params['marks'];
|
||||||
|
|
||||||
if($newowner && $user->isAdmin()) {
|
if($newowner && $user->isAdmin()) {
|
||||||
$j = $i = 0;
|
$j = $i = 0;
|
||||||
foreach($entries as $entry) {
|
foreach($entries as $entry) {
|
||||||
// if($entry->isType('document')) {
|
$prefix = $entry->isType('document') ? 'D' : 'F';
|
||||||
|
if(empty($marks) || !empty($marks[$prefix.$entry->getId()])) {
|
||||||
if($entry->getOwner()->getId() != $newowner->getId()) {
|
if($entry->getOwner()->getId() != $newowner->getId()) {
|
||||||
$entry->setOwner($newowner);
|
$entry->setOwner($newowner);
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
$this->setParam('batchmsg', getMLText('batch_new_owner_msg', ['count'=>$j]));
|
$this->setParam('batchmsg', getMLText('batch_new_owner_msg', ['count'=>$j]));
|
||||||
} else {
|
} else {
|
||||||
|
@ -210,7 +290,7 @@ function typeahead() { /* {{{ */
|
||||||
$tmp['orderby'] = ($orderby=="d"||$orderby=="da") ? "dd" : "d";
|
$tmp['orderby'] = ($orderby=="d"||$orderby=="da") ? "dd" : "d";
|
||||||
$headcol .= " <a href=\"../out/out.Search.php?".http_build_query($tmp)."\" title=\"".getMLText("sort_by_date")."\">".($orderby=="d"||$orderby=="da"?' <i class="fa fa-sort-amount-asc selected"></i>':($orderby=="dd"?' <i class="fa fa-sort-amount-desc selected"></i>':' <i class="fa fa-sort-amount-asc"></i>'))."</a>";
|
$headcol .= " <a href=\"../out/out.Search.php?".http_build_query($tmp)."\" title=\"".getMLText("sort_by_date")."\">".($orderby=="d"||$orderby=="da"?' <i class="fa fa-sort-amount-asc selected"></i>':($orderby=="dd"?' <i class="fa fa-sort-amount-desc selected"></i>':' <i class="fa fa-sort-amount-asc"></i>'))."</a>";
|
||||||
}
|
}
|
||||||
return $headcol;
|
return $headcol;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
|
@ -277,7 +357,7 @@ function typeahead() { /* {{{ */
|
||||||
//$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);
|
$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">
|
||||||
|
@ -583,53 +663,9 @@ function typeahead() { /* {{{ */
|
||||||
$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search'));
|
$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search'));
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
|
||||||
if($totaldocs) {
|
|
||||||
ob_start();
|
|
||||||
$this->formField(
|
|
||||||
getMLText("include_content"),
|
|
||||||
array(
|
|
||||||
'element'=>'input',
|
|
||||||
'type'=>'checkbox',
|
|
||||||
'name'=>'includecontent',
|
|
||||||
'id'=>'includecontent',
|
|
||||||
'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("export"), false, true)."\n";
|
|
||||||
$content = ob_get_clean();
|
|
||||||
$this->printAccordion(getMLText('export'), $content);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($total) {
|
|
||||||
ob_start();
|
|
||||||
$users = $dms->getAllUsers();
|
|
||||||
$options = array();
|
|
||||||
$options[] = array("-1", getMLText("choose_user"));
|
|
||||||
foreach ($users as $currUser) {
|
|
||||||
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin().' - '.$currUser->getFullName()), false, array(array('data-subtitle', htmlspecialchars($currUser->getEmail()))));
|
|
||||||
}
|
|
||||||
$this->formField(
|
|
||||||
null, //getMLText("selection"),
|
|
||||||
array(
|
|
||||||
'element'=>'select',
|
|
||||||
'id'=>'newowner',
|
|
||||||
'class'=>'chzn-select',
|
|
||||||
'options'=>$options,
|
|
||||||
'placeholder'=>getMLText('select_users'),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_owner"), false, true)."\n";
|
|
||||||
$content = ob_get_clean();
|
|
||||||
$this->printAccordion(getMLText('batch_change_owner'), $content);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
// }}}
|
// }}}
|
||||||
// }}}
|
|
||||||
|
|
||||||
// Fulltext search Form {{{
|
// Fulltext search Form {{{
|
||||||
if($enablefullsearch) {
|
if($enablefullsearch) {
|
||||||
|
@ -783,6 +819,54 @@ function typeahead() { /* {{{ */
|
||||||
if($this->query) {
|
if($this->query) {
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Batch operations {{{ */
|
||||||
|
if($total)
|
||||||
|
$this->contentHeading(getMLText('batch_operation'));
|
||||||
|
if($totaldocs) {
|
||||||
|
ob_start();
|
||||||
|
$this->formField(
|
||||||
|
getMLText("include_content"),
|
||||||
|
array(
|
||||||
|
'element'=>'input',
|
||||||
|
'type'=>'checkbox',
|
||||||
|
'name'=>'includecontent',
|
||||||
|
'id'=>'includecontent',
|
||||||
|
'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("export"), false, true)."\n";
|
||||||
|
$content = ob_get_clean();
|
||||||
|
$this->printAccordion(getMLText('export'), $content);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($user->isAdmin() && $total) {
|
||||||
|
ob_start();
|
||||||
|
$users = $dms->getAllUsers();
|
||||||
|
$options = array();
|
||||||
|
$options[] = array("-1", getMLText("choose_user"));
|
||||||
|
foreach ($users as $currUser) {
|
||||||
|
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin().' - '.$currUser->getFullName()), false, array(array('data-subtitle', htmlspecialchars($currUser->getEmail()))));
|
||||||
|
}
|
||||||
|
$this->formField(
|
||||||
|
null, //getMLText("selection"),
|
||||||
|
array(
|
||||||
|
'element'=>'select',
|
||||||
|
'id'=>'newowner',
|
||||||
|
'class'=>'chzn-select',
|
||||||
|
'options'=>$options,
|
||||||
|
'placeholder'=>getMLText('select_users'),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_owner"), false, true)."\n";
|
||||||
|
$content = ob_get_clean();
|
||||||
|
$this->printAccordion(getMLText('batch_change_owner'), $content);
|
||||||
|
}
|
||||||
|
// }}}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->columnStart(8);
|
$this->columnStart(8);
|
||||||
if($batchmsg = $this->getParam('batchmsg')) {
|
if($batchmsg = $this->getParam('batchmsg')) {
|
||||||
|
@ -878,6 +962,7 @@ function typeahead() { /* {{{ */
|
||||||
$extracontent['below_title'] = $this->getListRowPath($document);
|
$extracontent['below_title'] = $this->getListRowPath($document);
|
||||||
if($attrstr)
|
if($attrstr)
|
||||||
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true);
|
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true);
|
||||||
|
$extracontent['end_action_list'] = $this->printMarkDocumentButton($document, true);
|
||||||
|
|
||||||
$txt = $this->callHook('documentListItem', $entry, $previewer, false, 'search', $extracontent);
|
$txt = $this->callHook('documentListItem', $entry, $previewer, false, 'search', $extracontent);
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
|
@ -907,6 +992,7 @@ function typeahead() { /* {{{ */
|
||||||
$extracontent['below_title'] = $this->getListRowPath($folder);
|
$extracontent['below_title'] = $this->getListRowPath($folder);
|
||||||
if($attrstr)
|
if($attrstr)
|
||||||
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true);
|
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true);
|
||||||
|
$extracontent['end_action_list'] = $this->printMarkFolderButton($folder, true);
|
||||||
print $this->folderListRow($folder, false, $extracontent);
|
print $this->folderListRow($folder, false, $extracontent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,6 +434,9 @@ ul.qq-upload-list li span {
|
||||||
width: 900px;
|
width: 900px;
|
||||||
margin-left: -450px;
|
margin-left: -450px;
|
||||||
}
|
}
|
||||||
|
.modal-wide .modal-body {
|
||||||
|
max-height: 642px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
|
|
|
@ -1386,7 +1386,7 @@ function getOverallStatusIcon($status) { /* {{{ */
|
||||||
$icon = 'fa fa-question';
|
$icon = 'fa fa-question';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return '<i class="fa '.$icon.'"'.($color ? ' style="color: '.$color.';"' : '').' title="'.getOverallStatusText($status).'"></i>';
|
return '<div style="display: inline-block; white-space: nowrap;"><i class="fa '.$icon.'"'.($color ? ' style="color: '.$color.';"' : '').' title="'.getOverallStatusText($status).'"></i> <span class="d-none d-md-inline-block">'.getOverallStatusText($status).'</span></div>';
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user