Skip to content

Commit

Permalink
Merge pull request smarty-php#33 from think-ahead/ticket-#5167-remove…
Browse files Browse the repository at this point in the history
…-the-facilityenabled-flag

Ticket #5167 remove the facilityenabled flag
  • Loading branch information
think-katou committed Dec 22, 2020
2 parents 184268e + 75cd5e0 commit 9e086ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 36 deletions.
26 changes: 0 additions & 26 deletions app/controllers/components/misc_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -1812,32 +1812,6 @@ function GetDailyKanzashiCustomersLimit(&$controller, $dbname, $storecode, $ymd)
return $result;
}

/**
* Determine whether Facility is Enabled
*
* @param controller &$controller
* @param string $dbname
* @param int $storecode
* @return boolean
*/
function IsFacilityEnabled(&$controller, $dbname, $storecode)
{
$controller->Store->set_company_database($dbname, $controller->Store);
$query = "
SELECT *
FROM store_settings
WHERE
storecode = :storecode AND
optionname = 'FacilityEnabled' AND
optionvaluei = 1
";

$param = compact('storecode');
$result = $controller->Store->query($query, $param, false);

return (bool)$result;
}

/**
* Get the available Facilities
*
Expand Down
16 changes: 6 additions & 10 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,7 @@ class ServersController extends WebServicesController
'allstoretype' => 'tns:AllStoreTypes',
'KanzashiSalons' => 'tns:KanzashiSalons',
'KanzashiConfig' => 'tns:KanzashiConfig',
'KanzashiInfo' => 'tns:KanzashiInfo',
'FACILITY_ENABLED' => 'xsd:boolean'
'KanzashiInfo' => 'tns:KanzashiInfo'
)),

'_AllStoreTypes' => array('struct' => array(
Expand Down Expand Up @@ -3345,9 +3344,6 @@ function wsLogin($param)
}
}

$arrReturn['FACILITY_ENABLED'] = $this->MiscFunction
->IsFacilityEnabled($this, $arrReturn['dbname'], $arrReturn['storecode']);

if ($arrReturn['YOYAKU_HYOU_OPEN_TIME'] == "") {
$arrReturn['YOYAKU_HYOU_OPEN_TIME'] = $arrReturn['OPEN_TIME'];
$arrReturn['YOYAKU_HYOU_CLOSE_TIME'] = $arrReturn['CLOSE_TIME'];
Expand Down Expand Up @@ -9351,18 +9347,18 @@ function wsGetDataOfTheDay($sessionid, $param)

$facilities['records'] = array();
#----------------------------------------------------------------------------------------------------------------
if ($this->MiscFunction->IsFacilityEnabled($this, $storeinfo['dbname'], $param['STORECODE'])) {
$facilities = $this->MiscFunction
->GetAvailableFacilities($this, $storeinfo['dbname']);
$facilities = $this->MiscFunction
->GetAvailableFacilities($this, $storeinfo['dbname']);

if($facilities) {
$programs = $this->MiscFunction->
GetFacilityPrograms($this, $storeinfo['dbname'], $storeinfo['companyid'], $param['STORECODE'], $param['date']);

foreach($facilities['records'] as &$facility) {
foreach($programs as &$program){
if($facility['Id'] != $program['FacilityId'])
continue;

$facility['Programs'][] = $program;
unset($program);
}
Expand Down

0 comments on commit 9e086ab

Please sign in to comment.