Changeset 22584 for branches/version-2_12-dev/data/class
- Timestamp:
- 2013/02/26 20:55:22 (11 years ago)
- Location:
- branches/version-2_12-dev/data/class
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Mail.php
r22567 r22584 76 76 { 77 77 78 $objQuery =& SC_Query_Ex::getSingletonInstance();79 78 // メールテンプレート情報の取得 80 $ where = 'template_id = ?';81 $ arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id));82 $objPage->tpl_header = $ arrRet[0]['header'];83 $objPage->tpl_footer = $ arrRet[0]['footer'];84 $tmp_subject = $ arrRet[0]['subject'];79 $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); 80 $mailtemplate = $objMailtemplate->get($template_id); 81 $objPage->tpl_header = $mailtemplate['header']; 82 $objPage->tpl_footer = $mailtemplate['footer']; 83 $tmp_subject = $mailtemplate['subject']; 85 84 86 85 $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); … … 117 116 if ($subject == '' && $header == '' && $footer == '') { 118 117 // メールテンプレート情報の取得 119 $ where = 'template_id = ?';120 $ arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id));121 $arrTplVar->tpl_header = $ arrRet[0]['header'];122 $arrTplVar->tpl_footer = $ arrRet[0]['footer'];123 $tmp_subject = $ arrRet[0]['subject'];118 $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); 119 $mailtemplate = $objMailtemplate->get($template_id); 120 $arrTplVar->tpl_header = $mailtemplate['header']; 121 $arrTplVar->tpl_footer = $mailtemplate['footer']; 122 $tmp_subject = $mailtemplate['subject']; 124 123 } else { 125 124 $arrTplVar->tpl_header = $header; -
branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php
r22567 r22584 73 73 74 74 $masterData = new SC_DB_MasterData_Ex(); 75 $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); 75 76 76 77 $mode = $this->getMode(); … … 90 91 switch ($mode) { 91 92 case 'id_set': 92 $ result = $this->lfGetMailTemplateByTemplateID($post['template_id']);93 if ($ result) {94 $this->arrForm = $ result[0];93 $mailtemplate = $objMailtemplate->get($post['template_id']); 94 if ($mailtemplate) { 95 $this->arrForm = $mailtemplate; 95 96 } else { 96 97 $this->arrForm['template_id'] = $post['template_id']; … … 106 107 } else { 107 108 // 正常 108 $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id'] );109 $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id'], $objMailtemplate); 109 110 110 111 // 完了メッセージ … … 129 130 } 130 131 131 function lf GetMailTemplateByTemplateID($template_id)132 function lfRegistMailTemplate($post, $member_id, SC_Helper_Mailtemplate_Ex $objMailtemplate) 132 133 { 133 $objQuery =& SC_Query_Ex::getSingletonInstance();134 135 $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?';136 return $objQuery->getAll($sql, array($template_id));137 }138 139 function lfRegistMailTemplate($post, $member_id)140 {141 $objQuery =& SC_Query_Ex::getSingletonInstance();142 143 134 $post['creator_id'] = $member_id; 144 $post['update_date'] = 'CURRENT_TIMESTAMP'; 145 146 $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?'; 147 $template_data = $objQuery->getAll($sql, array($post['template_id'])); 148 if ($template_data) { 149 $sql_where = 'template_id = ?'; 150 $objQuery->update('dtb_mailtemplate', $post, $sql_where, array(addslashes($post['template_id']))); 151 } else { 152 $objQuery->insert('dtb_mailtemplate', $post); 153 } 154 135 $objMailtemplate->save($post); 155 136 } 156 137 -
branches/version-2_12-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php
r22567 r22584 227 227 function changeData(&$objFormParam) 228 228 { 229 $objQuery =& SC_Query_Ex::getSingletonInstance();230 231 229 $template_id = $objFormParam->getValue('template_id'); 232 230 … … 237 235 // 有効選択時 238 236 elseif (SC_Utils_Ex::sfIsInt($template_id)) { 239 $where = 'template_id = ?'; 240 $arrWhereVal = array($template_id); 241 $mailTemplates = $objQuery->getRow('subject, header, footer', 'dtb_mailtemplate', $where, $arrWhereVal); 237 $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); 238 $mailTemplates = $objMailtemplate->get($template_id); 242 239 } 243 240 // 不正選択時
Note: See TracChangeset
for help on using the changeset viewer.