Page 1 of 1

Edit agent view sidebar

PostPosted: Fri Oct 22, 2010 7:39 pm
by jselvin
Hi,

astgui 2.2.054
VERSION: 2.4-254
BUILD: 100512-1615


I'm trying to figure out where the agent view sidebar can be edited. where and in which file? I must be blind, because I can't find it.

I want to put the amount of sales of each agent in that view - make it a bit more competitive, and also order by sales.

Does anyone have any good pointers?

/Jimmy

PostPosted: Fri Oct 22, 2010 7:50 pm
by williamconley
last i knew everything on the agent screen was on the agent page. agc/vicidial.php

but it's using AJAX to get the data to populate the layers with information (but the framework to hold the information and the AJAX functions are all on the vicidial.php screen).

PostPosted: Fri Oct 22, 2010 9:07 pm
by jselvin
All I can find is that the layer id's are AgentViewSpan and AgentViewStatus but where the data is written in the layer is a mystery.

Been trying to find out for a couple of hours, It's 4am, if anyone can show me where the code is that writes the userid - username in AgentViewStatus I'd be most thankful.

Thank you

PostPosted: Fri Oct 22, 2010 9:31 pm
by williamconley
the data is written with AJAX. If you are not familiar with it ... it can be a headache.

javascript sends a request every second to a php page on the database server and receives a "data packet" with which to populate pre-defined areas with appropriate ids. It changes the data available and the html system shows the new data immediately via javascript without reloading the page.

PostPosted: Sat Oct 23, 2010 7:43 am
by mflorell
There are several PHP scripts involved actually, and the data is transmitted over AJAX to the vicidial.php script. I will caution you that adding stats like number of sales to that will potentially slow down your system if you do get it to work.

PostPosted: Sat Oct 23, 2010 11:28 am
by williamconley
True. If you are going to do that, you should set up a script that counts the sales every 5 minutes or so and stores them somewhere that's easy to query so the "every second" ajax script does not need to do any math, just pull the number that has been previously stored. then it will add only a nanosecond or so to the time, but nothing noticeable.

PostPosted: Sat Oct 23, 2010 3:04 pm
by jselvin
thanks for the info,

I'm gonna setup an external page containing some more useful info...
Seems easier, and I'm ashamed to admit, I simply can't reason out where the code to print out the user_id and user in agent view.

PostPosted: Tue Oct 26, 2010 4:55 pm
by Trying
This will actually be a very cool feature. Let us know if you get it working, otherwise you could consider having it developed.

PostPosted: Tue Oct 26, 2010 5:05 pm
by williamconley
the external page version we've already done for several clients. they all want a wall-board showing sales (and some go so far as to put it on a plasma screen on the wall so everyone can see it!)

PostPosted: Tue Oct 26, 2010 5:19 pm
by Trying
Now come on William, what will it take for you to make it available to the rest of us? :)

PostPosted: Tue Oct 26, 2010 5:28 pm
by williamconley
it's custom for each person. you don't sell their products or track sales like they do. (if they have two account numbers in their custom account number fields=two sales ...)

it's not like it's hard

nor is it in any way related to vicidial (it's just a web page pulling mysql data ... :) )

But if YOU want us to develop one for YOU that IS standard and allow us to publish for the community, we are HAPPY to do so.

PostPosted: Tue Oct 26, 2010 8:02 pm
by jselvin
William:
"javascript sends a request every second... ...populate pre-defined areas with appropriate ids"

I understand most of the Ajax work, I've mainly used frameworks to do Ajax work, but I get the general ideas and can read code quite well, or at least I thought so, because my main concern is:

The information I have available is the IDs of the section that is relevant, those are AgentViewSpan and AgentViewStatus

This is the basis of my following actions to solve the task I've set.
My following action is to look for those two IDs in the code, as a reference.
I first go through vicidial.php, and only find javascript that handles the open and close of the agentview sidebar.

After some frowning, I make a search of the entire vicidial and agc catalogs for the two IDs, case insensitive. Where I find 7 occurences of Agentviewspan and 4 of agentviewstatus, all which are in vicidial.php, and all dealing with opening and closing of the sidebar.

looking in to the variable agentviewstatus I find the functions refresh_agents_view(), and actually, now that I'm typing down my steps I just realised as I was fact checking, that there is in the function refresh_agents_view() is a line:
xmlhttp.open('POST', 'vdc_db_query.php');
and just above that
RAview_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=AGENTSview.....

Which makes sense as you open vdc_db_query.php and see that everything is controlled with actions. As it should be.

Searching after the actions AGENTSview I come upon an entire (small) universe of new information,

I feel like I've just beaten the first really hard boss in a videogame, you know that first really really hard one that makes you want to damage and hurt something or somebody due to frustration because you know you almost have it... :evil:

Thank you for your help guys, I hope I can take it from here :)

I know there are plenty of bosses left to defeat :P


How much would it cost to have the astgui interface modernized?
Preferably built upon an existing framwork, Symfony or Zend. Clean, well commented code, no embedded html tags, phpdoc, mvc, object oriented approach.... Don't know if it should be done, but if it could - approximately how much would it be?

PostPosted: Tue Oct 26, 2010 8:47 pm
by williamconley
For that you would need to do one of several things: Of course The Vicidial Group is the BEST at modifying their page, but they've been doing that for quite some time, obviously, and they do not seem predisposed to "pretty it up". I assume a FEE would fix that, but I do not see a lot of pretty stuff coming from their coding ... on the other hand, if we are talking about setting it up for skinning, that's not pretty anyway it is just pure coding.

Another method would be to go to a coding shop that already deals in Symfony/Zend/etc ... but the pitfall there is that they may break VICIdial (or have a hard time with it, as most do!). But still quite possible.

Then there are places like Poundteam (me) and of course guys like Gardo who have some experience meddling with this sort of thing. For that, you need only ask us.

I would recommend you start with The Vicidial Group. If you have the budget and the timeframe, they WILL be able to create a long-lasting "included forever" upgrade to the system (and based on the present status of VICIdial, their code is powerful, yes?).

PostPosted: Tue Oct 26, 2010 10:13 pm
by mflorell
Rewriting the entire agent interface would be a significant investment in time, which would most likely not be paid for. I would estimate at least 100 hours to rewrite the existing agent interface, which would mean halting all development for at least a month. That alone would be a reason not to do it, since we would rather use that time adding IM functionality to ViciDial. The existing agent interface functions just fine for all of our clients, and there really is no coding framework system that I have tried that can handle the complex nature of the multi-level AJAX calls and Javascript that the agent interface currently does.

What I would rather see happen is a volunteer going through the agent code function by function and cleaning it up and documenting it and submitting patches to the issue tracker as they go, so the changes can be integrated into SVN/trunk as they are submitted.

PostPosted: Tue Oct 26, 2010 10:25 pm
by williamconley
Assuming the code warrior managed to accomplish this task without breaking vicidial's functionality ... and that the EndResult has the EXACT same functionality as the Vicidial agent screen presently does ... i would presume that the "running" load to Vicidial's Servers from the AJAX calls and on the Client's IE/Firefox load would be nearly identical to what they are now. (As long as any temptation to add/modify functionality were strictly avoided.)

The "original load" of the page should increase, but considering the present size of the existing page (not a small file, ok?) I would expect it to be viable.

The layers of visibility and various hidden/shown areas will be a large undertaking, to be sure.

I will also say that the compatibility of Vicidial being maintained across both IE and FireFox in its present form could present a challenge during such an endeavor. But still doable, as most frameworks also take this into account.