diff --git a/module/bug/model.php b/module/bug/model.php index 8a63c56329..facb21345d 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -385,7 +385,7 @@ class bugModel extends model // Delayed or not?. if($bug->deadline != '0000-00-00') { - if(substr($bug->resolvedDate, 0, 10) != '0000-00-00') + if($bug->resolvedDate and substr($bug->resolvedDate, 0, 10) != '0000-00-00') { $delay = helper::diffDate(substr($bug->resolvedDate, 0, 10), $bug->deadline); } diff --git a/module/doc/model.php b/module/doc/model.php index 2bf2150008..5e17ae4349 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1104,7 +1104,66 @@ class docModel extends model } } - if($type == 'product' or $type == 'project') $libs = $this->dao->select('id,name,`order`')->from($table)->where('id')->in(array_keys($libs))->orderBy('`order` desc, id desc')->fetchAll('id'); + if($type == 'product' or $type == 'project') $libs = $this->dao->select('*')->from($table)->where('id')->in(array_keys($libs))->orderBy('`order` desc')->fetchAll('id'); + + /* Order the same as drop menu.*/ + if($type == 'product') + { + $this->loadModel('product'); + $products = $mineProducts = $otherProducts = $closedProducts = array(); + foreach($libs as $lib) + { + if(!$this->app->user->admin and !$this->product->checkPriv($lib->id)) continue; + if($lib->status == 'normal' and $lib->PO == $this->app->user->account) + { + $mineProducts[$lib->id] = $lib; + } + elseif($lib->status == 'normal' and $lib->PO != $this->app->user->account) + { + $otherProducts[$lib->id] = $lib; + } + elseif($lib->status == 'closed') + { + $closedProducts[$lib->id] = $lib; + } + } + $products = $mineProducts + $otherProducts + $closedProducts; + $libs = array(); + foreach($products as $product) + { + $libs[$product->id] = new stdclass(); + $libs[$product->id]->id = $product->id; + $libs[$product->id]->name = $product->name; + } + } + elseif($type == 'project') + { + $projects = $mineProjects = $otherProjects = $closedProjects = array(); + foreach($libs as $lib) + { + if(!$this->app->user->admin and !$this->lib->checkPriv($lib->id)) continue; + if($lib->status != 'done' and $lib->status != 'closed' and $lib->PM == $this->app->user->account) + { + $mineProjects[$lib->id] = $lib; + } + elseif($lib->status != 'done' and $lib->status != 'closed' and !($lib->PM == $this->app->user->account)) + { + $otherProjects[$lib->id] = $lib; + } + elseif($lib->status == 'done' or $lib->status == 'closed') + { + $closedProjects[$lib->id] = $lib; + } + } + $projects = $mineProjects + $otherProjects + $closedProjects; + $libs = array(); + foreach($projects as $project) + { + $libs[$project->id] = new stdclass(); + $libs[$project->id]->id = $project->id; + $libs[$project->id]->name = $project->name; + } + } return $libs; } diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 2907270007..818727343d 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -241,8 +241,8 @@ $lang->project->setTeam = 'Set Team'; $lang->project->linkStory = 'Link Story'; $lang->project->createTask = 'Create Task'; $lang->project->goback = "Go Back"; -$lang->project->noweekend = 'Without Weekend'; -$lang->project->withweekend = 'With Weekend'; +$lang->project->noweekend = 'excl. Weekend'; +$lang->project->withweekend = 'incl. Weekend'; $lang->project->interval = 'Intervals'; $lang->project->fixFirstWithLeft = 'Modify the left'; @@ -258,7 +258,7 @@ $lang->project->charts->burn->graph->formatNumber = 0; $lang->project->charts->burn->graph->animation = 0; $lang->project->charts->burn->graph->rotateNames = 1; $lang->project->charts->burn->graph->showValues = 0; -$lang->project->charts->burn->graph->reference = 'Reference'; +$lang->project->charts->burn->graph->reference = 'Ideal'; $lang->project->charts->burn->graph->actuality = 'Actual'; $lang->project->placeholder = new stdclass(); diff --git a/module/story/model.php b/module/story/model.php index a2683d6480..6921f834ed 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -485,6 +485,7 @@ class storyModel extends model ->setDefault('status', $oldStory->status) ->setDefault('product', $oldStory->product) ->setDefault('branch', $oldStory->branch) + ->setIF(!$this->post->linkStories, 'linkStories', '') ->setIF($this->post->assignedTo != $oldStory->assignedTo, 'assignedDate', $now) ->setIF($this->post->closedBy != false and $oldStory->closedDate == '', 'closedDate', $now) ->setIF($this->post->closedReason != false and $oldStory->closedDate == '', 'closedDate', $now)