Fix inventory-item/update buttons save, save/next

This commit is contained in:
2016-09-14 19:03:53 +02:00
parent e4ff76af47
commit 9cb0517e43
4 changed files with 4 additions and 11 deletions

View File

@@ -208,14 +208,9 @@ class InventoryItemController extends Controller
// if (isset($prev)) {
// return $this->redirect($prev);
// } else {
// return $this->redirect(['index', 'id' => $inventory->id_inventory]);
// }
$next = InventoryItem::findNextItemAlphabetical($model->id_inventory_item);
if ( isset($next)){
if ( isset($_POST['_next']) && isset($next)){
return $this->redirect(['inventory-item/update', 'id' => $next]);
}else{
return $this->redirect(['index', 'id' => $inventory->id_inventory]);