From: naoki hirata Date: Sun, 12 Jan 2014 02:06:20 +0000 (+0900) Subject: 運用ログにメッセージトップ表示用のカラム追加。 X-Git-Tag: v2.8.0~10 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3b808d811bacb92aea8e29ab95c6633ac0b4679c;p=magic3%2Fmagic3.git 運用ログにメッセージトップ表示用のカラム追加。 --- diff --git a/include/db/systemDb.php b/include/db/systemDb.php index 3171d1ec..f5f367e4 100644 --- a/include/db/systemDb.php +++ b/include/db/systemDb.php @@ -3232,16 +3232,17 @@ class SystemDb extends BaseDb /** * エラーログ書き込み * - * @param string $type メッセージタイプ(info=情報,warn=警告,error=通常エラー,fatal=致命的エラー) - * @param string $method 呼び出し元クラスメソッド(通常は「__METHOD__」) - * @param string $message メッセージ - * @param int $code メッセージコード + * @param string $type メッセージタイプ(info=情報,warn=警告,error=通常エラー,fatal=致命的エラー) + * @param string $method 呼び出し元クラスメソッド(通常は「__METHOD__」) + * @param string $message メッセージ + * @param int $code メッセージコード * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return bool true=成功、false=失敗 */ - function writeErrorLog($type, $method, $message, $code = 0, $msgExt = '', $searchOption = '', $link = '') + function writeErrorLog($type, $method, $message, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { global $gEnvManager; global $gAccessManager; @@ -3262,7 +3263,11 @@ class SystemDb extends BaseDb } else { $currentVer = $gSystemManager->getSystemConfig(M3_TB_FIELD_DB_VERSION); } - if ($currentVer >= 2012090701){ + if ($currentVer >= 2014010201){ + // バージョン2014010201以降で「ol_show_top(トップ表示)」を追加(2014/1/12) + $sql = "INSERT INTO _operation_log (ol_type, ol_method, ol_message, ol_message_ext, ol_message_code, ol_access_log_serial, ol_search_option, ol_link, ol_show_top, ol_widget_id, ol_dt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, now())"; + $params = array($type, $method, $message, $msgExt, intval($code), intval($logSerial), $searchOption, $link, intval($showTo), $gEnvManager->getCurrentWidgetId()); + } else if ($currentVer >= 2012090701){ // バージョン2012090701以降で「ol_link(リンク先)」を追加(2012/9/12) $sql = "INSERT INTO _operation_log (ol_type, ol_method, ol_message, ol_message_ext, ol_message_code, ol_access_log_serial, ol_search_option, ol_link, ol_widget_id, ol_dt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, now())"; $params = array($type, $method, $message, $msgExt, intval($code), intval($logSerial), $searchOption, $link, $gEnvManager->getCurrentWidgetId()); diff --git a/include/manager/opeLogManager.php b/include/manager/opeLogManager.php index d8e4aa58..16897712 100644 --- a/include/manager/opeLogManager.php +++ b/include/manager/opeLogManager.php @@ -8,9 +8,9 @@ * * @package Magic3 Framework * @author 平田直毅(Naoki Hirata) - * @copyright Copyright 2006-2012 Magic3 Project. + * @copyright Copyright 2006-2014 Magic3 Project. * @license http://www.gnu.org/copyleft/gpl.html GPL License - * @version SVN: $Id: opeLogManager.php 5189 2012-09-12 13:45:30Z fishbone $ + * @version SVN: $Id$ * @link http://www.magic3.org */ /** @@ -62,11 +62,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeInfo($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeInfo($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('info', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('info', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * 操作要求出力 @@ -80,11 +81,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeRequest($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeRequest($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('request', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('request', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ワーニング出力 @@ -99,11 +101,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeWarn($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeWarn($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('warn', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('warn', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * 通常エラー出力 @@ -118,11 +121,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeError($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeError($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('error', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('error', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * 致命的エラー出力 @@ -137,11 +141,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeFatal($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeFatal($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('fatal', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('fatal', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ユーザ操作出力 @@ -156,11 +161,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeUserInfo($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeUserInfo($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('user_info', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('user_info', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ユーザ操作要求出力 @@ -175,11 +181,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeUserRequest($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeUserRequest($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('user_request', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('user_request', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ユーザ操作エラー出力 @@ -194,11 +201,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeUserError($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeUserError($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('user_err', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('user_err', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ユーザの不正なアクセスを出力 @@ -213,11 +221,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeUserAccess($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeUserAccess($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('user_access', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('user_access', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } /** * ユーザからの不正なデータを検出 @@ -232,11 +241,12 @@ class OpeLogManager extends Core * @param string $msgExt 詳細メッセージ * @param string $searchOption 検索用補助データ * @param string $link リンク先 + * @param bool $showTop メッセージをトップ表示するかどうか * @return なし */ - public function writeUserData($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '') + public function writeUserData($method, $msg, $code = 0, $msgExt = '', $searchOption = '', $link = '', $showTop = false) { - $this->db->writeErrorLog('user_data', $method, $msg, $code, $msgExt, $searchOption, $link); + $this->db->writeErrorLog('user_data', $method, $msg, $code, $msgExt, $searchOption, $link, $showTop); } } ?> diff --git a/include/sql/update/2013121801_to_2014010201.sql b/include/sql/update/2013121801_to_2014010201.sql new file mode 100644 index 00000000..e787e2e7 --- /dev/null +++ b/include/sql/update/2013121801_to_2014010201.sql @@ -0,0 +1,84 @@ +-- * +-- * バージョンアップ用スクリプト +-- * +-- * PHP versions 5 +-- * +-- * LICENSE: This source file is licensed under the terms of the GNU General Public License. +-- * +-- * @package Magic3 Framework +-- * @author 平田直毅(Naoki Hirata) +-- * @copyright Copyright 2006-2014 Magic3 Project. +-- * @license http://www.gnu.org/copyleft/gpl.html GPL License +-- * @version SVN: $Id$ +-- * @link http://www.magic3.org +-- * +-- -------------------------------------------------------------------------------------------------- +-- バージョンアップ用スクリプト +-- -------------------------------------------------------------------------------------------------- + +-- *** システムベーステーブル *** +-- 運用ログトラン +ALTER TABLE _operation_log ADD ol_show_top BOOLEAN DEFAULT false NOT NULL; -- メッセージをトップ表示するかどうか + +-- ページ定義マスター +DELETE FROM _page_def WHERE pd_id = 'admin_index'; +INSERT INTO _page_def +(pd_id, pd_sub_id, pd_position_id, pd_index, pd_widget_id, pd_config_id, pd_visible, pd_editable, pd_title_visible) VALUES +('admin_index', '', 'top', 1, 'admin_menu4', 0, true, false, false), +('admin_index', 'front', 'top', 2, 'admin/message', 0, true, false, false), +('admin_index', 'front', 'main', 1, 'admin_main', 0, true, false, false), +('admin_index', 'front', 'main', 2, 'admin/analytics', 0, true, true, false), +('admin_index', 'front', 'main', 3, 'admin/opelog', 0, true, true, false), +('admin_index', 'front', 'left', 1, 'admin/loginuser', 0, true, true, true), +('admin_index', 'content', 'main', 1, 'admin_main', 0, true, false, false); + +-- テンプレート情報 +DELETE FROM _templates WHERE tm_id = '_admin4'; +INSERT INTO _templates +(tm_id, tm_name, tm_type, tm_device_type, tm_mobile, tm_use_bootstrap, tm_available, tm_clean_type, tm_create_dt) VALUES +('_admin4', '_admin4', 2, 0, false, true, false, 0, now()); + +-- システム設定マスター(管理画面用デフォルトテンプレートを変更) +UPDATE _system_config SET sc_value = '_admin4' WHERE sc_id = 'admin_default_template'; + +-- 管理画面メニューデータ +DELETE FROM _nav_item; +INSERT INTO _nav_item +(ni_id, ni_parent_id, ni_index, ni_nav_id, ni_task_id, ni_view_control, ni_param, ni_name, ni_help_title, ni_help_body) VALUES +(100, 0, 0, 'admin_menu', '_page', 0, '', '画面管理', '画面管理', 'Webサイトのデザインや機能を管理します。'), +(101, 100, 0, 'admin_menu', 'pagedef', 0, '', 'PC用画面', 'PC用画面編集', 'PC用Webサイトの画面を作成します。'), +(102, 100, 1, 'admin_menu', 'pagedef_mobile', 0, '', '携帯用画面', '携帯用画面編集', '携帯用Webサイトの画面を作成します。'), +(103, 100, 2, 'admin_menu', 'pagedef_smartphone', 0, '', 'スマートフォン用画面', 'スマートフォン用画面編集', 'スマートフォン用Webサイトの画面を作成します。'), +(104, 100, 3, 'admin_menu', '_104', 3, '', 'セパレータ', '', ''), +(105, 100, 4, 'admin_menu', 'widgetlist', 0, '', 'ウィジェット管理', 'ウィジェット管理', 'ウィジェットの管理を行います。'), +(106, 100, 5, 'admin_menu', 'templist', 0, '', 'テンプレート管理', 'テンプレート管理', 'テンプレートの管理を行います。'), +(107, 100, 6, 'admin_menu', 'smenudef', 0, '', 'メニュー管理', 'メニュー管理', 'メニュー定義を管理します。'), +(199, 0, 1, 'admin_menu', '_199', 1, '', '改行', '', ''), +(200, 0, 2, 'admin_menu', '_login', 0, '', 'システム運用', '', ''), +(201, 200, 0, 'admin_menu', 'userlist', 0, '', 'ユーザ一覧', 'ユーザ一覧', 'ログイン可能なユーザを管理します。'), +(202, 200, 1, 'admin_menu', 'accesslog', 0, '', '運用状況', '運用状況', 'サイトの運用状況を表示します。'), +(299, 0, 3, 'admin_menu', '_299', 1, '', '改行', '', ''), +(300, 0, 4, 'admin_menu', '_config', 0, '', 'システム管理', '', ''), +(301, 300, 0, 'admin_menu', 'configsite', 0, '', '基本情報', '基本情報', 'サイト運営に必要な情報を設定します。'), +(302, 300, 1, 'admin_menu', 'configsys', 0, '', 'システム情報', 'システム情報', 'システム全体の設定、運用状況を管理します。'), +(303, 300, 2, 'admin_menu', 'mainte', 0, '', 'メンテナンス', 'メンテナンス', 'ファイルやDBなどのメンテナンスを行います。'), +(10100, 0, 0, 'admin_menu.en', '_page', 0, '', 'Edit Page', 'Edit Page', 'Edit page for design and function.'), +(10101, 10100, 0, 'admin_menu.en', 'pagedef', 0, '', 'PC Page', 'PC Page', 'Edit page for PC.'), +(10102, 10100, 1, 'admin_menu.en', 'pagedef_mobile', 0, '', 'Mobile Page', 'Mobile Page', 'Edit page for Mobile.'), +(10103, 10100, 2, 'admin_menu.en', 'pagedef_smartphone', 0, '', 'Smartphone Page', 'Smartphone Page', 'Edit page for Smartphone.'), +(10104, 10100, 3, 'admin_menu.en', '_10104', 3, '', 'Separator', '', ''), +(10105, 10100, 4, 'admin_menu.en', 'widgetlist', 0, '', 'Widget Administration', 'Widget Administration', 'Administrate widgets with widget config window.'), +(10106, 10100, 5, 'admin_menu.en', 'templist', 0, '', 'Template Administration', 'Template Administration', 'Administrate templates.'), +(10107, 10100, 6, 'admin_menu.en', 'smenudef', 0, '', 'Menu Administration', 'Menu Administration', 'Administrate menu definition.'), +(10199, 0, 1, 'admin_menu.en', '_10199', 1, '', 'Return', '', ''), +(10200, 0, 2, 'admin_menu.en', '_login', 0, '', 'System Operation', '', ''), +(10201, 10200, 0, 'admin_menu.en', 'userlist', 0, '', 'User List', 'User List', 'Administrate user to login.'), +(10202, 10200, 1, 'admin_menu.en', 'accesslog', 0, '', 'Site Conditions', 'Site Conditions', 'Operation log and access analytics on site.'), +(10299, 0, 3, 'admin_menu.en', '_10299', 1, '', 'Return', '', ''), +(10300, 0, 4, 'admin_menu.en', '_config', 0, '', 'System Administration', '', ''), +(10301, 10300, 0, 'admin_menu.en', 'configsite', 0, '', 'Site Information', 'Site Information', 'Configure site information.'), +(10302, 10300, 1, 'admin_menu.en', 'configsys', 0, '', 'System Information', 'System Information', 'Configure sytem information.'), +(10303, 10300, 2, 'admin_menu.en', 'mainte', 0, '', 'System Maintenance', 'System Maintenance', 'Maintenance about file system and database.'); + +-- *** システム標準テーブル *** +