home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / projects / index.php < prev    next >
PHP Script  |  2004-03-08  |  3KB  |  90 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../../Group-Office.php");
  14.  
  15.  
  16. $GO_SECURITY->authenticate();
  17. $GO_MODULES->authenticate('projects');
  18. require($GO_LANGUAGE->get_language_file('projects'));
  19.  
  20. $page_title=$menu_projects;
  21. require($GO_CONFIG->class_path."projects.class.inc");
  22. $projects = new projects();
  23.  
  24. $post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
  25. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  26. $link_back = (isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
  27.  
  28. $time = get_time();
  29. $day = date("j", $time);
  30. $year = date("Y", $time);
  31. $month = date("m", $time);
  32.  
  33. $date = date($_SESSION['GO_SESSION']['date_format'], $time);
  34.  
  35. $tabtable = new tabtable('projects_tab', $lang_modules['projects'], '800', '400');
  36. $tabtable->add_tab('projects.inc', $lang_modules['projects']);
  37. $tabtable->add_tab('load.inc', $pm_load);
  38. $tabtable->add_tab('fees.inc', $pm_fees);
  39.  
  40. //remember sorting of the list in a cookie
  41. if (isset($_REQUEST['new_sort_field']))
  42. {
  43.     SetCookie("pm_sort_field",$_REQUEST['new_sort_field'],time()+3600*24*365,"/","",0);
  44.     $_COOKIE['pm_sort_field'] = $_REQUEST['new_sort_field'];
  45. }
  46.  
  47. if (isset($_REQUEST['new_sort_direction']))
  48. {
  49.     SetCookie("pm_sort_direction",$_REQUEST['new_sort_direction'],time()+3600*24*365,"/","",0);
  50.     $_COOKIE['pm_sort_direction'] = $_REQUEST['new_sort_direction'];
  51. }
  52.  
  53. if (isset($_REQUEST['filter']))
  54. {
  55.     SetCookie("pm_filter",$_REQUEST['filter'],time()+3600*24*365,"/","",0);
  56. }
  57.  
  58. switch($post_action)
  59. {
  60.     case 'projects':
  61.         $tabtable->set_active_tab(0);
  62.     break;
  63.  
  64.     case 'fees':
  65.         $tabtable->set_active_tab(2);
  66.     break;
  67. }
  68.  
  69.  
  70. if ($tabtable->get_active_tab_id() == 'load.inc')
  71. {
  72.     $datepicker = new date_picker();
  73.     $GO_HEADER['head'] = $datepicker->get_header();
  74. }
  75.  
  76. require($GO_THEME->theme_path."header.inc");
  77.  
  78. echo '<form name="projects_form" method="get" action="'.$_SERVER['PHP_SELF'].'">';
  79. echo '<input type="hidden" name="task" />';
  80.  
  81. $tabtable->print_head();
  82. echo '<br />';
  83.  
  84. if (isset($feedback)) echo $feedback;
  85. require($tabtable->get_active_tab_id());
  86. $tabtable->print_foot();
  87. echo '</form>';
  88. require($GO_THEME->theme_path."footer.inc");
  89. ?>
  90.