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


PHP UserService::getUserList方法代码示例

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


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

示例1: prepareForEdit

 /**
  * Get a bunch of data prepared for the view
  */
 protected function prepareForEdit()
 {
     if ($this->view->model == null) {
         throw new Exception("Task not found!");
     }
     // check the existence of the client to add this contact to
     $pid = (int) $this->_getParam('projectid') ? (int) $this->_getParam('projectid') : $this->view->model->projectid;
     $project = new Project();
     if ($pid) {
         $project = $this->projectService->getProject($pid);
     }
     $this->view->project = $project;
     $this->view->projectUsers = $this->projectService->getProjectUsers($project);
     $this->view->activeTasks = array();
     if ($project->id) {
         $this->view->projects = $this->projectService->getProjectsForClient($project->clientid);
         $this->view->activeTasks = $this->projectService->getActiveProjectTasks($project);
     } else {
         $this->view->projects = new ArrayObject();
     }
     $this->view->categories = $this->view->model->constraints['category']->getValues();
     $this->view->clients = $this->clientService->getClients();
     $this->view->model->tags = "";
     if ($this->view->model->id) {
         $this->view->notes = $this->notificationService->getNotesFor($this->view->model);
         $this->view->existingWatch = $this->notificationService->getWatch(za()->getUser(), $this->view->model->id, 'Task');
         $this->view->allUsers = $this->userService->getUserList();
         $this->view->subscribers = $this->notificationService->getSubscribers($this->view->model->id, 'Task');
         $tags = $this->tagService->getItemTags($this->view->model);
         $tagStr = "";
         $sep = "";
         foreach ($tags as $tag) {
             $tagStr .= $sep . $tag->tag;
             $sep = ',';
         }
         $this->view->model->tags = $tagStr;
         // get all the issues that triggered this task
         $this->view->issues = $this->itemLinkService->getLinkedItemsOfType($this->view->model, 'to', 'Issue');
         $this->view->features = $this->itemLinkService->getLinkedItemsOfType($this->view->model, 'to', 'Feature');
         // get selectable features based on the milestont this project is in.
         $this->view->selectableFeatures = $project->getFeatures();
         $client = $this->clientService->getClient($project->clientid);
         // get all the requests for the given client
         $this->view->selectableRequests = $client->getIssues();
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:49,代码来源:TaskController.php

示例2: prepareForEdit

 /**
  * Override the edit action to supply some selectable relationships
  *
  * @param MappedObject $model
  */
 protected function prepareForEdit($model = null)
 {
     $clientid = $model && $model->clientid ? $model->clientid : (int) $this->_getParam('clientid');
     // check the existence of the client to add this contact to
     $client = $clientid ? $this->clientService->getClient($clientid) : null;
     // check the existence of the client to add this contact to
     $this->view->owners = $this->groupService->getGroups();
     $this->view->users = $this->userService->getUserList();
     $this->view->client = $client;
     $this->view->clients = $this->clientService->getClients();
     $this->view->projects = $clientid ? $this->projectService->getProjectsForClient($client) : array();
     parent::prepareForEdit($model);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:18,代码来源:ProjectController.php

示例3: viewgroupAction

 public function viewgroupAction()
 {
     $group = $this->byId($this->_getParam('id'), 'UserGroup');
     $users = $this->groupService->getUsersInGroup($group, true);
     $groupUsers = array();
     foreach ($users as $user) {
         $groupUsers[$user->id] = $user;
     }
     $this->view->groupusers = $groupUsers;
     $this->view->users = $this->userService->getUserList();
     $this->view->group = $group;
     $this->renderView('admin/view-group.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:13,代码来源:AdminController.php

示例4: editreportAction

 /**
  * Edit an expense report
  */
 public function editreportAction($model = null)
 {
     $cid = $this->_getParam('clientid');
     $client = null;
     if ($cid) {
         $client = $this->byId($cid, 'Client');
     }
     $user = $this->userService->getUserByField('username', $this->_getParam('username'));
     if (!$user && !$client) {
         throw new Exception("Must specify a client or user");
     }
     $this->view->expenses = array();
     if ($client) {
         $this->view->client = $client;
         $this->view->projects = $this->projectService->getProjects(array('clientid=' => $cid));
     } else {
         $this->view->client = new Client();
         $this->view->projects = array();
     }
     if ($user) {
         $this->view->user = $user;
     } else {
         $this->view->user = new CrmUser();
     }
     if ($model == null) {
         if ((int) $this->_getParam('id')) {
             $this->view->model = $this->byId(null, 'ExpenseReport');
             //  $this->dbService->getById((int)$this->_getParam('id'), $modelType);
             if ($client) {
                 $this->view->expenses = $this->expenseService->getExpenses(array('expensereportid=' => $this->view->model->id));
             } else {
                 $this->view->expenses = $this->expenseService->getExpenses(array('userreportid=' => $this->view->model->id));
             }
         } else {
             $this->view->model = new ExpenseReport();
         }
     } else {
         $this->view->model = $model;
     }
     $this->view->clients = $this->clientService->getClients();
     $this->view->users = $this->userService->getUserList();
     $this->renderView('expense/editreport.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:46,代码来源:ExpenseController.php

示例5: summaryAction

 /**
  * Used to display a list of the current week's breakdown 
  */
 public function summaryAction()
 {
     $timesheetid = -1;
     // Okay, so if we were passed in a timesheet, it means we want to view
     // the data for that timesheet. However, if that timesheet is locked,
     // we want to make sure that the tasks being viewed are ONLY those that
     // are found in that locked timesheet.
     $timesheet = $this->byId();
     $start = null;
     $end = null;
     $this->view->showLinks = true;
     $cats = array();
     $users = $this->userService->getUserList();
     if (!$start) {
         // The start date, if not set in the parameters, will be just
         // the previous monday
         $start = $this->_getParam('start', $this->calculateDefaultStartDate());
         // $end = $this->_getParam('end', date('Y-m-d', time()));
         $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + 6 * 86400));
     }
     // lets normalise the end date to make sure it's of 23:59:59
     $end = date('Y-m-d 23:59:59', strtotime($end));
     $order = 'endtime desc';
     $this->view->taskInfo = array();
     $project = null;
     if ($this->_getParam('projectid')) {
         $project = $this->projectService->getProject($this->_getParam('projectid'));
     }
     foreach ($users as $user) {
         $this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);
     }
     $task = new Task();
     $this->view->categories = $task->constraints['category']->getValues();
     $this->view->startDate = $start;
     $this->view->endDate = $end;
     $this->view->params = $this->_getAllParams();
     $this->view->dayDivision = za()->getConfig('day_length', 8) / 4;
     // za()->getConfig('day_division', 2);
     $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);
     $this->renderView('timesheet/user-report.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:44,代码来源:TimesheetController.php

示例6: prepareForEdit

 /**
  * Override the edit action to supply some selectable relationships
  *
  * @param MappedObject $model
  */
 public function prepareForEdit($model = null)
 {
     if ($this->view->model == null) {
         $this->flash("Invalid request specified");
         $this->redirect('error');
         return;
     }
     $this->view->issueHistory = $this->issueService->getIssueHistory($this->view->model);
     $pid = (int) $this->_getParam('projectid');
     $cid = (int) $this->_getParam('clientid');
     if ($this->view->model->projectid) {
         $pid = $this->view->model->projectid;
     }
     if ($this->view->model->clientid) {
         $cid = $this->view->model->clientid;
     }
     // Which one?
     if ($pid) {
         $this->view->project = $this->projectService->getProject($pid);
         $this->view->client = $this->clientService->getClient($this->view->project->clientid);
         // figure out the releases available for this project
         $this->view->releases = $this->issueService->getProjectReleases($this->view->project);
     } else {
         if ($cid) {
             $this->view->client = $this->clientService->getClient($cid);
             $this->view->releases = array();
         }
     }
     if ($this->view->client != null) {
         $this->view->categories = $this->issueService->getIssueCategoriesForCompany($this->view->client);
     } else {
         $this->view->categories = array();
     }
     // if it's a new issue, and it's a normal user set it to be private by default
     // User can always specify a different one though
     if (!$this->view->model->id && za()->getUser()->hasRole(User::ROLE_USER)) {
         $this->view->model->isprivate = true;
     }
     $this->view->users = $this->userService->getUserList();
     $this->view->severities = $this->view->model->constraints['severity']->getValues();
     $this->view->types = $this->view->model->constraints['issuetype']->getValues();
     $this->view->statuses = $this->view->model->constraints['status']->getValues();
     if ($this->view->model->id) {
         $this->view->notes = $this->notificationService->getNotesFor($this->view->model);
         $this->view->existingWatch = $this->notificationService->getWatch(za()->getUser(), $this->view->model->id, 'Issue');
         $this->view->userStatuses = $this->view->model->getUserStatuses();
         $clientUsers = $this->userService->getUsersForClient($this->view->model->clientid);
         foreach ($this->view->users as $user) {
             $clientUsers->append($user);
         }
         $this->view->allUsers = $clientUsers;
         $this->view->subscribers = $this->notificationService->getSubscribers($this->view->model->id, 'Issue');
         $this->view->project = $this->projectService->getProject($this->view->model->projectid);
         $this->view->client = $this->clientService->getClient($this->view->model->clientid);
         $this->view->files = $this->issueService->getIssueFiles($this->view->model);
         $path = 'Clients/' . $this->view->client->title . '/Issues/' . $this->view->model->id;
         $this->view->filePath = $path;
         // Get all the features for this project
         $this->view->projectFeatures = $this->featureService->getFeatures(array('projectid=' => $this->view->model->projectid));
         $this->view->projectTasks = $this->projectService->getTasks(array('projectid=' => $this->view->project->id), 'title asc');
         $this->view->linkedTasks = $this->itemLinkService->getLinkedItems($this->view->model, 'from', 'Task');
         $this->view->linkedToFeatures = $this->itemLinkService->getLinkedItems($this->view->model, 'from', 'Feature');
         $this->view->linkedFromFeatures = $this->itemLinkService->getLinkedItems($this->view->model, 'to', 'Feature');
     }
     $this->view->clients = $this->clientService->getClients();
     if ($this->view->client) {
         $this->view->projects = $this->projectService->getProjectsForClient($this->view->client->id);
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:74,代码来源:IssueController.php

示例7: getProjectUsers

 /**
  * Gets all the users assigned to a project
  *
  * @param Project $project
  * @return ArrayObject
  */
 public function getProjectUsers()
 {
     // For now, just return all users
     return $this->userService->getUserList();
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:11,代码来源:ProjectService.php


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