Skip to content

Commit 026d116

Browse files
committed
Calendar: Add option to set event as collective - refs BT#18894
1 parent 4d1eba4 commit 026d116

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

assets/vue/components/ccalendarevent/Form.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767

6868
<EditLinks :item="item" />
6969

70+
<q-checkbox v-model="item.collective" label="Is collective" />
71+
7072
<q-input
7173
v-model="item.content"
7274
type="textarea"
@@ -115,6 +117,7 @@ export default {
115117
title: null,
116118
content: null,
117119
parentResourceNodeId: null,
120+
collective: false,
118121
};
119122
},
120123
computed: {

assets/vue/views/ccalendarevent/List.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default {
100100
text: 'Add event',
101101
click: function() {
102102
item.value['parentResourceNodeId'] = currentUser.value.resourceNode['id'];
103+
item.value['collective'] = false;
103104
dialog.value = true;
104105
}
105106
}
@@ -118,6 +119,7 @@ export default {
118119
item.value['title'] = EventClickArg.event.title;
119120
item.value['startDate'] = EventClickArg.event.startStr;
120121
item.value['endDate'] = EventClickArg.event.endStr;
122+
item.value['collective'] = EventClickArg.event.collective || false;
121123
122124
dialogShow.value = true;
123125
},
@@ -126,13 +128,15 @@ export default {
126128
item.value['startDate'] = info.dateStr;
127129
item.value['endDate'] = info.dateStr;
128130
item.value['parentResourceNodeId'] = currentUser.value.resourceNode['id'];
131+
item.value['collective'] = false;
129132
dialog.value = true;
130133
},
131134
select: function(info) {
132135
item.value['allDay'] = info.allDay;
133136
item.value['startDate'] = info.startStr;
134137
item.value['endDate'] = info.endStr;
135138
item.value['parentResourceNodeId'] = currentUser.value.resourceNode['id'];
139+
item.value['collective'] = false;
136140
dialog.value = true;
137141
},
138142
events: function(info, successCallback, failureCallback) {

src/CoreBundle/Controller/Api/CreateCCalendarEventAction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __invoke(Request $request, CCalendarEventRepository $repo, Entit
2626
->setStartDate(new DateTime($result['startDate'] ?? ''))
2727
->setEndDate(new DateTime($result['endDate'] ?? ''))
2828
//->setAllDay($result['allDay'] ?? false)
29+
->setCollective($result['collective'] ?? false)
2930
;
3031

3132
return $event;

src/CourseBundle/Entity/CCalendarEvent.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,19 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface
159159
*/
160160
protected Collection $attachments;
161161

162+
/**
163+
* @ORM\Column(name="collective", type="boolean", options={"default": false}, nullable=false)
164+
*/
165+
#[Groups(['calendar_event:read', 'calendar_event:write'])]
166+
protected bool $collective = false;
167+
162168
public function __construct()
163169
{
164170
$this->children = new ArrayCollection();
165171
$this->attachments = new ArrayCollection();
166172
$this->repeatEvents = new ArrayCollection();
167173
$this->allDay = false;
174+
$this->collective = false;
168175
}
169176

170177
public function __toString(): string
@@ -387,4 +394,16 @@ public function setResourceName(string $name): self
387394
{
388395
return $this->setTitle($name);
389396
}
397+
398+
public function isCollective(): bool
399+
{
400+
return $this->collective;
401+
}
402+
403+
public function setCollective(bool $collective): CCalendarEvent
404+
{
405+
$this->collective = $collective;
406+
407+
return $this;
408+
}
390409
}

0 commit comments

Comments
 (0)