[6779] | 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 | |
---|
| 12 | include('inc/class.solists.inc.php'); |
---|
| 13 | include('../header.inc.php'); |
---|
| 14 | |
---|
| 15 | class uiprojects{ |
---|
| 16 | |
---|
| 17 | var $output; |
---|
| 18 | var $listProjects; |
---|
| 19 | |
---|
| 20 | public function uiprojects(){ |
---|
| 21 | //Novo objeto, classe solists |
---|
| 22 | $this->listProjects = new solists(); |
---|
| 23 | $num = count($this->listProjects->db); |
---|
| 24 | |
---|
| 25 | $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); |
---|
| 26 | $template->set_file(Array('agileProjects' => 'projects.tpl')); |
---|
| 27 | $template->set_block('agileProjects','body'); |
---|
| 28 | if($_SESSION['phpgw_info']['expresso']['agileProjects']['projectName']){ |
---|
| 29 | echo("<div align=right>Projeto executado: "); |
---|
| 30 | print_r($_SESSION['phpgw_info']['expresso']['agileProjects']['projectName']); |
---|
| 31 | echo ("</div>"); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | echo "<div><button type=\"button\" onClick=\"javascript:projectInclude();\">[ ".lang('Include project')." ]</button><br/><br/> |
---|
| 35 | |
---|
| 36 | <table id=\"customers\"> |
---|
| 37 | <thead> |
---|
| 38 | <tr> |
---|
| 39 | <th>".lang('Name of Project')."</th> |
---|
| 40 | <th>".lang('Owner')."</th> |
---|
| 41 | <th>".lang('Description')."</th> |
---|
| 42 | <th>".lang('Actions')."</th> |
---|
| 43 | </tr> |
---|
| 44 | </thead> |
---|
| 45 | <tbody>"; |
---|
| 46 | for($i=0;$i<$num;$i++){ |
---|
| 47 | for($j=0;$j<2;$j++){ |
---|
| 48 | $sel='<B>'; |
---|
| 49 | $unsel='</B>'; |
---|
| 50 | if($_SESSION['phpgw_info']['expresso']['agileProjects']['active'] != $this->listProjects->projId[$i][$j]){ |
---|
| 51 | $sel = ''; |
---|
| 52 | $unsel = ''; |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | echo "<tr class=".$line."> |
---|
| 56 | <td>".$sel.$this->listProjects->db[$i][$j].$unsel."</td> |
---|
| 57 | <td>".$sel.$this->listProjects->db[$i][++$j].$unsel."</td> |
---|
| 58 | <td>".$sel.$this->listProjects->db[$i][++$j].$unsel."</td> |
---|
| 59 | <td> |
---|
| 60 | "; |
---|
| 61 | |
---|
| 62 | $projName = $this->listProjects->db[$i][2-$j]; |
---|
| 63 | $projId = $this->listProjects->projId[$i][2-$j]; |
---|
| 64 | $projOwner = $this->listProjects->db[$i][--$j]; |
---|
| 65 | |
---|
| 66 | if($_SESSION['phpgw_info']['expresso']['agileProjects']['active'] == $projId){ |
---|
| 67 | $projActive = "<img id=\"active_project".$projId."\" onclick=\"javascript:activeProject('".$projName."','".$projId."','".$_SESSION['phpgw_info']['expresso']['agileProjects']['active']."');\" title='Abrir' src='templates/default/images/open_now.png'/>"; |
---|
| 68 | } |
---|
| 69 | else{ |
---|
| 70 | $projActive = "<img id=\"active_project".$projId."\" onclick=\"javascript:activeProject('".$projName."','".$projId."', '".$_SESSION['phpgw_info']['expresso']['agileProjects']['active']."');\" title='Abrir' src='templates/default/images/open.png'/>"; |
---|
| 71 | } |
---|
| 72 | echo " |
---|
| 73 | ".$projActive." |
---|
| 74 | <img onclick=\"editProject(".$projId.",'".$projOwner."','".$_SESSION['phpgw_info']['expresso']['user']['userid']."');\" title='Editar' src='templates/default/images/edit.png'/> |
---|
| 75 | <img onclick=\"removeProject('".$projName."',".$projId.",'".$projOwner."','".$_SESSION['phpgw_info']['expresso']['user']['userid']."');\" title='Excluir' src='templates/default/images/delete.png'/> |
---|
| 76 | </td> |
---|
| 77 | </tr>"; |
---|
| 78 | } |
---|
| 79 | if($line == "alt"){ |
---|
| 80 | $line=""; |
---|
| 81 | }else{ |
---|
| 82 | $line="alt"; |
---|
| 83 | } |
---|
| 84 | }//Fim da listagem |
---|
| 85 | echo "</tbody></table>"; |
---|
| 86 | } |
---|
| 87 | } |
---|
| 88 | ?> |
---|