Improvement keys pmtables in dynaform

This commit is contained in:
Marco Antonio Nina
2014-05-05 14:09:22 -04:00
parent 1c59d1a880
commit 3f2d2bf29e

View File

@@ -166,7 +166,6 @@ try {
if (! empty( $newValues )) {
$id = key( $newValues );
$newValues[$id] = $aData['APP_DATA'][$id];
$sw = false;
foreach ($aKeys as $key => $value) {
if ($newValues[$key] == '') {
$G_PUBLISH = new Publisher();
@@ -178,6 +177,7 @@ try {
}
}
$idPmtable = $oForm->fields[$id]->pmconnection->pmtable != '' ? $oForm->fields[$id]->pmconnection->pmtable : $oForm->fields[$id]->owner->tree->children[0]->attributes['pmtable'];
if (!($oAdditionalTables->updateDataInTable($idPmtable, $newValues ))) {
//<--This is to know if it is a new registry on the PM Table
$oAdditionalTables->saveDataInTable($idPmtable, $newValues );
@@ -320,6 +320,16 @@ try {
//$oJSON = new Services_JSON();
$_POST['__notValidateThisFields__'] = (isset( $_POST['__notValidateThisFields__'] ) && $_POST['__notValidateThisFields__'] != '') ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
if ($missing_req_values = $oForm->validateRequiredFields( $_POST['form'], Bootstrap::json_decode( stripslashes( $_POST['__notValidateThisFields__'] ) ) )) {
$fieldsRequired = Bootstrap::json_decode(str_replace(array("%27", "%39"), array("\"", "'"), $_POST["DynaformRequiredFields"]));
foreach ($fieldsRequired as $key1 => $value1) {
foreach ($missing_req_values as $key2 => $value2) {
if ($value1->name == $value2) {
$missing_req_values[$key2] = $value1->label;
}
}
}
$_POST['next_step'] = $aNextStep;
$_POST['previous_step'] = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$_POST['req_val'] = $missing_req_values;