1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
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. |
---|
22 | */ |
---|
23 | |
---|
24 | // {{{ requires |
---|
25 | require_once CLASS_EX_REALDIR . 'page_extends/mypage/LC_Page_AbstractMypage_Ex.php'; |
---|
26 | |
---|
27 | /** |
---|
28 | * 受注管理メール確認 のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id$ |
---|
33 | */ |
---|
34 | class LC_Page_Mypage_MailView extends LC_Page_AbstractMypage_Ex { |
---|
35 | |
---|
36 | // }}} |
---|
37 | // {{{ functions |
---|
38 | |
---|
39 | /** |
---|
40 | * Page を初期化する. |
---|
41 | * |
---|
42 | * @return void |
---|
43 | */ |
---|
44 | function init() { |
---|
45 | parent::init(); |
---|
46 | $this->httpCacheControl('nocache'); |
---|
47 | } |
---|
48 | |
---|
49 | /** |
---|
50 | * Page のプロセス. |
---|
51 | * |
---|
52 | * @return void |
---|
53 | */ |
---|
54 | function process() { |
---|
55 | parent::process(); |
---|
56 | } |
---|
57 | |
---|
58 | /** |
---|
59 | * Page のAction. |
---|
60 | * |
---|
61 | * @return void |
---|
62 | */ |
---|
63 | function action() { |
---|
64 | |
---|
65 | $objCustomer = new SC_Customer_Ex(); |
---|
66 | if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) { |
---|
67 | SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); |
---|
68 | } |
---|
69 | |
---|
70 | $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id')); |
---|
71 | |
---|
72 | if (empty($arrMailView)) { |
---|
73 | SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); |
---|
74 | } |
---|
75 | |
---|
76 | $this->tpl_subject = $arrMailView[0]['subject']; |
---|
77 | $this->tpl_body = $arrMailView[0]['mail_body']; |
---|
78 | |
---|
79 | if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) { |
---|
80 | $this->setTemplate('mypage/mail_view.tpl'); |
---|
81 | } else { |
---|
82 | $this->tpl_title = 'メール履歴詳細'; |
---|
83 | $this->tpl_mainpage = 'mypage/mail_view.tpl'; |
---|
84 | } |
---|
85 | |
---|
86 | switch ($this->getMode()) { |
---|
87 | case 'getDetail': |
---|
88 | |
---|
89 | echo SC_Utils_Ex::jsonEncode($arrMailView); |
---|
90 | SC_Response_Ex::actionExit(); |
---|
91 | break; |
---|
92 | default: |
---|
93 | break; |
---|
94 | } |
---|
95 | |
---|
96 | } |
---|
97 | |
---|
98 | /** |
---|
99 | * デストラクタ. |
---|
100 | * |
---|
101 | * @return void |
---|
102 | */ |
---|
103 | function destroy() { |
---|
104 | parent::destroy(); |
---|
105 | } |
---|
106 | |
---|
107 | /** |
---|
108 | * GETで指定された受注idのメール送信内容を返す |
---|
109 | * |
---|
110 | * @param mixed $send_id |
---|
111 | * @param mixed $customer_id |
---|
112 | * @access private |
---|
113 | * @return array |
---|
114 | */ |
---|
115 | function lfGetMailView($send_id, $customer_id) { |
---|
116 | $objQuery = SC_Query_Ex::getSingletonInstance(); |
---|
117 | $col = 'subject, mail_body'; |
---|
118 | $where = 'send_id = ? AND customer_id = ?'; |
---|
119 | $arrWhereVal = array($send_id, $customer_id); |
---|
120 | return $objQuery->select($col, 'dtb_mail_history LEFT JOIN dtb_order ON dtb_mail_history.order_id = dtb_order.order_id', $where, $arrWhereVal); |
---|
121 | } |
---|
122 | } |
---|