mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
b7e075cdba
|
@ -325,6 +325,9 @@
|
||||||
Changes in version 5.1.40
|
Changes in version 5.1.40
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
- fix saving user data when language selection is turned of (Closes: #568)
|
- fix saving user data when language selection is turned of (Closes: #568)
|
||||||
|
- add much better support for new storage drivers
|
||||||
|
- fix possible xss attacks
|
||||||
|
- saver way to collect plugin configuration
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.39
|
Changes in version 5.1.39
|
||||||
|
|
|
@ -49,6 +49,9 @@ application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||||
application/msword
|
application/msword
|
||||||
catdoc %s
|
catdoc %s
|
||||||
|
|
||||||
|
application/vnd.oasis.opendocument.text
|
||||||
|
odt2txt %s
|
||||||
|
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
xlsx2csv -d tab %s
|
xlsx2csv -d tab %s
|
||||||
|
|
||||||
|
|
|
@ -210,13 +210,19 @@ class SeedDMS_Extension_Mgr {
|
||||||
$fp = @fopen(self::getExtensionsConfFile(), "w");
|
$fp = @fopen(self::getExtensionsConfFile(), "w");
|
||||||
if($fp) {
|
if($fp) {
|
||||||
if($extensions) {
|
if($extensions) {
|
||||||
|
$EXT_CONF = [];
|
||||||
foreach($extensions as $_ext) {
|
foreach($extensions as $_ext) {
|
||||||
if(file_exists($this->extdir . "/" . $_ext . "/conf.php")) {
|
if(file_exists($this->extdir . "/" . $_ext . "/conf.php")) {
|
||||||
$content = file_get_contents($this->extdir . "/" . $_ext . "/conf.php");
|
include $this->extdir . "/" . $_ext . "/conf.php";
|
||||||
fwrite($fp, $content);
|
// $content = file_get_contents($this->extdir . "/" . $_ext . "/conf.php");
|
||||||
|
// fwrite($fp, $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// fclose($fp);
|
||||||
|
// $fp = @fopen(self::getExtensionsConfFile(), "w");
|
||||||
|
fwrite($fp, '<?php
|
||||||
|
$EXT_CONF = '.var_export($EXT_CONF, true).';');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -81,7 +81,7 @@ if(true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Catch all route */
|
/* Catch all route */
|
||||||
$app->get('/{path:.*}', function($request, $response) {
|
$app->get('/{path:.*}', function($request, $response) use ($settings) {
|
||||||
return $response
|
return $response
|
||||||
->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php')
|
->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php')
|
||||||
->withStatus(302);
|
->withStatus(302);
|
||||||
|
|
|
@ -3417,7 +3417,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$extracontent = array_merge($extracontent, $ec);
|
$extracontent = array_merge($extracontent, $ec);
|
||||||
|
|
||||||
$content .= "<td>";
|
$content .= "<td>";
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
if ($latestContent->exists()) {
|
||||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||||
if(is_string($previewhtml))
|
if(is_string($previewhtml))
|
||||||
$content .= $previewhtml;
|
$content .= $previewhtml;
|
||||||
|
|
|
@ -52,12 +52,12 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style {
|
||||||
$subitems = [];
|
$subitems = [];
|
||||||
foreach($clipboard['folders'] as $folderid) {
|
foreach($clipboard['folders'] as $folderid) {
|
||||||
if($folder = $this->params['dms']->getFolder($folderid)) {
|
if($folder = $this->params['dms']->getFolder($folderid)) {
|
||||||
$subitems[] = array('label'=>'<i class="fa fa-folder-o"></i> '.$folder->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID(), 'class'=>"table-row-folder droptarget", 'attributes'=>array(array('data-droptarget', "folder_".$folder->getID()), array('rel', "folder_".$folder->getID()), array('data-name', htmlspecialchars($folder->getName(), ENT_QUOTES))));
|
$subitems[] = array('label'=>'<i class="fa fa-folder-o"></i> '.htmlspecialchars($folder->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID(), 'class'=>"table-row-folder droptarget", 'attributes'=>array(array('data-droptarget', "folder_".$folder->getID()), array('rel', "folder_".$folder->getID()), array('data-name', htmlspecialchars($folder->getName(), ENT_QUOTES))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($clipboard['docs'] as $docid) {
|
foreach($clipboard['docs'] as $docid) {
|
||||||
if($document = $this->params['dms']->getDocument($docid))
|
if($document = $this->params['dms']->getDocument($docid))
|
||||||
$subitems[] = array('label'=>'<i class="fa fa-file"></i> '.$document->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(), 'class'=>"table-row-document droptarget", 'attributes'=>array(array('data-droptarget', "document_".$document->getID()), array('rel', "document_".$document->getID()), array('formtoken', createFormKey('')), array('data-name', htmlspecialchars($document->getName(), ENT_QUOTES))));
|
$subitems[] = array('label'=>'<i class="fa fa-file"></i> '.htmlspecialchars($document->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(), 'class'=>"table-row-document droptarget", 'attributes'=>array(array('data-droptarget', "document_".$document->getID()), array('rel', "document_".$document->getID()), array('formtoken', createFormKey('')), array('data-name', htmlspecialchars($document->getName(), ENT_QUOTES))));
|
||||||
}
|
}
|
||||||
if((count($clipboard['docs']) + count($clipboard['folders'])) > 0) {
|
if((count($clipboard['docs']) + count($clipboard['folders'])) > 0) {
|
||||||
$subitems[] = array('divider'=>true);
|
$subitems[] = array('divider'=>true);
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Include parent class
|
|
||||||
*/
|
|
||||||
//require_once("class.Bootstrap.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which outputs the html page for Info view
|
* Class which outputs the html page for Info view
|
||||||
*
|
*
|
||||||
|
@ -60,17 +55,30 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
||||||
$this->rowStart();
|
$this->rowStart();
|
||||||
$this->columnStart(6);
|
$this->columnStart(6);
|
||||||
$this->contentHeading(getMLText("seeddms_info"));
|
$this->contentHeading(getMLText("seeddms_info"));
|
||||||
$seedextensions = $extmgr->getExtensionConfiguration();
|
|
||||||
echo "<table class=\"table table-condensed table-sm\">\n";
|
echo "<table class=\"table table-condensed table-sm\">\n";
|
||||||
echo "<thead>\n<tr>\n";
|
echo "<thead>\n<tr>\n";
|
||||||
echo "<th></th>";
|
echo "<th>".getMLText("name")."</th>\n";
|
||||||
echo "<th>".getMLText("name");
|
|
||||||
echo "</th>\n";
|
|
||||||
echo "</tr>\n</thead>\n<tbody>\n";
|
echo "</tr>\n</thead>\n<tbody>\n";
|
||||||
$dbversion = $dms->getDBVersion();
|
$dbversion = $dms->getDBVersion();
|
||||||
echo "<tr><td></td><td></td><td>".getMLText('seeddms_version')."</td><td>".$version->version()."</td></tr>\n";
|
echo "<tr><td>".getMLText('seeddms_version')."</td><td>".$version->version()."</td></tr>\n";
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
echo "<tr><td></td><td></td><td>".getMLText('database_schema_version')."</td><td>".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."</td></tr>\n";
|
$storage = $dms->getStorage();
|
||||||
|
echo "<tr><td>".getMLText('database_schema_version')."</td><td>".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."</td></tr>\n";
|
||||||
|
echo "<tr></td><td>".getMLText('storage')."</td><td>".($storage ? $storage->info() : "legacy")."</td></tr>\n";
|
||||||
|
}
|
||||||
|
echo "</tbody>\n</table>\n";
|
||||||
|
|
||||||
|
if($user->isAdmin()) {
|
||||||
|
$this->contentHeading(getMLText("extension_info"));
|
||||||
|
echo "<table class=\"table table-condensed table-sm\">\n";
|
||||||
|
echo "<thead>\n<tr>\n";
|
||||||
|
echo "<th></th>";
|
||||||
|
echo "<th></th>";
|
||||||
|
echo "<th>".getMLText("name");
|
||||||
|
echo "<th>".getMLText("version")."</th>\n";
|
||||||
|
echo "</th>\n";
|
||||||
|
echo "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
$seedextensions = $extmgr->getExtensionConfiguration();
|
||||||
foreach($seedextensions as $extname=>$extconf) {
|
foreach($seedextensions as $extname=>$extconf) {
|
||||||
echo "<tr><td>";
|
echo "<tr><td>";
|
||||||
if(!$settings->extensionIsDisabled($extname))
|
if(!$settings->extensionIsDisabled($extname))
|
||||||
|
@ -85,8 +93,8 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
||||||
echo "<td>".$extname."<br />".$extconf['title']."</td><td>".$extconf['version']."</td>";
|
echo "<td>".$extname."<br />".$extconf['title']."</td><td>".$extconf['version']."</td>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
|
echo "</tbody>\n</table>\n";
|
||||||
}
|
}
|
||||||
echo "</tbody>\n</table>\n";
|
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->columnStart(6);
|
$this->columnStart(6);
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
|
|
|
@ -724,7 +724,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
switch($conf['type']) {
|
switch($conf['type']) {
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="<?php echo "extensions[".$extname."][".$confkey."]"; ?>" value=""><input type="checkbox" name="<?php echo "extensions[".$extname."][".$confkey."]"; ?>" value="1" <?php if(isset($settings->_extensions[$extname][$confkey]) && $settings->_extensions[$extname][$confkey]) echo 'checked'; ?> />
|
<input type="hidden" name="<?php echo "extensions[".$extname."][".$confkey."]"; ?>" value=""><input type="checkbox" id="extension_<?= $extname ?>_<?= $confkey ?>" name="<?php echo "extensions[".$extname."][".$confkey."]"; ?>" value="1" <?php if(isset($settings->_extensions[$extname][$confkey]) && $settings->_extensions[$extname][$confkey]) echo 'checked'; ?> />
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
|
@ -733,7 +733,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
$order = empty($conf['order']) ? '' : $conf['order'];
|
$order = empty($conf['order']) ? '' : $conf['order'];
|
||||||
if(!empty($conf['options'])) {
|
if(!empty($conf['options'])) {
|
||||||
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
|
||||||
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "").($order ? " order=\"".$order."\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_option")."\" style=\"width: 100%;\">";
|
echo "<select id=\"extension_".$extname."_".$confkey."\" class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "").($order ? " order=\"".$order."\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_option")."\" style=\"width: 100%;\">";
|
||||||
if(is_array($conf['options'])) {
|
if(is_array($conf['options'])) {
|
||||||
$options = $conf['options'];
|
$options = $conf['options'];
|
||||||
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
|
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
|
||||||
|
|
|
@ -298,7 +298,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
|
||||||
$subitems = [];
|
$subitems = [];
|
||||||
foreach($tasks['review'] as $t) {
|
foreach($tasks['review'] as $t) {
|
||||||
$doc = $dms->getDocument($t['id']);
|
$doc = $dms->getDocument($t['id']);
|
||||||
$subitems[] = array('label'=>$doc->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
$subitems[] = array('label'=>htmlspecialchars($doc->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
||||||
}
|
}
|
||||||
$menuitems['tasks']['children']['review'] = array('label'=>getMLText('documents_to_review'), 'children'=>$subitems);
|
$menuitems['tasks']['children']['review'] = array('label'=>getMLText('documents_to_review'), 'children'=>$subitems);
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
|
||||||
$subitems = [];
|
$subitems = [];
|
||||||
foreach($tasks['approval'] as $t) {
|
foreach($tasks['approval'] as $t) {
|
||||||
$doc = $dms->getDocument($t['id']);
|
$doc = $dms->getDocument($t['id']);
|
||||||
$subitems[] = array('label'=>$doc->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
$subitems[] = array('label'=>htmlspecialchars($doc->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
||||||
}
|
}
|
||||||
$menuitems['tasks']['children']['approval'] = array('label'=>getMLText('documents_to_approve'), 'children'=>$subitems);
|
$menuitems['tasks']['children']['approval'] = array('label'=>getMLText('documents_to_approve'), 'children'=>$subitems);
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
|
||||||
$subitems = [];
|
$subitems = [];
|
||||||
foreach($tasks['workflow'] as $t) {
|
foreach($tasks['workflow'] as $t) {
|
||||||
$doc = $dms->getDocument($t['id']);
|
$doc = $dms->getDocument($t['id']);
|
||||||
$subitems[] = array('label'=>$doc->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=workflow", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
$subitems[] = array('label'=>htmlspecialchars($doc->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=workflow", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
||||||
}
|
}
|
||||||
$menuitems['tasks']['children']['workflow'] = array('label'=>getMLText('documents_to_trigger_workflow'), 'children'=>$subitems);
|
$menuitems['tasks']['children']['workflow'] = array('label'=>getMLText('documents_to_trigger_workflow'), 'children'=>$subitems);
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
|
||||||
$subitems = [];
|
$subitems = [];
|
||||||
foreach($tasks['rejected'] as $t) {
|
foreach($tasks['rejected'] as $t) {
|
||||||
$doc = $dms->getDocument($t['id']);
|
$doc = $dms->getDocument($t['id']);
|
||||||
$subitems[] = array('label'=>$doc->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=docinfo", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
$subitems[] = array('label'=>htmlspecialchars($doc->getName()), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=docinfo", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
|
||||||
}
|
}
|
||||||
$menuitems['tasks']['children']['rejected'] = array('label'=>getMLText('documents_rejected'), 'children'=>$subitems);
|
$menuitems['tasks']['children']['rejected'] = array('label'=>getMLText('documents_rejected'), 'children'=>$subitems);
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ $(document).ready( function() {
|
||||||
|
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
|
|
||||||
$file_exists=file_exists($dms->contentDir . $file->getPath());
|
$file_exists = $file->exists();//file_exists($dms->contentDir . $file->getPath());
|
||||||
|
|
||||||
$responsibleUser = $file->getUser();
|
$responsibleUser = $file->getUser();
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ $(document).ready( function() {
|
||||||
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
|
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
|
||||||
if ($file_exists) {
|
if ($file_exists) {
|
||||||
$realmimetype = $file->getRealMimeType();
|
$realmimetype = $file->getRealMimeType();
|
||||||
print "<li>".SeedDMS_Core_File::format_filesize(filesize($dms->contentDir . $file->getPath())) ." bytes, ".htmlspecialchars($file->getMimeType())."</li>";
|
print "<li>".SeedDMS_Core_File::format_filesize($file->size()) ." bytes, ".htmlspecialchars($file->getMimeType())."</li>";
|
||||||
} else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
} else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";
|
||||||
|
|
||||||
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".htmlspecialchars($responsibleUser->getEmail())."\">".htmlspecialchars($responsibleUser->getFullName())."</a></li>";
|
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".htmlspecialchars($responsibleUser->getEmail())."\">".htmlspecialchars($responsibleUser->getFullName())."</a></li>";
|
||||||
|
@ -733,7 +733,7 @@ $(document).ready( function() {
|
||||||
$previewwidthdetail = $this->params['previewWidthDetail'];
|
$previewwidthdetail = $this->params['previewWidthDetail'];
|
||||||
|
|
||||||
// verify if file exists
|
// verify if file exists
|
||||||
$file_exists=file_exists($dms->contentDir . $latestContent->getPath());
|
$file_exists = $latestContent->exists(); //file_exists($dms->contentDir . $latestContent->getPath());
|
||||||
|
|
||||||
$status = $latestContent->getStatus();
|
$status = $latestContent->getStatus();
|
||||||
|
|
||||||
|
@ -2050,4 +2050,3 @@ $(document).ready( function() {
|
||||||
$this->htmlEndPage();
|
$this->htmlEndPage();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -3390,7 +3390,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$extracontent = array_merge($extracontent, $ec);
|
$extracontent = array_merge($extracontent, $ec);
|
||||||
|
|
||||||
$content .= "<td>";
|
$content .= "<td>";
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
if ($latestContent->exists()) {
|
||||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||||
if(is_string($previewhtml))
|
if(is_string($previewhtml))
|
||||||
$content .= $previewhtml;
|
$content .= $previewhtml;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user