Skip to content

Commit

Permalink
Merge pull request smarty-php#82 from think-ahead/release-2.0.8
Browse files Browse the repository at this point in the history
Merge release-2.0.8 into master branch
  • Loading branch information
think-seron authored Nov 29, 2021
2 parents 5905a53 + f5dd842 commit c23f220
Show file tree
Hide file tree
Showing 194 changed files with 2,036 additions and 1,906 deletions.
2 changes: 1 addition & 1 deletion app/app_error.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppError extends ErrorHandler {
* @param Array $messages
*/
function __construct($method, $messages) {
$this->controller =& new AppController();
$this->controller = new AppController();
$storeid = $messages[0]['url'];
$this->controller->redirect(MOBASUTE_PATH.$storeid);
exit();
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/keitai_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


class KeitaiSessionComponent extends Object
class KeitaiSessionComponent extends CakeObject
{

/**
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/misc_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


class MiscFunctionComponent extends Object
class MiscFunctionComponent extends CakeObject
{

/**
Expand Down
5 changes: 2 additions & 3 deletions app/controllers/components/soap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
define('LOG_REQUEST', 1);
define('LOG_ANSWER', 2);

class SoapComponent extends Object
class SoapComponent extends CakeObject
{
var $controller = null;
var $error = null;
Expand Down Expand Up @@ -138,8 +138,7 @@ function service($name=false)
'encoded', // use
$api['doc']); // documentation

global $HTTP_RAW_POST_DATA;
$data = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$data = file_get_contents('php://input');
$server->service($data);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/yoyaku_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

class YoyakuSessionComponent extends Object
class YoyakuSessionComponent extends CakeObject
{

/**
Expand Down
89 changes: 40 additions & 49 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,7 @@ function wsCustomerMergeSave($sessionid, $strcode, $fromccode, $toccode, $transc

try {

$source->begin();
$source->begin($this->Customer);

foreach ($sqlstatements as $sqlstatement) {

Expand All @@ -2900,7 +2900,7 @@ function wsCustomerMergeSave($sessionid, $strcode, $fromccode, $toccode, $transc
}
}

$source->commit();
$source->commit($this->Customer);
unset($source, $sqlstatements);

//====================================================================================
Expand Down Expand Up @@ -2934,7 +2934,7 @@ function wsCustomerMergeSave($sessionid, $strcode, $fromccode, $toccode, $transc

return $this->MiscFunction->GetTransactionUpdateDate($this->Customer, $transcode, $keyno);
} catch (Exception $ex) {
$source->rollback();
$source->rollback($this->Customer);
unset($source, $sqlstatements);
return null;
}
Expand All @@ -2954,7 +2954,6 @@ function wsCustomerMergeSave($sessionid, $strcode, $fromccode, $toccode, $transc
*/
function wsGetReservationCounter($sessionid, $strcode, $datefr, $dateto)
{

//===================================================================================
//(Verify Session and Get DB name)
//-----------------------------------------------------------------------------------
Expand All @@ -2963,9 +2962,9 @@ function wsGetReservationCounter($sessionid, $strcode, $datefr, $dateto)
$this->_soap_server->fault(1, '', INVALID_SESSION);
return;
}

$this->Customer->set_company_database($storeinfo['dbname'], $this->Customer);
//===================================================================================

/*
STORE_TRANSACTION ORIGINATION
0: SIPSS店舗、もばすてPC予約、その他
Expand Down Expand Up @@ -3547,26 +3546,23 @@ function wsSearchCustomer($sessionid, $param)
}
unset($param['free_customer']);

$remove_spaces = fn($str) => preg_replace("@[  ]@u", '', $str);

foreach ($param as $key => $val) {
if ((!empty($val) || $val === '0') && $key != 'limit' && $key != 'page' && $key != 'orderby' && $key != 'SEARCHSHAREDSTORE') {
if ($key == "PHONE") {
$criteria['(TEL1 LIKE ? OR TEL2 LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "MAILADDRESS") {
$criteria['(MAILADDRESS1 LIKE ? OR MAILADDRESS2 LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "CNAME") {
$val = ereg_replace(" ", "", $val);
$val = ereg_replace(" ", "", $val);
$val = $remove_spaces($val);
$criteria['(REPLACE(CNAME, " ", "") LIKE ? OR REPLACE(CNAME, " ", "") LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "CNAMEKANA") {
//--------------------------------------------------------------------------------------------------------------------
$val = ereg_replace(" ", "", $val);
$val = ereg_replace(" ", "", $val);
//--------------------------------------------------------------------------------------------------------------------
$kanafull = ereg_replace(" ", "", $val);
$kanafull = ereg_replace(" ", "", $val);
$val = $remove_spaces($val);
//--------------------------------------------------------------------------------------------------------------------
$val = mb_convert_kana($val, "kV", "UTF8");
$kanafull = mb_convert_kana($kanafull, "KV", "UTF8");
$kanafull = mb_convert_kana($val, "KV", "UTF8");
//--------------------------------------------------------------------------------------------------------------------
$criteria['(REPLACE(CNAMEKANA, " ", "") LIKE ?
OR REPLACE(CNAMEKANA, " ", "") LIKE ?
Expand Down Expand Up @@ -3748,7 +3744,7 @@ function wsSearchCustomer($sessionid, $param)
$Sql = "SELECT f_get_last_staffcodename(" . $storeinfo['storecode'] . ", " . "'" . $rec['CCODE'] . "') AS laststaffcodename";
$datarec = $this->Customer->query($Sql);
if (count($datarec) > 0) {
list($laststaffcode, $laststaffname) = split('[#]', $datarec[0][0]["laststaffcodename"]);
list($laststaffcode, $laststaffname) = preg_split('/[#]/', $datarec[0][0]["laststaffcodename"]);
$ret['records'][$ctr] = array_merge($rec, array(
'LASTSTAFFCODE' => (int)$laststaffcode,
'LASTSTAFFNAME' => $laststaffname
Expand Down Expand Up @@ -4691,7 +4687,7 @@ function wsAddStaffRowsHistories($sessionid, $storecode, $staffcode, $params, $p
$source = $this->StaffRowsHistory->getDataSource();

try {
$source->begin();
$source->begin($this->StaffRowsHistory);

if ($pre_delete) {
$query =
Expand Down Expand Up @@ -4729,10 +4725,10 @@ function wsAddStaffRowsHistories($sessionid, $storecode, $staffcode, $params, $p
}
}

$source->commit();
$source->commit($this->StaffRowsHistory);
return true;
} catch (Exception $ex) {
$source->rollback();
$source->rollback($this->StaffRowsHistory);
return false;
}
}
Expand Down Expand Up @@ -5807,7 +5803,7 @@ function wsAddUpdateDeleteStoreHoliday($sessionid, $param, $ismainsalon = true)
if (checkdate($param['month'], $day, $param['year']) && $param[$arrDays[$i]] <> "" ) {

//'whitespace'削除 (Removed 'whitespace' string)
$param[$arrDays[$i]] = ereg_replace('whitespace', '', $param[$arrDays[$i]]);
$param[$arrDays[$i]] = preg_replace('/whitespace/', '', $param[$arrDays[$i]]);
$param[$arrDays[$i]] = addslashes($param[$arrDays[$i]]);

//準備INSERT SQLステートメント (Prepare INSERT Sql Statement)
Expand Down Expand Up @@ -5836,17 +5832,17 @@ function wsAddUpdateDeleteStoreHoliday($sessionid, $param, $ismainsalon = true)
}
$source = $this->StoreHoliday->getDataSource();
try {
$source->begin();
$source->begin($this->StoreHoliday);
for ($ctr = 0; $ctr < count($sqlstatements); $ctr++) {
if ($this->StoreHoliday->query($sqlstatements[$ctr], $params[$ctr], false) === false) {
throw new Exception();
}
}
$source->commit();
$source->commit($this->StoreHoliday);
unset($source, $sqlstatements);
return true;
} catch (Exception $ex) {
$source->rollback();
$source->rollback($this->StoreHoliday);
unset($source, $sqlstatements);
return false;
}
Expand Down Expand Up @@ -8274,7 +8270,7 @@ function wsAddUpdateStoreTransaction($sessionid, $param)

//---------------------------------------------------------------------------
//-- 開始のデータベーストランザクション (Starts Database Transaction)
$this->StoreTransaction->begin();
$this->StoreTransaction->begin($this->StoreTransaction);
$sqlctr = 0;

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -8360,7 +8356,7 @@ function wsAddUpdateStoreTransaction($sessionid, $param)
$roop = true;
while ($roop) {
$subparam['storecode'] = $param['STORECODE']; //$storeinfo['storecode'];
$subparam['date'] = ereg_replace("-", "", $param['TRANSDATE']);
$subparam['date'] = preg_replace('/-/', '', $param['TRANSDATE']);
$subparam['idno'] = $idno;

//存在する場合、idnoに+1をして再チェックを繰り返す add 20160308
Expand Down Expand Up @@ -8884,7 +8880,7 @@ function wsAddUpdateStoreTransaction($sessionid, $param)


if ($error <> "true") {
$this->StoreTransaction->commit(); //-- トランザクションをコミット (Commit Transactions)
$this->StoreTransaction->commit($this->StoreTransaction); //-- トランザクションをコミット (Commit Transactions)
#------------------------------------------------------------------------------------------------------------------------
# ADDED BY MARVINC - 2015-07-27
# Note: Add condition for syscode
Expand Down Expand Up @@ -8912,10 +8908,10 @@ function wsAddUpdateStoreTransaction($sessionid, $param)
WHERE CMRD.transcode = CMR.transcode
)";
$this->StoreTransaction->query($del_mailsql_d);
$this->StoreTransaction->commit();
$this->StoreTransaction->commit($this->StoreTransaction);
#------------------------------------------------------------------------------------------------------------------------
} else {
$this->StoreTransaction->rollback(); //-- トランザクションをロールバック (Rollback Transactions)
$this->StoreTransaction->rollback($this->StoreTransaction); //-- トランザクションをロールバック (Rollback Transactions)
//$this->_soap_server->fault(1, '', ROLLBACK_MSG);
}
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -9244,7 +9240,7 @@ function wsAddUpdateBreakTime($sessionid, $param)

//-- 会社データベースを設定する (Set the Company Database)
$this->BreakTime->set_company_database($storeinfo['dbname'], $this->BreakTime);
$this->BreakTime->begin();
$this->BreakTime->begin($this->BreakTime);

//-- BREAKIDは設定してない場合、新規BREAKIDを作成 (Check BREAKID, create new if none)
if (empty($param['BREAKID'])) {
Expand All @@ -9266,11 +9262,11 @@ function wsAddUpdateBreakTime($sessionid, $param)
$query = "insert into break_time_log(BREAKID,STAFFCODE,STORECODE,DATE,STARTTIME,ENDTIME,PRIORITY,REMARKS,STATUS ,CREATEDATE )
select BREAKID,STAFFCODE,STORECODE,DATE,STARTTIME,ENDTIME,PRIORITY,REMARKS,1 as STATUS ,now() as CREATEDATE from break_time where breakid = {$param['BREAKID']}";
$this->BreakTime->query($query);
$this->BreakTime->commit();
$this->BreakTime->commit($this->BreakTime);

return $this->BreakTime->id;
} else {
$this->BreakTime->rollback();
$this->BreakTime->rollback($this->BreakTime);
$this->_soap_server->fault(1, '', 'Error Processing Data');
}
}
Expand All @@ -9296,7 +9292,7 @@ function wsDeleteBreakTime($sessionid, $breakid)
//-- 会社データベースを設定する (Set the Company Database)
$ret = true;
$this->BreakTime->set_company_database($storeinfo['dbname'], $this->BreakTime);
$this->BreakTime->begin();
$this->BreakTime->begin($this->BreakTime);

//削除ログの挿入
$query = "insert into break_time_log(BREAKID,STAFFCODE,STORECODE,DATE,STARTTIME,ENDTIME,PRIORITY,REMARKS,STATUS ,CREATEDATE )
Expand All @@ -9309,9 +9305,9 @@ function wsDeleteBreakTime($sessionid, $breakid)
$this->BreakTime->query($query);
}
if ($ret !== false) {
$this->BreakTime->commit();
$this->BreakTime->commit($this->BreakTime);
} else {
$this->BreakTime->rollback();
$this->BreakTime->rollback($this->BreakTime);
}

return true;
Expand Down Expand Up @@ -9584,7 +9580,7 @@ function wsGetDataOfTheDay($sessionid, $param)
$prioritytypenxt = $transactions[$key3 + 1]["PRIORITYTYPE"];
if ($endtime > $startime && $startime != null && $prioritytypecur == $prioritytypenxt) {
$conflict = true;
$priority = split("-", $transactions[$key3 + 1]["PRIORITYTYPE"]);
$priority = preg_split('/-/', $transactions[$key3 + 1]["PRIORITYTYPE"]);
$starttime_s = $transactions[$key3 + 1]["YOYAKUTIME"];
$endtime_s = $transactions[$key3 + 1]["ADJUSTED_ENDTIME"];
$transcode = $transactions[$key3 + 1]["TRANSCODE"];
Expand Down Expand Up @@ -10044,20 +10040,15 @@ function wsSendMail($sessionid, $from, $to, $cc, $bcc, $subject, $body)
* @param string $transcode
* @return return_storeTransactionInformation
*/
function wsSearchJikaiYoyaku($sessionid, $storecode, $ccode, $transcode)
function wsSearchJikaiYoyaku($sessionid, $storecode, $ccode = null, $transcode = null)
{
if ($param['ignoreSessionCheck'] <> 1) {
//-- セッションを確認してデータベース名を取り込む (Verify Session and Get DB name)
$storeinfo = $this->YoyakuSession->Check($this);
if ($storeinfo == false) {
$this->_soap_server->fault(1, '', INVALID_SESSION);
return;
}
} else {
$storeinfo['dbname'] = $param['dbname'];
//-- セッションを確認してデータベース名を取り込む (Verify Session and Get DB name)
$storeinfo = $this->YoyakuSession->Check($this);
if ($storeinfo == false) {
$this->_soap_server->fault(1, '', INVALID_SESSION);
return;
}


//-- 会社データベースを設定する (Set the Company Database)
$this->StoreTransaction->set_company_database($storeinfo['dbname'], $this->StoreTransaction);

Expand Down Expand Up @@ -11388,7 +11379,7 @@ function wsUpdateKanzashiCustomersLimit($sessionid, $ismainsalon, $store_holiday
}

$source = $this->StoreHoliday->getDataSource();
$source->begin();
$source->begin($this->StoreHoliday);

try {
foreach ($sqlstatements as $sqlstatement) {
Expand All @@ -11397,10 +11388,10 @@ function wsUpdateKanzashiCustomersLimit($sessionid, $ismainsalon, $store_holiday
}
}

$source->commit();
$source->commit($this->StoreHoliday);
$result['updated'] = true;
} catch (Exception $ex) {
$source->rollback();
$source->rollback($this->StoreHoliday);
}

return $result;
Expand Down Expand Up @@ -11652,10 +11643,10 @@ public function wsSaveFacilityPrograms($sessionid, $facility_programs)
}
}

$source->commit();
$source->commit($this->BreakTime);
return $facility_programs;
} catch (Exception $ex) {
$source->rollback();
$source->rollback($this->BreakTime);
return;
}
}
Expand Down
Loading

0 comments on commit c23f220

Please sign in to comment.