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

Changeset 13608


Ignore:
Timestamp:
Jul 17, 2010, 5:54:06 AM (12 years ago)
Author:
ebihara
Message:

コミュニティ書き込み通知メールに対応した (refs #1368)

Location:
OpenPNE3/plugins/opCommunityTopicPlugin/trunk
Files:
5 added
12 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/mobile_frontend/config/routing.yml

    r12795 r13608  
    3939  param: { module: communityTopic, action: searchForm }
    4040
     41config_community_topic_notification_mail:
     42  class: sfRequestRoute
     43  url: /config/communityTopicNotificationMail/:id
     44  param: { module: communityTopic, action: configNotificationMail }
     45  requirements: { id: \d+, sf_method: [post] }
     46
    4147communityTopic_nodefaults:
    4248  url: /communityTopic/*
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/mobile_frontend/i18n/messages.ja.xml

    r13579 r13608  
    214214        <source>Image %number%</source>
    215215        <target>写真%number%</target>
    216       </trans-unit>     
     216      </trans-unit>
     217      <trans-unit id="">
     218        <source>Want to receive</source>
     219        <target>受け取る</target>
     220      </trans-unit>
     221      <trans-unit id="">
     222        <source>Don't want to receive</source>
     223        <target>受け取らない</target>
     224      </trans-unit>
     225      <trans-unit id="">
     226        <source>Configuration of %community% topic notification mail to your PC mail address</source>
     227        <target>%community%書き込みをPCメールで</target>
     228      </trans-unit>
     229      <trans-unit id="">
     230        <source>Configuration of %community% topic notification mail to your mobile mail address</source>
     231        <target>%community%書き込みを携帯メールで</target>
     232      </trans-unit>
     233      <trans-unit id="">
     234        <source>Notification Mail Configuration</source>
     235        <target>メール受信設定</target>
     236      </trans-unit>
     237      <trans-unit id="">
     238        <source>Configuring was successfull.</source>
     239        <target>設定を保存しました</target>
     240      </trans-unit>
    217241    </body>
    218242  </file>
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/mobile_frontend/modules/community/config/view.yml

    r12449 r13608  
    1919      is_component: false
    2020
     21    configNotificationMail:
     22      template: [communityTopic, configNotificationMail]
     23      parts: [communityMember]
     24      target: [before]
     25      is_component: true
     26
    2127searchSuccess:
    2228  customize:
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/pc_frontend/config/routing.yml

    r12795 r13608  
    3939  param: { module: communityTopic, action: searchForm }
    4040
     41config_community_topic_notification_mail:
     42  class: sfRequestRoute
     43  url: /config/communityTopicNotificationMail/:id
     44  param: { module: communityTopic, action: configNotificationMail }
     45  requirements: { id: \d+, sf_method: [post] }
     46
    4147communityTopic_nodefaults:
    4248  url: /communityTopic/*
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/pc_frontend/i18n/messages.ja.xml

    r12455 r13608  
    163163        <target>コメント</target>
    164164      </trans-unit>
     165      <trans-unit id="">
     166        <source>Want to receive</source>
     167        <target>受け取る</target>
     168      </trans-unit>
     169      <trans-unit id="">
     170        <source>Don't want to receive</source>
     171        <target>受け取らない</target>
     172      </trans-unit>
     173      <trans-unit id="">
     174        <source>Configuration of %community% topic notification mail to your PC mail address</source>
     175        <target>%community%書き込みをPCメールで</target>
     176      </trans-unit>
     177      <trans-unit id="">
     178        <source>Configuration of %community% topic notification mail to your mobile mail address</source>
     179        <target>%community%書き込みを携帯メールで</target>
     180      </trans-unit>
     181      <trans-unit id="">
     182        <source>Configuring was successfull.</source>
     183        <target>設定を保存しました</target>
     184      </trans-unit>
    165185    </body>
    166186  </file>
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/apps/pc_frontend/modules/community/config/view.yml

    r12669 r13608  
    1111      parts: [communityHome]
    1212      target: [lastRow]
     13      is_component: true
     14
     15    configNotificationMail:
     16      template: [communityTopic, configNotificationMail]
     17      parts: [communityHome]
     18      target: [after]
    1319      is_component: true
    1420
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/action/opCommunityTopicPluginTopicActions.class.php

    r13578 r13608  
    2020 * @author     Eitarow Fukamachi <fukamachi@tejimaya.net>
    2121 */
    22 
    2322abstract class opCommunityTopicPluginTopicActions extends sfActions
    2423{
     
    233232  }
    234233
     234  public function executeConfigNotificationMail($request)
     235  {
     236    $form = new opConfigCommunityTopicNotificationMailForm($request['id']);
     237
     238    $form->bind($request['topic_notify']);
     239    if ($form->isValid())
     240    {
     241      $form->save();
     242      $this->getUser()->setFlash('notice', 'Configuring was successfull.');
     243    }
     244    else
     245    {
     246      $this->getUser()->setFlash('error', 'Failed to configure.');
     247    }
     248
     249    $this->redirect('@community_home?id='.$request['id']);
     250  }
     251
    235252  protected function processForm($request, sfForm $form)
    236253  {
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/action/opCommunityTopicPluginTopicComponents.class.php

    r12669 r13608  
    4646    $this->eventSearchCaption = sfContext::getInstance()->getI18N()->__('Event');
    4747  }
     48
     49  public function executeConfigNotificationMail($request)
     50  {
     51    $this->form = new opConfigCommunityTopicNotificationMailForm($request['id']);
     52  }
    4853}
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/form/doctrine/PluginCommunityEventCommentForm.class.php

    r13607 r13608  
    6969    $communityEvent->setUpdatedAt($communityEventComment->getCreatedAt());
    7070    $communityEvent->save();
     71
     72    if ($this->isNew())
     73    {
     74      opCommunityTopicToolkit::sendNotificationMail($communityEvent->getCommunity(), $communityEvent->getId(), 'event', $communityEventComment->getMember()->getName(), $communityEvent->getName(), $communityEventComment->getBody());
     75    }
     76
     77    return $communityEventComment;
    7178  }
    7279
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/form/doctrine/PluginCommunityEventForm.class.php

    r13607 r13608  
    134134    return $value;
    135135  }
     136
     137  public function save($con = null)
     138  {
     139    $result = parent::save($con);
     140
     141    if ($this->isNew())
     142    {
     143      opCommunityTopicToolkit::sendNotificationMail($result->getCommunity(), $result->getId(), 'event', $result->getMember()->getName(), $result->getName(), $result->getBody());
     144    }
     145
     146    return $result;
     147  }
    136148}
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/form/doctrine/PluginCommunityTopicCommentForm.class.php

    r13607 r13608  
    9393    $communityTopic->setUpdatedAt($communityTopicComment->getCreatedAt());
    9494    $communityTopic->save();
     95
     96    if ($this->isNew())
     97    {
     98      opCommunityTopicToolkit::sendNotificationMail($communityTopic->getCommunity(), $communityTopic->getId(), 'topic', $communityTopicComment->getMember()->getName(), $communityTopic->getName(), $communityTopicComment->getBody());
     99    }
     100
     101    return $communityTopicComment;
    95102  }
    96103}
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/form/doctrine/PluginCommunityTopicForm.class.php

    r13607 r13608  
    8484    return $object;
    8585  }
     86
     87  public function save($con = null)
     88  {
     89    $result = parent::save($con);
     90
     91    if ($this->isNew())
     92    {
     93      opCommunityTopicToolkit::sendNotificationMail($result->getCommunity(), $result->getId(), 'topic', $result->getMember()->getName(), $result->getName(), $result->getBody());
     94    }
     95
     96    return $result;
     97  }
    8698}
Note: See TracChangeset for help on using the changeset viewer.