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

This commit is contained in:
Uwe Steinmann 2017-04-11 06:42:27 +02:00
commit 510067a714
17 changed files with 346 additions and 72 deletions

View File

@ -34,6 +34,8 @@
--------------------------------------------------------------------------------
- do not show spinner when clipboard is loaded in menu (prevents flickering of
page)
- add select menu for predifined expiration dates
- add some more hooks
- merged changes from 5.0.12
--------------------------------------------------------------------------------

View File

@ -23,10 +23,13 @@
class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common {
public function run() {
$name = $this->getParam('name');
$comment = $this->getParam('comment');
/* Call preAddDocument early, because it might need to modify some
* of the parameters.
*/
if(false === $this->callHook('preAddDocument')) {
if(false === $this->callHook('preAddDocument', array('name'=>&$name, 'comment'=>&$comment))) {
$this->errormsg = 'hook_preAddDocument_failed';
return null;
}
@ -38,8 +41,6 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common {
$index = $this->params['index'];
$indexconf = $this->params['indexconf'];
$folder = $this->params['folder'];
$name = $this->getParam('name');
$comment = $this->getParam('comment');
$expires = $this->getParam('expires');
$keywords = $this->getParam('keywords');
$cats = $this->getParam('categories');

View File

@ -66,6 +66,7 @@ class SeedDMS_Controller_ApproveDocument extends SeedDMS_Controller_Common {
/* If document was rejected, set the document status to S_REJECTED right away */
if ($approvalstatus == -1){
if($content->setStatus(S_REJECTED,$comment,$user)) {
$this->callHook('postApproveDocument', $content, S_REJECTED);
}
} else {
$docApprovalStatus = $content->getApprovalStatus();
@ -88,8 +89,8 @@ class SeedDMS_Controller_ApproveDocument extends SeedDMS_Controller_Common {
// count of the approvals required for this document.
if ($approvalCT == $approvalTotal) {
// Change the status to released.
$newStatus=S_RELEASED;
if($content->setStatus($newStatus, getMLText("automatic_status_update"), $user)) {
if($content->setStatus(S_RELEASED, getMLText("automatic_status_update"), $user)) {
$this->callHook('postApproveDocument', $content, S_RELEASED);
}
}
}

View File

@ -195,6 +195,15 @@ class SeedDMS_Session {
return true;
} /* }}} */
/**
* Get language of session
*
* @return string language
*/
function getUser() { /* {{{ */
return $this->data['userid'];
} /* }}} */
/**
* Set language of session
*
@ -487,5 +496,28 @@ class SeedDMS_SessionMgr {
return $sessions;
} /* }}} */
/**
* Get list of active sessions with a given time
*
* @return array list of sessions
*/
function getLastAccessedSessions($datetime) { /* {{{ */
if(!$ts = makeTsFromLongDate($datetime))
return false;
$queryStr = "SELECT * FROM `tblSessions` WHERE `lastAccess`>=".$ts;
$queryStr .= " ORDER BY `lastAccess` DESC";
$resArr = $this->db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false)
return false;
$sessions = array();
foreach($resArr as $rec) {
$session = new SeedDMS_Session($this->db);
$session->load($rec['id']);
$sessions[] = $session;
}
return $sessions;
} /* }}} */
}
?>

View File

@ -127,14 +127,31 @@ if (!is_numeric($sequence)) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("invalid_sequence"));
}
$expires = false;
if (!isset($_POST['expires']) || $_POST["expires"] != "false") {
if($_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}
switch($_POST["presetexpdate"]) {
case "date":
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
break;
case "1w":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2]+7, $tmp[0]);
break;
case "1m":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1]+1, $tmp[2], $tmp[0]);
break;
case "1y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+1);
break;
case "2y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+2);
break;
case "never":
default:
$expires = null;
break;
}
// Get the list of reviewers and approvers for this document.

View File

@ -661,7 +661,7 @@ switch($command) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) {
if (method_exists($hookObj, 'postAddDocument')) {
$hookObj->postAddDocument($document);
$hookObj->postAddDocument(null, $document);
}
}
}

View File

