1 | <?php |
---|
2 | /************************************************************************************************\ |
---|
3 | * Gerencia de projetos ageis * |
---|
4 | * by Rafael Raymundo da Silva (rafael2000@gmail.com) * |
---|
5 | * ----------------------------------------------------------------------------------------------* |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \***********************************************************************************************/ |
---|
11 | include_once('../header.inc.php'); |
---|
12 | |
---|
13 | class sotasks{ |
---|
14 | var $sprints_name; |
---|
15 | var $sprintsElements; |
---|
16 | var $sprintsIdElements; |
---|
17 | var $usersElements; |
---|
18 | var $user_id; |
---|
19 | var $tasks_info; |
---|
20 | var $tasksElements; |
---|
21 | var $update_bubble; |
---|
22 | var $sprints_id; |
---|
23 | |
---|
24 | function sotaskInclude(){ |
---|
25 | include_once('../phpgwapi/inc/class.db.inc.php'); |
---|
26 | include_once('inc/class.ldap_functions.inc.php'); |
---|
27 | |
---|
28 | $projId = $_SESSION['phpgw_info']['expresso']['agileProjects']['active']; |
---|
29 | |
---|
30 | $this->sprints_name = $GLOBALS['phpgw']->db; |
---|
31 | $this->user_id = $GLOBALS['phpgw']->db; |
---|
32 | |
---|
33 | $list = new ldap_functions(); |
---|
34 | |
---|
35 | $this->sprints_name->query('SELECT sprints_name,sprints_id FROM phpgw_agile_sprints WHERE sprints_id_proj='.$projId,__LINE__,__FILE__); |
---|
36 | if($this->sprints_name->num_rows()){ |
---|
37 | $i=0; |
---|
38 | while($this->sprints_name->next_record()) |
---|
39 | { |
---|
40 | $this->sprintsElements['sprints_name'][$i] = $this->sprints_name->f('sprints_name'); |
---|
41 | $this->sprintsIdElements['sprints_id'][$i] = $this->sprints_name->f('sprints_id'); |
---|
42 | $i++; |
---|
43 | } |
---|
44 | } |
---|
45 | $this->user_id->query('SELECT DISTINCT uprojects_id_user FROM phpgw_agile_users_projects WHERE uprojects_id_project='.$projId,__LINE__,__FILE__); |
---|
46 | if($this->user_id->num_rows()){ |
---|
47 | $i=0; |
---|
48 | while($this->user_id->next_record()) |
---|
49 | { |
---|
50 | $this->usersElements['user_id'][$i] = $this->user_id->f('uprojects_id_user'); |
---|
51 | $i++; |
---|
52 | } |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
56 | function sotasksKanban($idCol){ |
---|
57 | include_once('../phpgwapi/inc/class.db.inc.php'); |
---|
58 | |
---|
59 | $projId = $_SESSION['phpgw_info']['expresso']['agileProjects']['active']; |
---|
60 | |
---|
61 | //Inicialmente obter o ID do SprintAtivo nesse projeto para buscar suas tarefas |
---|
62 | $this->sprints_id=$GLOBALS['phpgw']->db; |
---|
63 | $this->sprints_id->query("SELECT sprints_id from phpgw_agile_sprints WHERE sprints_id_proj=$projId AND sprints_status='t'",__LINE__,__FILE__); |
---|
64 | while($this->sprints_id->next_record()){ |
---|
65 | $sprintsIdElements[] = $this->sprints_id->f('sprints_id'); |
---|
66 | } |
---|
67 | if (!$sprintsIdElements[0]){ |
---|
68 | $sprintsIdElements[0]=0; |
---|
69 | } |
---|
70 | //-------------------------SprintID encontrado--------------------------------- |
---|
71 | |
---|
72 | $this->tasks_info = $GLOBALS['phpgw']->db; |
---|
73 | $this->tasks_info->query("SELECT tasks_id, tasks_priority, tasks_id_owner,tasks_title,tasks_description,tasks_estimate from phpgw_agile_tasks WHERE tasks_id_proj=$projId AND tasks_status='$idCol' AND tasks_id_sprints=$sprintsIdElements[0]",__LINE__,__FILE__); |
---|
74 | if($this->tasks_info->num_rows()){ |
---|
75 | $i=0; |
---|
76 | while($this->tasks_info->next_record()){ |
---|
77 | $this->tasksElements['tasks_id'][$i] = $this->tasks_info->f('tasks_id'); |
---|
78 | $this->tasksElements['tasks_priority'][$i] = $this->tasks_info->f('tasks_priority'); |
---|
79 | $this->tasksElements['tasks_id_owner'][$i] = $this->tasks_info->f('tasks_id_owner'); |
---|
80 | $this->tasksElements['tasks_title'][$i] = $this->tasks_info->f('tasks_title'); |
---|
81 | $this->tasksElements['tasks_description'][$i] = $this->tasks_info->f('tasks_description'); |
---|
82 | $this->tasksElements['tasks_estimate'][$i] = $this->tasks_info->f('tasks_estimate'); |
---|
83 | $i++; |
---|
84 | } |
---|
85 | } |
---|
86 | } |
---|
87 | function soupdateBubble($tasks_id,$tasks_status){ |
---|
88 | include_once('../phpgwapi/inc/class.db.inc.php'); |
---|
89 | |
---|
90 | $this->update_bubble = $GLOBALS['phpgw']->db; |
---|
91 | $this->update_bubble->query("UPDATE phpgw_agile_tasks SET tasks_status = '$tasks_status' WHERE tasks_id = $tasks_id",__LINE__,__FILE__); |
---|
92 | } |
---|
93 | } |
---|
94 | ?> |
---|