[3526] | 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.Utils.php"); |
---|
| 12 | include("../inc/inc.Language.php"); |
---|
| 13 | include("../inc/inc.OutUtils.php"); |
---|
| 14 | include("../inc/inc.Authentication.php"); |
---|
| 15 | |
---|
| 16 | $document = getDocument($documentid); |
---|
| 17 | |
---|
| 18 | if ($document->getAccessMode($user) < M_READWRITE) |
---|
| 19 | die ("Access denied"); |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | printHTMLHead( getMLText("document_title", array("documentname" => $document->getName()) ) ); |
---|
| 23 | ?> |
---|
| 24 | |
---|
| 25 | <script language="JavaScript"> |
---|
| 26 | function checkForm() |
---|
| 27 | { |
---|
| 28 | msg = ""; |
---|
| 29 | if (document.form1.userfile.value == "") msg += "<?php printMLText("js_no_file");?>\n"; |
---|
| 30 | if (document.form1.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n"; |
---|
| 31 | if (msg != "") |
---|
| 32 | { |
---|
| 33 | alert(msg); |
---|
| 34 | return false; |
---|
| 35 | } |
---|
| 36 | else |
---|
| 37 | return true; |
---|
| 38 | } |
---|
| 39 | </script> |
---|
| 40 | |
---|
| 41 | <?php |
---|
| 42 | printTitleBar($document->getFolder()); |
---|
| 43 | printDocumentPageStart($document); |
---|
| 44 | printPageHeader(getMLText("update_document") . ": " . $document->getName()); |
---|
| 45 | |
---|
| 46 | printStartBox(getMLText("update_document")); |
---|
| 47 | |
---|
| 48 | if ($document->isLocked()) |
---|
| 49 | { |
---|
| 50 | print "<div class=\"msgLocked\">"; |
---|
| 51 | $lockingUser = $document->getLockingUser(); |
---|
| 52 | |
---|
| 53 | printMLText("update_locked_msg", array("username" => $lockingUser->getFullName(), "email" => $lockingUser->getEmail())); |
---|
| 54 | |
---|
| 55 | if ($lockingUser->getID() == $user->getID()) |
---|
| 56 | printMLText("unlock_cause_locking_user"); |
---|
| 57 | else if ($document->getAccessMode($user) == M_ALL) |
---|
| 58 | printMLText("unlock_cause_access_mode_all"); |
---|
| 59 | else |
---|
| 60 | { |
---|
| 61 | printMLText("no_update_cause_locked"); |
---|
| 62 | print "</div>"; |
---|
| 63 | printEndBox(); |
---|
| 64 | printFolderPageEnd($folder); |
---|
| 65 | printHTMLFoot(); |
---|
| 66 | exit; |
---|
| 67 | } |
---|
| 68 | print "</div>"; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | ?> |
---|
| 72 | |
---|
| 73 | <form action="../op/op.UpdateDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();"> |
---|
| 74 | <input type="Hidden" name="documentid" value="<?php print $documentid; ?>"> |
---|
| 75 | <table> |
---|
| 76 | <tr> |
---|
| 77 | <td class="inputDescription"><?php printMLText("local_file");?>:</td> |
---|
| 78 | <td><input type="File" name="userfile"></td> |
---|
| 79 | </tr> |
---|
| 80 | <tr> |
---|
| 81 | <td valign="top" class="inputDescription"><?php printMLText("comment");?>:</td> |
---|
| 82 | <td class="standardText"> |
---|
| 83 | <textarea name="comment" rows="4" cols="30"></textarea> |
---|
| 84 | </td> |
---|
| 85 | </tr> |
---|
| 86 | <tr> |
---|
| 87 | <td valign="top" class="inputDescription"><?php printMLText("expires");?>:</td> |
---|
| 88 | <td class="standardText"> |
---|
[4362] | 89 | <input type="Radio" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br> |
---|
| 90 | <input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php printDateChooser(-1, "exp");?> |
---|
[3526] | 91 | </td> |
---|
| 92 | </tr> |
---|
| 93 | <tr> |
---|
| 94 | <td colspan="2"><br><input type="Submit"></td> |
---|
| 95 | </tr> |
---|
| 96 | </table> |
---|
| 97 | </form> |
---|
| 98 | |
---|
| 99 | <?php |
---|
| 100 | |
---|
| 101 | printEndBox(); |
---|
| 102 | printDocumentPageEnd($document); |
---|
| 103 | printHTMLFoot(); |
---|
| 104 | |
---|
| 105 | ?> |
---|