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,12 +149,20 @@ $(document).ready(function() {
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($presetexpiration) {
|
if($presetexpiration) {
|
||||||
|
@ -216,12 +224,20 @@ $(document).ready(function() {
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, '', 'attributes_version') ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, '', 'attributes_version') ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($workflowmode == 'advanced') {
|
if($workflowmode == 'advanced') {
|
||||||
|
|
|
@ -143,12 +143,20 @@ function checkForm()
|
||||||
}
|
}
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, $document->getAttribute($attrdef)) ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, $document->getAttribute($attrdef)) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -98,12 +98,21 @@ function checkForm() {
|
||||||
|
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, $folder->getAttribute($attrdef)) ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, $folder->getAttribute($attrdef)) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -196,12 +196,21 @@ function checkForm()
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
if($attrdefs) {
|
if($attrdefs) {
|
||||||
foreach($attrdefs as $attrdef) {
|
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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||||
|
|
|
@ -286,7 +286,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
$attributes = $document->getAttributes();
|
$attributes = $document->getAttributes();
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$this->printAttribute($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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -393,8 +402,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
$attributes = $latestContent->getAttributes();
|
$attributes = $latestContent->getAttributes();
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$attrdef = $attribute->getAttributeDefinition();
|
$arr = $this->callHook('showDocumentContentAttribute', $latestcontent, $attribute);
|
||||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
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 "</ul>\n";
|
||||||
|
@ -992,8 +1006,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
$attributes = $version->getAttributes();
|
$attributes = $version->getAttributes();
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$attrdef = $attribute->getAttributeDefinition();
|
$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute);
|
||||||
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
|
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 "</ul>\n";
|
||||||
|
|
|
@ -199,13 +199,22 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
||||||
$attributes = $folder->getAttributes();
|
$attributes = $folder->getAttributes();
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$attrdef = $attribute->getAttributeDefinition();
|
$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>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||||
<td><?php echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></td>
|
<td><?php echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user