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

Revision 4362, 3.5 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
19//if ($folder->getAccessMode($user) < M_READWRITE)
20        //die("access denied");
21       
22if(!$folder = getFolder($folderid)) {
23$GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!');
24               
25}
26
27if ($folder->getAccessMode($user) < M_READWRITE)
28$GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!');
29
30
31printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) );
32?>
33
34<script language="JavaScript">
35function checkForm()
36{
37        msg = "";
38        if (document.form1.userfile.value == "") msg += "<?php printMLText("js_no_file");?>\n";
39        //if (document.form1.fname.value == "") msg += "<?php printMLText("js_no_name");?>\n";
40        //if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
41        //if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n";
42        if (msg != "")
43        {
44                alert(msg);
45                return false;
46        }
47        else
48                return true;
49}
50</script>
51
52<?php
53printTitleBar($folder);
54printFolderPageStart($folder);
55printPageHeader(getMLText("add_document") . ": " . $folder->getName());
56
57printStartBox(getMLText("add_document"));
58?>
59
60<font color="red"><b>NOTA:</b> El documento hereda el permiso correspondiente de la carpeta que lo contiene </font><br></br>
61
62
63
64<form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
65        <input type="Hidden" name="folderid" value="<?php print $folderid; ?>">
66        <table>
67                <tr>
68                        <td class="inputDescription"><?php printMLText("local_file");?>:</td>
69                        <td><input type="File" name="userfile"></td>
70                </tr>
71                <tr>
72                        <td class="inputDescription"><?php printMLText("name");?>:</td>
73                        <td><input name="fname"></td>
74                </tr>
75                <tr>
76                        <td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
77                        <td><textarea name="comment" rows="4" cols="30"></textarea></td>
78                </tr>
79                <tr>
80                        <td valign="top" class="inputDescription"><?php printMLText("keywords");?>:</td>
81                        <td class="standardText">
82                                <textarea name="keywords" rows="4" cols="30"></textarea><br>
83                                <a href="javascript:chooseKeywords();"><?php printMLText("use_default_keywords");?></a>
84                                <script language="JavaScript">
85                                        var openDlg;
86                                       
87                                        function chooseKeywords() {
88                                                openDlg = open("out.KeywordChooser.php", "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
89                                        }
90                                </script>
91                        </td>
92                </tr>
93                <tr>
94                        <td valign="top" class="inputDescription"><?php printMLText("expires");?>:</td>
95                        <td class="standardText">
96                                <input type="Radio" name="expires" value="false" checked><?php printMLText("does_not_expire");?><br>
97                                <input type="radio" name="expires" value="true"><?php printDateChooser(-1, "exp");?>
98                        </td>
99                </tr>
100                <tr>
101                        <td class="inputDescription"><?php printMLText("sequence");?>:</td>
102                        <td><?php printSequenceChooser($folder->getDocuments());?></td>
103                </tr>
104                <tr>
105                        <td colspan="2"><br><input type="Submit"></td>
106                </tr>
107        </table>
108</form>
109
110
111<?php
112
113printEndBox();
114printFolderPageEnd($folder);
115printHTMLFoot();
116
117?>
Note: See TracBrowser for help on using the repository browser.