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

Changeset 9662


Ignore:
Timestamp:
Dec 24, 2008, 7:06:03 PM (11 years ago)
Author:
ShogoKawahara
Message:

changed sort_order field of ProfileForm? and ProfileOptionForm?

Location:
OpenPNE3/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_backend/modules/profile/actions/actions.class.php

    r9640 r9662  
    4747
    4848    if ($request->isMethod('post')) {
    49       $this->form->bind($request->getParameter('profile'));
     49      $parameter = $request->getParameter('profile');
     50      if ($this->form->getObject()->isNew())
     51      {
     52        $parameter['sort_order'] = ProfilePeer::getMaxSortOrder();
     53      }
     54      $this->form->bind($parameter);
    5055      if ($this->form->isValid()) {
    5156        $this->form->save();
     
    6671
    6772    if ($request->isMethod('post')) {
    68       $this->form->bind($request->getParameter('profile_option'));
     73      $parameter = $request->getParameter('profile_option');
     74      if ($this->form->getObject()->isNew())
     75      {
     76        $parameter['sort_order'] = ProfileOptionPeer::getMaxSortOrder();
     77      }
     78      $this->form->bind($parameter);
    6979      if ($this->form->isValid()) {
    7080        $this->form->save();
  • OpenPNE3/trunk/apps/pc_backend/modules/profile/templates/editSuccess.php

    r9544 r9662  
    1616<?php echo $form['is_required']->renderRow() ?>
    1717<?php echo $form['is_unique']->renderRow() ?>
    18 <?php echo $form['sort_order']->renderRow() ?>
    1918<?php echo $form['is_disp_regist']->renderRow() ?>
    2019<?php echo $form['is_disp_config']->renderRow() ?>
     
    2524<?php echo $form['value_type']->renderRow() ?>
    2625<tr>
    27 <th><?php echo $form['value_min']->renderLabel() ?><?php echo $form['value_max']->renderLabel() ?></th>
    28 <td><?php echo $form['value_min']->render() ?><?php echo $form['value_max']->render() ?></td>
     26<th><?php echo $form['value_min']->renderLabel() ?><?php echo $form['value_max']->renderLabel() ?></th>
     27<td><?php echo $form['value_min']->render() ?><?php echo $form['value_max']->render() ?></td>
    2928</tr>
    3029<?php echo $form['value_regexp']->renderRow() ?>
    3130
    3231<tr>
    33 <td colspan="2"><input type="submit" value="<?php echo __('追加する') ?>" /></td>
     32<td colspan="2">
     33<?php echo $form['sort_order']->render() ?>
     34<input type="submit" value="<?php echo __('追加する') ?>" /></td>
    3435</tr>
    3536</table>
  • OpenPNE3/trunk/apps/pc_backend/modules/profile/templates/listSuccess.php

    r9640 r9662  
    1313<th>重複の可否</th>
    1414<th>フォームタイプ</th>
    15 <th>並び順(昇順)</th>
    1615<th>選択肢</th>
    1716<th>登録</th>
     
    3029<td><?php echo ($value->getIsUnique() ? '×' :'○') ?></td>
    3130<td><?php echo $value->getFormType() ?></td>
    32 <td><?php echo $value->getSortOrder() ?></td>
    3331<td></td>
    3432<td><?php echo ($value->getIsDispRegist() ? '○' : '×') ?></td>
     
    5351<th>ID</th>
    5452<th>項目名(ja_JP)</th>
    55 <th>並び順(昇順)</th>
    5653<th colspan="2">操作</th>
    5754</tr></thead>
     
    6865<?php echo $form['ja_JP']['value']->render() ?>
    6966</td>
    70 <td>
    71 <?php echo $form['sort_order']->render() ?>
    72 </td>
    7367<?php if ($form->getObject()->isNew()) : ?>
    7468<td colspan="2">
     
    8175<?php echo $form['id']->render() ?>
    8276<?php echo $form['profile_id']->render() ?>
     77<?php echo $form['sort_order']->render() ?>
    8378<input type="submit" value="変更" />
    8479</td>
  • OpenPNE3/trunk/lib/form/ProfileForm.class.php

    r9503 r9662  
    3535      ))),
    3636      'is_unique' => new sfWidgetFormSelectRadio(array('choices' => array('0' => '重複可', '1' => '重複不可'))),
     37      'sort_order' => new sfWidgetFormInputHidden(),
    3738    ) + $this->getWidgetSchema()->getFields());
    3839
     
    5556      'is_disp_config' => 'プロフィール変更',
    5657      'is_disp_search' => 'メンバー検索',
    57       'sort_order' => '並び順',
    5858    ));
    5959
  • OpenPNE3/trunk/lib/form/ProfileOptionForm.class.php

    r7930 r9662  
    1919    $this->setWidgets(array(
    2020      'id'         => new sfWidgetFormInputHidden(),
    21       'profile_id'         => new sfWidgetFormInputHidden(),
    22       'sort_order' => new sfWidgetFormInput($options),
     21      'profile_id' => new sfWidgetFormInputHidden(),
     22      'sort_order' => new sfWidgetFormInputHidden(),
    2323    ));
    2424
  • OpenPNE3/trunk/lib/model/ProfileOptionPeer.php

    r8129 r9662  
    1919    return $result;
    2020  }
     21
     22  public static function getMaxSortOrder()
     23  {
     24    $c = new Criteria();
     25    $c->addDescendingOrderByColumn(self::SORT_ORDER);
     26
     27    $result = self::doSelectOne($c);
     28    if ($result)
     29    {
     30      return $result->getSortOrder();
     31    }
     32    return 0;
     33  }
    2134}
  • OpenPNE3/trunk/lib/model/ProfilePeer.php

    r7849 r9662  
    4848    return $result;
    4949  }
     50
     51  public static function getMaxSortOrder()
     52  {
     53    $c = new Criteria();
     54    $c->addDescendingOrderByColumn(self::SORT_ORDER);
     55
     56    $result = self::doSelectOne($c);
     57    if ($result)
     58    {
     59      return $result->getSortOrder();
     60    }
     61    return 0;
     62  }
    5063}
Note: See TracChangeset for help on using the changeset viewer.