Skip to content

Commit

Permalink
Merge pull request #227 from younginnovations/620-make-app-run-on-php7
Browse files Browse the repository at this point in the history
Prep app to run on PHP 7 on mines-rdc.cd
  • Loading branch information
Ionut Prunache authored Feb 26, 2021
2 parents d0f6104 + 1f0f207 commit 832e0f3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
4 changes: 1 addition & 3 deletions app/Http/Controllers/FilterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function index(Request $request)

return view(
'site.filter',
compact('contracts', 'filter', 'total_contract', 'currentPage', 'meta')
compact('contracts', 'filter', 'currentPage', 'meta')
);
}

Expand Down Expand Up @@ -89,7 +89,6 @@ public function gIndex(Request $request)
compact(
'contracts',
'filter',
'total_contract',
'currentPage',
'meta',
'filter_params',
Expand Down Expand Up @@ -137,7 +136,6 @@ public function recentIndex(Request $request)
compact(
'contracts',
'filter',
'total_contract',
'currentPage',
'meta',
'filter_params',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ar/codelist/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'br' => "البريتانية",
'bs' => "البوسنوية",
'ca' => "الكتالانية",
'cd' => 'الكونغوليين',
'ce' => "الشيشانية",
'ch' => "الشامورو",
'co' => "الكورسيكية",
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/codelist/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'br' => 'Breton',
'bs' => 'Bosnian',
'ca' => 'Catalan',
'cd' => 'Congolese',
'ce' => 'Chechen',
'ch' => 'Chamorro',
'co' => 'Corsican',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fr/codelist/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'br' => 'Breton',
'bs' => 'Bosnien',
'ca' => 'Catalan',
'cd' => 'Congolais',
'ce' => 'Tchétchène',
'ch' => 'Chamorro',
'co' => 'Corse',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ function ($a, $b) {
return intval($b->year_signed) - intval($a->year_signed);
}
);
$supporting_contracts_count = !empty($contract->supporting_contracts) ? count($contract->supporting_contracts) : 0;
$children_contracts_count = !empty($contract->children) ? count($contract->children) : 0;
?>

@foreach($contract->children as $child)
@include('contract.partials.listRow',['contract'=>$child])
@endforeach
Expand All @@ -76,7 +80,7 @@ function ($a, $b) {
<tr class='{{$contract->id}} in'>
<td colspan="6" class="other-document">
View
<a href="{{route('contract.view',['id'=> $contract->open_contracting_id]).'#associatedcontracts'}}">{{count($contract->supporting_contracts)- count($contract->children)}}
<a href="{{route('contract.view',['id'=> $contract->open_contracting_id]).'#associatedcontracts'}}">{{$supporting_contracts_count - $children_contracts_count}}
other document(s) </a> associated with {{$contract->name}}
</td>
</tr>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/contract/partials/listRow.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$toggleAttr = '';
$className='';
if($contract->is_supporting_document == '0') {
if(count($contract->supporting_contracts) > 0)
if(!empty($contract->supporting_contracts) && count($contract->supporting_contracts) > 0)
$toggleAttr = 'class=expand data-toggle=collapse data-target=.'.$contract->id;
} else {
$className = 'in '.$contract->translated_from->id;
Expand All @@ -25,7 +25,8 @@
?>
<tr {!! $toggleAttr !!}>
<td data-title="@lang('global.document')" style="background: 0" class="documentTitle document_title {{ !isset
($contract->children) ? 'associate' : ''}} {{ count($contract->supporting_contracts) ? 'parent': '' }} {{
($contract->children) ? 'associate' : ''}} {{ (!empty($contract->supporting_contracts) && count
($contract->supporting_contracts)) ? 'parent': '' }} {{
$contract->score === 0 ? 'greyed' : ''}}">
<a class="title-{{$contract->open_contracting_id}}"
href="{{ url(sprintf("/contract/%s/view#/pdf", $contract->open_contracting_id )) }}">
Expand Down Expand Up @@ -203,4 +204,4 @@
@endif
</ul>
</td>
</tr>
</tr>

0 comments on commit 832e0f3

Please sign in to comment.