home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / notes / index.php < prev    next >
Encoding:
PHP Script  |  2004-03-08  |  2.4 KB  |  79 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. $GO_SECURITY->authenticate();
  15. $GO_MODULES->authenticate('notes');
  16. require($GO_LANGUAGE->get_language_file('notes'));
  17.  
  18. $post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
  19. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  20. $link_back = (isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
  21.  
  22. //remember sorting in cookie
  23.  
  24. if (isset($_REQUEST['new_sort_field']) && $_REQUEST['new_sort_field'] != '')
  25. {
  26.     SetCookie("no_sort_field",$_REQUEST['new_sort_field'],time()+3600*24*365,"/","",0);
  27.     $_COOKIE['no_sort_field'] = $_REQUEST['new_sort_field'];
  28. }
  29. if (isset($_REQUEST['new_sort_direction']) && $_REQUEST['new_sort_direction'] != '')
  30. {
  31.     SetCookie("no_sort_direction",$_REQUEST['new_sort_direction'],time()+3600*24*365,"/","",0);
  32.     $_COOKIE['no_sort_direction'] = $_REQUEST['new_sort_direction'];
  33. }
  34.  
  35. if (isset($_REQUEST['show']))
  36. {
  37.     SetCookie("no_show",$_REQUEST['show'],time()+3600*24*365,"/","",0);
  38. }
  39.  
  40. //load contact management class
  41. require($GO_CONFIG->class_path."notes.class.inc");
  42. $notes = new notes();
  43.  
  44. $page_title = $lang_modules['notes'];
  45. require($GO_THEME->theme_path."header.inc");
  46.  
  47. echo '<form name="template" method="post" action="'.$_SERVER['PHP_SELF'].'" />';
  48. echo '<input type="hidden" name="template_id" value="" />';
  49. echo '<input type="hidden" name="task" value="" />';
  50. echo '<input type="hidden" name="close" value="false" />';
  51.  
  52. //create a tab window
  53. $tabtable = new tabtable('notes_tab', $lang_modules['notes'], '600', '400');
  54.  
  55. if ($GO_MODULES->write_permissions)
  56. {
  57.     $tabtable->add_tab('notes', $lang_modules['notes']);
  58.     $tabtable->add_tab('catagories', $no_catagories);
  59. }
  60.  
  61. $tabtable->print_head();
  62.  
  63. //set the user_id so it will only show notes from this user
  64. $user_id = $GO_SECURITY->user_id;
  65.  
  66. if ($tabtable->get_active_tab_id() == 'catagories')
  67. {
  68.     require('catagories.inc');
  69. }else
  70. {
  71.     require('notes.inc');
  72. }
  73.  
  74. $tabtable->print_foot();
  75.  
  76. echo '</form>';
  77. require($GO_THEME->theme_path."footer.inc");
  78. ?>
  79.