Revision 53d80f2a
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
js/kivi.CustomerVendor.js | ||
---|---|---|
160 | 160 |
var url = "common.pl?INPUT_ENCODING=UTF-8&action=show_history&longdescription=&input_name="+ encodeURIComponent(id); |
161 | 161 |
window.open(url, "_new_generic", parm); |
162 | 162 |
}; |
163 |
|
|
164 |
this.update_dial_action = function($input) { |
|
165 |
var $action = $('#' + $input.prop('id') + '-dial-action'); |
|
166 |
|
|
167 |
if (!$action) |
|
168 |
return true; |
|
169 |
|
|
170 |
var number = $input.val().replace(/\s+/g, ''); |
|
171 |
if (number == '') |
|
172 |
$action.hide(); |
|
173 |
else |
|
174 |
$action.prop('href', 'controller.pl?action=CTI/call&number=' + encodeURIComponent(number)).show(); |
|
175 |
|
|
176 |
return true; |
|
177 |
}; |
|
178 |
|
|
179 |
this.init_dial_action = function(input) { |
|
180 |
if ($('#_cti_enabled').val() != 1) |
|
181 |
return false; |
|
182 |
|
|
183 |
var $input = $(input); |
|
184 |
var action_id = $input.prop('id') + '-dial-action'; |
|
185 |
|
|
186 |
if (!$('#' + action_id).size()) { |
|
187 |
var $action = $('<a href="" id="' + action_id + '" class="cti_call_action" target="_blank" tabindex="-1"></a>'); |
|
188 |
$input.wrap('<span nobr></span>').after($action); |
|
189 |
|
|
190 |
$input.change(function() { kivi.CustomerVendor.update_dial_action($input); }); |
|
191 |
} |
|
192 |
|
|
193 |
kivi.CustomerVendor.update_dial_action($input); |
|
194 |
|
|
195 |
return true; |
|
196 |
}; |
|
163 | 197 |
}); |
198 |
|
|
199 |
function local_reinit_widgets() { |
|
200 |
$('#cv_phone,#shipto_shiptophone,#contact_cp_phone1,#contact_cp_phone2,#contact_cp_mobile1,#contact_cp_mobile2').each(function(idx, elt) { |
|
201 |
kivi.CustomerVendor.init_dial_action($(elt)); |
|
202 |
}); |
|
203 |
} |
Auch abrufbar als: Unified diff
Generische Unterstützung für CTI: Click-to-dial