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

Revision 3526, 4.1 KB checked in by afernandes, 13 years ago (diff)

Ticket #1416 - Disponibilizado modulos Timesheet e DMS 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
19$notifyList = $folder->getNotifyList();
20
21if ($folder->getAccessMode($user) < M_READWRITE)
22        die ("Access denied");
23
24
25printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) );
26?>
27
28<script language="JavaScript">
29function 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
46printTitleBar($folder);
47printFolderPageStart($folder);
48printPageHeader(getMLText("edit_folder_notify") . ": " . $folder->getName());
49
50printStartBox(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;\">&nbsp;</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;\">&nbsp;</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
88printNextBox(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
135printEndBox();
136printFolderPageEnd($folder);
137printHTMLFoot();
138?>
Note: See TracBrowser for help on using the repository browser.