Skip to content

Commit

Permalink
Merge pull request #80 from migarashi47/issue_54
Browse files Browse the repository at this point in the history
fix issue of #54
  • Loading branch information
ryo-endo authored Oct 26, 2017
2 parents f934b8e + 27c5ebf commit 0fcd262
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions data/class/SC_CheckError.php
Original file line number Diff line number Diff line change
Expand Up @@ -1762,4 +1762,18 @@ public function numelicCheck($string)

return strlen($string) > 0 && !ctype_digit($string);
}

// 都道府県マスタに存在する値かチェック
public function PREF_CHECK($value)
{
$disp = $value[0];
$key = $value[1];

$pref_id = $this->arrParam[$key];
$objQuery =& SC_Query_Ex::getSingletonInstance();
$exists = $objQuery->exists('mtb_pref', 'id = ?', array($pref_id));
if (!$exists) {
$this->arrErr[$key] = '' . $disp . 'が不正な値です。<br />';
}
}
}
1 change: 1 addition & 0 deletions data/class/SC_FormParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ public function checkError($br = true)
case 'SELECT_CHECK':
case 'FILE_NAME_CHECK_BY_NOUPLOAD':
case 'NUM_POINT_CHECK':
case 'PREF_CHECK':
$this->recursionCheck($this->disp_name[$index], $func,
$value, $arrErr[$key], $this->length[$index]);
if (SC_Utils_Ex::isBlank($arrErr[$key])) {
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public function sfCustomerCommonParam(&$objFormParam, $prefix = '')
$objFormParam->addParam('郵便番号1', $prefix . 'zip01', ZIP01_LEN, 'n', array('EXIST_CHECK', 'SPTAB_CHECK', 'NUM_CHECK', 'NUM_COUNT_CHECK'));
$objFormParam->addParam('郵便番号2', $prefix . 'zip02', ZIP02_LEN, 'n', array('EXIST_CHECK', 'SPTAB_CHECK', 'NUM_CHECK', 'NUM_COUNT_CHECK'));
$objFormParam->addParam('', $prefix . 'country_id', INT_LEN, 'n', array('NUM_CHECK'));
$objFormParam->addParam('都道府県', $prefix . 'pref', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK'));
$objFormParam->addParam('都道府県', $prefix . 'pref', INT_LEN, 'n', array('PREF_CHECK', 'EXIST_CHECK', 'NUM_CHECK'));
} else {
$objFormParam->addParam('お名前(フリガナ・姓)', $prefix . 'kana01', STEXT_LEN, 'CKV', array('NO_SPTAB', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK', 'KANA_CHECK'));
$objFormParam->addParam('お名前(フリガナ・名)', $prefix . 'kana02', STEXT_LEN, 'CKV', array('NO_SPTAB', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK', 'KANA_CHECK'));
Expand Down

0 comments on commit 0fcd262

Please sign in to comment.