* code for task #71660.#71661,#71662,#71663,#71664,#71665.

This commit is contained in:
wangyidong
2022-10-11 15:54:40 +08:00
parent deb373941a
commit 36f9aa8ad5
9 changed files with 417 additions and 77 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ $lang->my->menu->work['subMenu']->story = "$lang->SRCommon|my|work|mode=st
$lang->my->menu->work['subMenu']->bug = "{$lang->bug->common}|my|work|mode=bug";
$lang->my->menu->work['subMenu']->testcase = array('link' => "{$lang->testcase->common}|my|work|mode=testcase&type=assigntome", 'subModule' => 'testtask');
$lang->my->menu->work['subMenu']->testtask = "{$lang->testtask->common}|my|work|mode=testtask&type=wait";
$lang->my->menu->work['subMenu']->audit = array('link' => "{$lang->review->common}|my|work|mode=audit", 'subModule' => 'review');
$lang->my->menu->work['subMenu']->audit = array('link' => "{$lang->review->common}|my|work|mode=audit&type=all&param=&orderBy=time_desc", 'subModule' => 'review');
$lang->my->menu->work['menuOrder'][5] = 'task';
$lang->my->menu->work['menuOrder'][10] = 'requirement';
+11 -20
View File
@@ -182,8 +182,7 @@ class my extends control
$riskCount = $pager->recTotal;
/* Get the number of reviews assigned to me. */
$pendingList = $this->loadModel('approval')->getPendingReviews('review');
$reviewList = $this->review->getByList($pendingList, 'id_desc', $pager);
$reviewList = $this->my->getReviewList('all', 'time_desc', $pager);
$reviewCount = $pager->recTotal;
/* Get the number of nc assigned to me. */
@@ -221,6 +220,7 @@ if(isMax !== 0)
{
var issueCount = $issueCount;
var riskCount = $riskCount;
var qaCount = $qaCount;
var meetingCount = $meetingCount;
}
</script>
@@ -939,6 +939,7 @@ EOF;
* My audits.
*
* @param string $browseType
* @param string $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -946,32 +947,22 @@ EOF;
* @access public
* @return void
*/
public function audit($browseType = 'needreview', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
public function audit($browseType = 'all', $param = 0, $orderBy = 'time_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$this->app->loadClass('pager', true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$reviewList = array();
if($this->config->edition == 'max')
if($this->config->edition == 'max' and ($browseType == 'reviewedbyme' or $browseType == 'createdbyme'))
{
$this->loadModel('datatable');
$this->loadModel('baseline');
$this->app->loadLang('review');
$this->session->set('reviewList', $this->app->getURI(true));
$pendingList = $this->loadModel('approval')->getPendingReviews('review');
if($browseType == 'needreview')
{
$reviewList = $this->loadModel('review')->getByList($pendingList, $orderBy, $pager);
}
else
{
$reviewList = $this->loadModel('review')->getUserReviews($browseType, $orderBy, $pager);
}
$this->view->products = $this->my->getProductPairs();
$this->view->pendingList = $pendingList;
$reviewList = $this->loadModel('review')->getUserReviews($browseType, $orderBy, $pager);
}
else
{
$reviewList = $this->my->getReviewList($browseType, $orderBy, $pager);
}
$this->view->title = $this->lang->my->myReview;
$this->view->title = $this->lang->review->common;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->reviewList = $reviewList;
$this->view->recTotal = $recTotal;
+15
View File
@@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe';
$lang->my->storyMenu->closedByMe = 'ClosedByMe';
$lang->my->storyMenu->assignedByMe = 'AssignedByMe';
$lang->my->audit = new stdclass();
$lang->my->audit->title = 'Title';
$lang->my->audit->time = 'Time';
$lang->my->audit->type = 'Type';
$lang->my->audit->status = 'Status';
$lang->my->auditMenu = new stdclass();
$lang->my->auditMenu->all = 'All';
$lang->my->auditMenu->story = 'Story';
$lang->my->auditMenu->testcase = 'Case';
if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project';
if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback';
if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA';
$lang->my->projectMenu = new stdclass();
$lang->my->projectMenu->doing = 'Doing';
$lang->my->projectMenu->wait = 'Waiting';
@@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution
$lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration';
$lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress';
$lang->my->confirmReview = 'Do you want to pass it?';
$lang->my->guideChangeTheme = <<<EOT
<p class='theme-title'><span style='color: #0c60e1'>"Young Blue"</span> theme is available now!</p>
<div>
+15
View File
@@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe';
$lang->my->storyMenu->closedByMe = 'ClosedByMe';
$lang->my->storyMenu->assignedByMe = 'AssignedByMe';
$lang->my->audit = new stdclass();
$lang->my->audit->title = 'Title';
$lang->my->audit->time = 'Time';
$lang->my->audit->type = 'Type';
$lang->my->audit->status = 'Status';
$lang->my->auditMenu = new stdclass();
$lang->my->auditMenu->all = 'All';
$lang->my->auditMenu->story = 'Story';
$lang->my->auditMenu->testcase = 'Case';
if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project';
if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback';
if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA';
$lang->my->projectMenu = new stdclass();
$lang->my->projectMenu->doing = 'Doing';
$lang->my->projectMenu->wait = 'Waiting';
@@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution
$lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration';
$lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress';
$lang->my->confirmReview = 'Do you want to pass it?';
$lang->my->guideChangeTheme = <<<EOT
<p class='theme-title'><span style='color: #0c60e1'>"Young Blue"</span> theme is available now!</p>
<div>
+15
View File
@@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe';
$lang->my->storyMenu->closedByMe = 'ClosedByMe';
$lang->my->storyMenu->assignedByMe = 'AssignedByMe';
$lang->my->audit = new stdclass();
$lang->my->audit->title = 'Title';
$lang->my->audit->time = 'Time';
$lang->my->audit->type = 'Type';
$lang->my->audit->status = 'Status';
$lang->my->auditMenu = new stdclass();
$lang->my->auditMenu->all = 'All';
$lang->my->auditMenu->story = 'Story';
$lang->my->auditMenu->testcase = 'Case';
if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project';
if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback';
if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA';
$lang->my->projectMenu = new stdclass();
$lang->my->projectMenu->doing = 'Doing';
$lang->my->projectMenu->wait = 'Waiting';
@@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution
$lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration';
$lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress';
$lang->my->confirmReview = 'Do you want to pass it?';
$lang->my->guideChangeTheme = <<<EOT
<p class='theme-title'><span style='color: #0c60e1'>"Young Blue"</span> theme is available now!</p>
<div>
+15
View File
@@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = '由我评审';
$lang->my->storyMenu->closedByMe = '由我关闭';
$lang->my->storyMenu->assignedByMe = '由我指派';
$lang->my->audit = new stdclass();
$lang->my->audit->title = '评审标题';
$lang->my->audit->time = '提交时间';
$lang->my->audit->type = '类型';
$lang->my->audit->status = '状态';
$lang->my->auditMenu = new stdclass();
$lang->my->auditMenu->all = '所有';
$lang->my->auditMenu->story = '需求';
$lang->my->auditMenu->testcase = '用例';
if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = '项目';
if($config->edition != 'open') $lang->my->auditMenu->feedback = '反馈';
if($config->edition != 'open') $lang->my->auditMenu->oa = '办公';
$lang->my->projectMenu = new stdclass();
$lang->my->projectMenu->doing = '进行中';
$lang->my->projectMenu->wait = '未开始';
@@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = '默认进入执行
$lang->my->executionLinkList['execution-task'] = '默认进入最近一个执行的任务列表,可以查看当前迭代下的任务信息';
$lang->my->executionLinkList['execution-executionkanban'] = '默认进入执行看板,可以查看进行中项目的执行情况';
$lang->my->confirmReview = '您确定要执行通过操作吗?';
$lang->my->guideChangeTheme = <<<EOT
<p class='theme-title'>全新<span style='color: #0c60e1'>“青春蓝”</span>主题上线了!</p>
<div>
+234
View File
@@ -968,4 +968,238 @@ class myModel extends model
return $requirements;
}
/**
* Get review list for me.
*
* @param string $browseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getReviewList($browseType, $orderBy = 'time_desc', $pager = null)
{
if($this->app->rawMethod != 'work') return array();
$reviewList = array();
if($browseType == 'all' or $browseType == 'story') $reviewList = array_merge($reviewList, $this->getReviewingStories());
if($browseType == 'all' or $browseType == 'testcase') $reviewList = array_merge($reviewList, $this->getReviewingCases());
if($browseType == 'all' or $browseType == 'project') $reviewList = array_merge($reviewList, $this->getReviewingApprovals());
if($browseType == 'all' or $browseType == 'feedback') $reviewList = array_merge($reviewList, $this->getReviewingFeedbacks());
if($browseType == 'all' or $browseType == 'oa') $reviewList = array_merge($reviewList, $this->getReviewingOA());
if(empty($reviewList)) return array();
$field = $orderBy;
$direction = 'asc';
if(strpos($orderBy, '_') !== false) list($field, $direction) = explode('_', $orderBy);
/* Sort review. */
$reviewGroup = array();
foreach($reviewList as $review)
{
if(!isset($review->$field)) $field = 'time';
$reviewGroup[$review->$field][] = $review;
}
if($direction == 'asc') ksort($reviewGroup);
if($direction == 'desc') krsort($reviewGroup);
$reviewList = array();
foreach($reviewGroup as $reviews) $reviewList = array_merge($reviewList, $reviews);
/* Pager. */
$pager->setRecTotal(count($reviewList));
$pager->setPageTotal();
$pager->setPageID($pager->pageID);
$reviewList = array_chunk($reviewList, $pager->recPerPage);
$reviewList = $reviewList[$pager->pageID - 1];
return $reviewList;
}
/**
* Get reviewing stories.
*
* @param string $orderBy
* @access public
* @return array
*/
public function getReviewingStories($orderBy = 'id_desc')
{
if(!common::hasPriv('story', 'review')) return array();
$this->app->loadLang('story');
$stmt = $this->dao->select("t1.*")->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_STORYREVIEW)->alias('t2')->on('t1.id = t2.story and t1.version = t2.version')
->where('t1.deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t2.reviewer')->eq($this->app->user->account)
->andWhere('t2.result')->eq('')
->andWhere('t1.status')->eq('reviewing')
->orderBy($orderBy)
->query();
$stories = array();
while($data = $stmt->fetch())
{
$story = new stdclass();
$story->id = $data->id;
$story->title = $data->title;
$story->type = 'story';
$story->time = $data->openedDate;
$story->status = $data->status;
$stories[$story->id] = $story;
}
$actions = $this->dao->select('objectID,`date`')->from(TABLE_ACTION)->where('objectType')->eq('story')->andWhere('objectID')->in(array_keys($stories))->andWhere('action')->eq('submitreview')->orderBy('`date`')->fetchPairs('objectID', 'date');
foreach($actions as $storyID => $date) $stories[$storyID]->time = $date;
return array_values($stories);
}
/**
* Get reviewing cases.
*
* @param string $orderBy
* @access public
* @return array
*/
public function getReviewingCases($orderBy = 'id_desc')
{
if(!common::hasPriv('testcase', 'review')) return array();
$this->app->loadLang('testcase');
$stmt = $this->dao->select('*')->from(TABLE_CASE)
->where('deleted')->eq('0')
->andWhere('status')->eq('wait')
->beginIF(!$this->app->user->admin)->andWhere('product')->in($this->app->user->view->products)->fi()
->orderBy($orderBy)
->query();
$cases = array();
while($data = $stmt->fetch())
{
$case = new stdclass();
$case->id = $data->id;
$case->title = $data->title;
$case->type = 'testcase';
$case->time = $data->openedDate;
$case->status = $data->status;
$cases[$case->id] = $case;
}
return array_values($cases);
}
/**
* Get reviewing approvals.
*
* @param string $orderBy
* @access public
* @return array
*/
public function getReviewingApprovals($orderBy = 'id_desc')
{
if(!common::hasPriv('review', 'assess')) return array();
if($this->config->edition != 'max') return array();
$pendingList = $this->loadModel('approval')->getPendingReviews('review');
$projectReviews = $this->loadModel('review')->getByList($pendingList, $orderBy);
$this->app->loadLang('project');
$this->session->set('reviewList', $this->app->getURI(true));
$reviewList = array();
foreach($projectReviews as $review)
{
if(!isset($pendingList[$review->id])) continue;
$data = new stdclass();
$data->id = $review->id;
$data->title = $review->title;
$data->type = 'project';
$data->time = $review->createdDate;
$data->status = $review->status;
$reviewList[] = $data;
}
return $reviewList;
}
/**
* Get reviewing feedbacks.
*
* @param string $orderBy
* @access public
* @return array
*/
public function getReviewingFeedbacks($orderBy = 'id_desc')
{
if(!common::hasPriv('feedback', 'review')) return array();
if($this->config->edition == 'open') return array();
$feedbacks = $this->loadModel('feedback')->getList('review', $orderBy);
$reviewList = array();
foreach($feedbacks as $feedback)
{
$data = new stdclass();
$data->id = $feedback->id;
$data->title = $feedback->title;
$data->type = 'feedback';
$data->time = $feedback->openedDate;
$data->status = $feedback->status;
$reviewList[] = $data;
}
return $reviewList;
}
/**
* Get reviewing OA.
*
* @param string $orderBy
* @access public
* @return array
*/
public function getReviewingOA($orderBy = 'status')
{
if($this->config->edition == 'open') return array();
$users = $this->loadModel('user')->getPairs('noletter');
$account = $this->app->user->account;
/* Get dept info. */
$allDeptList = $this->loadModel('dept')->getPairs('', 'dept');
$allDeptList['0'] = '/';
$managedDeptList = array();
$tmpDept = $this->dept->getDeptManagedByMe($account);
foreach($tmpDept as $d) $managedDeptList[$d->id] = $d->name;
$oa = array();
if(common::hasPriv('attend', 'review')) $oa['attend'] = $this->getReviewingAttends($allDeptList, $managedDeptList);
if(common::hasPriv('leave', 'review')) $oa['leave'] = $this->getReviewingLeaves($allDeptList, $managedDeptList, $orderBy);
if(common::hasPriv('overtime', 'review')) $oa['overtime'] = $this->getReviewingOvertimes($allDeptList, $managedDeptList, $orderBy);
if(common::hasPriv('makeup', 'review')) $oa['makeup'] = $this->getReviewingMakeups($allDeptList, $managedDeptList, $orderBy);
if(common::hasPriv('lieu', 'review')) $oa['lieu'] = $this->getReviewingLieus($allDeptList, $managedDeptList, $orderBy);
$reviewList = array();
foreach($oa as $type => $reviewings)
{
foreach($reviewings as $object)
{
$review = new stdclass();
$review->id = $object->id;
$review->type = $type;
$review->time = $type == 'attend' ? $object->date : $object->createdDate;
$review->status = $type == 'attend' ? $object->reviewStatus : $object->status;
if($type == 'attend')
{
$review->title = zget($users, $object->account) . ': ' . $object->date . $this->lang->attend->statusList[$object->status ];
}
else
{
$review->title = zget($users, $object->createdBy) . ': ' . $object->begin . ' ' . substr($object->start, 0, 5) . ' ~ ' . $object->end . ' ' . substr($object->finish, 0, 5);
}
$reviewList[] = $review;
}
}
return $reviewList;
}
}
+109 -54
View File
@@ -4,69 +4,124 @@
<?php js::set('rawMethod', $app->rawMethod);?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php if($app->rawMethod == 'work'):?>
<?php foreach($lang->my->auditMenu as $key => $type):?>
<?php $active = $key == $browseType ? 'btn-active-text' : '';?>
<?php echo html::a($this->createLink('my', $app->rawMethod, "mode=$mode&browseType=$key&param=&orderBy=time_desc"), '<span class="text">' . $type . '</span>', '', 'class="btn btn-link ' . $active .'"');?>
<?php endforeach;?>
<?php else:?>
<?php foreach($lang->review->browseTypeList as $key => $type):?>
<?php if(in_array($key, array('all', 'done', 'reviewing'))) continue;?>
<?php if($app->rawMethod == 'work' && in_array($key, array('reviewedbyme', 'createdbyme', 'wait'))) continue;?>
<?php if($app->rawMethod == 'contribute' && $key == 'wait') continue;?>
<?php $active = $key == $browseType ? 'btn-active-text' : '';?>
<?php $recTotalLabel = $key == $browseType ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>": '';?>
<?php echo html::a($this->createLink('my', $app->rawMethod, "mode=$mode&browseType=$key"), '<span class="text">' . $type . '</span>' . $recTotalLabel, '', 'class="btn btn-link ' . $active .'"');?>
<?php echo html::a($this->createLink('my', $app->rawMethod, "mode=$mode&browseType=$key&param=&orderBy=time_desc"), '<span class="text">' . $type . '</span>' . $recTotalLabel, '', 'class="btn btn-link ' . $active .'"');?>
<?php endforeach;?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div class='main-col'>
<?php if(empty($reviewList)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->noData;?></span>
</p>
</div>
<?php else:?>
<form class='main-table' method='post' id='myReviewForm'>
<div class="table-header fixed-right">
<nav class="btn-toolbar pull-right"></nav>
</div>
<?php
$vars = "mode=$mode&browseType=$browseType&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID";
include $app->getModuleRoot() . 'common/view/datatable.html.php';
$setting = $this->datatable->getSetting('review');
foreach($setting as $key => $value)
{
if($value->id == 'actions') $setting[$key]->width = 80;
}
$widths = $this->datatable->setFixedFieldWidth($setting);
?>
<table class='table has-sort-head datatable' id='reviewList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
<thead>
<tr>
<?php
foreach($setting as $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, false);
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($reviewList as $review):?>
<tr data-id='<?php echo $review->id?>'>
<?php foreach($setting as $value) $this->my->reviewPrintCell($value, $review, $users, $products, $pendingList);?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
</form>
<?php endif;?>
</div>
</div>
<div id="mainContent">
<?php if(empty($reviewList)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->noData;?></span>
</p>
</div>
<?php else:?>
<form id='myReviewForm' class="main-table" method="post" data-ride="table">
<table class='table has-sort-head' id='reviewList'>
<thead>
<?php $vars = "mode=$mode&browseType=$browseType&param=&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<tr>
<th class='c-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='c-title'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->my->audit->title);?></th>
<th class='c-type'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->my->audit->type);?></th>
<th class='c-date w-150px'> <?php common::printOrderLink('time', $orderBy, $vars, $lang->my->audit->time);?></th>
<th class='c-status w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->my->audit->status);?></th>
<th class='c-actions-2'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php foreach($reviewList as $review):?>
<?php
$type = $review->type;
$typeName = $lang->$type->common;
if($type == 'project') $type = 'review';
$statusList = $lang->$type->statusList;
if($type == 'attend') $statusList = $lang->attend->reviewStatusList;
?>
<tr>
<td class='c-id'> <?php echo $review->id?></td>
<td class='c-title'> <?php echo $review->title?></td>
<td class='c-type'> <?php echo $typeName;?></td>
<td class='c-time'> <?php echo $review->time?></td>
<td class='c-status'><?php echo zget($statusList, $review->status, '')?></td>
<td class='c-actions'>
<?php
$module = $type;
$method = 'review';
$params = "id=$review->id";
$reviewIcon = '<i class="icon-glasses"></i>';
$passIcon = '<i class="icon-check"></i>';
$rejectIcon = '<i class="icon-close"></i>';
if($module == 'review')
{
$method = 'assess';
$params = "reviewID=$review->id&from={$this->app->rawMethod}";
common::printLink($module, $method, $params, $reviewIcon, '', "class='btn' title='{$lang->review->common}'");
}
elseif($module == 'attend')
{
extCommonModel::printLink('attend', 'review', "attendID={$review->id}&status=pass", $passIcon, "class='btn' title='{$lang->attend->reviewStatusList['pass']}' data-status='pass' data-toggle='ajax'");
extCommonModel::printLink('attend', 'review', "attendID={$review->id}&status=reject", $rejectIcon, "class='btn' title='{$lang->attend->reviewStatusList['reject']}' data-toggle='modal'");
}
elseif($module == 'leave')
{
$leaveMode = $review->status == 'pass' ? 'back' : '';
extCommonModel::printLink('leave', 'review', "id={$review->id}&status=pass&mode=$leaveMode", $passIcon, "class='btn' title='{$lang->$module->statusList['pass']}' data-status='pass' data-toggle='ajax'");
extCommonModel::printLink('leave', 'review', "id={$review->id}&status=reject&mode=$leaveMode", $rejectIcon, "class='btn' title='{$lang->$module->statusList['reject']}' data-toggle='modal'");
}
elseif(strpos('|makeup|overtime|lieu|', "|$module|") !== false)
{
extCommonModel::printLink($module, $method, "id={$review->id}&status=pass", $passIcon, "class='btn' title='{$lang->$module->statusList['pass']}' data-status='pass' data-toggle='ajax'");
extCommonModel::printLink($module, $method, "id={$review->id}&status=reject", $rejectIcon, "class='btn' title='{$lang->$module->statusList['reject']}' data-toggle='modal'");
}
else
{
common::printLink($module, $method, $params, $reviewIcon, '', "class='btn iframe' title='{$lang->review->common}'", true, true);
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
</form>
<?php endif;?>
</div>
<?php js::set('confirmReview', $lang->my->confirmReview);?>
<script>
$(function(){$('#myReviewForm').table();})
$(function()
{
$('[data-toggle=ajax]').click(function()
{
if($(this).hasClass('disabled')) return false;
var status = $(this).data('status');
if(status == 'undefined' || confirm(confirmReview))
{
$.get($(this).prop('href'), function(response)
{
if(response.message) $.zui.messager.success(response.message);
if(response.result == 'success') location.reload();
return false;
}, 'json');
}
return false;
});
});
</script>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php'?>
+2 -2
View File
@@ -36,8 +36,8 @@
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->my->byQuery;?></a>
</div>
<div id="mainContent">
<?php $dataModule = $app->rawMethod == 'work' ? 'workTask' : 'contributeTask';?>
<div class="cell<?php if($type == 'bySearch') echo ' show';?>" id="queryBox" data-module=<?php echo $dataModule;?>></div>
<?php $dataModule = $app->rawMethod == 'work' ? 'workTask' : 'contributeTask';?>
<div class="cell<?php if($type == 'bySearch') echo ' show';?>" id="queryBox" data-module=<?php echo $dataModule;?>></div>
<?php if(empty($tasks)):?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->task->noTask;?></span></p>