mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
- attributes can be edited
- form to add new documents has better layout
This commit is contained in:
parent
cab3ab9a00
commit
563d86ea79
|
@ -54,6 +54,8 @@ $version_comment = $_POST["version_comment"];
|
|||
|
||||
$keywords = $_POST["keywords"];
|
||||
$categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryidform1"]);
|
||||
$attributes = $_POST["attributes"];
|
||||
$attributes_version = $_POST["attributes_version"];
|
||||
|
||||
$reqversion = (int)$_POST["reqversion"];
|
||||
if ($reqversion<1) $reqversion=1;
|
||||
|
@ -169,7 +171,8 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
|
|||
$res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
|
||||
$cats, $userfiletmp, basename($userfilename),
|
||||
$fileType, $userfiletype, $sequence,
|
||||
$reviewers, $approvers, $reqversion,$version_comment);
|
||||
$reviewers, $approvers, $reqversion,
|
||||
$version_comment, $attributes, $attributes_version);
|
||||
|
||||
if (is_bool($res) && !$res) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
|
||||
|
|
|
@ -52,6 +52,7 @@ $sequence = $_POST["sequence"];
|
|||
if (!is_numeric($sequence)) {
|
||||
$sequence="keep";
|
||||
}
|
||||
$attributes = $_POST["attributes"];
|
||||
|
||||
if (($oldname = $document->getName()) != $name) {
|
||||
if($document->setName($name)) {
|
||||
|
@ -154,6 +155,16 @@ if($categories) {
|
|||
}
|
||||
}
|
||||
|
||||
if($attributes) {
|
||||
$oldattributes = $document->getAttributes();
|
||||
foreach($attributes as $attrdefid=>$attribute) {
|
||||
if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) {
|
||||
if(!$document->setAttributeValue($dms->getAttributeDefinition($attrdefid), $attribute))
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($sequence != "keep") {
|
||||
if($document->setSequence($sequence)) {
|
||||
}
|
||||
|
|
|
@ -135,8 +135,9 @@ if (is_uploaded_file($_FILES["userfile"]["tmp_name"]) && $_FILES["userfile"]["si
|
|||
}
|
||||
}
|
||||
|
||||
$attributes = $_POST["attributes"];
|
||||
|
||||
$contentResult=$document->addContent($comment, $user, $userfiletmp, basename($userfilename), $fileType, $userfiletype, $reviewers, $approvers);
|
||||
$contentResult=$document->addContent($comment, $user, $userfiletmp, basename($userfilename), $fileType, $userfiletype, $reviewers, $approvers, $version=0, $attributes);
|
||||
if (is_bool($contentResult) && !$contentResult) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
}
|
||||
|
|
|
@ -102,30 +102,14 @@ $docAccess = $folder->getApproversList();
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
</table><br>
|
||||
</table>
|
||||
<?php UI::contentSubHeading(getMLText("document_infos")); ?>
|
||||
|
||||
<form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" name="form1" onsubmit="return checkForm();">
|
||||
<?php echo createHiddenFieldWithKey('adddocument'); ?>
|
||||
<input type="hidden" name="folderid" value="<?php print $folderid; ?>">
|
||||
<input type="hidden" name="showtree" value="<?php echo showtree();?>">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("sequence");?>:</td>
|
||||
<td><?php UI::printSequenceChooser($folder->getDocuments());?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("version");?>:</td>
|
||||
<td><input name="reqversion" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("local_file");?>:</td>
|
||||
<td>
|
||||
<a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a>
|
||||
<ol id="files">
|
||||
<li><input type="File" name="userfile[]" size="60"></li>
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("name");?>:</td>
|
||||
<td><input name="name" size="60"></td>
|
||||
|
@ -134,10 +118,6 @@ $docAccess = $folder->getApproversList();
|
|||
<td><?php printMLText("comment");?>:</td>
|
||||
<td><textarea name="comment" rows="3" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment_for_current_version");?>:</td>
|
||||
<td><textarea name="version_comment" rows="3" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("keywords");?>:</td>
|
||||
<td>
|
||||
|
@ -152,10 +132,27 @@ $docAccess = $folder->getApproversList();
|
|||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("categories")?>:</td>
|
||||
<td><?php UI::printCategoryChooser("form1");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("categories")?>:</td>
|
||||
<td><?php UI::printCategoryChooser("form1");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("sequence");?>:</td>
|
||||
<td><?php UI::printSequenceChooser($folder->getDocuments());?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $attrdef->getName(); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php printMLText("expires");?>:</td>
|
||||
<td>
|
||||
|
@ -163,6 +160,41 @@ $docAccess = $folder->getApproversList();
|
|||
<input type="radio" name="expires" value="true"><?php UI::printDateChooser(-1, "exp");?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("version_info")); ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php printMLText("version");?>:</td>
|
||||
<td><input name="reqversion" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("local_file");?>:</td>
|
||||
<td>
|
||||
<a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a>
|
||||
<ol id="files">
|
||||
<li><input type="File" name="userfile[]" size="60"></li>
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("comment_for_current_version");?>:</td>
|
||||
<td><textarea name="version_comment" rows="3" cols="80"></textarea></td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $attrdef->getName(); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '', 'attributes_version') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php UI::contentSubHeading(getMLText("assign_reviewers")); ?>
|
||||
|
@ -181,8 +213,8 @@ $docAccess = $folder->getApproversList();
|
|||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
else print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName());
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
@ -196,8 +228,8 @@ $docAccess = $folder->getApproversList();
|
|||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName());
|
||||
else print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName());
|
||||
if ($mandatory) print "<li class=\"cbSelectItem\"><input type='checkbox' checked='checked' disabled='disabled'>".htmlspecialchars($grp->getName())."</li>";
|
||||
else print "<li class=\"cbSelectItem\"><input id='revGrp".$grp->getID()."' type='checkbox' name='grpReviewers[]' value='". $grp->getID() ."'>".htmlspecialchars($grp->getName())."</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
@ -112,6 +112,19 @@ UI::contentContainerStart();
|
|||
print "</td></tr>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_document, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, $document->getAttributeValue($attrdef)) ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><br><input type="Submit" value="<?php printMLText("save") ?>"></td>
|
||||
</tr>
|
||||
|
|
|
@ -140,6 +140,19 @@ $docAccess = $document->getApproversList();
|
|||
<input type="radio" name="expires" value="true"<?php if ($document->expires()) print " checked";?>><?php UI::printDateChooser(-1, "exp");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(LetoDMS_Core_AttributeDefinition::objtype_documentcontent, LetoDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $attrdef->getName(); ?></td>
|
||||
<td><?php UI::printAttributeEditField($attrdef, '') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user