source: branches/comu-ver2/data/Smarty/templates/default/admin/products/index.tpl @ 17605

Revision 17605, 12.5 KB checked in by Seasoft, 16 years ago (diff)

/index.php にリンクやリダイレクトしている箇所の「index.php」を定数化。

  • 定数「DIR_INDEX_FILE」… DirectoryIndex? の実ファイル名。現状の EC-CUBE は、「index.php」。/html/define.php で定義するが、定義が無い場合 SC_Initial::defineDirectoryIndex() で「index.php」と定義。本来は、プログラム中で実ファイルとしての index.php を指すときとは、この定数を使うのが良い気がするが、今回はそこまでは書き換えていない。
  • 定数「USE_FILENAME_DIR_INDEX」… DIR_INDEX_FILE にアクセスするときにファイル名を使用するか。/html/define.php で定義。
  • 定数「DIR_INDEX_URL」… /index.php にリンクやリダイレクトしている箇所の「index.php」部分を示す。この定数は SC_Initial::defineDirectoryIndex() で自動生成する。

・$_SERVERPHP_SELF? や自身をあらわすファイル名を利用している箇所を文字列「?」に書き換え。これにより、/ が自己URLにリンクするときに /index.php となることを防ぐ。RFC3986 を参考にする。モバイル端末がこのRFCに準拠しているのか確信が無いので、モバイルではこの変更は見送った。
・従来 / にリンクしていた箇所に、定数「DIR_INDEX_URL」を付加。漏れがあると予測される。

  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/html; charset=UTF-8
Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2008 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<script type="text/javascript">
25// URLの表示非表示切り替え
26function lfnDispChange(){
27  inner_id = 'switch';
28
29  cnt = document.form1.item_cnt.value;
30 
31  if($('#disp_url1').css("display") == 'none'){
32    for (i = 1; i <= cnt; i++) {
33      disp_id = 'disp_url'+i;
34      $('#' + disp_id).css("display", "");
35 
36      disp_id = 'disp_cat'+i;
37      $('#' + disp_id).css("display", "none");
38     
39      $('#' + inner_id).html('  URL <a href="#" onClick="lfnDispChange();"> &gt;&gt; カテゴリ表示<\/a>');
40    }
41  }else{
42    for (i = 1; i <= cnt; i++) {
43      disp_id = 'disp_url'+i;
44      $('#' + disp_id).css("display", "none");
45 
46      disp_id = 'disp_cat'+i;
47      $('#' + disp_id).css("display", "");
48     
49      $('#' + inner_id).html('  カテゴリ <a href="#" onClick="lfnDispChange();"> &gt;&gt; URL表示<\/a>');
50    }
51  }
52
53}
54
55</script>
56
57
58<div id="products" class="contents-main">
59<form name="search_form" id="search_form" method="post" action="?">
60  <input type="hidden" name="mode" value="search" />
61  <!--{foreach key=key item=item from=$arrHidden}-->
62  <!--{if $key == 'campaign_id' || $key == 'search_mode'}-->
63  <input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->" />
64  <!--{/if}-->
65  <!--{/foreach}-->
66  <h2>検索条件設定</h2>
67
68  <!--検索条件設定テーブルここから-->
69  <table>
70    <tr>
71      <th>商品ID</th>
72      <td>
73        <!--{if $arrErr.search_product_id}-->
74        <span class="attention"><!--{$arrErr.search_product_id}--></span>
75        <!--{/if}-->
76        <input type="text" name="search_product_id" value="<!--{$arrForm.search_product_id|escape}-->" size="30" class="box30" style="<!--{$arrErr.search_product_id|sfGetErrorColor}-->"/>
77      </td>
78    </tr>
79    <tr>
80      <th>商品コード</th>
81      <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|escape}-->" size="30" class="box30" /></td>
82    </tr>
83    <tr>
84      <th>カテゴリ</th>
85      <td>
86        <select name="search_category_id" style="<!--{if $arrErr.search_category_id != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->">
87        <option value="">選択してください</option>
88        <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
89        </select>
90      </td>
91    </tr>
92    <tr>
93      <th>規格名称</th>
94      <td>
95        <!--{if $arrErr.search_product_class_name}-->
96        <span class="attention"><!--{$arrErr.search_product_class_name}--></span>
97        <!--{/if}-->
98        <input type="text" name="search_product_class_name" value="<!--{$arrForm.search_product_class_name|escape}-->" size="30" class="box30"style="<!--{$arrErr.search_product_class_name|sfGetErrorColor}-->" />
99      </td>
100    </tr>
101    <tr>
102      <th>商品名</th>
103      <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|escape}-->" size="30" class="box30" /></td>
104    </tr>
105    <tr>
106      <th>種別</th>
107      <td><!--{html_checkboxes name="search_status" options=$arrDISP selected=$arrForm.search_status}--></td>
108    </tr>
109    <tr>
110      <th>登録・更新日</th>
111      <td>
112        <!--{if $arrErr.search_startyear || $arrErr.search_endyear}-->
113        <span class="attention"><!--{$arrErr.search_startyear}--></span>
114        <span class="attention"><!--{$arrErr.search_endyear}--></span>
115        <!--{/if}-->
116        <select name="search_startyear" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
117        <option value="">----</option>
118        <!--{html_options options=$arrStartYear selected=$arrForm.search_startyear}-->
119        </select>年
120        <select name="search_startmonth" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
121        <option value="">--</option>
122        <!--{html_options options=$arrStartMonth selected=$arrForm.search_startmonth}-->
123        </select>月
124        <select name="search_startday" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
125        <option value="">--</option>
126        <!--{html_options options=$arrStartDay selected=$arrForm.search_startday}-->
127        </select>日~
128        <select name="search_endyear" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
129        <option value="">----</option>
130        <!--{html_options options=$arrEndYear selected=$arrForm.search_endyear}-->
131        </select>年
132        <select name="search_endmonth" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
133        <option value="">--</option>
134        <!--{html_options options=$arrEndMonth selected=$arrForm.search_endmonth}-->
135        </select>月
136        <select name="search_endday" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
137        <option value="">--</option>
138        <!--{html_options options=$arrEndDay selected=$arrForm.search_endday}-->
139        </select>日
140      </td>
141    </tr>
142    <tr>
143      <th>ステータス</th>
144      <td>
145      <!--{html_checkboxes name="search_product_flag" options=$arrSTATUS selected=$arrForm.search_product_flag}-->
146      </td>
147    </tr>
148  </table>
149  <div class="btn">
150    検索結果表示件数
151    <!--{assign var=key value="search_page_max"}-->
152    <!--{if $arrErr[$key]}-->
153    <span class="attention"><!--{$arrErr[$key]}--></span>
154    <!--{/if}-->
155    <select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
156    <!--{html_options options=$arrPageMax selected=$arrForm.search_page_max}-->
157    </select> 件
158    <button type="submit"><span>この条件で検索する</span></button>
159  </div>
160  <!--検索条件設定テーブルここまで-->
161</form> 
162
163
164<!--{if count($arrErr) == 0 and ($smarty.post.mode == 'search' or $smarty.post.mode == 'delete')}-->
165
166<!--★★検索結果一覧★★-->
167<form name="form1" id="form1" method="post" action="?">
168  <input type="hidden" name="mode" value="search" />
169  <input type="hidden" name="product_id" value="" />
170  <input type="hidden" name="category_id" value="" />
171  <!--{foreach key=key item=item from=$arrHidden}-->
172  <input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->" />
173  <!--{/foreach}--> 
174  <h2>検索結果一覧</h2>
175  <p>
176    <span class="attention"><!--検索結果数--><!--{$tpl_linemax}-->件</span>&nbsp;が該当しました。
177    <!--検索結果-->
178    <!--{if $smarty.const.ADMIN_MODE == '1'}-->
179    <button type="button" onclick="fnModeSubmit('delete_all','','');">検索結果をすべて削除</button>
180    <!--{/if}-->
181    <button type="button" onclick="fnModeSubmit('csv','','');">CSV DOWNLOAD</button>
182    <a href="../contents/csv.php?tpl_subno_csv=product"> &gt;&gt; CSV出力項目設定</a>
183  </p>
184  <!--{include file=$tpl_pager}-->
185
186  <!--{if count($arrProducts) > 0}-->
187  <!--検索結果表示テーブル-->
188  <table class="list" id="products-search-result">
189    <tr>
190      <th rowspan="2">商品ID</th>
191      <th rowspan="2">商品画像</th>
192      <th rowspan="2">商品コード</th>
193      <th rowspan="2">価格(円)</th>
194      <th>商品名</th>
195      <th rowspan="2">在庫</th>
196      <th rowspan="2">種別</th>
197      <th rowspan="2">編集</th>
198      <th rowspan="2">確認</th>
199      <!--{if $smarty.const.OPTION_CLASS_REGIST == 1}-->
200      <th rowspan="2">規格</th>
201      <!--{/if}-->
202      <th rowspan="2">削除</th>
203      <th rowspan="2">複製</th>
204    </tr>
205    <tr>
206      <th><a href="#" onClick="lfnDispChange(); return false;">カテゴリ ⇔ URL</a></th>
207    </tr>
208
209    <!--{section name=cnt loop=$arrProducts}-->
210    <!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
211    <!--{assign var=status value="`$arrProducts[cnt].status`"}-->
212    <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;">
213      <td rowspan="2"><!--{$arrProducts[cnt].product_id}--></td>
214      <td rowspan="2">
215        <!--{if $arrProducts[cnt].main_list_image != ""}-->
216          <!--{assign var=image_path value="`$arrProducts[cnt].main_list_image`"}-->
217        <!--{else}-->
218          <!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
219        <!--{/if}-->
220      <img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&amp;width=65&amp;height=65">
221      </td>
222      <td rowspan="2"><!--{$arrProducts[cnt].product_code_min|escape}-->
223        <!--{if $arrProducts[cnt].product_code_min != $arrProducts[cnt].product_code_max}-->
224          <br />~ <!--{$arrProducts[cnt].product_code_max|escape}-->
225        <!--{/if}-->
226      </td>
227      <!--{* 価格 *}-->
228      <td rowspan="2" class="right">
229        <!--{$arrProducts[cnt].price02_min|number_format}-->
230        <!--{if $arrProducts[cnt].price02_min != $arrProducts[cnt].price02_max}-->
231          <br />~ <!--{$arrProducts[cnt].price02_max|number_format}-->
232        <!--{/if}-->
233      </td>
234      <td><!--{$arrProducts[cnt].name|escape}--></td>
235      <!--{* 在庫 *}-->
236      <!--{* XXX 複数規格でかつ、全ての在庫数量が等しい場合は先頭に「各」と入れたれたら良いと思う。 *}-->
237      <td rowspan="2">
238        <!--{if $arrProducts[cnt].stock_unlimited_min}-->無制限<!--{else}--><!--{$arrProducts[cnt].stock_min|number_format}--><!--{/if}-->
239        <!--{if $arrProducts[cnt].stock_unlimited_min != $arrProducts[cnt].stock_unlimited_max || $arrProducts[cnt].stock_min != $arrProducts[cnt].stock_max}-->
240          <br />~ <!--{if $arrProducts[cnt].stock_unlimited_max}-->無制限<!--{else}--><!--{$arrProducts[cnt].stock_max|number_format}--><!--{/if}-->
241        <!--{/if}-->
242      </td>
243      <!--{* 表示 *}-->
244      <!--{assign var=key value=$arrProducts[cnt].status}-->
245      <td rowspan="2"><!--{$arrDISP[$key]}--></td>
246      <td rowspan="2"><span class="icon_edit"><a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product.php'); fnModeSubmit('pre_edit', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >編集</a></span></td>
247      <td rowspan="2"><span class="icon_confirm"><a href="<!--{$smarty.const.SITE_URL|sfTrimURL}-->/products/detail.php?product_id=<!--{$arrProducts[cnt].product_id}-->&amp;admin=on" target="_blank">確認</a></span></td>
248      <!--{if $smarty.const.OPTION_CLASS_REGIST == 1}-->
249      <td rowspan="2"><span class="icon_class"><a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product_class.php'); fnModeSubmit('pre_edit', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >規格</a></span></td>
250      <!--{/if}-->
251      <td rowspan="2"><span class="icon_delete"><a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnSetFormValue('category_id', '<!--{$arrProducts[cnt].category_id}-->'); fnModeSubmit('delete', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;">削除</a></span></td>
252      <td rowspan="2"><span class="icon_copy"><a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product.php'); fnModeSubmit('copy', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >複製</a></span></td>
253    </tr>
254    <tr>
255      <td>
256        <!--{* カテゴリ名 *}-->
257        <div id="disp_cat<!--{$smarty.section.cnt.iteration}-->" style="display:<!--{$cat_flg}-->">
258          <!--{foreach from=$arrProducts[cnt].categories item=category_id name=categories}-->
259            <!--{$arrCatList[$category_id]|sfTrim}-->
260            <!--{if !$smarty.foreach.categories.last}--><br /><!--{/if}-->
261          <!--{/foreach}-->
262        </div>
263
264        <!--{* URL *}-->
265        <div id="disp_url<!--{$smarty.section.cnt.iteration}-->" style="display:none">
266        <!--{$smarty.const.SITE_URL|sfTrimURL}-->/products/detail.php?product_id=<!--{$arrProducts[cnt].product_id}-->
267        </div>
268      </td>
269    </tr>
270    <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
271    <!--{/section}-->
272  </table>
273  <input type="hidden" name="item_cnt" value="<!--{$arrProducts|@count}-->" />
274  <!--検索結果表示テーブル-->
275  <!--{/if}-->
276
277</form>
278
279<!--★★検索結果一覧★★-->   
280<!--{/if}-->
281</div>
Note: See TracBrowser for help on using the repository browser.