|
|
@@ -831,12 +831,21 @@ class Member extends Component
|
|
|
{
|
|
|
$status = '';
|
|
|
$annullata = false;
|
|
|
+ $motivation = null;
|
|
|
if (in_array($calendar->id, $presences))
|
|
|
{
|
|
|
$status = "<span style=\"color:#0c6197\">Presenza</span>";
|
|
|
$this->presenze += 1;
|
|
|
$this->valori[$monthMap[date('n', strtotime($calendar->from))]] += 1;
|
|
|
$chartData[PRESENZE]["data"][$monthMap[date('n', strtotime($calendar->from))]] += 1;
|
|
|
+
|
|
|
+ $presence = \App\Models\Presence::where('member_id', $this->dataId)->where('status', '<>', 99)->where('calendar_id', $calendar->id)->first();
|
|
|
+ if ($presence->motivation && $presence->motivation->show_in_member_presences) {
|
|
|
+ $motivation = $presence->motivation->name;
|
|
|
+ if (!isset($this->recuperi[$motivation])) $this->recuperi[$motivation] = 0;
|
|
|
+
|
|
|
+ $this->recuperi[$motivation] += 1;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -868,7 +877,7 @@ class Member extends Component
|
|
|
$chartData[ANNULLATE]["data"][$monthMap[date('n', strtotime($calendar->from))]] += 1;
|
|
|
}
|
|
|
|
|
|
- $this->member_presences[] = array('calendar_id' => $calendar->id, 'from' => $calendar->from, 'to' => $calendar->to, 'status' => $status, 'motivation' => null);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
+ $this->member_presences[] = array('calendar_id' => $calendar->id, 'from' => $calendar->from, 'to' => $calendar->to, 'status' => $status, 'motivation' => $motivation);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
}
|
|
|
|
|
|
//$courses = array(1);
|
|
|
@@ -887,18 +896,18 @@ class Member extends Component
|
|
|
$presences_recuperi = \App\Models\Presence::whereIn('calendar_id', $calendar_recuperi)->where('member_id', $this->dataId)->get();
|
|
|
foreach($presences_recuperi as $p)
|
|
|
{
|
|
|
- // $this->member_presences[] = array('calendar_id' => $p->calendar->id, 'from' => $p->calendar->from, 'to' => $p->calendar->to, 'status' => '<span style="color:#7136f6">Recupero</span>', 'motivation' => $p->motivation->name);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
- $this->member_presences[] = array('calendar_id' => $p->calendar->id, 'from' => $p->calendar->from, 'to' => $p->calendar->to, 'status' => '<span style=\"color:#0c6197\">Presenza</span>', 'motivation' => $p->motivation->name);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
+ if ($p->motivation && $p->motivation->show_in_member_presences) {
|
|
|
+ // $this->member_presences[] = array('calendar_id' => $p->calendar->id, 'from' => $p->calendar->from, 'to' => $p->calendar->to, 'status' => '<span style="color:#7136f6">Recupero</span>', 'motivation' => $p->motivation->name);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
+ $this->member_presences[] = array('calendar_id' => $p->calendar->id, 'from' => $p->calendar->from, 'to' => $p->calendar->to, 'status' => '<span style=\"color:#0c6197\">Presenza</span>', 'motivation' => $p->motivation->name);//\App\Models\Presence::where('member_id', $this->dataId)->get();
|
|
|
|
|
|
- if ($p->motivation) {
|
|
|
if (!isset($this->recuperi[$p->motivation->name])) $this->recuperi[$p->motivation->name] = 0;
|
|
|
|
|
|
$this->recuperi[$p->motivation->name] += 1;
|
|
|
+ $this->presenze += 1;
|
|
|
+
|
|
|
+ // $chartData[RECUPERO]["data"][$monthMap[date('n', strtotime($p->calendar->from))]] += 1;
|
|
|
+ $chartData[PRESENZE]["data"][$monthMap[date('n', strtotime($p->calendar->from))]] += 1;
|
|
|
}
|
|
|
- $this->presenze += 1;
|
|
|
-
|
|
|
- $chartData[PRESENZE]["data"][$monthMap[date('n', strtotime($p->calendar->from))]] += 1;
|
|
|
- // $chartData[RECUPERO]["data"][$monthMap[date('n', strtotime($p->calendar->from))]] += 1;
|
|
|
}
|
|
|
|
|
|
$sortVariable='from';
|