Example #1
0
 public function execute()
 {
     $issues = $this->issueService->getIssues(array('status=' => 'Open'));
     // Get the project for each issue
     $group = $this->groupService->getGroupByField('title', za()->getConfig('issue_group'));
     if ($group) {
         $users = $this->groupService->getUsersInGroup($group);
         $msg = new TemplatedMessage('open-issues.php', array('issues' => $issues));
         $this->notificationService->notifyUser('Open Requests', $users, $msg);
     } else {
         za()->log()->warn("Could not find group for sending issues to");
     }
 }
Example #2
0
 /**
  * Called when a user wants to leave a project
  */
 public function leaveAction()
 {
     $project = $this->byId();
     $group = $project->getGroup();
     if ($group) {
         $this->groupService->removeFromGroup($group, za()->getUser());
     }
     $this->_redirect($this->getCallingUrl());
 }
Example #3
0
 public function savegroupusersAction()
 {
     $usersToAdd = $this->_getParam('groupusers');
     if (!is_array($usersToAdd)) {
         $this->viewGroupAction();
         return;
     }
     $group = $this->byId($this->_getParam('id'), 'UserGroup');
     $this->groupService->addUsersToGroup($group, $usersToAdd);
     $this->redirect('admin', 'grouplist');
 }
} else {
    ?>
                                             <div class="message_pnl_sing_in_alert" style="width:270px;padding: 3px;">
                                                 <p>Ahora que la estrategia esta en produccion puedes editar los valores minimos, maximos,y deseados desde el modulo de proyecciones, puedes ingresar al modulo de proyeciones desde el menu superior o haciendo click <a style="color:blue;" href="<?php 
    echo url_for('projections/index?idTree=' . $tree->getid());
    ?>
">aqui</a> </p>
                                             </div>
                                        <?php 
}
?>

                                         <div style="width: 85px;"> <label>Responsable</label></div>
                                         <div>
                                               <?php 
$serviceGoup = new GroupService();
?>
                                               <?php 
$successGroup = $serviceGoup->listContactGroup($tree->getGrupoTrabajoId());
?>
                                               <?php 
