| @@ 359-366 (lines=8) @@ | ||
| 356 | */ |
|
| 357 | $status = ['code' => 0]; |
|
| 358 | ||
| 359 | foreach($idList as $id) { |
|
| 360 | if(!(ctype_digit($id) && $this->deleteTrackerByID($this->User->id, (int) $id))) { |
|
| 361 | $status['code'] = 1; |
|
| 362 | } else { |
|
| 363 | //Delete was successful, update history too. |
|
| 364 | $this->History->userRemoveTitle((int) $id); |
|
| 365 | } |
|
| 366 | } |
|
| 367 | ||
| 368 | return $status; |
|
| 369 | } |
|
| @@ 380-387 (lines=8) @@ | ||
| 377 | $status = ['code' => 0]; |
|
| 378 | ||
| 379 | if(in_array($category, array_keys($this->enabledCategories))) { |
|
| 380 | foreach($idList as $id) { |
|
| 381 | if(!(ctype_digit($id) && $this->setCategoryTrackerByID($this->User->id, (int) $id, $category))) { |
|
| 382 | $status['code'] = 1; |
|
| 383 | } else { |
|
| 384 | //Category update was successful, update history too. |
|
| 385 | $this->History->userUpdateCategory((int) $id, $category); |
|
| 386 | } |
|
| 387 | } |
|
| 388 | } else { |
|
| 389 | $status['code'] = 2; |
|
| 390 | } |
|