home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / addressbook / contact.php < prev    next >
PHP Script  |  2004-03-08  |  18KB  |  473 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. $GO_SECURITY->authenticate();
  16. $GO_MODULES->authenticate('addressbook');
  17. require($GO_LANGUAGE->get_language_file('contacts'));
  18.  
  19. $page_title=$contact_profile;
  20. require($GO_CONFIG->class_path."addressbook.class.inc");
  21. $ab = new addressbook();
  22.  
  23. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  24. $return_to = (isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : null;
  25. $link_back = (isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
  26. $contact_id = isset($_REQUEST['contact_id']) ? $_REQUEST['contact_id'] : '0';
  27.  
  28. //remember sorting of the projects list in a cookie
  29. if (isset($_REQUEST['new_sort_field']))
  30. {
  31.     SetCookie($_REQUEST['sort_cookie_prefix']."sort_field",$_REQUEST['new_sort_field'],time()+3600*24*365,"/","",0);
  32.     $_COOKIE[$_REQUEST['sort_cookie_prefix'].'sort_field'] = $_REQUEST['new_sort_field'];
  33. }
  34.  
  35. if (isset($_REQUEST['new_sort_direction']))
  36. {
  37.     SetCookie($_REQUEST['sort_cookie_prefix']."sort_direction",$_REQUEST['new_sort_direction'],time()+3600*24*365,"/","",0);
  38.     $_COOKIE[$_REQUEST['sort_cookie_prefix'].'sort_direction'] = $_REQUEST['new_sort_direction'];
  39. }
  40.  
  41. if (isset($_REQUEST['filter']))
  42. {
  43.     SetCookie("pm_filter",$_REQUEST['filter'],time()+3600*24*365,"/","",0);
  44. }
  45.  
  46. if (isset($_REQUEST['show']))
  47. {
  48.     SetCookie("no_show",$_REQUEST['show'],time()+3600*24*365,"/","",0);
  49. }
  50.  
  51. //calendar code
  52. //how many days does the user wants to see? (remember in cookie)
  53. $GO_CAL_SHOW_DAYS = isset($_COOKIE['GO_CAL_SHOW_DAYS']) ? $_COOKIE['GO_CAL_SHOW_DAYS'] : 7;
  54. $show_days = isset($_REQUEST['show_days']) ? $_REQUEST['show_days'] : $GO_CAL_SHOW_DAYS;
  55.  
  56. SetCookie("GO_CAL_SHOW_DAYS",$show_days,time()+3600*24*30,"/",'',0);
  57.  
  58. $company_id =isset($_REQUEST['company_id']) ? $_REQUEST['company_id'] : 0;
  59. $addressbook_id = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : $ab->get_default_addressbook($GO_SECURITY->user_id);
  60.  
  61. switch($task)
  62. {
  63.     case 'save':
  64.         $require = 'edit_contact.inc';
  65.         $first_name = trim($_POST['first_name']);
  66.         $middle_name = trim($_POST['middle_name']);
  67.         $last_name = trim($_POST['last_name']);
  68.         if ($first_name == '' && $last_name == '')
  69.         {
  70.             $feedback = "<p class=\"Error\">".$error_missing_field."</p>";
  71.         }else
  72.         {
  73.             $company_name = isset($_POST['company_name']) ? trim($_POST['company_name']) : '';
  74.  
  75.             if (isset($_POST['company_name']) && $company_name == '')
  76.             {
  77.                 $company_id = 0;
  78.             }elseif($company_name != '' && !$new_company_id = $ab->get_company_id_by_name($company_name, $addressbook_id))
  79.             {
  80.                 $acl_read = $GO_SECURITY->get_new_acl('company read');
  81.                 $acl_write = $GO_SECURITY->get_new_acl('company write');
  82.  
  83.                 if ($acl_read > 0 && $acl_write > 0 && $company_id = $ab->add_company($addressbook_id, $company_name, '', '', '', '', '', '', '', '', '','', '', $acl_read, $acl_write))
  84.                 {
  85.                     if($addressbook = $ab->get_addressbook($addressbook_id))
  86.                     {
  87.                         $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
  88.                         $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
  89.                     }
  90.  
  91.                 }else
  92.                 {
  93.                     $GO_SECURITY->delete_acl($acl_read);
  94.                     $GO_SECURITY->delete_acl($acl_write);
  95.                     $feedback = "<p class=\"Error\">".$strSaveError."</p>";
  96.                 }
  97.  
  98.             }elseif(isset($new_company_id) && $new_company_id != $company_id)
  99.             {
  100.                 $company_id = $new_company_id;
  101.             }
  102.  
  103.             //translate the given birthdayto gmt unix time
  104.             $birthday = date_to_db_date($_POST['birthday']);
  105.  
  106.             $group_id = isset($_POST['group_id']) ? $_POST['group_id'] : '0';
  107.             if ($_POST['contact_id'] > 0)
  108.             {
  109.                 if ($ab->update_contact($_POST['contact_id'], $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $_POST['initials'], $_POST['title'], $_POST['sex'], $birthday, $_POST['email'], $_POST['work_phone'], $_POST['home_phone'], $_POST['fax'], $_POST['cellular'], $_POST['country'], $_POST['state'], $_POST['city'], $_POST['zip'], $_POST['address'], $company_id, $_POST['work_fax'], $_POST['department'], $_POST['function'], $_POST['comment'], $group_id, $_POST['color']))
  110.                 {
  111.                     if ($_POST['close'] == 'true')
  112.                     {
  113.                         header('Location: '.$return_to);
  114.                         exit();
  115.                     }
  116.                 }else
  117.                 {
  118.                     $feedback = "<p class=\"Error\">".$strSaveError."</p>";
  119.                 }
  120.             }else
  121.             {
  122.                 $acl_read = $GO_SECURITY->get_new_acl('contact read');
  123.                 $acl_write = $GO_SECURITY->get_new_acl('contact write');
  124.  
  125.                 if ($acl_read > 0 && $acl_write > 0 && $contact_id = $ab->add_contact($_POST['source_id'], $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $_POST['initials'], $_POST['title'], $_POST['sex'], $birthday, $_POST['email'], $_POST['work_phone'], $_POST['home_phone'], $_POST['fax'], $_POST['cellular'], $_POST['country'], $_POST['state'], $_POST['city'], $_POST['zip'], $_POST['address'], $company_id, $_POST['work_fax'], $_POST['department'], $_POST['function'], $_POST['comment'], $group_id, $_POST['color'], $acl_read, $acl_write))
  126.                 {
  127.                     if($addressbook = $ab->get_addressbook($addressbook_id))
  128.                     {
  129.                         $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
  130.                         $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
  131.                     }
  132.  
  133.                     $link_back .= '&contact_id='.$contact_id;
  134.  
  135.                     if ($_POST['close'] == 'true')
  136.                     {
  137.                         header('Location: '.$return_to);
  138.                         exit();
  139.                     }
  140.                 }else
  141.                 {
  142.                     $GO_SECURITY->delete_acl($acl_read);
  143.                     $GO_SECURITY->delete_acl($acl_write);
  144.                     $feedback = "<p class=\"Error\">".$strSaveError."</p>";
  145.                 }
  146.             }
  147.         }
  148.  
  149.     break;
  150.  
  151.     case 'save_custom_fields':
  152.     if (isset($_POST['fields']))
  153.     {
  154.         require_once($GO_CONFIG->class_path.'custom_fields.class.inc');
  155.         $cf = new custom_fields('ab_custom_contact_fields');
  156.  
  157.         $cf->update_record($contact_id, $_POST['fields']);
  158.  
  159.         if ($_POST['close'] == 'true')
  160.         {
  161.             header('Location: '.$return_to);
  162.             exit();
  163.         }
  164.     }
  165.     break;
  166.  
  167.     case 'start_timer':
  168.         $active_tab = 1;
  169.     break;
  170.  
  171.     default:
  172.         $require = 'edit_contact.inc';
  173.     break;
  174. }
  175. if ($contact_id > 0)
  176. {
  177.  
  178.     $contact = $ab->get_contact($contact_id);
  179.     $write_permission = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $contact["acl_write"]);
  180.     if (!$write_permission  && !$GO_SECURITY->has_permission($GO_SECURITY->user_id, $contact["acl_read"]))
  181.     {
  182.         Header("Location: ".$GO_CONFIG->host."error_docs/403.php");
  183.         exit();
  184.     }
  185.     if (!$write_permission)
  186.     {
  187.         $require = 'show_contact.inc';
  188.     }
  189.     $birthday = $contact['birthday'] > 0 ? db_date_to_date($contact['birthday']) : '';
  190.     $addressbook_id = isset($_POST['addressbook_id']) ? $_POST['addressbook_id'] : $contact['addressbook_id'];
  191. }
  192.  
  193. if (isset($_REQUEST['user_id']) && $_REQUEST['user_id'] > 0)
  194. {
  195.     //load user management class
  196.     require($GO_CONFIG->class_path."users.class.inc");
  197.     $users = new users();
  198.  
  199.     $contact = $users->get_user($_REQUEST['user_id']);
  200.  
  201.     if ($ab->user_is_contact($GO_SECURITY->user_id, $_REQUEST['user_id']))
  202.     {
  203.         $feedback = "<p class='Error'>".$contact_exist_warning."</p>";
  204.         $contact['source_id'] = "";
  205.     }else
  206.     {
  207.         $contact['source_id'] = $_REQUEST['user_id'];
  208.     }
  209.     $addressbook_id = isset($_POST['addressbook_id']) ? $_POST['addressbook_id'] : $contact['addressbook_id'];
  210.     $contact['company_id'] = $ab->get_company_id_by_name($contact['company'], $addressbook_id);
  211.     $contact['group_id'] = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : '';
  212.     $contact['addressbook_id'] = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : $ab->get_default_addressbook($GO_SECURITY->user_id);
  213.     $birthday = $contact['birthday'] > 0 ? db_date_to_date($contact['birthday']) : '';
  214.     $require = 'edit_contact.inc';
  215. }elseif (($contact_id == 0 || $task != '') && $task != 'save_custom_fields')
  216. {
  217.     $require = 'edit_contact.inc';
  218.     $contact['addressbook_id'] = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : $addressbook_id;
  219.     $contact['first_name'] = isset($_REQUEST['first_name']) ? smartstrip($_REQUEST['first_name']) : '';
  220.     $contact['middle_name'] = isset($_REQUEST['middle_name']) ? smartstrip($_REQUEST['middle_name']) : '';
  221.     $contact['last_name'] = isset($_REQUEST['last_name']) ? smartstrip($_REQUEST['last_name']) : '';
  222.     $contact['initials'] = isset($_REQUEST['initials']) ? smartstrip($_REQUEST['initials']) : '';
  223.     $contact['title'] = isset($_REQUEST['title']) ? smartstrip($_REQUEST['title']) : '';
  224.     $contact['sex'] = isset($_REQUEST['sex']) ? smartstrip($_REQUEST['sex']) : 'M';
  225.     $birthday = isset($_REQUEST['birthday']) ? smartstrip($_REQUEST['birthday']) : '';
  226.     $contact['email'] = isset($_REQUEST['email']) ? smartstrip($_REQUEST['email']) : '';
  227.     $contact['work_phone'] = isset($_REQUEST['work_phone']) ? smartstrip($_REQUEST['work_phone']) : '';
  228.     $contact['home_phone'] = isset($_REQUEST['home_phone']) ? smartstrip($_REQUEST['home_phone']) : '';
  229.     $contact['fax'] = isset($_REQUEST['fax']) ? smartstrip($_REQUEST['fax']) : '';
  230.     $contact['cellular'] = isset($_REQUEST['cellular']) ? smartstrip($_REQUEST['cellular']) : '';
  231.     $contact['country'] = isset($_REQUEST['country']) ? smartstrip($_REQUEST['country']) : '';
  232.     $contact['state'] = isset($_REQUEST['state']) ? smartstrip($_REQUEST['state']) : '';
  233.     $contact['city'] = isset($_REQUEST['city']) ? smartstrip($_REQUEST['city']) : '';
  234.     $contact['zip'] = isset($_REQUEST['zip']) ? smartstrip($_REQUEST['zip']) : '';
  235.     $contact['address'] = isset($_REQUEST['address']) ? smartstrip($_REQUEST['address']) : '';
  236.     $contact['department'] = isset($_REQUEST['department']) ? smartstrip($_REQUEST['department']) : '';
  237.     $contact['function'] = isset($_REQUEST['function']) ? smartstrip($_REQUEST['function']) : '';
  238.     $contact['comment'] = isset($_REQUEST['comment']) ? smartstrip($_REQUEST['comment']) : '';
  239.     $contact['color'] = isset($_REQUEST['color']) ? smartstrip($_REQUEST['color']) : '000000';
  240.     $contact['source_id'] = isset($_REQUEST['source_id']) ? $_REQUEST['source_id'] : '';
  241.     $contact['group_id'] = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : '';
  242.     //$contact['company_name'] = isset($_REQUEST['company_name']) ? $_REQUEST['company_name'] : '';
  243.  
  244.     if ($company_id && $company= $ab->get_company($company_id))
  245.     {
  246.         $contact['company_name'] = $company['name'];
  247.         $contact['company_id'] = $company_id ;
  248.     }else
  249.     {
  250.         $contact['company_id'] = isset($contact['company_id']) ? $contact['company_id'] : 0;
  251.     }
  252. }
  253.  
  254. if($task =='update')
  255. {
  256.     require($GO_CONFIG->class_path.'users.class.inc');
  257.     $users = new users();
  258.     $contact = $users->get_user($contact['source_id']);
  259.     $contact["source_id"] = $_POST['source_id'];
  260.     $contact['comment'] = $_POST['comment'];
  261.     $contact['group_id'] = $_POST['group_id'];
  262.     $contact['addressbook_id'] = $_POST['addressbook_id'];
  263. }
  264.  
  265. $datepicker = new date_picker();
  266. $GO_HEADER['head'] = $datepicker->get_header();
  267. require($GO_THEME->theme_path."header.inc");
  268.  
  269. echo '<form name="add" method="post" action="'.$_SERVER['PHP_SELF'].'">';
  270. echo '<input type="hidden" value="'.$contact["source_id"].'" name="source_id" />';
  271. echo '<input type="hidden" name="task" value="" />';
  272. echo '<input type="hidden" name="close" value="false" />';
  273. echo '<input type="hidden" name="return_to" value="'.$return_to.'" />';
  274. echo '<input type="hidden" name="link_back" value="'.$link_back.'" />';
  275. echo '<input type="hidden" name="contact_id" value="'.$contact_id.'" />';
  276. echo '<table border="0"><tr>';
  277.  
  278. $title = $contact_id > 0 ? $ab_contact : $contacts_add;
  279. $tabtable= new tabtable('contact_table', $title, '600', '400', '120', '', true);
  280.  
  281. if ($contact_id > 0)
  282. {
  283.     $tabtable->add_tab('profile', $contact_profile);
  284.  
  285.     if ($GO_MODULES->get_plugin('custom_fields') && $cf_access_acl = $GO_SECURITY->get_acl_id('cf_access'))
  286.     {
  287.         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $cf_access_acl))
  288.         {
  289.             require_once($GO_CONFIG->class_path.'custom_fields.class.inc');
  290.             $cf = new custom_fields('ab_custom_contact_fields');
  291.  
  292.             if ($cf->get_fields() > 0)
  293.             {
  294.                 $tabtable->add_tab('custom_fields', $ab_custom_fields);
  295.             }
  296.         }
  297.     }
  298.  
  299.     if ($projects_module = $GO_MODULES->get_module('projects'))
  300.     {
  301.         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $projects_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $projects_module['acl_write']))
  302.         {
  303.             $tabtable->add_tab('projects', $lang_modules['projects']);
  304.         }
  305.     }
  306.  
  307.     if ($notes_module = $GO_MODULES->get_module('notes'))
  308.     {
  309.         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $notes_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $notes_module['acl_write']))
  310.         {
  311.             $tabtable->add_tab('notes', $lang_modules['notes']);
  312.  
  313.             echo '<td  class="ModuleIcons" nowrap>';
  314.             echo '<a href="'.$notes_module['url'].'note.php?contact_id='.$contact_id.'&return_to='.rawurlencode($link_back).'"><img src="'.$GO_THEME->images['ab_notes'].'" border="0" height="32" width="32" /><br />'.$ab_new_note.'</td>';
  315.         }
  316.     }
  317.  
  318.     if ($contact['email'] != '')
  319.     {
  320.         echo '<td class="ModuleIcons" nowrap>';
  321.         echo mail_to($contact['email'], '<img src="'.$GO_THEME->images['ab_email'].'" border="0" height="32" width="32" /><br />'.$ab_send_message, 'small', true, $contact_id);
  322.         echo '</td>';
  323.     }
  324.  
  325.     if ($calendar_module = $GO_MODULES->get_module('calendar'))
  326.     {
  327.         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_write']))
  328.         {
  329.             echo '<td class="ModuleIcons" nowrap>';
  330.             echo '<a href="'.$calendar_module['url'].'event.php?contact_id='.$contact_id.'&return_to='.rawurlencode($link_back).'"><img src="'.$GO_THEME->images['cal_compose'].'" border="0" height="32" width="32" /><br />'.$ab_new_event.'</td>';
  331.             echo '</td>';
  332.  
  333.             $tabtable->add_tab('calendar', $ab_events);
  334.         }
  335.     }
  336.  
  337.     if ($GO_MODULES->get_plugin('templates'))
  338.     {
  339.         require($GO_CONFIG->class_path.'templates.class.inc');
  340.         $tp = new templates();
  341.         if ($tp->has_oo_templates($GO_SECURITY->user_id))
  342.         {
  343.             echo '<td class="ModuleIcons" nowrap>';
  344.             echo '<a target="_blank" href="'.$GO_MODULES->url.'templates/download_oo_template.php?contact_id='.$contact_id.'"><img src="'.$GO_THEME->images['new_letter'].'" border="0" height="32" width="32" /><br />'.$ab_oo_doc.'</td>';
  345.             echo '</td>';
  346.         }
  347.     }
  348.  
  349.     $tabtable->add_tab('read_permissions', $strReadRights);
  350.     $tabtable->add_tab('write_permissions', $strWriteRights);
  351. }
  352. echo '</tr></table>';
  353.  
  354.  
  355.  
  356. $active_tab = isset($_REQUEST['active_tab']) ? $_REQUEST['active_tab'] : null;
  357. if (isset($active_tab))
  358. {
  359.     $tabtable->set_active_tab($active_tab);
  360. }
  361.  
  362. $tabtable->print_head();
  363.  
  364. switch($tabtable->get_active_tab_id())
  365. {
  366.     case 'read_permissions':
  367.         print_acl($contact['acl_read']);
  368.         echo '<br />';
  369.         $button = new button($cmdClose, "javascript:document.location='".$return_to."';");
  370.     break;
  371.  
  372.     case 'write_permissions':
  373.         print_acl($contact['acl_write']);
  374.         echo '<br />';
  375.         $button = new button($cmdClose, "javascript:document.location='".$return_to."';");
  376.     break;
  377.  
  378.     case 'custom_fields':
  379.         require('custom_fields/custom_fields.inc');
  380.     break;
  381.  
  382.     case 'projects':
  383.         echo '<input type="hidden" name="sort_cookie_prefix" value="pm_" />';
  384.         require($GO_LANGUAGE->get_language_file('projects'));
  385.         require_once($GO_CONFIG->class_path.'projects.class.inc');
  386.         $projects = new projects();
  387.  
  388.         $projects_module_url = $projects_module['url'];
  389.         $link_back .= '&active_tab='.$tabtable->active_tab;
  390.         require($GO_CONFIG->root_path.$projects_module['path'].'projects.inc');
  391.         echo '<br />';
  392.         $button = new button($cmdClose, "javascript:document.location='".$return_to."'");
  393.     break;
  394.  
  395.     case 'notes':
  396.         echo '<input type="hidden" name="sort_cookie_prefix" value="no_" />';
  397.         require($GO_LANGUAGE->get_language_file('notes'));
  398.         require_once($GO_CONFIG->class_path.'notes.class.inc');
  399.         $notes = new notes();
  400.         $notes_module_url = $notes_module['url'];
  401.         $link_back .= '&active_tab='.$tabtable->active_tab;
  402.         require($GO_CONFIG->root_path.$notes_module['path'].'notes.inc');
  403.         echo '<br />';
  404.         $button = new button($cmdClose, "javascript:document.location='".$return_to."'");
  405.     break;
  406.  
  407.     case 'calendar':
  408.         echo '<script type="text/javascript">
  409.         function goto_date(day, month, year)
  410.         {
  411.             document.forms[0].day.value = day;
  412.             document.forms[0].month.value = month;
  413.             document.forms[0].year.value = year;
  414.             document.forms[0].submit();
  415.         }
  416.         </script>';
  417.         echo '<input type="hidden" name="sort_cookie_prefix" value="cal_" />';
  418.  
  419.         require($GO_LANGUAGE->get_language_file('calendar'));
  420.         require_once($GO_CONFIG->class_path.'calendar.class.inc');
  421.         $cal = new calendar();
  422.         $calendar_module_url = $calendar_module['url'];
  423.         $link_back .= '&active_tab='.$tabtable->active_tab;
  424.  
  425.         $print = false;
  426.         $calendar_id = 0;
  427.  
  428.         $daystart=1;
  429.  
  430.         //get the local times
  431.         $local_time = get_time();
  432.         $year = isset($_REQUEST['year']) ? $_REQUEST['year'] : date("Y", $local_time);
  433.         $month = isset($_REQUEST['month']) ? $_REQUEST['month'] : date("m", $local_time);
  434.         $day = isset($_REQUEST['day']) ? $_REQUEST['day'] : date("j", $local_time);
  435.         $hour = isset($_REQUEST['hour']) ? $_REQUEST['hour'] : date("H", $local_time);
  436.         $min = isset($_REQUEST['min']) ? $_REQUEST['min'] : date("i", $local_time);
  437.         $local_browse_time = mktime($hour, $min, 0, $month, $day, $year);
  438.  
  439.         //recalculate date
  440.         $year = date("Y", $local_browse_time);
  441.         $month = date("m", $local_browse_time);
  442.         $day = date("j", $local_browse_time);
  443.         $hour = date("H", $local_browse_time);
  444.         $min = date("i", $local_browse_time);
  445.  
  446.         //get the current date properties
  447.         $current_year = date("Y", $local_time);
  448.         $current_month = date("m", $local_time);
  449.         $current_day = date("j", $local_time);
  450.         $current_hour = date("H", $local_time);
  451.         $current_min = date("i", $local_time);
  452.         $current_date = date(DB_DATE_FORMAT, $local_time);
  453.  
  454.         echo '<input type="hidden" name="day" value="'.$day.'" />';
  455.         echo '<input type="hidden" name="month" value="'.$month.'" />';
  456.         echo '<input type="hidden" name="year" value="'.$year.'" />';
  457.  
  458.         require($GO_CONFIG->root_path.$calendar_module['path'].'list_view.inc');
  459.         echo '<br />';
  460.         $button = new button($cmdClose, "javascript:document.location='".$return_to."'");
  461.     break;
  462.  
  463.     default:
  464.         require($require);
  465.     break;
  466. }
  467. $tabtable->print_foot();
  468.  
  469. echo '</form>';
  470. require($GO_THEME->theme_path."footer.inc");
  471. ?>
  472.  
  473.