|
|
@@ -278,6 +278,7 @@ class Course extends Component
|
|
|
$mTo = getMonthName(date("n", strtotime($this->date_to)));
|
|
|
|
|
|
$course_name = $course->name;
|
|
|
+ $discipline_name = $course->discipline?->name ?? $course_name;
|
|
|
|
|
|
// creo il calendario
|
|
|
$from = date("Y-m-d", strtotime($this->date_from));
|
|
|
@@ -327,7 +328,7 @@ class Course extends Component
|
|
|
{
|
|
|
|
|
|
// Controllo che non esiste un corso così
|
|
|
- $exist = \App\Models\Calendar::where('from', date('Y-m-d ' . $d["from"] . ":00", $i))->where('to', date('Y-m-d ' . $d["to"] . ":00", $i))->where('name', $course_name)->first();
|
|
|
+ $exist = \App\Models\Calendar::where('from', date('Y-m-d ' . $d["from"] . ":00", $i))->where('to', date('Y-m-d ' . $d["to"] . ":00", $i))->where('name', $discipline_name)->first();
|
|
|
|
|
|
if (!$exist && !in_array(date('Y-m-d', $i), $this->festivita))
|
|
|
{
|
|
|
@@ -336,7 +337,7 @@ class Course extends Component
|
|
|
$calendar = new \App\Models\Calendar();
|
|
|
$calendar->course_id = $course->id;
|
|
|
$calendar->court_id = null;
|
|
|
- $calendar->name = $course_name;
|
|
|
+ $calendar->name = $discipline_name;
|
|
|
$calendar->course_type_id = null;
|
|
|
$calendar->course_duration_id = null;
|
|
|
$calendar->course_frequency_id = null;
|