add hooks showDocumentKeywords and showDocumentCategory

This commit is contained in:
Uwe Steinmann 2020-08-12 07:26:28 +02:00
parent 969c9daba4
commit a17a190da1
2 changed files with 28 additions and 7 deletions

View File

@ -3,8 +3,9 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
- add hooks showDocumentAttribute and showDocumentContentAttribute in Search view - add hooks showDocumentAttribute and showDocumentContentAttribute in Search view
- fix layout problems of select2 menu, add option for adding an icon to each option - fix layout problems of select2 menu, add option for adding an icon to each option
- better import for users from csv file - better import of users from csv file
- fix various methods in restapi (Closes: #481) - fix various methods in restapi (Closes: #481)
- add hooks showDocumentKeywords and showDocumentCategories
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.18 Changes in version 5.1.18

View File

@ -284,6 +284,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php <?php
} }
if($document->getKeywords()) { if($document->getKeywords()) {
$arr = $this->callHook('showDocumentKeywords', $document);
if(is_array($arr)) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} elseif(is_string($arr)) {
echo $arr;
} else {
?> ?>
<tr> <tr>
<td><?php printMLText("keywords");?>:</td> <td><?php printMLText("keywords");?>:</td>
@ -291,7 +300,17 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</tr> </tr>
<?php <?php
} }
}
if($cats = $document->getCategories()) { if($cats = $document->getCategories()) {
$arr = $this->callHook('showDocumentCategories', $document);
if(is_array($arr)) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} elseif(is_string($arr)) {
echo $arr;
} else {
?> ?>
<tr> <tr>
<td><?php printMLText("categories");?>:</td> <td><?php printMLText("categories");?>:</td>
@ -306,6 +325,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</tr> </tr>
<?php <?php
} }
}
?> ?>
<?php <?php
$attributes = $document->getAttributes(); $attributes = $document->getAttributes();