Changeset 20221 for branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php
- Timestamp:
- 2011/02/20 02:34:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php
r20216 r20221 80 80 // POST値の取得 81 81 $objFormParam->setParam($_POST); 82 $objFormParam->convParam(); 82 83 $this->tpl_order_id = $objFormParam->getValue('order_id'); 83 84 … … 88 89 break; 89 90 case 'send': 90 // 入力値の変換 TODO ここ気持ち悪いんだ returnの時にやってなかったからもって上でやっていいものなのかどうか。 91 $objFormParam->convParam(); 92 $sendStatus = $this->doSend($objFormParam, 93 $objFormParam->getValue('order_id'), 94 $objFormParam->getValue('template_id'), 95 $objFormParam->getValue('subject'), 96 $objFormParam->getValue('header'), 97 $objFormParam->getValue('footer')); 98 if($sendStatus){ 91 $sendStatus = $this->doSend($objFormParam); 92 if($sendStatus === true){ 99 93 SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH); 100 94 exit; 95 }else{ 96 $this->arrErr = $sendStatus; 101 97 } 102 98 case 'confirm': 103 // 入力値の変換 ここ気持ち悪いんだ 104 $objFormParam->convParam(); 105 $status = $this->confirm($objFormParam, 106 $objFormParam->getValue('order_id'), 107 $objFormParam->getValue('template_id'), 108 $objFormParam->getValue('subject'), 109 $objFormParam->getValue('header'), 110 $objFormParam->getValue('footer')); 111 if($status){ 99 $status = $this->confirm($objFormParam); 100 if($status === true){ 101 $this->arrHidden = $objFormParam->getHashArray(); 112 102 return ; 103 }else{ 104 $this->arrErr = $status; 113 105 } 114 106 break; 115 107 case 'change': 116 $ this->changeData($objFormParam);108 $objFormParam = $this->changeData($objFormParam); 117 109 break; 118 110 } … … 142 134 * @param SC_FormParam $objFormParam 143 135 */ 144 function doSend(&$objFormParam,$order_id, $template_id, $subject, $header, $footer){ 145 // 入力値の変換 146 $objFormParam->convParam(); 147 148 $this->arrErr = $objFormParam->checkerror(); 136 function doSend(&$objFormParam){ 137 $arrErr = $objFormParam->checkerror(); 138 149 139 // メールの送信 150 if (count($ this->arrErr) == 0) {140 if (count($arrErr) == 0) { 151 141 // 注文受付メール 152 142 $objMail = new SC_Helper_Mail_Ex(); 153 $objSendMail = $objMail->sfSendOrderMail($order_id, $template_id, $subject, $header, $footer); 143 $objSendMail = $objMail->sfSendOrderMail($objFormParam->getValue('order_id'), 144 $objFormParam->getValue('template_id'), 145 $objFormParam->getValue('subject'), 146 $objFormParam->getValue('header'), 147 $objFormParam->getValue('footer')); 154 148 // TODO $SC_SendMail から送信がちゃんと出来たか確認できたら素敵。 155 149 return true; 156 150 } 157 return false;151 return $arrErr; 158 152 } 159 153 … … 161 155 * 確認画面を表示する為の準備 162 156 * @param SC_FormParam $objFormParam 163 * @param int $order_id 164 * @param int $template_id 165 * @param string $subject 166 * @param string $header 167 * @param string $footer 168 */ 169 function confirm(&$objFormParam,$order_id, $template_id, $subject, $header, $footer){ 170 // 入力値の引き継ぎ 171 $this->arrHidden = $objFormParam->getHashArray(); 172 $this->arrErr = $objFormParam->checkerror(); 157 */ 158 function confirm(&$objFormParam){ 159 $arrErr = $objFormParam->checkerror(); 173 160 // メールの送信 174 if (count($ this->arrErr) == 0) {161 if (count($arrErr) == 0) { 175 162 // 注文受付メール(送信なし) 176 163 $objMail = new SC_Helper_Mail_Ex(); 177 164 $objSendMail = $objMail->sfSendOrderMail( 178 $o rder_id,179 $ template_id,180 $ subject,181 $ header,182 $ footer, false);183 165 $objFormParam->getValue('order_id'), 166 $objFormParam->getValue('template_id'), 167 $objFormParam->getValue('subject'), 168 $objFormParam->getValue('header'), 169 $objFormParam->getValue('footer'), false); 170 184 171 $this->tpl_subject = $objFormParam->getValue('subject'); 185 172 $this->tpl_body = mb_convert_encoding( $objSendMail->body, CHAR_CODE, "auto" ); … … 188 175 return true; 189 176 } 190 return false;191 } 192 193 /** 194 * 177 return $arrErr; 178 } 179 180 /** 181 * 195 182 * テンプレートの文言をフォームに入れる。 196 183 * @param SC_FormParam $objFormParam 197 184 */ 198 185 function changeData(&$objFormParam){ 199 $objFormParam->setValue('template_id', $objFormParam->getValue('template_id'));200 186 if(SC_Utils_Ex::sfIsInt($objFormParam->getValue('template_id'))) { 201 187 $objQuery =& SC_Query::getSingletonInstance(); 202 188 $where = "template_id = ?"; 203 189 $mailTemplates = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($objFormParam->getValue('template_id'))); 190 if(!is_null($mailTemplates )){ 191 foreach(array('subject','header','footer') as $key){ 192 $objFormParam->setValue($key,$mailTemplates[$key]); 193 } 194 }else{ 195 196 } 204 197 $objFormParam->setParam($mailTemplates[0]); 205 } 198 }else{ 199 foreach(array('subject','header','footer') as $key){ 200 $objFormParam->setValue($key,""); 201 } 202 } 203 return $objFormParam; 206 204 } 207 205
Note: See TracChangeset
for help on using the changeset viewer.