Changeset 17623


Ignore:
Timestamp:
2008/09/22 23:41:51 (16 years ago)
Author:
Yammy
Message:

http://svn.ec-cube.net/open_trac/ticket/362
カレンダーブロックの定休日設定

Location:
branches/comu-ver2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/basis/index.tpl

    r17605 r17623  
    170170  </table> 
    171171 
     172  <h2>定休日設定</h2> 
     173  <table id="basis-index-func"> 
     174    <tr> 
     175      <th>定休日</th> 
     176      <td> 
     177        <span class="attention"><!--{$arrErr.regular_holiday_ids}--></span> 
     178        <!--{html_checkboxes name="regular_holiday_ids" options=$arrRegularHoliday selected=$arrForm.regular_holiday_ids}--> 
     179      </td> 
     180    </tr> 
     181  </table> 
     182 
    172183  <h2>SHOP機能</h2> 
    173184  <table id="basis-index-func"> 
  • branches/comu-ver2/data/class/pages/admin/basis/LC_Page_Admin_Basis.php

    r16741 r17623  
    5252        $this->arrTAXRULE = $masterData->getMasterData("mtb_taxrule"); 
    5353        $this->tpl_subtitle = 'SHOPマスタ'; 
     54 
     55        //定休日用配列 
     56        $this->arrRegularHoliday[0] = '日'; 
     57        $this->arrRegularHoliday[1] = '月'; 
     58        $this->arrRegularHoliday[2] = '火'; 
     59        $this->arrRegularHoliday[3] = '水'; 
     60        $this->arrRegularHoliday[4] = '木'; 
     61        $this->arrRegularHoliday[5] = '金'; 
     62        $this->arrRegularHoliday[6] = '土'; 
    5463    } 
    5564 
     
    8291            // 入力データの変換 
    8392            $this->arrForm = $this->lfConvertParam($this->arrForm); 
     93            $this->arrForm['regular_holiday_ids'] = $_POST['regular_holiday_ids'];  // 定休日情報を付加 
    8494            // 入力データのエラーチェック 
    8595            $this->arrErr = $this->lfErrorCheck($this->arrForm); 
     
    98108                $this->tpl_onload = "window.alert('SHOPマスタの登録が完了しました。');"; 
    99109            } 
     110            if( empty($this->arrForm['regular_holiday_ids']) ) { 
     111                $this->arrSel = array(); 
     112            } else { 
     113                $this->arrSel = $this->arrForm['regular_holiday_ids']; 
     114            } 
    100115        } else { 
    101116            $arrCol = $this->lfGetCol(); 
     
    103118            $arrRet = $objQuery->select($col, "dtb_baseinfo"); 
    104119            $this->arrForm = $arrRet[0]; 
     120 
     121            $regular_holiday_ids = explode('|', $this->arrForm['regular_holiday_ids']); 
     122            $this->arrForm['regular_holiday_ids'] = $regular_holiday_ids; 
    105123        } 
    106124 
     
    145163            "free_rule", 
    146164            "good_traded", 
    147             "message" 
     165            "message", 
     166            "regular_holiday_ids" 
    148167 
    149168        ); 
     
    155174        $arrCol = $this->lfGetCol(); 
    156175        foreach($arrCol as $val) { 
    157             $sqlval[$val] = $array[$val]; 
     176            //配列の場合は、パイプ区切りの文字列に変換 
     177            if(is_array($array[$val])) { 
     178                $sqlval[$val] = implode("|", $array[$val]); 
     179            } else { 
     180                $sqlval[$val] = $array[$val]; 
     181            } 
    158182        } 
    159183        $sqlval['update_date'] = 'Now()'; 
  • branches/comu-ver2/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar.php

    r17073 r17623  
    6363        } 
    6464 
     65        // 休日取得取得 
     66        $this->arrHoliday = $this->lfGetHoliday(); 
     67 
    6568        // 定休日取得取得 
    66         $this->arrHoliday = $this->lfGetHoliday(); 
     69        $this->arrRegularHoliday = $this->lfGetRegularHoliday(); 
    6770 
    6871        // カレンダーデータ取得 
     
    127130                $arrCalendar[$j][$i]['month'] = $month; 
    128131                $arrCalendar[$j][$i]['day'] = $Day->day; 
    129                 if ($this->lfCheckHoliday($month, $Day->day) || $Day->first || $Day->last) { 
     132                if ($this->lfCheckHoliday($month, $Day->day)) { 
    130133                    $arrCalendar[$j][$i]['holiday'] = true; 
    131134                } else { 
     
    152155    } 
    153156 
     157    // 定休日取得 
     158    function lfGetRegularHoliday() { 
     159        $objSIteInfo = new SC_SiteInfo(); 
     160        $arrRegularHoliday = explode('|', $objSIteInfo->data['regular_holiday_ids']); 
     161        return $arrRegularHoliday; 
     162    } 
     163 
    154164    // 休日チェック 
    155165    function lfCheckHoliday($month, $day) { 
    156166        if (!empty($this->arrHoliday[$month])) { 
    157167            if (in_array($day, $this->arrHoliday[$month])) { 
     168                return true; 
     169            } 
     170        } 
     171        if (!empty($this->arrRegularHoliday)) { 
     172            $w = date('w', mktime(0,0,0 ,$month, $day, date('Y'))); 
     173            if (in_array($w, $this->arrRegularHoliday)) { 
    158174                return true; 
    159175            } 
  • branches/comu-ver2/html/install/sql/create_table_mysql.sql

    r17601 r17623  
    142142    mypage_tpl text, 
    143143    good_traded text, 
    144     message text 
     144    message text, 
     145    regular_holiday_ids text 
    145146) TYPE=InnoDB ; 
    146147 
  • branches/comu-ver2/html/install/sql/create_table_pgsql.sql

    r17601 r17623  
    145145    mypage_tpl text, 
    146146    good_traded text, 
    147     message text 
     147    message text, 
     148    regular_holiday_ids text 
    148149); 
    149150 
Note: See TracChangeset for help on using the changeset viewer.