mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
place mandatory reviewers/approvers right below input field
This commit is contained in:
parent
3e7fa6e1c1
commit
9333d9ebf6
|
@ -398,6 +398,19 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
if($workflowmode == 'traditional') {
|
if($workflowmode == 'traditional') {
|
||||||
$this->contentSubHeading(getMLText("assign_reviewers"));
|
$this->contentSubHeading(getMLText("assign_reviewers"));
|
||||||
|
|
||||||
|
/* List all mandatory reviewers */
|
||||||
|
$res=$user->getMandatoryReviewers();
|
||||||
|
if($res) {
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if($r['reviewerUserID'] > 0) {
|
||||||
|
$u = $dms->getUser($r['reviewerUserID']);
|
||||||
|
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$options = array();
|
$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;
|
||||||
|
@ -417,25 +430,10 @@ $(document).ready(function() {
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_reviewers'))),
|
'attributes'=>array(array('data-placeholder', getMLText('select_ind_reviewers'))),
|
||||||
'multiple'=>true,
|
'multiple'=>true,
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
),
|
||||||
|
array('field_wrap'=>array('', ($tmp ? '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> '.implode(', ', $tmp).'</div>' : '')))
|
||||||
);
|
);
|
||||||
|
|
||||||
/* List all mandatory reviewers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['reviewerUserID'] > 0) {
|
|
||||||
$u = $dms->getUser($r['reviewerUserID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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']) {
|
||||||
|
@ -450,6 +448,17 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* List all mandatory groups of reviewers */
|
||||||
|
if($res) {
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if($r['reviewerGroupID'] > 0) {
|
||||||
|
$u = $dms->getGroup($r['reviewerGroupID']);
|
||||||
|
$tmp[] = htmlspecialchars($u->getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$options = array();
|
$options = array();
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
|
|
||||||
|
@ -469,23 +478,9 @@ $(document).ready(function() {
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_reviewers'))),
|
'attributes'=>array(array('data-placeholder', getMLText('select_grp_reviewers'))),
|
||||||
'multiple'=>true,
|
'multiple'=>true,
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
),
|
||||||
|
array('field_wrap'=>array('', ($tmp ? '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> '.implode(', ', $tmp).'</div>' : '')))
|
||||||
);
|
);
|
||||||
/* List all mandatory groups of reviewers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['reviewerGroupID'] > 0) {
|
|
||||||
$u = $dms->getGroup($r['reviewerGroupID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Check for mandatory reviewer group without access */
|
/* Check for mandatory reviewer group without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
if ($r['reviewerGroupID']) {
|
if ($r['reviewerGroupID']) {
|
||||||
|
@ -503,8 +498,19 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentSubHeading(getMLText("assign_approvers"));
|
$this->contentSubHeading(getMLText("assign_approvers"));
|
||||||
$options = array();
|
|
||||||
$res=$user->getMandatoryApprovers();
|
$res=$user->getMandatoryApprovers();
|
||||||
|
/* 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().')');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$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;
|
||||||
|
|
||||||
|
@ -524,39 +530,35 @@ $(document).ready(function() {
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_approvers'))),
|
'attributes'=>array(array('data-placeholder', getMLText('select_ind_approvers'))),
|
||||||
'multiple'=>true,
|
'multiple'=>true,
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
),
|
||||||
|
array('field_wrap'=>array('', ($tmp ? '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp).'</div>' : '')))
|
||||||
);
|
);
|
||||||
|
|
||||||
/* List all mandatory approvers */
|
/* Check for mandatory approvers without access */
|
||||||
if($res) {
|
foreach($res as $r) {
|
||||||
$tmp = array();
|
if($r['approverUserID']) {
|
||||||
foreach ($res as $r) {
|
$hasAccess = false;
|
||||||
if($r['approverUserID'] > 0) {
|
foreach ($docAccess["users"] as $usr) {
|
||||||
$u = $dms->getUser($r['approverUserID']);
|
if ($r['approverUserID']==$usr->getID())
|
||||||
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
$hasAccess = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if($tmp) {
|
if(!$hasAccess) {
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> ';
|
$noAccessUser = $dms->getUser($r['approverUserID']);
|
||||||
echo implode(', ', $tmp);
|
$this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
||||||
echo "</div>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for mandatory approvers without access */
|
/* List all mandatory groups of approvers */
|
||||||
foreach($res as $r) {
|
if($res) {
|
||||||
if($r['approverUserID']) {
|
$tmp = array();
|
||||||
$hasAccess = false;
|
foreach ($res as $r) {
|
||||||
foreach ($docAccess["users"] as $usr) {
|
if($r['approverGroupID'] > 0) {
|
||||||
if ($r['approverUserID']==$usr->getID())
|
$u = $dms->getGroup($r['approverGroupID']);
|
||||||
$hasAccess = true;
|
$tmp[] = htmlspecialchars($u->getName());
|
||||||
}
|
|
||||||
if(!$hasAccess) {
|
|
||||||
$noAccessUser = $dms->getUser($r['approverUserID']);
|
|
||||||
$this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$options = array();
|
$options = array();
|
||||||
foreach ($docAccess["groups"] as $grp) {
|
foreach ($docAccess["groups"] as $grp) {
|
||||||
|
|
||||||
|
@ -577,23 +579,9 @@ $(document).ready(function() {
|
||||||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_approvers'))),
|
'attributes'=>array(array('data-placeholder', getMLText('select_grp_approvers'))),
|
||||||
'multiple'=>true,
|
'multiple'=>true,
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
),
|
||||||
|
array('field_wrap'=>array('', ($tmp ? '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> '.implode(', ', $tmp).'</div>' : '')))
|
||||||
);
|
);
|
||||||
/* List all mandatory groups of approvers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['approverGroupID'] > 0) {
|
|
||||||
$u = $dms->getGroup($r['approverGroupID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for mandatory approver groups without access */
|
/* Check for mandatory approver groups without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
|
|
|
@ -374,10 +374,24 @@ console.log(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldwrap = '';
|
$fieldwrap = array();
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndReviewers", $tmp));
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndReviewers", $tmp));
|
||||||
}
|
}
|
||||||
|
/* List all mandatory reviewers */
|
||||||
|
if($res) {
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if($r['reviewerUserID'] > 0) {
|
||||||
|
$u = $dms->getUser($r['reviewerUserID']);
|
||||||
|
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($tmp) {
|
||||||
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("individuals"),
|
getMLText("individuals"),
|
||||||
array(
|
array(
|
||||||
|
@ -392,22 +406,6 @@ console.log(element);
|
||||||
array('field_wrap'=>$fieldwrap)
|
array('field_wrap'=>$fieldwrap)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* List all mandatory reviewers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['reviewerUserID'] > 0) {
|
|
||||||
$u = $dms->getUser($r['reviewerUserID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getFullName().' ('.$u->getLogin().')');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewers').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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']) {
|
||||||
|
@ -448,10 +446,23 @@ console.log(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldwrap = '';
|
$fieldwrap = array();
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpReviewers", $tmp));
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpReviewers", $tmp));
|
||||||
}
|
}
|
||||||
|
/* List all mandatory groups of reviewers */
|
||||||
|
if($res) {
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if($r['reviewerGroupID'] > 0) {
|
||||||
|
$u = $dms->getGroup($r['reviewerGroupID']);
|
||||||
|
$tmp[] = htmlspecialchars($u->getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($tmp) {
|
||||||
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("groups"),
|
getMLText("groups"),
|
||||||
array(
|
array(
|
||||||
|
@ -466,21 +477,6 @@ console.log(element);
|
||||||
array('field_wrap'=>$fieldwrap)
|
array('field_wrap'=>$fieldwrap)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* List all mandatory groups of reviewers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['reviewerGroupID'] > 0) {
|
|
||||||
$u = $dms->getGroup($r['reviewerGroupID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_reviewergroups').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Check for mandatory reviewer group without access */
|
/* Check for mandatory reviewer group without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
if ($r['reviewerGroupID']) {
|
if ($r['reviewerGroupID']) {
|
||||||
|
@ -526,10 +522,24 @@ console.log(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldwrap = '';
|
$fieldwrap = array();
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("IndApprovers", $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) {
|
||||||
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("individuals"),
|
getMLText("individuals"),
|
||||||
array(
|
array(
|
||||||
|
@ -544,22 +554,6 @@ console.log(element);
|
||||||
array('field_wrap'=>$fieldwrap)
|
array('field_wrap'=>$fieldwrap)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* 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";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for mandatory approvers without access */
|
/* Check for mandatory approvers without access */
|
||||||
foreach($res as $r) {
|
foreach($res as $r) {
|
||||||
if($r['approverUserID']) {
|
if($r['approverUserID']) {
|
||||||
|
@ -602,10 +596,24 @@ console.log(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fieldwrap = '';
|
$fieldwrap = array();
|
||||||
if($tmp) {
|
if($tmp) {
|
||||||
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpApprovers", $tmp));
|
$fieldwrap = array('', $this->getSelectPresetButtonHtml("GrpApprovers", $tmp));
|
||||||
}
|
}
|
||||||
|
/* List all mandatory groups of approvers */
|
||||||
|
if($res) {
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if($r['approverGroupID'] > 0) {
|
||||||
|
$u = $dms->getGroup($r['approverGroupID']);
|
||||||
|
$tmp[] = htmlspecialchars($u->getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($tmp) {
|
||||||
|
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("groups"),
|
getMLText("groups"),
|
||||||
array(
|
array(
|
||||||
|
@ -620,22 +628,6 @@ console.log(element);
|
||||||
array('field_wrap'=>$fieldwrap)
|
array('field_wrap'=>$fieldwrap)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* List all mandatory groups of approvers */
|
|
||||||
if($res) {
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($res as $r) {
|
|
||||||
if($r['approverGroupID'] > 0) {
|
|
||||||
$u = $dms->getGroup($r['approverGroupID']);
|
|
||||||
$tmp[] = htmlspecialchars($u->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($tmp) {
|
|
||||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvergroups').':</span> ';
|
|
||||||
echo implode(', ', $tmp);
|
|
||||||
echo "</div>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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']) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user