SuiteCRM
SuiteCRM copied to clipboard
Add options in Calendar: event limit and week numbers
Description
In our calendar, an unreasonably low limit (1!) of entries were allowed to be shown in each day, in Month view. This causes the calendar to be really hard to use. As soon as a second event was scheduled in a day, none of the actual events show, and only "+2 more" would be shown.
I believe this was probably just caused by a misunderstanding of how to use the fullCalendar
parameter eventLimit
.
This fix simply introduces a more reasonable limit, 6.
The downside is that the calendar will use variable row heights and that doesn't make it look very neat. But only a better fullcalendar package could solve this. And it's not a very fancy looking calendar anyway, so I believe (from experience) that having a minimum of visibility into what your Calendar actually contains is preferable to any alignment quirk.
How To Test This
- Make the change, rebuild JS
- add a good number of events on the same day, checking how the Month view looks like as you add appointments
- when the number of events hits the limit, a "+2 more" tag starts showing.
Types of changes
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Final checklist
- [X] My code follows the code style of this project found here.
- [ ] My change requires a change to the documentation.
- [X] I have read the How to Contribute guidelines.
Codecov Report
Merging #8440 into hotfix-7.10.x will decrease coverage by
<.01%
. The diff coverage is0%
.
@@ Coverage Diff @@
## hotfix-7.10.x #8440 +/- ##
=================================================
- Coverage 10.6% 10.59% -0.01%
=================================================
Files 3229 3229
Lines 240073 240179 +106
=================================================
+ Hits 25449 25455 +6
- Misses 214624 214724 +100
Can't tell if I'm being a dafty here @pgorod. Pulling this down puts me 20 commits ahead of this hotfix-7.10.x ?? however, the fix does appear to work as expected :+1:
@Mac-Rae I'm not sure what could be going on, but a possibility is that after the Rebuild JS process you committed changes?
Other than that, the only problem I could see is if you started from the wrong branch, or from an out-of-sync-with-latest branch...
Maybe so, there are only 2 commits on this PR so it should be alright
@samus-aran related requests:
-
user wants to be able to turn on week numbers: https://community.suitecrm.com/t/week-numbers-in-date-picker-and-calendar/70784
-
another user wants to be able to turn off dragging and resizing: https://community.suitecrm.com/t/calendar-drag-drop-disable-config-not-working/70713
Both these things have fullcalendar
options available, they're just not configurable inside SuiteCRM.
Adding this for now as I believe it is. Could @samus-aran please confirm :slightly_smiling_face:
Updated PR to make settings available from the UI:
- monthly view events per day
- show week numbers
These settings' defaults can also be overridden system-wide in config_override.php
. Users can still adjust their own preferences after that. Examples:
$sugar_config['calendar']['event_limit'] = 3;
$sugar_config['calendar']['show_week_numbers'] = 1;
(The "work in progress" label can be removed)
@horus68 this PR includes language changes.
I could have called one of the labels LBL_ALL
, containing the string All
, but I decided to make the string unique so translators can check where it comes from. Did I do well?
Here is an overview of what got changed by this pull request:
Issues
======
- Added 2
Complexity increasing per file
==============================
- modules/Calendar/Calendar.php 2
See the complete overview on Codacy
This pull request has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/adding-projects-and-projecttask-to-calendar/92592/2