Skip to content

Commit

Permalink
Merge pull request #142 from sarapis/feedback-changes
Browse files Browse the repository at this point in the history
Fix service taxonomy category issue with taxonomy type
  • Loading branch information
d9it committed Mar 14, 2024
2 parents 366bee9 + 03d4607 commit b97cb76
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
38 changes: 20 additions & 18 deletions app/Services/ServiceDataService.php
Expand Up @@ -93,24 +93,26 @@ public function service_airtable_v3($access_token, $base_url)

$service->service_status = isset($record['fields']['status']) ? $record['fields']['status'] : null;

// if (isset($record['fields']['taxonomy'])) {
// $i = 0;
// foreach ($record['fields']['taxonomy'] as $value) {
// $service_taxonomy = new ServiceTaxonomy();
// $service_taxonomy->service_recordid = $service->service_recordid;
// $service_taxonomy->taxonomy_recordid = $strtointclass->string_to_int($value);
// $service_taxonomy->save();
// $servicetaxonomy = $strtointclass->string_to_int($value);

// if ($i != 0) {
// $service->service_taxonomy = $service->service_taxonomy . ',' . $servicetaxonomy;
// } else {
// $service->service_taxonomy = $servicetaxonomy;
// }

// $i++;
// }
// }
if (isset($record['fields']['taxonomy_terms'])) {
$i = 0;
$servicetaxonomy = [];
foreach ($record['fields']['taxonomy_terms'] as $value) {
// $service_taxonomy = new ServiceTaxonomy();
// $service_taxonomy->service_recordid = $service->service_recordid;
// $service_taxonomy->taxonomy_recordid = $strtointclass->string_to_int($value);
// $service_taxonomy->save();
$servicetaxonomy[] = $strtointclass->string_to_int($value);

// if ($i != 0) {
// $service->service_taxonomy = $service->service_taxonomy . ',' . $servicetaxonomy;
// } else {
// $service->service_taxonomy = $servicetaxonomy;
// }

// $i++;
}
$service->service_taxonomy = count($servicetaxonomy) > 0 ? implode(',', $servicetaxonomy) : null ;
}

$service->service_application_process = isset($record['fields']['application_process']) ? $record['fields']['application_process'] : null;
// $service->service_wait_time = isset($record['fields']['wait_time']) ? $record['fields']['wait_time'] : null;
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontEnd/contacts/show.blade.php
Expand Up @@ -176,7 +176,7 @@
<span class="pl-0 category_badge subtitle">
@foreach ($service->taxonomy as $service_taxonomy_info)
@if (isset($service_taxonomy_info->taxonomy_type) && count($service_taxonomy_info->taxonomy_type) > 0 && $service_taxonomy_info->taxonomy_type[0]->name == 'Service Category')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null) --}}
@if ($i == 0)
<b>Service Category:</b>
@php
Expand All @@ -185,7 +185,7 @@
@endif
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}" style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand All @@ -194,7 +194,7 @@
<span class="pl-0 category_badge subtitle">
@foreach ($service->taxonomy as $service_taxonomy_info)
@if (isset($service_taxonomy_info->taxonomy_type) && count($service_taxonomy_info->taxonomy_type) > 0 && $service_taxonomy_info->taxonomy_type[0]->name == 'Service Eligibility')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null) --}}
@if ($j == 0)
<b>Service Eligibility:</b>
@php
Expand All @@ -203,7 +203,7 @@
@endif
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}" style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontEnd/locations/show.blade.php
Expand Up @@ -263,7 +263,7 @@
@if (isset($service_taxonomy_info->taxonomy_type) &&
count($service_taxonomy_info->taxonomy_type) > 0 &&
$service_taxonomy_info->taxonomy_type[0]->name == 'Service Category')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null) --}}
@if ($i == 0)
<b>Service Category:</b>
@php
Expand All @@ -273,7 +273,7 @@
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand All @@ -284,7 +284,7 @@
@if (isset($service_taxonomy_info->taxonomy_type) &&
count($service_taxonomy_info->taxonomy_type) > 0 &&
$service_taxonomy_info->taxonomy_type[0]->name == 'Service Eligibility')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null) --}}
@if ($j == 0)
<b>Service Eligibility:</b>
@php
Expand All @@ -294,7 +294,7 @@
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontEnd/organizations/show.blade.php
Expand Up @@ -362,7 +362,7 @@ class="subtitle"><b>{{ $detail['detail_type'] }}:</b></span>
<span class="pl-0 category_badge subtitle">
@foreach ($service->taxonomy as $service_taxonomy_info)
@if (isset($service_taxonomy_info->taxonomy_type) && count($service_taxonomy_info->taxonomy_type) > 0 && $service_taxonomy_info->taxonomy_type[0]->name == 'Service Category')
@if ($service->service_taxonomy != null)
{{-- @if ($service->service_taxonomy != null) --}}
@if ($i == 0)
<b>Service Category:</b>
@php
Expand All @@ -372,7 +372,7 @@ class="subtitle"><b>{{ $detail['detail_type'] }}:</b></span>
<a class="panel-link {{ str_replace(' ', '_', $service_taxonomy_info->taxonomy_name) }}"
at="child_{{ $service_taxonomy_info->taxonomy_recordid }}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#' . $service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{ $service_taxonomy_info->taxonomy_name }}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand All @@ -381,7 +381,7 @@ class="subtitle"><b>{{ $detail['detail_type'] }}:</b></span>
<span class="pl-0 category_badge subtitle">
@foreach ($service->taxonomy as $service_taxonomy_info)
@if (isset($service_taxonomy_info->taxonomy_type) && count($service_taxonomy_info->taxonomy_type) > 0 && $service_taxonomy_info->taxonomy_type[0]->name == 'Service Eligibility')
@if ($service->service_taxonomy != null)
{{-- @if ($service->service_taxonomy != null) --}}
@if ($j == 0)
<b>Service Eligibility:</b>
@php
Expand All @@ -391,7 +391,7 @@ class="subtitle"><b>{{ $detail['detail_type'] }}:</b></span>
<a class="panel-link {{ str_replace(' ', '_', $service_taxonomy_info->taxonomy_name) }}"
at="child_{{ $service_taxonomy_info->taxonomy_recordid }}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#' . $service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{ $service_taxonomy_info->taxonomy_name }}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/frontEnd/services/service_download.blade.php
Expand Up @@ -50,14 +50,14 @@
<h4 class="panel-text"><span class="badge bg-red">Alternate Name:</span> {{$service->service_alternate_name}}</h4>

