I am trying to integrate my CRM (XRMS) contact form into my modx website. It accepts input and places the customer info in the CRM and creates an activity (reply to the client) and creates an opportunity (client wants a service).
The plugin from XRMS has four parts:
1) the form which I just copied into the "Contacts" document in my site. Works perfect.
2) the processing script which is located in a subdirectory of XRMS in the same server as my site. I do not touch that one.
3) two functions for javascript validation. I have placed that in the templates/mytpl/js directory of my site and created a chunk with the <script> on it, and then placed a call to the chunk in the "Extra Header" template variable (puts extra calls in the header of a page for javascript, extra css and the like) Works fine.
4) the last part is the connection to the XRMS application. It includes all the functions for connection to the DB and other stuff to input the info into the appropriate places in the CRM. This snippet looks as follows:
<?php
require_once('../../include-locations.inc');
require_once($include_directory . 'vars.php');
require_once($include_directory . 'utils-interface.php');
require_once($include_directory . 'adodb/adodb.inc.php');
require_once($include_directory . 'utils-accounting.php');
$con = &adonewconnection($xrms_db_dbtype);
$con->connect($xrms_db_server, $xrms_db_username, $xrms_db_password, $xrms_db_dbname);
//$con->debug = 1;
?>
I have replaced the $include_directory variable with all the path to the files...
The XRMS plugin loads (puts) all these code before the <html> of the document, how can I do the same?
I have tried placing the snippet at the very top of my content area, but it does not work.
I don’t want to place it in the template, because it is only going to be used in this page, not in the other 50...
Any help will be appreciated...
Carlos