/usr/share/letodms/out/out.DocumentVersionDetail.php is in letodms 3.2.1+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | <?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2006-2008 Malcolm Cowe
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.Utils.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_GET["documentid"];
$document = $dms->getDocument($documentid);
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$folder = $document->getFolder();
$docPathHTML = getFolderPathHTML($folder, true). " / <a href=\"../out/out.ViewDocument.php?documentid=".$documentid."\">".$document->getName()."</a>";
if ($document->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
$version = $_GET["version"];
$version = $document->getContentByVersion($version);
if (!is_object($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
// if version is last got out.ViewDocument
$latestContent = $document->getLatestContent();
if ($latestContent->getVersion()==$version->getVersion()) {
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
}
$status = $version->getStatus();
$reviewStatus = $version->getReviewStatus();
$approvalStatus = $version->getApprovalStatus();
UI::htmlStartPage(getMLText("document_title", array("documentname" => $document->getName())));
UI::globalNavigation($folder);
UI::pageNavigation($docPathHTML, "view_document");
UI::contentHeading(getMLText("document_infos"));
UI::contentContainerStart();
?>
<table>
<tr>
<td><?php printMLText("owner");?>:</td>
<td>
<?php
$owner = $document->getOwner();
print "<a class=\"infos\" href=\"mailto:".$owner->getEmail()."\">".$owner->getFullName()."</a>";
?>
</td>
</tr>
<tr>
<td><?php printMLText("comment");?>:</td>
<td><?php print $document->getComment();?></td>
</tr>
<tr>
<td><?php printMLText("creation_date");?>:</td>
<td><?php print getLongReadableDate($document->getDate()); ?></td>
</tr>
<tr>
<td><?php printMLText("keywords");?>:</td>
<td><?php print $document->getKeywords();?></td>
</tr>
<?php
if ($document->isLocked()) {
$lockingUser = $document->getLockingUser();
?>
<tr>
<td><?php printMLText("lock_status");?>:</td>
<td><?php printMLText("lock_message", array("email" => $lockingUser->getEmail(), "username" => $lockingUser->getFullName()));?></td>
</tr>
<?php
}
?>
</tr>
</table>
<?php
UI::contentContainerEnd();
// verify if file exists
$file_exists=file_exists($dms->contentDir . $version->getPath());
UI::contentHeading(getMLText("details_version", array ("version" => $version->getVersion())));
UI::contentContainerStart();
print "<table class=\"folderView\">";
print "<thead>\n<tr>\n";
print "<th width='10%'></th>\n";
print "<th width='10%'>".getMLText("version")."</th>\n";
print "<th width='20%'>".getMLText("file")."</th>\n";
print "<th width='25%'>".getMLText("comment")."</th>\n";
print "<th width='15%'>".getMLText("status")."</th>\n";
print "<th width='20%'></th>\n";
print "</tr>\n</thead>\n<tbody>\n";
print "<tr>\n";
print "<td><ul class=\"actions\">";
if ($file_exists){
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\"> ".getMLText("download")."</a>";
if ($settings->_viewOnlineFileTypes && in_array(strtolower($version->getFileType()), $settings->_viewOnlineFileTypes))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><img src=\"images/view.gif\" class=\"mimeicon\">" . getMLText("view_online") . "</a>";
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\"> ";
print "</ul></td>\n";
print "<td class=\"center\">".$version->getVersion()."</td>\n";
print "<td><ul class=\"documentDetail\">\n";
print "<li>".$version->getOriginalFileName()."</li>\n";
if ($file_exists) print "<li>". formatted_size(filesize($dms->contentDir . $version->getPath())) ." ".$version->getMimeType()."</li>";
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
$updatingUser = $version->getUser();
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$updatingUser->getEmail()."\">".$updatingUser->getFullName()."</a></li>";
print "<li>".getLongReadableDate($version->getDate())."</li>";
print "</ul></td>\n";
print "<td>".$version->getComment()."</td>";
print "<td>".getOverallStatusText($status["status"])."</td>";
print "<td>";
if (($document->getAccessMode($user) >= M_READWRITE)) {
print "<ul class=\"actions\">";
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$version->getVersion()."\">".getMLText("rm_version")."</a></li>";
if ($document->getAccessMode($user) == M_ALL) {
if ( $status["status"]==S_RELEASED || $status["status"]==S_OBSOLETE ){
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$documentid."&version=".$version->getVersion()."'>".getMLText("change_status")."</a></li>";
}
}
print "<li><a href=\"out.EditComment.php?documentid=".$documentid."&version=".$version->getVersion()."\">".getMLText("edit_comment")."</a></li>";
print "</ul>";
}
else {
print " ";
}
echo "</td>";
print "</tr></tbody>\n</table>\n";
print "<table class=\"folderView\">\n";
if (is_array($reviewStatus) && count($reviewStatus)>0) {
print "<tr><td colspan=4>\n";
UI::contentSubHeading(getMLText("reviewers"));
print "</td></tr>\n";
print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
print "</tr>\n";
foreach ($reviewStatus as $r) {
$required = null;
switch ($r["type"]) {
case 0: // Reviewer is an individual.
$required = $dms->getUser($r["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
}
else {
$reqName = $required->getFullName();
}
break;
case 1: // Reviewer is a group.
$required = $dms->getGroup($r["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
}
else {
$reqName = $required->getName();
}
break;
}
print "<tr>\n";
print "<td>".$reqName."</td>\n";
print "<td><ul class=\"documentDetail\"><li>".$r["date"]."</li>";
$updateUser = $dms->getUser($r["userID"]);
print "<li>".(is_object($updateUser) ? $updateUser->getFullName() : "unknown user id '".$r["userID"]."'")."</li></ul></td>";
print "<td>".$r["comment"]."</td>\n";
print "<td>".getReviewStatusText($r["status"])."</td>\n";
print "</tr>\n";
}
}
if (is_array($approvalStatus) && count($approvalStatus)>0) {
print "<tr><td colspan=4>\n";
UI::contentSubHeading(getMLText("approvers"));
print "</td></tr>\n";
print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
print "</tr>\n";
foreach ($approvalStatus as $a) {
$required = null;
switch ($a["type"]) {
case 0: // Approver is an individual.
$required = $dms->getUser($a["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
}
else {
$reqName = $required->getFullName();
}
break;
case 1: // Approver is a group.
$required = $dms->getGroup($a["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
}
else {
$reqName = $required->getName();
}
break;
}
print "<tr>\n";
print "<td>".$reqName."</td>\n";
print "<td><ul class=\"documentDetail\"><li>".$a["date"]."</li>";
$updateUser = $dms->getUser($a["userID"]);
print "<li>".(is_object($updateUser) ? $updateUser->getFullName() : "unknown user id '".$a["userID"]."'")."</li></ul></td>";
print "<td>".$a["comment"]."</td>\n";
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
print "</tr>\n";
}
}
print "</table>\n";
UI::contentContainerEnd();
UI::htmlEndPage();
?>
|