/**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->tpl_mainpage = 'mail/index.tpl';
     $this->tpl_mainno = 'mail';
     $this->tpl_subno = 'index';
     $this->tpl_pager = 'pager.tpl';
     $this->tpl_maintitle = 'メルマガ管理';
     $this->tpl_subtitle = '配信内容設定';
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrPref = $masterData->getMasterData('mtb_pref');
     $this->arrJob = $masterData->getMasterData('mtb_job');
     $this->arrJob['不明'] = '不明';
     $this->arrSex = $masterData->getMasterData('mtb_sex');
     $this->arrPageRows = $masterData->getMasterData('mtb_page_max');
     $this->arrHtmlmail = array('' => '両方', 1 => 'HTML', 2 => 'TEXT');
     $this->arrMailType = $masterData->getMasterData('mtb_mail_type');
     // 日付プルダウン設定
     $objDate = new SC_Date_Ex(BIRTH_YEAR);
     $this->arrBirthYear = $objDate->getYear();
     $this->arrRegistYear = $objDate->getYear();
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     $this->objDate = $objDate;
     // カテゴリ一覧設定
     $objDb = new SC_Helper_DB_Ex();
     $this->arrCatList = $objDb->sfGetCategoryList();
     // テンプレート一覧設定
     $this->arrTemplate = $this->lfGetMailTemplateList(SC_Helper_Mail_Ex::sfGetMailmagaTemplate());
     $this->httpCacheControl('nocache');
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objMailHelper = new SC_Helper_Mail_Ex();
     switch ($this->getMode()) {
         case 'edit':
             // 編集
             if (SC_Utils_Ex::sfIsInt($_GET['template_id']) === true) {
                 $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']);
                 $this->arrForm = $arrMail[0];
             }
             break;
         case 'regist':
             // 新規登録
             $objFormParam = new SC_FormParam_Ex();
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             $this->arrForm = $objFormParam->getHashArray();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // エラーが無いときは登録・編集
                 $this->lfRegistData($objFormParam, $objFormParam->getValue('template_id'));
                 // 自分を再読込して、完了画面へ遷移
                 $this->objDisplay->reload(array('mode' => 'complete'));
             } else {
                 $this->arrForm['template_id'] = $objFormParam->getValue('template_id');
             }
             break;
         case 'complete':
             // 完了画面表示
             $this->tpl_mainpage = 'mail/template_complete.tpl';
             break;
         default:
             break;
     }
 }
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->tpl_mainpage = 'mail/index.tpl';
     $this->tpl_mainno = 'mail';
     $this->tpl_subno = 'index';
     $this->tpl_pager = 'pager.tpl';
     $this->tpl_maintitle = t('c_Mail magazine_02');
     $this->tpl_subtitle = t('c_Delivery content settings_01');
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrPref = $masterData->getMasterData('mtb_pref');
     $this->arrJob = $masterData->getMasterData('mtb_job');
     $this->arrJob[t('c_Unknown_01')] = t('c_Unknown_01');
     $this->arrSex = $masterData->getMasterData('mtb_sex');
     $this->arrPageRows = $masterData->getMasterData('mtb_page_max');
     $this->arrHtmlmail = array('' => t('c_Both_01'), 1 => t('c_HTML_01'), 2 => t('c_TEXT_02'));
     $this->arrMailType = $masterData->getMasterData('mtb_mail_type');
     // 日付プルダウン設定
     $objDate = new SC_Date_Ex(BIRTH_YEAR);
     $this->arrBirthYear = $objDate->getYear();
     $this->arrRegistYear = $objDate->getYear();
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     $this->objDate = $objDate;
     // カテゴリ一覧設定
     $objDb = new SC_Helper_DB_Ex();
     $this->arrCatList = $objDb->sfGetCategoryList();
     // テンプレート一覧設定
     $this->arrTemplate = $this->lfGetMailTemplateList(SC_Helper_Mail_Ex::sfGetMailmagaTemplate());
     $this->httpCacheControl('nocache');
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objMailHelper = new SC_Helper_Mail_Ex();
     switch ($this->getMode()) {
         case 'delete':
             if (SC_Utils_Ex::sfIsInt($_GET['id']) === true) {
                 $this->lfDeleteMailTemplate($_GET['id']);
                 $this->objDisplay->reload(null, true);
             }
             break;
         default:
             break;
     }
     $this->arrTemplates = $objMailHelper->sfGetMailmagaTemplate();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objMailHelper = new SC_Helper_Mail_Ex();
     switch ($this->getMode()) {
         case 'template':
             if (SC_Utils_Ex::sfIsInt($_GET['template_id'])) {
                 $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'history':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'presend':
             $this->mail['body'] = $_POST['body'];
         default:
     }
     $this->setTemplate($this->tpl_mainpage);
 }