/** * Checkout */ public function BatchSchedule() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Invoking BatchSchedule, param=" . var_export($param, true)); } $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $row) { $tran = CalemJson::objToArray($row); try { $this->schedBo->batchSchedule($tran); $result[] = array('status' => 0); } catch (Exception $e) { $result[] = array('status' => 100, 'errorInfo' => $e->getErrorInfo()->getData()); } } return $result; }
/** * Checkout */ public function GenInOrderRequest() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Invoking GenInOrderRequest, param=" . var_export($param, true)); } $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $row) { $inId = $row->in_id; $reqRow = CalemJson::objToArray($row->reqRow); try { $this->inOrderGenBo->manualGenOrderRequest($inId, $reqRow); $result[] = array('status' => 0); } catch (Exception $e) { $result[] = array('status' => 100, 'errorInfo' => $e->getErrorInfo()->getData()); } } return $result; }
/** * VerifyReqStatusChange */ public function VerifyReqStatusChange() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Invoking VerifyReqStatusChange, param=" . var_export($param, true)); } $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $row) { $tran = CalemJson::objToArray($row); try { $this->reqBo->verifyReqStatusChange($tran); $result[] = array('status' => 0); } catch (CalemDataBoException $e) { $result[] = array('status' => 100, 'errorInfo' => $e->getErrorInfo()->getData()); } catch (Exception $ex) { $e = new CalemDataBoException('requisition', $ex); $result[] = array('status' => 100, 'errorInfo' => $e->getErrorInfo()->getData()); } } return $result; }
public function SwapDropdown() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Swap field name, param=" . var_export($param, true)); } $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $fldObj) { $fldAr = CalemJson::objToArray($fldObj); //Update dropdown $result[] = $this->swapDropdownEntry($fldAr); } return $result; }
public function EditLabel() { $param = $this->getParamValue(0); if ($this->logger->isDebugEnabled()) { $this->logger->debug("Edit label, param=" . var_export($param, true)); } $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $fldObj) { $fldAr = CalemJson::objToArray($fldObj); //Update text $result[] = $this->updateMessage($fldAr); } return $result; }
public function processUpdateData($param) { $result = array(); //Processing each row by iterating the param object. foreach ($param as $key => $row) { $base = $row->base; $custom = $row->custom; $sql = $row->sql; $baseTable = $base->table; $baseCurrent = CalemJson::objToArray($base->current); $baseUpdate = CalemJson::objToArray($base->update); if ($custom) { $customTable = $custom->table; $customCurrent = CalemJson::objToArray($custom->current); $customUpdate = CalemJson::objToArray($custom->update); } try { $bo = CalemFactory::getDataBo($baseTable); $feedback = $bo->update($baseTable, $baseCurrent, $baseUpdate, $customTable, $customCurrent, $customUpdate, $sql); $result[] = array('table' => $baseTable, 'status' => 0, 'feedback' => $feedback); } catch (CalemDboUpdateConflictException $e) { $result[] = array('table' => $baseTable, 'status' => $e->getStatus(), 'feedback' => array('table' => $baseTable, 'server' => $e->getServer(), 'update' => $baseTable, 'conflict' => $e->getConflict())); } catch (Exception $e) { $result[] = array('table' => $baseTable, 'status' => 400, 'errorInfo' => $e->getErrorInfo()->getData()); } } return $result; }