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


PHP Tasks::ofToAssignUserOfAllTasks方法代码示例

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


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

示例1: delete

    /**

     * Delete User

     *

     * @param string $usrUid Unique id of User

     *

     * return void

     */

    public function delete($usrUid)

    {

        try {

            //Verify data

            $this->throwExceptionIfNotExistsUser($usrUid, $this->arrayFieldNameForException["usrUid"]);



            \G::LoadClass('case');

            $oProcessMap = new \Cases();

            $USR_UID = $usrUid;

            $total = 0;

            $history = 0;

            $c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);

            $total += \ApplicationPeer::doCount($c);

            $c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);

            $total += \ApplicationPeer::doCount($c);

            $c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);

            $history += \ApplicationPeer::doCount($c);

            $c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);

            $history += \ApplicationPeer::doCount($c);

            if ($total > 0) {

                throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_BE_DELETED", array($USR_UID)));

            } else {

                $UID = $usrUid;

                \G::LoadClass('tasks');

                $oTasks = new \Tasks();

                $oTasks->ofToAssignUserOfAllTasks($UID);

                \G::LoadClass('groups');

                $oGroups = new \Groups();

                $oGroups->removeUserOfAllGroups($UID);

                $this->changeUserStatus($UID, 'CLOSED');

                $_GET['USR_USERNAME'] = '';

                $this->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']), '');

                require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");

                $oUser = new \Users();

                $aFields = $oUser->load($UID);

                $aFields['USR_STATUS'] = 'CLOSED';

                $aFields['USR_USERNAME'] = '';

                $oUser->update($aFields);

                //Delete Dashboard

                require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashletInstance.php");

                $criteria = new \Criteria( 'workflow' );

                $criteria->add( \DashletInstancePeer::DAS_INS_OWNER_UID, $UID );

                $criteria->add( \DashletInstancePeer::DAS_INS_OWNER_TYPE , 'USER');

//.........这里部分代码省略.........
开发者ID:nhenderson,项目名称:processmaker,代码行数:101,代码来源:User.php

示例2: Tasks

     $c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
     $history += ApplicationPeer::doCount($c);
     $c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
     $history += ApplicationPeer::doCount($c);
     $response = '{success: true, candelete: ';
     $response .= $total > 0 ? 'false' : 'true';
     $response .= ', hashistory: ';
     $response .= $history > 0 ? 'true' : 'false';
     $response .= '}';
     echo $response;
     break;
 case 'deleteUser':
     $UID = $_POST['USR_UID'];
     G::LoadClass('tasks');
     $oTasks = new Tasks();
     $oTasks->ofToAssignUserOfAllTasks($UID);
     G::LoadClass('groups');
     $oGroups = new Groups();
     $oGroups->removeUserOfAllGroups($UID);
     $RBAC->changeUserStatus($UID, 'CLOSED');
     $_GET['USR_USERNAME'] = '';
     $RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
     require_once 'classes/model/Users.php';
     $oUser = new Users();
     $aFields = $oUser->load($UID);
     $aFields['USR_STATUS'] = 'CLOSED';
     $aFields['USR_USERNAME'] = '';
     $oUser->update($aFields);
     //Delete Dashboard
     require_once 'classes/model/DashletInstance.php';
     $criteria = new Criteria('workflow');
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:users_Ajax.php

示例3: Users

            die;
            break;
    }
    if ($_GET['USR_UID'] == '00000000000000000000000000000001') {
        G::SendTemporalMessage('ID_CANNOT_CHANGE_STATUS_ADMIN_USER', 'error', 'usersLabels');
        G::header('location: ' . $_SERVER['HTTP_REFERER']);
        die;
    }
    /*$RBAC->removeUser($_GET['USR_UID']);
      require_once 'classes/model/Users.php';
      $oUser = new Users();
      $oUser->remove($_GET['USR_UID']);*/
    //print_r($_GET['USR_UID']); die
    G::LoadClass('tasks');
    $oTasks = new Tasks();
    $oTasks->ofToAssignUserOfAllTasks($_GET['USR_UID']);
    G::LoadClass('groups');
    $oGroups = new Groups();
    $oGroups->removeUserOfAllGroups($_GET['USR_UID']);
    $RBAC->changeUserStatus($_GET['USR_UID'], 'CLOSED');
    $_GET['USR_USERNAME'] = '';
    $RBAC->updateUser(array('USR_UID' => $_GET['USR_UID'], 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
    require_once 'classes/model/Users.php';
    $oUser = new Users();
    $aFields = $oUser->load($_GET['USR_UID']);
    $aFields['USR_STATUS'] = 'CLOSED';
    $aFields['USR_USERNAME'] = '';
    $oUser->update($aFields);
    G::header('location: users_List');
} catch (Exception $oException) {
    die($oException->getMessage());
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:users_Delete.php


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