Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ def add_libs(rel_name, galette_archive):
'.gitignore',
'.php-cs-fixer.dist.php',
'.phpcs.xml',
'calendar.js',
'package-lock.json',
'package.json',
'phpstan.neon',
Expand All @@ -424,7 +423,7 @@ def add_libs(rel_name, galette_archive):
if os.path.exists(target):
os.remove(target)

for todrop in ['.github', 'bin', 'node_modules', 'tests']:
for todrop in ['.github', 'bin', 'js', 'node_modules', 'tests']:
target = os.path.join(npm_dir, todrop)
if os.path.exists(target):
shutil.rmtree(target)
Expand Down
47 changes: 18 additions & 29 deletions calendar.js → js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,39 @@ import 'fullcalendar/themes/classic/palette.css';

$(function() {
var calendarEl = document.getElementById('calendar');
var options = JSON.parse(document.getElementById('calendar_options').textContent);
//modal is written in the page, only its content changes
var $modal = $('#calendar_event');
var $edit = $modal.find('[data-action="edit"]');
var $booking = $modal.find('[data-action="booking"]');

var calendar = new Calendar(calendarEl, {
plugins: [ themePlugin, interactionPlugin, dayGridPlugin, listPlugin ],
views: _fullcalendar_views,
buttons: options.buttons,
headerToolbar: {
left: 'title',
right: 'dayGridMonth,listDay,listWeek,listMonth prevYear,prev,today,next,nextYear'
},
height: 'auto',
locales: allLocales,
locale: _fullcalendar_locale,
locale: options.locale,
weekNumbers: true,
events: _calendar_dataurl,
events: options.dataurl,
selectable: true,
eventClick: function(info) {
var _infos = JSON.parse(JSON.stringify(info.event.extendedProps));
_infos.url = _calendar_event_url.replace('PLACEBO', _infos.id_event);
_infos.booking = _calendar_booking_url.replace('PLACEBO', _infos.id_event);
var _actions = [];
if (_infos.can_edit) {
_actions.push(_edit_action);
}
_actions.push(Object.assign({}, _booking_action, {
click: function() {
window.location.href = _infos.booking;
}
}));
_actions.push(_close_action);
var infos = info.event.extendedProps;
//description is built and escaped server side, other values must be displayed as text
var _elt = $('<div class="ui tiny modal"><div class="header"></div><div class="content"></div></div>');
_elt.find('.header').text(_infos.name + ' (' + _infos.begin_date_fmt + ' - ' + _infos.end_date_fmt + ')');
_elt.find('.content').html(_infos.description);
_elt.appendTo('body');
_elt.modal({
onApprove: function() {
window.location.href = _infos.url;
},
actions: _actions
}).modal('show');
$modal.find('.header').text(infos.name + ' (' + infos.begin_date_fmt + ' - ' + infos.end_date_fmt + ')');
$modal.find('.content').html(infos.description);
//links are given with the event, edit one only when current user can edit it
$edit
.attr('href', infos.edit_url || '#')
.toggleClass('displaynone', !infos.edit_url);
$booking.attr('href', infos.booking_url);
$modal.modal('show');
},
eventMouseEnter: function(info) {
var _el = $(info.el);
_el.popup({
$(info.el).popup({
exclusive: true,
hoverable: true,
variation: 'basic',
Expand All @@ -70,4 +60,3 @@ $(function() {

calendar.render();
});

Binary file modified lang/de_DE.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/de_DE/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/en_US/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/es.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/es/LC_MESSAGES/events.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion lang/events.pot
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
2 changes: 1 addition & 1 deletion lang/events_ar.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
2 changes: 1 addition & 1 deletion lang/events_br.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
2 changes: 1 addition & 1 deletion lang/events_ca.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ msgstr "No pagat"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
4 changes: 2 additions & 2 deletions lang/events_de_DE.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ msgstr "Nicht bezahlt"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Gesamtzahl der gefundenen Buchungen: %f"
msgid "Found bookings total %1$s"
msgstr "Gesamtzahl der gefundenen Buchungen: %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ msgstr "Not paid"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr "Found bookings total %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_es.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ msgstr "No pagado"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Se encontraron un total de %f reservas"
msgid "Found bookings total %1$s"
msgstr "Se encontraron un total de %1$s reservas"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_fr_FR.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ msgstr "Non payée"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Total des réservations trouvées : %f"
msgid "Found bookings total %1$s"
msgstr "Total des réservations trouvées : %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_it_IT.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ msgstr "Non pagato"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Totale prenotazioni trovate %f"
msgid "Found bookings total %1$s"
msgstr "Totale prenotazioni trovate %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
2 changes: 1 addition & 1 deletion lang/events_nb_NO.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
2 changes: 1 addition & 1 deletion lang/events_oc.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
2 changes: 1 addition & 1 deletion lang/events_ota.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
4 changes: 2 additions & 2 deletions lang/events_pt.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ msgstr "Não pago"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Reservas encontradas totalizam %f"
msgid "Found bookings total %1$s"
msgstr "Reservas encontradas totalizam %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_pt_BR.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ msgstr "Não pago"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Reservas encontradas totalizam %f"
msgid "Found bookings total %1$s"
msgstr "Reservas encontradas totalizam %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_ru.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ msgstr "Не оплачено"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Всего найдено броней %f"
msgid "Found bookings total %1$s"
msgstr "Всего найдено броней %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
2 changes: 1 addition & 1 deletion lang/events_si.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
4 changes: 2 additions & 2 deletions lang/events_sl.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ msgstr "Ni plačano"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Skupaj najdenih rezervacij %f"
msgid "Found bookings total %1$s"
msgstr "Skupaj najdenih rezervacij %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
4 changes: 2 additions & 2 deletions lang/events_ta.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ msgstr "செலுத்தப்படவில்லை"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "முன்பதிவு மொத்தம் %f"
msgid "Found bookings total %1$s"
msgstr "முன்பதிவு மொத்தம் %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
2 changes: 1 addition & 1 deletion lang/events_tr.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ msgstr ""

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgid "Found bookings total %1$s"
msgstr ""

#: ../templates/default/bookings.html.twig:192
Expand Down
4 changes: 2 additions & 2 deletions lang/events_uk.utf8.po
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ msgstr "Не оплачено"

#: ../templates/default/bookings.html.twig:147
#, php-format
msgid "Found bookings total %f"
msgstr "Загалом бронювань знайдено: %f"
msgid "Found bookings total %1$s"
msgstr "Загалом бронювань знайдено: %1$s"

#: ../templates/default/bookings.html.twig:192
msgid "Edit booking"
Expand Down
Binary file modified lang/fr_FR.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/fr_FR/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/it_IT.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/it_IT/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/pt.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/pt/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/pt_BR.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/pt_BR/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/ru.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/ru/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/sl.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/sl/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/ta.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/ta/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/uk.utf8/LC_MESSAGES/events.mo
Binary file not shown.
Binary file modified lang/uk/LC_MESSAGES/events.mo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public function edit(Request $request, Response $response, ?int $id = null, stri
$response,
$this->getTemplate('activity'),
[
'autocomplete' => true,
'page_title' => $title,
'activity' => $activity,
// pseudo random int
Expand Down
2 changes: 0 additions & 2 deletions lib/GaletteEvents/Controllers/Crud/BookingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ public function edit(Request $request, Response $response, ?int $id = null, stri
'filters' => $m->getFilters(),
'count' => $m->getCount()
];
$route_params['autocomplete'] = true;

//check if current attached member is part of the list
if (
Expand All @@ -412,7 +411,6 @@ public function edit(Request $request, Response $response, ?int $id = null, stri
array_merge(
$route_params,
[
'autocomplete' => true,
'page_title' => $title,
'booking' => $booking,
'events' => $events->getList(true),
Expand Down
17 changes: 15 additions & 2 deletions lib/GaletteEvents/Controllers/Crud/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace GaletteEvents\Controllers\Crud;

use ArrayObject;
use Galette\Repository\Groups;
use Galette\Core\Pagination;
use GaletteEvents\Filters\EventsList;
Expand Down Expand Up @@ -168,8 +169,21 @@ public function ajaxCalendar(Request $request, Response $response): Response
$filters->end_date_filter = date(__("Y-m-d"), $end);

$events = new Events($this->zdb, $this->login, $this->history, $this->preferences, $filters);
$list = $events->getList(false, true);

return $this->withJson($response, $events->getList(false, true));
//links of the event modal
foreach ($list as $row) {
if (!$row instanceof ArrayObject) {
continue;
}
$id = (string)$row[Event::PK];
if ($row['can_edit']) {
$row['edit_url'] = $this->routeparser->urlFor('events_event_edit', ['id' => $id]);
}
$row['booking_url'] = $this->routeparser->urlFor('events_booking_add') . '?event=' . $id;
}

return $this->withJson($response, $list);
}

// /CRUD - Read
Expand Down Expand Up @@ -223,7 +237,6 @@ public function edit(Request $request, Response $response, ?int $id = null, stri
$response,
$this->getTemplate('event'),
[
'autocomplete' => true,
'page_title' => $title,
'event' => $event,
'require_calendar' => true,
Expand Down
2 changes: 1 addition & 1 deletion templates/default/activities.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<td class="collapsing" data-col-label="{{ _T("Creation date", "events") }}">{{ activity.getCreationDate()|date(_T("Y-m-d")) }}</td>
<td class="collapsing" data-col-label="{{ _T("Events", "events") }}">{{ activity.countEvents() }}</td>
<td class="center id_row collapsing" data-col-label="{{ _T("Is active", "events") }}">
<i class="toggle {% if activity.isActive() %}on{% else %}off{% endif %} icon tooltip" data-html="{% if activity.isActive() %}{{ _T("Active", "events") }}{% else %}{{ _T("Inactive", "events") }}{% endif %}"></i>
<i class="toggle {% if activity.isActive() %}on{% else %}off{% endif %} icon tooltip" data-html="{% if activity.isActive() %}{{ _T("Active", "events") }}{% else %}{{ _T("Inactive", "events") }}{% endif %}" aria-hidden="true"></i>
<span class="visually-hidden">
{% if activity.isActive() %}
{{ _T("Active", "events") }}
Expand Down
Loading
Loading