diff --git a/module/execution/model.php b/module/execution/model.php index 1e1144d216..711d30c265 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -307,7 +307,7 @@ class executionModel extends model /*Judge workdays is legitimate. */ $workdays = helper::diffDate($_POST['end'], $_POST['begin']); - if($_POST['days'] > $workdays) + if(isset($_POST['days']) and $_POST['days'] > $workdays) { dao::$errors['days'] = sprintf($this->lang->project->workdaysExceed, $workdays); return false; @@ -462,7 +462,7 @@ class executionModel extends model /*Judge workdays is legitimate. */ $this->app->loadLang('project'); $workdays = helper::diffDate($_POST['end'], $_POST['begin']); - if($_POST['days'] > $workdays) + if(isset($_POST['days']) and $_POST['days'] > $workdays) { dao::$errors['days'] = sprintf($this->lang->project->workdaysExceed, $workdays); return false; @@ -661,7 +661,7 @@ class executionModel extends model /*Judge workdays is legitimate. */ $workdays = helper::diffDate($data->ends[$executionID], $data->begins[$executionID]); - if($data->dayses[$executionID] > $workdays) + if(isset($data->dayses[$executionID]) and $data->dayses[$executionID] > $workdays) { $this->app->loadLang('project'); dao::$errors['days'][] = 'execution#' . $executionID . sprintf($this->lang->project->workdaysExceed, $workdays); diff --git a/module/project/control.php b/module/project/control.php index 9514754597..e9a781220c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -382,7 +382,7 @@ class project extends control if($_POST) { - $projectID = $this->project->create($model); + $projectID = $this->project->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('project', $projectID, 'opened'); diff --git a/module/project/model.php b/module/project/model.php index 807730ba3a..a1a6d2d535 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -787,7 +787,7 @@ class projectModel extends model * @access public * @return int|bool */ - public function create($model) + public function create() { $project = fixer::input('post') ->callFunc('name', 'trim') @@ -849,7 +849,7 @@ class projectModel extends model /*Judge workdays is legitimate. */ $workdays = helper::diffDate($project->end, $project->begin); - if($model == 'scrum' and $project->days > $workdays) + if(isset($project->days) and $project->days > $workdays) { dao::$errors['days'] = sprintf($this->lang->project->workdaysExceed, $workdays); return false; @@ -1097,7 +1097,7 @@ class projectModel extends model /*Judge workdays is legitimate. */ $workdays = helper::diffDate($project->end, $project->begin); - if($project->days > $workdays) + if(isset($project->days) and $project->days > $workdays) { dao::$errors['days'] = sprintf($this->lang->project->workdaysExceed, $workdays); return false;