1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

Merge branch 'dev' for release 6.3.27

This commit is contained in:
Du Peng 2024-06-12 17:47:47 +02:00
commit 9e5ebfe7c7
8 changed files with 78 additions and 14 deletions

View File

@ -2,6 +2,11 @@
## Next release
## v6.3.27 2024 June 12
- Fix a bug: unable to show gender wowan in member export
- Add a new feature: add a new button to automatically refresh the public calendar
## v6.3.26 2024 June 5
- improvement: add uid_attribute for saml provider

View File

@ -16,8 +16,8 @@
* Controller used in the public calendar global
*/
Application.Controllers.controller('CalendarController', ['$scope', '$state', '$aside', '$uibModal', 'moment', 'Availability', 'Setting', 'growl', 'dialogs', 'bookingWindowStart', 'bookingWindowEnd', '_t', 'uiCalendarConfig', 'CalendarConfig', 'trainingsPromise', 'machinesPromise', 'spacesPromise', 'iCalendarPromise', 'machineCategoriesPromise',
function ($scope, $state, $aside, $uibModal, moment, Availability, Setting, growl, dialogs, bookingWindowStart, bookingWindowEnd, _t, uiCalendarConfig, CalendarConfig, trainingsPromise, machinesPromise, spacesPromise, iCalendarPromise, machineCategoriesPromise) {
Application.Controllers.controller('CalendarController', ['$scope', '$state', '$aside', '$uibModal', 'moment', 'Availability', 'Setting', 'growl', 'dialogs', 'bookingWindowStart', 'bookingWindowEnd', '_t', 'uiCalendarConfig', 'CalendarConfig', 'trainingsPromise', 'machinesPromise', 'spacesPromise', 'iCalendarPromise', 'machineCategoriesPromise', '$interval',
function ($scope, $state, $aside, $uibModal, moment, Availability, Setting, growl, dialogs, bookingWindowStart, bookingWindowEnd, _t, uiCalendarConfig, CalendarConfig, trainingsPromise, machinesPromise, spacesPromise, iCalendarPromise, machineCategoriesPromise, $interval) {
/* PRIVATE STATIC CONSTANTS */
let currentMachineEvent = null;
machinesPromise.forEach(m => m.checked = true);
@ -27,6 +27,8 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
// check all formation/machine is select in filter
const isSelectAll = (type, scope) => scope[type].length === scope[type].filter(t => t.checked).length;
let stopRedirectPage = false;
/* PUBLIC SCOPE */
// List of trainings
@ -190,6 +192,46 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
}]
});
$scope.triggerOnlyCalendarViewMode = function () {
const header = document.getElementById('top-header');
const nav = document.getElementById('nav');
const calendarBackButton = document.getElementById('calendar-back-button');
const mainContent = $('.vbox > header.header-md ~ section');
if (!header || !nav || !calendarBackButton || !mainContent) { return; }
if (header.style.display === 'none') {
header.style.display = '';
nav.style.display = '';
calendarBackButton.style.display = '';
mainContent.css('top', '');
} else {
header.style.display = 'none';
nav.style.display = 'none';
calendarBackButton.style.display = 'none';
mainContent.css('top', '0');
}
};
// refresh calendar every 5 minutes
$scope.triggerAutoRefresh = function () {
if ($scope.autoRefresh) {
$interval.cancel($scope.autoRefresh);
$scope.autoRefresh = undefined;
stopRedirectPage = false;
} else {
// refresh calendar every 1 minute
$scope.autoRefresh = $interval(refreshCalendar, 60000);
stopRedirectPage = true;
}
};
$scope.$on('$destroy', function () {
if ($scope.autoRefresh) {
$interval.cancel($scope.autoRefresh);
$scope.autoRefresh = undefined;
stopRedirectPage = false;
}
});
/* PRIVATE SCOPE */
/**
@ -257,13 +299,13 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
} else if (event.available_type === 'space') {
calendar.fullCalendar('changeView', 'agendaDay');
calendar.fullCalendar('gotoDate', event.start);
} else if (event.available_type === 'event') {
} else if (event.available_type === 'event' && !stopRedirectPage) {
$state.go('app.public.events_show', { id: event.event_id });
} else if (event.available_type === 'training') {
} else if (event.available_type === 'training' && !stopRedirectPage) {
$state.go('app.public.training_show', { id: event.training_id });
} else {
if (event.machine_ids) {
if (event.machine_ids.length === 1) {
if (event.machine_ids.length === 1 && !stopRedirectPage) {
$state.go('app.public.machines_show', { id: event.machine_ids[0] });
} else {
// open a modal to ask the user to select the machine to show
@ -350,6 +392,12 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
const availabilitySourceUrl = () => `/api/availabilities/public?${$.param(getFilter())}`;
const refreshCalendar = function () {
uiCalendarConfig.calendars.calendar.fullCalendar('changeView', 'agendaWeek');
uiCalendarConfig.calendars.calendar.fullCalendar('today');
uiCalendarConfig.calendars.calendar.fullCalendar('refetchEvents');
};
// !!! MUST BE CALLED AT THE END of the controller
return initialize();
}

View File

@ -124,6 +124,11 @@
height: 94px;
text-align: center;
}
.public-calendar-heading-actions {
display: flex;
justify-content: right;
}
}
body.container {

View File

@ -1,21 +1,27 @@
<section class="heading b-b">
<div class="row no-gutter">
<div class="col-xs-2 col-sm-2 col-md-1">
<div class="col-xs-2 col-sm-2 col-md-1" id="calendar-back-button">
<section class="heading-btn">
<a ng-click="backPrevLocation($event)"><i class="fas fa-long-arrow-alt-left "></i></a>
</section>
</div>
<div class="col-xs-10 col-sm-10 col-md-8 b-l b-r-md hide-b-r-lg">
<div class="col-xs-10 col-sm-10 col-md-3 b-l b-r-md hide-b-r-lg">
<section class="heading-title">
<h1 translate>{{ 'app.public.calendar.calendar' }}</h1>
</section>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 b-t hide-b-md">
<div class="heading-actions wrapper">
<button type="button" class="btn btn-default m-t m-b" ng-click="openFilterAside()">
<div class="col-xs-12 col-sm-12 col-md-8 b-t hide-b-md">
<div class="heading-actions wrapper public-calendar-heading-actions">
<button type="button" class="btn btn-default m-t m-b m-r-sm" ng-click="openFilterAside()">
<span class="fa fa-filter"></span> {{ 'app.shared.calendar.filter_calendar' | translate }}
</button>
<button type="button" class="btn btn-default m-t m-b m-r-sm" ng-click="triggerAutoRefresh()">
<span class="fas fa-redo"></span>
</button>
<button type="button" class="btn btn-default m-t m-b" ng-click="triggerOnlyCalendarViewMode()">
<span class="fas fa-expand"></span>
</button>
</div>
</div>

View File

@ -31,7 +31,7 @@ module ExcelHelper
user&.profile&.full_name || t('export.deleted_user'),
user&.email || '',
user&.profile&.phone || '',
hit['_source']['gender'].present? ? t("export.#{hit['_source']['gender']}") : '',
hit['_source']['gender'].nil? ? t("export.#{hit['_source']['gender']}") : '',
hit['_source']['age'],
subtype.nil? ? '' : subtype.label
]

View File

@ -106,7 +106,7 @@
<section class="vbox">
<header class="header header-md navbar navbar-fixed-top-xs">
<header id="top-header" class="header header-md navbar navbar-fixed-top-xs">
<div ui-view="header"></div>
</header>

View File

@ -51,7 +51,7 @@ wb.add_worksheet(name: ExcelService.name_safe(t('export_members.members'))) do |
member.email,
member.is_allow_newsletter,
member.last_sign_in_at&.to_date,
member.statistic_profile.gender.present? ? (member.statistic_profile.gender ? t('export_members.man') : t('export_members.woman')) : '',
member.statistic_profile.gender.nil? ? (member.statistic_profile.gender ? t('export_members.man') : t('export_members.woman')) : '',
member.statistic_profile.age,
member.invoicing_profile&.address&.address || '',
member.profile.phone,

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "6.3.26",
"version": "6.3.27",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",