close_connect(); # Get our fun functions require_once('crm_soap_funcs.php'); require_once('crm_display_funcs.php'); ## Set up our variables. # The transcript: the reason we are here $xscript_id = (isset($_GET['xscript_id']) ? $_GET['xscript_id'] : null ); # search vars $first_name = (isset($_POST['first_name']) ? $_POST['first_name'] : null ); $last_name = (isset($_POST['last_name']) ? $_POST['last_name'] : null ); $email = (isset($_POST['email']) ? $_POST['email'] : null ); $account = (isset($_POST['account']) ? $_POST['account'] : null ); # confirmation vars $confirmed_p = (isset($_POST['confirmed_p']) ? $_POST['confirmed_p'] : null ); if (!$confirmed_p) { $confirmed_p = (isset($_SESSION['confirmed_p']) ? $_SESSION['confirmed_p'] : null ); } $sugar_thing_id = (isset($_POST['sugar_thing_id']) ? $_POST['sugar_thing_id'] : null ); if (!$sugar_thing_id) { $sugar_thing_id = (isset($_SESSION['sugar_thing_id']) ? $_SESSION['sugar_thing_id'] : null ); } $sugar_thing_type = (isset($_POST['sugar_thing_type']) ? $_POST['sugar_thing_type'] : null ); if (!$sugar_thing_type) { $sugar_thing_type = (isset($_SESSION['sugar_thing_type']) ? $_SESSION['sugar_thing_type'] : null ); } ## No transcript? We're done. if (!$xscript_id) { exit("This page is for adding a transcript to Sugar, yet no transcript was specified.\n"); } ## TODO: this is debug stuff, remove it. ## Do the deed if 'confirmed' is set. if ($confirmed_p) { if (!$sugar_thing_id || !$sugar_thing_type) { print "Error: It looks to me that we tried to add a transcript to something that doesn't exist in Sugar."; } $err = add_xscript($sugar_thing_type, $sugar_thing_id, $xscript_id, $mydatabase); if ($err) { print "Error: $err"; } else { unset ( $account, $_POST['account'], $first_name, $_POST['first_name'], $last_name, $_POST['last_name'], $email, $_POST['email'], $confirmed_p, $_POST['confirmed_p'], $sugar_thing_id, $_POST['sugar_thing_id'], $sugar_thing_type, $_POST['sugar_thing_type'], $_SESSION['sugar_thing_type'], $_SESSION['sugar_thing_id'], $_SESSION['confirmed_p'], $xscript_id, $_POST['xscript_id'] ); header("Location: crm_add_success.php"); exit; } } else { $vis_info = array ( 'account' => addslashes($account), 'email' => addslashes($email), 'first_name' => addslashes($first_name), 'last_name' => addslashes($last_name) ); ?> Archive to CRM /bk.gif cellspacing="0" cellpadding="0">
/top_trim.gif> /version.gif border=0 width=267 height=32>
Select Existing Record:
Select a link below to archive this chat transcript to an existing CRM record.
Search for a CRM record:
Enter additional information and click Search
OR Create new Record:
Use the following drop-down to create a new Account, Case, Contact, or Lead to associate this Transcript to.