source: branches/2.2.0.1/agileProjects/inc/class.uikanban.inc.php @ 4269

Revision 4269, 6.8 KB checked in by rafaelraymundo, 13 years ago (diff)

Ticket #1823 - Adicionada primeira versao do modulo de kanban para avaliacao.

  • Property svn:executable set to *
Line 
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
12include('../phpgwapi/inc/class.common.inc.php');
13include('inc/class.sotasks.inc.php');
14$GLOBALS['phpgw_info'] = array();
15$GLOBALS['phpgw_info']['flags']['currentapp'] = 'agileProjects';
16
17
18        class uikanban{
19               
20                var $template_dir;
21                var $public_functions = array(
22                        'uikanban' => True,
23                        'columns'  => True,
24                        'task'     => True,
25                        'moveJS'   => True
26                );
27
28                function uikanban(){
29                        if($_SESSION['phpgw_info']['expresso']['agileProjects']['active'] == ''){
30                                echo "Primeiro selecione um projeto";
31                                exit();
32                        }
33                        echo("<div align=right>Projeto executado: ");
34                        print_r($_SESSION['phpgw_info']['expresso']['agileProjects']['projectName']);
35                        echo ("</div>");
36
37                        echo "  <div class=\"container\">
38                                <ul class=\"column\" style=\"width:1213px;\">";
39                        $col .= $this->columns("Planejadas","sprintBacklog");
40                        $col .= $this->columns("Em execu&ccedil;&atilde;o","doing");
41                        $col .= $this->columns("Testes","tests");
42                        $col .= $this->columns("Prontas","done");
43                       
44                        echo $col."</ul></div>";
45                }
46               
47                function columns($colName,$idCol){
48                        include_once('inc/class.ldap_functions.inc.php');
49                        $sotasks = new sotasks();
50                        $list = new ldap_functions();
51
52                        $col.= "<li style=\"width:303px\">";
53                        $col.= "<div class=\"block_title\">";
54                        $col.= "<h2>".$colName."</h2>";
55                        $col.= "<div id=\"$idCol\" class=\"block connectedSortable\">";
56                        switch($idCol){
57                                case 'sprintBacklog':
58                                        $sotasks->sotasksKanban('sprintBacklog');
59                                        for($i=0;$i<count($sotasks->tasksElements['tasks_id_owner']);$i++){
60                                                $tasks_id=$sotasks->tasksElements['tasks_id'][$i];
61                                                $tasks_priority=$sotasks->tasksElements['tasks_priority'][$i];
62                                                $tasks_title=$sotasks->tasksElements['tasks_title'][$i];
63                                                $tasks_description=$sotasks->tasksElements['tasks_description'][$i];
64                                                $tasks_estimate=$sotasks->tasksElements['tasks_estimate'][$i];
65                                                $col.= $this->task($list->uidnumber2cn($sotasks->tasksElements['tasks_id_owner'][$i]),$tasks_id,$tasks_priority,$tasks_title,$tasks_description,$tasks_estimate);
66                                        }
67                                break;
68                                case 'doing':
69                                        $sotasks->sotasksKanban('doing');
70                                        for($i=0;$i<count($sotasks->tasksElements['tasks_id_owner']);$i++){
71                                                $tasks_id=$sotasks->tasksElements['tasks_id'][$i];
72                                                $tasks_priority=$sotasks->tasksElements['tasks_priority'][$i];
73                                                $tasks_title=$sotasks->tasksElements['tasks_title'][$i];
74                                                $tasks_description=$sotasks->tasksElements['tasks_description'][$i];
75                                                $tasks_estimate=$sotasks->tasksElements['tasks_estimate'][$i];
76                                                $col.= $this->task($list->uidnumber2cn($sotasks->tasksElements['tasks_id_owner'][$i]),$tasks_id,$tasks_priority,$tasks_title,$tasks_description,$tasks_estimate);
77                                        }                                       
78                                break;
79                                case 'tests':
80                                        $sotasks->sotasksKanban('tests');
81                                        for($i=0;$i<count($sotasks->tasksElements['tasks_id_owner']);$i++){
82                                                $tasks_id=$sotasks->tasksElements['tasks_id'][$i];
83                                                $tasks_priority=$sotasks->tasksElements['tasks_priority'][$i];
84                                                $tasks_title=$sotasks->tasksElements['tasks_title'][$i];
85                                                $tasks_description=$sotasks->tasksElements['tasks_description'][$i];
86                                                $tasks_estimate=$sotasks->tasksElements['tasks_estimate'][$i];
87                                                $col.= $this->task($list->uidnumber2cn($sotasks->tasksElements['tasks_id_owner'][$i]),$tasks_id,$tasks_priority,$tasks_title,$tasks_description,$tasks_estimate);
88                                        }                                       
89                                break;
90                                case 'done':
91                                        $sotasks->sotasksKanban('done');
92                                        for($i=0;$i<count($sotasks->tasksElements['tasks_id_owner']);$i++){
93                                                $tasks_id=$sotasks->tasksElements['tasks_id'][$i];
94                                                $tasks_priority=$sotasks->tasksElements['tasks_priority'][$i];
95                                                $tasks_title=$sotasks->tasksElements['tasks_title'][$i];
96                                                $tasks_description=$sotasks->tasksElements['tasks_description'][$i];
97                                                $tasks_estimate=$sotasks->tasksElements['tasks_estimate'][$i];
98                                                $col.= $this->task($list->uidnumber2cn($sotasks->tasksElements['tasks_id_owner'][$i]),$tasks_id,$tasks_priority,$tasks_title,$tasks_description,$tasks_estimate);
99                                        }
100                                break;
101                        }
102                        $col.=  "</div>";
103                        $col.= "</li>";
104               
105                        return($col);
106                }
107                function task($owner='',$tasks_id,$tasks_priority,$tasks_title='',$tasks_description='',$tasks_estimate){
108                        if($tasks_priority == 't'){
109                                $tasks_priority ="mark_red";
110                        }
111                        else{
112                                $tasks_priority="mark_green";
113                        }
114                        $task.="<div data-id=".$tasks_id." class=\"buble\" style=\"\">
115                            <div class=\"buble-content\">
116                                <span class=\"task\">
117                                <span class=\"msg_list\">
118                                        <span class=\"title-bar\">
119                                                <img height='15px' width='10px' src='templates/default/images/".$tasks_priority.".png'><span style=\"float:right;margin-left:2%;\">".$owner."</span>
120                                        </span>
121                                        <B>".$tasks_title."</B>
122                                        <button class=\"msg_head\">+</button>
123                                        <div class=\"msg_body\" style=\"background-color:#fbf9a5; display: none;\">".$tasks_description."</div>
124                                        <span class=\"footer\"> Estimativa: ".$tasks_estimate." pontos</span>
125                                </span></span>
126                            </div>
127                        </div>
128        ";     
129                        return($task);
130                }
131        }
132?>
Note: See TracBrowser for help on using the repository browser.