Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2019-10-17 07:22:16 +02:00
commit a870602324
13 changed files with 209 additions and 87 deletions

View File

@ -127,6 +127,10 @@
- add section in README.Install.md on how to secure the configuration
- fix php error when removing a version of a document
- major rework of ViewFolder page, most parts of the page are now loaded by ajax
- do not set mandatory reviewer when document is uploaded and workflow mode is
set to 'traditional without review'.
- turn off auto complete for date fields
- new hook pageNavigationBar
--------------------------------------------------------------------------------
Changes in version 5.1.12

View File

@ -1796,6 +1796,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
$version = $resArr[0]['m']+1;
}
if($fileType == '.')
$fileType = '';
$filesize = SeedDMS_Core_File::fileSize($tmpFile);
$checksum = SeedDMS_Core_File::checksum($tmpFile);
@ -1968,6 +1970,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
if(!$content)
return false;
if($fileType == '.')
$fileType = '';
/* Check if $user, $orgFileName, $fileType and $mimetype are the same */
if($user->getID() != $content->getUser()->getID()) {
return false;
@ -3146,20 +3151,31 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
/**
* Recalculate the status of a document
*
* The methods checks the review and approval status and sets the
* status of the document accordingly.
* If status is S_RELEASED and version has workflow set status
* to S_IN_WORKFLOW
* If status is S_RELEASED and there are reviewers set status S_DRAFT_REV
* If status is S_RELEASED or S_DRAFT_REV and there are approvers set
*
* If status is S_RELEASED and the version has a workflow, then set
* the status to S_IN_WORKFLOW
* If status is S_RELEASED and there are reviewers => set status S_DRAFT_REV
* If status is S_RELEASED or S_DRAFT_REV and there are approvers => set
* status S_DRAFT_APP
* If status is draft and there are no approver and no reviewers set
* If status is draft and there are no approver and no reviewers => set
* status to S_RELEASED
* The status of a document with the current status S_OBSOLETE, S_REJECTED,
* or S_EXPIRED will not be changed unless the parameter
* $ignorecurrentstatus is set to true.
*
* This method may not be called after a negative approval or review to
* recalculated the status, because
* it doesn't take a defeating approval or review into account. It will
* just check for a pending workflow, approval or review and set the status
* accordingly, e.g. after the list of reviewers or appovers has been
* modified. If there is not pending workflow, approval or review the
* status will be set to S_RELEASED.
*
* This method will call {@see SeedDMS_Core_DocumentContent::setStatus()}
* which checks if the state has actually changed. This is, why this
* which checks if the status has actually changed. This is, why this
* function can be called at any time without harm to the status log.
* The $initialstatus can be set, to define the status set when no other
* status is set. This happens if the document has no
@ -3226,7 +3242,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
}
}
/* First check for an open review, approval, revision. */
/* First check for a running workflow, review, approval, revision. */
if ($hasworkflow) $this->setStatus(S_IN_WORKFLOW,$msg,$user);
elseif ($pendingReview) $this->setStatus(S_DRAFT_REV,$msg,$user);
elseif ($pendingApproval) $this->setStatus(S_DRAFT_APP,$msg,$user);
@ -3331,7 +3347,16 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return $this->_user;
} /* }}} */
function getPath() { return $this->_document->getDir() . $this->_version . $this->_fileType; }
/**
* Return path of file on disk relative to the content directory
*
* Since version 5.1.13 a single '.' in the fileType will be skipped.
* On Windows a file named 'name.' will be saved as 'name' but the fileType
* will contain the a single '.'.
*
* @return string path of file on disc
*/
function getPath() { return $this->_document->getDir() . $this->_version . ($this->_fileType != '.' ? $this->_fileType : ''); }
function setRevisionDate($date = false) { /* {{{ */
$db = $this->_document->_dms->getDB();

View File

@ -80,11 +80,10 @@ a revision can also be started if some revisors have already reviewed the docume
<file name="inc.ClassWorkflow.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<<<<<<< HEAD
<file name="inc.ClassTransmittal.php" role="php">
=======
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file name="inc.ClassDecorator.php" role="php">
>>>>>>> seeddms-5.1.x
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
</dir> <!-- /DTD -->
@ -1714,6 +1713,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
<notes>
- add decorators
- add new methods SeedDMS_Core_Document::isType(), SeedDMS_Core_Folder::isType(), SeedDMS_Core_DocumentContent::isType(). Use them instead of checking the class name.
- skip a fileType with just a '.'
</notes>
</release>
<release>

View File

@ -99,6 +99,7 @@ class SeedDMS_SQLiteFTS_Indexer {
$sql = "INSERT INTO docs (docid, title, comment, keywords, category, owner, content, mimetype, origfilename, created) VALUES(".$doc->getFieldValue('document_id').", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($doc->getFieldValue('comment')).", ".$this->_conn->quote($doc->getFieldValue('keywords')).", ".$this->_conn->quote($doc->getFieldValue('category')).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($doc->getFieldValue('content')).", ".$this->_conn->quote($doc->getFieldValue('mimetype')).", ".$this->_conn->quote($doc->getFieldValue('origfilename')).", ".time().")";
$res = $this->_conn->exec($sql);
if($res === false) {
return false;
var_dump($this->_conn->errorInfo());
}
return $res;

View File

@ -352,6 +352,10 @@ class SeedDMS_Extension_Mgr {
public function updateExtension($file) { /* {{{ */
/* unzip the extension in a temporary directory */
$newdir = $this->cachedir ."/ext.new";
/* First remove a left over from a previous extension */
if(file_exists($newdir)) {
self::rrmdir($newdir);
}
if(!mkdir($newdir, 0755)) {
$this->errmsgs[] = "Cannot create temp. extension directory";
return false;
@ -379,7 +383,10 @@ class SeedDMS_Extension_Mgr {
$this->rrmdir($this->extdir ."/". $extname);
}
/* Move the temp. created ext directory to the final location */
rename($newdir, $this->extdir ."/". $extname);
if(!rename($newdir, $this->extdir ."/". $extname)) {
$this->rrmdir($this->extdir ."/". $extname);
return false;
}
return true;
} /* }}} */

View File

@ -181,11 +181,20 @@ class SeedDMS_View_Common {
* null if no hook was called
*/
public function hasHook($hook) { /* {{{ */
$tmps = array();
$tmp = explode('_', get_class($this));
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])] as $hookObj) {
if (method_exists($hookObj, $hook)) {
return true;
$tmps[] = $tmp[2];
$tmp = explode('_', get_parent_class($this));
$tmps[] = $tmp[2];
/* Run array_unique() in case the parent class has the same suffix */
$tmps = array_unique($tmps);
$ret = null;
foreach($tmps as $tmp) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)] as $hookObj) {
if (method_exists($hookObj, $hook)) {
return true;
}
}
}
}

