本文整理汇总了PHP中Step::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Step::update方法的具体用法?PHP Step::update怎么用?PHP Step::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Step
的用法示例。
在下文中一共展示了Step::update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateStep
function UpdateStep($data, $fields)
{
try {
$Step = new Step();
$result = $Step->update($fields);
return $result;
} catch (Exception $e) {
return array('Exception!! ' => $e->getMessage());
}
}
示例2: switch
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) {
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
require_once 'classes/model/Step.php';
$oStep = new Step();
if (isset($_POST['form'])) {
$value = $_POST['form'];
} else {
$value = $_POST;
}
$oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION']));
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria($value['TAS_UID']);
} catch (Exception $oException) {
die($oException->getMessage());
}
示例3: updateAll
/**
* Update Steps of a Task
*
* @param string $stepUid Unique id of Step
* @param array $arrayData Data
*
* return array Return data of the Steps updated
*/
public function updateAll($stepUid, $arrayData)
{
try {
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Verify data
$this->throwExceptionIfNotExistsStep($stepUid);
//Load Step
$step = new \Step();
$arrayStepData = $step->load($stepUid);
$taskUid = $arrayStepData["TAS_UID"];
$proUid = $arrayStepData["PRO_UID"];
//Verify data
if (isset($arrayData["STEP_TYPE_OBJ"]) && !isset($arrayData["STEP_UID_OBJ"])) {
throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayParamException["stepUidObj"])));
}
if (!isset($arrayData["STEP_TYPE_OBJ"]) && isset($arrayData["STEP_UID_OBJ"])) {
throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayParamException["stepTypeObj"])));
}
if (isset($arrayData["STEP_TYPE_OBJ"])) {
$arrayData["STEP_TYPE_OBJ"] = trim($arrayData["STEP_TYPE_OBJ"]);
if ($arrayData["STEP_TYPE_OBJ"] == "") {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_CAN_NOT_BE_EMPTY", array($this->arrayParamException["stepTypeObj"])));
}
}
if (isset($arrayData["STEP_UID_OBJ"])) {
$arrayData["STEP_UID_OBJ"] = trim($arrayData["STEP_UID_OBJ"]);
if ($arrayData["STEP_UID_OBJ"] == "") {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_CAN_NOT_BE_EMPTY", array($this->arrayParamException["stepUidObj"])));
}
}
if (isset($arrayData["STEP_MODE"])) {
$arrayData["STEP_MODE"] = trim($arrayData["STEP_MODE"]);
if ($arrayData["STEP_MODE"] == "") {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_CAN_NOT_BE_EMPTY", array($this->arrayParamException["stepMode"])));
}
}
if (isset($arrayData["STEP_TYPE_OBJ"])) {
$this->throwExceptionIfHaveInvalidValueInTypeObj($arrayData["STEP_TYPE_OBJ"]);
}
if (isset($arrayData["STEP_MODE"])) {
$this->throwExceptionIfHaveInvalidValueInMode($arrayData["STEP_MODE"]);
}
if (isset($arrayData["STEP_TYPE_OBJ"]) && isset($arrayData["STEP_UID_OBJ"])) {
$msg = $this->existsObjectUid($arrayData["STEP_TYPE_OBJ"], $arrayData["STEP_UID_OBJ"], $this->arrayParamException["stepUidObj"]);
if ($msg != "") {
throw new \Exception($msg);
}
if ($this->existsRecord($taskUid, $arrayData["STEP_TYPE_OBJ"], $arrayData["STEP_UID_OBJ"], 0, $stepUid)) {
throw new \Exception(\G::LoadTranslation("ID_RECORD_EXISTS_IN_TABLE", array($taskUid . ", " . $arrayData["STEP_TYPE_OBJ"] . ", " . $arrayData["STEP_UID_OBJ"], "STEP")));
}
}
//Update
$step = new \Step();
$arrayData["STEP_UID"] = $stepUid;
$result = $step->update($arrayData);
//Return
unset($arrayData["STEP_UID"]);
if (!$this->formatFieldNameInUppercase) {
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
}
return $arrayData;
} catch (\Exception $e) {
throw $e;
}
}
示例4: update
/**
* Update WebEntry-Event
*
* @param string $webEntryEventUid Unique id of WebEntry-Event
* @param string $userUidUpdater Unique id of updater User
* @param array $arrayData Data
*
* return array Return data of the WebEntry-Event updated
*/
public function update($webEntryEventUid, $userUidUpdater, array $arrayData)
{
try {
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$validator = new \ProcessMaker\BusinessModel\Validator();
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
//Set data
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
$arrayDataBackup = $arrayData;
unset($arrayData["WEE_UID"]);
unset($arrayData["PRJ_UID"]);
unset($arrayData["WEE_WE_UID"]);
unset($arrayData["WEE_WE_TAS_UID"]);
//Set variables
$arrayWebEntryEventData = $this->getWebEntryEvent($webEntryEventUid, true);
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
//Verify data
$this->throwExceptionIfNotExistsWebEntryEvent($webEntryEventUid, $this->arrayFieldNameForException["webEntryEventUid"]);
$this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData);
//Update
$cnn = \Propel::getConnection("workflow");
$this->webEntryEventWebEntryUid = "";
$this->webEntryEventWebEntryTaskUid = "";
try {
//WebEntry
$option = "UPDATE";
if (isset($arrayData["WEE_STATUS"])) {
if ($arrayData["WEE_STATUS"] == "ENABLED") {
if ($arrayWebEntryEventData["WEE_STATUS"] == "DISABLED") {
$option = "INSERT";
}
} else {
if ($arrayWebEntryEventData["WEE_STATUS"] == "ENABLED") {
$option = "DELETE";
}
}
}
switch ($option) {
case "INSERT":
$this->createWebEntry($arrayFinalData["PRJ_UID"], $arrayFinalData["EVN_UID"], $arrayFinalData["ACT_UID"], $arrayFinalData["DYN_UID"], $arrayFinalData["USR_UID"], $arrayFinalData["WEE_TITLE"], $arrayFinalData["WEE_DESCRIPTION"], $userUidUpdater);
$arrayData["WEE_WE_UID"] = $this->webEntryEventWebEntryUid;
$arrayData["WEE_WE_TAS_UID"] = $this->webEntryEventWebEntryTaskUid;
break;
case "UPDATE":
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
$task = new \Tasks();
//Task - Step
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] != $arrayWebEntryEventData["DYN_UID"]) {
//Delete
$step = new \Step();
$criteria = new \Criteria("workflow");
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $step->remove($row["STEP_UID"]);
}
//Add
$step = new \Step();
$stepUid = $step->create(array("PRO_UID" => $arrayWebEntryEventData["PRJ_UID"], "TAS_UID" => $arrayWebEntryEventData["WEE_WE_TAS_UID"]));
$result = $step->update(array("STEP_UID" => $stepUid, "STEP_TYPE_OBJ" => "DYNAFORM", "STEP_UID_OBJ" => $arrayData["DYN_UID"], "STEP_POSITION" => 1, "STEP_MODE" => "EDIT"));
}
//Task - User
if (isset($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
//Unassign
$taskUser = new \TaskUser();
$criteria = new \Criteria("workflow");
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $taskUser->remove($row["TAS_UID"], $row["USR_UID"], $row["TU_TYPE"], $row["TU_RELATION"]);
}
//Assign
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"], 1);
}
//Route
if (isset($arrayData["ACT_UID"]) && $arrayData["ACT_UID"] != $arrayWebEntryEventData["ACT_UID"]) {
//Delete
$result = $task->deleteAllRoutesOfTask($arrayWebEntryEventData["PRJ_UID"], $arrayWebEntryEventData["WEE_WE_TAS_UID"], true);
//Add
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"], "SEQUENTIAL");
}
//WebEntry
$arrayDataAux = array();
if (isset($arrayData["DYN_UID"])) {
//.........这里部分代码省略.........
示例5: switch
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) {
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
require_once 'classes/model/Step.php';
$oStep = new Step();
$sStepUID = $oStep->create(array('PRO_UID' => $_POST['sProcess'], 'TAS_UID' => $_POST['sTask']));
$oStep->update(array('STEP_UID' => $sStepUID, 'STEP_TYPE_OBJ' => $_POST['sType'], 'STEP_UID_OBJ' => $_POST['sUID'], 'STEP_POSITION' => $oStep->getNextPosition($_POST['sTask']) - 1, 'STEP_MODE' => isset($_POST['sMode']) ? $_POST['sMode'] : 'EDIT'));
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria($_POST['sTask']);
} catch (Exception $oException) {
die($oException->getMessage());
}