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

Changeset 2339


Ignore:
Timestamp:
Mar 30, 2007, 12:53:01 AM (13 years ago)
Author:
ebihara
Message:

#430 biz_saveImage以外の関数置換によるバグを修正

Location:
OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/lib/db/schedule.php

    r2326 r2339  
    120120
    121121    $biz_group_id_list = array();
    122     foreach(db_group_biz_group_list4c_member_id($target_c_member_id) as $value) {
     122    $biz_group_list = db_group_biz_group_list4c_member_id($target_c_member_id);
     123    foreach($biz_group_list[0] as $value) {
    123124        $biz_group_id_list[] = $value['biz_group_id'];
    124125    }
     
    126127    foreach ($tmp as $biz_schedule_id) {
    127128        $biz_schedule = db_schedule_biz_schedule4biz_schedule_id($biz_schedule_id);
    128 
     129        $sql = 'SELECT c_member_id FROM biz_schedule_member WHERE biz_schedule_id = ?';
     130        $biz_schedule_member_id_list = db_get_col($sql, array(intval($biz_schedule_id)));
    129131        if (db_schedule_public_flag_condition($u, $biz_schedule_id)) {
    130                 if ($biz_schedule['c_member_id'] == $target_c_member_id) {
     132                if (in_array($target_c_member_id, $biz_schedule_member_id_list)) {
    131133                    $contain[] = $biz_schedule_id;
    132134                } elseif(in_array($biz_schedule['biz_group_id'], $biz_group_id_list) && ($value['public_flag'] != 'private')) {
    133135                    $contain[] = $biz_schedule_id;
    134                 }
     136                } elseif (empty($biz_schedule_member_id_list) && !$biz_schedule['biz_group_id'] && ($biz_schedule['c_member_id'] == $u)) {
     137                $contain[] = $biz_schedule_id;
     138            }
    135139        }
    136140    }
     
    139143
    140144    foreach ($contain as $key => $biz_schedule_id) {
    141         if (!is_null($value)) {
     145        if (!is_null($biz_schedule_id)) {
    142146            //そのidの予定を得る
    143147            $sql = 'SELECT * FROM biz_schedule WHERE biz_schedule_id = ?';
     
    205209 * 予定を登録
    206210 */
    207 function db_schedule_insert_biz_schedule($title, $member_id, $begin_date, $finish_date,
     211function db_schedule_insert_biz_schedule($title, $c_member_id, $begin_date, $finish_date,
    208212    $begin_time = null, $finish_time = null,
    209213    $value = '', $rep_type = 0, $first_id = 0,
    210     $biz_group_id = 0, $public_flag = "public")
     214    $biz_group_id = 0, $public_flag = "public", $target_c_member_id = null)
    211215{
    212216    //biz_scheduleにデータを追加する
    213217    $data = array(
    214218        'title' => $title,
    215         'c_member_id' => intval($member_id),
     219        'c_member_id' => intval($c_member_id),
    216220        'begin_date' => $begin_date,
    217221        'finish_date' => $finish_date,
     
    225229    );
    226230
    227     return db_insert('biz_schedule', $data);
     231    $biz_schedule_id = db_insert('biz_schedule', $data);
     232
     233    if (!$biz_group_id) {  //個人の予定
     234        if (is_null($target_c_member_id)) {  //作成者自身の予定
     235            $target_c_member_id = $c_member_id;
     236        }
     237
     238        $param = array(
     239            'biz_schedule_id' => $biz_schedule_id,
     240            'c_member_id' => $target_c_member_id,
     241            'is_read' => 1
     242        );
     243        db_insert('biz_schedule_member', $param);
     244    }
     245
     246    return $biz_schedule_id;
    228247}
    229248
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/do/fhg_biz_schedule_add.php

    r2326 r2339  
    146146        if ($requests['sc_rp']) {
    147147            //終了日の決定
    148             $finish_date = date("Y-m-d", strtotime($requests['sc_b_year'].'-'.$requests['sc_b_month'].'-'.($requests['sc_b_date']+($requests['sc_rcount'])*7)));
     148            $finish_date = date("Y-m-d", strtotime($requests['sc_b_year'].'-'.$requests['sc_b_month'].'-'.$requests['sc_b_date'].' + ' . ($requests['sc_rcount'])*7 . 'days'));
    149149
    150150            //first_idの決定
    151151            $first_id = db_schedule_repeat_schedule_first_id();
     152
    152153            if (!$first_id) {
    153154                $first_id = 1;
     
    165166        if (!$requests['sc_rp']) {
    166167            //繰り返しをしない予定登録
    167             $insert_id = db_schedule_insert_biz_schedule($requests['sc_title'], $u, $begin_date, $finish_date, $begin_time, $finish_time, $requests['sc_memo'], $rp_rule, 0, $requests['biz_group_id'], $requests['public_flag']);
     168            $insert_id = db_schedule_insert_biz_schedule($requests['sc_title'], $u, $begin_date, $finish_date, $begin_time, $finish_time, $requests['sc_memo'], $rp_rule, 0, $requests['biz_group_id'], $requests['public_flag'], $requests['target_c_member_id']);
    168169        } else {
    169170            //繰り返し予定
    170171            $tmp = $begin_date;  //処理中の日付
    171172
    172             for ($i=0; date("Ymd", strtotime($tmp)) < date("Ymd", strtotime($finish_date)); $i++) {
    173                 $nowday = strtotime($requests['sc_b_year'].'-'.$requests['sc_b_month'].'-'.($requests['sc_b_date']+$i));
    174                 $tmp = date("Ymd", $nowday);
     173            for ($i=0; strtotime($tmp) < strtotime($finish_date); $i++) {
     174                $nowday = strtotime($begin_date . ' + ' . $i . 'days');
     175                $tmp = date("Y-m-d", $nowday);
    175176                if ($rp_rule & (1 << date("w",$nowday))) {
    176                     $insert_id = db_schedule_insert_biz_schedule($requests['sc_title'], $u, $tmp, $tmp, $begin_time, $finish_time, $requests['sc_memo'], $rp_rule, $first_id, $requests['biz_group_id'], $requests['public_flag']);
     177                    $insert_id = db_schedule_insert_biz_schedule($requests['sc_title'], $u, $tmp, $tmp, $begin_time, $finish_time, $requests['sc_memo'], $rp_rule, $first_id, $requests['biz_group_id'], $requests['public_flag'], $requests['target_c_member_id']);
    177178                }
    178179            }
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/do/h_biz_group_edit.php

    r2326 r2339  
    2929                $p = array('msg' => '画像は300KB以内のGIF・JPEG・PNGにしてください。',
    3030                    'target_id' => $biz_group_id);
    31                 openpne_redirect('biz', 'page_h_group_edit', $p);
     31                openpne_redirect('biz', 'page_h_biz_group_edit', $p);
    3232                exit();
    3333            }
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/lib/smarty_functions.php

    r2326 r2339  
    6161
    6262    $inc_smarty->assign("cmd", $cmd_head);  //操作の対象ページ
    63     $inc_smarty->assign("target_id", $member_id);  //予定登録
     63    $inc_smarty->assign("target_id", $member_id);  //予定参加
    6464
    6565    require_once 'Calendar/Week.php';
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/page/fh_biz_schedule_add.php

    r2314 r2339  
    131131
    132132        $this->set('biz_group_list', $biz_group_list[0]);
     133        $this->set('target_c_member_id', $target_id);
    133134
    134135        return 'success';
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/page/fh_biz_schedule_view.php

    r2326 r2339  
    7575                $biz_group = db_group_biz_group4biz_group_id($list['biz_group_id']);
    7676                $list['biz_group_name'] = $biz_group['name'];
     77        } else {
     78            $target_c_member = db_member_c_member4c_member_id_LIGHT($requests['target_id']);
     79            $list['target_c_member_nickname'] = $target_c_member['nickname'];
    7780        }
    7881
     
    99102        if ($list['rep_type']) {
    100103            //繰り返し予定の場合はまとめて既読済みに
    101             $rep_schedule = db_schedule_biz_schedule_list_date4c_member_id($requests['id']);
     104            $rep_schedule = db_schedule_biz_repeat_schedule_list4biz_schedule_id($requests['id']);
    102105            foreach ($rep_schedule as $value) {
    103106                db_schedule_update_biz_schedule_is_checked($u, $value);
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/templates/fh_biz_schedule_add.tpl

    r1641 r2339  
    1212({t_form _enctype=file m=biz a=do_fhg_biz_schedule_add})
    1313<input type="hidden" name="sessid" value="({$PHPSESSID})">
    14 
     14<input type="hidden" name="target_c_member_id" value="({$target_c_member_id})">
    1515<table border="0" cellspacing="0" cellpadding="0" style="width:540px;margin:0px auto;" class="border_07">
    1616<tr>
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/templates/fh_biz_schedule_calendar.tpl

    r1187 r2339  
    4040<a href="({$weather_url})" target="_blank">天気予報を見る</a>
    4141&nbsp;<img src="./skin/icon_schedule.gif" class="icon">
    42 <a href="({t_url m=biz a=page_fh_biz_schedule_add})">予定を追加</a>&nbsp;
    43 
     42<a href="({t_url m=biz a=page_fh_biz_schedule_add})&target_id=({$c_member.c_member_id})">予定を追加</a>&nbsp;
    4443</td>
    4544<td style="width:200px;padding:2px 0px;" class="bg_05" align="right">
     
    8079({$item.day})
    8180({/if})<br>
    82 <a href="({t_url m=biz a=page_fh_biz_schedule_add})&amp;begin_date=({$year})({$month|string_format:'%02d'})({$item.day|string_format:'%02d'})"><img src="./skin/icon_schedule.gif" class="icon"></a><br>
     81<a href="({t_url m=biz a=page_fh_biz_schedule_add})&amp;begin_date=({$year})({$month|string_format:'%02d'})({$item.day|string_format:'%02d'})&target_id=({$c_member.c_member_id})"><img src="./skin/icon_schedule.gif" class="icon"></a><br>
    8382
    8483({* 祝日 *})
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/templates/fh_biz_schedule_view.tpl

    r1803 r2339  
    177177<td class="bg_05" align="center" valign="middle">
    178178<div style="padding:4px 3px;">
     179登録者
     180</div>
     181</td>
     182<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     183<td class="bg_02" align="left" valign="middle">
     184<div style="padding:4px 3px;">
     185<a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$schedule.c_member_id})">({$schedule.writer_name})</a><br>
     186</div>
     187</td>
     188<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     189</tr>
     190({*********})
     191<tr>
     192<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     193</tr>
     194({*********})
     195<tr>
     196<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     197<td class="bg_05" align="center" valign="middle">
     198<div style="padding:4px 3px;">
    179199({if $schedule.biz_group_id})
    180 登録者
     200グループ
    181201({else})
    182202参加者
     
    187207<td class="bg_02" align="left" valign="middle">
    188208<div style="padding:4px 3px;">
    189 
    190         <a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$schedule.c_member_id})">({$schedule.writer_name})</a>   <br>
    191 
    192 </div>
    193 </td>
    194 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    195 </tr>
    196 ({*********})
    197 <tr>
    198 <td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    199 </tr>
    200 ({*********})
    201209({if $schedule.biz_group_id})
    202 <tr>
    203 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    204 <td class="bg_05" align="center" valign="middle">
    205 <div style="padding:4px 3px;">
    206 グループ
    207 </div>
    208 </td>
    209 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    210 <td class="bg_02" align="left" valign="middle">
    211 <div style="padding:4px 3px;">
    212         <a href="({t_url m=biz a=page_g_home})&amp;target_c_commu_id=({$schedule.biz_group_id})">({$schedule.biz_group_name})</a><br>
    213 </div>
    214 </td>
    215 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    216 </tr>
    217 ({*********})
    218 <tr>
    219 <td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    220 </tr>
    221 ({*********})
    222 ({/if})
     210<a href="({t_url m=biz a=page_g_home})&amp;target_c_commu_id=({$schedule.biz_group_id})">({$schedule.biz_group_name})</a><br>
     211({elseif $target_c_member_id})
     212<a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$target_c_member_id})">({$schedule.target_c_member_nickname})</a><br>
     213({else})
     214<a href="({t_url m=pc a=page_f_home})&amp;target_c_member_id=({$schedule.c_member_id})">({$schedule.writer_name})</a>   <br>
     215({/if})
     216</div>
     217</td>
     218<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     219</tr>
     220({*********})
     221<tr>
     222<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     223</tr>
    223224({*********})
    224225<tr>
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/biz/validate/do/fhg_biz_schedule_add.ini

    r1087 r2339  
    8888caption = 'バナー予定かどうか'
    8989
     90[target_c_member_id]
     91type="int"
     92required = 0
     93caption = '予定参加者'
  • OpenPNE/branches/ebihara/prj_dev28_bizfix/webapp_biz/modules/ktai_biz/init.inc

    r1856 r2339  
    2020}
    2121
     22//ライブラリの読み込み
     23util_include_php_files(OPENPNE_WEBAPP_BIZ_DIR . '/lib/db');
     24util_include_php_files(OPENPNE_WEBAPP_BIZ_DIR . '/lib/util');
     25
    2226// bizモジュールディレクトリの定義
    2327$biz_dir = OPENPNE_MODULES_BIZ_DIR.'/biz/';
     
    2731
    2832// 文字コード変換
    29 function ktai_convert_encoding($arr)
     33function ktai_biz_convert_encoding($arr)
    3034{
    3135    return is_array($arr) ?
    32         array_map('ktai_convert_encoding', $arr) :
     36        array_map('ktai_biz_convert_encoding', $arr) :
    3337        mb_convert_encoding($arr, 'UTF-8', 'SJIS-win');
    3438}
    3539
    3640// 絵文字変換
    37 function ktai_convert_emoji($arr)
     41function ktai_biz_convert_emoji($arr)
    3842{
    3943    return is_array($arr) ?
    40         array_map('ktai_convert_emoji', $arr) :
     44        array_map('ktai_biz_convert_emoji', $arr) :
    4145        emoji_escape($arr);
    4246}
    4347
    44 function ktai_convert($arr)
     48function ktai_biz_convert($arr)
    4549{
    46     $arr = ktai_convert_emoji($arr);
    47     $arr = ktai_convert_encoding($arr);
     50    $arr = ktai_biz_convert_emoji($arr);
     51    $arr = ktai_biz_convert_encoding($arr);
    4852    return $arr;
    4953}
    5054
    51 $_GET     = ktai_convert($_GET);
    52 $_POST    = ktai_convert($_POST);
    53 $_REQUEST = ktai_convert($_REQUEST);
     55$_GET     = ktai_biz_convert($_GET);
     56$_POST    = ktai_biz_convert($_POST);
     57$_REQUEST = ktai_biz_convert($_REQUEST);
    5458
    5559ini_set('session.use_cookies', '0');
Note: See TracChangeset for help on using the changeset viewer.