diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 018f073bd..cb0d20fca 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -203,6 +203,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface */ private string $status = self::STATUS_VALID; + /** + * @ORM\Column(type="boolean", nullable=true) + */ + private ?bool $urgent = false; + public function __construct() { $this->comment = new CommentEmbeddable(); diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php index 2974fb875..3c2b54855 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php @@ -85,6 +85,6 @@ final class AgentAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by agent'; + return 'Group calendars by agent'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index a07f052bf..854710a79 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -40,7 +40,7 @@ class CancelReasonAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { - // TODO: still needs to take into account appointments without a cancel reason somehow + // TODO: still needs to take into account calendars without a cancel reason somehow if (!in_array('calcancel', $qb->getAllAliases(), true)) { $qb->join('cal.cancelReason', 'calcancel'); } @@ -88,6 +88,6 @@ class CancelReasonAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by cancel reason'; + return 'Group calendars by cancel reason'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php index 17905cf35..51500f45f 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php @@ -41,7 +41,7 @@ final class JobAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { if (!in_array('caluser', $qb->getAllAliases(), true)) { - $qb->join('cal.user', 'caluser'); + $qb->join('cal.mainUser', 'caluser'); } $qb->addSelect('IDENTITY(caluser.userJob) as job_aggregator'); @@ -87,6 +87,6 @@ final class JobAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by agent job'; + return 'Group calendars by agent job'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php index 236b1b74f..287dccec7 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php @@ -80,6 +80,6 @@ final class LocationAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by location'; + return 'Group calendars by location'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php index c8d02160f..5d7559b2d 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php @@ -87,6 +87,6 @@ final class LocationTypeAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by location type'; + return 'Group calendars by location type'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php index 26329ad13..b4f01db12 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php @@ -55,10 +55,10 @@ class MonthYearAggregator implements AggregatorInterface return 'by month and year'; } - $month = substr($value, 0, 2); - $year = substr($value, 3, 4); + $month = (int)substr($value, 0, 2); + $year = (int)substr($value, 3, 4); - return strftime('%B %G', mktime(0, 0, 0, $month, '1', $year)); + return strftime('%B %G', mktime(0, 0, 0, $month, 1, $year)); }; } @@ -69,6 +69,6 @@ class MonthYearAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by month and year'; + return 'Group calendars by month and year'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php index 7605c3d5d..8d3685f96 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php @@ -41,7 +41,7 @@ final class ScopeAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { if (!in_array('caluser', $qb->getAllAliases(), true)) { - $qb->join('cal.user', 'caluser'); + $qb->join('cal.mainUser', 'caluser'); } $qb->addSelect('IDENTITY(caluser.mainScope) as scope_aggregator'); @@ -87,6 +87,6 @@ final class ScopeAggregator implements AggregatorInterface public function getTitle(): string { - return 'Group appointments by agent scope'; + return 'Group calendars by agent scope'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index edf654a10..9d78d0f26 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -21,7 +21,8 @@ use Closure; use Doctrine\ORM\AbstractQuery; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Process\Exception\LogicException; +use Symfony\Component\Validator\Exception\LogicException; + class CountCalendars implements ExportInterface, GroupedExportInterface { @@ -44,7 +45,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface public function getDescription(): string { - return 'Count appointments by various parameters.'; + return 'Count calendars by various parameters.'; } public function getGroup(): string @@ -78,7 +79,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface public function getTitle(): string { - return 'Count appointments'; + return 'Count calendars'; } public function getType(): string diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index 51e94a288..4649ef571 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -44,7 +44,7 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface public function getDescription(): string { - return 'Get the average of appointment duration according to various filters'; + return 'Get the average of calendar duration according to various filters'; } public function getGroup(): string @@ -78,7 +78,7 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface public function getTitle(): string { - return 'Average appointment duration'; + return 'Average calendar duration'; } public function getType(): string diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index 51591c670..4e2ed6a63 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -44,7 +44,7 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface public function getDescription(): string { - return 'Get the sum of appointment durations according to various filters'; + return 'Get the sum of calendar durations according to various filters'; } public function getGroup(): string @@ -78,7 +78,7 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface public function getTitle(): string { - return 'Sum of appointment durations'; + return 'Sum of calendar durations'; } public function getType(): string diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index fe33c1210..a0b77ece9 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -82,6 +82,6 @@ class AgentFilter implements FilterInterface public function getTitle(): string { - return 'Filter appointments by agent'; + return 'Filter calendars by agent'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index c3aafc192..23e3ac4e6 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -66,7 +66,7 @@ class BetweenDatesFilter implements FilterInterface public function describeAction($data, $format = 'string'): array { - return ['Filtered by appointments between %dateFrom% and %dateTo%', [ + return ['Filtered by calendars between %dateFrom% and %dateTo%', [ '%dateFrom%' => $data['date_from']->format('d-m-Y'), '%dateTo%' => $data['date_to']->format('d-m-Y'), ]]; @@ -74,6 +74,6 @@ class BetweenDatesFilter implements FilterInterface public function getTitle(): string { - return 'Filter appointments between certain dates'; + return 'Filter calendars between certain dates'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index 03cd4857d..d5a70b3da 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -43,7 +43,7 @@ class JobFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { if (!in_array('caluser', $qb->getAllAliases(), true)) { - $qb->join('cal.user', 'caluser'); + $qb->join('cal.mainUser', 'caluser'); } $where = $qb->getDQLPart('where'); @@ -95,6 +95,6 @@ class JobFilter implements FilterInterface public function getTitle(): string { - return 'Filter appointments by agent job'; + return 'Filter calendars by agent job'; } } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index cbd566e9e..9f12cbf19 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -43,7 +43,7 @@ class ScopeFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { if (!in_array('caluser', $qb->getAllAliases(), true)) { - $qb->join('cal.user', 'caluser'); + $qb->join('cal.mainUser', 'caluser'); } $where = $qb->getDQLPart('where'); @@ -95,6 +95,6 @@ class ScopeFilter implements FilterInterface public function getTitle() { - return 'Filter appointments by agent scope'; + return 'Filter calendars by agent scope'; } } diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php new file mode 100644 index 000000000..270c57da4 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php @@ -0,0 +1,33 @@ +addSql('ALTER TABLE chill_calendar.calendar ADD urgent BOOLEAN DEFAULT NULL'); + + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE chill_calendar.calendar DROP urgent'); + + } +} diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml index b8b1e2e56..a10b7d43d 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml @@ -72,8 +72,8 @@ invite: # exports Exports of calendar: Exports des rendez-vous -Count appointments: Nombre de rendez-vous -Count appointments by various parameters.: Compte le nombre de rendez-vous en fonction de différents paramètres. +Count calendars: Nombre de rendez-vous +Count calendars by various parameters.: Compte le nombre de rendez-vous en fonction de différents paramètres. Average appointment duration: Moyenne de la durée des rendez-vous Get the average of appointment duration according to various filters: Calcule la moyenne des durées des rendez-vous en fonction de différents paramètres. @@ -82,21 +82,21 @@ Sum of appointment durations: Somme de la durée des rendez-vous Get the sum of appointment durations according to various filters: Calcule la somme des durées des rendez-vous en fonction de différents paramètres. 'Filtered by agent: only %agents%': "Filtré par agents: uniquement %agents%" -Filter appointments by agent: Filtrer les rendez-vous par agents -Filter appointments by agent job: Filtrer les rendez-vous par métiers des agents +Filter calendars by agent: Filtrer les rendez-vous par agents +Filter calendars by agent job: Filtrer les rendez-vous par métiers des agents 'Filtered by agent job: only %jobs%': 'Filtré par métiers des agents: uniquement les %jobs%' -Filter appointments by agent scope: Filtrer les rendez-vous par services des agents +Filter calendars by agent scope: Filtrer les rendez-vous par services des agents 'Filtered by agent scope: only %scopes%': 'Filtré par services des agents: uniquement les services %scopes%' -Filter appointments between certain dates: Filtrer les rendez-vous par date du rendez-vous -'Filtered by appointments between %dateFrom% and %dateTo%': 'Filtré par rendez-vous entre %dateFrom% et %dateTo%' +Filter calendars between certain dates: Filtrer les rendez-vous par date du rendez-vous +'Filtered by calendars between %dateFrom% and %dateTo%': 'Filtré par rendez-vous entre %dateFrom% et %dateTo%' -Group appointments by agent: Grouper les rendez-vous par agent -Group appointments by agent job: Grouper les rendez-vous par métier de l'agent -Group appointments by agent scope: Grouper les rendez-vous par service de l'agent -Group appointments by location type: Grouper les rendez-vous par type de localisation -Group appointments by location: Grouper les rendez-vous par lieu de rendez-vous -Group appointments by cancel reason: Grouper les rendez-vous par motif d'annulation -Group appointments by month and year: Grouper les rendez-vous par mois et année +Group calendars by agent: Grouper les rendez-vous par agent +Group calendars by agent job: Grouper les rendez-vous par métier de l'agent +Group calendars by agent scope: Grouper les rendez-vous par service de l'agent +Group calendars by location type: Grouper les rendez-vous par type de localisation +Group calendars by location: Grouper les rendez-vous par lieu de rendez-vous +Group calendars by cancel reason: Grouper les rendez-vous par motif d'annulation +Group calendars by month and year: Grouper les rendez-vous par mois et année Scope: Service Job: Métier Location type: Type de localisation