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

This commit is contained in:
Uwe Steinmann 2018-01-30 08:05:00 +01:00
commit 89ad08a537
15 changed files with 235 additions and 315 deletions

View File

@ -70,6 +70,9 @@
- add preview for webm videos (Closes #374) - add preview for webm videos (Closes #374)
- add support for apache mod_xsendfile, minor optimization of file download - add support for apache mod_xsendfile, minor optimization of file download
- animate button to download more objects in folder list which loading is active - animate button to download more objects in folder list which loading is active
- use converters for creating preview images as configured in settings (Closes #389)
- propperly check if user is already in database when doing ldap auth (Closes #388)
- list linked documents on the ViewDocument page in the way as in other document lists
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.5 Changes in version 5.1.5

View File

@ -24,6 +24,8 @@
*/ */
class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
protected $errormsg;
static function execWithTimeout($cmd, $timeout=2) { /* {{{ */ static function execWithTimeout($cmd, $timeout=2) { /* {{{ */
$descriptorspec = array( $descriptorspec = array(
0 => array("pipe", "r"), 0 => array("pipe", "r"),
@ -37,17 +39,23 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
if (!is_resource($process)) { if (!is_resource($process)) {
throw new Exception("proc_open failed on: " . $cmd); throw new Exception("proc_open failed on: " . $cmd);
} }
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
$output = ''; $output = $error = '';
$timeleft = $timeout - time(); $timeleft = $timeout - time();
$read = array($pipes[1]); $read = array($pipes[1], $pipes[2]);
$write = NULL; $write = NULL;
$exeptions = NULL; $exeptions = NULL;
do { do {
stream_select($read, $write, $exeptions, $timeleft, 200000); $num_changed_streams = stream_select($read, $write, $exeptions, $timeleft, 200000);
if (!empty($read)) { if ($num_changed_streams === false) {
proc_terminate($process);
throw new Exception("stream select failed on: " . $cmd);
} elseif ($num_changed_streams > 0) {
$output .= fread($pipes[1], 8192); $output .= fread($pipes[1], 8192);
$error .= fread($pipes[2], 8192);
} }
$timeleft = $timeout - time(); $timeleft = $timeout - time();
} while (!feof($pipes[1]) && $timeleft > 0); } while (!feof($pipes[1]) && $timeleft > 0);
@ -56,7 +64,7 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
proc_terminate($process); proc_terminate($process);
throw new Exception("command timeout on: " . $cmd); throw new Exception("command timeout on: " . $cmd);
} else { } else {
return $output; return array('stdout'=>$output, 'stderr'=>$error);
} }
} /* }}} */ } /* }}} */
@ -64,7 +72,8 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
* Constructor. Creates our indexable document and adds all * Constructor. Creates our indexable document and adds all
* necessary fields to it using the passed in document * necessary fields to it using the passed in document
*/ */
public function __construct($dms, $document, $convcmd=null, $nocontent=false, $timeout=5) { public function __construct($dms, $document, $convcmd=null, $nocontent=false, $timeout=5) { /* {{{ */
$this->errormsg = '';
$_convcmd = array( $_convcmd = array(
'application/pdf' => 'pdftotext -enc UTF-8 -nopgbrk %s - |sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'', 'application/pdf' => 'pdftotext -enc UTF-8 -nopgbrk %s - |sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'',
'application/postscript' => 'ps2pdf14 %s - | pdftotext -enc UTF-8 -nopgbrk - - | sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'', 'application/postscript' => 'ps2pdf14 %s - | pdftotext -enc UTF-8 -nopgbrk - - | sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'',
@ -137,13 +146,20 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
if($cmd) { if($cmd) {
try { try {
$content = self::execWithTimeout($cmd, $timeout); $content = self::execWithTimeout($cmd, $timeout);
if($content) { if($content['stdout']) {
$this->addField(Zend_Search_Lucene_Field::UnStored('content', $content, 'utf-8')); $this->addField(Zend_Search_Lucene_Field::UnStored('content', $content['stdout'], 'utf-8'));
}
if($content['stderr']) {
$this->errormsg = $content['stderr'];
} }
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
} }
} } /* }}} */
public function getErrorMsg() { /* {{{ */
return $this->errormsg;
} /* }}} */
} }
?> ?>

View File

@ -11,11 +11,11 @@
<email>uwe@steinmann.cx</email> <email>uwe@steinmann.cx</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2017-12-04</date> <date>2018-01-30</date>
<time>10:58:13</time> <time>10:58:13</time>
<version> <version>
<release>1.1.11</release> <release>1.1.12</release>
<api>1.1.11</api> <api>1.1.12</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>stable</release>
@ -23,7 +23,7 @@
</stability> </stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license> <license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes> <notes>
allow conversion commands for mimetypes with wildcards execWithTimeout() reads data from stderr and saves it into error msg
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">
@ -267,5 +267,21 @@ make all functions in Indexer.php static
catch exception in execWithTimeout() catch exception in execWithTimeout()
</notes> </notes>
</release> </release>
<release>
<date>2017-12-04</date>
<time>10:58:13</time>
<version>
<release>1.1.11</release>
<api>1.1.11</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
allow conversion commands for mimetypes with wildcards
</notes>
</release>
</changelog> </changelog>
</package> </package>

View File

@ -70,18 +70,24 @@ class SeedDMS_Preview_Base {
if (!is_resource($process)) { if (!is_resource($process)) {
throw new Exception("proc_open failed on: " . $cmd); throw new Exception("proc_open failed on: " . $cmd);
} }
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
$output = ''; $output = $error = '';
$timeleft = $timeout - time(); $timeleft = $timeout - time();
$read = array($pipes[1]); $read = array($pipes[1], $pipes[2]);
$write = NULL; $write = NULL;
$exeptions = NULL; $exeptions = NULL;
do { do {
stream_select($read, $write, $exeptions, $timeleft, 200000); $num_changed_streams = stream_select($read, $write, $exeptions, $timeleft, 200000);
if (!empty($read)) { if ($num_changed_streams === false) {
proc_terminate($process);
throw new Exception("stream select failed on: " . $cmd);
} elseif ($num_changed_streams > 0) {
$output .= fread($pipes[1], 8192); $output .= fread($pipes[1], 8192);
} $error .= fread($pipes[2], 8192);
}
$timeleft = $timeout - time(); $timeleft = $timeout - time();
} while (!feof($pipes[1]) && $timeleft > 0); } while (!feof($pipes[1]) && $timeleft > 0);
@ -89,7 +95,7 @@ class SeedDMS_Preview_Base {
proc_terminate($process); proc_terminate($process);
throw new Exception("command timeout on: " . $cmd); throw new Exception("command timeout on: " . $cmd);
} else { } else {
return $output; return array('stdout'=>$output, 'stderr'=>$error);
} }
} /* }}} */ } /* }}} */

View File

@ -115,27 +115,6 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
$cmd = str_replace(array('%w', '%f', '%o', '%m'), array($width, $infile, $target.'.png', $mimetype), $this->converters['*']); $cmd = str_replace(array('%w', '%f', '%o', '%m'), array($width, $infile, $target.'.png', $mimetype), $this->converters['*']);
} }
/*
switch($mimetype) {
case "image/png":
case "image/gif":
case "image/jpeg":
case "image/jpg":
case "image/svg+xml":
$cmd = 'convert -resize '.$width.'x '.$infile.' '.$target.'.png';
break;
case "application/pdf":
case "application/postscript":
$cmd = 'convert -density 100 -resize '.$width.'x '.$infile.'[0] '.$target.'.png';
break;
case "text/plain":
$cmd = 'convert -resize '.$width.'x '.$infile.'[0] '.$target.'.png';
break;
case "application/x-compressed-tar":
$cmd = 'tar tzvf '.$infile.' | convert -density 100 -resize '.$width.'x text:-[0] '.$target.'.png';
break;
}
*/
if($cmd) { if($cmd) {
try { try {
self::execWithTimeout($cmd, $this->timeout); self::execWithTimeout($cmd, $this->timeout);

View File

@ -25,6 +25,7 @@
<notes> <notes>
add SeedDMS_Preview_Base::sendFile() as a replacement for readfile() which uses add SeedDMS_Preview_Base::sendFile() as a replacement for readfile() which uses
mod_xsendfile if available mod_xsendfile if available
execWithTimeout() reads data from stderr and returns it together with stdout in array
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">

View File

@ -29,6 +29,8 @@ require_once('Document.php');
*/ */
class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
protected $errormsg;
static function execWithTimeout($cmd, $timeout=2) { /* {{{ */ static function execWithTimeout($cmd, $timeout=2) { /* {{{ */
$descriptorspec = array( $descriptorspec = array(
0 => array("pipe", "r"), 0 => array("pipe", "r"),
@ -36,23 +38,29 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
2 => array("pipe", "w") 2 => array("pipe", "w")
); );
$pipes = array(); $pipes = array();
$timeout += time(); $timeout += time();
$process = proc_open($cmd, $descriptorspec, $pipes); $process = proc_open($cmd, $descriptorspec, $pipes);
if (!is_resource($process)) { if (!is_resource($process)) {
throw new Exception("proc_open failed on: " . $cmd); throw new Exception("proc_open failed on: " . $cmd);
} }
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
$output = ''; $output = $error = '';
$timeleft = $timeout - time(); $timeleft = $timeout - time();
$read = array($pipes[1]); $read = array($pipes[1], $pipes[2]);
$write = NULL; $write = NULL;
$exeptions = NULL; $exeptions = NULL;
do { do {
stream_select($read, $write, $exeptions, $timeleft, 200000); $num_changed_streams = stream_select($read, $write, $exeptions, $timeleft, 200000);
if (!empty($read)) { if ($num_changed_streams === false) {
proc_terminate($process);
throw new Exception("stream select failed on: " . $cmd);
} elseif ($num_changed_streams > 0) {
$output .= fread($pipes[1], 8192); $output .= fread($pipes[1], 8192);
$error .= fread($pipes[2], 8192);
} }
$timeleft = $timeout - time(); $timeleft = $timeout - time();
} while (!feof($pipes[1]) && $timeleft > 0); } while (!feof($pipes[1]) && $timeleft > 0);
@ -61,7 +69,7 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
proc_terminate($process); proc_terminate($process);
throw new Exception("command timeout on: " . $cmd); throw new Exception("command timeout on: " . $cmd);
} else { } else {
return $output; return array('stdout'=>$output, 'stderr'=>$error);
} }
} /* }}} */ } /* }}} */
@ -69,7 +77,8 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
* Constructor. Creates our indexable document and adds all * Constructor. Creates our indexable document and adds all
* necessary fields to it using the passed in document * necessary fields to it using the passed in document
*/ */
public function __construct($dms, $document, $convcmd=null, $nocontent=false, $timeout=5) { public function __construct($dms, $document, $convcmd=null, $nocontent=false, $timeout=5) { /* {{{ */
$this->errormsg = '';
$_convcmd = array( $_convcmd = array(
'application/pdf' => 'pdftotext -enc UTF-8 -nopgbrk %s - |sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'', 'application/pdf' => 'pdftotext -enc UTF-8 -nopgbrk %s - |sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'',
'application/postscript' => 'ps2pdf14 %s - | pdftotext -enc UTF-8 -nopgbrk - - | sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'', 'application/postscript' => 'ps2pdf14 %s - | pdftotext -enc UTF-8 -nopgbrk - - | sed -e \'s/ [a-zA-Z0-9.]\{1\} / /g\' -e \'s/[0-9.]//g\'',
@ -142,13 +151,20 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document {
if($cmd) { if($cmd) {
try { try {
$content = self::execWithTimeout($cmd, $timeout); $content = self::execWithTimeout($cmd, $timeout);
if($content) { if($content['stdout']) {
$this->addField('content', $content, 'unstored'); $this->addField('content', $content['stdout'], 'unstored');
}
if($content['stderr']) {
$this->errormsg = $content['stderr'];
} }
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
} }
} } /* }}} */
public function getErrorMsg() { /* {{{ */
return $this->errormsg;
} /* }}} */
} }
?> ?>

View File

@ -11,11 +11,11 @@
<email>uwe@steinmann.cx</email> <email>uwe@steinmann.cx</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2017-12-04</date> <date>2018-01-30</date>
<time>11:00:40</time> <time>11:00:40</time>
<version> <version>
<release>1.0.8</release> <release>1.0.9</release>
<api>1.0.8</api> <api>1.0.9</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>stable</release>
@ -23,7 +23,7 @@
</stability> </stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license> <license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes> <notes>
allow conversion commands for mimetypes with wildcards execWithTimeout() reads data from stderr and saves it into error msg
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">
@ -194,5 +194,21 @@ fix calculation of timeout (see bug #269)
catch exception in execWithTimeout() catch exception in execWithTimeout()
</notes> </notes>
</release> </release>
<release>
<date>2017-12-04</date>
<time>11:00:40</time>
<version>
<release>1.0.8</release>
<api>1.0.8</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
allow conversion commands for mimetypes with wildcards
</notes>
</release>
</changelog> </changelog>
</package> </package>

View File

@ -38,7 +38,7 @@ class SeedDMS_ExtExample extends SeedDMS_ExtBase {
* Use this method to do some initialization like setting up the hooks * Use this method to do some initialization like setting up the hooks
* You have access to the following global variables: * You have access to the following global variables:
* $GLOBALS['settings'] : current global configuration * $GLOBALS['settings'] : current global configuration
* $GLOBALS['settings']['_extensions']['example'] : configuration of this extension * $GLOBALS['settings']->_extensions['example'] : configuration of this extension
* $GLOBALS['LANG'] : the language array with translations for all languages * $GLOBALS['LANG'] : the language array with translations for all languages
* $GLOBALS['SEEDDMS_HOOKS'] : all hooks added so far * $GLOBALS['SEEDDMS_HOOKS'] : all hooks added so far
*/ */

View File

@ -125,11 +125,15 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
/* No do the actual authentication of the user */ /* No do the actual authentication of the user */
$bind = @ldap_bind($ds, $dn, $password); $bind = @ldap_bind($ds, $dn, $password);
$user = $dms->getUserByLogin($username); $user = $dms->getUserByLogin($username);
if($user === false) {
ldap_close($ds);
return false;
}
if ($bind) { if ($bind) {
// Successfully authenticated. Now check to see if the user exists within // Successfully authenticated. Now check to see if the user exists within
// the database. If not, add them in if _restricted is not set, // the database. If not, add them in if _restricted is not set,
// but do not add their password. // but do not add their password.
if (is_bool($user) && !$settings->_restricted) { if (is_null($user) && !$settings->_restricted) {
// Retrieve the user's LDAP information. // Retrieve the user's LDAP information.
if (isset($settings->_ldapFilter) && strlen($settings->_ldapFilter) > 0) { if (isset($settings->_ldapFilter) && strlen($settings->_ldapFilter) > 0) {
$search = ldap_search($ds, $settings->_ldapBaseDN, "(&(".$ldapSearchAttribut.$username.")".$settings->_ldapFilter.")"); $search = ldap_search($ds, $settings->_ldapBaseDN, "(&(".$ldapSearchAttribut.$username.")".$settings->_ldapFilter.")");

View File

@ -872,16 +872,22 @@ switch($command) {
if($index) { if($index) {
$indexconf['Indexer']::init($settings->_stopWordsFile); $indexconf['Indexer']::init($settings->_stopWordsFile);
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout); $idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) { $error = $idoc->getErrorMsg();
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) { if(!$error) {
if (method_exists($hookObj, 'preIndexDocument')) { if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
$hookObj->preIndexDocument(null, $document, $idoc); foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
if (method_exists($hookObj, 'preIndexDocument')) {
$hookObj->preIndexDocument(null, $document, $idoc);
}
} }
} }
$index->addDocument($idoc);
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$document->getID()));
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>$error, 'data'=>$document->getID()));
} }
$index->addDocument($idoc);
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$document->getID()));
} else { } else {
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('error_occured'), 'data'=>$document->getID())); echo json_encode(array('success'=>false, 'message'=>getMLText('error_occured'), 'data'=>$document->getID()));

View File

@ -37,8 +37,8 @@ class SeedDMS_View_ApproveDocument extends SeedDMS_Bootstrap_Style {
function checkIndForm() function checkIndForm()
{ {
msg = new Array(); msg = new Array();
if (document.form1.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>"); if (document.formind.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>");
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>"); if (document.formind.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (msg != "") { if (msg != "") {
noty({ noty({
text: msg.join('<br />'), text: msg.join('<br />'),
@ -56,9 +56,9 @@ function checkIndForm()
function checkGrpForm() function checkGrpForm()
{ {
msg = new Array(); msg = new Array();
// if (document.form2.approvalGroup.value == "") msg.push("<?php printMLText("js_no_approval_group");?>"); // if (document.formgrp.approvalGroup.value == "") msg.push("<?php printMLText("js_no_approval_group");?>");
if (document.form2.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>"); if (document.formgrp.approvalStatus.value == "") msg.push("<?php printMLText("js_no_approval_status");?>");
if (document.form2.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>"); if (document.formgrp.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (msg != "") if (msg != "")
{ {
noty({ noty({
@ -75,11 +75,11 @@ function checkGrpForm()
return true; return true;
} }
$(document).ready(function() { $(document).ready(function() {
$('body').on('submit', '#form1', function(ev){ $('body').on('submit', '#formind', function(ev){
if(checkIndForm()) return; if(checkIndForm()) return;
ev.preventDefault(); ev.preventDefault();
}); });
$('body').on('submit', '#form2', function(ev){ $('body').on('submit', '#formgrp', function(ev){
if(checkGrpForm()) return; if(checkGrpForm()) return;
ev.preventDefault(); ev.preventDefault();
}); });
@ -112,24 +112,24 @@ $(document).ready(function() {
$this->contentContainerStart(); $this->contentContainerStart();
// Display the Approval form. // Display the Approval form.
if ($approvalStatus['type'] == 0) { $approvaltype = ($approvalStatus['type'] == 0) ? 'ind' : 'grp';
if($approvalStatus["status"]!=0) { if($approvalStatus["status"]!=0) {
print "<table class=\"folderView\"><thead><tr>"; print "<table class=\"folderView\"><thead><tr>";
print "<th>".getMLText("status")."</th>"; print "<th>".getMLText("status")."</th>";
print "<th>".getMLText("comment")."</th>"; print "<th>".getMLText("comment")."</th>";
print "<th>".getMLText("last_update")."</th>"; print "<th>".getMLText("last_update")."</th>";
print "</tr></thead><tbody><tr>"; print "</tr></thead><tbody><tr>";
print "<td>"; print "<td>";
printApprovalStatusText($approvalStatus["status"]); printApprovalStatusText($approvalStatus["status"]);
print "</td>"; print "</td>";
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>"; print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
$indUser = $dms->getUser($approvalStatus["userID"]); $indUser = $dms->getUser($approvalStatus["userID"]);
print "<td>".$approvalStatus["date"]." - ". $indUser->getFullname() ."</td>"; print "<td>".$approvalStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
print "</tr></tbody></table><br>\n"; print "</tr></tbody></table><br>\n";
} }
?> ?>
<form method="post" action="../op/op.ApproveDocument.php" id="form1" name="form1" enctype="multipart/form-data"> <form method="POST" action="../op/op.ApproveDocument.php" id="form<?= $approvaltype ?>" name="form<?= $approvaltype ?>" enctype="multipart/form-data">
<?php echo createHiddenFieldWithKey('approvedocument'); ?> <?php echo createHiddenFieldWithKey('approvedocument'); ?>
<table> <table>
<tr> <tr>
@ -141,57 +141,6 @@ $(document).ready(function() {
<td> <td>
<?php <?php
$this->printFileChooser('approvalfile', false); $this->printFileChooser('approvalfile', false);
?>
</td>
</tr>
<tr><td><?php printMLText("approval_status")?>:</td>
<td><select name="approvalStatus">
<?php if($approvalStatus['status'] != 1) { ?>
<option value='1'><?php printMLText("status_approved")?></option>
<?php } ?>
<?php if($approvalStatus['status'] != -1) { ?>
<option value='-1'><?php printMLText("rejected")?></option>
<?php } ?>
</select>
</td></tr><tr><td></td><td>
<input type='hidden' name='approvalType' value='ind'/>
<input type='hidden' name='documentid' value='<?php echo $document->getId() ?>'/>
<input type='hidden' name='version' value='<?php echo $latestContent->getVersion(); ?>'/>
<input type='submit' class="btn" name='indApproval' value='<?php printMLText("submit_approval")?>'/>
</td></tr></table>
</form>
<?php
}
else if ($approvalStatus['type'] == 1) {
if($approvalStatus["status"]!=0) {
print "<table class=\"folderView\"><thead><tr>";
print "<th>".getMLText("status")."</th>";
print "<th>".getMLText("comment")."</th>";
print "<th>".getMLText("last_update")."</th>";
print "</tr></thead><tbody><tr>";
print "<td>";
printApprovalStatusText($approvalStatus["status"]);
print "</td>";
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
$indUser = $dms->getUser($approvalStatus["userID"]);
print "<td>".$approvalStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
print "</tr></tbody></table><br>\n";
}
?>
<form method="POST" action="../op/op.ApproveDocument.php" id="form2" name="form2" enctype="multipart/form-data">
<?php echo createHiddenFieldWithKey('approvedocument'); ?>
<table>
<tr><td><?php printMLText("comment")?>:</td>
<td><textarea name="comment" cols="80" rows="4"></textarea>
</td></tr>
<tr>
<td><?php printMLText("approval_file")?>:</td>
<td>
<?php
$this->printFileChooser('approvalfile', false);
?> ?>
</td> </td>
</tr> </tr>
@ -207,15 +156,16 @@ $(document).ready(function() {
</select> </select>
</td></tr> </td></tr>
<tr><td></td><td> <tr><td></td><td>
<input type='submit' class="btn" name='<?= $approvaltype ?>Approval' value='<?php printMLText("submit_approval")?>'/></td></tr>
</table>
<input type='hidden' name='approvalType' value='<?= $approvaltype ?>'/>
<?php if($approvaltype == 'grp'): ?>
<input type='hidden' name='approvalGroup' value="<?php echo $approvalStatus['required']; ?>" /> <input type='hidden' name='approvalGroup' value="<?php echo $approvalStatus['required']; ?>" />
<input type='hidden' name='approvalType' value='grp'/> <?php endif; ?>
<input type='hidden' name='documentid' value='<?php echo $document->getId() ?>'/> <input type='hidden' name='documentid' value='<?php echo $document->getId() ?>'/>
<input type='hidden' name='version' value='<?php echo $latestContent->getVersion(); ?>'/> <input type='hidden' name='version' value='<?php echo $latestContent->getVersion(); ?>'/>
<input type='submit' class="btn" name='groupApproval' value='<?php printMLText("submit_approval")?>'/></td></tr>
</table>
</form> </form>
<?php <?php
}
$this->contentContainerEnd(); $this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();

View File

@ -71,7 +71,7 @@ function check_queue() {
dismissQueue: true, dismissQueue: true,
layout: 'topRight', layout: 'topRight',
theme: 'defaultTheme', theme: 'defaultTheme',
timeout: 1500, timeout: 5000,
}); });
}, },
success: function(data) { success: function(data) {

View File

@ -37,8 +37,8 @@ class SeedDMS_View_ReviewDocument extends SeedDMS_Bootstrap_Style {
function checkIndForm() function checkIndForm()
{ {
msg = new Array(); msg = new Array();
if (document.form1.reviewStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>"); if (document.formind.reviewStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>");
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>"); if (document.formind.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (msg != "") { if (msg != "") {
noty({ noty({
text: msg.join('<br />'), text: msg.join('<br />'),
@ -55,10 +55,10 @@ function checkIndForm()
} }
function checkGrpForm() function checkGrpForm()
{ {
msg = ""; msg = new Array();
if (document.form2.reviewGroup.value == "") msg += "<?php printMLText("js_no_review_group");?>\n"; // if (document.formgrp.reviewGroup.value == "") msg.push("<?php printMLText("js_no_review_group");?>");
if (document.form2.reviewStatus.value == "") msg += "<?php printMLText("js_no_review_status");?>\n"; if (document.formgrp.reviewStatus.value == "") msg.push("<?php printMLText("js_no_review_status");?>");
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n"; if (document.formgrp.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (msg != "") if (msg != "")
{ {
noty({ noty({
@ -75,11 +75,11 @@ function checkGrpForm()
return true; return true;
} }
$(document).ready(function() { $(document).ready(function() {
$('body').on('submit', '#form1', function(ev){ $('body').on('submit', '#formind', function(ev){
if(checkIndForm()) return; if(checkIndForm()) return;
ev.preventDefault(); ev.preventDefault();
}); });
$('body').on('submit', '#form2', function(ev){ $('body').on('submit', '#formgrp', function(ev){
if(checkGrpForm()) return; if(checkGrpForm()) return;
ev.preventDefault(); ev.preventDefault();
}); });
@ -110,82 +110,24 @@ $(document).ready(function() {
$this->contentContainerStart(); $this->contentContainerStart();
// Display the Review form. // Display the Review form.
if ($reviewStatus['type'] == 0) { $reviewtype = ($reviewStatus['type'] == 0) ? 'ind' : 'grp';
if($reviewStatus["status"]!=0) { if($reviewStatus["status"]!=0) {
print "<table class=\"folderView\"><thead><tr>"; print "<table class=\"folderView\"><thead><tr>";
print "<th>".getMLText("status")."</th>"; print "<th>".getMLText("status")."</th>";
print "<th>".getMLText("comment")."</th>"; print "<th>".getMLText("comment")."</th>";
print "<th>".getMLText("last_update")."</th>"; print "<th>".getMLText("last_update")."</th>";
print "</tr></thead><tbody><tr>"; print "</tr></thead><tbody><tr>";
print "<td>"; print "<td>";
printReviewStatusText($reviewStatus["status"]); printReviewStatusText($reviewStatus["status"]);
print "</td>"; print "</td>";
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>"; print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
$indUser = $dms->getUser($reviewStatus["userID"]); $indUser = $dms->getUser($reviewStatus["userID"]);
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>"; print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
print "</tr></tbody></table><br>"; print "</tr></tbody></table><br>\n";
}
?>
<form method="post" action="../op/op.ReviewDocument.php" id="form1" name="form1" enctype="multipart/form-data">
<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
<table class="table-condensed">
<tr>
<td><?php printMLText("comment")?>:</td>
<td><textarea name="comment" cols="80" rows="4"></textarea></td>
</tr>
<tr>
<td><?php printMLText("review_file")?>:</td>
<td>
<?php
$this->printFileChooser('reviewfile', false);
?>
</td>
</tr>
<tr>
<td><?php printMLText("review_status")?></td>
<td>
<select name="reviewStatus">
<?php if($reviewStatus['status'] != 1) { ?>
<option value='1'><?php printMLText("status_reviewed")?></option>
<?php } ?>
<?php if($reviewStatus['status'] != -1) { ?>
<option value='-1'><?php printMLText("rejected")?></option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<td></td>
<td><input type='submit' class="btn" name='indReview' value='<?php printMLText("submit_review")?>'/></td>
</tr>
</table>
<input type='hidden' name='reviewType' value='ind'/>
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
</form>
<?php
} }
else if ($reviewStatus['type'] == 1) {
if($reviewStatus["status"]!=0) {
print "<table class=\"folderView\"><thead><tr>";
print "<th>".getMLText("status")."</th>";
print "<th>".getMLText("comment")."</th>";
print "<th>".getMLText("last_update")."</th>";
print "</tr></thead><tbody><tr>";
print "<td>";
printReviewStatusText($reviewStatus["status"]);
print "</td>";
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
$indUser = $dms->getUser($reviewStatus["userID"]);
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
print "</tr></tbody></table><br>\n";
}
?> ?>
<form method="post" action="../op/op.ReviewDocument.php" id="form2" name="form2" enctype="multipart/form-data"> <form method="post" action="../op/op.ReviewDocument.php" id="form<?= $reviewtype ?>" name="form<?= $reviewtype ?>" enctype="multipart/form-data">
<?php echo createHiddenFieldWithKey('reviewdocument'); ?> <?php echo createHiddenFieldWithKey('reviewdocument'); ?>
<table class="table-condensed"> <table class="table-condensed">
<tr> <tr>
@ -215,16 +157,18 @@ $(document).ready(function() {
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td><input type='submit' class="btn" name='groupReview' value='<?php printMLText("submit_review")?>'/></td> <td><input type='submit' class="btn" name='<?= $reviewtype ?>Review' value='<?php printMLText("submit_review")?>'/></td>
</tr> </tr>
</table> </table>
<input type='hidden' name='reviewType' value='grp'/> <input type='hidden' name='reviewType' value='<?= $reviewtype ?>'/>
<?php if($reviewtype == 'grp'): ?>
<input type='hidden' name='reviewGroup' value='<?php echo $reviewStatus['required']; ?>'/> <input type='hidden' name='reviewGroup' value='<?php echo $reviewStatus['required']; ?>'/>
<?php endif; ?>
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/> <input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/> <input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
</form> </form>
<?php <?php
}
$this->contentContainerEnd(); $this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();

View File

@ -192,6 +192,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$document->getID(), 300, '', date('Y-m-d')); $this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$document->getID(), 300, '', date('Y-m-d'));
} }
$this->printDocumentChooserJs("form1"); $this->printDocumentChooserJs("form1");
$this->printDeleteDocumentButtonJs();
} /* }}} */ } /* }}} */
function documentInfos() { /* {{{ */ function documentInfos() { /* {{{ */
@ -376,6 +377,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
break; break;
case 'video/webm': case 'video/webm':
case 'video/mp4': case 'video/mp4':
case 'video/x-msvideo':
$this->contentHeading(getMLText("preview")); $this->contentHeading(getMLText("preview"));
?> ?>
<video controls style="width: 100%;"> <video controls style="width: 100%;">
@ -441,6 +443,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$versions = $document->getContent(); $versions = $document->getContent();
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<link href="../styles/'.$this->theme.'/timeline/timeline.css" rel="stylesheet">'."\n", 'css'); $this->htmlAddHeader('<link href="../styles/'.$this->theme.'/timeline/timeline.css" rel="stylesheet">'."\n", 'css');
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/timeline/timeline-min.js"></script>'."\n", 'js'); $this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/timeline/timeline-min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/timeline/timeline-locales.js"></script>'."\n", 'js'); $this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/timeline/timeline-locales.js"></script>'."\n", 'js');
@ -1635,55 +1638,33 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</div> </div>
<div class="tab-pane <?php if($currenttab == 'links') echo 'active'; ?>" id="links"> <div class="tab-pane <?php if($currenttab == 'links') echo 'active'; ?>" id="links">
<?php <?php
$this->contentContainerStart();
if (count($links) > 0) { if (count($links) > 0) {
print "<table class=\"table table-condensed\">"; print "<table id=\"viewfolder-table\" class=\"table table-condensed table-hover\">";
print "<thead>\n<tr>\n"; print "<thead>\n<tr>\n";
print "<th></th>\n"; print "<th></th>\n";
print "<th></th>\n"; print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("comment")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th></th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th></th>\n"; print "<th></th>\n";
print "</tr>\n</thead>\n<tbody>\n"; print "</tr>\n</thead>\n<tbody>\n";
foreach($links as $link) { foreach($links as $link) {
$responsibleUser = $link->getUser(); $responsibleUser = $link->getUser();
$targetDoc = $link->getTarget(); $targetDoc = $link->getTarget();
$targetlc = $targetDoc->getLatestContent();
$previewer->createPreview($targetlc, $previewwidthdetail); echo "<tr id=\"table-row-document-".$targetDoc->getId()."\" class=\"table-row-document\" rel=\"document_".$targetDoc->getId()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
echo "<tr id=\"table-row-transmittalitem-".$link->getID()."\">"; $targetDoc->verifyLastestContentExpriry();
echo $this->documentListRow($targetDoc, $previewer, true); $txt = $this->callHook('documentListItem', $targetDoc, $previewer, 'reverselinks');
print "<td><small>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName()); if(is_string($txt))
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) { echo $txt;
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no")); else {
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>"; echo $this->documentListRow($targetDoc, $previewer, true);
} }
print "</small></td>"; print "<td><span class=\"actions\">";
echo "</tr>"; print getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if(0){
print "<tr>";
print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">";
if($accessop->check_controller_access('Download', array('action'=>'version')))
print "<a href=\"../op/op.Download.php?documentid=".$targetDoc->getID()."&version=".$targetlc->getVersion()."\">";
if($previewer->hasPreview($targetlc)) {
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"../op/op.Preview.php?documentid=".$targetDoc->getID()."&version=".$targetlc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($targetlc->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"".$this->getMimeIcon($targetlc->getFileType())."\" title=\"".htmlspecialchars($targetlc->getMimeType())."\">";
}
if($accessop->check_controller_access('Download', array('action'=>'run')))
print "</a>";
print "</td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$targetDoc->getID()."\" class=\"linklist\">".htmlspecialchars($targetDoc->getName())."</a></td>";
print "<td>".htmlspecialchars($targetDoc->getComment())."</td>";
print "<td>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no")); print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
print "</td>";
print "<td><span class=\"actions\">";
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>"; print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
print "</span></td>"; print "</span></td>";
@ -1695,81 +1676,63 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
else printMLText("no_linked_files"); else printMLText("no_linked_files");
if (!$user->isGuest()){ if (!$user->isGuest()){
$this->contentContainerStart();
?> ?>
<br> <br>
<form action="../op/op.AddDocumentLink.php" name="form1"> <form action="../op/op.AddDocumentLink.php" name="form1" class="form-inline">
<input type="hidden" name="documentid" value="<?php print $documentid;?>"> <input type="hidden" name="documentid" value="<?php print $documentid;?>">
<table class="table-condensed"> <?php printMLText("add_document_link");?>:
<tr> <?php $this->printDocumentChooserHtml("form1");?>
<td><?php printMLText("add_document_link");?>:</td>
<td><?php $this->printDocumentChooserHtml("form1");?></td>
</tr>
<?php <?php
if ($document->getAccessMode($user) >= M_READWRITE) { if ($document->getAccessMode($user) >= M_READWRITE) {
print "<tr><td>".getMLText("document_link_public")."</td>"; print "<label class=\"checkbox\">";
print "<td>";
print "<input type=\"checkbox\" name=\"public\" value=\"true\" checked />"; print "<input type=\"checkbox\" name=\"public\" value=\"true\" checked />";
print "</td></tr>"; print getMLText("document_link_public");
print "</label>";
} }
?> ?>
<tr> <button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save")?></button>
<td></td>
<td><button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save")?></button></td>
</tr>
</table>
</form> </form>
<?php <?php
$this->contentContainerEnd();
} }
$this->contentContainerEnd();
if (count($reverselinks) > 0) { if (count($reverselinks) > 0) {
$this->contentHeading(getMLText("reverse_links")); $this->contentHeading(getMLText("reverse_links"));
$this->contentContainerStart(); // $this->contentContainerStart();
print "<table class=\"table table-condensed\">"; print "<table id=\"viewfolder-table\" class=\"table table-condensed table-hover\">";
print "<thead>\n<tr>\n"; print "<thead>\n<tr>\n";
print "<th></th>\n"; print "<th></th>\n";
print "<th></th>\n"; print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("comment")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th></th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th></th>\n"; print "<th></th>\n";
print "</tr>\n</thead>\n<tbody>\n"; print "</tr>\n</thead>\n<tbody>\n";
foreach($reverselinks as $link) { foreach($reverselinks as $link) {
$responsibleUser = $link->getUser(); $responsibleUser = $link->getUser();
$sourceDoc = $link->getDocument(); $sourceDoc = $link->getDocument();
/* Check if latest content is accessible. Could be that even if the document
* is accessible, the document content isn't because of its status echo "<tr id=\"table-row-document-".$sourceDoc->getId()."\" class=\"table-row-document\" rel=\"document_".$sourceDoc->getId()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
*/ $sourceDoc->verifyLastestContentExpriry();
if($sourcelc = $sourceDoc->getLatestContent()) { $txt = $this->callHook('documentListItem', $sourceDoc, $previewer, 'reverselinks');
$previewer->createPreview($sourcelc, $previewwidthdetail); if(is_string($txt))
print "<tr>"; echo $txt;
print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">"; else {
if($accessop->check_controller_access('Download', array('action'=>'version'))) echo $this->documentListRow($sourceDoc, $previewer, true);
print "<a href=\"../op/op.Download.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."\">";
if($previewer->hasPreview($sourcelc)) {
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"../op/op.Preview.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"".$this->getMimeIcon($sourcelc->getFileType())."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
}
if($accessop->check_controller_access('Download', array('action'=>'run')))
print "</a>";
print "</td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$sourceDoc->getID()."\" class=\"linklist\">".htmlspecialchars($sourceDoc->getName())."</a></td>";
print "<td>".htmlspecialchars($sourceDoc->getComment())."</td>";
print "<td>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
print "</td>";
print "<td><span class=\"actions\">";
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
print "</span></td>";
print "</tr>";
} }
print "<td><span class=\"actions\">";
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$sourceDoc->getId()."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
print "</span></td>";
print "</tr>";
} }
print "</tbody>\n</table>\n"; print "</tbody>\n</table>\n";
$this->contentContainerEnd(); // $this->contentContainerEnd();
} }
?> ?>
</div> </div>