Plugin Directory

Changeset 1784440


Ignore:
Timestamp:
12/11/2017 12:32:54 AM (8 years ago)
Author:
Tanaka Hisao
Message:

1.8.3

Location:
salon-booking/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • salon-booking/trunk/languages/salon-booking-ja.po

    r1742391 r1784440  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2017-07-28 08:20+0900\n"
    6 "PO-Revision-Date: 2017-10-06 09:02+0900\n"
     6"PO-Revision-Date: 2017-12-10 08:37+0900\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    4242#: salon-booking/salon.php:427
    4343msgid "Salon Maintenance"
    44 msgstr "サロン 全体の設定"
     44msgstr "全体の設定"
    4545
    4646#: salon-booking/salon.php:430
     
    9999#: salon-booking/salon.php:479
    100100msgid "Salon Management"
    101 msgstr "サロン 日々の管理"
     101msgstr "日々の管理"
    102102
    103103#: salon-booking/salon.php:482
     
    38983898#: salon-booking/src/page/salon-page.php:3196
    38993899msgid "PC On business color"
    3900 msgstr "特別な営業日の色(PC)"
     3900msgstr "営業日の色(PC)"
    39013901
    39023902#: salon-booking/src/page/salon-page.php:3197
    39033903msgid "\\\"On business\\\" color on \\\"Reservtion\\\""
    3904 msgstr "予約画面の特別な営業日の色"
     3904msgstr "予約画面の営業日の色"
    39053905
    39063906#: salon-booking/src/page/salon-page.php:3201
  • salon-booking/trunk/readme.txt

    r1742391 r1784440  
    44Requires at least: 4.0
    55Tested up to: 4.8
    6 Stable tag: 1.8.2
     6Stable tag: 1.8.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7474
    7575== Changelog ==
     76= 1.8.3 =
     77* Changed display "special holiday"
     78* Fixed bug
     79
    7680= 1.8.2 =
    7781* Fixed about drag/drop in front page
  • salon-booking/trunk/salon.php

    r1742391 r1784440  
    44Plugin URI: http://salon.mallory.jp
    55Description: Salon Booking enables the reservation to one-on-one business between a client and a staff member.
    6 Version: 1.8.2
     6Version: 1.8.3
    77Author: tanaka-hisao
    88Author URI: http://salon.mallory.jp
     
    1010Domain Path: /languages/
    1111*/
    12 define( 'SL_VERSION', '1.8.2' );
     12define( 'SL_VERSION', '1.8.3' );
    1313define( 'SL_DOMAIN', 'salon-booking' );
    1414define( 'SL_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
     
    6767
    6868    public function __construct() {
    69         add_action('init', array( &$this, 'init_session_start'));
     69//      add_action('init', array( &$this, 'init_session_start'));
    7070
    7171        $this->maintenance = SL_DOMAIN.'-maintenace';
     
    133133//              add_action( 'wp_ajax_sllink',  array( &$this,'edit_link') );
    134134            require_once(SL_PLUGIN_SRC_DIR . 'comp/linkFunctionHotpepper-component.php');
     135            add_action('wp_ajax_sllink', array( &$this,'edit_link'));
    135136        }
    136137
     
    319320
    320321
    321     public function init_session_start(){
    322         if (!isset($_SESSION))  session_start();
    323     }
     322//  public function init_session_start(){
     323//      if (!isset($_SESSION))  session_start();
     324//  }
    324325
    325326    public function update_profile_fields( $contactmethods ) {
  • salon-booking/trunk/src/comp/booking-component.php

    r1727804 r1784440  
    314314
    315315    public function doServiceFromSalon($set_datas_array) {
    316 //      var_export($set_datas_array);
    317 //      wp_clear_scheduled_hook('sl_update_service_hotpepper');
    318         if (SALON_FOR_LINK ) {
     316        if (1 != 1 && SALON_FOR_LINK ) {
    319317
    320318            $set_datas_array['type'] = $_POST['type'];
  • salon-booking/trunk/src/comp/link-component.php

    r1742391 r1784440  
    4040    }
    4141
     42    public function runLink() {
     43        wp_schedule_event(time(), 'hourly', 'sl_update_reservation_hotpepper');
     44    }
    4245
     46    public function checkEnviroment($service_cd, $branch_cd) {
     47        $isOk = true;
     48        $messages = array();
     49        //店の予約時間は30分単位
     50        if (!$this->checkBranch($service_cd, $branch_cd, $messages)) {
     51            $isOk = false;
     52        }
     53        //imapのクラスが必要
     54        if (!$this->checkConfig($service_cd,$messages)) {
     55            $isOk = false;
     56        }
     57        if (!$isOk) {
     58            return $messages;
     59        }
     60        return $isOk;
     61
     62    }
     63
     64    public function checkBranch($service_cd, $branch_cd, &$messages) {
     65        $isOk = true;
     66        $branch_datas = $this->datas->getBranchData($branch_cd, 'open_time,close_time,time_step');
     67        if ($branch_datas !== false) {
     68            switch ($service_cd) {
     69            case Salon_Service::HOTPEPPER:
     70                //hotpepperは30分単位
     71                if ($branch_datas['time_step'] % 30 != 0) {
     72                    $messages[] = "店情報の「"
     73                            .__('Unit of Time (minutes)',SL_DOMAIN)
     74                            ."」は30分で割り切れる時間にしてください。";
     75                    $isOk = false;
     76                }
     77                if (+substr($branch_datas['open_time'], -2) % 30 != 0) {
     78                    $messages[] = "店情報の「"
     79                            .__('Open Time',SL_DOMAIN)
     80                            ."」はXX:00またはXX:30にしてください。";
     81                    $isOk = false;
     82                }
     83                if (+substr($branch_datas['close_time'], -2) % 30 != 0) {
     84                    $messages[] = "店情報の「"
     85                            .__('Close Time',SL_DOMAIN)
     86                            ."」はXX:00またはXX:30にしてください。";
     87                    $isOk = false;
     88                }
     89                break;
     90            }
     91        }
     92        return $isOk;
     93    }
     94    public function checkConfig($service_cd, &$messages) {
     95        global $wp_filter;
     96        $isOk = true;
     97
     98        if (!is_array($messages)) {
     99            $messages = array();
     100        }
     101        if ( !function_exists('imap_open') ) {
     102            $messages[] = "IMAPが使用できません。";
     103            $isOk = false;
     104        }
     105        switch($service_cd) {
     106            case Salon_Service::HOTPEPPER:
     107                if (!isset($wp_filter['salon_set_config_for_hotpepper'])) {
     108                    $messages[] = "必要とするFILTERが定義されていません。";
     109                    $isOk = false;
     110                }
     111                break;
     112        }
     113        return $isOk;
     114    }
     115
     116    public function getLinkInformation() {
     117        return wp_next_scheduled( 'sl_update_reservation_hotpepper' );
     118    }
     119
     120    public function stopLink() {
     121        $start_time = wp_next_scheduled( 'sl_update_reservation_hotpepper' );
     122        $original_args = array();
     123
     124        wp_unschedule_event( $start_time, 'sl_update_reservation_hotpepper', $original_args );
     125    }
    43126
    44127
  • salon-booking/trunk/src/comp/linkFunctionHotpepper-component.php

    r1742391 r1784440  
    129129    }
    130130
    131 
    132 
    133 
    134131    private function _editLinkData($datas) {
    135132        $set_data = array();
     
    148145
    149146    public function update_reservation_from_service() {
     147        //メールを読む
     148        //アクセスする
     149        //salon-bookingを更新する
    150150
    151151    }
     
    351351
    352352        $kanji = str_replace(" "," ",$set_datas['non_regist_name']);
    353         $kana = mb_convert_kana($kanji, "C");
    354         if(preg_match("/^[ァ-ヾ]+$/u",$kana) === false) {
    355             $kana = "サロン ブッキング";
    356         }
    357 
     353
     354//      $kana = mb_convert_kana($kanji, "C");
     355//      if(preg_match("/^[ァ-ヾ]+$/u",$kana) === false) {
     356//          $kana = "サロン ブッキング";
     357//      }
     358//      $kanas = explode(' ', $kana);
     359        $kana = array("サロン","ブッキング");
    358360        $names = explode(' ', $kanji);
    359         $kanas = explode(' ', $kana);
    360361
    361362        $url = self::URL_POST_REGIST;
     
    386387                ,"nmSeiKana" => $kanas[0]
    387388                ,"nmMeiKana" => $kanas[1]
    388                 ,"nmSei" => ""
    389                 ,"nmMei" => ""
     389                ,"nmSei" => trim($names[0])
     390                ,"nmMei" => trim($names[1])
    390391                ,"tel" => ""
    391392                ,"tel2" => ""
  • salon-booking/trunk/src/comp/salonconst-component.php

    r1742391 r1784440  
    174174    //const PC_BACK = "#C2D5FC";
    175175    const PC_BACK = "#FFFFFF";
     176    const PC_BACK_PALLET0 = "#696";
    176177    const PC_BACK_PALLET1 = "#6633FF";
    177178    const PC_BACK_PALLET2 = "#996600";
  • salon-booking/trunk/src/control/link-control.php

    r1742391 r1784440  
    4040
    4141        if ($this->action_class == 'Link_Page' ) {
     42            $this->pages->set_link_information($this->comp->getLinkInformation());
    4243            $this->pages->set_link_datas($this->datas->getLinkDatas());
     44            $user_login = $this->datas->getUserLogin();
     45            $this->pages->set_messages_of_check($this->comp->checkEnviroment(Salon_Service::HOTPEPPER,$this->datas->getBracnCdbyCurrentUser($user_login)));
     46
     47
    4348
    4449        }
    4550        elseif ($this->action_class == 'Link_Edit' ) {
    4651            $this->pages->check_request();
    47             $res = $this->comp->editTableData();
    48             $this->datas->update( $res);
     52            if ($_POST['type'] == 'run' ) {
     53                $this->comp->runLink();
     54            }
     55            elseif ($_POST['type'] == 'stop' ) {
     56                $this->comp->stopLink();
     57            }
     58
    4959        }
    5060
  • salon-booking/trunk/src/data/basic-data.php

    r1524367 r1784440  
    1515        $now = new DateTime(date_i18n('Y-m-d'));
    1616        $min = clone $now;
    17         $max = clone $now;
     17//      $max = clone $now;
    1818//      $min->sub(new DateInterval("P".$this->getConfigData('SALON_CONFIG_BEFORE_DAY')."D"));
    1919//      $max->add(new DateInterval("P".$this->getConfigData('SALON_CONFIG_AFTER_DAY')."D"));
    2020        $min->modify("-".$this->getConfigData('SALON_CONFIG_BEFORE_DAY')." day");
    21         $max->modify("+".$this->getConfigData('SALON_CONFIG_AFTER_DAY')." day");
     21//      $max->modify("+".$this->getConfigData('SALON_CONFIG_AFTER_DAY')." day");
    2222        $minYmd = $min->format("Ymd");
    23         $maxYmd = $max->format("Ymd");
     23//      $maxYmd = $max->format("Ymd");
    2424
     25        $maxYmd = $target_year + 1 . '1231';
    2526
    2627        $datas = $this->getBranchData($target_branch_cd,'sp_dates,open_time,close_time');
     
    2829        if ($datas) {
    2930            $sp_dates = unserialize($datas['sp_dates']);
    30             if ($sp_dates && !empty($sp_dates[$target_year])) {
    31                 foreach ($sp_dates[$target_year] as $k1 => $d1) {
    32                     if ($minYmd <= $k1 && $k1 <= $maxYmd) {
    33                         $title = __('special holiday',SL_DOMAIN);
    34                         if ($d1['status'] == Salon_Status::OPEN) $title = __('on business',SL_DOMAIN);
    35                         $target_date = __('%%m/%%d/%%Y',SL_DOMAIN);
    36                         $target_date = str_replace('%%Y',substr($k1,0,4),$target_date);
    37                         $target_date = str_replace('%%m',substr($k1,4,2),$target_date);
    38                         $target_date = str_replace('%%d',substr($k1,6,2),$target_date);
    39                         $show_date = $target_date . " "
    40                                 . substr($d1['fromHHMM'],0,2) . ":" . substr($d1['fromHHMM'],2,2)
    41                             ." - " . substr($d1['toHHMM'],0,2) . ":" . substr($d1['toHHMM'],2,2);
    42                         $result[$target_date] = array("show_date"=>$show_date,"target_date"=>$target_date,"status_title"=>$title,"status"=>$d1['status'],"fromHHMM"=>$d1['fromHHMM'],"toHHMM"=>$d1['toHHMM']);
     31            for($yyyy = $target_year ; $yyyy < $target_year + 2 ; $yyyy++) {
     32                if ($sp_dates && !empty($sp_dates[$yyyy])) {
     33                    foreach ($sp_dates[$yyyy] as $k1 => $d1) {
     34                        if ($minYmd <= $k1 && $k1 <= $maxYmd) {
     35                            $title = __('special holiday',SL_DOMAIN);
     36                            if ($d1['status'] == Salon_Status::OPEN) $title = __('on business',SL_DOMAIN);
     37                            $target_date = __('%%m/%%d/%%Y',SL_DOMAIN);
     38                            $target_date = str_replace('%%Y',substr($k1,0,4),$target_date);
     39                            $target_date = str_replace('%%m',substr($k1,4,2),$target_date);
     40                            $target_date = str_replace('%%d',substr($k1,6,2),$target_date);
     41                            $show_date = $target_date . " "
     42                                    . substr($d1['fromHHMM'],0,2) . ":" . substr($d1['fromHHMM'],2,2)
     43                                    ." - " . substr($d1['toHHMM'],0,2) . ":" . substr($d1['toHHMM'],2,2);
     44                            $result[$target_date] = array("show_date"=>$show_date,"target_date"=>$target_date,"status_title"=>$title,"status"=>$d1['status'],"fromHHMM"=>$d1['fromHHMM'],"toHHMM"=>$d1['toHHMM']);
     45                        }
    4346                    }
     47
     48
    4449                }
    4550            }
  • salon-booking/trunk/src/data/link-data.php

    r1742391 r1784440  
    139139                ' * '.
    140140                ' FROM '.$wpdb->prefix.'salon_link '.
    141                 ' ORDER BY reservation_cd ';
     141                ' ORDER BY update_time desc ';
    142142        if ($wpdb->query($sql) === false ) {
    143143            $this->_dbAccessAbnormalEnd();
  • salon-booking/trunk/src/page/booking_pc-page.php

    r1742391 r1784440  
    14031403                else {
    14041404                    save_target_event._dhx_changed = false;
    1405                     scheduler._lame_copy(scheduler._events[sid],save_target_event);
     1405                    scheduler._lame_copy(scheduler._events[save_target_event.id],save_target_event);
    14061406                    scheduler.updateEvent(save_target_event.id);
    14071407                }
  • salon-booking/trunk/src/page/configbooking-page.php

    r1727804 r1784440  
    5656    //  || isset($this->config_datas['SALON_CONFIG_DO_NEW_FUNCTION'])) : ?>
    5757$j('.color-picker').wpColorPicker({
    58                 defaultColor:"<?php echo Salon_Color::PC_BACK; ?>"
     58                defaultColor:false
    5959                ,mode:'hsl'
    6060                ,controls: {
     
    6868                ,width: 350 // the width of the collection of UI elements
    6969//              ,palettes: false // show a palette of basic colors beneath the square.
    70                 ,palettes:['<?php echo Salon_Color::PC_BACK; ?>'
     70                ,palettes:['<?php echo Salon_Color::PC_BACK_PALLET0; ?>'
    7171                        , '<?php echo Salon_Color::PC_BACK_PALLET1; ?>'
    7272                        , '<?php echo Salon_Color::PC_BACK_PALLET2; ?>'
  • salon-booking/trunk/src/page/salon-page.php

    r1727804 r1784440  
    21712171                this.show_cover();
    21722172            };
    2173             scheduler._on_dbl_click=function(e,a){if(a=a||e.target||e.srcElement,!this.config.readonly){var c=a.className.split(" ")[0];switch(c){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":case"dhx_marked_timespan":if(!scheduler.config.dblclick_create)break;if(-1==a.className.indexOf("on_business"))this.addEventNow(this.getActionData(e).date,null,e);else{var t=this.dblclick_dhx_matrix_cell;t.call(this,e)}break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":var i=this._locate_event(a);if(!this.callEvent("onDblClick",[i,e]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(i)._timed||!this.config.select?this.showLightbox(i):this.edit(i);break;case"dhx_time_block":case"dhx_cal_container":return;default:var t=this["dblclick_"+c];if(t)t.call(this,e);else if(a.parentNode&&a!=this)return scheduler._on_dbl_click(e,a.parentNode)}}};
     2173            scheduler._on_dbl_click=function(e,a){if(a=a||e.target||e.srcElement,!this.config.readonly){var c=a.className.split(" ")[0];switch(c){case"dhx_scale_holder":case"dhx_scale_holder_now":case"dhx_month_body":case"dhx_wa_day_data":case"dhx_marked_timespan":if(!scheduler.config.dblclick_create)break;if(-1==a.className.indexOf("on_business")||"timeline"!=scheduler._mode)this.addEventNow(this.getActionData(e).date,null,e);else{var t=this.dblclick_dhx_matrix_cell;t.call(this,e)}break;case"dhx_cal_event":case"dhx_wa_ev_body":case"dhx_agenda_line":case"dhx_grid_event":case"dhx_cal_event_line":case"dhx_cal_event_clear":var i=this._locate_event(a);if(!this.callEvent("onDblClick",[i,e]))return;this.config.details_on_dblclick||this._table_view||!this.getEvent(i)._timed||!this.config.select?this.showLightbox(i):this.edit(i);break;case"dhx_time_block":case"dhx_cal_container":return;default:var t=this["dblclick_"+c];if(t)t.call(this,e);else if(a.parentNode&&a!=this)return scheduler._on_dbl_click(e,a.parentNode)}}};
    21742174EOT;
    21752175        if ($over24) {
Note: See TracChangeset for help on using the changeset viewer.