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

This commit is contained in:
Uwe Steinmann 2023-03-10 17:59:54 +01:00
commit 3f6719e7aa
4 changed files with 38 additions and 16 deletions

View File

@ -256,6 +256,7 @@
- use chosen select for custom attributes - use chosen select for custom attributes
- color category (use first 6 chars of md5(category name) as hex color) - color category (use first 6 chars of md5(category name) as hex color)
- create missing preview images in category or attribute manager - create missing preview images in category or attribute manager
- support README of extension in different languages
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.29 Changes in version 5.1.29

View File

@ -45,7 +45,8 @@ function renderBooleanData($colname, $objdata) { /* {{{ */
} /* }}} */ } /* }}} */
function getPasswordPlainData($colname, $coldata, $objdata) { /* {{{ */ function getPasswordPlainData($colname, $coldata, $objdata) { /* {{{ */
$objdata['passenc'] = seed_pass_hash($coldata); /* Setting 'passenc' to null will not update the password */
$objdata['passenc'] = $coldata ? seed_pass_hash($coldata) : null;
return $objdata; return $objdata;
} /* }}} */ } /* }}} */
@ -240,7 +241,7 @@ if (isset($_FILES['userdata']) && $_FILES['userdata']['error'] == 0) {
if($makeupdate) if($makeupdate)
$eu->setEmail($u['email']); $eu->setEmail($u['email']);
} }
if(isset($u['passenc']) && $u['passenc'] != $eu->getPwd()) { if(isset($u['passenc']) && !is_null($u['passenc']) && $u['passenc'] != $eu->getPwd()) {
$log[$uhash][] = array('id'=>$eu->getLogin(), 'type'=>'success', 'msg'=> "Encrypted password of user updated. '".$u['passenc']."' != '".$eu->getPwd()."'"); $log[$uhash][] = array('id'=>$eu->getLogin(), 'type'=>'success', 'msg'=> "Encrypted password of user updated. '".$u['passenc']."' != '".$eu->getPwd()."'");
if($makeupdate) if($makeupdate)
$eu->setPwd($u['passenc']); $eu->setPwd($u['passenc']);

View File

@ -178,6 +178,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
function readme() { /* {{{ */ function readme() { /* {{{ */
$dms = $this->params['dms']; $dms = $this->params['dms'];
$user = $this->params['user']; $user = $this->params['user'];
$session = $this->params['session'];
$extdir = $this->params['extdir']; $extdir = $this->params['extdir'];
$extmgr = $this->params['extmgr']; $extmgr = $this->params['extmgr'];
$extname = $this->params['extname']; $extname = $this->params['extname'];
@ -185,9 +186,10 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
if(isset($extconf[$extname])) { if(isset($extconf[$extname])) {
$extconf = $extconf[$extname]; $extconf = $extconf[$extname];
if(file_exists($extdir."/".$extname."/README.md")) { $Parsedown = new Parsedown();
// echo '<div style="white-space: pre-wrap; font-family: monospace; padding: 0px;">'.file_get_contents($extdir."/".$extname."/README.md")."</div>"; if(file_exists($extdir."/".$extname."/README.".$session->getLanguage().".md")) {
$Parsedown = new Parsedown(); echo $Parsedown->text(file_get_contents($extdir."/".$extname."/README.".$session->getLanguage().".md"));
} elseif(file_exists($extdir."/".$extname."/README.md")) {
echo $Parsedown->text(file_get_contents($extdir."/".$extname."/README.md")); echo $Parsedown->text(file_get_contents($extdir."/".$extname."/README.md"));
} }
} }
@ -197,6 +199,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
$dms = $this->params['dms']; $dms = $this->params['dms'];
$user = $this->params['user']; $user = $this->params['user'];
$settings = $this->params['settings']; $settings = $this->params['settings'];
$session = $this->params['session'];
$httproot = $this->params['httproot']; $httproot = $this->params['httproot'];
$extmgr = $this->params['extmgr']; $extmgr = $this->params['extmgr'];
$extdir = $this->params['extdir']; $extdir = $this->params['extdir'];
@ -237,7 +240,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
echo "</td>"; echo "</td>";
echo "<td nowrap>"; echo "<td nowrap>";
echo "<div class=\"list-action\">"; echo "<div class=\"list-action\">";
if(file_exists($extdir."/".$extname."/README.md")) { if(file_exists($extdir."/".$extname."/README.".$session->getLanguage().".md") || file_exists($extdir."/".$extname."/README.md")) {
echo $this->getModalBoxLink(array('target'=>'extensionReadme', 'remote'=>'out.ExtensionMgr.php?action=readme&extensionname='.$extname, 'class'=>'', 'title'=>'<i class="fa fa-question"></i>', 'attributes'=>array('title'=>getMLText('show_extension_readme')))); echo $this->getModalBoxLink(array('target'=>'extensionReadme', 'remote'=>'out.ExtensionMgr.php?action=readme&extensionname='.$extname, 'class'=>'', 'title'=>'<i class="fa fa-question"></i>', 'attributes'=>array('title'=>getMLText('show_extension_readme'))));
} }
if(!empty($extconf['changelog']) && file_exists($extdir."/".$extname."/".$extconf['changelog'])) { if(!empty($extconf['changelog']) && file_exists($extdir."/".$extname."/".$extconf['changelog'])) {

View File

@ -874,9 +874,12 @@ function typeahead() { /* {{{ */
foreach($values as $v=>$c) { foreach($values as $v=>$c) {
$uu = $dms->getUserByLogin($v); $uu = $dms->getUserByLogin($v);
if($uu) { if($uu) {
$option = array($uu->getId(), $v.' ('.$c.')'); $option = array($uu->getId(), $v/*.' ('.$c.')'*/);
if(isset(${$facetname}) && in_array($uu->getId(), ${$facetname})) if(isset(${$facetname}) && in_array($uu->getId(), ${$facetname}))
$option[] = true; $option[] = true;
else
$option[] = false;
$option[] = array(array('data-subtitle', $c.' ×'));
$options[] = $option; $options[] = $option;
} }
} }
@ -884,35 +887,48 @@ function typeahead() { /* {{{ */
foreach($values as $v=>$c) { foreach($values as $v=>$c) {
$cat = $dms->getDocumentCategoryByName($v); $cat = $dms->getDocumentCategoryByName($v);
if($cat) { if($cat) {
$option = array($cat->getId(), $v.' ('.$c.')'); $option = array($cat->getId(), $v/*.' ('.$c.')'*/);
if(isset(${$facetname}) && in_array($cat->getId(), ${$facetname})) if(isset(${$facetname}) && in_array($cat->getId(), ${$facetname}))
$option[] = true; $option[] = true;
else
$option[] = false;
$option[] = array(array('data-subtitle', $c.' ×'));
$options[] = $option; $options[] = $option;
} }
} }
} elseif($facetname == 'status') { } elseif($facetname == 'status') {
foreach($values as $v=>$c) { foreach($values as $v=>$c) {
$option = array($v, getOverallStatusText($v).' ('.$c.')'); $option = array($v, getOverallStatusText($v)/*.' ('.$c.')'*/);
if(isset(${$facetname}) && in_array($v, ${$facetname})) if(isset(${$facetname}) && in_array($v, ${$facetname}))
$option[] = true; $option[] = true;
$options[] = $option; else
$option[] = false;
$option[] = array(array('data-subtitle', $c.' ×'));
$options[] = $option;
} }
} elseif(substr($facetname, 0, 5) == 'attr_') { } elseif(substr($facetname, 0, 5) == 'attr_') {
foreach($values as $v=>$c) { foreach($values as $v=>$c) {
$option = array($v, $v.' ('.$c.')'); $option = array($v, $v/*.' ('.$c.')'*/);
if(isset($attributes[$facetname]) && in_array($v, $attributes[$facetname])) if(isset($attributes[$facetname]) && in_array($v, $attributes[$facetname]))
$option[] = true; $option[] = true;
$options[] = $option; else
$option[] = false;
$option[] = array(array('data-subtitle', $c.' ×'));
$options[] = $option;
} }
} else { } else {
foreach($values as $v=>$c) { foreach($values as $v=>$c) {
$option = array($v, $v.' ('.$c.')'); $option = array($v, $v.' ('.$c.')');
if(isset(${$facetname}) && in_array($v, ${$facetname})) if(isset(${$facetname}) && in_array($v, ${$facetname}))
$option[] = true; $option[] = true;
else
$option[] = false;
$option[] = array(array('data-subtitle', $c.' ×'));
$options[] = $option; $options[] = $option;
} }
} }
if(substr($facetname, 0, 5) == 'attr_') { if(substr($facetname, 0, 5) == 'attr_') {
if($options) {
$tmp = explode('_', $facetname); $tmp = explode('_', $facetname);
if($attrdef = $dms->getAttributeDefinition($tmp[1])) if($attrdef = $dms->getAttributeDefinition($tmp[1]))
$dispname = $attrdef->getName(); $dispname = $attrdef->getName();
@ -930,6 +946,7 @@ function typeahead() { /* {{{ */
'multiple'=>$multiple 'multiple'=>$multiple
) )
); );
}
} else { } else {
$this->formField( $this->formField(
getMLText($facetname), getMLText($facetname),