1 | <?php |
---|
2 | include("../inc/inc.Settings.php"); |
---|
3 | include("../inc/inc.AccessUtils.php"); |
---|
4 | include("../inc/inc.ClassAccess.php"); |
---|
5 | include("../inc/inc.ClassDocument.php"); |
---|
6 | include("../inc/inc.ClassFolder.php"); |
---|
7 | include("../inc/inc.ClassGroup.php"); |
---|
8 | include("../inc/inc.ClassUser.php"); |
---|
9 | include("../inc/inc.DBAccess.php"); |
---|
10 | include("../inc/inc.FileUtils.php"); |
---|
11 | include("../inc/inc.Language.php"); |
---|
12 | include("../inc/inc.OutUtils.php"); |
---|
13 | |
---|
14 | include("../inc/inc.Authentication.php"); |
---|
15 | |
---|
16 | $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1; |
---|
17 | $folder = getFolder($folderid); |
---|
18 | |
---|
19 | $notifyList = $folder->getNotifyList(); |
---|
20 | |
---|
21 | if ($folder->getAccessMode($user) < M_READWRITE) |
---|
22 | die ("Access denied"); |
---|
23 | |
---|
24 | |
---|
25 | printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) ); |
---|
26 | ?> |
---|
27 | |
---|
28 | <script language="JavaScript"> |
---|
29 | function checkForm() |
---|
30 | { |
---|
31 | msg = ""; |
---|
32 | if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) && |
---|
33 | (document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1)) |
---|
34 | msg += "<?php printMLText("js_select_user_or_group");?>\n"; |
---|
35 | if (msg != "") |
---|
36 | { |
---|
37 | alert(msg); |
---|
38 | return false; |
---|
39 | } |
---|
40 | else |
---|
41 | return true; |
---|
42 | } |
---|
43 | </script> |
---|
44 | |
---|
45 | <?php |
---|
46 | printTitleBar($folder); |
---|
47 | printFolderPageStart($folder); |
---|
48 | printPageHeader(getMLText("edit_folder_notify") . ": " . $folder->getName()); |
---|
49 | |
---|
50 | printStartBox(getMLText("edit_existing_notify")); |
---|
51 | ?> |
---|
52 | |
---|
53 | <table border="0" cellpadding="5" cellspacing="0"> |
---|
54 | <?php |
---|
55 | if ((count($notifyList["users"]) == 0) && (count($notifyList["groups"]) == 0)) |
---|
56 | { |
---|
57 | print "<tr><td class=\"notifylist\">".getMLText("empty_notify_list")."</td></tr>"; |
---|
58 | } |
---|
59 | else |
---|
60 | { |
---|
61 | print "<tr>\n"; |
---|
62 | print " <td style=\"border-bottom: 1pt solid #000080;\"> </td>\n"; |
---|
63 | print " <td style=\"border-bottom: 1pt solid #000080;\" class=\"notifylist\"><i>".getMLText("name")."</i></td>\n"; |
---|
64 | print " <td style=\"border-bottom: 1pt solid #000080;\"> </td>\n"; |
---|
65 | print "</tr>\n"; |
---|
66 | foreach ($notifyList["users"] as $userNotify) |
---|
67 | { |
---|
68 | print "<tr>"; |
---|
69 | print "<td><img src=\"images/usericon.gif\" width=16 height=16></td>"; |
---|
70 | print "<td class=\"notifylist\">" . $userNotify->getFullName() . "</td>"; |
---|
71 | print "<td><a href=\"../op/op.FolderNotify.php?folderid=". $folderid . "&action=delnotify&userid=".$userNotify->getID()."\"><img src=\"images/del.gif\" width=15 height=15 border=0></a>"; |
---|
72 | print "</tr>"; |
---|
73 | } |
---|
74 | |
---|
75 | foreach ($notifyList["groups"] as $groupNotify) |
---|
76 | { |
---|
77 | print "<tr>"; |
---|
78 | print "<td><img src=\"images/groupicon.gif\" width=16 height=16 border=0></td>"; |
---|
79 | print "<td class=\"notifylist\">" . $groupNotify->getName() . "</td>"; |
---|
80 | print "<td><a href=\"../op/op.FolderNotify.php?folderid=". $folderid . "&action=delnotify&groupid=".$groupNotify->getID()."\"><img src=\"images/del.gif\" width=15 height=15 border=0></a>"; |
---|
81 | print "</tr>"; |
---|
82 | } |
---|
83 | } |
---|
84 | ?> |
---|
85 | </table> |
---|
86 | |
---|
87 | <?php |
---|
88 | printNextBox(getMLText("add_new_notify")); |
---|
89 | ?> |
---|
90 | |
---|
91 | |
---|
92 | <form action="../op/op.FolderNotify.php" name="form1" onsubmit="return checkForm();"> |
---|
93 | <input type="Hidden" name="folderid" value="<?php print $folderid?>"> |
---|
94 | <input type="Hidden" name="action" value="addnotify"> |
---|
95 | <table> |
---|
96 | <tr> |
---|
97 | <td class="inputDescription"><?php printMLText("user");?>:</td> |
---|
98 | <td> |
---|
99 | <select name="userid"> |
---|
100 | <option value="-1"><?php printMLText("select_one");?> |
---|
101 | <option value="-1">------------------------------- |
---|
102 | <?php |
---|
103 | $allUsers = getAllUsers(); |
---|
104 | foreach ($allUsers as $userObj) |
---|
105 | { |
---|
106 | if ($userObj->getID() == $settings->_guestID) |
---|
107 | continue; |
---|
108 | print "<option value=\"".$userObj->getID()."\">" . $userObj->getFullName() . "\n"; |
---|
109 | } |
---|
110 | ?> |
---|
111 | </select> |
---|
112 | </td> |
---|
113 | </tr> |
---|
114 | <tr> |
---|
115 | <td class="inputDescription"><?php printMLText("group");?>:</td> |
---|
116 | <td> |
---|
117 | <select name="groupid"> |
---|
118 | <option value="-1"><?php printMLText("select_one");?> |
---|
119 | <option value="-1">------------------------------- |
---|
120 | <?php |
---|
121 | $allGroups = getAllGroups(); |
---|
122 | foreach ($allGroups as $groupObj) |
---|
123 | print "<option value=\"".$groupObj->getID()."\">" . $groupObj->getName() . "\n"; |
---|
124 | ?> |
---|
125 | </select> |
---|
126 | </td> |
---|
127 | </tr> |
---|
128 | <tr> |
---|
129 | <td colspan="2"><br><input type="Submit"></td> |
---|
130 | </tr> |
---|
131 | </table> |
---|
132 | </form> |
---|
133 | |
---|
134 | <?php |
---|
135 | printEndBox(); |
---|
136 | printFolderPageEnd($folder); |
---|
137 | printHTMLFoot(); |
---|
138 | ?> |
---|