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
- color category (use first 6 chars of md5(category name) as hex color)
- create missing preview images in category or attribute manager
- support README of extension in different languages
--------------------------------------------------------------------------------
Changes in version 5.1.29

View File

@ -45,7 +45,8 @@ function renderBooleanData($colname, $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;
} /* }}} */
@ -240,7 +241,7 @@ if (isset($_FILES['userdata']) && $_FILES['userdata']['error'] == 0) {
if($makeupdate)
$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()."'");
if($makeupdate)
$eu->setPwd($u['passenc']);

View File

@ -178,6 +178,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
function readme() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$session = $this->params['session'];
$extdir = $this->params['extdir'];
$extmgr = $this->params['extmgr'];
$extname = $this->params['extname'];
@ -185,9 +186,10 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
if(isset($extconf[$extname])) {
$extconf = $extconf[$extname];
if(file_exists($extdir."/".$extname."/README.md")) {
// echo '<div style="white-space: pre-wrap; font-family: monospace; padding: 0px;">'.file_get_contents($extdir."/".$extname."/README.md")."</div>";
$Parsedown = new Parsedown();
if(file_exists($extdir."/".$extname."/README.".$session->getLanguage().".md")) {
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"));
}
}
@ -197,6 +199,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
$session = $this->params['session'];
$httproot = $this->params['httproot'];
$extmgr = $this->params['extmgr'];
$extdir = $this->params['extdir'];
@ -237,7 +240,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
echo "</td>";
echo "<td nowrap>";
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'))));
}
if(!empty($extconf['changelog']) && file_exists($extdir."/".$extname."/".$extconf['changelog'])) {

View File

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