Ignore:
Timestamp:
2012/05/10 17:57:04 (12 years ago)
Author:
adachi
Message:

#1797 #1798 メールテンプレートでfilterが動作するように修正

Location:
branches/version-2_12-dev/data/class
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_View.php

    r21765 r21820  
    7272            $this->_smarty->force_compile = false; 
    7373        } 
     74        // 各filterをセットします. 
     75        $this->registFilter(); 
    7476    } 
    7577 
     
    100102            } 
    101103        } 
    102         // 各filterをセットします. 
    103         $this->registFilter(); 
    104104        $res =  $this->_smarty->fetch($template); 
    105105        if (ADMIN_MODE == '1') { 
     
    136136     */ 
    137137    function prefilter_transform($source, &$smarty) { 
    138         // フックポイントを実行. 
    139         $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->objPage->plugin_activate_flg); 
    140         $objPlugin->doAction('prefilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); 
     138        if (!is_null($this->objPage)) { 
     139            // フックポイントを実行. 
     140            $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->objPage->plugin_activate_flg); 
     141            $objPlugin->doAction('prefilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); 
     142        } 
    141143        return $source; 
    142144    } 
     
    149151     */ 
    150152    function outputfilter_transform($source, &$smarty) { 
    151         // フックポイントを実行. 
    152         $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->objPage->plugin_activate_flg); 
    153         $objPlugin->doAction('outputfilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); 
     153        if (!is_null($this->objPage)) { 
     154            // フックポイントを実行. 
     155            $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->objPage->plugin_activate_flg); 
     156            $objPlugin->doAction('outputfilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); 
     157        } 
    154158        return $source; 
    155159    } 
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Mail.php

    r21767 r21820  
    3535 
    3636    /** 
     37     * LC_Pageオブジェクト. 
     38     *  
     39     * @var LC_Page 
     40     */ 
     41    protected $objPage; 
     42 
     43    /** 
    3744     * コンストラクタ. 
    3845     */ 
     
    4350    } 
    4451 
     52    /** 
     53     * LC_Pageオブジェクトをセットします. 
     54     *  
     55     * @param LC_Page $objPage 
     56     */ 
     57    function setPage(LC_Page $objPage) { 
     58        $this->objPage = $objPage; 
     59    } 
     60 
     61    /** 
     62     * LC_Pageオブジェクトを返します. 
     63     *  
     64     * @return LC_Page 
     65     */ 
     66    function getPage() { 
     67        return $this->objPage; 
     68    } 
     69     
    4570    /* DBに登録されたテンプレートメールの送信 */ 
    4671    function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = '', $from_name = '', $reply_to = '', $bcc = '') { 
     
    5782 
    5883        $objMailView = new SC_SiteView_Ex(); 
     84        $objMailView->setPage($this->getPage()); 
    5985        // メール本文の取得 
    6086        $objMailView->assignobj($objPage); 
     
    150176        $arrTplVar->tpl_user_point = $objCustomer->getValue('point'); 
    151177 
     178        $objMailView = null; 
    152179        if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { 
    153180            $objMailView = new SC_MobileView_Ex(); 
     
    156183        } 
    157184        // メール本文の取得 
     185        $objMailView->setPage($this->getPage()); 
    158186        $objMailView->assignobj($arrTplVar); 
    159187        $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]); 
     
    182210    function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) { 
    183211        $objMailView = new SC_SiteView_Ex(); 
     212        $objMailView->setPage($this->getPage()); 
    184213        $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); 
    185214        // メール本文の取得 
     
    217246        if (empty($objMailView)) { 
    218247            $objMailView = new SC_SiteView_Ex(); 
     248            $objMailView->setPage($this->getPage()); 
    219249        } 
    220250        $objTplAssign = new stdClass; 
     
    284314 
    285315        $objMailText = new SC_SiteView_Ex(); 
     316        $objMailText->setPage($this->getPage()); 
    286317        $objMailText->assign('CONF', $CONF); 
    287318        $objMailText->assign('name01', $arrCustomerData['name01']); 
  • branches/version-2_12-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer.php

    r21743 r21820  
    206206        // 登録メール再送 
    207207        $objHelperMail = new SC_Helper_Mail_Ex(); 
     208        $objHelperMail->setPage($this); 
    208209        $objHelperMail->sfSendRegistMail($arrData['secret_key'], $customer_id); 
    209210        return true; 
  • branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php

    r21743 r21820  
    172172            foreach ($order_id_array as $order_id){ 
    173173                $objMail = new SC_Helper_Mail_Ex(); 
     174                $objMail->setPage($this); 
    174175                $objSendMail = $objMail->sfSendOrderMail($order_id, 
    175176                $objFormParam->getValue('template_id'), 
     
    194195            // 注文受付メール(送信なし) 
    195196            $objMail = new SC_Helper_Mail_Ex(); 
     197            $objMail->setPage($this); 
    196198            $objSendMail = $objMail->sfSendOrderMail( 
    197             $objFormParam->getValue('order_id'), 
    198             $objFormParam->getValue('template_id'), 
    199             $objFormParam->getValue('subject'), 
    200             $objFormParam->getValue('header'), 
    201             $objFormParam->getValue('footer'), false); 
     199                $objFormParam->getValue('order_id'), 
     200                $objFormParam->getValue('template_id'), 
     201                $objFormParam->getValue('subject'), 
     202                $objFormParam->getValue('header'), 
     203                $objFormParam->getValue('footer'), false); 
    202204 
    203205            $this->tpl_subject = $objFormParam->getValue('subject'); 
  • branches/version-2_12-dev/data/class/pages/contact/LC_Page_Contact.php

    r21743 r21820  
    197197        $objPage->tpl_infoemail = $CONF['email02']; 
    198198        $helperMail = new SC_Helper_Mail_Ex(); 
     199        $helperMail->setPage($this); 
    199200        $helperMail->sfSendTemplateMail( 
    200201            $objPage->arrForm['email']['value'],            // to 
  • branches/version-2_12-dev/data/class/pages/entry/LC_Page_Entry.php

    r21743 r21820  
    236236 
    237237        $objMailText    = new SC_SiteView_Ex(); 
     238        $objMailText->setPage($this); 
    238239        $objMailText->assign('CONF', $CONF); 
    239240        $objMailText->assign('name01', $arrForm['name01']); 
     
    243244 
    244245        $objHelperMail  = new SC_Helper_Mail_Ex(); 
     246        $objHelperMail->setPage($this); 
    245247 
    246248        // 仮会員が有効の場合 
  • branches/version-2_12-dev/data/class/pages/forgot/LC_Page_Forgot.php

    r21743 r21820  
    285285        // パスワード変更お知らせメール送信 
    286286        $objMailText = new SC_SiteView_Ex(false); 
     287        $objMailText->setPage($this); 
    287288        $objMailText->assign('customer_name', $customer_name); 
    288289        $objMailText->assign('new_password', $new_password); 
    289290        $toCustomerMail = $objMailText->fetch('mail_templates/forgot_mail.tpl'); 
    290         $objHelperMail  = new SC_Helper_Mail_Ex(); 
     291 
     292        $objHelperMail = new SC_Helper_Mail_Ex(); 
     293        $objHelperMail->setPage($this); 
     294         
    291295        // メール送信オブジェクトによる送信処理 
    292296        $objMail = new SC_SendMail(); 
  • branches/version-2_12-dev/data/class/pages/regist/LC_Page_Regist.php

    r21743 r21820  
    149149        $objCustomer    = new SC_Customer_Ex(); 
    150150        $objHelperMail  = new SC_Helper_Mail_Ex(); 
     151        $objHelperMail->setPage($this); 
    151152        $CONF           = SC_Helper_DB_Ex::sfGetBasisData(); 
    152153 
     
    158159        //-- メール送信 
    159160        $objMailText    = new SC_SiteView_Ex(); 
     161        $objMailText->setPage($this); 
    160162        $objMailText->assign('CONF', $CONF); 
    161163        $objMailText->assign('name01', $data['name01']); 
  • branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php

    r21743 r21820  
    7777        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    7878        $objPurchase = new SC_Helper_Purchase_Ex(); 
    79  
     79        $objHelperMail = new SC_Helper_Mail(); 
     80        $objHelperMail->setPage($this); 
     81         
    8082        $this->is_multiple = $objPurchase->isMultiple(); 
    8183 
     
    164166                else { 
    165167                    $objPurchase->completeOrder(ORDER_NEW); 
    166                     $objPurchase->sendOrderMail($this->arrForm['order_id']); 
    167  
     168                    $template_id = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? 2 : 1; 
     169                    $objHelperMail->sfSendOrderMail( 
     170                            $this->arrForm['order_id'], 
     171                            $template_id); 
    168172 
    169173                    SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); 
Note: See TracChangeset for help on using the changeset viewer.