View File

@ -688,47 +688,54 @@ switch($command) {
$reviewers["g"] = array();
$approvers["i"] = array();
$approvers["g"] = array();
$workflow = null;
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
$res=$user->getMandatoryReviewers();
foreach ($res as $r){
if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') {
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
if($settings->_workflowMode == 'traditional') {
$res=$user->getMandatoryReviewers();
foreach ($res as $r){
if ($r['reviewerUserID']!=0){
foreach ($docAccess["users"] as $usr)
if ($usr->getID()==$r['reviewerUserID']){
$reviewers["i"][] = $r['reviewerUserID'];
break;
if ($r['reviewerUserID']!=0){
foreach ($docAccess["users"] as $usr)
if ($usr->getID()==$r['reviewerUserID']){
$reviewers["i"][] = $r['reviewerUserID'];
break;
}
}
}
else if ($r['reviewerGroupID']!=0){
foreach ($docAccess["groups"] as $grp)
if ($grp->getID()==$r['reviewerGroupID']){
$reviewers["g"][] = $r['reviewerGroupID'];
break;
else if ($r['reviewerGroupID']!=0){
foreach ($docAccess["groups"] as $grp)
if ($grp->getID()==$r['reviewerGroupID']){
$reviewers["g"][] = $r['reviewerGroupID'];
break;
}
}
}
}
}
$res=$user->getMandatoryApprovers();
foreach ($res as $r){
$res=$user->getMandatoryApprovers();
foreach ($res as $r){
if ($r['approverUserID']!=0){
foreach ($docAccess["users"] as $usr)
if ($usr->getID()==$r['approverUserID']){
$approvers["i"][] = $r['approverUserID'];
break;
}
}
else if ($r['approverGroupID']!=0){
foreach ($docAccess["groups"] as $grp)
if ($grp->getID()==$r['approverGroupID']){
$approvers["g"][] = $r['approverGroupID'];
break;
}
if ($r['approverUserID']!=0){
foreach ($docAccess["users"] as $usr)
if ($usr->getID()==$r['approverUserID']){
$approvers["i"][] = $r['approverUserID'];
break;
}
}
else if ($r['approverGroupID']!=0){
foreach ($docAccess["groups"] as $grp)
if ($grp->getID()==$r['approverGroupID']){
$approvers["g"][] = $r['approverGroupID'];
break;
}
}
}
} elseif($settings->_workflowMode == 'advanced') {
$workflow = $user->getMandatoryWorkflow();
}
$workflow = $user->getMandatoryWorkflow();
$expires = false;
if($settings->_presetExpirationDate) {

View File

@ -98,6 +98,7 @@ if($view) {
$view->setParam('incItemsPerPage', $settings->_incItemsPerPage != 0 ? $settings->_incItemsPerPage : $settings->_maxItemsPerPage);
$view->setParam('offset', $offset);
$view->setParam('limit', $limit);
$view->setParam('onepage', true); // do most navigation by reloading areas of pages with ajax
$view($_GET);
exit;
}

View File

@ -157,6 +157,7 @@ $(document).ready( function() {
$('body').on('click', 'a.addtoclipboard', function(ev) { /* {{{ */
ev.preventDefault();
ev.stopPropagation();
attr_rel = $(ev.currentTarget).attr('rel');
attr_msg = $(ev.currentTarget).attr('msg');
type = attr_rel.substring(0, 1) == 'F' ? 'folder' : 'document';
@ -545,7 +546,7 @@ function onAddClipboard(ev) { /* {{{ */
maxFileSizeMsg = msg;
}
function sendFileToServer(formData,status) {
function sendFileToServer(formData,status,callback) {
var uploadURL = ajaxurl; //Upload URL
var extraData ={}; //Extra Data.
var jqXHR=$.ajax({
@ -584,6 +585,9 @@ function onAddClipboard(ev) { /* {{{ */
timeout: 1500,
});
status.statusbar.after($('<a href="../out/out.EditDocument.php?documentid=' + data.data + '" class="btn btn-mini btn-primary">' + editBtnLabel + '</a>'));
if(callback) {
callback();
}
} else {
noty({
text: data.message,
@ -665,7 +669,10 @@ function onAddClipboard(ev) { /* {{{ */
statusbar.parent().show();
var status = new createStatusbar(statusbar);
status.setFileNameSize(files[i].name,files[i].size);
sendFileToServer(fd,status);
sendFileToServer(fd,status,function(){
if(target_id == seeddms_folder)
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
});
} else {
noty({
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
@ -1155,7 +1162,6 @@ $(document).ready(function() { /* {{{ */
var updateDropFolder = function() {
$('#menu-dropfolder > div.ajax').trigger('update', {folderid: seeddms_folder});
console.log(seeddms_folder);
timeOutId = setTimeout(updateDropFolder, 60000);
}

View File

@ -213,7 +213,22 @@ $(document).ready( function() {
<div class="control-group">
<label class="control-label"><?php printMLText("attrdef_type");?>:</label>
<div class="controls">
<select name="type"><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_int ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int) echo "selected"; ?>><?php printMLText('attrdef_type_int'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_float ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_float) echo "selected"; ?>><?php printMLText('attrdef_type_float'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_string ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_string) echo "selected"; ?>><?php printMLText('attrdef_type_string'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_boolean ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_boolean) echo "selected"; ?>><?php printMLText('attrdef_type_boolean'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_date ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) echo "selected"; ?>><?php printMLText('attrdef_type_date'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_email ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_email) echo "selected"; ?>><?php printMLText('attrdef_type_email'); ?></option><option value="<?php echo SeedDMS_Core_AttributeDefinition::type_url ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_url) echo "selected"; ?>><?php printMLText('attrdef_type_url'); ?></option></select>
<select name="type">
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_int ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int) echo "selected"; ?>><?php printMLText('attrdef_type_int'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_float ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_float) echo "selected"; ?>><?php printMLText('attrdef_type_float'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_string ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_string) echo "selected"; ?>><?php printMLText('attrdef_type_string'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_boolean ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_boolean) echo "selected"; ?>><?php printMLText('attrdef_type_boolean'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_date ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) echo "selected"; ?>><?php printMLText('attrdef_type_date'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_email ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_email) echo "selected"; ?>><?php printMLText('attrdef_type_email'); ?></option>
<option value="<?php echo SeedDMS_Core_AttributeDefinition::type_url ?>" <?php if($attrdef && $attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_url) echo "selected"; ?>><?php printMLText('attrdef_type_url'); ?></option>
<?php
if($moreoptions = $this->callHook('additionalTypes', $attrdef)) {
foreach($moreoptions as $option) {
echo '<option value="'.(int) $option['value'].'" '.($attrdef && $attrdef->getType() == $option['value'] ? "selected" : "").'>'.$option['name'].'</option>';
}
}
?>
</select>
</div>
</div>
<?php

View File

@ -534,6 +534,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
case "calendar";
$this->calendarNavigationBar($extra);
break;
default:
if($this->hasHook('pageNavigationBar')) {
$menubar = $this->callHook('pageNavigationBar', $pageType, $extra);
if(is_string($menubar))
echo $menubar;
}
}
echo " </div>\n";
echo " </div>\n";
@ -1205,14 +1211,14 @@ $(document).ready(function() {
echo self::getFileChooserHtml($varname, $multiple, $accept);
} /* }}} */
function printDateChooser($defDate = '', $varName) { /* {{{ */
echo self::getDateChooser($defDate, $varName);
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd') { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat);
} /* }}} */
function getDateChooser($defDate = '', $varName, $lang='') { /* {{{ */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd') { /* {{{ */
$content = '
<span class="input-append date span12 datepicker" id="'.$varName.'date" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="yyyy-mm-dd"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').'>
<input class="span6" size="16" name="'.$varName.'" type="text" value="'.$defDate.'">
<span class="input-append date span12 datepicker" id="'.$varName.'date" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').'>
<input class="span6" size="16" name="'.$varName.'" id="'.$varName.'" type="text" value="'.$defDate.'" autocomplete="off">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>';
return $content;
@ -1748,19 +1754,24 @@ $(document).ready(function() {
* @param boolean $showdocs set to true if tree shall contain documents
* as well.
* @param integer $expandtree level to which the tree shall be opened
* @param boolean $partialtree set to true if the given folder is the start folder
*/
function printNewTreeNavigationJs($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='', $partialtree=false) { /* {{{ */
function jqtree($obj, $path, $folder, $user, $accessmode, $showdocs=1, $expandtree=0, $orderby='', $level=0) {
$orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc');
if($path || $expandtree>=$level) {
if($path/* || $expandtree>=$level*/) {
if($path)
$pathfolder = array_shift($path);
$children = array();
$subfolders = $folder->getSubFolders(isset($orderby[0]) ? $orderby[0] : '', $orderdir);
$subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, $accessmode);
if($expandtree) {
$subfolders = $folder->getSubFolders(isset($orderby[0]) ? $orderby[0] : '', $orderdir);
$subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, $accessmode);
} else {
$subfolders = array($pathfolder);
}
foreach($subfolders as $subfolder) {
$node = array('label'=>$subfolder->getName(), 'id'=>$subfolder->getID(), 'load_on_demand'=>($subfolder->hasSubFolders() || ($subfolder->hasDocuments() && $showdocs)) ? true : false, 'is_folder'=>true);
if($expandtree>=$level || $pathfolder->getID() == $subfolder->getID()) {
if(/*$expandtree>=$level ||*/ $pathfolder->getID() == $subfolder->getID()) {
$node['children'] = jqtree($obj, $path, $subfolder, $user, $accessmode, $showdocs, $expandtree, $orderby, $level+1);
if($showdocs) {
$documents = $subfolder->getDocuments(isset($orderby[0]) ? $orderby[0] : '', $orderdir);
@ -1792,10 +1803,11 @@ $(document).ready(function() {
$orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc');
if($folderid) {
$folder = $this->params['dms']->getFolder($folderid);
$path = $folder->getPath();
if(!$partialtree) {
$folder = array_shift($path);
$path = $folder->getPath();
}
/* Get the first folder (root folder) of path */
$folder = array_shift($path);
$node = array('label'=>$folder->getName(), 'id'=>$folder->getID(), 'load_on_demand'=>false, 'is_folder'=>true);
if(!$folder->hasSubFolders()) {
$node['load_on_demand'] = true;
@ -1831,7 +1843,7 @@ $(function() {
const $tree = $('#jqtree<?php echo $formid ?>');
$tree.tree({
// saveState: true,
selectable: false,
selectable: true,
data: data,
saveState: 'jqtree<?php echo $formid; ?>',
openedIcon: $('<i class="icon-minus-sign"></i>'),
@ -1842,7 +1854,7 @@ $(function() {
} else
documentSelected<?php echo $formid ?>(node.id, node.name);
},
autoOpen: true,
autoOpen: false,
drapAndDrop: true,
onCreateLi: function(node, $li) {
// Add 'icon' span before title
@ -2001,6 +2013,7 @@ $(function() {
$(document).ready(function () {
// $('.delete-document-btn').click(function(ev) {
$('body').on('click', 'a.delete-document-btn', function(ev){
ev.stopPropagation();
id = $(ev.currentTarget).attr('rel');
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
msg = $(ev.currentTarget).attr('msg');
@ -2074,6 +2087,7 @@ $(function() {
$(document).ready(function () {
// $('.delete-folder-btn').click(function(ev) {
$('body').on('click', 'a.delete-folder-btn', function(ev){
ev.stopPropagation();
id = $(ev.currentTarget).attr('rel');
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
msg = $(ev.currentTarget).attr('msg');
@ -2411,6 +2425,7 @@ $(document).ready( function() {
$previewwidth = $this->params['previewWidthList'];
$enableClipboard = $this->params['enableclipboard'];
$accessop = $this->params['accessobject'];
$onepage = $this->params['onepage'];
$content = '';
@ -2471,8 +2486,11 @@ $(document).ready( function() {
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
$content .= "</td>";
$content .= "<td>";
$content .= "<a draggable=\"false\" href=\"../out/out.ViewDocument.php?documentid=".$docID."&showtree=".$showtree."\">" . htmlspecialchars($document->getName()) . "</a>";
$content .= "<td>";
if($onepage)
$content .= "<b>".htmlspecialchars($document->getName()) . "</b>";
else
$content .= "<a draggable=\"false\" href=\"../out/out.ViewDocument.php?documentid=".$docID."&showtree=".$showtree."\">" . htmlspecialchars($document->getName()) . "</a>";
if(isset($extracontent['below_title']))
$content .= $extracontent['below_title'];
$content .= "<br /><span style=\"font-size: 85%; font-style: italic; color: #666; \">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $document->getDate())."</b>, ".getMLText('version')." <b>".$version."</b> - <b>".date('Y-m-d', $latestContent->getDate())."</b>".($document->expires() ? ", ".getMLText('expires').": <b>".getReadableDate($document->getExpires())."</b>" : "")."</span>";
@ -2603,6 +2621,7 @@ $(document).ready( function() {
$enableRecursiveCount = $this->params['enableRecursiveCount'];
$maxRecursiveCount = $this->params['maxRecursiveCount'];
$enableClipboard = $this->params['enableclipboard'];
$onepage = $this->params['onepage'];
$owner = $subFolder->getOwner();
$comment = $subFolder->getComment();
@ -2611,7 +2630,10 @@ $(document).ready( function() {
$content = '';
$content .= $this->folderListRowStart($subFolder);
$content .= "<td><a draggable=\"false\" href=\"../out/out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\"><img draggable=\"false\" src=\"".$this->getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0></a></td>\n";
$content .= "<td><a draggable=\"false\" href=\"../out/out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . "</a>";
if($onepage)
$content .= "<td>" . "<b>".htmlspecialchars($subFolder->getName())."</b>";
else
$content .= "<td><a draggable=\"false\" href=\"../out/out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . "</a>";
$content .= "<br /><span style=\"font-size: 85%; font-style: italic; color: #666;\">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $subFolder->getDate())."</b></span>";
if($comment) {
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";

View File

@ -806,17 +806,17 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<div class="tab-pane <?php if($currenttab == 'revapp') echo 'active'; ?>" id="revapp">
<?php
print "<div class=\"row-fluid\">";
print "<div class=\"span6\">";
// $this->contentContainerStart();
print "<legend>".getMLText('reviewers')."</legend>";
print "<table class=\"table table-condensed\">\n";
/* Just check fo an exting reviewStatus, even workflow mode is set
* to traditional_only_approval. There may be old documents which
* are still in S_DRAFT_REV.
*/
if (/*$workflowmode != 'traditional_only_approval' &&*/ is_array($reviewStatus) && count($reviewStatus)>0) {
print "<div class=\"span6\">";
// $this->contentContainerStart();
print "<legend>".getMLText('reviewers')."</legend>";
print "<table class=\"table table-condensed\">\n";
print "<tr>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("last_update").", ".getMLText("comment")."</th>\n";
@ -898,11 +898,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "</tr>\n";
}
}
}
print "</table>";
print "</table>";
// $this->contentContainerEnd();
print "</div>";
print "</div>";
}
print "<div class=\"span6\">";
// $this->contentContainerStart();
print "<legend>".getMLText('approvers')."</legend>";

View File

@ -100,15 +100,23 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
$enableDropUpload = $this->params['enableDropUpload'];
$maxItemsPerPage = $this->params['maxItemsPerPage'];
$showtree = $this->params['showtree'];
$onepage = $this->params['onepage'];
$sitename = trim(strip_tags($this->params['sitename']));
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
?>
seeddms_folder = <?= $folder->getID() ?>;
function folderSelected(id, name) {
// window.location = '../out/out.ViewFolder.php?folderid=' + id;
<?php if(!$onepage) { ?>
window.location = '../out/out.ViewFolder.php?folderid=' + id;
<?php } else { ?>
seeddms_folder = id;
title_prefix = "<?= (strlen($sitename)>0 ? $sitename : "SeedDMS") ?>";
$('div.ajax').trigger('update', {folderid: id, orderby: '<?= $orderby ?>'});
document.title = title_prefix+": "+name;
window.history.pushState({"html":"","pageTitle":title_prefix+": "+name},"", '../out/out.ViewFolder.php?folderid=' + id);
<?php } ?>
}
<?php if($maxItemsPerPage) { ?>
function loadMoreObjects(element, limit) {
@ -147,15 +155,32 @@ $('#loadmore').click(function(e) {
});
<?php } ?>
/*
$('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
attr_id = $(ev.currentTarget).attr('id').split('-')[3];
<?php
if($onepage) {
?>
window.onpopstate = function(event) {
console.log("location: " + document.location + ", state: " + JSON.stringify(event.state));
console.log(JSON.stringify(event.state));
window.location = document.location;
};
$('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) {
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
folderSelected(attr_id, '');
$([document.documentElement, document.body]).animate({
scrollTop: 200
}, 200);
});
*/
$('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(ev) {
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
window.location = '../out/out.ViewDocument.php?documentid=' + attr_id;
});
$('body').on('click', '.order-btn', function(ev) {
ev.preventDefault();
var element = $(this);
var orderby = element.data('orderby');
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder, orderby: orderby});
});
<?php } ?>
<?php
if($showtree == 1)
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 0, '', ($expandFolderTree == 1) ? -1 : 3, $orderby);
@ -233,7 +258,6 @@ $('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showFolderAttribute', $folder, $attribute);
if(is_array($arr)) {
echo $txt;
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1].":</td>";
@ -268,6 +292,7 @@ $('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
$previewconverters = $this->params['previewConverters'];
$timeout = $this->params['timeout'];
$xsendfile = $this->params['xsendfile'];
$onepage = $this->params['onepage'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
$previewer->setConverters($previewconverters);
@ -286,7 +311,7 @@ $('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
if($documents === null)
$documents = $folder->getDocuments($orderby[0], $orderdir);
$documents = SeedDMS_Core_DMS::filterAccess($documents, $user, M_READ);
$parent = null; //$folder->getParent();
$parent = $onepage ? $folder->getParent() : null;
$txt = $this->callHook('folderListPreContent', $folder, $subFolders, $documents);
if(is_string($txt))
@ -301,9 +326,9 @@ $('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
print "<thead>\n<tr>\n";
print "<th>".($parent ? '<button class="btn btn-mini btn-default" id="table-row-folder-'.$parent->getID().'"><i class="icon-arrow-up"></i></button>' : '')."</th>\n";
print "<th>".getMLText("name");
print " <a href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="n"||$orderby=="na"?"&orderby=nd":"&orderby=n")."\" title=\"".getMLText("sort_by_name")."\">".($orderby=="n"||$orderby=="na"?' <i class="icon-sort-by-alphabet selected"></i>':($orderby=="nd"?' <i class="icon-sort-by-alphabet-alt selected"></i>':' <i class="icon-sort-by-alphabet"></i>'))."</a>";
print " <a href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="s"||$orderby=="sa"?"&orderby=sd":"&orderby=s")."\" title=\"".getMLText("sort_by_sequence")."\">".($orderby=="s"||$orderby=="sa"?' <i class="icon-sort-by-order selected"></i>':($orderby=="sd"?' <i class="icon-sort-by-order-alt selected"></i>':' <i class="icon-sort-by-order"></i>'))."</a>";
print " <a href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="d"||$orderby=="da"?"&orderby=dd":"&orderby=d")."\" title=\"".getMLText("sort_by_date")."\">".($orderby=="d"||$orderby=="da"?' <i class="icon-sort-by-attributes selected"></i>':($orderby=="dd"?' <i class="icon-sort-by-attributes-alt selected"></i>':' <i class="icon-sort-by-attributes"></i>'))."</a>";
print " <a class=\"order-btn\" href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="n"||$orderby=="na"?"&orderby=nd":"&orderby=n")."\" data-orderby=\"".($orderby=="n"||$orderby=="na"?"nd":"n")."\"title=\"".getMLText("sort_by_name")."\">".($orderby=="n"||$orderby=="na"?' <i class="icon-sort-by-alphabet selected"></i>':($orderby=="nd"?' <i class="icon-sort-by-alphabet-alt selected"></i>':' <i class="icon-sort-by-alphabet"></i>'))."</a>";
print " <a class=\"order-btn\" href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="s"||$orderby=="sa"?"&orderby=sd":"&orderby=s")."\" data-orderby=\"".($orderby=="s"||$orderby=="sa"?"sd":"s")."\" title=\"".getMLText("sort_by_sequence")."\">".($orderby=="s"||$orderby=="sa"?' <i class="icon-sort-by-order selected"></i>':($orderby=="sd"?' <i class="icon-sort-by-order-alt selected"></i>':' <i class="icon-sort-by-order"></i>'))."</a>";
print " <a class=\"order-btn\" href=\"../out/out.ViewFolder.php?folderid=". $folderid .($orderby=="d"||$orderby=="da"?"&orderby=dd":"&orderby=d")."\" data-orderby=\"".($orderby=="d"||$orderby=="da"?"dd":"d")."\" title=\"".getMLText("sort_by_date")."\">".($orderby=="d"||$orderby=="da"?' <i class="icon-sort-by-attributes selected"></i>':($orderby=="dd"?' <i class="icon-sort-by-attributes-alt selected"></i>':' <i class="icon-sort-by-attributes"></i>'))."</a>";
print "</th>\n";
// print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
@ -547,7 +572,7 @@ $('body').on('click', '[id^=\"table-row-folder\"]', function(ev) {
echo "<div class=\"span4\">";
// $this->dropUpload();
?>
<div class="ajax" data-view="ViewFolder" data-action="dropUpload" <?php echo ($folder ? "data-query=\"folderid=".$folder->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="ViewFolder" data-action="dropUpload" data-no-spinner="true" <?php echo ($folder ? "data-query=\"folderid=".$folder->getID()."\"" : "") ?>></div>
<?php
echo "</div>";