Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
z
2020-08-27 14:04:27 +08:00
9 changed files with 264 additions and 29 deletions
+20 -20
View File
@@ -1,9 +1,9 @@
<?php
/* Actions */
$lang->risk->batchCreate = 'Batch Add';
$lang->risk->create = 'Add Risk';
$lang->risk->batchCreate = 'Batch Create';
$lang->risk->create = 'Create Risk';
$lang->risk->edit = 'Edit Risk';
$lang->risk->browse = 'List';
$lang->risk->browse = 'Risks';
$lang->risk->view = 'Details';
$lang->risk->activate = 'Active';
$lang->risk->hangup = 'Suspend';
@@ -28,29 +28,29 @@ $lang->risk->riskindex = 'Risk Index';
$lang->risk->pri = 'Priority';
$lang->risk->prevention = 'Mitigation';
$lang->risk->remedy = 'Contingency';
$lang->risk->identifiedDate = 'Identified Date';
$lang->risk->plannedClosedDate = 'Closed Date';
$lang->risk->identifiedDate = 'Identified';
$lang->risk->plannedClosedDate = 'Deadline';
$lang->risk->assignedTo = 'AssignedTo';
$lang->risk->assignedDate = 'Assigned Date';
$lang->risk->createdBy = 'Added By';
$lang->risk->createdDate = 'Added Date';
$lang->risk->assignedDate = 'AssignedDate';
$lang->risk->createdBy = 'CreatedBy';
$lang->risk->createdDate = 'CreatedDate';
$lang->risk->noAssigned = 'Unassigned';
$lang->risk->cancelBy = 'Canceled By';
$lang->risk->cancelDate = 'Canceled Date';
$lang->risk->cancelBy = 'CanceledBy';
$lang->risk->cancelDate = 'CanceledDate';
$lang->risk->cancelReason = 'Cancel Reason';
$lang->risk->resolvedBy = 'Resolved By';
$lang->risk->closedDate = 'Closed Date';
$lang->risk->resolvedBy = 'ResolvedBy';
$lang->risk->closedDate = 'ClosedDate';
$lang->risk->actualClosedDate = 'Closed Date';
$lang->risk->resolution = 'Resolution';
$lang->risk->hangupBy = 'Suspended By';
$lang->risk->hangupDate = 'Suspended Date';
$lang->risk->activateBy = 'Activated By';
$lang->risk->activateDate = 'Activated Date';
$lang->risk->hangupBy = 'SuspendedBy';
$lang->risk->hangupDate = 'SuspendedDate';
$lang->risk->activateBy = 'ActivatedBy';
$lang->risk->activateDate = 'ActivatedDate';
$lang->risk->isChange = 'Any change?';
$lang->risk->trackedBy = 'Tracked By';
$lang->risk->trackedDate = 'Tracked Date';
$lang->risk->editedBy = 'Edited By';
$lang->risk->editedDate = 'Edited By';
$lang->risk->trackedBy = 'TrackedBy';
$lang->risk->trackedDate = 'TrackedDate';
$lang->risk->editedBy = 'EditedBy';
$lang->risk->editedDate = 'EditedDate';
$lang->risk->legendBasicInfo = 'Basic Info.';
$lang->risk->legendLifeTime = 'About Risk';
+17
View File
@@ -1,6 +1,23 @@
<?php
/**
* The control file of subject currentModule of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package subject
* @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
class subject extends control
{
/**
* Browse subjects
*
* @param int $currentModuleID
* @access public
* @return void
*/
public function browse($currentModuleID = 0)
{
$this->view->title = $this->lang->subject->manage;
+10
View File
@@ -1,4 +1,14 @@
<?php
/**
* The subject module English file of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package subject
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->subject->common = 'Subject';
$lang->subject->manage = 'Manage Subject';
$lang->subject->manageChild = 'Manage Child Subject';
+10
View File
@@ -1,4 +1,14 @@
<?php
/**
* The subject module zh-cn file of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package subject
* @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->subject->common = '科目';
$lang->subject->manage = '科目维护';
$lang->subject->manageChild = '维护子科目';
+2 -2
View File
@@ -1,11 +1,11 @@
<?php
/**
* The browse view file of tree module of ZenTaoPMS.
* The browse view file of subject module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package tree
* @package subject
* @version $Id: browse.html.php 4796 2013-06-06 02:21:59Z zhujinyonging@gmail.com $
* @link http://www.zentao.net
*/
+25 -4
View File
@@ -11,12 +11,27 @@
*/
class weekly extends control
{
/**
* The construct function, load users.
*
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
}
/**
* Index
*
* @param int $program
* @param string $date
* @access public
* @return void
*/
public function index($program = 0, $date = '')
{
$program = $program ? $program : $this->session->program;
@@ -46,13 +61,19 @@ class weekly extends control
$this->display();
}
/**
* ComputeWeekly
*
* @access public
* @return void
*/
public function computeWeekly()
{
$programs = $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('isCat')->eq(0)
->andWhere('template')->ne('')
->andWhere('program')->eq(0)
->where('deleted')->eq(0)
->andWhere('isCat')->eq(0)
->andWhere('template')->ne('')
->andWhere('program')->eq(0)
->fetchPairs();
$date = helper::today();
+10
View File
@@ -1,4 +1,14 @@
<?php
/**
* The weekly module English file of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package weekly
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->weekly->common = 'Project Weekly';
$lang->weekly->index = 'Weekly newspaper overview';
$lang->weekly->progress = 'Percent Completed';
+10
View File
@@ -1,4 +1,14 @@
<?php
/**
* The weekly module zh-cn file of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package weekly
* @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->weekly->common = '项目周报';
$lang->weekly->index = '周报总览';
$lang->weekly->progress = '完成百分比';
+160 -3
View File
@@ -11,6 +11,14 @@
*/
class weeklyModel extends model
{
/**
* GetPageNav
*
* @param int $program
* @param int $date
* @access public
* @return string
*/
public function getPageNav($program, $date)
{
$date = date('Ymd', strtotime($this->getThisMonday($date)));
@@ -34,6 +42,13 @@ class weeklyModel extends model
}
/**
* GetWeekPairs
*
* @param int $begin
* @access public
* @return array
*/
public function getWeekPairs($begin)
{
$sn = $this->getWeekSN($begin, date('Y-m-d'));
@@ -50,6 +65,14 @@ class weeklyModel extends model
return $weeks;
}
/**
* GetFromDB
*
* @param int $program
* @param int $date
* @access public
* @return object
*/
public function getFromDB($program, $date)
{
$monday = $this->getThisMonday($date);
@@ -60,6 +83,14 @@ class weeklyModel extends model
->fetch();
}
/**
* Save
*
* @param int $program
* @param int $date
* @access public
* @return void
*/
public function save($program, $date)
{
$report = new stdclass;
@@ -75,11 +106,26 @@ class weeklyModel extends model
$this->dao->replace(TABLE_WEEKLYREPORT)->data($report)->exec();
}
/**
* GetWeekSN
*
* @param int $begin
* @param int $date
* @access public
* @return int
*/
public function getWeekSN($begin, $date)
{
return ceil((strtotime($date) - strtotime($begin)) / 7 / 86400);
}
/**
* GetThisMonday
*
* @param int $date
* @access public
* @return date
*/
public function getThisMonday($date)
{
$day = date('w', strtotime($date));
@@ -88,12 +134,26 @@ class weeklyModel extends model
return date('Y-m-d', strtotime("$date - $days days"));
}
/**
* GetThisSunday
*
* @param int $date
* @access public
* @return date
*/
public function getThisSunday($date)
{
$monday = $this->getThisMonday($date);
return date('Y-m-d', strtotime("$monday +6 days"));
}
/**
* GetLastDay
*
* @param int $date
* @access public
* @return string
*/
public function getLastDay($date)
{
$this->loadModel('project');
@@ -104,6 +164,14 @@ class weeklyModel extends model
return end($workdays);
}
/**
* GetStaff
*
* @param int $program
* @param string $date
* @access public
* @return array
*/
public function getStaff($program, $date = '')
{
if(!$date) $date = date('Y-m-d');
@@ -121,6 +189,15 @@ class weeklyModel extends model
->fetch('count');
}
/**
* GetFinished
*
* @param int $program
* @param string $date
* @param int $pager
* @access public
* @return void
*/
public function getFinished($program, $date = '', $pager = null)
{
if(!$date) $date = date('Y-m-d');
@@ -140,6 +217,14 @@ class weeklyModel extends model
return $this->loadModel('task')->processTasks($tasks);
}
/**
* GetPostponed
*
* @param int $program
* @param string $date
* @access public
* @return void
*/
public function getPostponed($program, $date = '')
{
if(!$date) $date = date('Y-m-d');
@@ -169,6 +254,14 @@ class weeklyModel extends model
return $this->loadModel('task')->processTasks($tasks);
}
/**
* GetTasksOfNextWeek
*
* @param int $program
* @param string $date
* @access public
* @return void
*/
public function getTasksOfNextWeek($program, $date = '')
{
if(!$date) $date = date('Y-m-d');
@@ -188,6 +281,14 @@ class weeklyModel extends model
return $this->loadModel('task')->processTasks($tasks);
}
/**
* GetWorkloadByType
*
* @param int $program
* @param string $date
* @access public
* @return object
*/
public function getWorkloadByType($program, $date = '')
{
if(!$date) $date = date('Y-m-d');
@@ -206,6 +307,14 @@ class weeklyModel extends model
->fetchPairs();
}
/**
* GetPlanedTaskByWeek
*
* @param int $program
* @param string $date
* @access public
* @return array
*/
public function getPlanedTaskByWeek($program, $date = '')
{
if(!$date) $date = date('Y-m-d');
@@ -222,6 +331,14 @@ class weeklyModel extends model
->fetchAll('id');
}
/**
* GetPV
*
* @param int $program
* @param string $date
* @access public
* @return int
*/
public function getPV($program, $date = '')
{
$report = $this->getFromDB($program, $date);
@@ -235,7 +352,7 @@ class weeklyModel extends model
$lastDay = $this->getLastDay($date);
$nextMonday = date('Y-m-d', strtotime("$sunday +1 days"));
$workdays = $this->loadModel('holiday')->getActualWorkingDays($monday, $sunday);
$projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $program->id);
$projectIdList = array_keys($projects);
@@ -263,11 +380,19 @@ class weeklyModel extends model
return round($PV, 2);
}
/**
* GetEV
*
* @param int $program
* @param string $date
* @access public
* @return int
*/
public function getEV($program, $date = '')
{
$report = $this->getFromDB($program, $date);
if(!empty($report)) return $report->ev;
$projects = $this->loadModel('project')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $program);
$projectIdList = array_keys($projects);
@@ -300,11 +425,19 @@ class weeklyModel extends model
return round($EV, 2);
}
/**
* GetAC
*
* @param int $program
* @param string $date
* @access public
* @return int
*/
public function getAC($program, $date = '')
{
$report = $this->getFromDB($program, $date);
if(!empty($report)) return $report->ac;
if(!$date) $date = date('Y-m-d');
$monday = $this->getThisMonday($date);
@@ -323,6 +456,14 @@ class weeklyModel extends model
return round($AC, 2);
}
/**
* GetSV
*
* @param int $ev
* @param int $pv
* @access public
* @return int
*/
public function getSV($ev, $pv)
{
if($pv == 0) return 0;
@@ -330,6 +471,14 @@ class weeklyModel extends model
return number_format($sv * 100, 2);
}
/**
* GetCV
*
* @param int $ev
* @param int $ac
* @access public
* @return int
*/
public function getCV($ev, $ac)
{
if($ac == 0) return 0;
@@ -337,6 +486,14 @@ class weeklyModel extends model
return number_format($cv * 100, 2);
}
/**
* GetTips
*
* @param string $type
* @param int $data
* @access public
* @return string
*/
public function getTips($type = 'progress', $data = 0)
{
$this->app->loadConfig('custom');