source: branches/version-2_12-multilang/data/Smarty/templates/admin/products/review.tpl @ 22357

Revision 22357, 13.3 KB checked in by adachi, 8 years ago (diff)

#1987 カレンダーの日付フォーマット対応(レビュー管理)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23*}-->
24
25<script type="text/javascript">
26$(function(){
27    var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat;
28
29    <!--{if $arrForm.search_startyear != '' && $arrForm.search_startmonth != '' && $arrForm.search_startday != ''}-->
30    var search_startyear  = '<!--{$arrForm.search_startyear|h}-->';
31    var search_startmonth = '<!--{$arrForm.search_startmonth|h}-->';
32    var search_startday   = '<!--{$arrForm.search_startday|h}-->';
33    var search_start_ymd = $.datepicker.formatDate(dateFormat, new Date(search_startyear, search_startmonth - 1, search_startday));
34    $("#datepickersearch_start").val(search_start_ymd);
35    <!--{/if}-->
36
37    $( "#datepickersearch_start" ).datepicker({
38    beforeShowDay: function(date) {
39        if(date.getDay() == 0) {
40            return [true,"date-sunday"];
41        } else if(date.getDay() == 6){
42            return [true,"date-saturday"];
43        } else {
44            return [true];
45        }
46    },changeMonth: 'true'
47    ,changeYear: 'true'
48    ,onSelect: function(dateText, inst){
49        var year  = inst.selectedYear;
50        var month = inst.selectedMonth + 1;
51        var day   = inst.selectedDay;
52        setDatesearch_start(year + '/' + month + '/' + day);
53    },
54    showButtonPanel: true,
55    beforeShow: showAdditionalButtonsearch_start,       
56    onChangeMonthYear: showAdditionalButtonsearch_start
57    });
58   
59    $("#datepickersearch_start").change( function() {
60        var dateText   = $(this).val();
61        var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat;
62        // console.log(dateText);
63        // console.log(dateFormat);
64        var date;
65        var year  = '';
66        var month = '';
67        var day   = '';
68        try {
69            date = $.datepicker.parseDate(dateFormat, dateText);
70            year  = date.getFullYear();
71            month = date.getMonth() + 1;
72            day   = date.getDay();
73        } catch (e) {
74            // console.log(e);
75            // clear date text
76            $(this).val('');
77        }
78        setDatesearch_start(year + '/' + month + '/' + day);
79    });
80
81    <!--{if $arrForm.search_endyear != '' && $arrForm.search_endmonth != '' && $arrForm.search_endday != ''}-->
82    var search_endyear  = '<!--{$arrForm.search_endyear|h}-->';
83    var search_endmonth = '<!--{$arrForm.search_endmonth|h}-->';
84    var search_endday   = '<!--{$arrForm.search_endday|h}-->';
85    var search_end_ymd = $.datepicker.formatDate(dateFormat, new Date(search_endyear, search_endmonth - 1, search_endday));
86    $("#datepickersearch_end").val(search_end_ymd);
87    <!--{/if}-->
88   
89    $( "#datepickersearch_end" ).datepicker({
90    beforeShowDay: function(date) {
91        if(date.getDay() == 0) {
92            return [true,"date-sunday"];
93        } else if(date.getDay() == 6){
94            return [true,"date-saturday"];
95        } else {
96            return [true];
97        }
98    },changeMonth: 'true'
99    ,changeYear: 'true'
100    ,onSelect: function(dateText, inst){
101        var year  = inst.selectedYear;
102        var month = inst.selectedMonth + 1;
103        var day   = inst.selectedDay;
104        setDatesearch_end(year + '/' + month + '/' + day);
105    },
106    showButtonPanel: true,
107    beforeShow: showAdditionalButtonsearch_end,       
108    onChangeMonthYear: showAdditionalButtonsearch_end
109    });
110   
111    $("#datepickersearch_end").blur( function() {
112        var dateText   = $(this).val();
113        var dateFormat = $.datepicker.regional['<!--{$smarty.const.LANG_CODE}-->'].dateFormat;
114        // console.log(dateText);
115        // console.log(dateFormat);
116        var date;
117        var year  = '';
118        var month = '';
119        var day   = '';
120        try {
121            date = $.datepicker.parseDate(dateFormat, dateText);
122            year  = date.getFullYear();
123            month = date.getMonth() + 1;
124            day   = date.getDay();
125        } catch (e) {
126            // console.log(e);
127            // clear date text
128            $(this).val('');
129        }
130        setDatesearch_end(year + '/' + month + '/' + day);
131    });
132
133});
134
135var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');
136
137var showAdditionalButtonsearch_start = function (input) {
138    setTimeout(function () {
139        var buttonPane = $(input)
140                 .datepicker("widget")
141                 .find(".ui-datepicker-buttonpane");
142        btn
143                .unbind("click")
144                .bind("click", function () {
145                    $.datepicker._clearDate(input);
146                    $("*[name=search_startyear]").val("");
147                    $("*[name=search_startmonth]").val("");
148                    $("*[name=search_startday]").val("");
149                });
150        btn.appendTo(buttonPane);
151    }, 1);
152};
153
154var showAdditionalButtonsearch_end = function (input) {
155    setTimeout(function () {
156        var buttonPane = $(input)
157                 .datepicker("widget")
158                 .find(".ui-datepicker-buttonpane");
159        btn
160                .unbind("click")
161                .bind("click", function () {
162                    $.datepicker._clearDate(input);
163                    $("*[name=search_endyear]").val("");
164                    $("*[name=search_endmonth]").val("");
165                    $("*[name=search_endday]").val("");
166                });
167        btn.appendTo(buttonPane);
168    }, 1);
169};
170
171function setDatesearch_start(dateText){
172var dates = dateText.split('/');
173$("*[name=search_startyear]").val(dates[0]);
174$("*[name=search_startmonth]").val(dates[1]);
175$("*[name=search_startday]").val(dates[2]);
176}
177
178function setDatesearch_end(dateText){
179var dates = dateText.split('/');
180$("*[name=search_endyear]").val(dates[0]);
181$("*[name=search_endmonth]").val(dates[1]);
182$("*[name=search_endday]").val(dates[2]);
183}
184</script>
185
186<div id="products" class="contents-main">
187<form name="search_form" method="post" action="?" >
188<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
189<input type="hidden" name="mode" value="search" />
190    <h2><!--{t string="tpl_250"}--></h2>
191
192    <!--検索条件設定テーブルここから-->
193    <table>
194        <tr>
195            <th><!--{t string="tpl_615"}--></th>
196            <td><input type="text" name="search_reviewer_name" value="<!--{$arrForm.search_reviewer_name|h}-->" size="30" class="box30" /></td>
197            <th><!--{t string="tpl_616"}--></th>
198            <td><input type="text" name="search_reviewer_url" value="<!--{$arrForm.search_reviewer_url|h}-->" size="30" class="box30" /></td>
199        </tr>
200        <tr>
201            <th><!--{t string="tpl_188"}--></th>
202            <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|h}-->" size="30" class="box30" /></td>
203            <th><!--{t string="tpl_192"}--></th>
204            <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|h}-->" size="30" class="box30" /></td>
205        </tr>
206        <tr>
207            <th><!--{t string="tpl_215"}--></th>
208            <!--{assign var=key value=search_sex}-->
209            <td><!--{html_checkboxes name="$key" options=$arrSex selected=$arrForm[$key]}--></td>
210            <th><!--{t string="tpl_617"}--></th>
211            <td>
212                <!--{assign var=key value=search_recommend_level}-->
213                <select name="<!--{$key}-->">
214                    <option value="" selected="selected"><!--{t string="tpl_068"}--></option>
215                    <!--{html_options options=$arrRECOMMEND selected=$arrForm[$key].value|h}-->
216                </select>
217            </td>
218        </tr>
219        <tr>
220            <th><!--{t string="tpl_618"}--></th>
221            <td colspan="3">
222                <!--{if $arrErr.search_startyear || $arrErr.search_endyear}-->
223                    <span class="attention"><!--{$arrErr.search_startyear}--></span>
224                    <span class="attention"><!--{$arrErr.search_endyear}--></span>
225                <!--{/if}-->
226                <input id="datepickersearch_start"
227                       type="text"
228                       value="" <!--{if $arrErr.search_startyear != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />
229                <input type="hidden" name="search_startyear" value="<!--{$arrForm.search_startyear|h}-->" />
230                <input type="hidden" name="search_startmonth" value="<!--{$arrForm.search_startmonth|h}-->" />
231                <input type="hidden" name="search_startday" value="<!--{$arrForm.search_startday|h}-->" />
232                <!--{t string="-"}-->
233                <input id="datepickersearch_end"
234                       type="text"
235                       value="" <!--{if $arrErr.search_endyear != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> />
236                <input type="hidden" name="search_endyear" value="<!--{$arrForm.search_endyear|h}-->" />
237                <input type="hidden" name="search_endmonth" value="<!--{$arrForm.search_endmonth|h}-->" />
238                <input type="hidden" name="search_endday" value="<!--{$arrForm.search_endday|h}-->" />
239            </td>
240        </tr>
241    </table>
242
243    <div class="btn">
244        <p class="page_rows"><!--{t string="tpl_251"}-->
245            <!--{assign var=key value="search_page_max"}-->
246            <!--{if $arrErr[$key]}-->
247                <span class="attention"><!--{$arrErr[$key]}--></span>
248            <!--{/if}-->
249            <!--{t string="record_prefix"}-->
250            <select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
251            <!--{html_options options=$arrPageMax selected=$arrForm.search_page_max|h}-->
252            </select>
253            <!--{t string="record_suffix"}-->
254        </p>
255        <div class="btn-area">
256            <ul>
257                <li>
258                    <a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('search_form', 'search', '', ''); return false;"><span class="btn-next"><!--{t string="tpl_252"}--></span></a></li>
259            </ul>
260        </div>
261    </div>
262</form>
263
264
265<!--{if count($arrErr) == 0 and ($smarty.post.mode == 'search' or $smarty.post.mode == 'delete')}-->
266
267<!--★★検索結果一覧★★-->
268<form name="form1" id="form1" method="post" action="?">
269    <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
270    <input type="hidden" name="mode" value="search" />
271    <input type="hidden" name="review_id" value="" />
272    <input type="hidden" name="search_pageno" value="<!--{$tpl_pageno|h}-->" />
273    <!--{foreach key=key item=item from=$arrHidden}-->
274        <!--{if $key ne "search_pageno"}-->
275            <input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
276        <!--{/if}-->
277    <!--{/foreach}-->
278    <h2><!--{t string="tpl_253"}--></h2>
279    <div class="btn">
280        <!--検索結果数--><!--{t string="tpl_230" escape="none" T_FIELD=$tpl_linemax}-->
281        <!--{if $smarty.const.ADMIN_MODE == '1'}-->
282            <a class="btn-normal" href="javascript:;" onclick="fnModeSubmit('delete_all','',''); return false;"><span><!--{t string="tpl_327"}--></span></a>
283        <!--{/if}-->
284        <a class="btn-normal" href="javascript:;" onclick="fnModeSubmit('csv','',''); return false;"><span><!--{t string="tpl_254"}--></span></a>
285    </div>
286    <!--{if $arrReview > 0 & $tpl_linemax > 0}-->
287
288        <!--{include file=$tpl_pager}-->
289
290        <!--検索結果表示テーブル-->
291        <table id="products-review-result" class="list">
292            <tr>
293                <th><!--{t string="tpl_618"}--></th>
294                <th><!--{t string="tpl_615"}--></th>
295                <th><!--{t string="tpl_188"}--></th>
296                <th><!--{t string="tpl_617"}--></th>
297                <th><!--{t string="tpl_619"}--></th>
298                <th class="edit"><!--{t string="tpl_003"}--></th>
299                <th class="delete"><!--{t string="tpl_004"}--></th>
300            </tr>
301
302            <!--{section name=cnt loop=$arrReview}-->
303                <tr>
304                    <td><!--{$arrReview[cnt].create_date|h|sfDispDBDate}--></td>
305                    <td><!--{$arrReview[cnt].reviewer_name|h}--></td>
306                    <td><!--{$arrReview[cnt].name|h}--></td>
307                    <!--{assign var=key value="`$arrReview[cnt].recommend_level`"}-->
308                    <td><!--{$arrRECOMMEND[$key]|h}--></td>
309                    <td class="menu"><!--{if $arrReview[cnt].status eq 1}--><!--{t string="tpl_170"}--><!--{elseif $arrReview[cnt].status eq 2}--><!--{t string="tpl_620"}--><!--{/if}--></td>
310                    <td class="menu"><a href="javascript:;" onclick="fnChangeAction('./review_edit.php'); fnModeSubmit('','review_id','<!--{$arrReview[cnt].review_id}-->'); return false;"><!--{t string="tpl_003"}--></a></td>
311                    <td class="menu"><a href="javascript:;" onclick="fnModeSubmit('delete','review_id','<!--{$arrReview[cnt].review_id}-->'); return false;"><!--{t string="tpl_004"}--></a></td>
312                </tr>
313            <!--{/section}-->
314        </table>
315        <!--検索結果表示テーブル-->
316    <!--{/if}-->
317</form>
318<!--{/if}-->
319<!--★★検索結果一覧★★-->
320</div>
Note: See TracBrowser for help on using the repository browser.