mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
sync checkin code with update document code
This commit is contained in:
parent
5e1bb70d9b
commit
76f6500fd4
|
@ -68,6 +68,7 @@ if($view) {
|
|||
$view->setParam('folder', $folder);
|
||||
$view->setParam('document', $document);
|
||||
$view->setParam('strictformcheck', $settings->_strictFormCheck);
|
||||
$view->setParam('nodocumentformfields', $settings->_noDocumentFormFields);
|
||||
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
|
||||
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
|
||||
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
|
||||
|
|
|
@ -80,6 +80,7 @@ $(document).ready(function() {
|
|||
$folder = $this->params['folder'];
|
||||
$document = $this->params['document'];
|
||||
$strictformcheck = $this->params['strictformcheck'];
|
||||
$nodocumentformfields = $this->params['nodocumentformfields'];
|
||||
$enablelargefileupload = $this->params['enablelargefileupload'];
|
||||
$enableadminrevapp = $this->params['enableadminrevapp'];
|
||||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||
|
@ -157,118 +158,137 @@ $(document).ready(function() {
|
|||
$this->contentContainerStart();
|
||||
?>
|
||||
|
||||
<form action="../op/op.CheckInDocument.php" method="post" id="form1" name="form1">
|
||||
<form class="form-horizontal" action="../op/op.CheckInDocument.php" method="post" id="form1" name="form1">
|
||||
<?php echo createHiddenFieldWithKey('checkindocument'); ?>
|
||||
<input type="hidden" name="documentid" value="<?php print $document->getID(); ?>">
|
||||
<table class="table-condensed">
|
||||
|
||||
<tr>
|
||||
<td><?php printMLText("comment");?>:</td>
|
||||
<td class="standardText">
|
||||
<textarea name="comment" rows="4" cols="80"<?php echo $strictformcheck ? ' required' : ''; ?>></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($presetexpiration) {
|
||||
if(!($expts = strtotime($presetexpiration)))
|
||||
$expts = false;
|
||||
} else {
|
||||
<?php
|
||||
if(!$nodocumentformfields || !in_array('version_comment', $nodocumentformfields)) {
|
||||
$this->formField(
|
||||
getMLText("comment"),
|
||||
array(
|
||||
'element'=>'textarea',
|
||||
'name'=>'comment',
|
||||
'rows'=>4,
|
||||
'cols'=>80
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!$nodocumentformfields || !in_array('expires', $nodocumentformfields)) {
|
||||
if($presetexpiration) {
|
||||
if(!($expts = strtotime($presetexpiration)))
|
||||
$expts = false;
|
||||
}
|
||||
?>
|
||||
<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 class="standardText">
|
||||
<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 ($expts ? date('Y-m-d', $expts) : ''); ?>">
|
||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
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 {
|
||||
$expts = false;
|
||||
}
|
||||
$options = array();
|
||||
$options[] = array('never', getMLText('does_not_expire'));
|
||||
$options[] = array('date', getMLText('expire_by_date'), $expts);
|
||||
$options[] = array('1w', getMLText('expire_in_1w'));
|
||||
$options[] = array('1m', getMLText('expire_in_1m'));
|
||||
$options[] = array('1y', getMLText('expire_in_1y'));
|
||||
$options[] = array('2y', getMLText('expire_in_2y'));
|
||||
$this->formField(
|
||||
getMLText("preset_expires"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'presetexpdate',
|
||||
'name'=>'presetexpdate',
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$this->formField(
|
||||
getMLText("expires"),
|
||||
$this->getDateChooser(($expts ? date('Y-m-d', $expts) : ''), "expdate", $this->params['session']->getLanguage())
|
||||
);
|
||||
}
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
|
||||
if(is_array($arr)) {
|
||||
if($arr)
|
||||
$this->formField($arr[0], $arr[1]);
|
||||
} elseif(is_string($arr)) {
|
||||
echo $arr;
|
||||
} else {
|
||||
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef)));
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||
<td><?php $this->printAttributeEditField($attrdef, '', 'attributes') ?>
|
||||
<?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_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef), $attrdef->getValueSetSeparator());
|
||||
break;
|
||||
case SeedDMS_Core_AttributeDefinition::type_boolean:
|
||||
$this->printCheckboxPresetButtonHtml('attributes_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef));
|
||||
break;
|
||||
}
|
||||
// print_r($latestContent->getAttributeValue($attrdef));
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
// Retrieve a list of all users and groups that have review / approve
|
||||
// privileges.
|
||||
$docAccess = $folder->getReadAccessList($enableadminrevapp, $enableownerrevapp);
|
||||
if($workflowmode != 'traditional_only_approval') {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php $this->contentSubHeading(getMLText("assign_reviewers")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="IndReviewer" class="chzn-select span9" name="indReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_reviewers'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
|
||||
<?php
|
||||
$arrs = $this->callHook('addDocumentContentAttributes', $folder);
|
||||
if(is_array($arrs)) {
|
||||
foreach($arrs as $arr) {
|
||||
$this->formField($arr[0], $arr[1]);
|
||||
}
|
||||
} elseif(is_string($arrs)) {
|
||||
echo $arrs;
|
||||
}
|
||||
|
||||
if($workflowmode == 'advanced') {
|
||||
$mandatoryworkflows = $user->getMandatoryWorkflows();
|
||||
if($mandatoryworkflows) {
|
||||
if(count($mandatoryworkflows) == 1) {
|
||||
$this->formField(
|
||||
getMLText("workflow"),
|
||||
htmlspecialchars($mandatoryworkflows[0]->getName()).'<input type="hidden" name="workflow" value="'.$mandatoryworkflows[0]->getID().'">'
|
||||
);
|
||||
} else {
|
||||
$options = array();
|
||||
$curworkflow = $latestContent->getWorkflow();
|
||||
foreach ($mandatoryworkflows as $workflow) {
|
||||
$options[] = array($workflow->getID(), htmlspecialchars($workflow->getName()), $curworkflow && $curworkflow->getID() == $workflow->getID());
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("workflow"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'workflow',
|
||||
'name'=>'workflow',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_workflow'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$options = array();
|
||||
$options[] = array('', '');
|
||||
$workflows=$dms->getAllWorkflows();
|
||||
foreach ($workflows as $workflow) {
|
||||
$options[] = array($workflow->getID(), htmlspecialchars($workflow->getName()));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("workflow"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'workflow',
|
||||
'name'=>'workflow',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_workflow'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->warningMsg(getMLText("add_doc_workflow_warning"));
|
||||
} elseif($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
$docAccess = $document->getReadAccessList($enableadminrevapp, $enableownerrevapp);
|
||||
if($workflowmode == 'traditional') {
|
||||
$this->contentSubHeading(getMLText("assign_reviewers"));
|
||||
$res=$user->getMandatoryReviewers();
|
||||
$options = array();
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<option disabled=\"disabled\" value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
||||
else print "<option value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
||||
$option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
|
||||
if ($mandatory) $option[] = array(array('disabled', 'disabled'));
|
||||
$options[] = $option;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($reviewStatus as $r) {
|
||||
if($r['type'] == 0) {
|
||||
if($res) {
|
||||
if($res) {
|
||||
$mandatory=false;
|
||||
foreach ($res as $rr)
|
||||
if ($rr['reviewerUserID']==$r['required']) {
|
||||
|
@ -281,8 +301,9 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = array();
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("IndReviewer", $tmp);
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndReviewers", $tmp));
|
||||
}
|
||||
/* List all mandatory reviewers */
|
||||
if($res) {
|
||||
|
@ -294,11 +315,27 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
if($tmp) {
|
||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> ';
|
||||
echo implode(', ', $tmp);
|
||||
echo "</div>\n";
|
||||
if(isset($fieldwrap[1]))
|
||||
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
else
|
||||
$fieldwrap[1] = '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->formField(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'indReviewers[]',
|
||||
'id'=>'IndReviewers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_reviewers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
/* Check for mandatory reviewer without access */
|
||||
foreach($res as $r) {
|
||||
if($r['reviewerUserID']) {
|
||||
|
@ -309,45 +346,38 @@ $(document).ready(function() {
|
|||
}
|
||||
if(!$hasAccess) {
|
||||
$noAccessUser = $dms->getUser($r['reviewerUserID']);
|
||||
echo "<div class=\"alert alert-warning\">".getMLText("mandatory_reviewer_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")")))."</div>";
|
||||
$this->warningMsg(getMLText("mandatory_reviewer_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals_in_groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class="chzn-select span9" name="grpIndReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_reviewers'); ?>">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="GrpReviewer" class="chzn-select span9" name="grpReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_reviewers'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
||||
<?php
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("individuals_in_groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpIndReviewers[]',
|
||||
'id'=>'GrpIndReviewers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_ind_reviewers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory || !$grp->getUsers()) print "<option value=\"".$grp->getID()."\" disabled=\"disabled\">".htmlspecialchars($grp->getName())."</option>";
|
||||
else print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
$option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
|
||||
if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
|
||||
$options[] = $option;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($reviewStatus as $r) {
|
||||
if($r['type'] == 1) {
|
||||
|
@ -364,8 +394,9 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = array('', '');
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("GrpReviewer", $tmp);
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpReviewers", $tmp));
|
||||
}
|
||||
/* List all mandatory groups of reviewers */
|
||||
if($res) {
|
||||
|
@ -377,11 +408,22 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
if($tmp) {
|
||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> ';
|
||||
echo implode(', ', $tmp);
|
||||
echo "</div>\n";
|
||||
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
}
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpReviewers[]',
|
||||
'id'=>'GrpReviewers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_reviewers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
/* Check for mandatory reviewer group without access */
|
||||
foreach($res as $r) {
|
||||
|
@ -393,73 +435,72 @@ $(document).ready(function() {
|
|||
}
|
||||
if(!$hasAccess) {
|
||||
$noAccessGroup = $dms->getGroup($r['reviewerGroupID']);
|
||||
echo "<div class=\"alert alert-warning\">".getMLText("mandatory_reviewergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName())))."</div>";
|
||||
$this->warningMsg(getMLText("mandatory_reviewergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<?php $this->contentSubHeading(getMLText("assign_approvers")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="IndApprover" class="chzn-select span9" name="indApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_approvers'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
|
||||
<?php
|
||||
$res=$user->getMandatoryApprovers();
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
}
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory) print "<option value=\"". $usr->getID() ."\" disabled='disabled'>". htmlspecialchars($usr->getFullName())."</option>";
|
||||
else print "<option value=\"". $usr->getID() ."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($approvalStatus as $r) {
|
||||
if($r['type'] == 0) {
|
||||
if($res) {
|
||||
$mandatory=false;
|
||||
foreach ($res as $rr)
|
||||
if ($rr['approverUserID']==$r['required']) {
|
||||
$mandatory=true;
|
||||
}
|
||||
if(!$mandatory)
|
||||
$tmp[] = $r['required'];
|
||||
} else {
|
||||
$this->contentSubHeading(getMLText("assign_approvers"));
|
||||
$options = array();
|
||||
$res=$user->getMandatoryApprovers();
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||
|
||||
$option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
|
||||
if ($mandatory) $option[] = array(array('disabled', 'disabled'));
|
||||
$options[] = $option;
|
||||
}
|
||||
$tmp = array();
|
||||
foreach($approvalStatus as $r) {
|
||||
if($r['type'] == 0) {
|
||||
if($res) {
|
||||
$mandatory=false;
|
||||
foreach ($res as $rr)
|
||||
if ($rr['approverUserID']==$r['required']) {
|
||||
$mandatory=true;
|
||||
}
|
||||
if(!$mandatory)
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
} else {
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = array();
|
||||
if($tmp) {
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndApprovers", $tmp));
|
||||
}
|
||||
/* List all mandatory approvers */
|
||||
if($res) {
|
||||
$tmp = array();
|
||||
foreach ($res as $r) {
|
||||
if($r['approverUserID'] > 0) {
|
||||
$u = $dms->getUser($r['approverUserID']);
|
||||
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
||||
}
|
||||
}
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("IndApprover", $tmp);
|
||||
}
|
||||
/* List all mandatory approvers */
|
||||
if($res) {
|
||||
$tmp = array();
|
||||
foreach ($res as $r) {
|
||||
if($r['approverUserID'] > 0) {
|
||||
$u = $dms->getUser($r['approverUserID']);
|
||||
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
||||
}
|
||||
}
|
||||
if($tmp) {
|
||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> ';
|
||||
echo implode(', ', $tmp);
|
||||
echo "</div>\n";
|
||||
}
|
||||
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->formField(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'indApprovers[]',
|
||||
'id'=>'IndApprovers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_approvers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
/* Check for mandatory approvers without access */
|
||||
foreach($res as $r) {
|
||||
|
@ -471,46 +512,39 @@ $(document).ready(function() {
|
|||
}
|
||||
if(!$hasAccess) {
|
||||
$noAccessUser = $dms->getUser($r['approverUserID']);
|
||||
echo "<div class=\"alert alert-warning\">".getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")")))."</div>";
|
||||
$this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals_in_groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class="chzn-select span9" name="grpIndApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_approvers'); ?>">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
print "<option value=\"". $grp->getID() ."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="GrpApprover" class="chzn-select span9" name="grpApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_approvers'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
||||
<?php
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("individuals_in_groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpIndApprovers[]',
|
||||
'id'=>'GrpIndApprovers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_ind_approvers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
$mandatory=false;
|
||||
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true;
|
||||
|
||||
if ($mandatory || !$grp->getUsers()) print "<option value=\"". $grp->getID() ."\" disabled=\"disabled\">".htmlspecialchars($grp->getName())."</option>";
|
||||
else print "<option value=\"". $grp->getID() ."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
$option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
|
||||
if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
|
||||
|
||||
$options[] = $option;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($approvalStatus as $r) {
|
||||
if($r['type'] == 1) {
|
||||
|
@ -527,8 +561,9 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = array('', '');
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("GrpApprover", $tmp);
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpApprovers", $tmp));
|
||||
}
|
||||
/* List all mandatory groups of approvers */
|
||||
if($res) {
|
||||
|
@ -540,12 +575,24 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
if($tmp) {
|
||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> ';
|
||||
echo implode(', ', $tmp);
|
||||
echo "</div>\n";
|
||||
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->formField(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpApprovers[]',
|
||||
'id'=>'GrpApprovers',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_approvers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
/* Check for mandatory approver groups without access */
|
||||
foreach($res as $r) {
|
||||
if ($r['approverGroupID']) {
|
||||
|
@ -556,138 +603,90 @@ $(document).ready(function() {
|
|||
}
|
||||
if(!$hasAccess) {
|
||||
$noAccessGroup = $dms->getGroup($r['approverGroupID']);
|
||||
echo "<div class=\"alert alert-warning\">".getMLText("mandatory_approvergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName())))."</div>";
|
||||
$this->warningMsg(getMLText("mandatory_approvergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$mandatoryworkflow = $user->getMandatoryWorkflow();
|
||||
if($mandatoryworkflow) {
|
||||
?>
|
||||
<?php echo $mandatoryworkflow->getName(); ?>
|
||||
<input type="hidden" name="workflow" value="<?php echo $mandatoryworkflow->getID(); ?>">
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
||||
<?php
|
||||
$workflows=$dms->getAllWorkflows();
|
||||
print "<option value=\"\">"."</option>";
|
||||
foreach ($workflows as $workflow) {
|
||||
print "<option value=\"".$workflow->getID()."\"";
|
||||
if($mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID())
|
||||
echo " selected=\"selected\"";
|
||||
print ">". htmlspecialchars($workflow->getName())."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php $this->warningMsg(getMLText("add_doc_workflow_warning")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if($enablereceiptworkflow) {
|
||||
$docAccess = $folder->getReadAccessList();
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php $this->contentSubHeading(getMLText("assign_recipients")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="IndRecipient" class="chzn-select span9" name="indRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_recipients'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
|
||||
<?php
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfreceipt && $usr->getID()==$user->getID()) continue;
|
||||
print "<option value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($receiptStatus as $r) {
|
||||
if($r['type'] == 0) {
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
}
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("IndRecipient", $tmp);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("individuals_in_groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select class="chzn-select span9" name="grpIndRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_recipients'); ?>">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
$this->warningMsg(getMLText("add_doc_reviewer_approver_warning"));
|
||||
}
|
||||
if($enablereceiptworkflow) {
|
||||
$options = array();
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfreceipt && $usr->getID()==$user->getID()) continue;
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()));
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select id="GrpRecipient" class="chzn-select span9" name="grpRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_recipients'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
||||
<?php
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
||||
$tmp = array();
|
||||
foreach($receiptStatus as $r) {
|
||||
if($r['type'] == 0) {
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$tmp = array();
|
||||
foreach($receiptStatus as $r) {
|
||||
if($r['type'] == 1) {
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
}
|
||||
if($tmp) {
|
||||
$this->printSelectPresetButtonHtml("GrpRecipient", $tmp);
|
||||
}
|
||||
$fieldwrap = array();
|
||||
if($tmp) {
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndRecipient", $tmp));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("assign_recipients"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'indRecipients[]',
|
||||
'id'=>'IndRecipient',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_recipients')), array('data-no_results_text', getMLText('unknown_owner'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("individuals_in_groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpIndRecipients[]',
|
||||
'id'=>'GrpIndRecipient',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_ind_recipients'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||
}
|
||||
$tmp = array();
|
||||
foreach($receiptStatus as $r) {
|
||||
if($r['type'] == 1) {
|
||||
$tmp[] = $r['required'];
|
||||
}
|
||||
}
|
||||
$fieldwrap = array();
|
||||
if($tmp) {
|
||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpRecipient", $tmp));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("assign_recipients"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'grpRecipients[]',
|
||||
'id'=>'GrpRecipient',
|
||||
'class'=>'chzn-select',
|
||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_recipients')), array('data-no_results_text', getMLText('unknown_owner'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
),
|
||||
array('field_wrap'=>$fieldwrap)
|
||||
);
|
||||
|
||||
}
|
||||
$this->formSubmit(getMLText('checkin_document'));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" class="btn" value="<?php printMLText("checkin_document")?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue
Block a user