mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
157c033f2a
|
@ -2100,6 +2100,15 @@ $(document).ready(function() {
|
|||
echo self::getAttributeEditField($attrdef, $attribute, $fieldname, $norequire, $namepostfix, $alwaysmultiple);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return html code for an input/select field of an attribute
|
||||
*
|
||||
* The passed attribute ($attribute) can either be an object of type
|
||||
* SeedDMS_Core_Attribute, scalar or an array. A scalar or array is
|
||||
* passed when the method is called to create the search form. In that
|
||||
* case $attribute has the value from the post data after submitting the
|
||||
* search form.
|
||||
*/
|
||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='', $alwaysmultiple=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$attr_id = $fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '');
|
||||
|
@ -2136,10 +2145,19 @@ $(document).ready(function() {
|
|||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $attr_name);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$target = $attribute ? $attribute->getValueAsArray() : [];
|
||||
$objvalue = [];
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
if($attribute) {
|
||||
if(is_object($attribute)) {
|
||||
$target = $attribute->getValueAsArray();
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
} elseif(is_array($attribute)) {
|
||||
foreach($attribute as $t)
|
||||
$objvalue[] = $t;
|
||||
} else {
|
||||
$objvalue[] = $attribute;
|
||||
}
|
||||
}
|
||||
$users = $dms->getAllUsers();
|
||||
if($users) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
|
@ -2159,10 +2177,19 @@ $(document).ready(function() {
|
|||
}
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||
$target = $attribute ? $attribute->getValueAsArray() : [];
|
||||
$objvalue = [];
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
if($attribute) {
|
||||
if(is_object($attribute)) {
|
||||
$target = $attribute->getValueAsArray();
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
} elseif(is_array($attribute)) {
|
||||
foreach($attribute as $t)
|
||||
$objvalue[] = $t;
|
||||
} else {
|
||||
$objvalue[] = $attribute;
|
||||
}
|
||||
}
|
||||
$groups = $dms->getAllGroups();
|
||||
if($groups) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
|
|
|
@ -353,7 +353,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style {
|
|||
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars($attribute->getValueAsString())."</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -813,9 +813,9 @@ $(document).ready(function() {
|
|||
} elseif(in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]) && !$attrdef->getValueSet()) {
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? $attributes[$attrdef->getID()]['from'] : '', 'attributes', true, 'from'));
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? $attributes[$attrdef->getID()]['to'] : '', 'attributes', true, 'to'));
|
||||
|
||||
} else
|
||||
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true, '', true));
|
||||
} else {
|
||||
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true, '', false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2044,6 +2044,15 @@ $(document).ready(function() {
|
|||
echo self::getAttributeEditField($attrdef, $attribute, $fieldname, $norequire, $namepostfix, $alwaysmultiple);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return html code for an input/select field of an attribute
|
||||
*
|
||||
* The passed attribute ($attribute) can either be an object of type
|
||||
* SeedDMS_Core_Attribute, scalar or an array. A scalar or array is
|
||||
* passed when the method is called to create the search form. In that
|
||||
* case $attribute has the value from the post data after submitting the
|
||||
* search form.
|
||||
*/
|
||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='', $alwaysmultiple=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$attr_id = $fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '');
|
||||
|
@ -2077,18 +2086,27 @@ $(document).ready(function() {
|
|||
$content .= "<input type=\"text\" class=\"form-control\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '')." data-rule-number=\"true\"/>";
|
||||
break; */
|
||||
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||
$target = $attribute ? $attribute->getValue() : null;
|
||||
$target = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : null;
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $attr_name, false);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$target = $attribute ? $attribute->getValue() : null;
|
||||
$target = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : null;
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $attr_name);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$target = $attribute ? $attribute->getValueAsArray() : [];
|
||||
$objvalue = [];
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
if($attribute) {
|
||||
if(is_object($attribute)) {
|
||||
$target = $attribute->getValueAsArray();
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
} elseif(is_array($attribute)) {
|
||||
foreach($attribute as $t)
|
||||
$objvalue[] = $t;
|
||||
} else {
|
||||
$objvalue[] = $attribute;
|
||||
}
|
||||
}
|
||||
$users = $dms->getAllUsers();
|
||||
if($users) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
|
@ -2108,10 +2126,19 @@ $(document).ready(function() {
|
|||
}
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||
$target = $attribute ? $attribute->getValueAsArray() : [];
|
||||
$objvalue = [];
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
if($attribute) {
|
||||
if(is_object($attribute)) {
|
||||
$target = $attribute->getValueAsArray();
|
||||
foreach($target as $t)
|
||||
$objvalue[] = $t->getId();
|
||||
} elseif(is_array($attribute)) {
|
||||
foreach($attribute as $t)
|
||||
$objvalue[] = $t;
|
||||
} else {
|
||||
$objvalue[] = $attribute;
|
||||
}
|
||||
}
|
||||
$groups = $dms->getAllGroups();
|
||||
if($groups) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user