-
-
- : |
-
-
- |
-
-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;
- }
-?>
-
- : |
-
-
- |
-
- >
- : |
-
-
-
-
-
- |
-
-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 "";
- echo "".$arr[0].": | ";
- echo "".$arr[1]." | ";
- echo "
";
+ } 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 {
-?>
-
- getName()); ?>: |
- printAttributeEditField($attrdef, '', 'attributes') ?>
-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));
- }
-?> |
-
-getReadAccessList($enableadminrevapp, $enableownerrevapp);
- if($workflowmode != 'traditional_only_approval') {
-?>
-
-
- contentSubHeading(getMLText("assign_reviewers")); ?>
- |
-
-
-
- :
- |
-
-
-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 ' '.getMLText('mandatory_reviewers').': ';
- echo implode(', ', $tmp);
- echo " \n";
+ if(isset($fieldwrap[1]))
+ $fieldwrap[1] .= ''.getMLText('mandatory_reviewers').': '.implode(', ', $tmp)." \n";
+ else
+ $fieldwrap[1] = ''.getMLText('mandatory_reviewers').': '.implode(', ', $tmp)." \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 "".getMLText("mandatory_reviewer_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")")))." ";
+ $this->warningMsg(getMLText("mandatory_reviewer_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
}
}
}
-?>
- |
-
-
-
- :
- |
-
-
- |
-
-
-
- :
- |
-
-
-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 ' '.getMLText('mandatory_reviewergroups').': ';
- echo implode(', ', $tmp);
- echo " \n";
+ $fieldwrap[1] .= ''.getMLText('mandatory_reviewergroups').': '.implode(', ', $tmp)." \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 "".getMLText("mandatory_reviewergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName())))." ";
+ $this->warningMsg(getMLText("mandatory_reviewergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName()))));
}
}
}
-?>
- |
-
-
-
-
- contentSubHeading(getMLText("assign_approvers")); ?>
- |
-
-
-
- :
- |
-
-
-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 ' '.getMLText('mandatory_approvers').': ';
- echo implode(', ', $tmp);
- echo " \n";
- }
+ $fieldwrap[1] .= ''.getMLText('mandatory_approvers').': '.implode(', ', $tmp)." \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 "".getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")")))." ";
+ $this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
}
}
}
-?>
- |
-
-
-
- :
- |
-
-
- |
-
-
-
- :
- |
-
-
-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 ' '.getMLText('mandatory_approvergroups').': ';
- echo implode(', ', $tmp);
- echo " \n";
+ $fieldwrap[1] .= ''.getMLText('mandatory_approvergroups').': '.implode(', ', $tmp)." \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 "".getMLText("mandatory_approvergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName())))." ";
+ $this->warningMsg(getMLText("mandatory_approvergroup_no_access", array('group'=>htmlspecialchars($noAccessGroup->getName()))));
}
}
}
-?>
- |
-
-
- |
-
-
-
-
- :
- |
-
-getMandatoryWorkflow();
- if($mandatoryworkflow) {
-?>
- getName(); ?>
-
-
-
-
- |
-
-
-
- warningMsg(getMLText("add_doc_workflow_warning")); ?>
- |
-
-getReadAccessList();
-?>
-
-
- contentSubHeading(getMLText("assign_recipients")); ?>
- |
-
-
-
- :
- |
-
-
-printSelectPresetButtonHtml("IndRecipient", $tmp);
- }
-?>
- |
-
-
-
- :
- |
-
-
- |
-
-
-
- :
- |
-
-
-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'));
?>
- |
-
-
-
- |
- "> |
-
-