<h4 class="panel-text"><span class="badge bg-red">Category:</span>
@if($service->service_taxonomy!=0 || $service->service_taxonomy==null)
{{-- @if($service->service_taxonomy!=0 || $service->service_taxonomy==null) --}}
@foreach($service->taxonomy as $key => $taxonomy)
@if($loop->last)
<a class="panel-link" href="{{ config('app.url')}}/category_{{$taxonomy->taxonomy_recordid}}">{{$taxonomy->taxonomy_name}}</a> @else
<a class="panel-link" href="{{ config('app.url')}}/category_{{$taxonomy->taxonomy_recordid}}">{{$taxonomy->taxonomy_name}}</a>,
@endif
@endforeach
@endif
{{-- @endif --}}
</h4>
<p class="panel-text"><span class="badge bg-red">Organization:</span>
@if($service->service_organization)
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontEnd/services/services.blade.php
Expand Up @@ -283,7 +283,7 @@
@if (isset($service_taxonomy_info->taxonomy_type) &&
count($service_taxonomy_info->taxonomy_type) > 0 &&
$service_taxonomy_info->taxonomy_type[0]->name == 'Service Category')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null)--}}
@if ($i == 0)
<b>Service Category:</b>
@php
Expand All @@ -293,7 +293,7 @@
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif--}}
@endif
@endforeach
</span>
Expand All @@ -306,7 +306,7 @@
@if (isset($service_taxonomy_info->taxonomy_type) &&
count($service_taxonomy_info->taxonomy_type) > 0 &&
$service_taxonomy_info->taxonomy_type[0]->name == 'Service Eligibility')
@if($service->service_taxonomy != null)
{{-- @if($service->service_taxonomy != null) --}}
@if ($j == 0)
<b>Service Eligibility:</b>
@php
Expand All @@ -316,7 +316,7 @@
<a class="panel-link {{str_replace(' ', '_', $service_taxonomy_info->taxonomy_name)}}"
at="child_{{$service_taxonomy_info->taxonomy_recordid}}"
style="background-color: {{ $service_taxonomy_info->badge_color ? '#'.$service_taxonomy_info->badge_color : '#000' }} !important; color:#fff !important;">{{$service_taxonomy_info->taxonomy_name}}</a>
@endif
{{-- @endif --}}
@endif
@endforeach
</span>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontEnd/services/services_download.blade.php
Expand Up @@ -16,17 +16,17 @@
href="{{ config('app.url') }}/services/{{ $service->service_recordid }}">
{{ $service->service_name }}</a></h3>
<h4><span class="badge bg-red">Category:</span>
@if ($service->service_taxonomy != 0)
{{-- @if ($service->service_taxonomy != 0) --}}
@foreach ($service->taxonomy as $key => $taxonomy)
@if ($loop->last)
@if ($loop->last)
<a class="panel-link"
href="{{ config('app.url') }}/category/{{ $taxonomy->taxonomy_recordid }}">{{ $taxonomy->taxonomy_name }}</a>
@else
<a class="panel-link"
href="{{ config('app.url') }}/category/{{ $taxonomy->taxonomy_recordid }}">{{ $taxonomy->taxonomy_name }}</a>,
@endif
@endforeach
@endif
@endforeach
{{-- @endif --}}
</h4>
<p><span class="badge bg-red">Organization:</span>
@if ($service->service_organization != 0)
Expand Down

0 comments on commit b97cb76

Please sign in to comment.