Skip to content

Commit

Permalink
Merge pull request #108 from dbarzin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dbarzin committed Jul 24, 2024
2 parents 6b5e4f7 + 9efa056 commit 17777ee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/SendNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function handle()
// Space
$txt .= '   -   ';
// Clauses
foreach($control->measures as $measure) {
foreach ($control->measures as $measure) {
$txt .= '<a href="' . url('/alice/show/' . $measure->id) . '">'. htmlentities($measure->clause) . '</a>';
// Space
$txt .= ' &nbsp; ';
Expand Down
25 changes: 17 additions & 8 deletions app/Http/Controllers/ControlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,17 +525,27 @@ public function domains(Request $request)
// Scope filter
$scope = $request->get('scope');
if ($scope !== null) {
$request->session()->put('scope', $scope);
if ($scope === 'none') {
$scope = null;
$request->session()->forget('scope');
} else {
$request->session()->put('scope', $scope);
}
} else {
$request->session()->forget('scope');
$scope = $request->session()->get('scope');
}

//dd($scope);
// Framework filter
$framework = $request->get('framework');
if ($framework !== null) {
$request->session()->put('framework', $framework);
if ($framework === 'none') {
$framework = null;
$request->session()->forget('framework');
} else {
$request->session()->put('framework', $framework);
}
} else {
$request->session()->forget('framework');
$framework = $request->session()->get('framework');
}

// get all active domains
Expand Down Expand Up @@ -570,11 +580,10 @@ public function domains(Request $request)
$scopes = DB::table('controls')
->select('scope')
->whereIn('status', [0,1])
->whereNotNull('scope')
->distinct()
->orderBy('scope')
->get()
->pluck('scope')
->toArray();
->get();

// count control never made
$controls_never_made = DB::table('controls as c1')
Expand Down
9 changes: 5 additions & 4 deletions resources/views/radar/domains.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="cell-2">
<strong>{{ trans("cruds.domain.fields.framework") }}</strong>
<select name="framework" data-role="select" id="framework">
<option></option>
<option value='none'></option>
@foreach ($frameworks as $framework)
<option
@if (Session::get("framework")==$framework)
Expand All @@ -27,12 +27,13 @@
<div class="cell-2">
<strong>{{ trans("cruds.control.fields.scope") }}</strong>
<select name="scope" data-role="select" id="scope">
@foreach ($scopes as $scope)
<option value='none'></option>
@foreach ($scopes as $key => $value)
<option
@if (Session::get("scope")==$scope)
@if (Session::get("scope")==$value->scope)
selected
@endif >
{{ $scope }}
{{ $value->scope }}
</option>
@endforeach
</select>
Expand Down

0 comments on commit 17777ee

Please sign in to comment.