Plugin Directory

Changeset 1031446


Ignore:
Timestamp:
11/24/2014 12:46:20 AM (11 years ago)
Author:
hidaka.bizplugin
Message:

1.7.0

Location:
biz-calendar/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • biz-calendar/trunk/admin-ui.php

    r686770 r1031446  
    2222        add_settings_field('id_chk_fri', '金曜日', array(&$this,'setting_chk_fri'), $this->file_path, 'fixed_holiday');
    2323        add_settings_field('id_chk_sat', '土曜日', array(&$this,'setting_chk_sat'), $this->file_path, 'fixed_holiday');
    24         add_settings_field('id_chk_holiday', '祝日を定休日にする', array(&$this,'setting_chk_holiday'), $this->file_path, 'fixed_holiday');
    2524
    2625        add_settings_section('temp_holiday', '臨時休営業日', array(&$this,'text_temp_holiday'), $this->file_path);
     
    8887    function setting_chk_sat() {
    8988        $this->setting_chk( "sat" );
    90     }
    91 
    92     function setting_chk_holiday() {
    93         $this->setting_chk( "holiday" );
    9489    }
    9590
  • biz-calendar/trunk/biz-calendar.php

    r867425 r1031446  
    44Plugin URI: http://residentbird.main.jp/bizplugin/
    55Description: 営業日・イベントカレンダーをウィジェットに表示するプラグインです。
    6 Version: 1.6.0
     6Version: 1.6.1
    77Author:WordPress Biz Plugin
    88Author URI: http://residentbird.main.jp/bizplugin/
     
    1414class BC
    1515{
    16     const VERSION = "1.6.0";
     16    const VERSION = "1.7.0";
    1717    const SHORTCODE = "showpostlist";
    1818    const OPTIONS = "bizcalendar_options";
     
    6969                    "fri" => "",
    7070                    "sat" => "on",
    71                     "holiday" => "on",
    7271                    "temp_holidays" =>"2013-01-02\n2013-01-03\n",
    7372                    "temp_weekdays" =>"",
    7473                    "eventdays" =>"",
    7574                    "event_url" =>"",
    76                     "holiday_cache" =>"",
    77                     "holiday_cache_date" =>"",
    7875                    "month_limit" =>"制限なし",
    7976                    "nextmonthlimit" =>"12",
     
    138135        }
    139136        $options = get_option( 'bizcalendar_options' );
    140         if ( isset($options['holiday']) && $options["holiday"] == 'on'){
    141             $options = $this->getHolidays($options);
    142         }
    143137        echo "<div id='biz_calendar'></div>";
    144138        echo $after_widget;
    145     }
    146 
    147     public function getHolidays( $options ){
    148         if ( $this->hasCache( $options) ){
    149             return $options;
    150         }
    151 
    152         $year = date_i18n('Y');
    153         //1-3月は前年の祝日を取得する
    154         $mon = date_i18n('n');
    155         if ( $mon < 4){
    156             $year -= 1;
    157         }
    158 
    159         $url = sprintf(
    160                 'http://www.google.com/calendar/feeds/%s/public/full-noattendees?start-min=%s&start-max=%s&max-results=%d&alt=json' ,
    161                 'outid3el0qkcrsuf89fltf7a4qbacgt9@import.calendar.google.com' , // 'japanese@holiday.calendar.google.com' ,
    162                 $year.'-04-01' ,  // 取得開始日
    163                 ($year + 1).'-03-31' ,  // 取得終了日
    164                 50              // 最大取得数
    165         );
    166 
    167         $results = file_get_contents($url);
    168         if ( !isset($results) ){
    169             return $options;
    170         }
    171         $results = json_decode($results, true);
    172         $holidays = array();
    173         foreach ($results['feed']['entry'] as $val ) {
    174             $date  = $val['gd$when'][0]['startTime'];
    175             $title = $val['title']['$t'];
    176             $holidays[$date] = $title;
    177         }
    178         ksort($holidays);
    179 
    180         //キャッシュを更新する
    181         $options["holiday_cache"] = $holidays;
    182         $options["holiday_cache_date"] = date_i18n( "Y/m");
    183         update_option('bizcalendar_options', $options);
    184         return $options;
    185     }
    186 
    187     private function hasCache($options){
    188         if( !isset($options["holiday_cache"]) || !isset($options["holiday_cache_date"])){
    189             return false;
    190         }
    191         if ( $options["holiday_cache_date"] != date_i18n( "Y/m") ){
    192             return false;
    193         }
    194         return true;
    195139    }
    196140
  • biz-calendar/trunk/calendar.js

    r686770 r1031446  
    206206    }
    207207
    208     // 祝日
    209     if (isHoliday(fulldate)) {
    210         return "HOLIDAY";
    211     }
    212208    return "WEEKDAY";
    213 }
    214 
    215 var isHoliday = function(fulldate) {
    216     if (currentSetting.options["holiday"] == "off") {
    217         return false;
    218     }
    219     holidays = currentSetting.options["holiday_cache"];
    220     if (holidays != undefined && holidays[fulldate] != null) {
    221         return true;
    222     }
    223     return false;
    224209}
    225210
  • biz-calendar/trunk/readme.txt

    r867425 r1031446  
    44Tags: calendar,event,widget
    55Requires at least: 3.4
    6 Tested up to: 3.8
    7 Stable tag: 1.6.0
     6Tested up to: 4.0.1
     7Stable tag: 1.7.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1919
    2020* 曜日を指定して定休日に設定できます
    21 * 祝日を自動的に定休日に設定できます
    22     * Google calendar APIから祝日情報を取得しています。Google calendar APIが使用できない環境では利用できません
    2321* 臨時休業日・臨時営業日を登録できます
    2422* イベント開催日、urlを設定できます
     
    3836
    3937== Changelog ==
     38
     39= 1.7.0 =
     40* Google Calendar API Ver.2終了に伴い、祝日を自動的に定休日に設定する機能を廃止しました
    4041
    4142= 1.6.0 =
Note: See TracChangeset for help on using the changeset viewer.