public function executeList(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'diary', 'smtList');
     $publicFlag = $this->getUser()->isSNSMember() ? DiaryTable::PUBLIC_FLAG_SNS : DiaryTable::PUBLIC_FLAG_OPEN;
     $this->isSearchEnable = Doctrine::getTable('SnsConfig')->get('op_diary_plugin_search_enable', '1');
     $this->pager = Doctrine::getTable('Diary')->getDiaryPager($request['page'], 20, $publicFlag);
 }
 public function executeEdit(opWebRequest $request)
 {
     $this->form = new sfForm();
     $memberId = $request->getParameter('member_id');
     if ($request->isMethod(sfWebRequest::POST)) {
         $wid = $request->getParameter('wid');
         if (!$memberId || !$wid) {
             return sfView::ERROR;
         }
         $member = Doctrine::getTable('Member')->find($memberId, null);
         if (is_null($member)) {
             return sfView::ERROR;
         }
         $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('op_kintai_member_wid', $memberId);
         if (!$config) {
             $config = new MemberConfig();
             $config->setName('op_kintai_member_wid');
             $config->setMember($member);
         }
         $config->setValue($wid);
         $config->save();
         $this->message = "登録しました。";
         $this->member = $member;
         $this->value = $wid;
     } else {
         $this->redirectIf(is_null($memberId), 'opGyoenKintaiPlugin/list');
         $member = Doctrine::getTable('Member')->find($memberId, null);
         $this->redirectIf(is_null($member), 'opGyoenKintaiPlugin/list');
         $this->member = $member;
         $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('op_kintai_member_wid', $memberId);
         $this->value = $config ? $config->getValue() : '';
     }
     return sfView::SUCCESS;
 }
 /**
  * Executes error action
  *
  * @param opWebRequest $request A request object
  */
 public function execute($request)
 {
     if ($request->isSmartphone()) {
         $this->setLayout('smtLayoutSns');
         $this->setTemplate('smtError');
     }
 }
 public function executeSmtCommunity(opWebRequest $request)
 {
     $this->communityId = (int) $request->getParameter('id');
     $this->community = Doctrine::getTable('Community')->find($this->communityId);
     opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community));
     $this->setTemplate('smtCommunity');
     return sfView::SUCCESS;
 }
Beispiel #5
0
 public function executeSmtMemberJoinCommunityListBox(opWebRequest $request)
 {
     if ($request->hasParameter('id') && 'profile' !== sfContext::getInstance()->getActionName()) {
         $this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
     } else {
         $this->member = $this->getUser()->getMember();
     }
 }
Beispiel #6
0
 public function executeFriendListBox(opWebRequest $request)
 {
     $memberId = $this->getUser()->getMemberId();
     if ($request->hasParameter('id')) {
         $memberId = $request->getParameter('id');
     }
     $this->member = Doctrine::getTable('Member')->find($memberId);
     $this->row = $this->gadget->getConfig('row');
     $this->friends = $this->member->getFriends($this->row, true);
 }
Beispiel #7
0
 public function executeJoinListBox(opWebRequest $request)
 {
     $memberId = $this->getUser()->getMemberId();
     if ($request->hasParameter('id')) {
         $memberId = $request->getParameter('id');
     }
     $this->member = Doctrine::getTable('Member')->find($memberId);
     $this->row = $this->gadget->getConfig('row');
     $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId());
     $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row, true);
 }
Beispiel #8
0
 public function executeFriendListBox(opWebRequest $request)
 {
     if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') {
         $this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
     } else {
         $this->member = $this->getUser()->getMember();
     }
     $this->row = $this->gadget->getConfig('row');
     $this->col = $this->gadget->getConfig('col');
     $this->friends = $this->member->getFriends($this->row * $this->col, true);
 }
Beispiel #9
0
 public function executeIndex(opWebRequest $request)
 {
     $this->form = new opTimelinePluginConfigurationForm();
     if ($request->isMethod(sfRequest::POST)) {
         $this->form->bind($request->getParameter($this->form->getName()));
         if ($this->form->isValid()) {
             $this->form->save();
             $this->getUser()->setFlash('notice', 'Saved configuration successfully.');
             $this->redirect('opTimelinePlugin/index');
         }
     }
 }
 public function executeDecision(opWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->checkCategory();
     $params = array('category' => $this->category, 'id' => $request->getParameter('id'), 'is_accepted' => $request->hasParameter('accept'), 'member' => $this->getUser()->getMember());
     $event = new sfEvent($this, 'op_confirmation.decision', $params);
     $this->dispatcher->notifyUntil($event);
     if ($event->isProcessed()) {
         $message = (string) $event->getReturnValue();
         $this->getUser()->setFlash('notice', $message);
     }
     $this->redirect('@confirmation_list?category=' . $this->category);
 }
