Page 1 of 1

Date range only business days

Posted: 2012-11-07, 06:43
by mark_burge@hotmail.com
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);
      }
   }
}

Re: Date range only business days

Posted: 2012-11-16, 07:16
by George
Hi Mark,
thanks for the mod. Can you describe what it does in more detail?
Best regards,
George

Re: Date range only business days

Posted: 2012-11-16, 22:38
by mark_burge@hotmail.com
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.

Re: Date range only business days

Posted: 2012-11-17, 09:48
by George
Thanks for the mod. It's a godd idea for an option...

Re: Date range only business days

Posted: 2012-11-20, 11:36
by Franz
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

Re: Date range only business days

Posted: 2012-11-20, 18:17
by George
Hi Franz
thanks for your contribution to this area! A great list of addl. features.
Best regards,
George

Re: Date range only business days

Posted: 2012-11-26, 18:43
by George
Implemented in 3.4.002