Announcement

Collapse
No announcement yet.

Calendar options to admin section

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calendar options to admin section

    Hello Yuri,

    do you think it's possible to put some setting of calendar to admin section or user preference ?

    PHP Code:
    calendar.js
    line 55

    slotDuration
    30, <-- this value

    line 
    +- 530
    var options = {
    headerfalse,
    custom // hiddenDays: this.getConfig().get('calendarHiddenDays') || [],
    custom // minTime: '08:00:00',
    custom // maxTime: '18:00:00',
    custom //scrollTime: '08:00:00',


    config.php

    'calendarHiddenDays' => [
    => 0,
    => 6
    ], 
    And if it's possible for timeLine too?
    And last (sorry).. maybe a previousDay - nextDay bouton for timeLine on top right ?

    Thanks




    Last edited by item; 05-05-2021, 06:19 PM.

  • #2
    Hello item

    Here's how you can modify some calendar features in an "update safe" way.

    For example, as per your idea, to have the ability to see a full week in timeline display instead of one day only:

    Before:
    Click image for larger version  Name:	Timeline 1.PNG Views:	3 Size:	13.0 KB ID:	70658

    After:
    Click image for larger version  Name:	Timeline 2.PNG Views:	3 Size:	14.5 KB ID:	70659

    Step 1: Create a custom clientDefs for Calendar to specify a custom timeline view:

    custom/Espo/Custom/Resources/metadata/clientDefs/Calendar.json
    Code:
    {
        "timelineView": "custom:views/calendar/timeline"
    }
    Step 2: Clone and modify the timeline view class as follows:

    client/custom/src/views/calendar/timeline.js
    Code:
    // COPY THE CODE FROM client/modules/crm/src/views/calendar/timeline.js AND MODIFY LINE #809 (approx) TO READ:
    // FROM:  this.end.add(1, 'day');
    // TO: this.end.add(1, 'week');
    Step 3: Clear cache and rebuild
    Last edited by telecastg; 05-11-2021, 03:55 PM.

    Comment


    • item
      item commented
      Editing a comment
      Thanks man

    • telecastg
      telecastg commented
      Editing a comment
      You're welcome

  • #3
    I copied all code of the page client/modules/crm/src/views/calendar/timeline.js in client/custom/src/views/calendar/timeline.js but I get an error in console on the row
    "import View from 'view';"


    if I remove all the imports from the file client/custom/src/views/calendar/timeline.js it doesn't work
    import View from 'view';
    import {DataSet} from 'vis-data';
    import {Timeline} from 'vis-timeline';
    import moment from 'moment';
    import $ from 'jquery';​

    Comment


    • telecastg
      telecastg commented
      Editing a comment
      The code above works with Espo 7, not with Espo 8.
Working...
X