From c1d2b46b2e2103a2f45aff46ef6c4a6cabf5a708 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 28 Apr 2021 17:40:55 +0200 Subject: [PATCH] put list of open tasks into table --- .../class.RemoveUserFromProcesses.php | 182 +++++++----------- 1 file changed, 70 insertions(+), 112 deletions(-) diff --git a/views/bootstrap/class.RemoveUserFromProcesses.php b/views/bootstrap/class.RemoveUserFromProcesses.php index b590bcffc..e76f3bffe 100644 --- a/views/bootstrap/class.RemoveUserFromProcesses.php +++ b/views/bootstrap/class.RemoveUserFromProcesses.php @@ -35,10 +35,10 @@ class SeedDMS_View_RemoveUserFromProcesses extends SeedDMS_Theme_Style { $this->printClickDocumentJs(); ?> $(document).ready( function() { - $('body').on('click', 'label.checkbox', function(ev){ + $('body').on('click', 'label.checkbox, td span', function(ev){ ev.preventDefault(); $('#kkkk.ajax').data('action', $(this).data('action')); - $('#kkkk.ajax').trigger('update', {userid: $(this).data('userid'), task: $(this). data('task')}); + $('#kkkk.ajax').trigger('update', {userid: $(this).data('userid'), task: $(this).data('task')}); }); }); warningMsg(getMLText("confirm_rm_user_from_processes", array ("username" => htmlspecialchars($rmuser->getFullName())))); $this->rowStart(); $this->columnStart(4); -?> -
- - - -contentContainerStart(); $reviewStatus = $rmuser->getReviewStatus(); $tmpr = array(); $cr = array("-2"=>0, '-1'=>0, '0'=>0, '1'=>0); @@ -222,111 +215,77 @@ $(document).ready( function() { else $tmpa[$ai['status']] = array($ai); } -?> - -formField( - getMLText('reviews_not_touched', array('no_reviews' => count($tmpr["0"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[review][]', - 'value'=>'0', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); -?> - - -formField( - getMLText('reviews_accepted', array('no_reviews' => count($tmpr["1"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[approval][]', - 'value'=>'1', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); -?> - - -formField( - getMLText('reviews_rejected', array('no_reviews' => count($tmpr["-1"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[approval][]', - 'value'=>'-1', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); -?> - - -formField( - getMLText('approvals_not_touched', array('no_approvals' => count($tmpa["0"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[approval][]', - 'value'=>'0', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); + $out = array(); + if(isset($tmpr["0"])) { + $out[] = array( + '0', + 'review', + 'not_touched', + getMLText('reviews_not_touched', array('no_reviews' => count($tmpr["0"]))), + getMLText('reviews_not_touched_latest', array('no_reviews' => $cr["0"])) + ); + } + if(isset($tmpr["1"])) { + $out[] = array( + '1', + 'review', + 'accepted', + getMLText('reviews_accepted', array('no_reviews' => count($tmpr["1"]))), + getMLText('reviews_accepted_latest', array('no_reviews' => $cr["1"])) + ); + } + if(isset($tmpr["-1"])) { + $out[] = array( + '-1', + 'review', + 'rejected', + getMLText('reviews_rejected', array('no_reviews' => count($tmpr["-1"]))), + getMLText('reviews_rejected_latest', array('no_reviews' => $cr["-1"])) + ); + } + if(isset($tmpa["0"])) { + $out[] = array( + '0', + 'approval', + 'not_touched', + getMLText('approvals_not_touched', array('no_approvals' => count($tmpa["0"]))), + getMLText('approvals_not_touched_latest', array('no_approvals' => $ca["0"])) + ); + } + if(isset($tmpa["1"])) { + $out[] = array( + '1', + 'approval', + 'accepted', + getMLText('approvals_accepted', array('no_approvals' => count($tmpa["1"]))), + getMLText('approvals_accepted_latest', array('no_approvals' => $ca["1"])) + ); + } + if(isset($tmpa["-1"])) { + $out[] = array( + '-1', + 'approval', + 'rejected', + getMLText('approvals_rejected', array('no_approvals' => count($tmpa["-1"]))), + getMLText('approvals_rejected_latest', array('no_approvals' => $ca["-1"])) + ); + } + ?> - - -formField( - getMLText('approvals_accepted', array('no_approvals' => count($tmpa["1"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[approval][]', - 'value'=>'1', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); -?> - - -formField( - getMLText('approvals_rejected', array('no_approvals' => count($tmpa["-1"]))), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'name'=>'status[approval][]', - 'value'=>'-1', - 'checked'=>true - ), - array( - 'field_wrap' => array('") - ) - ); -?> - + + + + + + "; + foreach($out as $o) { + echo "".$o[3]."".$o[4]."getId()."\" data-task=\"".$o[1]."s_".$o[2]."\">"; + } + echo ""; + /* $options = array(); $allUsers = $dms->getAllUsers($sortusersinlist); @@ -345,7 +304,6 @@ $(document).ready( function() { ) ); */ - $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('rm_user_from_processes')); ?>