Skip to content

Commit

Permalink
Merge pull request #115 from Leantime/hotfixes-2.0.10
Browse files Browse the repository at this point in the history
fix for milestone creation issues
  • Loading branch information
marcelfolaron authored Feb 24, 2020
2 parents ff9df09 + ca9b6c8 commit 5222faa
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class settings {
*/
private $debug = 1;

public $appVersion = "2.0.9";
public $appVersion = "2.0.10";

public $dbVersion = "2.0.4";

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leantime",
"version": "2.0.9",
"version": "2.0.10",
"description": "Project Management Tools",
"main": "gruntfile.js",
"dependencies": {
Expand Down
18 changes: 13 additions & 5 deletions src/domain/tickets/controllers/class.editMilestone.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ public function get($params)

$milestone = $this->ticketRepo->getTicket($params['id']);
$milestone = (object) $milestone;

if(!isset($milestone->id)) {
$this->tpl->setNotification("There was an issue retrieving this milestone", "error");
$this->tpl->redirect("/tickets/roadmap/");
}

$milestone->editFrom = date('m/d/Y', strtotime($milestone->editFrom));
$milestone->editTo = date('m/d/Y', strtotime($milestone->editTo));

$comments = $this->commentsRepo->getComments('ticket', $params['id']);

}else{

$milestone = new models\tickets();
$today = new DateTime();
$milestone->editFrom = $today->format("m/d/Y");
Expand Down Expand Up @@ -136,9 +143,10 @@ public function post($params)

}else{


$result = $this->ticketService->quickAddMilestone($params);

if($result == true) {
if(is_numeric($result)) {

$this->tpl->setNotification("Milestone Created Successfully", "success");

Expand All @@ -151,13 +159,13 @@ public function post($params)
$this->tpl->redirect("/tickets/editMilestone/".$result);

}else{
$this->tpl->setNotification("There was a problem saving the milestone", "error");
}

}

$this->tpl->setNotification("There was a problem saving the milestone: ".$result['message'], "error");
$this->tpl->redirect("/tickets/editMilestone/");

}

}

$this->tpl->assign('milestone', (object) $params);
$this->tpl->displayPartial('tickets.milestoneDialog');
Expand Down
1 change: 1 addition & 0 deletions src/domain/tickets/services/class.tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public function quickAddMilestone($params)
'editTo' => date('Y-m-d 00:00:01', strtotime($params['editTo']))
);


if($values['headline'] == "") {
$error = array("status"=>"error", "message"=>"Headline Missing");
return $error;
Expand Down
4 changes: 3 additions & 1 deletion src/domain/tickets/templates/milestoneDialog.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@

</form>

<?php if($currentMilestone->id !== '') { ?>
<?php

if(isset($currentMilestone->id) && $currentMilestone->id !== '') { ?>
<br />
<input type="hidden" name="comment" value="1" />

Expand Down

0 comments on commit 5222faa

Please sign in to comment.