* Add workestimation comment.

This commit is contained in:
tianshujie98
2020-08-27 12:16:34 +08:00
parent b3b90ccbe2
commit 17ba1e95e4
3 changed files with 42 additions and 2 deletions
+8 -1
View File
@@ -11,6 +11,13 @@
*/
class workestimation extends control
{
/**
* Index
*
* @param int $program
* @access public
* @return void
*/
public function index($program = 0)
{
$program = $program ? $program : $this->session->program;
@@ -27,7 +34,7 @@ class workestimation extends control
$budget = $this->workestimation->getBudget($program);
if(!isset($this->config->project)) $this->config->project = new stdclass();
if(empty($budget))
if(empty($budget))
{
$this->app->loadConfig('estimate');
$budget = new stdclass();
+22 -1
View File
@@ -11,11 +11,25 @@
*/
class workestimationModel extends model
{
/**
* Get a budget
*
* @param int $program
* @access public
* @return array
*/
public function getBudget($program)
{
return $this->dao->select('*')->from(TABLE_WORKESTIMATION)->where('program')->eq($program)->fetch();
}
/**
* Get program scale
*
* @param int $program
* @access public
* @return int
*/
public function getProgramScale($program)
{
$products = $this->loadModel('product')->getPairs($program);
@@ -23,13 +37,20 @@ class workestimationModel extends model
return $this->dao->select('cast(sum(estimate) as decimal(10,2)) as scale')->from(TABLE_STORY)->where('product')->in($productIdList)->andWhere('type')->eq('requirement')->fetch('scale');
}
/**
* Save a budget
*
* @param int $program
* @access public
* @return bool
*/
public function save($program)
{
$budget = $this->getBudget($program);
$postBudget = fixer::input('post')->get();
$postBudget->program = $program;
if(empty($budget))
if(empty($budget))
{
$this->dao->insert(TABLE_WORKESTIMATION)
->batchcheck($this->config->workestimation->index->requiredFields, 'notempty')
+12
View File
@@ -1,3 +1,15 @@
<?php
/**
* The index of workestimation 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 workestimation
* @version $Id: index.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>.unify-padding{width:94px;}</style>
<div id='mainContent' class='main-content'>