mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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 {
|
||||
if($workflowmode == 'traditional') {
|
||||
$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();
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
|
@ -417,25 +430,10 @@ $(document).ready(function() {
|
|||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_reviewers'))),
|
||||
'multiple'=>true,
|
||||
'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 */
|
||||
foreach($res as $r) {
|
||||
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();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
|
@ -469,23 +478,9 @@ $(document).ready(function() {
|
|||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_reviewers'))),
|
||||
'multiple'=>true,
|
||||
'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 */
|
||||
foreach($res as $r) {
|
||||
if ($r['reviewerGroupID']) {
|
||||
|
@ -503,8 +498,19 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
$this->contentSubHeading(getMLText("assign_approvers"));
|
||||
$options = array();
|
||||
$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) {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
|
||||
|
@ -524,39 +530,35 @@ $(document).ready(function() {
|
|||
'attributes'=>array(array('data-placeholder', getMLText('select_ind_approvers'))),
|
||||
'multiple'=>true,
|
||||
'options'=>$options
|
||||
)
|
||||
),
|
||||
array('field_wrap'=>array('', ($tmp ? '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp).'</div>' : '')))
|
||||
);
|
||||
|
||||
/* 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().')');
|
||||
}
|
||||
/* Check for mandatory approvers without access */
|
||||
foreach($res as $r) {
|
||||
if($r['approverUserID']) {
|
||||
$hasAccess = false;
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if ($r['approverUserID']==$usr->getID())
|
||||
$hasAccess = true;
|
||||
}
|
||||
if($tmp) {
|
||||
echo '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> ';
|
||||
echo implode(', ', $tmp);
|
||||
echo "</div>\n";
|
||||
if(!$hasAccess) {
|
||||
$noAccessUser = $dms->getUser($r['approverUserID']);
|
||||
$this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for mandatory approvers without access */
|
||||
foreach($res as $r) {
|
||||
if($r['approverUserID']) {
|
||||
$hasAccess = false;
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if ($r['approverUserID']==$usr->getID())
|
||||
$hasAccess = true;
|
||||
}
|
||||
if(!$hasAccess) {
|
||||
$noAccessUser = $dms->getUser($r['approverUserID']);
|
||||
$this->warningMsg(getMLText("mandatory_approver_no_access", array('user'=>htmlspecialchars($noAccessUser->getFullName()." (".$noAccessUser->getLogin().")"))));
|
||||
}
|
||||
/* 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
$options = array();
|
||||
foreach ($docAccess["groups"] as $grp) {
|
||||
|
||||
|
@ -577,23 +579,9 @@ $(document).ready(function() {
|
|||
'attributes'=>array(array('data-placeholder', getMLText('select_grp_approvers'))),
|
||||
'multiple'=>true,
|
||||
'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 */
|
||||
foreach($res as $r) {
|
||||
|
|
|
@ -374,10 +374,24 @@ console.log(element);
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = '';
|
||||
$fieldwrap = array();
|
||||
if($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(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
|
@ -392,22 +406,6 @@ console.log(element);
|
|||
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 */
|
||||
foreach($res as $r) {
|
||||
if($r['reviewerUserID']) {
|
||||
|
@ -448,10 +446,23 @@ console.log(element);
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = '';
|
||||
$fieldwrap = array();
|
||||
if($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(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
|
@ -466,21 +477,6 @@ console.log(element);
|
|||
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 */
|
||||
foreach($res as $r) {
|
||||
if ($r['reviewerGroupID']) {
|
||||
|
@ -526,10 +522,24 @@ console.log(element);
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = '';
|
||||
$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) {
|
||||
$fieldwrap[1] .= '<div class="mandatories"><span>'.getMLText('mandatory_approvers').':</span> '.implode(', ', $tmp)."</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->formField(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
|
@ -544,22 +554,6 @@ console.log(element);
|
|||
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 */
|
||||
foreach($res as $r) {
|
||||
if($r['approverUserID']) {
|
||||
|
@ -602,10 +596,24 @@ console.log(element);
|
|||
}
|
||||
}
|
||||
}
|
||||
$fieldwrap = '';
|
||||
$fieldwrap = array();
|
||||
if($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(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
|
@ -620,22 +628,6 @@ console.log(element);
|
|||
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 */
|
||||
foreach($res as $r) {
|
||||
if ($r['approverGroupID']) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user