Ignore:
Timestamp:
2013/05/02 18:11:36 (11 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php

    r22584 r22796  
    3232 * @version $Id$ 
    3333 */ 
    34 class LC_Page_Admin_Basis_Mail extends LC_Page_Admin_Ex  
    35 { 
     34class LC_Page_Admin_Basis_Mail extends LC_Page_Admin_Ex { 
    3635 
    3736    // }}} 
     
    4342     * @return void 
    4443     */ 
    45     function init() 
    46     { 
     44    function init() { 
    4745        parent::init(); 
    4846        $this->tpl_mainpage = 'basis/mail.tpl'; 
     
    5856     * @return void 
    5957     */ 
    60     function process() 
    61     { 
     58    function process() { 
    6259        $this->action(); 
    6360        $this->sendResponse(); 
     
    6966     * @return void 
    7067     */ 
    71     function action() 
    72     { 
     68    function action() { 
    7369 
    7470        $masterData = new SC_DB_MasterData_Ex(); 
    75         $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); 
    7671 
    7772        $mode = $this->getMode(); 
     
    9186        switch ($mode) { 
    9287            case 'id_set': 
    93                     $mailtemplate = $objMailtemplate->get($post['template_id']); 
    94                     if ($mailtemplate) { 
    95                         $this->arrForm = $mailtemplate; 
     88                    $result = $this->lfGetMailTemplateByTemplateID($post['template_id']); 
     89                    if ($result) { 
     90                        $this->arrForm = $result[0]; 
    9691                    } else { 
    9792                        $this->arrForm['template_id'] = $post['template_id']; 
     
    107102                    } else { 
    108103                        // 正常 
    109                         $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id'], $objMailtemplate); 
     104                        $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id']); 
    110105 
    111106                        // 完了メッセージ 
     
    125120     * @return void 
    126121     */ 
    127     function destroy() 
    128     { 
     122    function destroy() { 
    129123        parent::destroy(); 
    130124    } 
    131125 
    132     function lfRegistMailTemplate($post, $member_id, SC_Helper_Mailtemplate_Ex $objMailtemplate) 
    133     { 
    134         $post['creator_id'] = $member_id; 
    135         $objMailtemplate->save($post); 
     126    function lfGetMailTemplateByTemplateID($template_id) { 
     127        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     128 
     129        $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?'; 
     130        return $objQuery->getAll($sql, array($template_id)); 
    136131    } 
    137132 
    138     function lfInitParam($mode, &$objFormParam) 
    139     { 
     133    function lfRegistMailTemplate($post, $member_id) { 
     134        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     135 
     136        $post['creator_id'] = $member_id; 
     137        $post['update_date'] = 'CURRENT_TIMESTAMP'; 
     138 
     139        $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?'; 
     140        $template_data = $objQuery->getAll($sql, array($post['template_id'])); 
     141        if ($template_data) { 
     142            $sql_where = 'template_id = ?'; 
     143            $objQuery->update('dtb_mailtemplate', $post, $sql_where, array(addslashes($post['template_id']))); 
     144        } else { 
     145            $objQuery->insert('dtb_mailtemplate', $post); 
     146        } 
     147 
     148    } 
     149 
     150    function lfInitParam($mode, &$objFormParam) { 
    140151        switch ($mode) { 
    141152            case 'regist': 
    142153                $objFormParam->addParam('メールタイトル', 'subject', MTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 
    143                 $objFormParam->addParam('ヘッダー', 'header', LTEXT_LEN, 'KVa', array('SPTAB_CHECK','MAX_LENGTH_CHECK')); 
    144                 $objFormParam->addParam('フッター', 'footer', LTEXT_LEN, 'KVa', array('SPTAB_CHECK','MAX_LENGTH_CHECK')); 
     154                $objFormParam->addParam('ヘッダー', 'header', LTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 
     155                $objFormParam->addParam('フッター', 'footer', LTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 
    145156                $objFormParam->addParam('テンプレート', 'template_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 
    146157            case 'id_set': 
Note: See TracChangeset for help on using the changeset viewer.