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 | //if ($folder->getAccessMode($user) < M_READWRITE) |
---|
20 | //die("access denied"); |
---|
21 | |
---|
22 | if(!$folder = getFolder($folderid)) { |
---|
23 | $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); |
---|
24 | |
---|
25 | } |
---|
26 | |
---|
27 | if ($folder->getAccessMode($user) < M_READWRITE) |
---|
28 | $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); |
---|
29 | |
---|
30 | |
---|
31 | printHTMLHead( getMLText("folder_title", array("foldername" => $folder->getName()) ) ); |
---|
32 | ?> |
---|
33 | |
---|
34 | <script language="JavaScript"> |
---|
35 | function 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 |
---|
53 | printTitleBar($folder); |
---|
54 | printFolderPageStart($folder); |
---|
55 | printPageHeader(getMLText("add_document") . ": " . $folder->getName()); |
---|
56 | |
---|
57 | printStartBox(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 | |
---|
113 | printEndBox(); |
---|
114 | printFolderPageEnd($folder); |
---|
115 | printHTMLFoot(); |
---|
116 | |
---|
117 | ?> |
---|