mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
add more hooks for showing/editing attributes
This commit is contained in:
parent
c7ad9433a1
commit
4e4848c5d7
|
@ -149,6 +149,13 @@ $(document).ready(function() {
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
|
@ -157,6 +164,7 @@ $(document).ready(function() {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if($presetexpiration) {
|
||||
if(!($expts = strtotime($presetexpiration)))
|
||||
$expts = time();
|
||||
|
@ -216,6 +224,13 @@ $(document).ready(function() {
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
|
@ -224,6 +239,7 @@ $(document).ready(function() {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if($workflowmode == 'advanced') {
|
||||
?>
|
||||
<tr>
|
||||
|
|
|
@ -143,6 +143,13 @@ function checkForm()
|
|||
}
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
|
@ -151,6 +158,7 @@ function checkForm()
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
|
|
|
@ -98,6 +98,14 @@ function checkForm() {
|
|||
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0]."</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
|
@ -106,6 +114,7 @@ function checkForm() {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
|
|
|
@ -196,6 +196,14 @@ function checkForm()
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentContentAttribute', null, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
|
@ -204,6 +212,7 @@ function checkForm()
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
|
|
|
@ -286,9 +286,18 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$attributes = $document->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showDocumentAttribute', $document, $attribute);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1]."</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
$this->printAttribute($attribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
|
@ -393,10 +402,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$attributes = $latestContent->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showDocumentContentAttribute', $latestcontent, $attribute);
|
||||
if(is_array($arr)) {
|
||||
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</ul>\n";
|
||||
|
||||
print "<td>".htmlspecialchars($latestContent->getComment())."</td>";
|
||||
|
@ -992,10 +1006,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$attributes = $version->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute);
|
||||
if(is_array($arr)) {
|
||||
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</ul>\n";
|
||||
print "<td>".htmlspecialchars($version->getComment())."</td>";
|
||||
print "<td>".getOverallStatusText($vstat["status"])."</td>";
|
||||
|
|
|
@ -199,6 +199,14 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
|||
$attributes = $folder->getAttributes();
|
||||
if($attributes) {
|
||||
foreach($attributes as $attribute) {
|
||||
$arr = $this->callHook('showFolderAttribute', $folder, $attribute);
|
||||
if(is_array($arr)) {
|
||||
echo $txt;
|
||||
echo "<tr>";
|
||||
echo "<td>".$arr[0].":</td>";
|
||||
echo "<td>".$arr[1].":</td>";
|
||||
echo "</tr>";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
?>
|
||||
<tr>
|
||||
|
@ -208,6 +216,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
$this->contentContainerEnd();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user