Changeset 22796 for branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php
- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php
r22584 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Admin_Basis_Mail extends LC_Page_Admin_Ex 35 { 34 class LC_Page_Admin_Basis_Mail extends LC_Page_Admin_Ex { 36 35 37 36 // }}} … … 43 42 * @return void 44 43 */ 45 function init() 46 { 44 function init() { 47 45 parent::init(); 48 46 $this->tpl_mainpage = 'basis/mail.tpl'; … … 58 56 * @return void 59 57 */ 60 function process() 61 { 58 function process() { 62 59 $this->action(); 63 60 $this->sendResponse(); … … 69 66 * @return void 70 67 */ 71 function action() 72 { 68 function action() { 73 69 74 70 $masterData = new SC_DB_MasterData_Ex(); 75 $objMailtemplate = new SC_Helper_Mailtemplate_Ex();76 71 77 72 $mode = $this->getMode(); … … 91 86 switch ($mode) { 92 87 case 'id_set': 93 $ mailtemplate = $objMailtemplate->get($post['template_id']);94 if ($ mailtemplate) {95 $this->arrForm = $ mailtemplate;88 $result = $this->lfGetMailTemplateByTemplateID($post['template_id']); 89 if ($result) { 90 $this->arrForm = $result[0]; 96 91 } else { 97 92 $this->arrForm['template_id'] = $post['template_id']; … … 107 102 } else { 108 103 // 正常 109 $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id'] , $objMailtemplate);104 $this->lfRegistMailTemplate($this->arrForm, $_SESSION['member_id']); 110 105 111 106 // 完了メッセージ … … 125 120 * @return void 126 121 */ 127 function destroy() 128 { 122 function destroy() { 129 123 parent::destroy(); 130 124 } 131 125 132 function lfRegistMailTemplate($post, $member_id, SC_Helper_Mailtemplate_Ex $objMailtemplate) 133 { 134 $post['creator_id'] = $member_id; 135 $objMailtemplate->save($post); 126 function lfGetMailTemplateByTemplateID($template_id) { 127 $objQuery =& SC_Query_Ex::getSingletonInstance(); 128 129 $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?'; 130 return $objQuery->getAll($sql, array($template_id)); 136 131 } 137 132 138 function lfInitParam($mode, &$objFormParam) 139 { 133 function lfRegistMailTemplate($post, $member_id) { 134 $objQuery =& SC_Query_Ex::getSingletonInstance(); 135 136 $post['creator_id'] = $member_id; 137 $post['update_date'] = 'CURRENT_TIMESTAMP'; 138 139 $sql = 'SELECT * FROM dtb_mailtemplate WHERE template_id = ?'; 140 $template_data = $objQuery->getAll($sql, array($post['template_id'])); 141 if ($template_data) { 142 $sql_where = 'template_id = ?'; 143 $objQuery->update('dtb_mailtemplate', $post, $sql_where, array(addslashes($post['template_id']))); 144 } else { 145 $objQuery->insert('dtb_mailtemplate', $post); 146 } 147 148 } 149 150 function lfInitParam($mode, &$objFormParam) { 140 151 switch ($mode) { 141 152 case 'regist': 142 153 $objFormParam->addParam('メールタイトル', 'subject', MTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 143 $objFormParam->addParam('ヘッダー', 'header', LTEXT_LEN, 'KVa', array(' SPTAB_CHECK','MAX_LENGTH_CHECK'));144 $objFormParam->addParam('フッター', 'footer', LTEXT_LEN, 'KVa', array(' SPTAB_CHECK','MAX_LENGTH_CHECK'));154 $objFormParam->addParam('ヘッダー', 'header', LTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 155 $objFormParam->addParam('フッター', 'footer', LTEXT_LEN, 'KVa', array('EXIST_CHECK','SPTAB_CHECK','MAX_LENGTH_CHECK')); 145 156 $objFormParam->addParam('テンプレート', 'template_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 146 157 case 'id_set':
Note: See TracChangeset
for help on using the changeset viewer.