source: branches/2.2.0.1/agileProjects/js/jscode/tabs.js @ 4269

Revision 4269, 9.3 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        //------------------------------Tabs----------------------------------
2        $(function(){
3                                // Tabs
4                                $('#tabs').tabs();
5               
6                                //hover states on the static widgets
7                                $('#dialog_link, ul#icons li').hover(
8                                        function() { $(this).addClass('ui-state-hover'); },
9                                        function() { $(this).removeClass('ui-state-hover'); }
10                                );
11                    });
12        //-------------------End Tabs----------------------------------------
13        //---------------------Columns---------------------------------------
14        $(document).ready(function(){
15       
16                $('a[href^="http://"]') .attr({ target: "_blank" });
17 
18                function smartColumns() {
19               
20                        $("ul.column").css({ 'width' : "260px"});
21               
22                        var colWrap = $("ul.column").width();
23                        var colNum = Math.floor(colWrap / 300);
24                        var colFixed = Math.floor(colWrap / colNum);
25               
26               
27                        $("ul.column").css({ 'width' : colWrap});
28                        $("ul.column li").css({ 'width' : colFixed});
29                }       
30       
31                smartColumns();
32       
33        // -----------Resize columns-----------
34        //      $(window).resize(function () {
35        //              smartColumns();
36        //      });         
37        });
38        //-------------------End Columns----------------------------------
39        //-----------------------Tasks------------------------------------
40        /*$(document).ready(function(){
41                $("#sprintBacklog,#doing,#tests,#done").sortable({
42                    connectWith: '.connectedSortable',
43                    receive: function(event, ui) {
44                        //alert($(ui.item).attr('data-id') + ' -> ' + $(this).attr('id'));
45                        //Do something with the recently dropped item here
46                    }
47                }).disableSelection();
48 
49            });
50        //Expand for details
51        $(document).ready(function()
52        {
53                //hide the all of the element with class msg_body
54                $(".msg_body").hide();
55                //toggle the componenet with class msg_body
56                $(".msg_head").click(function()
57                {
58                        $(this).next(".msg_body").slideToggle(600);
59                });
60        });
61*/      //-------------------End Tasks---------------------------------------
62        //------------------Update Bubble------------------------------------
63        function updateBubble(tasks_id,tasks_status){
64
65                http = new XMLHttpRequest();
66                http.onreadystatechange = stateUpdateBubble;
67                http.open("GET","action.php?type=updateBubble&tasks_id="+tasks_id+"&tasks_status="+tasks_status+"");
68                http.send(null);
69                respostServer = http.responseXML;
70        }
71        function stateUpdateBubble() {
72                if ( http.readyState == 4) { // Complete
73                        if ( http.status != 200) { // server reply is OK
74                                alert( "Problema: " + http.statusText );
75                        }
76                }
77        }
78        //------------------Fim update bubble--------------------------------
79        //----------------Alter Tabs----------------------------------------
80        function dataRequest(tabRequest){
81                tab = tabRequest;
82                http = new XMLHttpRequest();
83                http.onreadystatechange = stateProc;
84                http.open("GET","/agileProjects/action.php?tabs="+tabRequest+"");
85                http.send(null);
86                respostServer = http.responseXML;
87        }
88        function stateProc() {
89                if ( http.readyState == 4) { // Complete
90                        if ( http.status == 200) { // server reply is OK
91                                document.getElementById('tabs-1').innerHTML = '';
92                                document.getElementById('tabs-2').innerHTML = '';
93                                document.getElementById('tabs-3').innerHTML = '';
94                                document.getElementById('tabs-4').innerHTML = '';
95                                document.getElementById(tab).innerHTML = http.responseText;
96                                //------------------------------------------------------
97                                //Acoes responsaveis pelo movimento da Tarefas do Kanban
98                                //------------------------------------------------------
99                                if(tab == 'tabs-4'){
100                                        $(document).ready(function(){
101                                           $("#sprintBacklog,#doing,#tests,#done").sortable({
102                                                connectWith: '.connectedSortable',
103                                                receive: function(event, ui) {
104                                                updateBubble(($(ui.item).attr('data-id')),($(this).attr('id')));
105                                //                alert($(ui.item).attr('data-id') + ' -> ' + $(this).attr('id'));
106                                                  //Do something with the recently dropped item here
107                                                }
108                                           }).disableSelection();
109 
110                                        });
111                                        //Expand for details
112                                        $(document).ready(function()
113                                        {
114                                                //hide the all of the element with class msg_body
115                                                $(".msg_body").hide();
116                                                //toggle the componenet with class msg_body
117                                                $(".msg_head").click(function()
118                                                {
119                                                        $(this).next(".msg_body").slideToggle(600);
120                                                });
121                                        });
122                                }       
123                        } else {
124                                alert( "Problema: " + http.statusText ); 
125                        }
126                }
127        }
128        //-------------------Fim Alter tabs-----------------------------------
129        //---------------Include Project--------------------------------------
130        function projectInclude(projId, projOwner,userLog){
131
132                if(projOwner!='' && userLog!='' && projId!=''){
133                        if(projOwner != userLog){
134                                alert("Voce nao tem permissao para editar esse projeto");
135                                exit();
136                        }
137                }
138
139                        http = new XMLHttpRequest();
140                        http.onreadystatechange = stateIncludeProject;
141                        http.open("GET","/agileProjects/inc/class.uiprojectInclude.inc.php?type=editProj&projId="+projId+"");
142                        http.send(null);
143                        respostServer = http.responseXML;
144        }
145        function stateIncludeProject() {
146                if ( http.readyState == 4) { // Complete
147                        if ( http.status == 200) { // server reply is OK
148                                document.getElementById('tabs-1').innerHTML = '';
149                                document.getElementById('tabs-1').innerHTML = http.responseText ;
150                        } else {
151                                alert( "Problema: " + http.statusText );
152                        }
153                }
154        }
155        //----------------Fim Include Project---------------------------------
156        //---------------Include Tasks------------------------------------------
157        function taskInclude(){
158
159                http = new XMLHttpRequest();
160                http.onreadystatechange = stateIncludeTask;
161                http.open("GET","action.php?type=taskInclude");
162                http.send(null);
163                respostServer = http.responseXML;
164        }
165        function stateIncludeTask() {
166                if ( http.readyState == 4) { // Complete
167                        if ( http.status == 200) { // server reply is OK
168                                document.getElementById('tabs-2').innerHTML = '';
169                                document.getElementById('tabs-2').innerHTML = http.responseText ;
170                        } else {
171                                alert( "Problema: " + http.statusText );
172                        }
173                }
174        }
175        //----------------Fim Include Tasks-------------------------------------
176        //---------------Include Tasks------------------------------------------
177        function sprintInclude(){
178
179                        http = new XMLHttpRequest();
180                        http.onreadystatechange = stateIncludeSprint;
181                        http.open("GET","/agileProjects/inc/sprintInclude.inc.php");
182                        http.send(null);
183                        respostServer = http.responseXML;
184        }
185        function stateIncludeSprint() {
186                if ( http.readyState == 4) { // Complete
187                        if ( http.status == 200) { // server reply is OK
188                                document.getElementById('tabs-3').innerHTML = '';
189                                document.getElementById('tabs-3').innerHTML = http.responseText ;
190                        } else {
191                                alert( "Problema: " + http.statusText );
192                        }
193                }
194        }
195        //----------------Fim Include Tasks-------------------------------------       
196        //---------------Include Users----------------------------------------
197        function userInclude(filter, boxField){
198                field = boxField;
199                http = new XMLHttpRequest();
200                http.onreadystatechange = stateUserInclude;
201                http.open("GET","/agileProjects/controller.php?action=agileProjects.ldap_functions.search_users_only&tipo=search&filtro="+filter+"");
202                http.send(null);
203                respostServer = http.responseXML;
204        }
205        function stateUserInclude() {
206                if ( http.readyState == 4) { // Complete
207                        if ( http.status == 200) { // server reply is OK
208                                document.getElementById(field).innerHTML = '';
209                                document.getElementById(field).innerHTML = http.responseText;
210                        } else {
211                                alert( "Problema: " + http.statusText );
212                        }
213                }
214        }
Note: See TracBrowser for help on using the repository browser.