Copy Calendar module

Discuss about Group-Office development here

Moderator: Developers

peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Copy Calendar module

Postby peguru » Mon Jun 20, 2016 7:18 am

I have tried to copy calendar module. It works almost but there is some strange behaviour. I have replaced "calendar" to "shiftplanning" like this

Calendar.js

Code: Select all

GO.shiftplanning.extraToolbarItems = [];

GO.moduleManager.addModule('shiftplanning', GO.shiftplanning.MainPanel, {
   title : 'Työvuorosuunnittelu',
   iconCls : 'go-tab-icon-calendar'
});


I have modified all .js files - searched for "calendar" and replaced those with "shiftplanning"

But when I click Shiftplanning module and right after that I click original Calendar module, my shiftplanning event shows up in Calendar even it is not in calendar database, it is only in "sp_events" table.

If I reload Group-office before clicking original Calendar, it works. Also, if I remove original calendar module folder off from modules/ directory, it works perfectly.

Any help would be appreciated!
fischli
Posts: 36
Joined: Tue Apr 22, 2014 10:06 am

Re: Copy Calendar module

Postby fischli » Mon Jun 20, 2016 11:22 am

You also did a refactoring on 'module/calendar/scripts.txt' ?
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Mon Jun 20, 2016 12:37 pm

fischli wrote:You also did a refactoring on 'module/calendar/scripts.txt' ?

Yes. Also, sometimes when I open the cloned module or even original module, a month view is empty (white). If it does like that, then pressing F5 fix the problem.
mschering
Site Admin
Site Admin
Posts: 8154
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Copy Calendar module

Postby mschering » Thu Jun 23, 2016 7:32 am

Sorry, I can't determine what's going on without looking at the code. We could offer a code review.
Best regards,

Merijn Schering
Intermesh
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Thu Jul 07, 2016 6:00 am

mschering wrote:Sorry, I can't determine what's going on without looking at the code. We could offer a code review.

Could you tell me more about this
mcharvat
Posts: 59
Joined: Thu Jul 03, 2014 10:36 pm
Contact:

Re: Copy Calendar module

Postby mcharvat » Fri Jul 29, 2016 12:25 pm

The problem will be with unique ids. When you have a look at Calendar.js, months grid, viewGrid etc got id property which should be removed or renamed (up to you). GO is single page app so all ids should be unique
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Sat Jul 30, 2016 8:11 am

mcharvat wrote:The problem will be with unique ids. When you have a look at Calendar.js, months grid, viewGrid etc got id property which should be removed or renamed (up to you). GO is single page app so all ids should be unique

Thanks for the answer. That helped a lot. But there is still some problems: if I move from shiftplanning module to calendar, at least month view is empty (no entries). If I reload GO by pressing F5, they show up..

If I take a look at Firebug console, the entry is there but it just not show up..
mcharvat
Posts: 59
Joined: Thu Jul 03, 2014 10:36 pm
Contact:

Re: Copy Calendar module

Postby mcharvat » Sat Jul 30, 2016 10:18 pm

Difficult to say without access to module.
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Sun Jul 31, 2016 2:27 pm

mcharvat wrote:Difficult to say without access to module.

The problem seems to be only in a month view. All other views (one day, work week etc.) works. A list view works best, there has not been nothinglike problems. So could you guess what could be a difference between the month view and the list view?
mcharvat
Posts: 59
Joined: Thu Jul 03, 2014 10:36 pm
Contact:

Re: Copy Calendar module

Postby mcharvat » Sun Jul 31, 2016 11:20 pm

Maybe another problem with ids? Can only guess
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Fri Aug 05, 2016 4:38 pm

When I try to delete an event in a month view by right-clicking the event, I get following error
https://www.dropbox.com/s/bpizlsk576uknv7/console.png?dl=0
Any suggestions what could cause this? I think that this has something to do with the problem I mentioned earlier.

EDIT: This is solved now. In my previous version, the delete works so I have to check which of my code updates causes this.

But the earlier mentioned problem still exists. I'll take a closer look to firebug warnings.
peguru
Posts: 12
Joined: Mon Jan 04, 2016 1:42 pm

Re: Copy Calendar module

Postby peguru » Mon Aug 08, 2016 11:50 am

peguru wrote:
mschering wrote:Sorry, I can't determine what's going on without looking at the code. We could offer a code review.

Could you tell me more about this

Still waiting an answer to this, seems to be hard to fix

Return to “Development Chats”

Who is online

Users browsing this forum: No registered users and 2 guests

cron