if ($successGroup['success']) {
    ?>
                                               <select id="hd-resposable-final" name="hd-resposable-final">
                                                       <?php 
    foreach ($successGroup['object'] as $row) {
        ?>
                                                            <option value="<?php 
        echo $row->getUserId();
        ?>
"><?php 
Example #5
0
 /**
  * 获取HTL团渠道
  * @param $gid
  * @return string
  */
 public static function hltChanid($gid)
 {
     $bool = GroupService::hltProvider_exists($gid);
     $chanid = BDataHelper::getHltConfig('chanid');
     if ($bool) {
         $chanid = BDataHelper::getHltConfig('menshisystem');
     }
     return $chanid;
 }
Example #6
0
<?php

session_start();
require_once 'model/group/group-service.php';
$group = new GroupService();
$groupList = $group->getAllRecord();
?>

<div id="panel-user" class="easyui-panel" title=" " style="padding: 5px;">
	<div id="panel-search" class="easyui-panel" title="Pencarian" data-options="collapsible: true">		
		<table align="center" width="25%">				
			<tr>
				<td align="left">User ID</td>
				<td>:</td>
				<td><input type="text" id="cari-username" name="cari-username" /></td>
				<td><button id="btn-search">Cari</button></td>
			</tr>				
		</table>
	</div>

	<table class="easyui-datagrid" title="Tabel User" id="tbl-user" data-options="singleSelect: true, collapsible: true, url: 'model/user/get-all-user-json.php', rownumbers: true, pagination: true, tools:'#tools'" style="height: 370px; padding: 10px;" iconCls="" >
		<thead>
			<tr>
				<th data-options="field: 'UserId', width: 80">User ID</th>
				<th data-options="field: 'Nama', width: 250">Nama</th>
				<th data-options="field: 'NamaGroup', width: 250">Group</th>
				<th data-options="hidden: true, field: 'Password'"></th>
			</tr>
		</thead>
	</table>	
</div>
Example #7
0
 /**
  * 群组
  */
 private function group()
 {
     $service = new GroupService();
     $result = $service->invoke($this->commonUri);
     echo json_encode($result);
 }
Example #8
0
 /**
  * Save a task.
  * 
  * Saves the task object, then updates any task assignments that need 
  * attention. 
  * 
  * @param Task $taskToSave The task to save
  * @param boolean $updateGroups Whether to update group membership on save. Defaults
  * 								to false to prevent too much db access
  * @param boolean $updateAssignees Whether the assignees should be updated. 
  * 								make this false if you know the assigned users haven't changed
  */
 public function saveTask($taskToSave, $updateGroups = false, $updateAssignees = true)
 {
     $task = null;
     try {
         $this->dbService->beginTransaction();
         $oldId = null;
         $projectid = 0;
         $title = '';
         if (is_array($taskToSave)) {
             $title = ifset($taskToSave, 'title', 'Untitled Task');
             if (ifset($taskToSave, 'complete', false)) {
                 $taskToSave['completedate'] = date('Y-m-d H:i:s');
             }
             if (isset($taskToSave['id'])) {
                 $oldId = $taskToSave['id'];
             }
         } else {
             $title = $taskToSave->title;
             if ($taskToSave->complete) {
                 $taskToSave->completedate = date('Y-m-d H:i:s');
             }
             if ($taskToSave->id) {
                 $oldId = $taskToSave->id;
             }
         }
         // if there's an OLD ID, get that task so we know what dependencies
         // will need to be updated after saving
         $dependency = null;
         $oldState = null;
         if ($oldId) {
             $oldState = $this->getTask($oldId);
             $dependency = $oldState->getDependencyId();
         } else {
             // no previous id, so must be creating from scratch
             $this->trackerService->track('create-task', $title);
         }
         $task = $this->dbService->saveObject($taskToSave, 'Task');
         if ($task == null) {
             throw new Exception("Failed creating task for parameters " . print_r($taskToSave, true));
         }
         $projectid = $task->projectid ? $task->projectid : 0;
         if (!$projectid) {
             $unassignedProject = $this->getUnassignedTaskProject();
             $task->projectid = $unassignedProject->id;
             $this->dbService->saveObject($task);
         }
         // If the task's dependency is different, or its dates have changed,
         // update all dependants
         if ($oldState != null) {
             if (date('Y-m-d', strtotime($oldState->due)) != date('Y-m-d', strtotime($task->due)) || $dependency != $task->getDependencyId()) {
                 // go and update the dependency
                 $this->updateTaskDependants($task, $dependency);
             }
         }
         // Get the project because we'll be adding users
         // to the project in a moment
         $project = $this->getProject($task->projectid);
         if (!is_array($task->userid)) {
             $task->userid = array();
         }
         if ($updateAssignees) {
             // Delete all the old user/task assignments
             $this->dbService->delete('usertaskassignment', 'taskid=' . $task->id);
             foreach ($task->userid as $username) {
                 // create a new assignment
                 $params = array('taskid' => $task->id, 'userid' => $username);
                 $user = $this->userService->getByName($username);
                 if ($user && $updateGroups) {
                     $groups = $this->groupService->getGroupsForUser($user, false);
                     // Note here that ownerid == the group that owns this project
                     if ($project->ownerid && !isset($groups[$project->ownerid])) {
                         $group = $this->groupService->getGroup($project->ownerid);
                         if ($group) {
                             // Add the user to this group
                             $this->groupService->addToGroup($group, $user);
                             $this->log->debug(__CLASS__ . ':' . __LINE__ . ": User {$user->username} added to {$group->title}");
                         } else {
                             $this->log->warn(__CLASS__ . ':' . __LINE__ . ": Group not found for {$project->ownerid}");
                         }
                     } else {
                         if ($project->ownerid) {
                             $this->log->debug(__CLASS__ . ':' . __LINE__ . ": User {$user->username} is already in group " . $groups[$project->ownerid]->title);
                         } else {
                             $this->log->debug(__CLASS__ . ':' . __LINE__ . ": Project does not have an owner for assigning a group");
                         }
                     }
                 }
                 $this->dbService->saveObject($params, 'UserTaskAssignment');
             }
         }
         $this->updateAffectedLinkedItems($task);
         $this->dbService->commit();
     } catch (InvalidModelException $ime) {
         $this->log->err("Failed saving task because of invalid data: " . print_r($ime->getMessages(), true));
         $this->log->err($ime->getTraceAsString());
         $this->dbService->rollback();
         throw $ime;
     } catch (Exception $e) {
         $this->log->err("Failed saving task " . $e->getMessage());
         $this->log->err($e->getTraceAsString());
         $this->dbService->rollback();
         throw $e;
     }
     return $task;
 }