PBXManagerJS.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- PBXManagerJS.js.backup 2015-06-08 14:50:56.406000968 +0500
+++ PBXManagerJS.js 2015-06-08 16:03:15.589195697 +0500
@@ -48,7 +48,7 @@
title: app.vtranslate('JS_PBX_INCOMING_CALL'),
//SalesPlatform.ru begin
text: '<div class="row-fluid pbxcall" id="pbxcall_'+record.pbxmanagerid+'" callid='+record.pbxmanagerid+' style="color:black"><span class="span12" id="caller" value="'+record.customernumber+'">'+app.vtranslate('JS_PBX_CALL_FROM')+' : '+record.customernumber+'</span><span class="hide span12" id="contactsave_'+record.pbxmanagerid+'">\n\
- <span><input class="span3" id="email_'+record.pbxmanagerid+'" type="text" placeholder="' + app.vtranslate('Enter Email-id') + '"></input>&nbsp;&nbsp;&nbsp;<select class="input-medium" id="module_'+record.pbxmanagerid+'"><option value="Select" selected>' + app.vtranslate('Select') + '</option></select><h5 class="alert-danger hide span3" id="alert_msg">'+app.vtranslate('JS_PBX_FILL_ALL_FIELDS')+'</h5>\n\
+ <span><input class="span3" id="firstname_'+record.pbxmanagerid+'" type="text" placeholder="Введите имя"></input><input class="span3" id="lastname_'+record.pbxmanagerid+'" type="text" placeholder="Введите Фамилию"></input>&nbsp;&nbsp;&nbsp;<input class="span3" id="description_'+record.pbxmanagerid+'" type="text" placeholder="Введите описание"></input>&nbsp;&nbsp;&nbsp;<input class="span3" id="email_'+record.pbxmanagerid+'" type="text" placeholder="Введите e-mail"></input>&nbsp;&nbsp;&nbsp;<select class="input-small" id="module_'+record.pbxmanagerid+'" placeholder="Select"><option>Leads</option></select><h5 class="alert-danger hide span3" id="alert_msg">'+app.vtranslate('JS_PBX_FILL_ALL_FIELDS')+'</h5>\n\
<button class="btn btn-success pull-right" id="pbxcontactsave_'+record.pbxmanagerid+'" recordid="'+record.pbxmanagerid+'" type="submit">' + app.vtranslate('Save') + '</button>\n\
</span></span><br/><span class="span12" style="display:none" id="owner">'+app.vtranslate('JS_LBL_ASSIGNED_TO')+'&nbsp;:&nbsp;<span id="ownername"></span></span><br/><span class="span12" style="display:none" id="answeredby"><i class="icon-headphones"></i>&nbsp;<span id="answeredbyname"></span></span></div>',
@@ -104,12 +104,17 @@
},
createRecord: function(e, record) {
- var pbxmanagerid = jQuery(e.currentTarget).attr('recordid');
+ var pbxmanagerid = jQuery(e.currentTarget).attr('recordid');
+ var firstname = jQuery('#firstname_'+pbxmanagerid+'').val();
+ var lastname = jQuery('#lastname_'+pbxmanagerid+'').val();
+ var description = jQuery('#description_'+pbxmanagerid+'').val();
+
+
var email = jQuery('#email_'+pbxmanagerid+'').val();
var moduleName = jQuery('#module_'+pbxmanagerid+'').val();
var number = jQuery('#caller','#pbxcall_'+pbxmanagerid+'').attr("value");
- var url = 'index.php?module=PBXManager&action=IncomingCallPoll&mode=createRecord&number='+encodeURIComponent(number)+'&email='+encodeURIComponent(email)+'&callid='+record.sourceuuid+'&modulename='+moduleName;
+ var url = 'index.php?module=PBXManager&action=IncomingCallPoll&mode=createRecord&number='+encodeURIComponent(number)+'&firstname='+encodeURIComponent(firstname)+'&lastname='+encodeURIComponent(lastname)+'&email='+encodeURIComponent(email)+'&description='+encodeURIComponent(description)+'&callid='+record.sourceuuid+'&modulename='+moduleName;
AppConnector.request(url).then(function(data){
if(data.success && data.result) {
jQuery('#contactsave_'+pbxmanagerid+'').hide();