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

Changeset 1187


Ignore:
Timestamp:
Dec 15, 2006, 11:12:43 AM (14 years ago)
Author:
takanashi
Message:

#361 週間スケジュールの表示方法変更
#315 カレンダーの休日・祝日設定を入れたい
盛り込み

Location:
OpenPNE/trunk
Files:
19 edited
12 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/db/deprecated_temporary4.php

    r1131 r1187  
    446446                $c_password_query_answer,
    447447                $public_flag_diary,
    448                 $is_shinobiashi)
     448                $is_shinobiashi,
     449                $schedule_start_day)
    449450{
    450451    return db_member_h_config_3(
     
    457458                $c_password_query_answer,
    458459                $public_flag_diary,
    459                 $is_shinobiashi);
     460                $is_shinobiashi,
     461                $schedule_start_day);
    460462}
    461463
  • OpenPNE/trunk/webapp/lib/db/etc.php

    r1175 r1187  
    744744}
    745745
     746/**
     747 * カレンダーの祝日を取得する
     748 */
     749function db_c_holiday_list4date($m, $d)
     750{
     751    $sql = 'SELECT name FROM c_holiday WHERE month = ? AND day = ?';
     752    $params = array(intval($m), intval($d));
     753    return db_get_col($sql, $params);
     754}
    746755?>
  • OpenPNE/trunk/webapp/lib/db/member.php

    r1175 r1187  
    10271027                $c_password_query_answer,
    10281028                $public_flag_diary,
    1029                 $is_shinobiashi)
     1029                $is_shinobiashi,
     1030                $schedule_start_day)
    10301031{
    10311032    //function cacheの削除
     
    10401041        'public_flag_diary' => $public_flag_diary,
    10411042        'is_shinobiashi' => $is_shinobiashi,
     1043        'schedule_start_day' => $schedule_start_day,
    10421044    );
    10431045    $where = array('c_member_id' => intval($c_member_id));
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r1175 r1187  
    19411941}
    19421942
     1943/**
     1944 * 祝日のリストを取得
     1945 */
     1946function db_admin_c_holiday_list()
     1947{
     1948    $sql = 'SELECT * FROM c_holiday ORDER BY month';
     1949    $holiday_list = db_get_all($sql);
     1950
     1951    return $holiday_list;
     1952}
     1953
     1954/**
     1955 * 休日を追加
     1956 */
     1957function db_admin_insert_c_holiday($name, $month, $day)
     1958{
     1959    $data = array(
     1960        'name' => strval($name),
     1961        'month' => intval($month),
     1962        'day' => intval($day),
     1963    );
     1964    return db_insert('c_holiday', $data);
     1965}
     1966
     1967/**
     1968 * 休日を編集
     1969 */
     1970function db_admin_update_c_holiday($c_holiday_id, $name, $month, $day)
     1971{
     1972    $data = array(
     1973        'name' => strval($name),
     1974        'month' => intval($month),
     1975        'day' => intval($day),
     1976    );
     1977    $where = array('c_holiday_id' => intval($c_holiday_id));
     1978    return db_update('c_holiday', $data, $where);
     1979}
     1980
     1981/**
     1982 * 休日を削除
     1983 */
     1984function db_admin_delete_c_holiday($c_holiday_id)
     1985{
     1986    $sql = "DELETE FROM c_holiday WHERE c_holiday_id = ?";
     1987    $params = array(intval($c_holiday_id));
     1988    return db_query($sql, $params);
     1989}
    19431990
    19441991?>
  • OpenPNE/trunk/webapp/modules/admin/templates/inc_header.tpl

    r1076 r1187  
    7171<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_api')})" title="OpenPNE API設定: API通信を許可するIPアドレスの設定">OpenPNE API設定</a></li>
    7272<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_cmd')})" title="CMD設定: CMDを許可するページの設定">CMD設定</a></li>
     73<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('edit_c_holiday')})" title="祝日設定: カレンダーに表示する休日の設定">祝日設定</a></li>
    7374</ul>
    7475
  • OpenPNE/trunk/webapp/modules/pc/do/h_config_3.php

    r134 r1187  
    3131        $public_flag_diary = $requests['public_flag_diary'];
    3232        $is_shinobiashi = $requests['is_shinobiashi'];
     33        $schedule_start_day = $requests['schedule_start_day'];
    3334        // ----------
    3435
     
    5859            $c_password_query_answer,
    5960            $public_flag_diary,
    60             $is_shinobiashi
     61            $is_shinobiashi,
     62            $schedule_start_day
    6163        );
    6264
  • OpenPNE/trunk/webapp/modules/pc/page/h_calendar.php

    r134 r1187  
    6060                    'event' => $event_list[$day],
    6161                    'schedule' => p_h_calendar_c_schedule_list4date($year, $month, $day, $u),
     62                    'holiday' => db_c_holiday_list4date($month, $day),
    6263                );
    6364                $item['day'] = $day;
  • OpenPNE/trunk/webapp/modules/pc/page/h_home.php

    r881 r1187  
    9999        /// 週間カレンダー
    100100        if (DISPLAY_SCHEDULE_HOME) {
    101             $this->set('calendar', $this->get_calendar($u, $requests['w']));
     101                        //開始曜日の設定
     102                        if ($c_member['schedule_start_day'] == 2) {
     103                $start_day = date("w");
     104            } else {
     105                $start_day = $c_member['schedule_start_day'];
     106            }
     107            $this->set('calendar', $this->get_calendar($u, $requests['w'], $start_day));
    102108        }
    103109
     
    128134    }
    129135
    130     function get_calendar($u, $week)
     136    function get_calendar($u, $week, $start_day)
    131137    {
    132138        include_once 'Calendar/Week.php';
     
    137143        $this->set('w', $w);
    138144        $time = strtotime($w . ' week');
    139         $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), 0);
     145        $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), $start_day);
    140146        $Week->build();
    141147        $calendar = array();
    142148        $dayofweek = array('日','月','火','水','木','金','土');
    143         $i = 0;
     149        $i = $start_day;
     150        $dayofweek = array_merge($dayofweek,
     151            array_slice($dayofweek, 0, ($start_day + 1)));
    144152        while ($Day = $Week->fetch()) {
    145153            $y = $Day->thisYear();
     
    156164                'event' => p_h_home_event4c_member_id($y, $m, $d, $u),
    157165                'schedule' => p_h_calendar_c_schedule_list4date($y, $m, $d, $u),
     166                'holiday' => db_c_holiday_list4date($m, $d),
    158167            );
    159168            if ($w == 0 && $d == date('d')) {
  • OpenPNE/trunk/webapp/modules/pc/templates/h_calendar.tpl

    r1081 r1187  
    6969({foreach from=$calendar item=week})
    7070<tr>
    71 ({foreach from=$week item=item})
     71({foreach from=$week item=item name=weekloop})
    7272({if $item.now})
    7373<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_09">
     74({elseif $item.holiday || $smarty.foreach.weekloop.first})
     75<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_14">
    7476({else})
    7577<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_02">
     
    8183({$item.day})
    8284({/if})<br>
     85
    8386({if $add_schedule})
    8487<a href="({t_url m=pc a=page_h_schedule_add})&amp;year=({$ym.year_disp})&amp;month=({$ym.month_disp})&amp;day=({$item.day})"><img src="({t_img_url_skin filename=icon_schedule})" class="icon"></a><br>
     88({/if})
     89
     90({* 祝日 *})
     91({if $item.holiday})
     92({foreach from=$item.holiday item=item_holiday})
     93<span class=" c_02">({$item_holiday})</span><br>
     94({/foreach})
    8595({/if})
    8696
  • OpenPNE/trunk/webapp/modules/pc/templates/h_config.tpl

    r1175 r1187  
    368368<input type="radio" name="is_receive_daily_news" value="0" ({if $c_member.is_receive_daily_news eq 0}) checked="checked"({/if}) class="no_bg">受け取らない<br>
    369369<span>※({$SNS_NAME})の最新情報をお届けします。</span>
     370
     371</div>
     372</td>
     373<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     374</tr>
     375({*********})
     376<tr>
     377<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     378</tr>
     379({/if})
     380({*********})
     381({if $smarty.const.DISPLAY_SCHEDULE_HOME})
     382<tr>
     383<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     384<td class="bg_05" align="left" valign="middle">
     385
     386<div class="padding_s">
     387
     388週間カレンダー
     389
     390</div>
     391
     392</td>
     393<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     394<td class="bg_02" align="left" valign="middle">
     395<div class="padding_s">
     396
     397<input type="radio" name="schedule_start_day" value="0" ({if $c_member.schedule_start_day == 0}) checked="checked"({/if})>日曜始まり
     398<input type="radio" name="schedule_start_day" value="1" ({if $c_member.schedule_start_day == 1}) checked="checked"({/if})>月曜始まり
     399<input type="radio" name="schedule_start_day" value="2" ({if $c_member.schedule_start_day == 2}) checked="checked"({/if})>本日始まり
    370400
    371401</div>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_home.tpl

    r1106 r1187  
    923923<tr>
    924924({foreach from=$calendar item=item name=calendar})
    925 <td style="width:({if $smarty.foreach.calendar.last})64({else})60({/if})px;({if !$smarty.foreach.calendar.last})border-right:none;({/if})" align="left" valign="top" class="border_01 bg_0({if $item.now})9({else})2({/if})({if $item.dayofweek == "日"}) c_02({elseif $item.dayofweek == "土"}) c_03({/if}) padding_s">
     925<td style="width:({if $smarty.foreach.calendar.last})64({else})60({/if})px;({if !$smarty.foreach.calendar.last})border-right:none;({/if})" align="left" valign="top" class="border_01 bg_0({if $item.now})9({else})2({/if})({if $item.dayofweek == "日" || $item.holiday}) c_02({elseif $item.dayofweek == "土"}) c_03({/if}) padding_s">
    926926({if $item.now})<span class="b_b">({/if})
    927927
     
    935935
    936936<div>
     937({* 祝日 *})
     938({foreach from=$item.holiday item=item_holiday})
     939({$item_holiday})<br>
     940({/foreach})
     941
    937942({* 誕生日 *})
    938943({foreach from=$item.birth item=item_birth})
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_header.tpl

    r1154 r1187  
    4848.bg_12 { background-color: #({$INC_HEADER_color_config.bg_12}) ; }
    4949.bg_13 { background-color: #({$INC_HEADER_color_config.bg_13}) ; }
     50.bg_14 { background-color: #({$INC_HEADER_color_config.bg_14}) ; }
    5051
    5152body { background-color: #({$INC_HEADER_color_config.bg_12}) ; }
  • OpenPNE/trunk/webapp/modules/pc/validate/do/h_config_3.ini

    r260 r1187  
    3535type = "string"
    3636default = "public"
     37
     38[schedule_start_day]
     39type="int"
     40default=0
  • OpenPNE/trunk/webapp_biz/modules/biz/lib/mysql_functions.php

    r1181 r1187  
    13381338    }
    13391339}
     1340
     1341
     1342/**
     1343 * 週間カレンダー開始曜日を取得
     1344 */
     1345function biz_get_schedule_start_day($c_member_id)
     1346{
     1347    $sql = 'SELECT schedule_start_day FROM c_member WHERE c_member_id = ?';
     1348    return db_get_one($sql, array($c_member_id));
     1349}
    13401350?>
  • OpenPNE/trunk/webapp_biz/modules/biz/lib/smarty_functions.php

    r1181 r1187  
    6262    $inc_smarty->assign("cmd", $cmd_head);  //操作の対象ページ
    6363    $inc_smarty->assign("target_id", $member_id);  //予定登録者
     64    $schedule_start_day = biz_get_schedule_start_day($member_id);
     65        if ($schedule_start_day == 2) {
     66        $start_day = date("w");
     67    } else {
     68        $start_day = intval($schedule_start_day);
     69    }
    6470
    6571    require_once 'Calendar/Week.php';
     
    7076    $inc_smarty->assign('w', $w);
    7177    $time = strtotime($w . " week");
    72     $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), 0);
     78    $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), $start_day);
    7379    $Week->build();
    7480    $calendar = array();
    7581    $dayofweek = array('日','月','火','水','木','金','土');
    76     $i = 0;
    77 
     82    $i = $start_day;
     83    $dayofweek = array_merge($dayofweek,
     84        array_slice($dayofweek, 0, ($start_day + 1)));
    7885    $schedule = array();
    7986
     
    108115                'schedule' => $schedule,
    109116                'todo' => biz_schedule_todo4c_member_id($u, $member_id, $y, $m, $d),
     117                'holiday' => db_c_holiday_list4date($m, $d),
    110118            );
    111119
     
    123131
    124132        $time = strtotime($w+$i . " week");
    125         $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time), 0);
     133        $Week = new Calendar_Week(date('Y', $time), date('m', $time), date('d', $time));
    126134        $Week->build();
    127135
  • OpenPNE/trunk/webapp_biz/modules/biz/page/fh_biz_schedule_calendar.php

    r1181 r1187  
    7777                'schedule' => $schedule,
    7878                'todo' => $todo_list[$day],
     79                'holiday' => db_c_holiday_list4date($month, $day),
    7980              );
    8081              $item['day'] = $day;
  • OpenPNE/trunk/webapp_biz/modules/biz/templates/fh_biz_schedule_calendar.tpl

    r1181 r1187  
    6666({foreach from=$calendar item=week})
    6767<tr>
    68 ({foreach from=$week item=item})
     68({foreach from=$week item=item name=weekloop})
    6969({if $item.now})
    7070<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_09">
     71({elseif $item.holiday || $smarty.foreach.weekloop.first})
     72<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_14">
    7173({else})
    7274<td style="height:65px;padding:2px;" align="left" valign="top" class="bg_02">
     
    7981({/if})<br>
    8082<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>
     83
     84({* 祝日 *})
     85({foreach from=$item.holiday item=item_holiday})
     86<span class=" c_02">({$item_holiday})</span><br>
     87({/foreach})
    8188
    8289({* スケジュール *})
  • OpenPNE/trunk/webapp_biz/modules/biz/templates/inc_biz_schedule_week.tpl

    r1181 r1187  
    140140<td class="bg_05 border_01" style="width:131px;border-top:none;border-right:none;" align="center" valign="top"><img src="./skin/dummy.gif" style="width:130px;height:10px;" class="dummy"></td>
    141141({foreach from=$calendar item=item name=calendar})
    142 <td class="({if $item.now})bg_09({else})bg_05({/if}) padding_ss border_01({if $item.dayofweek == "日"}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if})" align="center">
     142<td class="({if $item.now})bg_09({else})bg_05({/if}) padding_ss border_01({if $item.dayofweek == "日" || $item.holiday}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if})" align="center">
    143143
    144144({if $item.now})<span class="b_b">({/if})
     
    205205</td>
    206206({foreach from=$calendar item=item name=calendar})
    207 <td class="({if $item.now})bg_09({else})bg_02({/if}) border_01({if $item.dayofweek == "日"}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if}) border-bottom:none;" align="left" valign="top">
     207<td class="({if $item.now})bg_09({else})bg_02({/if}) border_01({if $item.dayofweek == "日" || $item.holiday}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if}) border-bottom:none;" align="left" valign="top">
     208
     209({* 祝日 *})
     210<div class="padding_s">
     211({foreach from=$item.holiday item=item_holiday})
     212({$item_holiday})<br>
     213({/foreach})
     214</div>
    208215
    209216({* スケジュール(時間有) *})
     
    257264
    258265({foreach from=$calendar item=item name=calendar})
    259 <td class="({if $item.now})bg_09({else})bg_02({/if}) border_01({if $item.dayofweek == "日"}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if})" align="left" valign="top">
     266<td class="({if $item.now})bg_09({else})bg_02({/if}) border_01({if $item.dayofweek == "日" || $item.holiday}) c_02({elseif $item.dayofweek == "土"}) c_03({else})({/if})" style="width:81px;border-top:none;({if !$smarty.foreach.calendar.last}) border-right:none;({/if})" align="left" valign="top">
    260267
    261268({if $cmd == 'h'})
  • OpenPNE/trunk/webapp_biz/modules/biz/templates/inc_header.tpl

    r1154 r1187  
    4848.bg_12 { background-color: #({$INC_HEADER_color_config.bg_12}) ; }
    4949.bg_13 { background-color: #({$INC_HEADER_color_config.bg_13}) ; }
     50.bg_14 { background-color: #({$INC_HEADER_color_config.bg_14}) ; }
    5051
    5152body { background-color: #({$INC_HEADER_color_config.bg_12}) ; }
Note: See TracChangeset for help on using the changeset viewer.