Beispiel #11
0
 public function executeDeleteImage(opWebRequest $request)
 {
     $this->image = Doctrine::getTable('MemberImage')->find($request->getParameter('member_image_id'));
     $this->forward404Unless($this->image);
     $this->forward404Unless($this->image->getMemberId() == $this->getUser()->getMemberId());
     $this->form = new sfForm();
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         $this->image->delete();
         $this->redirect('member/configImage');
     }
 }
Beispiel #12
0
 /**
  * Executes search action
  *
  * @param opWebRequest $request A request object
  */
 public function executeSearch(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'community', 'smtSearch');
     return parent::executeSearch($request);
 }
 public function getRequestContext()
 {
     return array_merge(parent::getRequestContext(), array('to_address' => self::$mailMessage->to, 'from_address' => self::$mailMessage->from));
 }
 public function executeBirthdayBox(opWebRequest $request)
 {
     $id = $request->getParameter('id', $this->getUser()->getMemberId());
     $birthday = Doctrine::getTable('MemberProfile')->getViewableProfileByMemberIdAndProfileName($id, 'op_preset_birthday');
     $this->targetDay = $birthday ? opToolkit::extractTargetDay((string) $birthday) : false;
 }
Beispiel #15
0
 public function executeSns(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'timeline', 'smtSns');
     $this->forward('default', 'error');
     return sfView::SUCCESS;
 }
Beispiel #16
0
 public function executeLink(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'friend', 'smtLink');
     return parent::executeLink($request);
 }
 /**
  * Executes dropMember action
  *
  * @param sfRequest $request A request object
  */
 public function executeDropMember(opWebRequest $request)
 {
     $this->redirectUnless($this->isAdmin || $this->isSubAdmin, '@error');
     $member = Doctrine::getTable('Member')->find($request->getParameter('member_id'));
     $this->forward404Unless($member);
     $isCommunityMember = Doctrine::getTable('CommunityMember')->isMember($member->getId(), $this->id);
     $this->redirectUnless($isCommunityMember, '@error');
     $isAdmin = Doctrine::getTable('CommunityMember')->isAdmin($member->getId(), $this->id);
     $isSubAdmin = Doctrine::getTable('CommunityMember')->isSubAdmin($member->getId(), $this->id);
     $this->redirectIf($isAdmin || $isSubAdmin, '@error');
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         Doctrine::getTable('CommunityMember')->quit($member->getId(), $this->id);
         $this->redirect('@community_memberManage?id=' . $this->id);
     }
     $this->member = $member;
     $this->community = Doctrine::getTable('Community')->find($this->id);
     return sfView::INPUT;
 }
 public function executeShowAllMemberActivity(opWebRequest $request)
 {
     if (!isset($this->size)) {
         $this->size = 20;
     }
     $page = $request->getParameter('page', 1);
     if ($page == 1 && opConfig::get('is_allow_post_activity')) {
         $activityData = new ActivityData();
         $activityData->setBody($request->getParameter('body'));
         $this->form = new ActivityDataForm($activityData);
     }
     $this->pager = Doctrine::getTable('ActivityData')->getAllMemberActivityListPager($page, $this->size);
 }
Beispiel #19
0
 public function executeSmtCommunityMemberJoinListBox(opWebRequest $request)
 {
     $this->id = $request->getParameter('id');
     $this->community = Doctrine::getTable('Community')->find($this->id);
 }
Beispiel #20
0
 /**
  * Executes editProfile action
  *
  * @param opWebRequest $request a request object
  */
 public function executeEditProfile(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'member', 'smtEditProfile');
     return parent::executeEditProfile($request);
 }
Beispiel #21
0
 /**
  * Executes deleteImage action
  *
  * @param opWebRequest $request a request object
  */
 public function executeDeleteImage(opWebRequest $request)
 {
     $this->forward404Unless($this->id && $this->isEditCommunity);
     $this->community = Doctrine::getTable('Community')->find($this->id);
     $this->forward404Unless($this->community->getImageFileName());
     $this->form = new sfForm();
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         $this->community->getFile()->delete();
         $this->redirect('community/configImage?id=' . $this->id);
     }
 }