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

Changeset 9593


Ignore:
Timestamp:
Dec 18, 2008, 10:49:57 PM (14 years ago)
Author:
ebihara
Message:

fixed a member doesn't link with another one is invited from he/she

Location:
OpenPNE3/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/actions/actions.class.php

    r9587 r9593  
    146146  {
    147147    $this->form = new InviteForm();
     148    $this->form->setOption('is_link', true);
    148149    if ($request->isMethod('post'))
    149150    {
  • OpenPNE3/trunk/lib/form/InviteForm.class.php

    r9587 r9593  
    4141    $mail->send($to, OpenPNEConfig::get('admin_mail_address'));
    4242  }
     43
     44  public function save()
     45  {
     46    parent::save();
     47
     48    if ($this->getOption('is_link'))
     49    {
     50      $fromMemberId = sfContext::getInstance()->getUser()->getMemberId();
     51      $toMemberId = $this->member->getId();
     52      $relation = MemberRelationshipPeer::retrieveByFromAndTo($fromMemberId, $toMemberId);
     53      if (!$relation)
     54      {
     55        $relation = new MemberRelationship();
     56        $relation->setMemberIdFrom($fromMemberId);
     57        $relation->setMemberIdTo($toMemberId);
     58      }
     59      $relation->setFriend();
     60    }
     61  }
    4362}
Note: See TracChangeset for help on using the changeset viewer.