source: branches/version-2_13-dev/data/class/pages/mypage/LC_Page_Mypage_MailView.php @ 22856

Revision 22856, 3.2 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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
24require_once CLASS_EX_REALDIR . 'page_extends/mypage/LC_Page_AbstractMypage_Ex.php';
25
26/**
27 * 受注管理メール確認 のページクラス.
28 *
29 * @package Page
30 * @author LOCKON CO.,LTD.
31 * @version $Id$
32 */
33class LC_Page_Mypage_MailView extends LC_Page_AbstractMypage_Ex
34{
35    /**
36     * Page を初期化する.
37     *
38     * @return void
39     */
40    function init()
41    {
42        parent::init();
43        $this->httpCacheControl('nocache');
44    }
45
46    /**
47     * Page のプロセス.
48     *
49     * @return void
50     */
51    function process()
52    {
53        parent::process();
54    }
55
56    /**
57     * Page のAction.
58     *
59     * @return void
60     */
61    function action()
62    {
63        $objCustomer = new SC_Customer_Ex();
64        if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
65            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
66        }
67
68        $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id'));
69
70        if (empty($arrMailView)) {
71            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
72        }
73
74        $this->tpl_subject  = $arrMailView[0]['subject'];
75        $this->tpl_body     = $arrMailView[0]['mail_body'];
76
77        if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) {
78            $this->setTemplate('mypage/mail_view.tpl');
79        } else {
80            $this->tpl_title    = 'メール履歴詳細';
81            $this->tpl_mainpage = 'mypage/mail_view.tpl';
82        }
83
84        switch ($this->getMode()) {
85            case 'getDetail':
86
87                echo SC_Utils_Ex::jsonEncode($arrMailView);
88                SC_Response_Ex::actionExit();
89                break;
90            default:
91                break;
92        }
93
94    }
95
96    /**
97     * デストラクタ.
98     *
99     * @return void
100     */
101    function destroy()
102    {
103        parent::destroy();
104    }
105
106    /**
107     * GETで指定された受注idのメール送信内容を返す
108     *
109     * @param mixed $send_id
110     * @param mixed $customer_id
111     * @access private
112     * @return array
113     */
114    function lfGetMailView($send_id, $customer_id)
115    {
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
121        return $objQuery->select($col, 'dtb_mail_history LEFT JOIN dtb_order ON dtb_mail_history.order_id = dtb_order.order_id', $where, $arrWhereVal);
122    }
123}
Note: See TracBrowser for help on using the repository browser.