mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
3bbdf680de
|
@ -329,6 +329,7 @@
|
|||
- prevent malicious manipulation of referer when setting language
|
||||
- fix setting attributes of type user, group, document, folder when updating
|
||||
a document
|
||||
- objects can be removed from clipboard
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.38
|
||||
|
|
|
@ -286,6 +286,24 @@ class SeedDMS_Session {
|
|||
return (array) $this->data['clipboard'];
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check if object is on clipboard
|
||||
*
|
||||
* @param object $object Document or folder
|
||||
*/
|
||||
function isOnClipboard($object) { /* {{{ */
|
||||
/* id is only set if load() was called before */
|
||||
if($this->id) {
|
||||
$dms = $object->getDMS();
|
||||
if($object->isType('document')) {
|
||||
return in_array($object->getID(), $this->data['clipboard']['docs']);
|
||||
} elseif($object->isType('folder')) {
|
||||
return in_array($object->getID(), $this->data['clipboard']['folders']);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Add to clipboard of session
|
||||
*
|
||||
|
|
|
@ -768,6 +768,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
|
||||
private function folderNavigationBar($folder) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$session = $this->params['session'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
if (!is_object($folder) || !$folder->isType('folder')) {
|
||||
|
@ -812,7 +813,10 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$menuitems['edit_folder_notify'] = array('link'=>$this->params['settings']->_httpRoot."out/out.FolderNotify.php?folderid=". $folderID ."&showtree=". showtree(), 'label'=>getMLText('edit_folder_notify'));
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
if($session->isOnClipboard($folder))
|
||||
$menuitems['remove_from_clipboard'] = array('class'=>'removefromclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_removed_from_clipboard')], ['title', getMLText("remove_from_clipboard")]), 'label'=>getMLText("remove_from_clipboard"));
|
||||
else
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
}
|
||||
if ($accessobject->check_view_access('Indexer') && $this->params['enablefullsearch']) {
|
||||
$menuitems['index_folder'] = array('link'=>$this->params['settings']->_httpRoot."out/out.Indexer.php?folderid=". $folderID."&showtree=".showtree(), 'label'=>getMLText('index_folder'));
|
||||
|
@ -835,6 +839,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
} /* }}} */
|
||||
|
||||
private function documentNavigationBar($document) { /* {{{ */
|
||||
$session = $this->params['session'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessMode = $document->getAccessMode($this->params['user']);
|
||||
|
@ -896,7 +901,10 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$menuitems['edit_document_notify'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentNotify". $docid, 'label'=>getMLText('edit_document_notify'));
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
if($session->isOnClipboard($document))
|
||||
$menuitems['remove_from_clipboard'] = array('class'=>'removefromclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_removed_from_clipboard')], ['title', getMLText("remove_from_clipboard")]), 'label'=>getMLText("remove_from_clipboard"));
|
||||
else
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
}
|
||||
if ($accessobject->check_view_access('TransferDocument')) {
|
||||
$menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document'));
|
||||
|
@ -3304,6 +3312,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
function documentListRowAction($document, $previewer, $skipcont=false, $version=0, $extracontent=array()) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$onepage = $this->params['onepage'];
|
||||
|
@ -3333,7 +3342,10 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['document_access'] = $this->printAccessButton($document, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($document))
|
||||
$actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
|
@ -3539,6 +3551,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
function folderListRowAction($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
// $folder = $this->params['folder'];
|
||||
$showtree = $this->params['showtree'];
|
||||
$enableRecursiveCount = $this->params['enableRecursiveCount'];
|
||||
|
@ -3571,7 +3584,10 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['folder_access'] = $this->printAccessButton($subFolder, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($subFolder))
|
||||
$actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_folder'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("view_folder").'"><i class="fa fa-eye"></i></a>';
|
||||
|
|
|
@ -407,6 +407,8 @@ $(document).ready( function() {
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
|
@ -442,6 +444,8 @@ $(document).ready( function() {
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
|
@ -753,6 +757,8 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'success',
|
||||
|
|
|
@ -701,6 +701,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
|
||||
private function folderNavigationBar($folder) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$session = $this->params['session'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
if (!is_object($folder) || !$folder->isType('folder')) {
|
||||
|
@ -743,7 +744,10 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$menuitems['edit_folder_notify'] = array('link'=>$this->params['settings']->_httpRoot."out/out.FolderNotify.php?folderid=". $folderID ."&showtree=". showtree(), 'label'=>getMLText('edit_folder_notify'));
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
if($session->isOnClipboard($folder))
|
||||
$menuitems['remove_from_clipboard'] = array('class'=>'removefromclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_removed_from_clipboard')], ['title', getMLText("remove_from_clipboard")]), 'label'=>getMLText("remove_from_clipboard"));
|
||||
else
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'F'.$folder->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
}
|
||||
if ($this->params['user']->isAdmin() && $this->params['enablefullsearch']) {
|
||||
$menuitems['index_folder'] = array('link'=>$this->params['settings']->_httpRoot."out/out.Indexer.php?folderid=". $folderID."&showtree=".showtree(), 'label'=>getMLText('index_folder'));
|
||||
|
@ -764,6 +768,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
} /* }}} */
|
||||
|
||||
private function documentNavigationBar($document) { /* {{{ */
|
||||
$session = $this->params['session'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessMode = $document->getAccessMode($this->params['user']);
|
||||
|
@ -823,7 +828,10 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$menuitems['edit_document_notify'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentNotify". $docid, 'label'=>getMLText('edit_document_notify'));
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
if($session->isOnClipboard($document))
|
||||
$menuitems['remove_from_clipboard'] = array('class'=>'removefromclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_removed_from_clipboard')], ['title', getMLText("remove_from_clipboard")]), 'label'=>getMLText("remove_from_clipboard"));
|
||||
else
|
||||
$menuitems['add_to_clipboard'] = array('class'=>'addtoclipboard', 'attributes'=>array(['rel', 'D'.$document->getId()], ['msg', getMLText('splash_added_to_clipboard')], ['title', getMLText("add_to_clipboard")]), 'label'=>getMLText("add_to_clipboard"));
|
||||
}
|
||||
if ($accessobject->check_view_access('TransferDocument')) {
|
||||
$menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document'));
|
||||
|
@ -3278,6 +3286,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
function documentListRowAction($document, $previewer, $skipcont=false, $version=0, $extracontent=array()) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$onepage = $this->params['onepage'];
|
||||
|
@ -3307,7 +3316,10 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['document_access'] = $this->printAccessButton($document, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($document))
|
||||
$actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
|
@ -3565,6 +3577,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
function folderListRowAction($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
// $folder = $this->params['folder'];
|
||||
$showtree = $this->params['showtree'];
|
||||
$enableRecursiveCount = $this->params['enableRecursiveCount'];
|
||||
|
@ -3597,7 +3610,10 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['folder_access'] = $this->printAccessButton($subFolder, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($subFolder))
|
||||
$actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_folder'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("view_folder").'"><i class="fa fa-eye"></i></a>';
|
||||
|
|
|
@ -456,6 +456,8 @@ $(document).ready( function() {
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
|
@ -491,6 +493,8 @@ $(document).ready( function() {
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: attr_msg,
|
||||
type: 'success',
|
||||
|
@ -802,6 +806,8 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
if(data.success) {
|
||||
$("#main-clipboard").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=mainclipboard')
|
||||
$("#menu-clipboard div").html('Loading').load(seeddms_webroot+'out/out.Clipboard.php?action=menuclipboard')
|
||||
$("div.ajax[data-action='navigation']").trigger('update', {});
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {});
|
||||
noty({
|
||||
text: data.message,
|
||||
type: 'success',
|
||||
|
|
Loading…
Reference in New Issue
Block a user