Skip to content

Commit

Permalink
Merge branch 'master' into fix-adddeliv
Browse files Browse the repository at this point in the history
  • Loading branch information
seasoftjapan authored Jan 15, 2025
2 parents 3ff9079 + 26f7a7e commit 643efae
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 20 deletions.
14 changes: 7 additions & 7 deletions data/Smarty/templates/admin/order/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@
<td class="center">
<!--{assign var=key value="price"}-->
<span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
<input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />
<input type="number" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="6" class="box6" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />
</td>
<td class="center">
<!--{assign var=key value="quantity"}-->
<span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
<input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" onChange="quantityCopyForSingleShipping('<!--{$product_index}-->')" />
<input type="number" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" onChange="quantityCopyForSingleShipping('<!--{$product_index}-->')" />
</td>
<!--{assign var=price value="`$arrForm.price.value[$product_index]`"}-->
<!--{assign var=quantity value="`$arrForm.quantity.value[$product_index]`"}-->
Expand All @@ -432,7 +432,7 @@
<!--{$price|sfCalcIncTax:$tax_rate:$tax_rule|n2s}--><br />
<!--{assign var=key value="tax_rate"}-->
<span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
税率<input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />%
税率<input type="number" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />%
</td>
<td class="right"><!--{($price|sfCalcIncTax:$tax_rate:$tax_rule*$quantity)|n2s}--></td>
</tr>
Expand All @@ -446,7 +446,7 @@
<td class="right">
<!--{assign var=key value="discount"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
<input type="number" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
</td>
</tr>
Expand All @@ -455,7 +455,7 @@
<td class="right">
<!--{assign var=key value="deliv_fee"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
<input type="number" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
</td>
</tr>
Expand All @@ -464,7 +464,7 @@
<td class="right">
<!--{assign var=key value="charge"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
<input type="number" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
</td>
</tr>
Expand All @@ -489,7 +489,7 @@
<td class="right">
<!--{assign var=key value="use_point"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|default:0|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
<input type="number" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|default:0|h}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="5" class="box6" />
pt
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li class="level<!--{$child.level}-->">
<!--{* カテゴリ名表示 *}-->
<!--{assign var=disp_name value="`$child.category_id`.`$child.category_name`"}-->
<!--{if $child.level != $smarty.const.LEVEL_MAX}-->
<!--{if $child.level <= $smarty.const.LEVEL_MAX}-->
<a href="?" onclick="eccube.setModeAndSubmit('tree', 'parent_category_id', <!--{$child.category_id|h}-->); return false;">
<!--{if $arrForm.parent_category_id == $child.category_id}-->
<img src="<!--{$TPL_URLPATH}-->img/contents/folder_open.gif" alt="フォルダ" />
Expand All @@ -47,4 +47,4 @@
<!--{/if}-->
</li>
<!--{/foreach}-->
</ul>
</ul>
4 changes: 0 additions & 4 deletions data/Smarty/templates/sphone/cart/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@

<form name="form<!--{$key}-->" id="form<!--{$key}-->" method="post" action="<!--{$smarty.const.CART_URL|h}-->">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<!--{if 'sfGMOCartDisplay'|function_exists}-->
<!--{'sfGMOCartDisplay'|call_user_func}-->
<!--{/if}-->

<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="cart_no" value="" />
<input type="hidden" name="cartKey" value="<!--{$key|h}-->" />
Expand Down
3 changes: 0 additions & 3 deletions data/Smarty/templates/sphone/mypage/change.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
<dl class="form_entry">
<!--{include file="`$smarty.const.SMARTPHONE_TEMPLATE_REALDIR`frontparts/form_personal_input.tpl" flgFields=3 emailMobile=true prefix=""}-->
</dl>
<!--{if 'sfGMOMypageDisplay'|function_exists}-->
<!--{'sfGMOMypageDisplay'|call_user_func}-->
<!--{/if}-->
<div class="btn_area">
<p><input type="submit" class="btn data-role-none" value="確認ページへ" name="refusal" id="refusal" /></p>
</div>
Expand Down
16 changes: 15 additions & 1 deletion data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,18 @@ public function lfCheckError(&$objFormParam)
{
$objProduct = new SC_Product_Ex();
$arrValues = $objFormParam->getHashArray();

// XXX 空文字が入ってくる場合があるので数値へキャストする
// きちんとエラーハンドリングすべきだが応急処置
foreach (['price', 'quantity', 'tax_rate'] as $key) {
foreach ($arrValues[$key] as &$val) {
$val = (int) $val;
}
}
foreach (['discount', 'charge', 'deliv_fee', 'use_point'] as $key) {
$arrValues[$key] = (int) $arrValues[$key];
}

$arrErr = [];
$arrErrTemp = $objFormParam->checkError();
$arrErrDate = [];
Expand Down Expand Up @@ -1217,7 +1229,9 @@ public function setProductsQuantity(&$objFormParam)
$arrUpdateQuantity = [];
foreach ($arrShipmentsItems as $arritems) {
foreach ($arritems['shipment_product_class_id'] as $relation_index => $shipment_product_class_id) {
$arrUpdateQuantity[$shipment_product_class_id] += $arritems['shipment_quantity'][$relation_index];
// XXX 空文字が入ってくる場合があるので数値へキャストする
// きちんとエラーハンドリングすべきだが応急処置
$arrUpdateQuantity[$shipment_product_class_id] += (int) $arritems['shipment_quantity'][$relation_index];
}
}

Expand Down
5 changes: 2 additions & 3 deletions data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class LC_Page_Mypage_DeliveryAddr extends LC_Page_Ex
{
/** @var string */
/** @var array */
public $validUrl;
/** @var string */
public $ParentPage;
Expand Down Expand Up @@ -87,8 +87,7 @@ public function action()
}

// 正しい遷移かをチェック
$arrParentPageList = [DELIV_URLPATH, MYPAGE_DELIVADDR_URLPATH, MULTIPLE_URLPATH];
if (!SC_Utils_Ex::isBlank($ParentPage) && !in_array($ParentPage, $arrParentPageList)) {
if (!SC_Utils_Ex::isBlank($ParentPage) && !in_array($ParentPage, $this->validUrl)) {
// 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する
$ParentPage = MYPAGE_DELIVADDR_URLPATH;
}
Expand Down
3 changes: 3 additions & 0 deletions data/class_extends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ EC-CUBE2.17.2 までは、 [data/class](../class/) 以下すべてのクラス
- [data/class_extends/page_extends/mypage/LC_Page_AbstractMypage_Ex.php](page_extends/mypage/LC_Page_AbstractMypage_Ex.php)
- [data/class_extends/page_extends/LC_Page_Ex.php](page_extends/LC_Page_Ex.php)
- [data/class_extends/page_extends/admin/LC_Page_Admin_Ex.php](page_extends/admin/LC_Page_Admin_Ex.php)
- [data/class_extends/page_extends/shopping/LC_Page_Shopping_Payment_Ex.php](page_extends/shopping/LC_Page_Shopping_Payment_Ex.php)
- [data/class_extends/page_extends/shopping/LC_Page_Shopping_LoadPaymentModule_Ex.php](page_extends/shopping/LC_Page_Shopping_LoadPaymentModule_Ex.php)
- [data/class_extends/SC_Display_Ex.php](SC_Display_Ex.php)
32 changes: 32 additions & 0 deletions data/class_extends/SC_Display_Ex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

require_once CLASS_REALDIR.'SC_Display.php';

/*
* 決済モジュールやプラグイン、 user_data 以下の PHP で require されているため削除しないでください
*/

class SC_Display_Ex extends SC_Display
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

require_once CLASS_REALDIR.'pages/shopping/LC_Page_Shopping_LoadPaymentModule.php';

/*
* 決済モジュールやプラグイン、 user_data 以下の PHP で require されているため削除しないでください
*/

class LC_Page_Shopping_LoadPaymentModule_Ex extends LC_Page_Shopping_LoadPaymentModule
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

require_once CLASS_REALDIR.'pages/shopping/LC_Page_Shopping_Payment.php';

/*
* 決済モジュールやプラグイン、 user_data 以下の PHP で require されているため削除しないでください
*/

class LC_Page_Shopping_Payment_Ex extends LC_Page_Shopping_Payment
{
}

0 comments on commit 643efae

Please sign in to comment.