2define (
'FORM_SUBMIT_BTN_NAME',
'submit_button');
144 private $formControlFields = array();
157 parent::__construct();
158 $this->AddStyleFile(
'm_forms.css');
159 $this->name = $this->page->name;
163 $this->method =
'post';
164 $this->
return =
false;
165 $this->width =
'95%';
166 $this->defaultButton =
true;
167 $this->fields = array();
168 $this->validations = array();
189 $randomId = (Integer)
$MIOLO->_REQUEST(
'randomid');
191 if ( empty($randomId) )
194 $_REQUEST[
"randomid"] = (Integer) $randomId;
206 $this->_RegisterField($fieldRandom);
207 $this->layout[] = $fieldRandom;
222 $this->AddControl($value);
223 $this->fields[
$name] = $value;
238 return $this->fields[
$name] ??
null;
286 $field = $this->{$validator->field};
293 $field->validator = $validator;
297 if ( !$validator->label )
299 $validator->label = ( $validator->label ==
'' ? ( $field->label ??
'' ) : $validator->label );
302 $name =
'_validator_' . $this->name .
'_' . $validator->id .
'_' . $validator->field;
303 $validator->name = strtr(
$name, array(
'['=>
'_',
']'=>
'_'));
305 $validator->max = $validator->max ?? 0;
306 $this->validations[] = $validator;
316 return $this->formControlFields;
330 foreach ( (array)
$fields as $f )
340 elseif ( $f instanceof
MDiv )
344 elseif ( is_object($f) && ($f->name == $fieldName) )
370 if (is_array($validators))
372 foreach($validators as $v)
380 elseif (is_subclass_of( $validators,
'validator'))
402 if (isset($this->buttons))
404 foreach($this->buttons as $b)
449 $this->box->SetCaption(
$title);
466 if ($this->box->boxTitle != NULL)
468 $this->box->boxTitle->SetClose(
$action);
487 if ($this->box->boxTitle != NULL)
489 $this->box->boxTitle->SetIcon($icon);
495 $this->zebra = array($color0, $color1);
559 if ( is_array($field) )
561 foreach($field as $f)
572 $defvalue = $field->GetValue();
573 $value = $this->page->Request($field->name);
576 $field->checked = (isset($value) ? ($value == $field->value) : $field->checked);
580 $field->SetValue(isset($value) ? $value : $defvalue);
606 if ( (
$name !=
'') && ((strpos(
$name,
'[')) ===
false))
610 if (! isset($result))
632 $value = $this->EscapeValue($value);
636 $this->
$name->SetValue($value);
639 $_REQUEST[
$name] = $value;
652 private function EscapeValue($value)
654 if ( is_array($value) )
656 for ( $i=0, $n = count($value); $i < $n; $i++ )
658 $val = htmlentities($value[$i], ENT_QUOTES);
659 $value[$i] = $this->EscapeValue($val);
664 $value = str_replace(
'\"',
'"',$value);
665 $value = str_replace(
'"',
'"',$value);
666 $value = htmlentities($value, ENT_QUOTES);
694 $this->page->OnSubmit($jscode);
709 $this->page->AddJsCode($jscode);
750 if ($this->box->boxTitle != NULL)
758 if ( strlen($content) > 0 )
760 $content =
$MIOLO->getConf(
'options.urlHelp').$content;
768 $this->box->boxTitle->setHelp($content);
785 private function GetFields()
805 $this->fields = array();
808 $this->_RegisterField(
$fields);
829 private function _RegisterField($field, $isNotFormControl =
false)
831 if ( is_array($field) )
833 for ( $i=0, $n = count($field); $i < $n; $i++ )
835 $this->_RegisterField($field[$i], $isNotFormControl);
838 elseif ($field instanceof
MDiv)
840 $namefield = $field->id;
841 $this->$namefield = $field;
843 $field = $field->getInner();
845 if(is_array($field) || is_object($field) )
847 return $this->_registerField($field, $isNotFormControl);
853 $field->form = $this;
855 if ( method_exists($field,
'setFieldForm') )
858 $this->formControlFields[ $field->getName() ] = $field;
864 $this->enctype=
'multipart/form-data';
865 $this->page->setEnctype($this->enctype);
867 if ($field->name == $field->id)
869 $namefield = $field->name;
873 $namefield = $field->id;
875 $this->manager->Assert(!isset($this->$namefield),
"Err: property [$namefield] already in use in the form [$this->title]! Choose another name to [$namefield].");
876 $this->$namefield = $field;
881 $value = $this->page->Request($field->name);
885 $field->checked = $this->page->isPostBack() ? ($value == $field->value) : $field->checked;
890 $field->SetValue($value);
894 $field->SetValue($value);
896 elseif ( $field->value ==
'' )
898 $field->SetValue($value);
901 $this->_RegisterField($field->GetControls(),
true);
905 $field->SetValue($this->EscapeValue($field->value));
936 $field->SetHint($hint);
938 $this->_RegisterField($field);
939 $this->layout[] = $field;
986 if (strtoupper($btn->action ==
'REPORT'))
988 $this->page->hasReport =
true;
990 $this->buttons[] = $this->{$btn->GetId()} = $btn;
1005 if ( is_array($btn) )
1007 for ( $i=0, $n = count($btn); $i < $n; $i++ )
1028 $this->buttons[$index]->label = $label;
1047 $this->
return = $state;
1058 $this->defaultButton = $state;
1077 $this->reset = $state;
1102 self::$showHints = $state;
1129 return $this->_GetFieldList($this->fields);
1141 private function _GetFieldList($allfields)
1144 foreach ($allfields as $f )
1148 foreach ( $f as $a )
1150 if (is_a($a,
'BaseLabel'))
continue;
1156 if ( is_a($f,
'BaseLabel') || is_null($f->value) )
continue;
1165 $this->fields = NULL;
1166 $this->layout = NULL;
1171 $this->buttons = NULL;
1188 foreach ( $this->getFieldList() as $f )
1192 $required[] = $f->name;
1195 return $this->
validate($required, $assert);
1209 foreach ( $this->getFieldList() as $f )
1213 $required[] = $f->name;
1216 return $this->Validate( $required, $assert );
1232 function validate( $required, $assert=
true, $args = NULL)
1233 { global
$MIOLO,$HTTP_POST_VARS;
1235 $this->errors = array();
1237 foreach ( $this->getFieldList() as $f )
1241 foreach ( $required as $r )
1246 "ERROR: Required field [<b><font color=red>$name</font></b>] is not defined in form!" );
1248 $value = $this->getFormValue(
$name );
1249 if ( $value ===
'' || (is_null($value)) )
1251 $this->errors[] =
"<b>$label</b> " . _M(
"was not informed!");
1254 if ( $assert && count($this->errors) )
1256 $theme =&
$MIOLO->getTheme();
1257 $theme->setContent( $this );
1260 return count( $this->errors ) == 0;
1275 $MIOLO->logMessage(
'[DEPRECATED] Call method Form::Error() is deprecated -- use Form::AddError() instead!');
1276 $this->addError( $err );
1295 if ( is_array($err) )
1297 if ( $this->errors )
1299 $this->errors = array_merge($this->errors,$err);
1304 $this->errors = $err;
1309 $this->errors[] = $err;
1327 return $this->errors ? count($this->errors) : 0;
1347 if ( is_array($info) )
1351 $this->infos = array_merge($this->infos,$info);
1356 $this->infos = $info;
1361 $this->infos[] = $info;
1379 return $this->infos ? count($this->infos) : 0;
1395 if ( is_array($alert) )
1397 if ( $this->alerts )
1399 $this->alerts = array_merge($this->alerts,$alert);
1404 $this->alerts = $alert;
1409 $this->alerts[] = $alert;
1429 return $this->alerts ? count($this->alerts) : 0;
1453 $data->$field = MSubDetail::getData($field);
1460 $data->$field = $value;
1476 return $this->collectInput(
new FormData() );
1484 return (
object) $_REQUEST;
1503 $this->_SetData($data);
1528 private function _SetData($data)
1530 foreach( $this->fields as $i=>$field)
1532 $name = $this->fields[$i]->name;
1536 ($this->fields[$i] instanceof
MCheckBox) )
1538 $this->fields[$i]->checked = ( $data->$name == $this->fields[$i]->value );
1542 MSubDetail::setData($data->$name,
$name);
1546 $value = $data->$name;
1548 if ( method_exists($this->fields[$i],
'setValue') )
1550 $this->fields[$i]->setValue($value);
1553 $_POST[
$name] = $value;
1575 $field = $this->fields[
$name];
1576 return ($field ? $field->GetValue() : NULL);
1595 $field = $this->fields[
$name];
1597 if( method_exists($field,
'setValue') )
1599 $field->setValue( $value );
1619 for ( $i=0, $n = count($field); $i < $n; $i++ )
1621 if (
$name == $this->fields[$i]->name )
1623 $this->fields[$i]->validator = $value;
1635 return $this->fields[
$name];
1644 for ( $i=0, $n = count($this->buttons); $i < $n; $i++ )
1646 if (
$name == $this->buttons[$i]->name )
1648 return $this->buttons[$i];
1677 $this->page = &
$page;
1699 $this->fields[
$name]->$attr = $value;
1719 $field = $this->fields[
$name];
1720 if ( is_array($field->$attr) )
1723 $value = $a[$index];
1727 $value = $field->$attr;
1750 $button->$attr = $value;
1772 $field = $this->$name;
1777 $field->width =
"{$width}px";
1779 $field->top =
"{$top}px";
1780 $field->left =
"{$left}px";
1781 if ($position) $field->position = $position;
1782 $field->formMode = 2;
1803 if ($height) $this->box->AddStyle(
'height',
"{$height}px");
1804 if (
$width) $this->box->AddStyle(
'width',
"{$width}px");
1805 if ($top) $this->box->AddStyle(
'top',
"{$top}px");
1806 if ($left) $this->box->AddStyle(
'left',
"{$left}px");
1807 if ($position) $this->box->AddStyle(
'position',$position);
1808 $this->cssButtons =
"{$buttons}px";
1809 $this->cssForm =
true;
1814 $this->bgColor = $bgcolor;
1819 $this->align = $value;
1824 if (
$width) $this->box->AddStyle(
'width',
"{$width}");
1829 if ($height) $this->box->AddStyle(
'height',
"{$height}");
1845 $this->labelWidth =
$width;
1919 if( method_exists($this->page,
'getLayout') )
1921 $layout = $this->page->theme->GetLayout();
1925 $layout = $this->manager->theme->GetLayout();
1933 $t = array_merge($t,array(
$buttons));
1942 $body =
new MDiv(
'',$t);
1971 $zebra = is_array($this->zebra);
1973 if (is_array($this->layout))
1976 foreach ( $this->layout as $f )
1981 $row->AddStyle(
'backgroundColor', $this->zebra[($line++) % 2]);
1996 elseif ( $field instanceof
MDiv )
2000 elseif ( $field->validator != NULL && $field->validator instanceof
MValidator )
2002 $this->addValidator($field->validator);
2007 $field->validator = $validator;
2022 foreach ( $this->validations as $validator )
2024 if ( $validator && $validator->field ==
$name )
2042 foreach( $this->validations as $validator )
2044 if ( $validator && $validator->field ==
$name )
2046 $list[] = $validator;
2062 $identifier = str_replace(
']',
'_', str_replace(
'[',
'_', $fieldId));
2064 $identifier = str_replace(
'.',
'_', $identifier);
2066 $this->page->addAJAXJsCode(
"delete window.MIOLO_validators.$identifier;");
2081 if ( is_array($field) )
2084 foreach ( $field as $fld )
2086 if ( $fld->visible )
2092 $field->showLabel =
true;
2095 if ( !$field->visible )
2101 $label = $field->label;
2102 if ( ( ( ($field->className ==
'textfield') || ($field->className ==
'mtextfield')) && ($field->size == 0) ) || ($field instanceof
MHiddenField) )
2107 if ( $field->maintainstate )
2119 $rowContent = $field;
2125 if ( $label !=
'' && $label !=
' ' && $label[strlen($label)-1] !=
':' )
2132 if ( $field->id !=
'' )
2142 if ( $field->validator )
2144 if ( $field->validator->type ==
'required' )
2148 elseif ( is_array($this->validations) )
2152 foreach ( $this->validations as $validator )
2154 if ( $validator && $validator->field == $field->name && $validator->type ==
'required' )
2162 elseif ( $field instanceof
MContainer && $field->showRequiredLabel )
2167 $slbl = $rowContent[] =
new MSpan(
'', $lbl,
'label');
2168 if ( $this->labelWidth != NULL )
2170 $slbl->_AddStyle(
'width', $this->labelWidth .
'px');
2174 $sfld =
new MSpan(
'', $field,
'field');
2175 $rowContent[] = $sfld;
2177 return new MDiv(
'', $rowContent,
"m-form-row row");
2189 $ul =
new MUnorderedList();
2190 if (isset($this->buttons) )
2192 $ul->AddOption(
new MHr);
2193 foreach ( $this->buttons as $b )
2195 if ($b->visible) $ul->AddOption($b);
2200 $ul->AddOption(
new MButton(
'_reset',
'Limpar',
'RESET'));
2202 if ( $this->
return )
2204 $ul->AddOption(
new MButton(
'_return',
'Voltar',
'RETURN'));
2206 $d = (count($ul->options) ?
new MDiv(
'',$ul,
'm-form-button-box') : NULL);
2207 return ($d ?
new MDiv(
'', $d,
'm-form-row row') : NULL);
2222 $f[] =
"\n<!-- START OF HIDDEN FIELDS -->\n";
2223 foreach ( $hidden as $h )
2227 $f[] =
"\n<!-- END OF HIDDEN FIELDS -->";
2245 if ( $this->validations )
2248 $f[] =
"\n<!-- START OF FORM SCRIPT CODE -->\n";
2249 $f[] =
"<script language=\"JavaScript\">\n";
2251 $this->
OnSubmit(
"MIOLO_Validate_Input()");
2254 $f[] =
" * MIOLO Form Validation Objects\n";
2256 foreach ( $this->validations as $v )
2261 $f[] =
"var {$this->name}_validations = Array( ";
2263 foreach ( $this->validations as $v )
2269 $f[] = str_replace(
'.',
'_', $v->name);
2273 $f[] =
"</script>\n";
2274 $f[] =
"<!-- END OF FORM SCRIPT CODE -->\n";
2282 $f .=
"\n<!-- START OF FORM SCRIPT CODE -->\n";
2283 $f .=
"<script language=\"JavaScript\">\n";
2284 if ( $this->validations )
2286 $f .=
"document.forms[0].onsubmit = function () { return MIOLO_Validate_Input(); }";
2289 $f .=
" * MIOLO Form Validation Objects\n";
2291 foreach ( $this->validations as $v )
2293 $f .= $v->generate();
2296 $f .=
"var {$this->name}_validations = Array( ";
2298 foreach ( $this->validations as $v )
2304 $f .= str_replace(
'.',
'_', $v->name);
2311 $f .=
"var {$this->name}_validations = Array();";
2312 $f .=
"document.forms[0].onsubmit = function () { return MIOLO_Validate_Input(); }";
2314 $f .=
"</script>\n";
2315 $f .=
"<!-- END OF FORM SCRIPT CODE -->\n";
2321 if (!isset($this->buttons))
2323 if ($this->defaultButton)
2332 $this->box->SetControls(array($body));
2333 $this->box->SetBoxClass(
'm-form-css');
2334 return $this->box->Generate();
2338 $body =
new MDiv(
'',$this->
GenerateBody(),
'm-form-body panel-body card-body');
2339 if (!is_null($this->bgColor)) $body->AddStyle(
'backgroundColor',$this->bgColor);
2340 $this->box->SetControls(array($body,
$footer));
2341 $id = strlen($this->
id) > 0 ? $this->id : $this->GetUniqueId();
2342 $this->box->SetBoxClass(
"m-form-outer");
2343 $form =
new MDiv(
"frm$id", $this->box,
"m-form-box");
2344 if (!is_null($this->align)) $form->AddBoxStyle(
'text-align',$this->align);
2345 return $form->Generate();
2359 protected function getGrid($campos = array(), $gridName = NULL)
2364 foreach ( $campos as $field )
2393 if ( is_subclass_of($field,
"MGrid") && $field->name == $gridName )
2404 return $this->
getGrid($camposAtuais, $gridName);
2422 $camposAtuais =
null;
2424 if( $field instanceof
MDiv)
2426 $camposAtuais = $field->getInner();
2429 else if( $field instanceof
MTab)
2431 $camposAtuais = $field->getControls();
2436 $camposAtuais = $field->getTabs();
2440 return $camposAtuais;
2446 $grid = $this->
getGrid($this->fields, $gridName);
2453 return is_subclass_of($grid,
"MGrid") ? $grid->getQuery() :
null;
2458 $grid = $this->
getGrid($this->fields, $gridName);
2465 $isArrayGridMode = !isset($grid->columns[0]);
2468 foreach ($grid->columns as $index => $c)
2472 $titles[] = $c->title;
2476 $invisibleColumns[] = $index;
2480 $data = $grid->getData();
2486 $titleCount = count($titles);
2487 $visibleData = array();
2488 foreach ( $data as $line )
2490 if ( $invisibleColumns )
2493 foreach ( $invisibleColumns as $index )
2495 unset( $line[$index] );
2500 if ( $isArrayGridMode )
2502 $keys = array_keys($grid->columns);
2504 foreach ( $keys as $columnName )
2506 if( !in_array($columnName, $invisibleColumns) )
2509 if ( $grid->columns[$columnName]->options )
2511 $line[$columnName] = $grid->columns[$columnName]->options[$line[$columnName]];
2514 $newLine[] = $line[$columnName];
2520 $newLine = array_values(array_slice($line, 0, $titleCount));
2523 $visibleData[] = $newLine;
2526 $titles = array_values( $titles );
2527 return array_merge( array($titles), $visibleData );
2539 public function addCustomFields($identifier, $customizedId=NULL, $suffix=
'', $somenteComActionUrl =
false)
2552 public function getCustomFields($identifier, $customizedId=NULL, $suffix=
'', $somenteComActionUrl =
false, $step =
null)
2561 $this->mioloCustomizedId = $customizedId;
2564 if ( isset($customizedId) )
2571 if( $somenteComActionUrl )
2592 return $customFields;
2614 $cfield->suffix = $suffix;
2617 $value = $this->
GetFormValue(
$id, isset($data) && isset($data->$id) ? $data->$id : $cfield->defaultValue);
2620 if ( $cfield->isRequired() )
2625 switch ( $cfield->fieldFormat )
2634 $field->setJsHint($cfield->jshint);
2636 if ( $cfield->isRequired() && $cfield->isEditable() && $cfield->isVisible() )
2638 $field->isRequired =
'true';
2644 $field =
new MFloatField(
$id, $value, $label, 10, $cfield->hint);
2645 $field->setJsHint($cfield->jshint);
2649 $field =
new MTextField(
$id, $value, $label, strlen($cfield->largura) > 0 ? $cfield->largura : 10, $cfield->hint);
2651 $validator =
new MIntegerValidator(
$id, $label, $cfield->isRequired() ?
'required' :
'optional');
2655 $field =
new sEscolha(
$id, $value, $label,
new $cfield->objetoreferencia(), $cfield->hint);
2656 $field->setJsHint($cfield->jshint);
2660 $field =
new MSelection(
$id, $value, $label, $cfield->getListValues(),
false, $cfield->hint);
2661 $field->setJsHint($cfield->jshint);
2665 $field =
new MSelection(
$id, $value, $label, $cfield->getListSQL());
2666 $field->hint = $cfield->getFieldHint() ?? $cfield->hint;
2667 $field->setJsHint($cfield->jshint);
2671 if (isset($value) && SAGU::is_json($value))
2673 $value = json_decode($value);
2676 $field =
new MTagSelection(
$id, $value, $label, $cfield->getListSQL(),
false,
'',
'3', 1);
2677 $field->hint = $cfield->getFieldHint() ?? $cfield->hint;
2678 if (!empty($cfield->jshint))
2680 $field->addAttribute(
'title', $cfield->jshint);
2686 $selectValues = $cfield->getListValues();
2687 $countValues = count($selectValues);
2690 if (isset($value) && SAGU::is_json($value))
2692 $value = json_decode($value);
2695 $field =
new MTagSelection(
$id, $value, $label, $selectValues,
false, $cfield->hint);
2696 $field->size =
'10';
2697 if (!empty($cfield->jshint))
2699 $field->addAttribute(
'title', $cfield->jshint);
2701 if ($countValues < 10)
2703 $field->size = $countValues;
2708 $selectValues = $cfield->getListSQL();
2709 $countValues = count($selectValues);
2712 if (isset($value) && sagu::is_json($value))
2714 $value = json_decode($value);
2718 $field->hint = $cfield->getFieldHint() ?? $cfield->hint;
2719 if (!empty($cfield->jshint))
2721 $field->addAttribute(
'title', $cfield->jshint);
2723 $field->size =
'10';
2724 if ($countValues < 10)
2726 $field->size = $countValues;
2731 $field =
new MMultilineField(
$id, $value, $label, strlen($cfield->largura) > 0 ? $cfield->largura : 25, strlen($cfield->altura) ? $cfield->altura : 5, strlen($cfield->largura) ? $cfield->largura : 20, $cfield->hint);
2732 $field->setJsHint($cfield->jshint);
2736 $field =
new MTextField(
$id, $value, $label, strlen($cfield->largura) > 0 ? $cfield->largura : 10, $cfield->hint);
2740 $field =
new sEscolha(
$id, $value, $label,
null, $cfield->hint, $cfield->getListValues());
2741 $field->setJsHint($cfield->jshint);
2742 $this->page->addJsCode(
"$('#" .
$id .
"').hide();");
2745 $field =
new sEscolha(
$id, $value, $label,
null, $cfield->hint, $cfield->getListSQL());
2746 $field->setJsHint($cfield->jshint);
2749 $field =
new MDiv(
$id,
"<script>" . $value .
"</script>");
2752 $field =
new MFileField(
$id, $value, $label, strlen($cfield->largura) > 0 ? $cfield->largura : 10, $cfield->hint);
2754 $field->addAttribute(
"accept", $cfield->possibleValues);
2760 $field->forceShowLabel =
true;
2761 $field->setWidth($cfield->largura ?? SAGU::getParameter(
'BASIC',
'FIELD_EDITOR_SIZE'));
2766 if ( $cfield->maxLength != 0 )
2773 $validator->min = $cfield->minLength;
2774 $validator->max = $cfield->maxLength;
2779 if ( !$cfield->isEditable() )
2781 $field->setReadOnly(
true);
2785 if ( !$cfield->isVisible() )
2787 $field->addBoxStyle(
'display',
'none');
2793 $fieldLabel =
new MLabel($label .
":");
2794 $fieldLabel->setClass(
"m-caption");
2795 if($cfield->isRequired())
2797 $fieldLabel->setClass(
'm-caption m-caption-required');
2799 $fieldLabel->setWidth(SAGU::getParameter(
'BASIC',
'FIELD_CONTAINER_SIZE'));
2805 if ( $validator != NULL )
2807 $this->addValidator($validator);
2823 public function saveCustomFields($customizedId, $data =
null, $identifier =
null, $somenteComActionUrl =
false, $cfId =
null)
2825 if ( strlen($identifier) > 0 )
2827 $this->
getCustomFields($identifier, $customizedId,
'', $somenteComActionUrl);
2830 if ( count($this->mioloCustomFields) == 0 )
2835 if (!isset($this->mioloCustomizedId) && isset($customizedId))
2837 $this->mioloCustomizedId = $customizedId;
2848 foreach ( $this->mioloCustomFields as $cf )
2851 if ($cfId !=
null && $cfId != $cf->id)
2861 $customValue->customizedId = $customizedId;
2862 $customValue->customFieldId = $cf->id;
2863 $customValue->value = $data->$inputId;
2866 if ($_FILES[$inputId][
'error'] == UPLOAD_ERR_NO_FILE)
2870 $busFile =
new BusinessBasicBusFile();
2871 $fdata =
new stdClass();
2872 $fdata->uploadFileName = $_FILES[$inputId][
'name'];
2873 $fdata->contentType = mime_content_type($_FILES[$inputId][
'tmp_name']);
2874 $fileId = $busFile->insertFile($fdata, $_FILES[$inputId][
'tmp_name']);
2875 $customValue->value = $fileId;
2879 if (is_array($data->$inputId))
2882 $customValue->value = json_encode($data->$inputId, JSON_UNESCAPED_UNICODE);
2885 if ( isset($this->mioloCustomizedId) )
2887 if ( $customValue->updateByData() )
2899 if ( $customValue->insert() )
2921 if ( !count($this->mioloCustomFields) )
2926 $searchData = array();
2929 foreach ( $this->mioloCustomFields as $cf )
2933 if ( strlen($value) )
2935 $searchData[$cf->id] = $value;
2950 foreach ( $this->mioloCustomFields as $cf )
2955 if ( strlen($value) )
2957 $values[$cf->getInputId()] = $value;
2959 elseif ( is_array($value) )
2962 foreach ($value as $customValue)
2964 $values[$cf->getInputId()][$i] = $customValue;
2981 if ( count($this->mioloCustomFields) == 0 )
2988 foreach ( $this->mioloCustomFields as $cf )
2991 $customValue->customizedId = $customizedId;
2992 $customValue->customFieldId = $cf->id;
2994 $ok = $customValue->deleteByCustomizedId();
3005 $divLabelExpand = md5($text);
3006 $divContent = md5($text) .
'b';
3008 $text = str_replace(
"\n",
'<br />', $text);
3010 $html .=
'<div id="'.$divLabelExpand.
'">
3011 <a href="javascript: return;"
3012 onclick="document.getElementById(\''.$divContent.
'\').style.display=\
'block\'; document.getElementById(\''.$divLabelExpand.
'\').style.display=\
'none\'"
3013 >'.$labelExpand.
'</a>
3017 $html .=
'<div id="'.$divContent.
'" style="display: none">
3018 <a href="javascript: return;"
3019 onclick="document.getElementById(\''.$divContent.
'\').style.display=\
'none\'; document.getElementById(\''.$divLabelExpand.
'\').style.display=\
'block\'">'.$labelCollapse.
'</a>
3020 <pre>' . $text .
'</pre>
3037 if ( strpos(
$action,
'report:genericReports') !==
false || strpos(
$action,
'document:genericReports') !==
false )
3043 else if ( strpos(
$action,
'generateReport') !==
false )
const CLASS_CAPTION_REQUIRED
const FORM_MODE_SHOW_SIDE
const FORMAT_SESCOLHA_LISTSQL
const FORMAT_SESCOLHA_LIST
const FORMAT_MULTI_LISTSQL
static listByIdentifier($identifier, $actionURL=NULL, $step=null)
static getFieldValues($identifier, $customizedId)
static searchFieldValues($identifier, $searchData, $returnSql=false, $onlyCustomizedid=false, $filters=null)
static getCurrentModule()
static _REQUEST( $vars, $from='ALL')
static getCurrentAction()
static Error($msg='', $goto='', $caption='', $event='')
static Information($msg, $goto='', $event='')
static Alert($msg, $goto='', $event='')
static getNameTransaction($action, $module)
static getBooleanValue($value)