当前位置: 首页>>代码示例>>PHP>>正文


PHP Tasks::assignUser方法代码示例

本文整理汇总了PHP中Tasks::assignUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::assignUser方法的具体用法?PHP Tasks::assignUser怎么用?PHP Tasks::assignUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tasks的用法示例。


在下文中一共展示了Tasks::assignUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ProcessMap

     }
     break;
 case 'availableUsers':
     G::LoadClass('processMap');
     $oProcessMap = new ProcessMap();
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('propeltable', 'paged-table', 'users/users_AvailableUsers', $oProcessMap->getAvailableUsersCriteria($_GET['sTask'], $_GET['iType']));
     G::RenderPage('publish', 'raw');
     break;
 case 'assign':
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     switch ((int) $_POST['TU_RELATION']) {
         case 1:
             echo $oTasks->assignUser($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
             break;
         case 2:
             echo $oTasks->assignGroup($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
             break;
     }
     break;
 case 'ofToAssign':
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     switch ((int) $_POST['TU_RELATION']) {
         case 1:
             echo $oTasks->ofToAssignUser($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
             break;
         case 2:
             echo $oTasks->ofToAssignGroup($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:users_Ajax.php

示例2: 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"])) {
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:WebEntryEvent.php

示例3: createTaskByElement

    public function createTaskByElement($elementUid, $elementType, $key)
    {
        try {
            if (isset($this->arrayElementTaskRelation[$elementUid])) {
                $taskUid = $this->arrayElementTaskRelation[$elementUid];
            } else {
                $taskPosX = 0;
                $taskPosY = 0;

                $flow = \BpmnFlow::findOneBy(array(
                    \BpmnFlowPeer::FLO_ELEMENT_ORIGIN      => $elementUid,
                    \BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => $elementType
                ));

                if (!is_null($flow)) {
                    $arrayFlowData = $flow->toArray();

                    $taskPosX = (int)($arrayFlowData["FLO_X1"]);
                    $taskPosY = (int)($arrayFlowData["FLO_Y1"]);
                } else {
                    $flow = \BpmnFlow::findOneBy(array(
                        \BpmnFlowPeer::FLO_ELEMENT_DEST      => $elementUid,
                        \BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE => $elementType
                    ));

                    if (!is_null($flow)) {
                        $arrayFlowData = $flow->toArray();

                        $taskPosX = (int)($arrayFlowData["FLO_X2"]);
                        $taskPosY = (int)($arrayFlowData["FLO_Y2"]);
                    }
                }

                $prefix   = $this->arrayTaskAttribute[$key]["prefix"];
                $taskType = $this->arrayTaskAttribute[$key]["type"];

                $taskUid = $this->wp->addTask(array(
                    "TAS_UID"   => $prefix . substr(Util\Common::generateUID(), (32 - strlen($prefix)) * -1),
                    "TAS_TYPE"  => $taskType,
                    "TAS_TITLE" => $taskType,
                    "TAS_POSX"  => $taskPosX,
                    "TAS_POSY"  => $taskPosY
                ));

                if ($elementType == "bpmnEvent" &&
                    in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
                ) {
                    if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
                        //Task - User
                        //Assign to admin
                        $task = new \Tasks();

                        $result = $task->assignUser($taskUid, "00000000000000000000000000000001", 1);
                    }
                }

                //Element-Task-Relation - Create
                $elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();

                $arrayResult = $elementTaskRelation->create(
                    $this->wp->getUid(),
                    array(
                        "ELEMENT_UID"  => $elementUid,
                        "ELEMENT_TYPE" => $elementType,
                        "TAS_UID"      => $taskUid
                    )
                );

                //Array - Add element
                $this->arrayElementTaskRelation[$elementUid] = $taskUid;
            }

            //Return
            return $taskUid;
        } catch (\Exception $e) {
            throw $e;
        }
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:78,代码来源:BpmnWorkflow.php

示例4: Route

 case 'deleteRoute':
     require_once 'classes/model/Route.php';
     $oRoute = new Route();
     $sOutput = $oRoute->remove($oData->uid);
     echo $sOutput;
     break;
 case 'deleteEvent':
     $sOutput = $oEvent->remove($oData->uid);
     echo $sOutput;
     break;
 case 'assign':
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     switch ($oData->TU_RELATION) {
         case 1:
             echo $oTasks->assignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
             break;
         case 2:
             echo $oTasks->assignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
             break;
     }
     break;
 case 'ofToAssign':
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     switch ($oData->TU_RELATION) {
         case 1:
             echo $oTasks->ofToAssignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
             break;
         case 2:
             echo $oTasks->ofToAssignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:processes_Ajax.php


注:本文中的Tasks::assignUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。