mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
Redirect to edit page after logbook creation
After creating a new logbook, users are now redirected to the edit page for the newly created logbook instead of the logbooks list. The add method in Logbooks_model now returns the new logbook ID to support this change.
This commit is contained in:
parent
93ba9f7337
commit
f2b8a3eeaa
2 changed files with 4 additions and 2 deletions
|
|
@ -43,9 +43,9 @@ class Logbooks extends CI_Controller {
|
|||
else
|
||||
{
|
||||
$this->load->model('logbooks_model');
|
||||
$this->logbooks_model->add();
|
||||
$new_logbook_id = $this->logbooks_model->add();
|
||||
|
||||
redirect('logbooks');
|
||||
redirect('logbooks/edit/' . $new_logbook_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ class Logbooks_model extends CI_Model {
|
|||
$CI->load->model('user_model');
|
||||
$CI->user_model->update_session($this->session->userdata('user_id'));
|
||||
}
|
||||
|
||||
return $logbook_id;
|
||||
}
|
||||
|
||||
function CreateDefaultLogbook() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue