Skip to content

Commit

Permalink
qualche fix su analisi statica
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed May 4, 2024
1 parent 001dc02 commit c05a9e3
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion code/app/Console/Commands/FixDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public function handle()
$group->context = 'user';
$group->user_selectable = true;
$group->filters_orders = true;
$group->visible = true;
$group->save();

foreach($old_deliveries as $old) {
Expand Down
2 changes: 1 addition & 1 deletion code/app/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static function sortBookings($bookings, $circles)
$tmp_bookings = [];

foreach($bookings as $booking) {
$mycircles = $b->involvedCircles();
$mycircles = $booking->involvedCircles();
$valid = true;

foreach($circles as $required_circle) {
Expand Down
1 change: 1 addition & 0 deletions code/app/Importers/CSV/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use App\User;
use App\Contact;
use App\Group;
use App\Circle;

class Users extends CSVImporter
{
Expand Down
2 changes: 1 addition & 1 deletion code/app/Models/Concerns/InCircles.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function circlesByGroup($group = null)
];
}
else {
$ret = $ret[$circle->group->id];
$ret = $ret[$group->id];
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/app/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public function notifiableUsers($gas)
})->pluck('id');

if ($user_circles->isEmpty() == false) {
$query_users->whereHas('circles', function($query) {
$query_users->whereHas('circles', function($query) use ($user_circles) {
$query->whereIn('id', $user_circles);
});
}
Expand Down
3 changes: 0 additions & 3 deletions code/app/Services/GroupsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,18 @@ public function update($id, array $request)
$this->setIfSet($g, $request, 'cardinality');
$this->boolIfSet($g, $request, 'filters_orders');
$this->boolIfSet($g, $request, 'user_selectable');
$this->boolIfSet($g, $request, 'visible');
break;

case 'booking':
$g->cardinality = 'single';
$g->filters_orders = false;
$g->user_selectable = true;
$g->visible = true;
break;

case 'order':
$g->cardinality = 'many';
$g->filters_orders = false;
$g->user_selectable = true;
$g->visible = true;
break;
}

Expand Down
1 change: 1 addition & 0 deletions code/app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function up(): void
$table->string('cardinality')->default('single');
$table->boolean('user_selectable')->default(false);
$table->boolean('filters_orders')->default(true);
$table->boolean('visible')->default(true);
});
}

Expand Down
5 changes: 2 additions & 3 deletions code/resources/views/groups/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<div class="col-md-12">
@include('groups.base-edit')

<x-larastrap::radios :label="_i('Contesto')" name="context" :options="['user' => _i('Utente'), 'booking' => _i('Prenotazione'), 'order' => _i('Ordine')]" classes="selective-display" :attributes="['data-target' => '.optional']" />
<x-larastrap::radios :label="_i('Contesto')" name="context" :options="['user' => _i('Utente'), 'booking' => _i('Prenotazione'), 'order' => _i('Ordine')]" classes="selective-display" :attributes="['data-target' => '.optional']" :pophelp="_i('<ul><li>Utente: il Gruppo è assegnabile a ciascun utente, a priori, e vale per tutti gli Ordini. Utile per partizionare gli utenti.</li><li>Prenotazione: il Gruppo è assegnabile a ciascuna Prenotazione da parte degli utenti. Utile per gestire la logistica, in caso di molteplici punti di consegna arbitrariamente selezionabili dagli utenti.</li><li>Ordine: il Gruppo è assegnabile a ciascun Ordine, e viene mostrato nel pannello di Prenotazione (ma non può essere selezionato dagli utenti). Utile per veicolare informazioni, ad esempio relative al luogo di consegna o più in generale per etichettare gli Ordini.</li></ul>')" />

<div class="optional" data-type="user">
<x-larastrap::radios :label="_i('Ogni Utente può stare in')" name="cardinality" :options="['single' => _i('un solo Cerchio'), 'many' => _i('diversi Cerchi')]" />
<x-larastrap::check :label="_i('Selezionabile dall\'Utente')" name="user_selectable" />
<x-larastrap::check :label="_i('Limita accesso agli Ordini')" name="filters_orders" />
<x-larastrap::check :label="_i('Visibile dall\'Utente')" name="visible" />
<x-larastrap::check :label="_i('Limita accesso Ordini')" name="filters_orders" :pophelp="_i('Se selezionato, sarà possibile scegliere uno o più Cerchie di questo Gruppo nel contesto di ogni Ordine. Così facendo, l\'Ordine stesso sarà accessibile solo agli utenti che sono stati assegnati alle Cerchie stesse.')" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion code/resources/views/user/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
@foreach($user->eligibleGroups() as $ug)
@if($admin_editable || $ug->user_selectable)
<x-dynamic-component :component="sprintf('larastrap::%s', $ug->cardinality == 'single' ? 'radiolist-model' : 'checklist-model')" :params="['name' => 'circles', 'npostfix' => '[]', 'label' => $ug->name, 'options' => $ug->circles]" />
@elseif($ug->visible)
@else
<x-dynamic-component :component="sprintf('larastrap::%s', $ug->cardinality == 'single' ? 'radiolist-model' : 'checklist-model')" :params="['name' => 'circles', 'npostfix' => '[]', 'label' => $ug->name, 'options' => $ug->circles]" disabled readonly />
@endif
@endforeach
Expand Down

0 comments on commit c05a9e3

Please sign in to comment.