Add a config item for knowing if v2 migration took place
这个提交包含在:
父节点
08d6294e34
当前提交
22f421e9eb
共有 4 个文件被更改,包括 59 次插入 和 21 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
| be upgraded / downgraded to.
|
| be upgraded / downgraded to.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['migration_version'] = 101;
|
$config['migration_version'] = 102;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -11,28 +11,33 @@ class Welcome extends CI_Controller {
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$data['page_title'] = "Welcome to Cloudlog Version 2.0";
|
|
||||||
|
|
||||||
// load stations model
|
if($this->config->item('option_version2_trigger') == "false") {
|
||||||
$this->load->model('stations');
|
$data['page_title'] = "Welcome to Cloudlog Version 2.0";
|
||||||
$data['CountAllStationLocations'] = $this->stations->CountAllStationLocations();
|
|
||||||
|
|
||||||
// load logbooks model
|
// load stations model
|
||||||
$this->load->model('logbooks_model');
|
$this->load->model('stations');
|
||||||
$data['NumberOfStationLogbooks'] = $this->logbooks_model->CountAllStationLogbooks();
|
$data['CountAllStationLocations'] = $this->stations->CountAllStationLocations();
|
||||||
|
|
||||||
// load api model
|
// load logbooks model
|
||||||
$this->load->model('api_model');
|
$this->load->model('logbooks_model');
|
||||||
$data['NumberOfAPIKeys'] = $this->api_model->CountKeysWithNoUserID();
|
$data['NumberOfStationLogbooks'] = $this->logbooks_model->CountAllStationLogbooks();
|
||||||
|
|
||||||
// load note model
|
// load api model
|
||||||
$this->load->model('note');
|
$this->load->model('api_model');
|
||||||
$data['NumberOfNotes'] = $this->note->CountAllNotes();
|
$data['NumberOfAPIKeys'] = $this->api_model->CountKeysWithNoUserID();
|
||||||
|
|
||||||
// load views
|
// load note model
|
||||||
$this->load->view('interface_assets/mini_header', $data);
|
$this->load->model('note');
|
||||||
$this->load->view('welcome/index');
|
$data['NumberOfNotes'] = $this->note->CountAllNotes();
|
||||||
$this->load->view('interface_assets/footer');
|
|
||||||
|
// load views
|
||||||
|
$this->load->view('interface_assets/mini_header', $data);
|
||||||
|
$this->load->view('welcome/index');
|
||||||
|
$this->load->view('interface_assets/footer');
|
||||||
|
} else {
|
||||||
|
redirect('login');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function locationsclaim() {
|
public function locationsclaim() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This migration creates a table called options which will hold global options needed within cloudlog
|
||||||
|
* removing the need for lots of configuration files.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Migration_add_version_two_trigger_to_options extends CI_Migration {
|
||||||
|
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$data = array(
|
||||||
|
array('option_name' => "version2_trigger", 'option_value' => "false", 'autoload' => "yes"),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->db->insert_batch('options', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
// No option to down
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
<?php
|
||||||
|
echo $this->config->item('option_version2_trigger');
|
||||||
|
?>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -149,4 +152,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<button class="btn btn-primary" onClick="window.location.reload();">Check if Migration Complete</button>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
正在加载…
在新工单中引用