do not show attributes in extra column in search result

put into a popup opened by a button
This commit is contained in:
Uwe Steinmann 2019-04-11 06:19:56 +02:00
parent e1b04bb567
commit 423bf1dd7c
3 changed files with 67 additions and 3 deletions

View File

@ -985,6 +985,9 @@ $(document).ready(function() { /* {{{ */
$("body").on("click", "span.openpopupbox i", function(e) {
$(e.target).parent().click();
});
$("body").on("click", "span.openpopupbox span", function(e) {
$(e.target).parent().click();
});
$("body").on("click", "span.closepopupbox", function(e) {
$(this).parent().hide();
});

View File

@ -2171,7 +2171,7 @@ $(document).ready( function() {
* @param object $previewer
* @param boolean $skipcont set to true if embrasing tr shall be skipped
*/
function documentListRow($document, $previewer, $skipcont=false, $version=0) { /* {{{ */
function documentListRow($document, $previewer, $skipcont=false, $version=0, $extracontent=array()) { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$showtree = $this->params['showtree'];
@ -2238,10 +2238,14 @@ $(document).ready( function() {
$content .= "<td>";
$content .= "<a draggable=\"false\" href=\"../out/out.ViewDocument.php?documentid=".$docID."&showtree=".$showtree."\">" . htmlspecialchars($document->getName()) . "</a>";
if(isset($extracontent['below_title']))
$content .= $extracontent['below_title'];
$content .= "<br /><span style=\"font-size: 85%; font-style: italic; color: #666; \">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $document->getDate())."</b>, ".getMLText('version')." <b>".$version."</b> - <b>".date('Y-m-d', $latestContent->getDate())."</b>".($document->expires() ? ", ".getMLText('expires').": <b>".getReadableDate($document->getExpires())."</b>" : "")."</span>";
if($comment) {
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
}
if(!empty($extracontent['bottom_title']))
$content .= $extracontent['bottom_title'];
$content .= "</td>\n";
$content .= "<td nowrap>";
@ -2293,7 +2297,7 @@ $(document).ready( function() {
return $content;
} /* }}} */
function folderListRow($subFolder) { /* {{{ */
function folderListRow($subFolder, $extracontent=array()) { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
// $folder = $this->params['folder'];
@ -2314,6 +2318,8 @@ $(document).ready( function() {
if($comment) {
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
}
if(isset($extracontent['bottom_title']))
$content .= $extracontent['bottom_title'];
$content .= "</td>\n";
// $content .= "<td>".htmlspecialchars($owner->getFullName())."</td>";
$content .= "<td colspan=\"1\" nowrap><small>";

View File

@ -463,7 +463,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("attributes")."</th>\n";
//print "<th>".getMLText("attributes")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
@ -487,6 +487,42 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
else
$comment = htmlspecialchars($document->getComment());
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
$belowtitle = "<br /><span style=\"font-size: 85%;\">".getMLText('in_folder').": /";
$folder = $document->getFolder();
$path = $folder->getPath();
for ($i = 1; $i < count($path); $i++) {
$belowtitle .= htmlspecialchars($path[$i]->getName())."/";
}
$belowtitle .= "</span>";
$lcattributes = $lc->getAttributes();
$attrstr = '';
if($lcattributes) {
$attrstr .= "<table class=\"table table-condensed\">\n";
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
foreach($lcattributes as $lcattribute) {
$attrdef = $lcattribute->getAttributeDefinition();
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $lcattribute->getValueAsArray()))."</td></tr>\n";
}
$attrstr .= "</table>\n";
}
$docttributes = $document->getAttributes();
if($docttributes) {
$attrstr .= "<table class=\"table table-condensed\">\n";
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
foreach($docttributes as $docttribute) {
$attrdef = $docttribute->getAttributeDefinition();
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $docttribute->getValueAsArray()))."</td></tr>\n";
}
$attrstr .= "</table>\n";
}
$extracontent = array();
$extracontent['below_title'] = $belowtitle;
if($attrstr)
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-default">'.getMLText('attributes').'</span>', $attrstr, true);
print $this->documentListRow($document, $previewer, false, 0, $extracontent);
if(0) {
print "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
if (in_array(2, $searchin)) {
$docName = $this->markQuery(htmlspecialchars($document->getName()), "i");
@ -565,6 +601,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
print "</div>";
print "</td>";
print "</tr>\n";
}
}
} elseif(get_class($entry) == $dms->getClassname('folder')) {
$folder = $entry;
@ -574,6 +611,23 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
} else {
$folderName = htmlspecialchars($folder->getName());
}
$attrstr = '';
$folderattributes = $folder->getAttributes();
if($folderattributes) {
$attrstr .= "<table class=\"table table-condensed\">\n";
$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>";
foreach($folderattributes as $folderattribute) {
$attrdef = $folderattribute->getAttributeDefinition();
$attrstr .= "<tr><td>".htmlspecialchars($attrdef->getName())."</td><td>".htmlspecialchars(implode(', ', $folderattribute->getValueAsArray()))."</td></tr>\n";
}
$attrstr .= "</table>";
}
$extracontent = array();
if($attrstr)
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-default">'.getMLText('attributes').'</span>', $attrstr, true);
print $this->folderListRow($folder, $extracontent);
if(0) {
print "<tr id=\"table-row-folder-".$folder->getID()."\" draggable=\"true\" rel=\"folder_".$folder->getID()."\" class=\"folder table-row-folder\" formtoken=\"".createFormKey('movefolder')."\">";
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\"><img src=\"".$this->imgpath."folder.png\" width=\"24\" height=\"24\" border=0></a></td>";
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\">";
@ -630,6 +684,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
print "</div>";
print "</td>";
print "</tr>\n";
}
}
}
print "</tbody></table>\n";