| @@ 442-449 (lines=8) @@ | ||
| 439 | */ |
|
| 440 | $status = ['code' => 0]; |
|
| 441 | ||
| 442 | foreach($idList as $id) { |
|
| 443 | if(!(ctype_digit($id) && $this->deleteTrackerByID($this->User->id, (int) $id))) { |
|
| 444 | $status['code'] = 1; |
|
| 445 | } else { |
|
| 446 | //Delete was successful, update history too. |
|
| 447 | $this->History->userRemoveTitle((int) $id); |
|
| 448 | } |
|
| 449 | } |
|
| 450 | ||
| 451 | return $status; |
|
| 452 | } |
|
| @@ 463-470 (lines=8) @@ | ||
| 460 | $status = ['code' => 0]; |
|
| 461 | ||
| 462 | if(in_array($category, array_keys($this->enabledCategories))) { |
|
| 463 | foreach($idList as $id) { |
|
| 464 | if(!(ctype_digit($id) && $this->setCategoryTrackerByID($this->User->id, (int) $id, $category))) { |
|
| 465 | $status['code'] = 1; |
|
| 466 | } else { |
|
| 467 | //Category update was successful, update history too. |
|
| 468 | $this->History->userUpdateCategory((int) $id, $category); |
|
| 469 | } |
|
| 470 | } |
|
| 471 | } else { |
|
| 472 | $status['code'] = 2; |
|
| 473 | } |
|