home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / calendar / calendars.inc < prev    next >
Encoding:
Text File  |  2004-03-08  |  2.9 KB  |  78 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. ?>
  14. <table border="0" cellpadding="10">
  15. <tr>
  16.     <td>
  17.     <table border="0" cellpadding="3" cellspacing="0">
  18.     <tr><td colspan="5" height="25"><a href="calendar.php" class="normal"><?php echo $cmdAdd; ?></a></td></tr>
  19.     <?php
  20.     if (isset($feedback))
  21.     {
  22.         echo '<tr><td colspan="5" height="25">'.$feedback.'</td></tr>';
  23.     }
  24.  
  25.     echo '<tr><td><h3>'.$sc_default.'</h3></td><td><h3>'.$strName.'</td><td><h3>'.$sc_owner.'</h3></td><td><h3>'.$sc_subscribed.'</h3></td><td> </td><td> </td></tr>';
  26.  
  27.     $default_calendar_id = $cal->get_default_calendar($GO_SECURITY->user_id);
  28.     $calendar_count = $cal->get_authorized_calendars($GO_SECURITY->user_id);
  29.     if ($calendar_count > 0)
  30.     {
  31.         while ($cal->next_record())
  32.         {
  33.             $calendar1= new calendar();
  34.             if($calendar1->is_subscribed($GO_SECURITY->user_id, $cal->f("id")))
  35.                 $checked = "checked";
  36.             else
  37.                 $checked = "";
  38.                 $check = ($cal->f('id') == $default_calendar_id) ? 'checked' : '';
  39.  
  40.             echo '<tr><td><input type="radio" name="default_calendar_id" value="'.$cal->f("id").'" '.$check.' /></td>';
  41.             echo '<td nowrap><a href="index.php?calendar_id='.$cal->f("id").'" class="normal">'.$cal->f("name").'</a> </td>';
  42.             echo '<td nowrap>'.show_profile($cal->f("user_id")).' </td>';
  43.             echo '<td align="center"> <input type="checkbox" name="calendars[]" value="'.$cal->f("id").'" '.$checked.' /></td>';
  44.  
  45.             echo '<td> <a href="calendar.php?calendar_id='.$cal->f("id").'&return_to='.rawurlencode($_SERVER['REQUEST_URI']).'" title="'.$strEdit.' \''.$cal->f("name").'\'"><img src="'.$GO_THEME->images['edit'].'" border="0" /></a></td>';
  46.             echo "<td> <a href='javascript:delete_calendar(\"".$cal->f("id")."\",\"".rawurlencode($strDeletePrefix."'".$cal->f("name")."'".$strDeleteSuffix)."\")' title=\"".$strDeleteItem." '".$cal->f("name")."'\"><img src=\"".$GO_THEME->images['delete']."\" border=\"0\"></a></td></tr>\n";
  47.         }
  48.     }
  49.     echo '</table>';
  50.     echo '<br /><br />';
  51.     $button = new button($cmdOk, "javascript:save_calendar('true')");
  52.     echo '  ';
  53.     $button = new button($cmdApply, "javascript:save_calendar('false')");
  54.     echo '  ';
  55.     $button = new button($cmdClose,"javascript:document.location='".$return_to."'");
  56.     ?>
  57.     </td>
  58. </tr>
  59. </table>
  60. <script type="text/javascript">
  61. function delete_calendar(calendar_id, message)
  62. {
  63.     if (confirm(unescape(message)))
  64.     {
  65.         document.forms[0].delete_calendar_id.value = calendar_id;
  66.         document.forms[0].task.value='delete_calendar';
  67.         document.forms[0].submit();
  68.     }
  69. }
  70. function save_calendar(close_me)
  71. {
  72.     document.forms[0].close_action.value=close_me;
  73.     document.forms[0].task.value = 'save_calendar';
  74.     document.forms[0].submit();
  75. }
  76. </script>
  77.  
  78.