@ -43,20 +43,41 @@ if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
$expires = false;
if (!isset($_POST["expires"]) || $_POST["expires"] != "false") {
if(isset($_POST["expdate"]) && $_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}
if (!isset($_POST["presetexpdate"]) || $_POST["presetexpdate"] == "") {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_expiration_date"));
}
switch($_POST["presetexpdate"]) {
case "date":
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
break;
case "1w":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2]+7, $tmp[0]);
break;
case "1m":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1]+1, $tmp[2], $tmp[0]);
break;
case "1y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+1);
break;
case "2y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+2);
break;
case "never":
default:
$expires = null;
break;
}
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['setExpires'] as $hookObj) {
if (method_exists($hookObj, 'preSetExpires')) {
$hookObj->preSetExpires(array('document'=>$document, 'expires'=>&$expires));
$hookObj->preSetExpires(null, array('document'=>$document, 'expires'=>&$expires));
}
}
}
@ -70,7 +91,7 @@ $document->verifyLastestContentExpriry();
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['setExpires'] as $hookObj) {
if (method_exists($hookObj, 'postSetExpires')) {
$hookObj->postSetExpires(array('document'=>$document, 'expires'=>$expires));
$hookObj->postSetExpires(null, array('document'=>$document, 'expires'=>$expires));
}
}
}

View File

@ -71,7 +71,7 @@ $workflow = $transition->getWorkflow();
if(isset($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'] as $hookObj) {
if (method_exists($hookObj, 'preTriggerWorkflowTransition')) {
$hookObj->preTriggerWorkflowTransition(array('version'=>$version, 'transition'=>$transition, 'comment'=>$_POST["comment"]));
$hookObj->preTriggerWorkflowTransition(null, array('version'=>$version, 'transition'=>$transition, 'comment'=>$_POST["comment"]));
}
}
}
@ -130,7 +130,7 @@ if($version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'] as $hookObj) {
if (method_exists($hookObj, 'postTriggerWorkflowTransition')) {
$hookObj->postTriggerWorkflowTransition(array('version'=>$version, 'transition'=>$transition, 'comment'=>$_POST["comment"]));
$hookObj->postTriggerWorkflowTransition(null, array('version'=>$version, 'transition'=>$transition, 'comment'=>$_POST["comment"]));
}
}
}

View File

