source: contrib/Dms/out/out.FolderNotify.php @ 4362

Revision 4362, 4.3 KB checked in by afernandes, 13 years ago (diff)

Ticket #1416 - Disponibilizado módulo de recursos para a comunidade

  • Property svn:executable set to *
Line 
1<?php
2include("../inc/inc.Settings.php");
3include("../inc/inc.AccessUtils.php");
4include("../inc/inc.ClassAccess.php");
5include("../inc/inc.ClassDocument.php");
6include("../inc/inc.ClassFolder.php");
7include("../inc/inc.ClassGroup.php");
8include("../inc/inc.ClassUser.php");
9include("../inc/inc.DBAccess.php");
10include("../inc/inc.FileUtils.php");
11include("../inc/inc.Language.php");
12include("../inc/inc.OutUtils.php");
13
14include("../inc/inc.Authentication.php");
15
16$folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : 1;
17//$folder = getFolder($folderid);
18
19if(!$folder = getFolder($folderid)) {
20$GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!');
21               
22}
23
24if ($folder->getAccessMode($user) < M_READWRITE)
25$GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!');
26
27
28$notifyList = $folder->getNotifyList();
29
30//if ($folder->getAccessMode($user) < M_READWRITE)
31        //die ("Access denied");
32
33
34printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) );
35?>
36
37<script language="JavaScript">
38function 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
55printTitleBar($folder);
56printFolderPageStart($folder);
57printPageHeader(getMLText("edit_folder_notify") . ": " . $folder->getName());
58
59printStartBox(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;\">&nbsp;</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;\">&nbsp;</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
97printNextBox(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
144printEndBox();
145printFolderPageEnd($folder);
146printHTMLFoot();
147?>
Note: See TracBrowser for help on using the repository browser.