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

Changeset 9858


Ignore:
Timestamp:
Jan 3, 2009, 4:27:55 PM (14 years ago)
Author:
ogawa
Message:

#3209:removed the member_id column from DiaryForm?

Location:
OpenPNE3/plugins/opDiaryPlugin/trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/action/opDiaryPluginDiaryActions.class.php

    r9856 r9858  
    7272  {
    7373    $this->form = new DiaryForm();
     74    $this->form->getObject()->setMemberId($this->getUser()->getMemberId());
    7475    $this->processForm($request, $this->form);
    7576    $this->setTemplate('new');
     
    9091    $this->processForm($request, $this->form);
    9192    $this->setTemplate('edit');
    92   }
    93 
    94   protected function processForm(sfWebRequest $request, sfForm $form)
    95   {
    96     $params = $request->getParameter('diary');
    97     $params['member_id'] = $this->getUser()->getMemberId();
    98     $this->form->bind($params, $request->getFiles('diary'));
    99 
    100     if ($this->form->isValid())
    101     {
    102       $diary = $this->form->save();
    103 
    104       $this->redirect($this->generateUrl('diary_show', $diary));
    105     }
    10693  }
    10794
     
    147134  }
    148135
     136  protected function processForm(sfWebRequest $request, sfForm $form)
     137  {
     138    $form->bind(
     139      $request->getParameter($form->getName()),
     140      $request->getFiles($form->getName())
     141    );
     142
     143    if ($form->isValid())
     144    {
     145      $diary = $form->save();
     146
     147      $this->redirect($this->generateUrl('diary_show', $diary));
     148    }
     149  }
     150
    149151  protected function isAuthor()
    150152  {
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/form/DiaryForm.class.php

    r9852 r9858  
    1212  public function configure()
    1313  {
    14     unset($this->widgetSchema['member_id']);
    15     $this->widgetSchema['title'] = new sfWidgetFormInput();
    16 
     14    unset($this['member_id']);
    1715    unset($this['created_at']);
    1816    unset($this['updated_at']);
     17
     18    $this->widgetSchema['title'] = new sfWidgetFormInput();
    1919
    2020    $this->widgetSchema['public_flag'] = new sfWidgetFormChoice(array(
Note: See TracChangeset for help on using the changeset viewer.