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

Revision 3526, 2.9 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$documentid = (isset($_GET['documentid'])) ? (int) $_GET['documentid'] : NULL;
17$document = getDocument($documentid);
18$folder = $document->getFolder();
19
20if ($document->getAccessMode($user) < M_READWRITE)
21        die ("Access denied");
22
23printHTMLHead( getMLText("document_title", array("documentname" => $document->getName()) ) );
24?>
25
26<script language="JavaScript">
27function checkForm()
28{
29        msg = "";
30        if (document.form1.name.value == "") msg += "<?php printMLText("js_no_name");?>\n";
31        if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
32        if (document.form1.keywords.value == "") msg += "<?php printMLText("js_no_keywords");?>\n";
33        if (msg != "")
34        {
35                alert(msg);
36                return false;
37        }
38        else
39                return true;
40}
41</script>
42
43<?php
44printTitleBar($document->getFolder());
45printDocumentPageStart($document);
46printPageHeader(getMLText("edit_document_props") . ": " . $document->getName());
47
48printStartBox(getMLText("edit_document_props"));
49?>
50
51<form action="../op/op.EditDocument.php" name="form1" onsubmit="return checkForm();">
52        <input type="Hidden" name="documentid" value="<?php print $documentid;?>">
53        <table cellpadding="3">
54                <tr>
55                        <td class="inputDescription"><?php printMLText("name");?>:</td>
56                        <td><input name="fname" value="<?php print $document->getName();?>"></td>
57                </tr>
58                <tr>
59                        <td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td>
60                        <td><textarea name="comment" rows="4" cols="30"><?php print $document->getComment();?></textarea></td>
61                </tr>
62                <tr>
63                        <td valign="top" class="inputDescription"><?php printMLText("keywords");?>:</td>
64                        <td class="standardText">
65                                <textarea name="keywords" rows="4" cols="30"><?php print $document->getKeywords();?></textarea><br>
66                                <a href="javascript:chooseKeywords();"><?php printMLText("use_default_keywords");?></a>
67                                <script language="JavaScript">
68                                        var openDlg;
69                                       
70                                        function chooseKeywords() {
71                                                openDlg = open("out.KeywordChooser.php", "openDlg", "width=500,height=400,scrollbars=yes,resizable=yes");
72                                        }
73                                </script>
74                        </td>
75                </tr>
76                <?php
77                        if ($folder->getAccessMode($user) > M_READ)
78                        {
79                                print "<tr>";
80                                print "<td class=\"inputDescription\">" . getMLText("sequence") . ":</td>";
81                                print "<td>";
82                                printSequenceChooser($folder->getDocuments(), $document->getID());
83                                print "</td></tr>";
84                        }
85                ?>
86                <tr>
87                        <td colspan="2"><br><input type="Submit"></td>
88                </tr>
89        </table>
90</form>
91
92
93<?php
94
95printEndBox();
96printDocumentPageEnd($document);
97printHTMLFoot();
98
99?>
Note: See TracBrowser for help on using the repository browser.