Date range only business days

If you have coded modifications, additions or language files for TeamCal Pro share it with others here.
Post Reply
mark_burge@hotmail.com
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 2011-09-30, 09:49

Date range only business days

Post by mark_burge@hotmail.com » 2012-11-07, 06:43

from editcalendar.php

Code: Select all

if ( $yearfrom!=$Year || $monthfrom!=$monthno || $yearto!=$Year || $monthto!=$monthno ) {
   echo "<script type=\"text/javascript\">alert(\"".$LANG['cal_range_within']."\");</script>";
}
else if ( $_POST['rangefrom']>$_POST['rangeto']) {
   echo "<script type=\"text/javascript\">alert(\"".$LANG['cal_range_start']."\");</script>";
}
else {
   for ($i=intval($dayfrom);$i<=intval($dayto);$i++) {
      $iweekday = date("l", mktime(0, 0, 0, $monthno, $i, $Year));
      if ($C->readConfig("satBusi")) {
         if ($iweekday != "Sunday") {
            $absarray[]=$_POST['rangeabs'].sprintf("%02d",$i);
         }
      }
      else if ($C->readConfig("sunBusi")) {
         if ($iweekday != "Saturday") {
            $absarray[]=$_POST['rangeabs'].sprintf("%02d",$i);
         }
      }
      else if (($iweekday != "Sunday") && ($iweekday != "Saturday")) {
         //$_POST['rangeabs'] = notaworkday
         //each date day in rage = 04, 05 etc
         // = notaworkday04
         $absarray[]=$_POST['rangeabs'].sprintf("%02d",$i);
      }
   }
}
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 389
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Date range only business days

Post by George » 2012-11-16, 07:16

Hi Mark,
thanks for the mod. Can you describe what it does in more detail?
Best regards,
George
mark_burge@hotmail.com
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 2011-09-30, 09:49

Re: Date range only business days

Post by mark_burge@hotmail.com » 2012-11-16, 22:38

When you enter an absense using the date range, it now only adds symbols on the working days, where previously it just did every day in the range.
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 389
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Date range only business days

Post by George » 2012-11-17, 09:48

Thanks for the mod. It's a godd idea for an option...
Franz
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 2012-04-05, 16:34
Are you a spam bot?: No
Location: Dresden
Contact:

Re: Date range only business days

Post by Franz » 2012-11-20, 11:36

Hi,

i would like to throw our modified editcalendar into the discussion. Hopefully everything is in the zip file. ;)

It also covers the only assign on workdays use case. But also
- only weekends, mondays, fridays and wednesdays, whatever ;)
- every day or only weekdays or .., but not on days marked as holidays
- all those things above but not in the first week (start, end date of changes)
- do all desired changes (eg. homeoffice on mondays, training every wednesday) and submit afterwards (due to javascript implementation)

There are also other changes in this files!
Regarding the here discussed feature i can remember this changes:
- adding some java code to incl/js/tcpro.js
- reworking html in editcalendar.php
- removing php code from editcalendar that handles things that are now in javascript
- adding some translations for html form (btn_preview)
Greetz,
Franz

edit: PS: the files are based on 3.3.010
Attachments
trunk.zip
(51.12 KiB) Downloaded 140 times
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 389
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Date range only business days

Post by George » 2012-11-20, 18:17

Hi Franz
thanks for your contribution to this area! A great list of addl. features.
Best regards,
George
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 389
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Date range only business days

Post by George » 2012-11-26, 18:43

Implemented in 3.4.002
Post Reply