* Adjust code.
This commit is contained in:
@@ -7,44 +7,45 @@
|
||||
* @author Xiying Guan <guanxiying@xirangit.com>
|
||||
* @package workestimation
|
||||
* @version $Id$
|
||||
* @link http://www.chanzhi.org
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class workestimation extends control
|
||||
{
|
||||
/**
|
||||
* Index.
|
||||
* Project workload estimations.
|
||||
*
|
||||
* @param int $program
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index($program = 0)
|
||||
public function index($projectID = 0)
|
||||
{
|
||||
$program = $program ? $program : $this->session->PRJ;
|
||||
$projectID = $projectID ? $projectID : $this->session->PRJ;
|
||||
if($_POST)
|
||||
{
|
||||
$result = $this->workestimation->save($program);
|
||||
$result = $this->workestimation->save($projectID);
|
||||
if($result) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer));
|
||||
$this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->workestimation->common;
|
||||
$this->view->programScale = $this->workestimation->getProgramScale($program);
|
||||
$this->view->hourPoint = $this->config->custom->hourPoint;
|
||||
|
||||
$budget = $this->workestimation->getBudget($program);
|
||||
$scale = $this->workestimation->getProgramScale($projectID);
|
||||
$budget = $this->workestimation->getBudget($projectID);
|
||||
if(!isset($this->config->project)) $this->config->project = new stdclass();
|
||||
if(empty($budget))
|
||||
{
|
||||
$this->app->loadConfig('estimate');
|
||||
$budget = new stdclass();
|
||||
$budget->scale = $this->view->programScale;
|
||||
$budget->scale = $scale;
|
||||
$budget->productivity = zget($this->config->custom, 'efficiency', '');
|
||||
$budget->unitLaborCost = zget($this->config->custom, 'cost', '');
|
||||
$budget->dayHour = zget($this->config->project, 'defaultWorkhours', '');
|
||||
}
|
||||
|
||||
$this->view->budget = $budget;
|
||||
$this->view->title = $this->lang->workestimation->common;
|
||||
$this->view->position[] = $this->lang->workestimation->common;
|
||||
$this->view->hourPoint = $this->config->custom->hourPoint;
|
||||
$this->view->programScale = $scale;
|
||||
$this->view->budget = $budget;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user