Skip to content

Commit 9a7018e

Browse files
committed
Fixed editing clients, projects and tags
1 parent 6cb622e commit 9a7018e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>Time Tracker</name>
66
<summary>Time Tracker App</summary>
77
<description><![CDATA[Time Tracker App]]></description>
8-
<version>0.0.15</version>
8+
<version>0.0.16</version>
99
<licence>agpl</licence>
1010
<author mail="[email protected]" >MTier Ltd.</author>
1111
<namespace>TimeTracker</namespace>

lib/Controller/AjaxController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public function editClient($id) {
306306
}
307307
if (trim($name) != ''){
308308
$old = $this->clientMapper->findByName($name);
309-
if ($old == null){
309+
if ($old == null || $old->id == $id){
310310
$c->setName($name);
311311
$this->clientMapper->update($c);
312312
} else {
@@ -396,7 +396,7 @@ public function editProject($id) {
396396
$name = $this->request->name;
397397
if (trim($name) != ''){
398398
$old = $this->projectMapper->findByName($name);
399-
if ($old != null){
399+
if ($old != null && $old->id != $id){
400400
return new JSONResponse(["Error" => "A project with this name already exists"]);
401401
}
402402
$p->setName($name);
@@ -542,7 +542,7 @@ public function editTag($id) {
542542
return;
543543
}
544544
$old = $this->tagMapper->findByNameUser($name, $this->userId);
545-
if ($old != null){
545+
if ($old != null && $old->id != $id){
546546
return new JSONResponse(["Error" => "This tag name already exists"]);
547547
}
548548
$c->setName($name);

0 commit comments

Comments
 (0)