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

Changeset 13102


Ignore:
Timestamp:
Nov 4, 2009, 5:07:20 PM (13 years ago)
Author:
ebihara
Message:

#3854:コミュニティ管理者交代要請メッセージ送信、メッセージ表示、承認待ち一覧ページでの表示に対応

Location:
OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation/config/config.php

    r13099 r13102  
    44$this->dispatcher->connect('op_action.post_execute_friend_link', array('opRegisterMessage', 'listenToPostActionEventSendFriendLinkRequestMessage'));
    55$this->dispatcher->connect('op_action.post_execute_community_join', array('opRegisterMessage', 'listenToPostActionEventSendCommunityJoiningRequestMessage'));
     6$this->dispatcher->connect('op_action.post_execute_community_changeAdminRequest', array('opRegisterMessage', 'listenToPostActionEventSendTakeOverCommunityRequestMessage'));
    67
    78$this->dispatcher->connect('op_confirmation.list_filter', array('opConfirmationMessageFilter', 'filterFriendLink'));
    89$this->dispatcher->connect('op_confirmation.list_filter', array('opConfirmationMessageFilter', 'filterCommunityJoiningRequest'));
     10$this->dispatcher->connect('op_confirmation.list_filter', array('opConfirmationMessageFilter', 'filterCommunityTakingOver'));
  • OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation/data/fixtures/001_import_message_type.yml

    r13099 r13102  
    2121  message_type_taking_over_community:
    2222    type_name: "community_taking_over"
    23     foreign_table: "community_member"
     23    foreign_table: "community"
    2424    Translation:
    2525      ja_JP:
  • OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation/data/migrations/0.9.0/fixtures/004_add_message_type.yml

    r13099 r13102  
    22  message_type_taking_over_community:
    33    type_name: "community_taking_over"
    4     foreign_table: "community_member"
     4    foreign_table: "community"
    55    Translation:
    66      ja_JP:
  • OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation/lib/opConfirmationMessageFilter.class.php

    r13099 r13102  
    5151    return $list;
    5252  }
     53
     54  static public function filterCommunityTakingOver(sfEvent $event, $list)
     55  {
     56    if ('community_admin_request' !== $event['category'])
     57    {
     58      return $list;
     59    }
     60
     61    foreach ($list as $k => $v)
     62    {
     63      $community = Doctrine::getTable('Community')->find($v['id']);
     64      $obj = Doctrine::getTable('SendMessageData')->getMessageByTypeAndIdentifier($community->getAdminMember()->id, sfContext::getInstance()->getUser()->getMemberId(), 'community_taking_over', $v['id']);
     65
     66      $list[$k]['list']['Message'] = array('text' => $obj->body);
     67    }
     68
     69    return $list;
     70  }
    5371}
  • OpenPNE3/plugins/opMessagePlugin/branches/ebihara_confirmation/lib/opRegisterMessage.class.php

    r13099 r13102  
    6868  }
    6969
     70  static public function listenToPostActionEventSendTakeOverCommunityRequestMessage($arguments)
     71  {
     72    if ($arguments['result'] == sfView::SUCCESS)
     73    {
     74      $community = $arguments['actionInstance']->community;
     75      $member = $arguments['actionInstance']->member;
     76
     77      $request = $arguments['actionInstance']->getRequest();
     78      $param = $request->getParameter('admin_request');
     79
     80      $sender = new opMessageSender();
     81      $sender->setToMember($member)
     82        ->setSubject('コミュニティ管理者交代要請メッセージ')
     83        ->setBody($param['message'])
     84        ->setMessageType('community_taking_over')
     85        ->setIdentifier($community->id)
     86        ->send();
     87    }
     88  }
     89
     90  public function decorateCommunityTakingOverBody(SendMessageData $message)
     91  {
     92    $id = $message->getForeignId();
     93    $community = Doctrine::getTable('Community')->find($id);
     94
     95    $params = array(
     96      'fromMember' => $message->getMember(),
     97      'message'    => $message->body,
     98      'community'  => $community,
     99    );
     100
     101    return opMessageSender::decorateBySpecifiedTemplate('communityTakingOverMessage', $params);
     102  }
     103
    70104  public function decorateCommunityJoiningRequestBody(SendMessageData $message)
    71105  {
Note: See TracChangeset for help on using the changeset viewer.