@ -260,7 +260,7 @@ if ($_FILES['userfile']['error'] == 0) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['updateDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['updateDocument'] as $hookObj) {
if (method_exists($hookObj, 'preUpdateDocument')) {
$hookObj->preUpdateDocument(array('name'=>&$name, 'comment'=>&$comment));
$hookObj->preUpdateDocument(null, array('name'=>&$name, 'comment'=>&$comment));
}
}
}
@ -274,7 +274,7 @@ if ($_FILES['userfile']['error'] == 0) {
if(isset($GLOBALS['SEEDDMS_HOOKS']['updateDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['updateDocument'] as $hookObj) {
if (method_exists($hookObj, 'postUpdateDocument')) {
$hookObj->postUpdateDocument($document);
$hookObj->postUpdateDocument(null, $document);
}
}
}
@ -393,14 +393,31 @@ if ($_FILES['userfile']['error'] == 0) {
}
}
$expires = false;
if (!isset($_POST['expires']) || $_POST["expires"] != "false") {
if($_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}
switch($_POST["presetexpdate"]) {
case "date":
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
break;
case "1w":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2]+7, $tmp[0]);
break;
case "1m":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1]+1, $tmp[2], $tmp[0]);
break;
case "1y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+1);
break;
case "2y":
$tmp = explode('-', date('Y-m-d'));
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]+2);
break;
case "never":
default:
$expires = null;
break;
}
if ($expires) {

40
out/out.Session.php Normal file
View File

@ -0,0 +1,40 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
// Copyright (C) 2010-2016 Uwe Steinmann
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.Utils.php");
include("../inc/inc.Language.php");
include("../inc/inc.Init.php");
include("../inc/inc.Extension.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Authentication.php");
include("../inc/inc.ClassAccessOperation.php");
include("../inc/inc.ClassUI.php");
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if($view) {
$view($_GET);
exit;
}
?>

View File

@ -128,6 +128,12 @@ $(document).ready(function() {
}
}
});
$('#presetexpdate').on('change', function(ev){
if($(this).val() == 'date')
$('#control_expdate').show();
else
$('#control_expdate').hide();
});
});
<?php
$this->printKeywordChooserJs("form1");
@ -219,6 +225,37 @@ $(document).ready(function() {
<td><?php printMLText("sequence");?>:</td>
<td><?php $this->printSequenceChooser($folder->getDocuments('s')); if($orderby != 's') echo "<br />".getMLText('order_by_sequence_off'); ?></td>
</tr>
<?php
if($presetexpiration) {
if(!($expts = strtotime($presetexpiration)))
$expts = false;
} else {
$expts = false;
}
?>
<tr>
<td><?php printMLText("preset_expires");?>:</td>
<td>
<select class="span3" name="presetexpdate" id="presetexpdate">
<option value="never"><?php printMLText('does_not_expire');?></option>
<option value="date"<?php echo ($expts != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option>
<option value="1w"><?php printMLText('expire_in_1w');?></option>
<option value="1m"><?php printMLText('expire_in_1m');?></option>
<option value="1y"><?php printMLText('expire_in_1y');?></option>
<option value="2y"><?php printMLText('expire_in_2y');?></option>
</select>
</td>
</tr>
<tr id="control_expdate" <?php echo ($expts == false ? 'style="display: none;"' : ''); ?>>
<td><?php printMLText("expires");?>:</td>
<td>
<span class="input-append date span6" id="expirationdate" data-date="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>" data-checkbox="#expires">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>
</tr>
<?php if($user->isAdmin()) { ?>
<tr>
<td><?php printMLText("owner");?>:</td>
@ -257,26 +294,16 @@ $(document).ready(function() {
}
}
}
if($presetexpiration) {
if(!($expts = strtotime($presetexpiration)))
$expts = time();
} else {
$expts = time();
$arrs = $this->callHook('addDocumentAttributes', $folder);
if(is_array($arrs)) {
foreach($arrs as $arr) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
}
}
?>
<tr>
<td><?php printMLText("expires");?>:</td>
<td>
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('Y-m-d', $expts); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>" data-checkbox="#expires">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('Y-m-d', $expts); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<label class="checkbox inline">
<input type="checkbox" id="expires" name="expires" value="false" <?php echo ($presetexpiration ? "" : "checked");?>><?php printMLText("does_not_expire");?>
</label>
</td>
</tr>
<tr>
<td>
<?php $this->contentSubHeading(getMLText("version_info")); ?>

View File

@ -401,6 +401,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
//$this->addFooterJS('checkTasks();');
}
if($this->params['user']->isAdmin()) {
echo " <div id=\"menu-session\">";
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Session\" data-action=\"menuSessions\"></div>";
echo " </div>";
}
if($this->params['enableclipboard']) {
echo " <div id=\"menu-clipboard\">";
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Clipboard\" data-action=\"menuClipboard\"></div>";

View File

@ -555,7 +555,7 @@ $(document).ready( function() {
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams);
// $this->contentContainerStart();
$txt = $this->callHook('searchListHeader', $folder, '');
$txt = $this->callHook('searchListHeader');
if(is_string($txt))
echo $txt;
else {
@ -602,14 +602,16 @@ $(document).ready( function() {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\">";
}
print "</a></td>";
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">";
print $docName;
print "</a>";
print "<br /><span style=\"font-size: 85%;\">".getMLText('in_folder').": /";
$folder = $document->getFolder();
$path = $folder->getPath();
for ($i = 1; $i < count($path); $i++) {
print htmlspecialchars($path[$i]->getName())."/";
}
print $docName;
print "</a>";
print "</span>";
print "<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', $lc->getDate())."</b></span>";
if($comment) {
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";

View File

@ -0,0 +1,68 @@
<?php
/**
* Implementation of Clipboard view
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Include parent class
*/
require_once("class.Bootstrap.php");
/**
* Class which outputs the html page for clipboard view
*
* @category DMS
* @package SeedDMS
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_View_Session extends SeedDMS_Bootstrap_Style {
/**
* Returns the html needed for the clipboard list in the menu
*
* This function renders the clipboard in a way suitable to be
* used as a menu
*
* @param array $clipboard clipboard containing two arrays for both
* documents and folders.
* @return string html code
*/
public function menuSessions() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$sessionmgr = new SeedDMS_SessionMgr($dms->getDB());
$sessions = $sessionmgr->getLastAccessedSessions(date('Y-m-d H:i:s', time()-3600));
if ($user->isGuest() || count($sessions) == 0) {
return '';
}
$content = '';
$content .= " <ul id=\"main-menu-session\" class=\"nav pull-right\">\n";
$content .= " <li class=\"dropdown add-session-area\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" class=\"add-session-area\">".getMLText('Sessions')." (".count($sessions).") <i class=\"icon-caret-down\"></i></a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
foreach($sessions as $session) {
if($sesuser = $dms->getUser($session->getUser()))
$content .= " <li><a href=\"../out/out.ViewFolder.php?folderid=".$sesuser->getID(). "\"><i class=\"icon-user\"></i> ".htmlspecialchars($sesuser->getFullName())." ".getReadableDuration(time()-$session->getLastAccess())."</a></li>\n";
}
$content .= " </ul>\n";
$content .= " </li>\n";
$content .= " </ul>\n";
echo $content;
} /* }}} */
}

View File

@ -31,6 +31,20 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_SetExpires extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript');
?>
$(document).ready( function() {
$('#presetexpdate').on('change', function(ev){
if($(this).val() == 'date')
$('#control_expdate').show();
else
$('#control_expdate').hide();
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -53,15 +67,25 @@ class SeedDMS_View_SetExpires extends SeedDMS_Bootstrap_Style {
<form class="form-horizontal" action="../op/op.SetExpires.php" method="post">
<input type="hidden" name="documentid" value="<?php print $document->getID();?>">
<div class="control-group">
<label class="control-label" for="login"><?php printMLText("preset_expires");?>:</label>
<div class="controls">
<select name="presetexpdate" id="presetexpdate">
<option value="never"><?php printMLText('does_not_expire');?></option>
<option value="date"<?php echo ($expdate != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option>
<option value="1w"><?php printMLText('expire_in_1w');?></option>
<option value="1m"><?php printMLText('expire_in_1m');?></option>
<option value="1y"><?php printMLText('expire_in_1y');?></option>
<option value="2y"><?php printMLText('expire_in_2y');?></option>
</select>
</div>
</div>
<div class="control-group" id="control_expdate">
<label class="control-label"><?php printMLText("expires");?>:</label>
<div class="controls">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo $expdate; ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span6" name="expdate" type="text" value="<?php echo $expdate; ?>">
<input class="span3" name="expdate" type="text" value="<?php echo $expdate; ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span><br />
<label class="checkbox inline">
<input type="checkbox" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>
</label>
</span>
</div>
</div>
<div class="controls">

View File

@ -119,6 +119,12 @@ console.log(element);
}
}
});
$('#presetexpdate').on('change', function(ev){
if($(this).val() == 'date')
$('#control_expdate').show();
else
$('#control_expdate').hide();
});
});
<?php
} /* }}} */
@ -239,21 +245,31 @@ console.log(element);
<?php
if($presetexpiration) {
if(!($expts = strtotime($presetexpiration)))
$expts = time();
$expts = false;
} else {
$expts = time();
$expts = false;
}
?>
<tr>
<td><?php printMLText("preset_expires");?>:</td>
<td>
<select class="span6" name="presetexpdate" id="presetexpdate">
<option value="never"><?php printMLText('does_not_expire');?></option>
<option value="date"<?php echo ($expts != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option>
<option value="1w"><?php printMLText('expire_in_1w');?></option>
<option value="1m"><?php printMLText('expire_in_1m');?></option>
<option value="1y"><?php printMLText('expire_in_1y');?></option>
<option value="2y"><?php printMLText('expire_in_2y');?></option>
</select>
</td>
</tr>
<tr id="control_expdate" <?php echo ($expts == false ? 'style="display: none;"' : ''); ?>>
<td><?php printMLText("expires");?>:</td>
<td class="standardText">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('Y-m-d', $expts); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('Y-m-d', $expts); ?>">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span6" size="16" name="expdate" type="text" value="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span><br />
<label class="checkbox inline">
<input type="checkbox" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>
</label>
</span>
</td>
</tr>
<?php

View File

@ -1517,7 +1517,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td><ul class=\"unstyled\">\n";
print "<li>".htmlspecialchars($file->getName())."</li>\n";
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
if($file->getName() != $file->getOriginalFileName())
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
if ($file_exists)
print "<li>".SeedDMS_Core_File::format_filesize(filesize($dms->contentDir . $file->getPath())) ." bytes, ".htmlspecialchars($file->getMimeType())."</li>";
else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";