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('folder', $folder);
|
||||||
$view->setParam('document', $document);
|
$view->setParam('document', $document);
|
||||||
$view->setParam('strictformcheck', $settings->_strictFormCheck);
|
$view->setParam('strictformcheck', $settings->_strictFormCheck);
|
||||||
|
$view->setParam('nodocumentformfields', $settings->_noDocumentFormFields);
|
||||||
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
|
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
|
||||||
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
|
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
|
||||||
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
|
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
|
||||||
|
|
|
@ -80,6 +80,7 @@ $(document).ready(function() {
|
||||||
$folder = $this->params['folder'];
|
$folder = $this->params['folder'];
|
||||||
$document = $this->params['document'];
|
$document = $this->params['document'];
|
||||||
$strictformcheck = $this->params['strictformcheck'];
|
$strictformcheck = $this->params['strictformcheck'];
|
||||||
|
$nodocumentformfields = $this->params['nodocumentformfields'];
|
||||||
$enablelargefileupload = $this->params['enablelargefileupload'];
|
$enablelargefileupload = $this->params['enablelargefileupload'];
|
||||||
$enableadminrevapp = $this->params['enableadminrevapp'];
|
$enableadminrevapp = $this->params['enableadminrevapp'];
|
||||||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||||
|
@ -157,118 +158,137 @@ $(document).ready(function() {
|
||||||
$this->contentContainerStart();
|
$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(); ?>">
|
<input type="hidden" name="documentid" value="<?php print $document->getID(); ?>">
|
||||||
<table class="table-condensed">
|
<?php
|
||||||
|
if(!$nodocumentformfields || !in_array('version_comment', $nodocumentformfields)) {
|
||||||
<tr>
|
$this->formField(
|
||||||
<td><?php printMLText("comment");?>:</td>
|
getMLText("comment"),
|
||||||
<td class="standardText">
|
array(
|
||||||
<textarea name="comment" rows="4" cols="80"<?php echo $strictformcheck ? ' required' : ''; ?>></textarea>
|
'element'=>'textarea',
|
||||||
</td>
|
'name'=>'comment',
|
||||||
</tr>
|
'rows'=>4,
|
||||||
<?php
|
'cols'=>80
|
||||||
if($presetexpiration) {
|
)
|
||||||
if(!($expts = strtotime($presetexpiration)))
|
);
|
||||||
$expts = false;
|
}
|
||||||
} else {
|
if(!$nodocumentformfields || !in_array('expires', $nodocumentformfields)) {
|
||||||
|
if($presetexpiration) {
|
||||||
|
if(!($expts = strtotime($presetexpiration)))
|
||||||
$expts = false;
|
$expts = false;
|
||||||
}
|
} else {
|
||||||
?>
|
$expts = false;
|
||||||
<tr>
|
}
|
||||||
<td><?php printMLText("preset_expires");?>:</td>
|
$options = array();
|
||||||
<td>
|
$options[] = array('never', getMLText('does_not_expire'));
|
||||||
<select class="span6" name="presetexpdate" id="presetexpdate">
|
$options[] = array('date', getMLText('expire_by_date'), $expts);
|
||||||
<option value="never"><?php printMLText('does_not_expire');?></option>
|
$options[] = array('1w', getMLText('expire_in_1w'));
|
||||||
<option value="date"<?php echo ($expts != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option>
|
$options[] = array('1m', getMLText('expire_in_1m'));
|
||||||
<option value="1w"><?php printMLText('expire_in_1w');?></option>
|
$options[] = array('1y', getMLText('expire_in_1y'));
|
||||||
<option value="1m"><?php printMLText('expire_in_1m');?></option>
|
$options[] = array('2y', getMLText('expire_in_2y'));
|
||||||
<option value="1y"><?php printMLText('expire_in_1y');?></option>
|
$this->formField(
|
||||||
<option value="2y"><?php printMLText('expire_in_2y');?></option>
|
getMLText("preset_expires"),
|
||||||
</select>
|
array(
|
||||||
</td>
|
'element'=>'select',
|
||||||
</tr>
|
'id'=>'presetexpdate',
|
||||||
<tr id="control_expdate" <?php echo ($expts == false ? 'style="display: none;"' : ''); ?>>
|
'name'=>'presetexpdate',
|
||||||
<td><?php printMLText("expires");?>:</td>
|
'options'=>$options
|
||||||
<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) : ''); ?>">
|
$this->formField(
|
||||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
getMLText("expires"),
|
||||||
</span>
|
$this->getDateChooser(($expts ? date('Y-m-d', $expts) : ''), "expdate", $this->params['session']->getLanguage())
|
||||||
</td>
|
);
|
||||||
</tr>
|
}
|
||||||
<?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);
|
||||||
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
|
if(is_array($arr)) {
|
||||||
if(is_array($arr)) {
|
if($arr)
|
||||||
if($arr) {
|
$this->formField($arr[0], $arr[1]);
|
||||||
echo "<tr>";
|
} elseif(is_string($arr)) {
|
||||||
echo "<td>".$arr[0].":</td>";
|
echo $arr;
|
||||||
echo "<td>".$arr[1]."</td>";
|
} else {
|
||||||
echo "</tr>";
|
$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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
$arrs = $this->callHook('addDocumentContentAttributes', $folder);
|
||||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
if(is_array($arrs)) {
|
||||||
// Retrieve a list of all users and groups that have review / approve
|
foreach($arrs as $arr) {
|
||||||
// privileges.
|
$this->formField($arr[0], $arr[1]);
|
||||||
$docAccess = $folder->getReadAccessList($enableadminrevapp, $enableownerrevapp);
|
}
|
||||||
if($workflowmode != 'traditional_only_approval') {
|
} elseif(is_string($arrs)) {
|
||||||
?>
|
echo $arrs;
|
||||||
<tr>
|
}
|
||||||
<td colspan="2">
|
|
||||||
<?php $this->contentSubHeading(getMLText("assign_reviewers")); ?>
|
if($workflowmode == 'advanced') {
|
||||||
</td>
|
$mandatoryworkflows = $user->getMandatoryWorkflows();
|
||||||
</tr>
|
if($mandatoryworkflows) {
|
||||||
<tr>
|
if(count($mandatoryworkflows) == 1) {
|
||||||
<td>
|
$this->formField(
|
||||||
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
|
getMLText("workflow"),
|
||||||
</td>
|
htmlspecialchars($mandatoryworkflows[0]->getName()).'<input type="hidden" name="workflow" value="'.$mandatoryworkflows[0]->getID().'">'
|
||||||
<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'); ?>">
|
} else {
|
||||||
<?php
|
$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();
|
$res=$user->getMandatoryReviewers();
|
||||||
|
$options = array();
|
||||||
foreach ($docAccess["users"] as $usr) {
|
foreach ($docAccess["users"] as $usr) {
|
||||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||||
$mandatory=false;
|
$mandatory=false;
|
||||||
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
|
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>";
|
$option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
|
||||||
else print "<option value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
if ($mandatory) $option[] = array(array('disabled', 'disabled'));
|
||||||
|
$options[] = $option;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
<?php
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
foreach($reviewStatus as $r) {
|
foreach($reviewStatus as $r) {
|
||||||
if($r['type'] == 0) {
|
if($r['type'] == 0) {
|
||||||
if($res) {
|
if($res) {
|
||||||
$mandatory=false;
|
$mandatory=false;
|
||||||
foreach ($res as $rr)
|
foreach ($res as $rr)
|
||||||
if ($rr['reviewerUserID']==$r['required']) {
|
if ($rr['reviewerUserID']==$r['required']) {
|
||||||
|
@ -281,8 +301,9 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$fieldwrap = array();
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$this->printSelectPresetButtonHtml("IndReviewer", $tmp);
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndReviewers", $tmp));
|
||||||
}
|
}
|
||||||
/* List all mandatory reviewers */
|
/* List all mandatory reviewers */
|
||||||
if($res) {
|
if($res) {
|
||||||
|
@ -294,11 +315,27 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> ';
|
if(isset($fieldwrap[1]))
|
||||||
echo implode(', ', $tmp);
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
echo "</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 */
|
/* Check for mandatory reviewer without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
if($r['reviewerUserID']) {
|
if($r['reviewerUserID']) {
|
||||||
|
@ -309,45 +346,38 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
if(!$hasAccess) {
|
if(!$hasAccess) {
|
||||||
$noAccessUser = $dms->getUser($r['reviewerUserID']);
|
$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>
|
$options = array();
|
||||||
</tr>
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
<tr>
|
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||||
<td>
|
}
|
||||||
<div class="cbSelectTitle"><?php printMLText("individuals_in_groups");?>:</div>
|
$this->formField(
|
||||||
</td>
|
getMLText("individuals_in_groups"),
|
||||||
<td>
|
array(
|
||||||
<select class="chzn-select span9" name="grpIndReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_reviewers'); ?>">
|
'element'=>'select',
|
||||||
<?php
|
'name'=>'grpIndReviewers[]',
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
'id'=>'GrpIndReviewers',
|
||||||
print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
'class'=>'chzn-select',
|
||||||
}
|
'attributes'=>array(array('data-placeholder', getMLText('select_grp_ind_reviewers'))),
|
||||||
?>
|
'multiple'=>true,
|
||||||
</select>
|
'options'=>$options
|
||||||
</td>
|
)
|
||||||
</tr>
|
);
|
||||||
<tr>
|
|
||||||
<td>
|
$options = array();
|
||||||
<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
|
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
|
|
||||||
$mandatory=false;
|
$mandatory=false;
|
||||||
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
|
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>";
|
$option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
|
||||||
else print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>";
|
if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
|
||||||
|
$options[] = $option;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
<?php
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
foreach($reviewStatus as $r) {
|
foreach($reviewStatus as $r) {
|
||||||
if($r['type'] == 1) {
|
if($r['type'] == 1) {
|
||||||
|
@ -364,8 +394,9 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$fieldwrap = array('', '');
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$this->printSelectPresetButtonHtml("GrpReviewer", $tmp);
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpReviewers", $tmp));
|
||||||
}
|
}
|
||||||
/* List all mandatory groups of reviewers */
|
/* List all mandatory groups of reviewers */
|
||||||
if($res) {
|
if($res) {
|
||||||
|
@ -377,11 +408,22 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> ';
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</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 */
|
/* Check for mandatory reviewer group without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
|
@ -393,73 +435,72 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
if(!$hasAccess) {
|
if(!$hasAccess) {
|
||||||
$noAccessGroup = $dms->getGroup($r['reviewerGroupID']);
|
$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;
|
$this->contentSubHeading(getMLText("assign_approvers"));
|
||||||
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
$options = array();
|
||||||
|
$res=$user->getMandatoryApprovers();
|
||||||
if ($mandatory) print "<option value=\"". $usr->getID() ."\" disabled='disabled'>". htmlspecialchars($usr->getFullName())."</option>";
|
foreach ($docAccess["users"] as $usr) {
|
||||||
else print "<option value=\"". $usr->getID() ."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||||
}
|
|
||||||
?>
|
$mandatory=false;
|
||||||
</select>
|
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
|
||||||
<?php
|
|
||||||
$tmp = array();
|
$option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
|
||||||
foreach($approvalStatus as $r) {
|
if ($mandatory) $option[] = array(array('disabled', 'disabled'));
|
||||||
if($r['type'] == 0) {
|
$options[] = $option;
|
||||||
if($res) {
|
}
|
||||||
$mandatory=false;
|
$tmp = array();
|
||||||
foreach ($res as $rr)
|
foreach($approvalStatus as $r) {
|
||||||
if ($rr['approverUserID']==$r['required']) {
|
if($r['type'] == 0) {
|
||||||
$mandatory=true;
|
if($res) {
|
||||||
}
|
$mandatory=false;
|
||||||
if(!$mandatory)
|
foreach ($res as $rr)
|
||||||
$tmp[] = $r['required'];
|
if ($rr['approverUserID']==$r['required']) {
|
||||||
} else {
|
$mandatory=true;
|
||||||
|
}
|
||||||
|
if(!$mandatory)
|
||||||
$tmp[] = $r['required'];
|
$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) {
|
if($tmp) {
|
||||||
$this->printSelectPresetButtonHtml("IndApprover", $tmp);
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
}
|
|
||||||
/* 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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$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 */
|
/* Check for mandatory approvers without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
|
@ -471,46 +512,39 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
if(!$hasAccess) {
|
if(!$hasAccess) {
|
||||||
$noAccessUser = $dms->getUser($r['approverUserID']);
|
$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>
|
$options = array();
|
||||||
</tr>
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
<tr>
|
$options[] = array($grp->getID(), htmlspecialchars($grp->getName()));
|
||||||
<td>
|
}
|
||||||
<div class="cbSelectTitle"><?php printMLText("individuals_in_groups");?>:</div>
|
$this->formField(
|
||||||
</td>
|
getMLText("individuals_in_groups"),
|
||||||
<td>
|
array(
|
||||||
<select class="chzn-select span9" name="grpIndApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_approvers'); ?>">
|
'element'=>'select',
|
||||||
<?php
|
'name'=>'grpIndApprovers[]',
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
'id'=>'GrpIndApprovers',
|
||||||
print "<option value=\"". $grp->getID() ."\">".htmlspecialchars($grp->getName())."</option>";
|
'class'=>'chzn-select',
|
||||||
}
|
'attributes'=>array(array('data-placeholder', getMLText('select_grp_ind_approvers'))),
|
||||||
?>
|
'multiple'=>true,
|
||||||
</select>
|
'options'=>$options
|
||||||
</td>
|
)
|
||||||
</tr>
|
);
|
||||||
<tr>
|
|
||||||
<td>
|
$options = array();
|
||||||
<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
|
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
|
|
||||||
$mandatory=false;
|
$mandatory=false;
|
||||||
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true;
|
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>";
|
$option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
|
||||||
else print "<option value=\"". $grp->getID() ."\">".htmlspecialchars($grp->getName())."</option>";
|
if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
|
||||||
|
|
||||||
|
$options[] = $option;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
<?php
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
foreach($approvalStatus as $r) {
|
foreach($approvalStatus as $r) {
|
||||||
if($r['type'] == 1) {
|
if($r['type'] == 1) {
|
||||||
|
@ -527,8 +561,9 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$fieldwrap = array('', '');
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$this->printSelectPresetButtonHtml("GrpApprover", $tmp);
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpApprovers", $tmp));
|
||||||
}
|
}
|
||||||
/* List all mandatory groups of approvers */
|
/* List all mandatory groups of approvers */
|
||||||
if($res) {
|
if($res) {
|
||||||
|
@ -540,12 +575,24 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> ';
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</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 */
|
/* Check for mandatory approver groups without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
if ($r['approverGroupID']) {
|
if ($r['approverGroupID']) {
|
||||||
|
@ -556,138 +603,90 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
if(!$hasAccess) {
|
if(!$hasAccess) {
|
||||||
$noAccessGroup = $dms->getGroup($r['approverGroupID']);
|
$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()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
$this->warningMsg(getMLText("add_doc_reviewer_approver_warning"));
|
||||||
</td>
|
}
|
||||||
</tr>
|
if($enablereceiptworkflow) {
|
||||||
<tr>
|
$options = array();
|
||||||
<td colspan="2"><div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div></td>
|
foreach ($docAccess["users"] as $usr) {
|
||||||
</tr>
|
if (!$enableselfreceipt && $usr->getID()==$user->getID()) continue;
|
||||||
<?php
|
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()));
|
||||||
} 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>";
|
|
||||||
}
|
}
|
||||||
?>
|
$tmp = array();
|
||||||
</select>
|
foreach($receiptStatus as $r) {
|
||||||
</td>
|
if($r['type'] == 0) {
|
||||||
</tr>
|
$tmp[] = $r['required'];
|
||||||
<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>";
|
|
||||||
}
|
}
|
||||||
?>
|
}
|
||||||
</select>
|
$fieldwrap = array();
|
||||||
<?php
|
if($tmp) {
|
||||||
$tmp = array();
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndRecipient", $tmp));
|
||||||
foreach($receiptStatus as $r) {
|
}
|
||||||
if($r['type'] == 1) {
|
$this->formField(
|
||||||
$tmp[] = $r['required'];
|
getMLText("assign_recipients"),
|
||||||
}
|
array(
|
||||||
}
|
'element'=>'select',
|
||||||
if($tmp) {
|
'name'=>'indRecipients[]',
|
||||||
$this->printSelectPresetButtonHtml("GrpRecipient", $tmp);
|
'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>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue
Block a user