OSDN Git Service

ページIDテーブル仕様変更。
authornaoki hirata <naoki@magic3.org>
Thu, 18 Aug 2016 22:03:28 +0000 (07:03 +0900)
committernaoki hirata <naoki@magic3.org>
Thu, 18 Aug 2016 22:03:28 +0000 (07:03 +0900)
include/sql/create_base.sql
include/sql/update/2016053001_to_2016073101.sql [new file with mode: 0644]
widgets/admin/analytics/include/db/admin_analyticsDb.php
widgets/admin_main/include/container/admin_mainPageheadWidgetContainer.php
widgets/admin_main/include/container/admin_mainPageinfoWidgetContainer.php
widgets/admin_main/include/db/admin_mainDb.php

index 9c370aa..049c7b7 100644 (file)
@@ -785,7 +785,7 @@ CREATE TABLE _page_id (
     pg_editable          BOOLEAN        DEFAULT true                  NOT NULL,      -- データ編集可能かどうか\r
     pg_available         BOOLEAN        DEFAULT true                  NOT NULL,      -- メニューから選択可能かどうか\r
     pg_admin_menu        BOOLEAN        DEFAULT false                 NOT NULL,      -- 管理メニューを表示するかどうか(ページID種別がアクセスポイント時。初期値。)\r
-    pg_analytics         BOOLEAN        DEFAULT false                 NOT NULL,      -- アクセス解析対象かどうか(ページID種別がアクセスポイント時)\r
+    pg_analytics         BOOLEAN        DEFAULT false                 NOT NULL,      -- アクセス解析対象かどうか(ページID種別がアクセスポイント時)(廃止予定)\r
     PRIMARY KEY  (pg_id, pg_type)\r
 ) ENGINE=innodb;\r
 \r
