diff --git a/module/project/control.php b/module/project/control.php index db36a93b18..15eb50346d 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1859,11 +1859,22 @@ class project extends control { if($confirm == 'no') { - echo js::confirm(sprintf($this->lang->project->confirmDelete, $this->projects[$projectID]), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")); + /* Get the number of unfinished tasks and unresolved bugs. */ + $unfinishedTasks = $this->dao->select('COUNT(id) AS count')->from(TABLE_TASK)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('status')->in('wait,doing')->fetch(); + $unresolvedBugs = $this->dao->select('COUNT(id) AS count')->from(TABLE_BUG)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('status')->eq('active')->fetch(); + + /* Set prompt information. */ + $tips = ''; + if($unfinishedTasks->count) $tips = sprintf($this->lang->project->unfinishedTask, $unfinishedTasks->count); + if($unresolvedBugs->count) $tips .= sprintf($this->lang->project->unresolvedBug, $unresolvedBugs->count); + if($tips) $tips = $this->lang->project->unfinishedProject . $tips; + + echo js::confirm($tips . sprintf($this->lang->project->confirmDelete, $this->projects[$projectID]), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")); exit; } else { + /* Delete project. */ $this->project->delete(TABLE_PROJECT, $projectID); $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('project')->eq($projectID)->exec(); $this->project->updateUserView($projectID); diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 130636b365..1e9155c6a1 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -275,6 +275,9 @@ $lang->project->noweekend = 'Ohne Wochenende'; $lang->project->withweekend = 'Mit Wochenende'; $lang->project->interval = 'Intervale '; $lang->project->fixFirstWithLeft = 'Modify the left'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, created by $actor . $extra' . "\n"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 24aa8f3ba5..0275dca4f6 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -275,6 +275,9 @@ $lang->project->noweekend = 'Exclude Weekend'; $lang->project->withweekend = 'Include Weekend'; $lang->project->interval = 'Intervals '; $lang->project->fixFirstWithLeft = 'Update hours left too'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, created by $actor . $extra' . "\n"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index dab155609c..8d012b2cb1 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -275,6 +275,9 @@ $lang->project->noweekend = 'Exclure les Weekends'; $lang->project->withweekend = 'Inclure les Weekends'; $lang->project->interval = 'Intervalles'; $lang->project->fixFirstWithLeft = 'Mettre à jour les heures également'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, créée par $actor .' . "\n"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 6b97ffd0ad..bd74e38c55 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -275,6 +275,9 @@ $lang->project->noweekend = 'Không gồm cuối tuần'; $lang->project->withweekend = 'Bao gồm cuối tuần'; $lang->project->interval = 'Intervals '; $lang->project->fixFirstWithLeft = 'Cập nhật cả giờ còn lại'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, được tạo bởi $actor $extra.' . "\n"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 3af509476f..989413475a 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -275,6 +275,9 @@ $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '显示周末'; $lang->project->interval = '间隔'; $lang->project->fixFirstWithLeft = '修改剩余工时'; +$lang->project->unfinishedProject = "该{$lang->projectCommon}下还有"; +$lang->project->unfinishedTask = "[%s]个未完成的任务,"; +$lang->project->unresolvedBug = "[%s]个未解决的bug,"; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, 由 $actor 创建。$extra' . "\n";