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

Changeset 3036


Ignore:
Timestamp:
May 19, 2007, 12:06:37 PM (12 years ago)
Author:
ogawa
Message:

#793:BIZ:繰り返し以外のすべての予定が意図せず削除されてしまう

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.6.7/webapp_biz/modules/biz/lib/mysql_functions.php

    r2440 r3036  
    9090    $first_id = db_get_one($sql, $params);
    9191
    92     $sql = 'SELECT biz_schedule_id FROM biz_schedule WHERE rep_first = ? ORDER BY begin_date';
    93     $params = array(
    94         intval($first_id),
    95     );
    96     $schedule = db_get_col($sql, $params);
     92    if (!$first_id) {  // 削除しようとした繰り返し予定が存在しない
     93        return array();
     94    } else {
     95        $sql = 'SELECT biz_schedule_id FROM biz_schedule WHERE rep_first = ? ORDER BY begin_date';
     96        $params = array(
     97            intval($first_id),
     98        );
     99        $schedule = db_get_col($sql, $params);
     100    }
    97101
    98102    return $schedule;
     
    888892
    889893//スケジュール削除
    890 function biz_deleteSchedule($id, $group = false)
    891 {
    892     if ($group) {
    893         $sql = 'SELECT first_id FROM biz_schedule WHERE biz_schedule_id = ?';
    894         $params = array(intval($id));
    895         $firstid = db_get_one($sql, $params);
    896 
    897         $sql = 'SELECT biz_schedule_id FROM biz_schedule WHERE first_id = ?';
    898         $params = array(intval($firstid));
    899         $schedules = db_get_col($sql, $params);
    900 
    901         $sql = 'DELETE FROM biz_schedule WHERE first_id = ?';
    902         $params = array(intval($firstid));
    903         db_query($sql, $params);
    904 
    905         foreach ($schedules as $nowid) {
    906             $sql = 'DELETE FROM biz_schedule_member WHERE biz_schedule_id = ?';
    907             $params = array(intval($nowid));
    908             db_query($sql, $params);
    909         }
    910     } else {
    911         $sql = 'DELETE FROM biz_schedule WHERE biz_schedule_id = ?';
    912         $params = array(
    913             intval($id),
    914         );
    915         db_query($sql, $params);
    916         $sql = 'DELETE FROM biz_schedule_member WHERE biz_schedule_id = ?';
    917         $params = array(
    918             intval($id),
    919         );
    920         db_query($sql, $params);
    921     }
     894function biz_deleteSchedule($id)
     895{
     896    $sql = 'DELETE FROM biz_schedule WHERE biz_schedule_id = ?';
     897    $params = array(
     898        intval($id),
     899    );
     900    db_query($sql, $params);
     901    $sql = 'DELETE FROM biz_schedule_member WHERE biz_schedule_id = ?';
     902    $params = array(
     903        intval($id),
     904    );
     905    db_query($sql, $params);
    922906}
    923907
Note: See TracChangeset for help on using the changeset viewer.