Changeset 22584 for branches/version-2_12-dev/data/class/pages
- Timestamp:
- 2013/02/26 20:55:22 (11 years ago)
- Location:
- branches/version-2_12-dev/data/class/pages/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.