Saturday and sunday sould be working day

If you need support with TeamCal Pro (installation, configuration, usage) post your request here.
Post Reply
Montona
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 2012-03-23, 10:48
Are you a spam bot?: No

Saturday and sunday sould be working day

Post by Montona » 2012-03-23, 15:33

Hello from Germany,

is there a way to declare saturday and sunday as working days?

Many thanks in Advance

Montona

User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 420
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Saturday and sunday sould be working day

Post by George » 2012-03-23, 22:26

Hi Montona,
unfortunately that is not possible in the current release.
Best regards,
George

Montona
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 2012-03-23, 10:48
Are you a spam bot?: No

Re: Saturday and sunday should be working day

Post by Montona » 2012-04-03, 08:52

If someone else wants to do the same, here is the solution:

On file /includes/functions.tcpro.php, ~line 1143 search this:

Code: Select all

   $template = "";
   for ($i = 1; $i <= $nofdays; $i++) {
      switch ($dayofweek) {
         case 1 : // Monday
            $template .= $busisym;
            break;
         case 2 : // Tuesday
            $template .= $busisym;
            break;
         case 3 : // Wednesday
            $template .= $busisym;
            break;
         case 4 : // Thursday
            $template .= $busisym;
            break;
         case 5 : // Friday
            $template .= $busisym;
            break;
         case 6 : // Saturday
            $template .= $wendsym;
            break;
         case 7 : // Sunday
            $template .= $wendsym;
            break;
         default :
            $template .= $busisym;
            break;
and replace the variable at Saturday and Sunday (case 6 and case 7) from "$wendsym" to "$busisym":

Code: Select all

   $template = "";
   for ($i = 1; $i <= $nofdays; $i++) {
      switch ($dayofweek) {
         case 1 : // Monday
            $template .= $busisym;
            break;
         case 2 : // Tuesday
            $template .= $busisym;
            break;
         case 3 : // Wednesday
            $template .= $busisym;
            break;
         case 4 : // Thursday
            $template .= $busisym;
            break;
         case 5 : // Friday
            $template .= $busisym;
            break;
         case 6 : // Saturday
            $template .= $busisym;
            break;
         case 7 : // Sunday
            $template .= $busisym;
            break;
         default :
            $template .= $busisym;
            break;
On file /editmonth.php ~line 105 search this:

Code: Select all

      $template = "";
      $dayofweek = intval($weekday1);
      for ($i = 1; $i <= $nofdays; $i++) {
         switch ($dayofweek) {
            case 1 :
               $template .= '0';
               break;
            case 2 :
               $template .= '0';
               break;
            case 3 :
               $template .= '0';
               break;
            case 4 :
               $template .= '0';
               break;
            case 5 :
               $template .= '0';
               break;
            case 6 :
               $template .= '1';
               break;
            case 7 :
               $template .= '1';
               break;
         }
         $dayofweek += 1;
         if ($dayofweek == 8) {
            $dayofweek = 1;


and replace at case 6 and case 7 the number "1" to "0".

Code: Select all

      $template = "";
      $dayofweek = intval($weekday1);
      for ($i = 1; $i <= $nofdays; $i++) {
         switch ($dayofweek) {
            case 1 :
               $template .= '0';
               break;
            case 2 :
               $template .= '0';
               break;
            case 3 :
               $template .= '0';
               break;
            case 4 :
               $template .= '0';
               break;
            case 5 :
               $template .= '0';
               break;
            case 6 :
               $template .= '0';
               break;
            case 7 :
               $template .= '0';
               break;
         }
         $dayofweek += 1;
         if ($dayofweek == 8) {
            $dayofweek = 1;



Do the same at ~ line 169 (same file).

Code: Select all

      $template = "";
      $dayofweek = intval($weekday1);
      for ($i = 1; $i <= $nofdays; $i++) {
         switch ($dayofweek) {
            case 1 :
               $template .= '0';
               break;
            case 2 :
               $template .= '0';
               break;
            case 3 :
               $template .= '0';
               break;
            case 4 :
               $template .= '0';
               break;
            case 5 :
               $template .= '0';
               break;
            case 6 :
               $template .= '0';
               break;
            case 7 :
               $template .= '0';
               break;
         }
         $dayofweek += 1;
         if ($dayofweek == 8) {
            $dayofweek = 1;




After this empty the table (dont drop it) with the name "my_tc_months".

TC will fill this table again after first access.

Please let me know if you have some doubts or problems with this solution.

Heart1010
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 2012-05-07, 16:38
Are you a spam bot?: No

Re: Saturday and sunday sould be working day

Post by Heart1010 » 2012-05-08, 13:36

Thanks Montona for your explanations :!:

User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 420
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Saturday and sunday sould be working day

Post by George » 2012-05-12, 13:15

Hi guys,
the new release 3.3.010 now offers to configure Saturday and/or Sunday to be displayed as business days.
Best regards,
George

Post Reply