hi urgent question about callback calendar ?

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

hi urgent question about callback calendar ?

Postby IPWINDEV » Fri Sep 22, 2023 12:24 pm

hi i want add more month to calendar callbacks more 12 months on agent side.
is there anyone can help me on the javascript code.

for exemple i want do a callback for april 2025 or 2026 how can i do it ?

Image




Code: Select all
################################################################
### BEGIN - build the callback calendar (12 months)          ###
################################################################
define ('ADAY', (60*60*24));
$CdayARY = getdate();
$Cmon = $CdayARY['mon'];
$Cyear = $CdayARY['year'];
$CTODAY = date("Y-m");
$CTODAYmday = date("j");
$CINC=0;
$live_days=0;
$limit_days=999;
if ($callback_days_limit > 0)
   {$limit_days=$callback_days_limit;}
$cb_display_days=999;
if ($callback_display_days > 0)
   {$cb_display_days=$callback_display_days;}

# gather any holidays associated with the Local Call Time that is set for this campaign
$ct_holidays='';
$ct_holiday_dates='|';
$ct_holiday_dateARY=array();
$ct_holiday_nameARY=array();
$stmt = "SELECT ct_holidays FROM vicidial_call_times where call_time_id='$local_call_time';";
$rslt=mysql_to_mysqli($stmt, $link);
   if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01097',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$ct_conf_ct = mysqli_num_rows($rslt);
if ($ct_conf_ct > 0)
   {
   $row=mysqli_fetch_row($rslt);
   $ct_holidays =      $row[0];
   $ct_holidays = preg_replace("/^\||\|$/","','",$ct_holidays);
   $ct_holidays = preg_replace("/\|/","','",$ct_holidays);
   $ct_holidays = "'$ct_holidays'";
   }
if (strlen($ct_holidays) > 2)
   {
   $stmt = "SELECT holiday_date,holiday_name FROM vicidial_call_time_holidays where holiday_id IN($ct_holidays) and holiday_status='ACTIVE';";
   $rslt=mysql_to_mysqli($stmt, $link);
      if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01098',$VD_login,$server_ip,$session_name,$one_mysql_log);}
   $hd_conf_ct = mysqli_num_rows($rslt);
   if ($DB) {echo "$hd_conf_ct|$stmt\n";}
   $hd_ct=0;
   while ($hd_conf_ct > $hd_ct)
      {
      $row=mysqli_fetch_row($rslt);
      $ct_holiday_dates .= "$row[0]|";
      $ct_holiday_dateARY[$hd_ct]=$row[0];
      $ct_holiday_nameARY[$hd_ct]=$row[1];
      $hd_ct++;
      }
   echo "<!-- ACTIVE HOLIDAYS: $ct_holiday_dates -->\n";
   }

$Cmonths = Array('0',_QXZ('January'),_QXZ('February'),_QXZ('March'),_QXZ('April'),_QXZ('May'),_QXZ('June'),_QXZ('July'),_QXZ('August'),_QXZ('September'),_QXZ('October'),_QXZ('November'),_QXZ('December'));
$Cdays = Array(_QXZ('Sun'),_QXZ('Mon'),_QXZ('Tue'),_QXZ('Wed'),_QXZ('Thu'),_QXZ('Fri'),_QXZ('Sat'));

$CCAL_OUT = '';

$CCAL_OUT .= "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">";

while ($CINC < 12)
   {
   if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) )
      {$CCAL_OUT .= "<tr>";}

   $CCAL_OUT .= "<td valign=\"top\">";

   $CYyear = $Cyear;
   $Cmonth=   ($Cmon + $CINC);
   if ($Cmonth > 12)
      {
      $Cmonth = ($Cmonth - 12);
      $CYyear++;
      }
   $Cstart= mktime(11,0,0,$Cmonth,1,$CYyear);
   $CfirstdayARY = getdate($Cstart);
   #echo "|$Cmon|$Cmonth|$CINC|\n";
   $CPRNTDAY = date("Y-m", $Cstart);
   $hDAYcheck = date("Y-m-d", $Cstart);
   $temp_Cmonths = $Cmonths[$CfirstdayARY['mon']];
   $temp_Cfirstday = $CfirstdayARY['year'];
   $future_color='#ffffff';
   $holiday_bg='';

   $CCAL_OUT .= "<table border=\"1\" cellpadding=\"1\" bordercolor=\"000000\" cellspacing=\"0\" bgcolor=\"white\">";
   $CCAL_OUT .= "<tr>";
   $CCAL_OUT .= "<td colspan=\"7\" bordercolor=\"#ffffff\" bgcolor=\"#FFFFCC\">";
   $CCAL_OUT .= "<div align=\"center\"><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">";
   $CCAL_OUT .= _QXZ($temp_Cmonths)." $temp_Cfirstday";
   $CCAL_OUT .= "</font></b></font></div>";
   $CCAL_OUT .= "</td>";
   $CCAL_OUT .= "</tr>";

   foreach($Cdays as $Cday)
      {
      $CDCLR="#ffffff";
      $CCAL_OUT .= "<td bordercolor=\"$CDCLR\" $holiday_bg>";
      $CCAL_OUT .= "<div align=\"center\"><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"1\">";
      $CCAL_OUT .= _QXZ("$Cday", 3);
      $CCAL_OUT .= "</font></b></font></div>";
      $CCAL_OUT .= "</td>";
      }

   for( $Ccount=0;$Ccount<(6*7);$Ccount++)
      {
      $Cdayarray = getdate($Cstart);
      if((($Ccount) % 7) == 0)
         {
         if($Cdayarray['mon'] != $CfirstdayARY['mon'])
            break;
         $CCAL_OUT .= "</tr><tr>";
         }
      if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth)
         {
         $CCAL_OUT .= "<td bordercolor=\"$future_color\" $holiday_bg><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"1\">&nbsp;</font></b></font></td>";
         }
      else
         {
         if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
            {
            $CPRNTmday = $Cdayarray['mday'];
            if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
            if ($limit_days > $live_days)
               {
               $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\"";
               $CBL = "<a href=\"#\" $CB_date_onclick>";
               $CEL = "</a>";
               }
            else
               {$CBL='';   $CEL=''; $CB_date_onclick='';}
            $CCAL_OUT .= "<td bgcolor=\"#FFCCCC\" bordercolor=\"#FFCCCC\" $CB_date_onclick>";
            $CCAL_OUT .= "<div align=\"center\"><font face=\"Arial, Helvetica, sans-serif\" size=\"1\">";
            $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
            $CCAL_OUT .= "</font></div>";
            $CCAL_OUT .= "</td>";
            $Cstart += ADAY;
            $live_days++;
            }
         else
            {
            $holiday_hover='';
            $CDCLR="#ffffff";
            if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
               {
               $CDCLR="$MAIN_COLOR";
               $CBL = '';
               $CEL = '';
               $CB_date_onclick='';
               }
            else
               {
               $CPRNTmday = $Cdayarray['mday'];
               if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
               if (preg_match("/\|$CPRNTDAY-$CPRNTmday\|/",$ct_holiday_dates))
                  {
                  $hd_loop=0;
                  while ($hd_loop < $hd_ct)
                     {
                     if ($ct_holiday_dateARY[$hd_loop] == "$CPRNTDAY-$CPRNTmday")
                        {
                        $holiday_hover="onMouseOver=\"holiday_display('$ct_holiday_nameARY[$hd_loop]');\"; onMouseOut=\"hideDiv('HolidayDisplayDiv');\"";
                        }
                     $CDCLR="#FFCC66";
                     $hd_loop++;
                     }
                  }
               if ($limit_days > $live_days)
                  {
                  $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\"";
                  $CBL = "<a href=\"#\" $CB_date_onclick>";
                  $CEL = "</a>";
                  }
               else
                  {$CBL='';   $CEL=''; $CB_date_onclick='';}
               $live_days++;
               }

            $CCAL_OUT .= "<td bgcolor=\"$CDCLR\" bordercolor=\"$future_color\" $CB_date_onclick $holiday_hover>";
            $CCAL_OUT .= "<div align=\"center\"><font face=\"Arial, Helvetica, sans-serif\" size=1>";
            $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
            $CCAL_OUT .= "</font></div>";
            $CCAL_OUT .= "</td>";
            $Cstart += ADAY;
            }
         }
      }
   $CCAL_OUT .= "</tr>";
   $CCAL_OUT .= "</table>";
   $CCAL_OUT .= "</td>";

   if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) )
      {$CCAL_OUT .= "</tr>";}
   $CINC++;
   }

$CCAL_OUT .= "</table>";

#echo "$CCAL_OUT\n";
################################################################
### END - build the callback calendar (12 months)            ###
################################################################
IPWINDEV
 
Posts: 13
Joined: Sun Apr 05, 2020 6:43 pm

Re: hi urgent question about callback calendar ?

Postby carpenox » Fri Sep 22, 2023 8:02 pm

Technically, there is supposed to be a "year scroller", however I have not seen it. Perhaps this should be submitted to the mantis system as a potential bug. What do you think Matt?
Alma Linux 9.4 | SVN Version: 3889 | DB Schema Version: 1721 | Asterisk 18.21.1 | PHP8
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
GC: https://join.skype.com/ujkQ7i5lV78O | DC: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2423
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Re: hi urgent question about callback calendar ?

Postby IPWINDEV » Fri Sep 22, 2023 9:09 pm

the quick solution that i have do is changing id="CallBackDatESelectioN" to input date then i choose what i need inside

maybe matt will give us other beauty solution

Code: Select all
<span><font class="sh_text">Date:</span>
    <input type="date" name="CallBackDatESelectioN" class="cust_form_text" placeholder="YYYY-MM-DD" id="CallBackDatESelectioN" />
    <input type="hidden" name="CallBackTimESelectioN" id="CallBackTimESelectioN" />
   <span id="CallBackDatEPrinT"><font class="sh_text"><?php echo _QXZ("Enter your Date Below"); ?></span> &nbsp;
   <span id="CallBackTimEPrinT"></span> &nbsp; &nbsp;
IPWINDEV
 
Posts: 13
Joined: Sun Apr 05, 2020 6:43 pm

Re: hi urgent question about callback calendar ?

Postby mflorell » Sat Sep 23, 2023 6:27 am

I don't think this has ever been requested before actually. Nobody has ever asked us to be able to set a scheduled callback for longer than one year. The current layout was designed to allow for quick choosing of a date, which is why it is a full 12-month display. I suppose it could be changed to just add more months below as well.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: hi urgent question about callback calendar ?

Postby carpenox » Sat Sep 23, 2023 9:02 am

Thanks for the response Matt, I wasn't sure if it was a bug or not. When I looked at some of the code, I saw a "year scroller" which I had never seen before is the gui.
Alma Linux 9.4 | SVN Version: 3889 | DB Schema Version: 1721 | Asterisk 18.21.1 | PHP8
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
GC: https://join.skype.com/ujkQ7i5lV78O | DC: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2423
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Re: hi urgent question about callback calendar ?

Postby mflorell » Sun Sep 24, 2023 6:39 am

Custom List Fields for DATE fields has a pretty standard one-month calendar display that uses a year-scroller. That isn't used by the callback selection calendar at all.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: hi urgent question about callback calendar ?

Postby carpenox » Sun Sep 24, 2023 7:15 am

Ah ok, I was obviously looking at the wrong file on that one. I looked through a bunch of files related to calendar trying to find a solution for him. Thanks again
Alma Linux 9.4 | SVN Version: 3889 | DB Schema Version: 1721 | Asterisk 18.21.1 | PHP8
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
GC: https://join.skype.com/ujkQ7i5lV78O | DC: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2423
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL


Return to Support

Who is online

Users browsing this forum: No registered users and 107 guests

cron