diff --git a/include/sql/update/2016053001_to_2016073101.sql b/include/sql/update/2016053001_to_2016073101.sql
new file mode 100644 (file)
index 0000000..21cd0bb
--- /dev/null
@@ -0,0 +1,35 @@
+-- *
+-- * バージョンアップ用スクリプト
+-- *
+-- * PHP versions 5
+-- *
+-- * LICENSE: This source file is licensed under the terms of the GNU General Public License.
+-- *
+-- * @package    Magic3 Framework
+-- * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
+-- * @copyright  Copyright 2006-2016 Magic3 Project.
+-- * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
+-- * @version    SVN: $Id$
+-- * @link       http://www.magic3.org
+-- *
+-- --------------------------------------------------------------------------------------------------
+-- バージョンアップ用スクリプト
+-- --------------------------------------------------------------------------------------------------
+
+-- *** システムベーステーブル ***
+-- ウィジェット情報マスター
+ALTER TABLE _widgets ADD wd_enable_content  BOOLEAN        DEFAULT false                 NOT NULL;      -- コンテンツ組み込み可能かどうか
+
+-- ページIDマスター
+ALTER TABLE _page_id ADD pg_frontend           BOOLEAN        DEFAULT false                  NOT NULL;      -- フロント画面用かどうか(ページID種別がアクセスポイント時)、pg_analyticsは廃止
+DELETE FROM _page_id WHERE pg_type = 0;
+INSERT INTO _page_id 
+(pg_id,          pg_type, pg_default_sub_id, pg_path,       pg_name,                            pg_description,                       pg_priority, pg_device_type, pg_active, pg_visible, pg_mobile, pg_editable, pg_admin_menu, pg_frontend) VALUES
+('index',        0,       'content',         'index',       'PC用アクセスポイント',             'PC用アクセスポイント',               0,           0,              true,      true,       false,     true,        true,          true),
+('s_index',      0,       'front',           's/index',     'スマートフォン用アクセスポイント', 'スマートフォン用アクセスポイント',   1,           2,              true,      true,       false,     true,        false,         true),
+('m_index',      0,       'front',           'm/index',     '携帯用アクセスポイント',           '携帯用アクセスポイント',             2,           1,              true,      true,       true,      true,        false,         true),
+('admin_index',  0,       'content',         'admin/index', '管理用アクセスポイント',           '管理用アクセスポイント',             3,           0,              true,      true,       false,     false,       false,         false),
+('connector',    0,       'content',         'connector',   'サーバ接続用アクセスポイント',     'サーバ接続用アクセスポイント',       4,           0,              true,      true,       false,     false,       false,         false);
+
+-- *** システム標準テーブル ***
+
index ce4b030..ac4eda7 100644 (file)
@@ -529,7 +529,7 @@ class admin_analyticsDb extends BaseDb
        {
                $queryStr  = 'SELECT * FROM _page_id ';
                $queryStr .=   'WHERE pg_type = 0 ';                    // アクセスポイント
-               $queryStr .=     'AND pg_analytics = true ';    // アクセス解析あり
+               $queryStr .=     'AND pg_frontend = true ';             // フロント画面
                $queryStr .=     'AND pg_visible = true ';              // 公開しているアクセスポイントのみ
                $queryStr .=     'AND pg_active = true ';               // アクセス許可しているアクセスポイントのみ
                $queryStr .=   'ORDER BY pg_priority';
index 4afac1c..78d893e 100644 (file)
@@ -179,7 +179,7 @@ class admin_mainPageheadWidgetContainer extends admin_mainConfigbasicBaseWidgetC
        function pageIdLoop($index, $fetchedRow, $param)
        {
                // フロント画面用アクセスポイントのみ取得
-               if (!$fetchedRow['pg_analytics']) return true;
+               if (!$fetchedRow['pg_frontend']) return true;
                
                // 現在有効なアクセスポイントのみ取得
                $deviceType = $fetchedRow['pg_device_type'];            // デバイスタイプ
index fc84448..38333db 100644 (file)
@@ -213,7 +213,7 @@ class admin_mainPageinfoWidgetContainer extends admin_mainMainteBaseWidgetContai
        function pageIdLoop($index, $fetchedRow, $param)
        {
                // 開発モードのときはすべて表示、開発モードでないときはフロント画面用アクセスポイントのみ取得
-               if (!$this->developMode && !$fetchedRow['pg_analytics']) return true;
+               if (!$this->developMode && !$fetchedRow['pg_frontend']) return true;
                
                // デフォルトのページIDを取得
                if (empty($this->pageId)) $this->pageId = $fetchedRow['pg_id'];
index 844ff1e..2ff19e4 100644 (file)
@@ -609,7 +609,7 @@ class admin_mainDb extends BaseDb
                $params = array();
                $queryStr  = 'SELECT * FROM _page_id ';
                $queryStr .= 'WHERE pg_type = 0 ';                      // アクセスポイント
-               $queryStr .=   'AND pg_analytics = true ';              // フロント画面用
+               $queryStr .=   'AND pg_frontend = true ';               // フロント画面用
                if ($activeOnly) $queryStr .=  'AND pg_active = true '; // 有効
                $queryStr .= 'ORDER BY pg_priority';
                $this->selectLoop($queryStr, $params, $callback);
@@ -1435,7 +1435,7 @@ class admin_mainDb extends BaseDb
                // フロント画面のアクセスポイントを取得
                $queryStr  = 'SELECT * FROM _page_id ';
                $queryStr .=   'WHERE pg_type = 0 ';
-               $queryStr .=     'AND pg_analytics = true';
+               $queryStr .=     'AND pg_frontend = true';
                $ret = $this->selectRecords($queryStr, array(), $rows);
                if ($ret){
                        for ($i = 0; $i < count($rows); $i++){
@@ -2909,7 +2909,7 @@ class admin_mainDb extends BaseDb
                $addWhere = '';
                $params = array();
                $queryStr  = 'SELECT * FROM _menu_id ';
-               $queryStr .=   'LEFT JOIN _page_id ON mn_device_type = pg_device_type AND pg_type = 0 AND pg_analytics = true ';
+               $queryStr .=   'LEFT JOIN _page_id ON mn_device_type = pg_device_type AND pg_type = 0 AND pg_frontend = true ';
                if ($deviceType != -1){
                        $addWhere = 'WHERE mn_device_type = ? ';
                        $params[] = $deviceType;