2 include_once $gfplugins.'webcalendar/www/includes/init.php';
4 if ( empty ( $login) || $login == "__public__" ) {
5 // do not allow public access
6 do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW" );
11 $user = (($is_admin || $is_nonuser_admin) && $user) ? $user : $login;
13 if ( $groups_enabled == "Y" ) {
14 $INC = array('js/assistant_edit.php');
21 <form action="assistant_edit_handler.php" method="post" name="assistanteditform">
23 if ($user) echo "<input type=\"hidden\" name=\"user\" value=\"$user\" />\n";
24 if ( $is_nonuser_admin ) {
25 nonuser_load_variables ( $user, "nonuser" );
26 echo "<h2>" . $nonuserfullname . " " . translate("Assistants")
27 ."<br />\n-- " . translate("Admin mode") . " --</h2>\n";
29 echo "<h2>" . translate("Your assistants") . "</h2>\n";
32 <a title="<?php etranslate("Admin") ?>" class="nav" href="adminhome.php">« <?php etranslate("Admin") ?></a><br /><br />
34 <table style="border-width:0px;">
35 <tr><td style="vertical-align:top;">
36 <label for="users"><?php etranslate("Assistants"); ?>:</label></td><td>
37 <select name="users[]" id="users" size="10" multiple="multiple">
39 // get list of all users
40 $users = get_my_users ();
41 // get list of users for this view
42 $sql = "SELECT cal_boss, cal_assistant FROM webcal_asst WHERE cal_boss = '$user'";
43 $res = dbi_query ( $sql );
45 while ( $row = dbi_fetch_row ( $res ) ) {
46 $assistantuser[$row[1]] = 1;
48 dbi_free_result ( $res );
50 for ( $i = 0; $i < count ( $users ); $i++ ) {
51 $u = $users[$i]['cal_login'];
52 if ($u == $login ) continue;
53 if ($u == '__public__' ) continue;
54 echo "<option value=\"$u\"";
55 if ( ! empty ( $assistantuser[$u] ) ) {
56 echo " selected=\"selected\"";
58 echo ">" . $users[$i]['cal_fullname'] . "</option>\n";
63 if ( $groups_enabled == "Y" ) {
64 echo "<input type=\"button\" onclick=\"selectUsers()\" value=\"" .
65 translate("Select") . "...\" />\n";
69 <tr><td colspan="2" style="text-align:center;">
71 <input type="submit" name="action" value="<?php etranslate("Save"); ?>" />
76 <?php print_trailer(); ?>