Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci-application/orif/stock/Config/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
$routes->add('stock/export_excel','\Stock\Controllers\ExcelExport::index');
$routes->add('stock/export_excel/(:any)','\Stock\Controllers\ExcelExport::$1');
$routes->add('stock/item/has_items/(:any)/(:any)','\Stock\Controllers\Item::has_items/$1/$2');
$routes->add('item/(:num)','\Stock\Controllers\Item::show_item/$1');
$routes->add('item/(:any)', '\Stock\Controllers\Item::$1');
$routes->add('item_common/(:any)', '\Stock\Controllers\ItemCommon::$1');
$routes->add('picture/(:any)', '\Stock\Controllers\Picture::$1');
Expand Down
14 changes: 14 additions & 0 deletions ci-application/orif/stock/Controllers/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1209,4 +1209,18 @@ public function return_loan($id) {
// Access denied, redirect to previous URL
return redirect()->to($_SESSION['_ci_previous_url']);
}

/**
* Redirect to the item_common view corresponding to the item
*
* @param $id : The ID of the item
*/
public function show_item($id) {
$item = $this->item_model->find($id);
if (!is_null($item)) {
return redirect()->to('/item_common/view/'.$item['item_common_id']);
} else {
return redirect()->to(base_url());
}
}
}
6 changes: 3 additions & 3 deletions ci-application/orif/stock/Controllers/ItemCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public function initController(RequestInterface $request, ResponseInterface $res
}

/**
* Display details of one single item
* Display details of an item common and its related items
*
* @param $id : the item to display
* @param $id : the item common to display
* @return void
*/
public function view($id = NULL) {

if (is_null($id)) {
// No item selected, display items list
// No item common selected, display items list
return redirect()->to(base_url());
}

Expand Down