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