[15631] | 1 | <?php |
---|
| 2 | /* |
---|
[16582] | 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[21867] | 5 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
[15631] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
[16582] | 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
[15631] | 22 | */ |
---|
| 23 | |
---|
| 24 | // {{{ requires |
---|
[20534] | 25 | require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php'; |
---|
[15631] | 26 | |
---|
| 27 | /** |
---|
[21783] | 28 | * オーナーズストア:インストールログ のページクラス. |
---|
[15631] | 29 | * |
---|
| 30 | * @package Page |
---|
| 31 | * @author LOCKON CO.,LTD. |
---|
| 32 | * @version $Id$ |
---|
| 33 | */ |
---|
[20345] | 34 | class LC_Page_Admin_OwnersStore_Log extends LC_Page_Admin_Ex { |
---|
[15631] | 35 | |
---|
| 36 | // }}} |
---|
| 37 | // {{{ functions |
---|
| 38 | |
---|
| 39 | /** |
---|
| 40 | * Page を初期化する. |
---|
| 41 | * |
---|
| 42 | * @return void |
---|
| 43 | */ |
---|
| 44 | function init() { |
---|
| 45 | parent::init(); |
---|
| 46 | |
---|
[16419] | 47 | $this->tpl_mainpage = 'ownersstore/log.tpl'; |
---|
| 48 | $this->tpl_mainno = 'ownersstore'; |
---|
[15631] | 49 | $this->tpl_subno = 'log'; |
---|
[20911] | 50 | $this->tpl_maintitle = 'オーナーズストア'; |
---|
[15631] | 51 | $this->tpl_subtitle = 'ログ管理'; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | /** |
---|
| 55 | * Page のプロセス. |
---|
| 56 | * |
---|
| 57 | * @return void |
---|
| 58 | */ |
---|
| 59 | function process() { |
---|
[19661] | 60 | $this->action(); |
---|
| 61 | $this->sendResponse(); |
---|
| 62 | } |
---|
[15632] | 63 | |
---|
[19661] | 64 | /** |
---|
| 65 | * Page のアクション. |
---|
| 66 | * |
---|
| 67 | * @return void |
---|
| 68 | */ |
---|
| 69 | function action() { |
---|
[20041] | 70 | switch ($this->getMode()) { |
---|
[21526] | 71 | case 'detail': |
---|
| 72 | $objForm = $this->initParam(); |
---|
| 73 | if ($objForm->checkError()) { |
---|
| 74 | SC_Utils_Ex::sfDispError(''); |
---|
| 75 | } |
---|
| 76 | $this->arrLogDetail = $this->getLogDetail($objForm->getValue('log_id')); |
---|
| 77 | if (count($this->arrLogDetail) == 0) { |
---|
| 78 | SC_Utils_Ex::sfDispError(''); |
---|
| 79 | } |
---|
| 80 | $this->tpl_mainpage = 'ownersstore/log_detail.tpl'; |
---|
| 81 | break; |
---|
| 82 | default: |
---|
| 83 | break; |
---|
[16663] | 84 | } |
---|
[16868] | 85 | $this->arrInstallLogs = $this->getLogs(); |
---|
[15631] | 86 | } |
---|
| 87 | |
---|
| 88 | /** |
---|
| 89 | * デストラクタ. |
---|
| 90 | * |
---|
| 91 | * @return void |
---|
| 92 | */ |
---|
| 93 | function destroy() { |
---|
| 94 | parent::destroy(); |
---|
| 95 | } |
---|
[16663] | 96 | |
---|
[16868] | 97 | function getLogs() { |
---|
| 98 | $sql =<<<END |
---|
| 99 | SELECT |
---|
| 100 | * |
---|
| 101 | FROM |
---|
| 102 | dtb_module_update_logs JOIN ( |
---|
| 103 | SELECT |
---|
| 104 | module_id, |
---|
| 105 | module_name |
---|
| 106 | FROM |
---|
| 107 | dtb_module |
---|
[21809] | 108 | ) AS modules ON dtb_module_update_logs.module_id = modules.module_id |
---|
[16868] | 109 | ORDER BY update_date DESC |
---|
| 110 | END; |
---|
[21750] | 111 | $objQuery =& SC_Query_Ex::getSingletonInstance(); |
---|
[16868] | 112 | $arrRet = $objQuery->getAll($sql); |
---|
| 113 | return isset($arrRet) ? $arrRet : array(); |
---|
[16663] | 114 | } |
---|
[16868] | 115 | |
---|
| 116 | function initParam() { |
---|
[20501] | 117 | $objForm = new SC_FormParam_Ex(); |
---|
[16868] | 118 | $objForm->addParam('log_id', 'log_id', INT_LEN, '', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 119 | $objForm->setParam($_GET); |
---|
| 120 | return $objForm; |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | function getLogDetail($log_id) { |
---|
| 124 | $sql =<<<END |
---|
| 125 | SELECT |
---|
| 126 | * |
---|
| 127 | FROM |
---|
| 128 | dtb_module_update_logs JOIN ( |
---|
| 129 | SELECT |
---|
| 130 | module_id, |
---|
| 131 | module_name |
---|
| 132 | FROM |
---|
| 133 | dtb_module |
---|
[21809] | 134 | ) AS modules ON dtb_module_update_logs.module_id = modules.module_id |
---|
[16868] | 135 | WHERE |
---|
| 136 | log_id = ? |
---|
| 137 | END; |
---|
[21750] | 138 | $objQuery =& SC_Query_Ex::getSingletonInstance(); |
---|
[16868] | 139 | $arrRet = $objQuery->getAll($sql, array($log_id)); |
---|
| 140 | return isset($arrRet[0]) ? $arrRet[0] : array(); |
---|
| 141 | } |
---|
[15631] | 142 | } |
---|