Changeset 21687 for branches/version-2_12-dev
- Timestamp:
- 2012/03/27 11:12:18 (12 years ago)
- Location:
- branches/version-2_12-dev/data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/Smarty/templates/admin/order/index.tpl
r21539 r21687 76 76 fm.action = tmpAction; 77 77 } 78 79 80 function fnSelectMailCheckSubmit(action){ 81 82 var fm = document.form1; 83 84 if (!fm["mail_order_id[]"]) { 85 return false; 86 } 87 88 var checkflag = false; 89 var max = fm["mail_order_id[]"].length; 90 91 if (max) { 92 for (var i=0; i<max; i++) { 93 if(fm["mail_order_id[]"][i].checked == true){ 94 checkflag = true; 95 } 96 } 97 } else { 98 if(fm["mail_order_id[]"].checked == true) { 99 checkflag = true; 100 } 101 } 102 103 if(!checkflag){ 104 alert('チェックボックスが選択されていません'); 105 return false; 106 } 107 108 fm.mode.value="mail_select"; 109 fm.action=action; 110 fm.submit(); 111 } 112 113 78 114 //--> 79 115 </script> … … 305 341 <a class="btn-normal" href="../contents/csv.php?tpl_subno_csv=order">CSV 出力項目設定</a> 306 342 <a class="btn-normal" href="javascript:;" onclick="fnSelectCheckSubmit('pdf.php'); return false;"><span>PDF一括出力</span></a> 343 <a class="btn-normal" href="javascript:;" onclick="fnSelectMailCheckSubmit('mail.php'); return false;"><span>メール一括通知</span></a> 307 344 </div> 308 345 <!--{if count($arrResults) > 0}--> … … 313 350 <table class="list"> 314 351 <col width="10%" /> 315 <col width=" 10%" />352 <col width="8%" /> 316 353 <col width="15%" /> 317 <col width=" 10%" />354 <col width="8%" /> 318 355 <col width="10%" /> 319 356 <col width="10%" /> … … 321 358 <col width="10%" /> 322 359 <col width="5%" /> 323 <col width=" 5%" />360 <col width="9%" /> 324 361 <col width="5%" /> 325 362 <!--{* ペイジェントモジュール連携用 *}--> … … 338 375 <th><label for="pdf_check">帳票</label> <input type="checkbox" name="pdf_check" id="pdf_check" onclick="fnAllCheck(this, 'input[name=pdf_order_id[]]')" /></th> 339 376 <th>編集</th> 340 <th>メール </th>377 <th>メール <input type="checkbox" name="mail_check" id="mail_check" onclick="fnAllCheck(this, 'input[name=mail_order_id[]]')" /></th> 341 378 <th>削除</th> 342 379 </tr> … … 360 397 <td class="center"> 361 398 <!--{if $arrResults[cnt].order_email|strlen >= 1}--> 362 <a href="?" onclick="fnChangeAction('<!--{$smarty.const.ADMIN_ORDER_MAIL_URLPATH}-->'); fnModeSubmit('pre_edit', 'order_id', '<!--{$arrResults[cnt].order_id}-->'); return false;"><span class="icon_mail">通知</span></a> 399 <input type="checkbox" name="mail_order_id[]" value="<!--{$arrResults[cnt].order_id}-->" id="mail_order_id_<!--{$arrResults[cnt].order_id}-->"/><label for="mail_order_id_<!--{$arrResults[cnt].order_id}-->">一括通知</label><br> 400 <a href="?" onclick="fnChangeAction('<!--{$smarty.const.ADMIN_ORDER_MAIL_URLPATH}-->'); fnModeSubmit('pre_edit', 'order_id', '<!--{$arrResults[cnt].order_id}-->'); return false;"><span class="icon_mail">個別通知</span></a> 363 401 <!--{/if}--> 364 402 </td> -
branches/version-2_12-dev/data/Smarty/templates/admin/order/mail.tpl
r21539 r21687 26 26 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 27 27 <input type="hidden" name="mode" value="confirm" /> 28 <input type="hidden" name="order_id " value="<!--{$tpl_order_id}-->" />28 <input type="hidden" name="order_id_array" value="<!--{$order_id_array}-->" /> 29 29 <!--{foreach key=key item=item from=$arrSearchHidden}--> 30 30 <!--{if is_array($item)}--> … … 38 38 <div id="order" class="contents-main"> 39 39 <h2>メール配信</h2> 40 41 <!--{if $order_id_count == 1}--> 40 42 <table class="list"> 41 43 <tr> … … 53 55 <!--{/section}--> 54 56 </table> 57 <!--{/if}--> 55 58 56 59 <table class="form"> -
branches/version-2_12-dev/data/Smarty/templates/admin/order/mail_confirm.tpl
r21539 r21687 26 26 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 27 27 <input type="hidden" name="mode" value="send" /> 28 <input type="hidden" name="order_id " value="<!--{$tpl_order_id}-->" />28 <input type="hidden" name="order_id_array" value="<!--{$order_id_array}-->" /> 29 29 <!--{foreach key=key item=item from=$arrHidden}--> 30 30 <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" /> … … 41 41 <div id="order" class="contents-main"> 42 42 <h2>メール配信</h2> 43 43 44 45 <!--{if $order_id_count != 1}--> 46 <span class="red">※本文は1通分の例です。受注情報は各メールごとに異なります</span><br /><br /> 47 <!--{/if}--> 44 48 <table class="form"> 45 49 <tr> -
branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php
r21591 r21687 74 74 $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); 75 75 $objPlugin->doAction('lc_page_admin_order_mail_action_start', array($this)); 76 76 77 //一括送信用の処理 78 if(array_key_exists("mail_order_id",$_POST) and $_POST['mode'] == 'mail_select'){ 79 $_POST['order_id_array'] = implode(",",$_POST['mail_order_id']); 80 }else if(!array_key_exists("order_id_array",$_POST)){ 81 $_POST['order_id_array'] = $_POST['order_id']; 82 } 83 84 85 //一括送信処理変数チェック(ここですべきかは課題) 86 if(preg_match("/^[0-9|\,]*$/",$_POST['order_id_array'])){ 87 $this->order_id_array = $_POST['order_id_array']; 88 }else{ 89 //エラーで元に戻す 90 SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH); 91 exit; 92 } 93 94 //メール本文の確認例は初めの1受注とする 95 if($this->order_id_array){ 96 $order_id_array = split(",",$this->order_id_array); 97 $_POST['order_id'] = intval($order_id_array[0]); 98 $this->order_id_count = count($order_id_array); 99 } 100 77 101 // パラメーター管理クラス 78 102 $objFormParam = new SC_FormParam_Ex(); … … 90 114 switch ($this->getMode()) { 91 115 case 'pre_edit': 116 case 'mail_select': 92 117 break; 93 118 case 'return': … … 154 179 function doSend(&$objFormParam) { 155 180 $arrErr = $objFormParam->checkerror(); 156 181 157 182 // メールの送信 158 183 if (count($arrErr) == 0) { 159 // 注文受付メール 160 $objMail = new SC_Helper_Mail_Ex(); 161 $objSendMail = $objMail->sfSendOrderMail($objFormParam->getValue('order_id'), 162 $objFormParam->getValue('template_id'), 163 $objFormParam->getValue('subject'), 164 $objFormParam->getValue('header'), 165 $objFormParam->getValue('footer')); 184 // 注文受付メール(複数受注ID対応) 185 $order_id_array = explode(",",$this->order_id_array); 186 foreach($order_id_array as $order_id){ 187 $objMail = new SC_Helper_Mail_Ex(); 188 $objSendMail = $objMail->sfSendOrderMail($order_id, 189 $objFormParam->getValue('template_id'), 190 $objFormParam->getValue('subject'), 191 $objFormParam->getValue('header'), 192 $objFormParam->getValue('footer')); 193 } 166 194 // TODO $SC_SendMail から送信がちゃんと出来たか確認できたら素敵。 167 195 return true; … … 236 264 // 検索条件のパラメーターを初期化 237 265 parent::lfInitParam($objFormParam); 238 239 $objFormParam->addParam('オーダーID', 'order_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));240 266 $objFormParam->addParam('テンプレート', 'template_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 241 267 $objFormParam->addParam('メールタイトル', 'subject', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'SPTAB_CHECK'));
Note: See TracChangeset
for help on using the changeset viewer.