- Timestamp:
- 2013/08/24 23:33:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail.php
r23100 r23124 25 25 26 26 /** 27 * メルマガ管理 のページクラス.27 * ã¡ã«ãã¬ç®¡ç ã®ãã¼ã¸ã¯ã©ã¹. 28 28 * 29 29 * @package Page … … 34 34 { 35 35 /** 36 * Page を初期化する.37 * 38 * @return void 39 */ 40 function init()36 * Page ãåæåãã. 37 * 38 * @return void 39 */ 40 public function init() 41 41 { 42 42 parent::init(); … … 45 45 $this->tpl_subno = 'index'; 46 46 $this->tpl_pager = 'pager.tpl'; 47 $this->tpl_maintitle = 'メルマガ管理'; 48 $this->tpl_subtitle = '配信内容設定'; 47 $this->tpl_maintitle = 'ã¡ã«ãã¬ç®¡ç'; 48 $this->tpl_subtitle = 'é 49 ä¿¡å 50 容è¨å®'; 49 51 50 52 $masterData = new SC_DB_MasterData_Ex(); 51 53 $this->arrPref = $masterData->getMasterData('mtb_pref'); 52 54 $this->arrJob = $masterData->getMasterData('mtb_job'); 53 $this->arrJob[' 不明'] = '不明';55 $this->arrJob['ä¸æ'] = 'ä¸æ'; 54 56 $this->arrSex = $masterData->getMasterData('mtb_sex'); 55 57 $this->arrPageRows = $masterData->getMasterData('mtb_page_max'); 56 $this->arrHtmlmail = array('' => ' 両方', 1 => 'HTML', 2 => 'TEXT');58 $this->arrHtmlmail = array('' => '両æ¹', 1 => 'HTML', 2 => 'TEXT'); 57 59 $this->arrMailType = $masterData->getMasterData('mtb_mail_type'); 58 60 59 // 日付プルダウン設定61 // æ¥ä»ãã«ãã¦ã³è¨å® 60 62 $objDate = new SC_Date_Ex(BIRTH_YEAR); 61 63 $this->arrBirthYear = $objDate->getYear(); … … 65 67 $this->objDate = $objDate; 66 68 67 // カテゴリ一覧設定69 // ã«ãã´ãªä¸è¦§è¨å® 68 70 $objDb = new SC_Helper_DB_Ex(); 69 71 $this->arrCatList = $objDb->sfGetCategoryList(); 70 72 71 // テンプレート一覧設定73 // ãã³ãã¬ã¼ãä¸è¦§è¨å® 72 74 $this->arrTemplate = $this->lfGetMailTemplateList(SC_Helper_Mail_Ex::sfGetMailmagaTemplate()); 73 75 … … 76 78 77 79 /** 78 * Page のプロセス.79 * 80 * @return void 81 */ 82 function process()80 * Page ã®ããã»ã¹. 81 * 82 * @return void 83 */ 84 public function process() 83 85 { 84 86 $this->action(); … … 87 89 88 90 /** 89 * Page のアクション.90 * 91 * @return void 92 */ 93 function action()94 { 95 // パラメーター管理クラス91 * Page ã®ã¢ã¯ã·ã§ã³. 92 * 93 * @return void 94 */ 95 public function action() 96 { 97 // ãã©ã¡ã¼ã¿ã¼ç®¡çã¯ã©ã¹ 96 98 $objFormParam = new SC_FormParam_Ex(); 97 99 $this->lfInitParamSearchCustomer($objFormParam); 98 100 $objFormParam->setParam($_POST); 99 101 100 // パラメーター読み込み102 // ãã©ã¡ã¼ã¿ã¼èªã¿è¾¼ã¿ 101 103 $this->arrHidden = $objFormParam->getSearchArray(); 102 104 103 // 入力パラメーターチェック 105 // å 106 ¥åãã©ã¡ã¼ã¿ã¼ãã§ã㯠104 107 $this->arrErr = SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam); 105 108 $this->arrForm = $objFormParam->getFormParamList(); 106 109 if (!SC_Utils_Ex::isBlank($this->arrErr)) return; 107 110 108 // モードによる処理切り替え111 // ã¢ã¼ãã«ããå¦çåãæ¿ã 109 112 switch ($this->getMode()) { 110 // 配信先検索 113 // é 114 ä¿¡å 115 æ¤ç´¢ 111 116 case 'search': 112 117 case 'back': … … 114 119 $this->arrPagenavi = $this->objNavi->arrPagenavi; 115 120 break; 116 // input:検索結果画面「配信内容を設定する」押下後 121 // input:æ¤ç´¢çµæç»é¢ãé 122 ä¿¡å 123 容ãè¨å®ãããæ¼ä¸å¾ 117 124 case 'input': 118 125 $this->tpl_mainpage = 'mail/input.tpl'; 119 126 break; 120 // template: テンプレート選択時127 // template:ãã³ãã¬ã¼ãé¸ææ 121 128 case 'template': 122 129 case 'regist_back': … … 125 132 $this->lfAddParamSelectTemplate($objFormParam); 126 133 $this->lfGetTemplateData($objFormParam, $_POST['template_id']); 127 // regist_back時、subject,bodyにはテンプレートを読み込むのではなく、入力内容で上書き 134 // regist_backæãsubject,bodyã«ã¯ãã³ãã¬ã¼ããèªã¿è¾¼ãã®ã§ã¯ãªããå 135 ¥åå 136 容ã§ä¸æ¸ã 128 137 if ($this->getMode()=='regist_back') { 129 138 $objFormParam->setParam($_POST); … … 145 154 if (SC_Utils_Ex::isBlank($this->arrErr)) { 146 155 $this->tpl_mainpage = 'mail/index.tpl'; 147 SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam)); // DB 登録・送信156 SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam)); // DBç»é²ã»éä¿¡ 148 157 149 158 SC_Response_Ex::sendRedirect('./history.php'); 150 159 } 151 160 break; 152 // query:配信履歴から「確認」 161 // query:é 162 ä¿¡å±¥æ´ããã確èªã 153 163 case 'query': 154 164 if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { … … 157 167 $this->setTemplate('mail/query.tpl'); 158 168 break; 159 // query:配信履歴から「再送信」 169 // query:é 170 ä¿¡å±¥æ´ãããåéä¿¡ã 160 171 case 'retry': 161 172 if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { 162 SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']); // DB 登録・送信173 SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']); // DBç»é²ã»éä¿¡ 163 174 164 175 SC_Response_Ex::sendRedirect('./history.php'); 165 176 } else { 166 $this->tpl_onload = "window.alert(' メール送信IDが正しくありません');";177 $this->tpl_onload = "window.alert('ã¡ã¼ã«éä¿¡IDãæ£ããããã¾ãã');"; 167 178 } 168 179 break; … … 174 185 175 186 /** 176 * パラメーター情報の初期化(初期会員検索時) 177 * 178 * @param array $objFormParam フォームパラメータークラス 179 * @return void 180 */ 181 function lfInitParamSearchCustomer(&$objFormParam) 187 * ãã©ã¡ã¼ã¿ã¼æ 188 å ±ã®åæåï¼åæä¼å¡æ¤ç´¢æï¼ 189 * 190 * @param array $objFormParam ãã©ã¼ã ãã©ã¡ã¼ã¿ã¼ã¯ã©ã¹ 191 * @return void 192 */ 193 public function lfInitParamSearchCustomer(&$objFormParam) 182 194 { 183 195 SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam); 184 $objFormParam->addParam('配信形式', 'search_htmlmail', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 185 $objFormParam->addParam('配信メールアドレス種別', 'search_mail_type', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 186 } 187 188 /** 189 * パラメーター情報の追加(テンプレート選択) 190 * 191 * @param array $objFormParam フォームパラメータークラス 192 * @return void 193 */ 194 function lfAddParamSelectTemplate(&$objFormParam) 195 { 196 $objFormParam->addParam('メール形式', 'mail_method', INT_LEN, 'n', array('EXIST_CHECK','ALNUM_CHECK')); 196 $objFormParam->addParam('é 197 ä¿¡å½¢å¼', 'search_htmlmail', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 198 $objFormParam->addParam('é 199 ä¿¡ã¡ã¼ã«ã¢ãã¬ã¹ç¨®å¥', 'search_mail_type', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 200 } 201 202 /** 203 * ãã©ã¡ã¼ã¿ã¼æ 204 å ±ã®è¿½å ï¼ãã³ãã¬ã¼ãé¸æï¼ 205 * 206 * @param array $objFormParam ãã©ã¼ã ãã©ã¡ã¼ã¿ã¼ã¯ã©ã¹ 207 * @return void 208 */ 209 public function lfAddParamSelectTemplate(&$objFormParam) 210 { 211 $objFormParam->addParam('ã¡ã¼ã«å½¢å¼', 'mail_method', INT_LEN, 'n', array('EXIST_CHECK','ALNUM_CHECK')); 197 212 $objFormParam->addParam('Subject', 'subject', STEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 198 $objFormParam->addParam('本文', 'body', LLTEXT_LEN, 'KVCa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 199 $objFormParam->addParam('テンプレートID', 'template_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'), '', false); 200 } 201 202 /** 203 * メルマガテンプレート一覧情報の取得 204 * 205 * @param array $arrTemplate SC_Helper_Mail_Ex::sfGetMailmagaTemplate()の戻り値 206 * @return array key:template_id value:サブジェクト【配信形式】 207 */ 208 function lfGetMailTemplateList($arrTemplate) 213 $objFormParam->addParam('æ¬æ', 'body', LLTEXT_LEN, 'KVCa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 214 $objFormParam->addParam('ãã³ãã¬ã¼ãID', 'template_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'), '', false); 215 } 216 217 /** 218 * ã¡ã«ãã¬ãã³ãã¬ã¼ãä¸è¦§æ 219 å ±ã®åå¾ 220 * 221 * @param array $arrTemplate SC_Helper_Mail_Ex::sfGetMailmagaTemplate()ã®æ»ãå¤ 222 * @return array key:template_id value:ãµãã¸ã§ã¯ããé 223 ä¿¡å½¢å¼ã 224 */ 225 public function lfGetMailTemplateList($arrTemplate) 209 226 { 210 227 if (is_array($arrTemplate)) { 211 228 foreach ($arrTemplate as $line) { 212 $return[$line['template_id']] = ' 【' . $this->arrHtmlmail[$line['mail_method']] . '】' . $line['subject'];229 $return[$line['template_id']] = 'ã' . $this->arrHtmlmail[$line['mail_method']] . 'ã' . $line['subject']; 213 230 } 214 231 } … … 218 235 219 236 /** 220 * テンプレートIDから情報の取得して$objFormParamにset_paramする 221 * 222 * @param array $objFormParam フォームパラメータークラス 223 * @param array $template_id テンプレートID 224 * @return void 225 */ 226 function lfGetTemplateData(&$objFormParam, $template_id) 237 * ãã³ãã¬ã¼ãIDããæ 238 å ±ã®åå¾ãã¦$objFormParamã«set_paramãã 239 * 240 * @param array $objFormParam ãã©ã¼ã ãã©ã¡ã¼ã¿ã¼ã¯ã©ã¹ 241 * @param array $template_id ãã³ãã¬ã¼ãID 242 * @return void 243 */ 244 public function lfGetTemplateData(&$objFormParam, $template_id) 227 245 { 228 246 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 234 252 235 253 /** 236 * 配信内容と配信リストを書き込む 237 * 238 * @return integer 登録した行の dtb_send_history.send_id の値 239 */ 240 function lfRegisterData(&$objFormParam) 254 * é 255 ä¿¡å 256 容ã¨é 257 ä¿¡ãªã¹ããæ¸ãè¾¼ã 258 * 259 * @return integer ç»é²ããè¡ã® dtb_send_history.send_id ã®å¤ 260 */ 261 public function lfRegisterData(&$objFormParam) 241 262 { 242 263 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 258 279 $dtb_send_history['send_id'] = $send_id; 259 280 $objQuery->insert('dtb_send_history', $dtb_send_history); 260 // 「配信メールアドレス種別」に携帯メールアドレスが指定されている場合は、携帯メールアドレスに配信 281 // ãé 282 ä¿¡ã¡ã¼ã«ã¢ãã¬ã¹ç¨®å¥ãã«æºå¸¯ã¡ã¼ã«ã¢ãã¬ã¹ãæå®ããã¦ããå ´åã¯ãæºå¸¯ã¡ã¼ã«ã¢ãã¬ã¹ã«é 283 ä¿¡ 261 284 $emailtype='email'; 262 285 $searchmailtype = $objFormParam->getValue('search_mail_type'); … … 279 302 280 303 /** 281 * 配信履歴から条件を取得する 282 * 283 * @param integer $send_id 配信履歴番号 304 * é 305 ä¿¡å±¥æ´ããæ¡ä»¶ãåå¾ãã 306 * 307 * @param integer $send_idãé ä¿¡å±¥æ´çªå· 284 308 * @return array 285 309 */ 286 function lfGetMailQuery($send_id)310 public function lfGetMailQuery($send_id) 287 311 { 288 312 $objQuery =& SC_Query_Ex::getSingletonInstance(); 289 313 290 // 送信履歴より、送信条件確認画面314 // éä¿¡å±¥æ´ãããéä¿¡æ¡ä»¶ç¢ºèªç»é¢ 291 315 $sql = 'SELECT search_data FROM dtb_send_history WHERE send_id = ?'; 292 316 $searchData = $objQuery->getOne($sql, array($send_id));
Note: See TracChangeset
for help on using the changeset viewer.