diff --git a/src/app/note/controllers/NoteController.php b/src/app/note/controllers/NoteController.php index e2e7d65fb033af826021165d404118f2f9592f91..5a9b3a8062dfb228d4c1205ff76cb59a0864c3c0 100755 --- a/src/app/note/controllers/NoteController.php +++ b/src/app/note/controllers/NoteController.php @@ -51,12 +51,10 @@ class NoteController } if (isset($data['entities_chosen'])) { - if (!Validator::arrayType()->validate($data['entities_chosen'])) { return $response->withStatus(400)->withJson(['errors' => 'Bad Request entities chosen']); } - foreach($data['entities_chosen'] as $entityId) { - + foreach ($data['entities_chosen'] as $entityId) { if ($entityId == null) { return $response->withStatus(400)->withJson(['errors' => 'Bad Request entities chosen']); } @@ -78,12 +76,13 @@ class NoteController //Insert relation note with entities in note_entities_table if (!empty($noteId) && !empty($data['entities_chosen'])) { - foreach($data['entities_chosen'] as $entity) { - NoteEntityModel::create( ['item_id' => $entity, 'note_id' => $noteId ]); + foreach ($data['entities_chosen'] as $entity) { + NoteEntityModel::create(['item_id' => $entity, 'note_id' => $noteId ]); } } - HistoryController::add( [ + HistoryController::add( + [ 'tableName' => "notes", 'recordId' => $noteId, 'eventType' => "ADD", @@ -113,7 +112,7 @@ class NoteController $date = $date->format('d-m-Y H:i'); $pdf->Cell(0, 20, "{$user['firstname']} {$user['lastname']} : {$date}", 1, 2, 'C', false); - $pdf->MultiCell(0, 20, $note['note_text'] ,1, 'L', false); + $pdf->MultiCell(0, 20, $note['note_text'], 1, 'L', false); $pdf->SetY($pdf->GetY() + 40); } $fileContent = $pdf->Output('', 'S'); diff --git a/src/app/user/controllers/UserController.php b/src/app/user/controllers/UserController.php index fc9575c11cb126ecb143db5517edbb181d378309..dddf949414437ac07ed631d0ba4755ecdd245ca7 100755 --- a/src/app/user/controllers/UserController.php +++ b/src/app/user/controllers/UserController.php @@ -430,7 +430,7 @@ class UserController return $response->withStatus(400)->withJson(['errors' => 'User not found']); } - foreach($data['redirectedBasketIds'] as $redirectedBasketId) { + foreach ($data['redirectedBasketIds'] as $redirectedBasketId) { $redirectedBasket = RedirectBasketModel::get(['select' => ['actual_user_id', 'owner_user_id', 'basket_id'], 'where' => ['id = ?'], 'data' => [$redirectedBasketId]]); if (empty($redirectedBasket[0]) || ($redirectedBasket[0]['actual_user_id'] != $aArgs['id'] && $redirectedBasket[0]['owner_user_id'] != $aArgs['id'])) { DatabaseModel::rollbackTransaction();