mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
show if user has no access on document he/she has to receipt
This commit is contained in:
parent
310fa41bc2
commit
bb4c6fe83b
|
@ -1169,9 +1169,12 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
$required = null;
|
$required = null;
|
||||||
$is_recipient = false;
|
$is_recipient = false;
|
||||||
$stat[''.$r['status']]++;
|
$stat[''.$r['status']]++;
|
||||||
|
$accesserr = '';
|
||||||
switch ($r["type"]) {
|
switch ($r["type"]) {
|
||||||
case 0: // Recipient is an individual.
|
case 0: // Recipient is an individual.
|
||||||
$required = $dms->getUser($r["required"]);
|
$required = $dms->getUser($r["required"]);
|
||||||
|
if($user->isAdmin() && ($document->getAccessMode($required) < M_READ || $latestContent->getAccessMode($required) < M_READ))
|
||||||
|
$accesserr = getMLText("access_denied");
|
||||||
if (!is_object($required)) {
|
if (!is_object($required)) {
|
||||||
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
|
||||||
}
|
}
|
||||||
|
@ -1206,7 +1209,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
print "<td>".htmlspecialchars($r["comment"])."</td>\n";
|
print "<td>".htmlspecialchars($r["comment"])."</td>\n";
|
||||||
print "<td>".getReceiptStatusText($r["status"])."</td>\n";
|
print "<td>".getReceiptStatusText($r["status"])."</td>\n";
|
||||||
print "<td><ul class=\"unstyled\">";
|
print "<td><ul class=\"unstyled\">";
|
||||||
|
if($accesserr)
|
||||||
|
echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>";
|
||||||
if($accessop->mayReceipt($document)) {
|
if($accessop->mayReceipt($document)) {
|
||||||
if ($is_recipient) {
|
if ($is_recipient) {
|
||||||
if($r["status"]==0) {
|
if($r["status"]==0) {
|
||||||
|
@ -1668,32 +1672,35 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
foreach($reverselinks as $link) {
|
foreach($reverselinks as $link) {
|
||||||
$responsibleUser = $link->getUser();
|
$responsibleUser = $link->getUser();
|
||||||
$sourceDoc = $link->getDocument();
|
$sourceDoc = $link->getDocument();
|
||||||
$sourcelc = $sourceDoc->getLatestContent();
|
/* Check if latest content is accessible. Could be that even if the document
|
||||||
|
* is accessible, the document content isn't because of its status
|
||||||
$previewer->createPreview($sourcelc, $previewwidthdetail);
|
*/
|
||||||
print "<tr>";
|
if($sourcelc = $sourceDoc->getLatestContent()) {
|
||||||
print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">";
|
$previewer->createPreview($sourcelc, $previewwidthdetail);
|
||||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
print "<tr>";
|
||||||
print "<a href=\"../op/op.Download.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."\">";
|
print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">";
|
||||||
if($previewer->hasPreview($sourcelc)) {
|
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||||
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"../op/op.Preview.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
|
print "<a href=\"../op/op.Download.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."\">";
|
||||||
} else {
|
if($previewer->hasPreview($sourcelc)) {
|
||||||
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"".$this->getMimeIcon($sourcelc->getFileType())."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
|
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"../op/op.Preview.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
|
||||||
|
} else {
|
||||||
|
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\" src=\"".$this->getMimeIcon($sourcelc->getFileType())."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
|
||||||
|
}
|
||||||
|
if($accessop->check_controller_access('Download', array('action'=>'run')))
|
||||||
|
print "</a>";
|
||||||
|
print "</td>";
|
||||||
|
print "<td><a href=\"out.ViewDocument.php?documentid=".$sourceDoc->getID()."\" class=\"linklist\">".htmlspecialchars($sourceDoc->getName())."</a></td>";
|
||||||
|
print "<td>".htmlspecialchars($sourceDoc->getComment())."</td>";
|
||||||
|
print "<td>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
|
||||||
|
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
||||||
|
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
|
||||||
|
print "</td>";
|
||||||
|
print "<td><span class=\"actions\">";
|
||||||
|
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
||||||
|
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
|
||||||
|
print "</span></td>";
|
||||||
|
print "</tr>";
|
||||||
}
|
}
|
||||||
if($accessop->check_controller_access('Download', array('action'=>'run')))
|
|
||||||
print "</a>";
|
|
||||||
print "</td>";
|
|
||||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$sourceDoc->getID()."\" class=\"linklist\">".htmlspecialchars($sourceDoc->getName())."</a></td>";
|
|
||||||
print "<td>".htmlspecialchars($sourceDoc->getComment())."</td>";
|
|
||||||
print "<td>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
|
|
||||||
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
|
||||||
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
|
|
||||||
print "</td>";
|
|
||||||
print "<td><span class=\"actions\">";
|
|
||||||
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
|
|
||||||
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
|
|
||||||
print "</span></td>";
|
|
||||||
print "</tr>";
|
|
||||||
}
|
}
|
||||||
print "</tbody>\n</table>\n";
|
print "</tbody>\n</table>\n";
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user