Yes, I do understand Matts point of view.
Cleaning up the code is time consuming, and the result will most likely be a decrease in features for starters.
But, I have started the work, and my company is willing to pay for the development. Vicidial is a great platform, and we are happy to build upon it.
I have also gotten a green light to share our code to the community, but when I requested to post my work so far, they asked me to wait.
But I can just mention where I am at so far:
*
Login and presentation is separated. The new "
vicidial.php" file uses a view class, putting all the HTML in separate .phtml files.
*
Stand alone Javascript files. To use the cache, javascript is moved out of vicidial.php. The javascript is also separated into two main files, one for the base-code and one for layout-code. The base-code takes care of all the communication with the Server and internal logic while the layout-code (using callback function) displays it.
*
Static javascript files. To avoid passing a lot of variables from the PHP to the HTML and Javascript directly when calling vicidial.php, most settings are fetched after the agent GUI is loaded. The only true variables used to initialize the Javascript is authentification variables such as username/password.
*
Server requests splitted into multiple files. All AJAX requests to the server is routed through a single file, much like [/i]vdc_db_query.php[i]. But unlike the huge vdc_db_query.php file, each ACTION has a separate file, loaded on request.
*
jQuery and JSON. To ease up Javascript coding as well as transfer of information to and from the server, jQuery is used as well as JSON.
*
Simplified AJAX debugging through FirePHP. The new "vdc_db_query.php" takes care of authentification, JSON encoding as well as error handling. FirePHP is implemented to ease up debugging.
*
Javascript variables/methods/functions grouped into objects. To avoid cluttering the global scope, objects are used to group variables and methods. No true OOP as every single object acts as a static class/singleton. Actually, no classes are defined, only objects. But doing it like that works well with jQuery.
So... what can you do so far?
At the moment, not much. You can log in with a user/phone, start a manual call and view the lead information in the header/form (Oh, by the way, the lead form is now built in the Javascript instead of PHP-code.)
Today I will be adding the hangup "feature"
Mvh,
Samuel Jirénius