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