ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12370


Ignore:
Timestamp:
Jul 23, 2009, 9:13:22 PM (11 years ago)
Author:
nagasawa
Message:

#3286:added a branch for mail 3.1.x

Location:
OpenPNE3/branches/nagasawa_mail31x
Files:
16 added
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/nagasawa_mail31x/apps/pc_backend/config/routing.yml

    r11785 r12370  
    2121  param: { action: index }
    2222
     23sns_config_mail:
     24  url:  /sns/config/category/mail
     25  param: { module: sns, action: mail}
     26
    2327default:
    2428  url:   /:module/:action/*
  • OpenPNE3/branches/nagasawa_mail31x/apps/pc_backend/modules/sns/actions/actions.class.php

    r10604 r12370  
    3737    }
    3838  }
     39
     40 /**
     41  * Executes mail action
     42  *
     43  * @param sfRequest $request A request object
     44  */
     45  public function executeMail(sfWebRequest $request)
     46  {
     47    $templateTable = Doctrine::getTable('Template');
     48    $pcNameList = $templateTable->getTemplateNameListFromFile('pc', 'mail');
     49    $name = $request->getParameter('name');
     50    if (!$name)
     51    {
     52      $name = $pcNameList[0];
     53    }
     54
     55    $template = Doctrine::getTable('Template')->findByName($name, true);
     56
     57    if (!$template)
     58    {
     59      return sfView::ERROR;
     60    }
     61    else
     62    {
     63      // rollback to default
     64      if ($template && $request->getParameter('is_default', 0))
     65      {
     66        $template->resetFromFile();
     67        $template->save();
     68      }
     69    }
     70    $this->form = new MailTemplateForm($template);
     71
     72    if ($request->isMethod(sfWebRequest::POST))
     73    {
     74      $this->form->bind($request->getParameter('template'));
     75      if ($this->form->isValid())
     76      {
     77        $this->form->save();
     78      }
     79    }
     80
     81    $this->nameList = array(
     82      'pc'      => $pcNameList,
     83      'mobile'  => $templateTable->getTemplateNameListFromFile('mobile', 'mail'),
     84      'admin'   => $templateTable->getTemplateNameListFromFile('admin', 'mail'),
     85    );
     86  }
    3987}
  • OpenPNE3/branches/nagasawa_mail31x/apps/pc_frontend/templates/_requestRegisterURLMail.php

    r10918 r12370  
    2828<?php echo __('* Participate in %1%', array('%1%' => $snsName)) ?>
    2929
    30 <?php if ($isMobile) : ?>
     30<?php if ($isMobile): ?>
    3131<?php echo app_url_for('mobile_frontend', sprintf('opAuthMailAddress/register?token=%s&authMode=%s', $token, $authMode), true) ?>
    3232<?php else: ?>
  • OpenPNE3/branches/nagasawa_mail31x/config/doctrine/schema.yml

    r12215 r12370  
    305305    BannerImage: { local: banner_image_id, foreign: id }
    306306
     307Template:
     308  actAs:
     309    I18n:
     310      fields: [value]
     311      length: 5
     312  columns:
     313    id: { type: integer(4), primary: true, autoincrement: true }
     314    name: { type: string(64), notnull: true }
     315    value: { type: string, default: "" }
     316  indexes:
     317    name_UNIQUE:
     318      fields: [name]
     319      type: unique
     320
    307321Session:
    308322  actAs: []
  • OpenPNE3/branches/nagasawa_mail31x/lib/action/sfOpenPNEMemberAction.class.php

    r12346 r12370  
    382382  {
    383383    $param = array(
    384       'member'   => $member,
     384      'snsName' => opConfig::get('sns_name'),
     385      'member'  => $member,
    385386    );
     387
     388    $template = Doctrine::getTable('Template')->findByName('pcMailSignature', true);
     389    $param['signature'] = $template->getBody(true, $param);
     390
    386391    $mail = new sfOpenPNEMailSend();
    387     $mail->setSubject(opConfig::get('sns_name') . '退会者情報');
    388     $mail->setGlobalTemplate('deleteAccountMail', $param);
     392    $mail->setTemplateFromTemplateTable('pcMailDeleteAccountMail', $param);
    389393    $mail->send(opConfig::get('admin_mail_address'), opConfig::get('admin_mail_address'));
    390394  }
  • OpenPNE3/branches/nagasawa_mail31x/lib/config/config/sns_config.yml

    r11021 r12370  
    119119    IsRequired: true
    120120    Default:    "プライバシーポリシーはただいま準備中です。\nThe Privacy Policy is under construction."
     121
     122mail:
  • OpenPNE3/branches/nagasawa_mail31x/lib/form/doctrine/InviteForm.class.php

    r12322 r12370  
    124124      'token'    => $token,
    125125      'authMode' => $authMode,
    126       'isMobile' => opToolkit::isMobileEmailAddress($to),
    127126      'name'     => $this->getOption('invited') ? sfContext::getInstance()->getUser()->getMember()->getName() : null,
    128       'message'  => $this->getOption('invited') ? $this->getValue('message') : null
     127      'message'  => $this->getOption('invited') ? $this->getValue('message') : null,
     128      'snsName'   => opConfig::get('sns_name'),
     129      'catchCopy' => '',
     130      'adminEMail' => '',
     131      'openpneUrl' => 'http://',
     132      'operationCompany' => '',
     133      'copyRight' => ''
    129134    );
    130135
     136    $template = Doctrine::getTable('Template')->findByName('pcMailSignature', true);
     137    $param['signature'] = $template->getBody(true, $param);
     138
     139    sfContext::getInstance()->getConfiguration()->loadHelpers('opUtil');
    131140    $mail = new sfOpenPNEMailSend();
    132     $mail->setSubject(opConfig::get('sns_name') . '招待状');
    133     $mail->setTemplate('global/requestRegisterURLMail', $param);
     141    if (opToolkit::isMobileEmailAddress($to))
     142    {
     143      $mail->setTemplateFromTemplateTable('mobileMailInviteMail', $param);
     144    }
     145    else
     146    {
     147      $mail->setTemplateFromTemplateTable('pcMailInviteMail', $param);
     148    }
    134149    $mail->send($to, opConfig::get('admin_mail_address'));
    135150  }
  • OpenPNE3/branches/nagasawa_mail31x/lib/util/sfOpenPNEMailSend.class.php

    r12124 r12370  
    4141  }
    4242
     43  public function setTemplateFromTemplateTable($template, $params = array())
     44  {
     45    $template = Doctrine::getTable('Template')->findByName($template, true);
     46    $this->subject = $template->getSubject(true, $params);
     47    $this->body = $template->getBody(true, $params);
     48  }
     49
    4350  public function send($to, $from)
    4451  {
  • OpenPNE3/branches/nagasawa_mail31x/web/css/backend.css

    r12312 r12370  
    172172}
    173173
     174body#sns_mail p {
     175  margin-bottom 16px;
     176}
     177
     178body#sns_mail dl#list {
     179  float: left;
     180  width: 200px;
     181}
     182
     183body#sns_mail dl#edit {
     184  float: left;
     185  width: 300px;
     186}
     187
    174188* html {
    175189  overflow-x: hidden;
Note: See TracChangeset for help on using the changeset viewer.