Skip to content

Commit

Permalink
Merge branch 'booleanFix'
Browse files Browse the repository at this point in the history
  • Loading branch information
cazzerson committed Oct 31, 2014
2 parents dd370f9 + f57f474 commit 6ca9dd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions service/models/ActivityModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function getActivityGroup()
public function update($data)
{
$hash = array('title' => isset($data['title']) ? $data['title'] : $this->getMetadata('title'),
'enabled' => (isset($data['enabled']) && is_bool($data['enabled'])) ? (int)$data['enabled'] : $this->getMetadata('enabled'),
'enabled' => (isset($data['enabled'])) ? (int)$data['enabled'] : $this->getMetadata('enabled'),
'fk_activity_group' => isset($data['group']) ? $data['group'] : $this->getMetadata('fk_activity_group'),
'description' => isset($data['desc']) ? $data['desc'] : $this->getMetadata('desc'),
'rank' => isset($data['rank']) ? $data['rank'] : $this->getMetadata('rank'));
Expand Down Expand Up @@ -157,8 +157,8 @@ public static function updateActivitiesArray($activities, $initID=null)
foreach($activities as $actGroupKey => $activityGroup) {

if ((isset($activityGroup['title']) && strlen($activityGroup['title']) > 0) && isset($activityGroup['id'])
&& isset($activityGroup['desc']) && (isset($activityGroup['required']) && is_bool($activityGroup['required']))
&& (isset($activityGroup['allowMulti']) && is_bool($activityGroup['allowMulti'])))
&& isset($activityGroup['desc']) && (isset($activityGroup['required']))
&& (isset($activityGroup['allowMulti'])))
{
$actGroupData = Array(
'title' => $activityGroup['title'],
Expand Down Expand Up @@ -193,7 +193,7 @@ public static function updateActivitiesArray($activities, $initID=null)
foreach($activityGroup['activities'] as $actKey => $activity)
{
if ((isset($activity['title']) && strlen($activity['title']) > 0) && isset($activity['id'])
&& isset($activity['desc']) && (isset($activity['enabled']) && is_bool($activity['enabled'])))
&& isset($activity['desc']) && (isset($activity['enabled'])))
{
$actData = Array(
'title' => $activity['title'],
Expand Down
4 changes: 2 additions & 2 deletions service/models/InitiativeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ private function fetchActivityGroups()
$activityGroupMetadata[] = array('id' => (int)$group->getMetadata('id'),
'title' => $group->getMetadata('title'),
'rank' => (int)$group->getMetadata('rank'),
'required' => ($group->getMetadata('required')) ? 1 : 0,
'allowMulti' => ($group->getMetadata('allowMulti')) ? 1 : 0,
'required' => ($group->getMetadata('required')) ? true : false,
'allowMulti' => ($group->getMetadata('allowMulti')) ? true : false,
);
}

Expand Down
2 changes: 1 addition & 1 deletion service/models/LocationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static function validateLocTree($locTree)
{
if ((isset($locTree['title']) && strlen($locTree['title']) > 0)
&& isset($locTree['description'])
&& (isset($locTree['enabled']) && is_bool($locTree['enabled'])))
&& (isset($locTree['enabled'])))
{
$retValue = true;

Expand Down

0 comments on commit 6ca9dd8

Please sign in to comment.