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

Changeset 2874


Ignore:
Timestamp:
May 13, 2007, 9:30:37 PM (15 years ago)
Author:
ogawa
Message:

#752:管理画面から到達ポイントが同じランクを複数指定できる

Location:
OpenPNE/branches/2.8.x/webapp
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/2.8.x/webapp/lib/db/point.php

    r2861 r2874  
    112112}
    113113
     114//引数で指定したポイントのランクが存在するかどうか
     115function db_point_is_rank4point($point)
     116{
     117    $sql = 'SELECT c_rank_id FROM c_rank WHERE point = ?';
     118    return (bool)db_get_one($sql, array(intval($point)));
     119}
     120
    114121?>
  • OpenPNE/branches/2.8.x/webapp/modules/admin/do/insert_c_rank.php

    r2865 r2874  
    88class admin_do_insert_c_rank extends OpenPNE_Action
    99{
     10    function handleError($errors)
     11    {
     12        admin_client_redirect('list_c_rank', array_shift($errors));
     13    }
     14
    1015    function execute($requests)
    1116    {
    1217        if (!OPENPNE_USE_POINT_RANK) {
    1318            admin_client_redirect('top', '指定されたページにはアクセスできません');
     19        }
     20
     21        if (db_point_is_rank4point($requests['point'])) {
     22            admin_client_redirect('list_c_rank', '同一の到達ポイントのランクが既に存在します');
    1423        }
    1524
  • OpenPNE/branches/2.8.x/webapp/modules/admin/do/update_c_action.php

    r2838 r2874  
    88class admin_do_update_c_action extends OpenPNE_Action
    99{
     10    function handleError($errors)
     11    {
     12        admin_client_redirect('list_c_rank', array_shift($errors));
     13    }
     14
    1015    function execute($requests)
    1116    {
    12         db_admin_update_c_action($requests['c_action_id'], $requests['name'], $requests['point']);
     17        db_admin_update_c_action($requests['c_action_id'], $requests['point']);
    1318
    1419        admin_client_redirect('list_c_rank', '加算ポイントを変更しました');
  • OpenPNE/branches/2.8.x/webapp/modules/admin/do/update_c_rank.php

    r2865 r2874  
    88class admin_do_update_c_rank extends OpenPNE_Action
    99{
     10    function handleError($errors)
     11    {
     12        admin_client_redirect('update_c_rank', array_shift($errors), 'c_rank_id='.$this->requests['c_rank_id']);
     13    }
     14
    1015    function execute($requests)
    1116    {
  • OpenPNE/branches/2.8.x/webapp/modules/admin/lib/db_admin.php

    r2838 r2874  
    22472247
    22482248//アクションを編集
    2249 function db_admin_update_c_action($c_action_id, $name, $point)
    2250 {
    2251     $data = array(
    2252         'name' => strval($name),
     2249function db_admin_update_c_action($c_action_id, $point)
     2250{
     2251    $data = array(
    22532252        'point' => intval($point),
    22542253    );
  • OpenPNE/branches/2.8.x/webapp/modules/admin/templates/list_c_rank.tpl

    r2860 r2874  
    3131
    3232<form action="./" method="post">
    33 <input type="hidden" name="m" value="({$module_name})">
    34 <input type="hidden" name="a" value="do_({$hash_tbl->hash('update_c_action','do')})">
    35 <input type="hidden" name="sessid" value="({$PHPSESSID})">
    36 <input type="hidden" name="c_action_id" value="({$c_action.c_action_id})">
    37 <input type="hidden" name="name" value="({$c_action.name})">
    38 <td><input type="text" class="basic" name="point" value="({$c_action.point})" size="10"></td>
     33<input type="hidden" name="m" value="({$module_name})" />
     34<input type="hidden" name="a" value="do_({$hash_tbl->hash('update_c_action','do')})" />
     35<input type="hidden" name="sessid" value="({$PHPSESSID})" />
     36<input type="hidden" name="c_action_id" value="({$c_action.c_action_id})" />
     37<td><input type="text" class="basic" name="point" value="({$c_action.point})" size="10" /></td>
    3938<td><span class="textBtnS"><input type="submit" class="submit" value="変更"></span></td>
    4039</form>
     
    8180<form action="./" method="post" enctype="multipart/form-data">
    8281<td>
    83 <input type="hidden" name="m" value="({$module_name})">
    84 <input type="hidden" name="a" value="do_({$hash_tbl->hash('insert_c_rank','do')})">
    85 <input type="hidden" name="sessid" value="({$PHPSESSID})">
     82<input type="hidden" name="m" value="({$module_name})" />
     83<input type="hidden" name="a" value="do_({$hash_tbl->hash('insert_c_rank','do')})" />
     84<input type="hidden" name="sessid" value="({$PHPSESSID})" />
    8685</td>
    87 <td><input type="text" class="basic" name="name" value="" size="5"></td>
    88 <td><input type="file" name="image_upfile" value="" size="20"></td>
    89 <td><input type="text" class="basic" name="point" value="" size="5"></td>
    90 <td colspan="2"><span class="textBtnS"><input type="submit" class="submit" value="ランク追加"></span></td>
     86<td><input type="text" class="basic" name="name" value="" size="5" /></td>
     87<td><input type="file" name="image_upfile" value="" size="20" /></td>
     88<td><input type="text" class="basic" name="point" value="" size="5" /></td>
     89<td colspan="2"><span class="textBtnS"><input type="submit" class="submit" value="ランク追加" /></span></td>
    9190</form>
    9291</tr>
  • OpenPNE/branches/2.8.x/webapp/modules/admin/validate/do/insert_c_rank.ini

    r1265 r2874  
    11[name]
    22type = "string"
    3 default = ""
     3required = 1
     4caption = "ランク名"
    45
    56[point]
    67type = "int"
    78default = 0
     9caption = "到達ポイント"
  • OpenPNE/branches/2.8.x/webapp/modules/admin/validate/do/update_c_action.ini

    r1265 r2874  
    33required = 1
    44
    5 [name]
    6 type = "string"
    7 default = ""
    8 
    95[point]
    106type = "int"
    117default = 0
     8caption = "加算ポイント"
  • OpenPNE/branches/2.8.x/webapp/modules/admin/validate/do/update_c_rank.ini

    r1265 r2874  
    55[name]
    66type = "string"
    7 default = ""
     7required = 1
     8caption = "ランク名"
    89
    910[point]
    1011type = "int"
    1112default = 0
     13caption = "到達ポイント"
Note: See TracChangeset for help on using the changeset viewer.