mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
sync with UpdateDocument
use same way to select expiration date, call hook editDocumentContenAttributes, fix checking form
This commit is contained in:
parent
9ff60e8a35
commit
0bb1035261
|
@ -29,18 +29,14 @@ class SeedDMS_View_CheckInDocument extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
function js() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
$strictformcheck = $this->params['strictformcheck'];
|
$strictformcheck = $this->params['strictformcheck'];
|
||||||
$dropfolderdir = $this->params['dropfolderdir'];
|
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
$this->printSelectPresetButtonJs();
|
$this->printSelectPresetButtonJs();
|
||||||
|
$this->printInputPresetButtonJs();
|
||||||
|
$this->printCheckboxPresetButtonJs();
|
||||||
?>
|
?>
|
||||||
function checkForm()
|
function checkForm()
|
||||||
{
|
{
|
||||||
msg = new Array();
|
msg = new Array();
|
||||||
<?php if($dropfolderdir) { ?>
|
|
||||||
if (document.form1.userfile.value == "" && document.form1.dropfolderfileform1.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
|
||||||
<?php } else { ?>
|
|
||||||
if (document.form1.userfile.value == "") msg.push("<?php printMLText("js_no_file");?>");
|
|
||||||
<?php } ?>
|
|
||||||
<?php
|
<?php
|
||||||
if ($strictformcheck) {
|
if ($strictformcheck) {
|
||||||
?>
|
?>
|
||||||
|
@ -68,6 +64,12 @@ $(document).ready(function() {
|
||||||
if(checkForm()) return;
|
if(checkForm()) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
$('#presetexpdate').on('change', function(ev){
|
||||||
|
if($(this).val() == 'date')
|
||||||
|
$('#control_expdate').show();
|
||||||
|
else
|
||||||
|
$('#control_expdate').hide();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
@ -83,7 +85,6 @@ $(document).ready(function() {
|
||||||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||||
$enableselfrevapp = $this->params['enableselfrevapp'];
|
$enableselfrevapp = $this->params['enableselfrevapp'];
|
||||||
$enableselfreceipt = $this->params['enableselfreceipt'];
|
$enableselfreceipt = $this->params['enableselfreceipt'];
|
||||||
$dropfolderdir = $this->params['dropfolderdir'];
|
|
||||||
$workflowmode = $this->params['workflowmode'];
|
$workflowmode = $this->params['workflowmode'];
|
||||||
$presetexpiration = $this->params['presetexpiration'];
|
$presetexpiration = $this->params['presetexpiration'];
|
||||||
$documentid = $document->getId();
|
$documentid = $document->getId();
|
||||||
|
@ -162,39 +163,75 @@ $(document).ready(function() {
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php printMLText("comment");?>:</td>
|
<td><?php printMLText("comment");?>:</td>
|
||||||
<td class="standardText">
|
<td class="standardText">
|
||||||
<textarea name="comment" rows="4" cols="80"></textarea>
|
<textarea name="comment" rows="4" cols="80"<?php echo $strictformcheck ? ' required' : ''; ?>></textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
if($presetexpiration) {
|
if($presetexpiration) {
|
||||||
if(!($expts = strtotime($presetexpiration)))
|
if(!($expts = strtotime($presetexpiration)))
|
||||||
$expts = time();
|
$expts = false;
|
||||||
} else {
|
} else {
|
||||||
$expts = time();
|
$expts = false;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><?php printMLText("preset_expires");?>:</td>
|
||||||
|
<td>
|
||||||
|
<select class="span6" name="presetexpdate" id="presetexpdate">
|
||||||
|
<option value="never"><?php printMLText('does_not_expire');?></option>
|
||||||
|
<option value="date"<?php echo ($expts != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option>
|
||||||
|
<option value="1w"><?php printMLText('expire_in_1w');?></option>
|
||||||
|
<option value="1m"><?php printMLText('expire_in_1m');?></option>
|
||||||
|
<option value="1y"><?php printMLText('expire_in_1y');?></option>
|
||||||
|
<option value="2y"><?php printMLText('expire_in_2y');?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="control_expdate" <?php echo ($expts == false ? 'style="display: none;"' : ''); ?>>
|
||||||
<td><?php printMLText("expires");?>:</td>
|
<td><?php printMLText("expires");?>:</td>
|
||||||
<td class="standardText">
|
<td class="standardText">
|
||||||
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('d-m-Y', $expts); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
|
<span class="input-append date span12" id="expirationdate" data-date="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
|
||||||
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('d-m-Y', $expts); ?>">
|
<input class="span3" size="16" name="expdate" type="text" value="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>">
|
||||||
<span class="add-on"><i class="icon-calendar"></i></span>
|
<span class="add-on"><i class="icon-calendar"></i></span>
|
||||||
</span><br />
|
</span>
|
||||||
<label class="checkbox inline">
|
|
||||||
<input type="checkbox" name="expires" value="false"<?php if (!$document->expires()) print " checked";?>><?php printMLText("does_not_expire");?><br>
|
|
||||||
</label>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$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', $document, $attrdef);
|
||||||
|
if(is_array($arr)) {
|
||||||
|
if($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, '', 'attributes_version') ?>
|
||||||
|
<?php
|
||||||
|
if($latestContent->getAttributeValue($attrdef)) {
|
||||||
|
switch($attrdef->getType()) {
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_string:
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_int:
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_float:
|
||||||
|
$this->printInputPresetButtonHtml('attributes_version_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef), $attrdef->getValueSetSeparator());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||||
|
$this->printCheckboxPresetButtonHtml('attributes_version_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// print_r($latestContent->getAttributeValue($attrdef));
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user