Hello,
My customer sells different IT services. He wants to put the different ITservices as a dropdown
in the lead capture form. Based on the drop down, the lead should be assigned to different user/groups.
Thanks
Hello,
My customer sells different IT services. He wants to put the different ITservices as a dropdown
in the lead capture form. Based on the drop down, the lead should be assigned to different user/groups.
Thanks
If you're asking if it's possible, yes it is. We do almost the exact same thing. We'll post which user to assign it from our corporate site with the following code:
We created a user in Sugar called leads_capture, gave it the rights it needed, then altered the $users array in leadCapture_override.php to look like:PHP Code:$postfields = "user=$sugar_user"
."&auth_user=leads_capture" /** [eggsurplus] general leads capture user for authenticating */
."&first_name=".urlencode($icu_firstname)
."&last_name=".urlencode($icu_lastname)
."&email1=".urlencode($icu_email)
."&title=".urlencode($icu_title)
."&phone_work=".urlencode($icu_phone)
."&account_name=".urlencode($account)
."&primary_address_street=".urlencode($icu_address)
."&primary_address_city=".urlencode($icu_city)
."&primary_address_state=".urlencode($icu_state)
."&primary_address_postalcode=".urlencode($icu_zip)
."&lead_source=".urlencode("Web Site")
."&lead_source_description=".urlencode("From website")
."&existing_customer_c=".urlencode($existing_customer)
."&description=".urlencode($email_body);
$sugar_url = SUGAR_URL."/leadCapture.php";
$session = curl_init();
curl_setopt($session, CURLOPT_URL, $sugar_url);
curl_setopt ($session, CURLOPT_POST, 1);
curl_setopt ($session, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
We then altered (which is NOT upgrade safe but we have a process in place to handle that) modules/Leads/Capture.php (actually leadCapture.php since we're still in 5.0.x) and changed this code:PHP Code:$users = array(
'leads_capture' => array('name'=>'leads_capture','pass'=>'ENTERUSERHASHHERE'),
);
toPHP Code:if (!empty($_POST['user']) && !empty($users[$_POST['user']])) {
require_once('modules/Users/User.php');
$current_user = new User();
$current_user->user_name = $users[$_POST['user']]['name'];
if($current_user->authenticate_user($users[$_POST['user']]['pass'])){
$userid = $current_user->retrieve_user_id($users[$_REQUEST['user']]['name']);
If you're getting paid for this customization in good conscience you should really forward that payment to my accountPHP Code:if (!empty($_POST['auth_user']) && !empty($users[$_POST['auth_user']])) { /** [eggsurplus] change to auth_user */
require_once('modules/Users/User.php');
$current_user = new User();
$current_user->user_name = $users[$_POST['auth_user']]['name']; /** [eggsurplus] change to auth_user */
if($current_user->authenticate_user($users[$_POST['auth_user']]['pass'])){
$userid = $current_user->retrieve_user_id($_POST['user']); /** [eggsurplus] change to $_POST['user'] */
![]()
Co-Founder of: SugarOutfitters
Modules:
SecuritySuite (Teams)
Photo Module
Follow me on Twitter:eggsurplus
Your Personal Developer
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks