New column in callback list

All installation and configuration problems and questions

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

New column in callback list

Postby destefanix » Thu Feb 08, 2018 12:40 pm

Hello,
i'd like to add a column in my callback list, with the CITY for example. I already modified vicidial.php to implement another column:

Code: Select all
// MODGDS-008 Added column for CITY
...
var CB_HTML = "<table width=\"<?php echo $HCwidth ?>px\"><tr bgcolor=\"<?php echo $SCRIPT_COLOR ?>\"><td><font class=\"log_title\">#</font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("CALLBACK DATE/TIME"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("CITY"); ?> </font></td><td align=\"center\"><font class=\"log_title\">
....


Set a new var in the array:
Code: Select all
var CB_city = call_array[11]; // MODGDS-008


But now I'm lost.. Where do can I define this parameter? I guess in the vdc_php_query.php file.. but where? Any help guys?
Vicidial 2.14-650a BUILD: 180111-1544 (ViciBox_v8.x86_64-8.0.1) & Asterisk 11.25.1-vici
Vultr VPS: 6 vCore | RAM 16384 MB | 200 GB SSD | 1Gbps
destefanix
 
Posts: 14
Joined: Mon Jun 19, 2017 11:52 pm

Re: New column in callback list

Postby blackbird2306 » Thu Feb 08, 2018 5:15 pm

Usually we don't give help this way but today I'll make an exception:
You are right. There is an AJAX request to vdc_db_query.php with parameter $ACTION == 'CalLBacKLisT'. So make changes to vdc_db_query.php. And I refer to the newest revision 2905 from 2018-02-07:

1. at line 16019:
while ($callbacks_count>$loop_count)
{
$stmt = "SELECT first_name,last_name,phone_number,gmt_offset_now,state,list_id,city from vicidial_list where lead_id='$lead_id[$loop_count]';";

2. and at line 16069 (append "-!T-$row[6]") :
Code: Select all
      $CBoutput = "$row[0]-!T-$row[1]-!T-$row[2]-!T-$callback_id[$loop_count]-!T-$lead_id[$loop_count]-!T-$campaign_id[$loop_count]-!T-"._QXZ("$status[$loop_count]")."-!T-$entry_time[$loop_count]-!T-$callback_time[$loop_count]-!T-$comments[$loop_count]-!T-$PHONEdialable-!T-$row[6]";
      echo "$CBoutput\n";

Next make changes to vicidial.php:
4. at line 7227:
Code: Select all
var CB_dialable = call_array[10];
var CB_city = call_array[11]; // here is your new variable city now

5. at line 7207:
Code: Select all
var CB_HTML = "<table width=\"<?php echo $HCwidth ?>px\"><tr bgcolor=\"<?php echo $SCRIPT_COLOR ?>\"><td><font class=\"log_title\">#</font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("CALLBACK DATE/TIME"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("CITY"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("NUMBER"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("INFO"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("FULL NAME"); ?> </font></td><td align=\"center\"><font class=\"log_title\">  <?php echo _QXZ("STATUS"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("CAMPAIGN"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("LAST CALL DATE/TIME"); ?> </font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("DIAL"); ?></font></td><td align=\"center\"><font class=\"log_title\"> <?php echo _QXZ("ALT"); ?> </font></td></tr>"

6. and last at line 7234:
Code: Select all
if (CB_dialable > 0)
                        {
                        CB_HTML = CB_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_callback_time + "</td><td align=\"right\"><font class=\"log_text\">" + CB_city + "</td><td align=\"right\"><font class=\"log_text\">" + CB_phone + "</td><td align=\"right\"><font class=\"log_text\">" + CB_comments_ten + " - <a href=\"#\" onclick=\"VieWLeaDInfO('" + CB_lead_id + "','" + CB_id + "');return false;\"><?php echo _QXZ("INFO"); ?></a></font></td><td align=\"right\"><font class=\"log_text\">" + CB_name + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_status + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_campaign + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_lastcall_time + "&nbsp;</font></td><td align=\"right\"><font class=\"log_text\"><a href=\"#\" onclick=\"new_callback_call('" + CB_id + "','" + CB_lead_id + "','MAIN');return false;\"><?php echo _QXZ("DIAL"); ?></a>&nbsp;</font></td><td align=\"right\"><font class=\"log_text\"><a href=\"#\" onclick=\"new_callback_call('" + CB_id + "','" + CB_lead_id + "','ALT');return false;\"><?php echo _QXZ("ALT"); ?></a>&nbsp;</font></td></tr>";
                        }
                     else
                        {
                        CB_HTML = CB_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_callback_time + "</td><td align=\"right\"><font class=\"log_text\">" + CB_city + "</td><td align=\"right\"><font class=\"log_text\">" + CB_phone + "</td><td align=\"right\"><font class=\"log_text\">" + CB_comments_ten + " - INFO</font></td><td align=\"right\"><font class=\"log_text\">" + CB_name + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_status + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_campaign + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_lastcall_time + "&nbsp;</font></td><td align=\"right\" colspan=2><font class=\"log_text\"><?php echo _QXZ("NON-DIALABLE"); ?>&nbsp;</font></td></tr>";
                        }

I give no guarantee of functionality !!
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: New column in callback list

Postby destefanix » Fri Feb 09, 2018 12:54 am

Hellyeah @blackbird2306.. Your answer helped me to solve that so thanks a lot.. The only change that i had to to is this

Code: Select all
$CBoutput = "$row[0]-!T-$row[1]-!T-$row[2]-!T-$callback_id[$loop_count]-!T-$lead_id[$loop_count]-!T-$campaign_id[$loop_count]-!T-"._QXZ("$status[$loop_count]")."-!T-$entry_time[$loop_count]-!T-$callback_time[$loop_count]-!T-$comments[$loop_count]-!T-$PHONEdialable-!T-$row[5]";


Because with row[6] i got the list id instead of list name.

I personally think that it could be VERY useful to have city name, or to give the possibility to add some column in cback list!!

Thanks guys!
Vicidial 2.14-650a BUILD: 180111-1544 (ViciBox_v8.x86_64-8.0.1) & Asterisk 11.25.1-vici
Vultr VPS: 6 vCore | RAM 16384 MB | 200 GB SSD | 1Gbps
destefanix
 
Posts: 14
Joined: Mon Jun 19, 2017 11:52 pm

Re: New column in callback list

Postby blackbird2306 » Fri Feb 09, 2018 6:55 am

You are welcome! But row[6] should be right for "city" unless you have something else than
Code: Select all
$stmt = "SELECT first_name,last_name,phone_number,gmt_offset_now,state,list_id,city from vicidial_list where lead_id='$lead_id[$loop_count]';";

in your sql query?

By the way I found a small bug in code, which I have reported to the Issue Tracker.
http://www.vicidial.org/VICIDIALmantis/view.php?id=1062
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 89 guests