View unanswered posts | View active topics It is currently Sun May 28, 2017 9:22 pm



This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
 Prevent moving Recurrence activities 
Author Message

Joined: Wed Jan 19, 2011 2:35 pm
Posts: 11
Post Prevent moving Recurrence activities
Hi

I managed to stop moving ordinary activities to prevent overlap with another ordinary. i achieve it with:
Code:
        dateAreaPane.addActivityMoveListener(new ActivityMoveListener()
        {
            public void activityMoved(ActivityMoveEvent e)
            {
            Activity movingActivity = e.getActivity()
             MutableDateRange newDataRange = e.getNewRange();
            ActivityList actList = ActivityDepository.getInstance(depositoryKey).getActivities();

            actList.removeActivityById(movingActivity.getID());
           // če se nov range že prekriva s katerim v listi, ne dovoliu premika
           if (actList.isTimeSpanInListOverlapping(newDataRange))
          {
            newDataRange.setToRange(movingActivity.getBaseDateRange());
          }



but i cannot manage to stop moving recurrence activities when overlap with another ordinary activities occurred.
Code:
        dateAreaPane.addActivityMoveListener(new ActivityMoveListener()
        {
            public void activityMoved(ActivityMoveEvent e)
            {
            Activity movingActivity = e.getActivity()
             MutableDateRange newDataRange = e.getNewRange();
             List<Activity> activities = ActivityDepository.getInstance(depositoryKey).getBrokedActivities();

          for (Activity activity : activities)
          {
              if (activity != movingActivity)
              {
                   RecurrenceRule recurrence = (RecurrenceRule) movingActivity.getRecurrence();
                          List<DateRange> recurrenceRanges = recurrence.getDateRanges(movingActivity.getBaseDateRange(), getReccurancePeriod(), true);
                         
                           for (DateRange recurrenceRange : recurrenceRanges)
                          {
                               if (recurrenceRange.isOverlapping(activity.getBaseDateRange()))
                               {
                                   newDataRange.setToRange(movingActivity.getBaseDateRange());
                               }
                          }
               }



the result is that recurrence activity stoped moving when overlap with some other activity occurred but it seems that happened to late. I don't know what could be wrong or what i'm i doing wrong. Is there some other way of doing that.

Result is in attachment, after that you canot move recurrence activity further down but overlap is already occured, so it to late.

Thanks for help


Attachments:
overlapReccurence.jpeg
overlapReccurence.jpeg [ 31.96 KiB | Viewed 12246 times ]
Tue Feb 01, 2011 2:33 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Prevent moving Recurrence activities
Hello,

As I mentioned in your previous post we use a support ticket system. Please use that one. You can access it from our site.

Thanks,


Tue Feb 01, 2011 10:08 pm
Profile WWW

Joined: Wed Jan 19, 2011 2:35 pm
Posts: 11
Post Re: Prevent moving Recurrence activities
ok just one question about that, if you dont have support contract or it expired you wont help in support ticket system is this correct?


Wed Feb 02, 2011 9:20 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Prevent moving Recurrence activities
You need to have a support contract to get support, but that's now different here or in the ticket system. I was under the impression you had one but I see now that you didn't actually say that.

Thanks,


Wed Feb 02, 2011 8:08 pm
Profile WWW

Joined: Wed Jan 19, 2011 2:35 pm
Posts: 11
Post Re: Prevent moving Recurrence activities
So what if the problem that i found is your bug. Suppose that is your bug i discovered it and must pay to get support for that. That's what i'm afraid of.


Thu Feb 03, 2011 9:20 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Prevent moving Recurrence activities
You can always report bugs in the support ticket system. This isn't a bug though and as I answered in the support tool you have probably made a programming error. Now we have given you support for free which is the reason we want to use the support ticket system.

Thanks,


Thu Feb 03, 2011 10:24 pm
Profile WWW

Joined: Wed Jan 19, 2011 2:35 pm
Posts: 11
Post Re: Prevent moving Recurrence activities
i figured that out by myself yesterday.
Thanks


Fri Feb 04, 2011 11:18 am
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 7 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.