mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
80ecac5710
|
@ -266,6 +266,7 @@
|
|||
- fix preview for file in drop folder
|
||||
- fix export of search result
|
||||
- use openssl instead of mcrypt
|
||||
- search form shows 'from' and 'to' field for integers and floats
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.30
|
||||
|
|
|
@ -2000,28 +2000,30 @@ $(document).ready(function() {
|
|||
|
||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='', $alwaysmultiple=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$attr_id = $fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '');
|
||||
$attr_name = $fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '');
|
||||
$content = '';
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\" />";
|
||||
$content .= "<input type=\"checkbox\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
|
||||
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\" />";
|
||||
$content .= "<input type=\"checkbox\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||
$objvalue = $attribute ? getReadableDate((is_object($attribute) ? $attribute->getValue() : $attribute)) : '';
|
||||
$dateformat = getConvertDateFormat($this->params['settings']->_dateformat);
|
||||
$content .= '<span class="input-append date span12 datepicker" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'">
|
||||
<input id="'.$fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '').'" class="span6" size="16" name="'.$fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '').'" type="text" value="'.($objvalue ? getReadableDate($objvalue) : '').'">
|
||||
<input id="'.$attr_id.'" class="span6" size="16" name="'.$attr_name.'" type="text" value="'.($objvalue ? getReadableDate($objvalue) : '').'">
|
||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||
</span>';
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_email:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"text\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').' data-rule-email="true"'." />";
|
||||
$content .= "<input type=\"text\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').' data-rule-email="true"'." />";
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_float:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"text\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '')." data-rule-number=\"true\"/>";
|
||||
$content .= "<input type=\"text\" 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:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
|
@ -2029,7 +2031,7 @@ $(document).ready(function() {
|
|||
$target = $dms->getFolder($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $fieldname."[".$attrdef->getId()."]", false);
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $attr_name, false);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
|
@ -2037,7 +2039,7 @@ $(document).ready(function() {
|
|||
$target = $dms->getDocument($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $attr_name);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||
|
@ -2045,7 +2047,7 @@ $(document).ready(function() {
|
|||
if($users) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues() || $alwaysmultiple;
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_user")."\">";
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" id=\"".$attr_id."\" name=\"".$attr_name.($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_user")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($users as $curuser) {
|
||||
|
@ -2065,7 +2067,7 @@ $(document).ready(function() {
|
|||
if($groups) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues() || $alwaysmultiple;
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_group")."\">";
|
||||
$content .= "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" id=\"".$attr_id."\" name=\"".$attr_name.($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_group")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($groups as $curgroup) {
|
||||
|
@ -2081,8 +2083,8 @@ $(document).ready(function() {
|
|||
break;
|
||||
default:
|
||||
if($valueset = $attrdef->getValueSetAsArray()) {
|
||||
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\"/>";
|
||||
$content .= "<select id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]";
|
||||
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\"/>";
|
||||
$content .= "<select id=\"".$attr_id."\" name=\"".$attr_name;
|
||||
if($attrdef->getMultipleValues() || $alwaysmultiple) {
|
||||
$content .= "[]\" multiple";
|
||||
} else {
|
||||
|
@ -2107,9 +2109,9 @@ $(document).ready(function() {
|
|||
} else {
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
if(strlen($objvalue) > 80) {
|
||||
$content .= "<textarea id=\"".$fieldname."_".$attrdef->getId()."\" class=\"input-xxlarge\" name=\"".$fieldname."[".$attrdef->getId()."]\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').">".htmlspecialchars($objvalue)."</textarea>";
|
||||
$content .= "<textarea id=\"".$attr_id."\" class=\"input-xxlarge\" name=\"".$attr_name."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').">".htmlspecialchars($objvalue)."</textarea>";
|
||||
} else {
|
||||
$content .= "<input type=\"text\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int ? ' data-rule-digits="true"' : '')." />";
|
||||
$content .= "<input type=\"text\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int ? ' data-rule-digits="true"' : '')." />";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -105,12 +105,12 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
|||
echo implode(', ', $phpextensions);
|
||||
|
||||
$this->contentHeading(getMLText("missing_php_extensions"));
|
||||
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick');
|
||||
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick', 'openssl');
|
||||
echo implode(', ', array_diff($requiredext, $phpextensions));
|
||||
|
||||
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
|
||||
$missingfunc = [];
|
||||
foreach(array('proc_open') as $funcname) {
|
||||
foreach(array('proc_open', 'openssl_cipher_iv_length') as $funcname) {
|
||||
if(!function_exists($funcname)) {
|
||||
$missingfunc[] = $funcname; //getMLText('func_'.$funcname."_missing")
|
||||
}
|
||||
|
|
|
@ -583,7 +583,7 @@ function typeahead() { /* {{{ */
|
|||
* even if it is empty. FIXME should be also checked.
|
||||
*/
|
||||
$hasattrs = true;
|
||||
if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date)
|
||||
if(!in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_date, SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]))
|
||||
if(!empty($attributes[$attrdef->getID()]))
|
||||
$openfilterdlg = true;
|
||||
}
|
||||
|
@ -597,6 +597,9 @@ function typeahead() { /* {{{ */
|
|||
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from'));
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'));
|
||||
} 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));
|
||||
}
|
||||
|
@ -618,7 +621,7 @@ function typeahead() { /* {{{ */
|
|||
/* Do not check dates because they always have 'from' and 'to' element
|
||||
* even if it is empty. FIXME should be also checked.
|
||||
*/
|
||||
if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date)
|
||||
if(!in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_date, SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]))
|
||||
if(!empty($attributes[$attrdef->getID()]))
|
||||
$openfilterdlg = true;
|
||||
}
|
||||
|
@ -714,6 +717,10 @@ function typeahead() { /* {{{ */
|
|||
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from'));
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'));
|
||||
} 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));
|
||||
}
|
||||
|
@ -734,7 +741,7 @@ function typeahead() { /* {{{ */
|
|||
foreach($attrdefs as $attrdef) {
|
||||
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) {
|
||||
$hasattrs = true;
|
||||
if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date)
|
||||
if(!in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_date, SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]))
|
||||
if(!empty($attributes[$attrdef->getID()]))
|
||||
$openfilterdlg = true;
|
||||
}
|
||||
|
@ -748,6 +755,10 @@ function typeahead() { /* {{{ */
|
|||
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from'));
|
||||
$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'));
|
||||
} 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));
|
||||
}
|
||||
|
|
|
@ -1961,25 +1961,27 @@ $(document).ready(function() {
|
|||
|
||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='', $alwaysmultiple=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$attr_id = $fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '');
|
||||
$attr_name = $fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '');
|
||||
$content = '';
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\" />";
|
||||
$content .= "<input type=\"checkbox\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
|
||||
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\" />";
|
||||
$content .= "<input type=\"checkbox\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$dateformat = getConvertDateFormat($this->params['settings']->_dateformat);
|
||||
/*
|
||||
$content .= '<span class="input-append date datepicker" data-date="'.getReadableDate(').'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'">
|
||||
<input id="'.$fieldname.'_'.$attrdef->getId().'" class="span9" size="16" name="'.$fieldname.'['.$attrdef->getId().']" type="text" value="'.($objvalue ? $objvalue : '').'">
|
||||
<input id="'.$attr_id.'" class="span9" size="16" name="'.$attr_name.'" type="text" value="'.($objvalue ? $objvalue : '').'">
|
||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||
</span>';
|
||||
*/
|
||||
$content = '
|
||||
<div class="input-group date">
|
||||
<input type="text" class="form-control" id="'.$fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '').'" name="'.$fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '').'" value="'.($objvalue ? getReadableDate($objvalue) : '').'" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'" data-date-autoclose="true" data-provide="datepicker">
|
||||
<input type="text" class="form-control" id="'.$attr_id.'" name="'.$attr_name.'" value="'.($objvalue ? getReadableDate($objvalue) : '').'" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'" data-date-autoclose="true" data-provide="datepicker">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
|
@ -1988,11 +1990,11 @@ $(document).ready(function() {
|
|||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_email:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"text\" class=\"form-control\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').' data-rule-email="true"'." />";
|
||||
$content .= "<input type=\"text\" class=\"form-control\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').' data-rule-email="true"'." />";
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_float:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
$content .= "<input type=\"text\" class=\"form-control\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '')." data-rule-number=\"true\"/>";
|
||||
$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:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
|
@ -2000,7 +2002,7 @@ $(document).ready(function() {
|
|||
$target = $dms->getFolder($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $fieldname."[".$attrdef->getId()."]", false);
|
||||
$content .= $this->getFolderChooserHtml("attr".$attrdef->getId(), M_READWRITE, -1, $target, $attr_name, false);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? (int) $attribute->getValue() : (int) $attribute) : 0;
|
||||
|
@ -2008,7 +2010,7 @@ $(document).ready(function() {
|
|||
$target = $dms->getDocument($objvalue);
|
||||
else
|
||||
$target = null;
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $attr_name);
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||
|
@ -2016,7 +2018,7 @@ $(document).ready(function() {
|
|||
if($users) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues() || $alwaysmultiple;
|
||||
$content .= "<select class=\"form-control chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_user")."\">";
|
||||
$content .= "<select class=\"form-control chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" id=\"".$attr_id."\" name=\"".$attr_name.($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_user")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($users as $curuser) {
|
||||
|
@ -2036,7 +2038,7 @@ $(document).ready(function() {
|
|||
if($groups) {
|
||||
$allowempty = $attrdef->getMinValues() == 0;
|
||||
$allowmultiple = $attrdef->getMultipleValues() || $alwaysmultiple;
|
||||
$content .= "<select class=\"form-control chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$fieldname."[".$attrdef->getId()."]".($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_group")."\">";
|
||||
$content .= "<select class=\"form-control chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" id=\"".$attr_id."\" name=\"".$attr_name.($allowmultiple ? '[]' : '')."\"".($allowmultiple ? " multiple" : "")." data-placeholder=\"".getMLText("select_group")."\">";
|
||||
if($allowempty)
|
||||
$content .= "<option value=\"\"></option>";
|
||||
foreach($groups as $curgroup) {
|
||||
|
@ -2052,8 +2054,8 @@ $(document).ready(function() {
|
|||
break;
|
||||
default:
|
||||
if($valueset = $attrdef->getValueSetAsArray()) {
|
||||
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\"/>";
|
||||
$content .= "<select id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]";
|
||||
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\"/>";
|
||||
$content .= "<select id=\"".$attr_id."\" name=\"".$attr_name;
|
||||
if($attrdef->getMultipleValues() || $alwaysmultiple) {
|
||||
$content .= "[]\" multiple";
|
||||
} else {
|
||||
|
@ -2078,9 +2080,9 @@ $(document).ready(function() {
|
|||
} else {
|
||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||
if(strlen($objvalue) > 80) {
|
||||
$content .= "<textarea class=\"form-control\" id=\"".$fieldname."_".$attrdef->getId()."\" class=\"input-xxlarge\" name=\"".$fieldname."[".$attrdef->getId()."]\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').">".htmlspecialchars($objvalue)."</textarea>";
|
||||
$content .= "<textarea class=\"form-control\" id=\"".$attr_id."\" class=\"input-xxlarge\" name=\"".$attr_name."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').">".htmlspecialchars($objvalue)."</textarea>";
|
||||
} else {
|
||||
$content .= "<input type=\"text\" class=\"form-control\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int ? ' data-rule-digits="true"' : '')." />";
|
||||
$content .= "<input type=\"text\" class=\"form-control\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"".htmlspecialchars($objvalue)."\"".((!$norequire && $attrdef->getMinValues() > 0) ? ' required="required"' : '').($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int ? ' data-rule-digits="true"' : '')." />";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user