|
|
@@ -556,6 +556,38 @@ class Presence extends Component
|
|
|
$this->emit('setSaving');
|
|
|
}
|
|
|
|
|
|
+ public function saveManualCalendar()
|
|
|
+ {
|
|
|
+ $userId = \Auth::user()->id;
|
|
|
+ $calendarId = $this->calendar->id;
|
|
|
+
|
|
|
+ $presences = \App\Models\Presence::where('calendar_id', $calendarId)
|
|
|
+ ->where('user_id', $userId)
|
|
|
+ ->where('status', '<>', 99)
|
|
|
+ ->get();
|
|
|
+
|
|
|
+ foreach ($presences as $presence) {
|
|
|
+ // Salvo eventuale court_id (se presente e maggiore di 0)
|
|
|
+ if ($this->save_court_id > 0) {
|
|
|
+ $presence->court_id = $this->save_court_id;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Salvo eventuale instructor_id (se presente e maggiore di 0)
|
|
|
+ if ($this->save_instructor_id > 0) {
|
|
|
+ $presence->instructor_id = $this->save_instructor_id;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Salvo eventuali note (se non vuote)
|
|
|
+ if ($this->save_notes != '') {
|
|
|
+ $presence->notes = $this->save_notes;
|
|
|
+ }
|
|
|
+
|
|
|
+ $presence->save();
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->emit('setSaving');
|
|
|
+ }
|
|
|
+
|
|
|
public function cancel($ids, $motivation_id)
|
|
|
{
|
|
|
|