From 80c9455ee95df61ac276566a3b5df6a4e9db9190 Mon Sep 17 00:00:00 2001 From: Chloe Deguzman Date: Tue, 8 Mar 2016 02:39:37 +0000 Subject: [PATCH] HOR-282 Removed unused saveFormSupervisor method for cases. --- .../methods/cases/saveFormSupervisor.php | 135 ------------------ 1 file changed, 135 deletions(-) delete mode 100644 workflow/engine/methods/cases/saveFormSupervisor.php diff --git a/workflow/engine/methods/cases/saveFormSupervisor.php b/workflow/engine/methods/cases/saveFormSupervisor.php deleted file mode 100644 index 4a8525aae..000000000 --- a/workflow/engine/methods/cases/saveFormSupervisor.php +++ /dev/null @@ -1,135 +0,0 @@ -. - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., - * Coral Gables, FL, 33134, USA, or email info@colosa.com. - */ - - -try { - - $oForm = new Form( $_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM ); - $oForm->validatePost(); - - //Includes - G::LoadClass( "case" ); - - //Load the variables - $oCase = new Cases(); - $Fields = $oCase->loadCase( $_SESSION["APPLICATION"] ); - - $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() ); - $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] ); - - //save data in PM Tables if necessary - $newValues = array (); - foreach ($_POST['form'] as $sField => $sAux) { - if (isset( $oForm->fields[$sField]->pmconnection ) && isset( $oForm->fields[$sField]->pmfield )) { - if (($oForm->fields[$sField]->pmconnection != '') && ($oForm->fields[$sField]->pmfield != '')) { - if (isset( $oForm->fields[$oForm->fields[$sField]->pmconnection] )) { - require_once PATH_CORE . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'AdditionalTables.php'; - $oAdditionalTables = new AdditionalTables(); - try { - $aData = $oAdditionalTables->load( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, true ); - } catch (Exception $oError) { - $aData = array ('FIELDS' => array () - ); - } - $aKeys = array (); - $aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys ); - $i = 0; - $aValues = array (); - foreach ($aData['FIELDS'] as $aField) { - if ($aField['FLD_KEY'] == '1') { - $aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : ''); - $i ++; - } - if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) { - $aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField]; - } else { - $aValues[$aField['FLD_NAME']] = ''; - } - } - try { - $aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys ); - } catch (Exception $oError) { - $aRow = false; - } - if ($aRow) { - foreach ($aValues as $sKey => $sValue) { - if ($sKey != $oForm->fields[$sField]->pmfield) { - $aValues[$sKey] = $aRow[$sKey]; - } - } - try { - $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aValues ); - } catch (Exception $oError) { - //Nothing - } - } else { - try { - // assembling the field list in order to save the data ina new record of a pm table - if (empty( $newValues )) { - $newValues = $aValues; - } else { - foreach ($aValues as $aValueKey => $aValueCont) { - if (trim( $newValues[$aValueKey] ) == '') { - $newValues[$aValueKey] = $aValueCont; - } - } - } - //$oAdditionalTables->saveDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues ); - } catch (Exception $oError) { - //Nothing - } - } - } - } - } - } - - //save data - $aData = array (); - $aData['APP_NUMBER'] = $Fields['APP_NUMBER']; - $aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS']; - $aData['APP_DATA'] = $Fields['APP_DATA']; - $aData['DEL_INDEX'] = $_SESSION['INDEX']; - $aData['TAS_UID'] = $_SESSION['TASK']; - $aData['CURRENT_DYNAFORM'] = $_GET['UID']; - $aData['USER_UID'] = $_SESSION['USER_LOGGED']; - $aData['APP_STATUS'] = $Fields['APP_STATUS']; - $aData['PRO_UID'] = $_SESSION['PROCESS']; - - $oCase->updateCase( $_SESSION['APPLICATION'], $aData ); - - // saving the data ina pm table in case that is a new record - if (! empty( $newValues )) { - $id = key( $newValues ); - if (! $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues )) { - //<--This is to know if it is a new registry on the PM Table - $oAdditionalTables->saveDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues ); - } - } - - die('OK'); - -} catch (Exception $e) { - die($e->getMessage()); -}