mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Added code to autocomplete with ux transactions
This commit is contained in:
parent
f6faa4861b
commit
a2cff4195f
@ -1638,20 +1638,12 @@ function ui_pagination ($count, $url = false, $offset = 0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
$number_of_pages = ceil($count / $pagination);
|
$number_of_pages = ceil($count / $pagination);
|
||||||
//~ html_debug_print('number_of_pages');
|
|
||||||
//~ html_debug_print($number_of_pages);
|
|
||||||
$actual_page = floor($offset / $pagination);
|
$actual_page = floor($offset / $pagination);
|
||||||
//~ html_debug_print('actual_page');
|
|
||||||
//~ html_debug_print($actual_page);
|
|
||||||
$ini_page = floor($actual_page / $block_limit) * $block_limit;
|
$ini_page = floor($actual_page / $block_limit) * $block_limit;
|
||||||
//~ html_debug_print('ini_page');
|
|
||||||
//~ html_debug_print($ini_page);
|
|
||||||
$end_page = $ini_page + $block_limit - 1;
|
$end_page = $ini_page + $block_limit - 1;
|
||||||
if ($end_page > $number_of_pages) {
|
if ($end_page > $number_of_pages) {
|
||||||
$end_page = $number_of_pages - 1;
|
$end_page = $number_of_pages - 1;
|
||||||
}
|
}
|
||||||
//~ html_debug_print('end_page');
|
|
||||||
//~ html_debug_print($end_page);
|
|
||||||
|
|
||||||
|
|
||||||
$output = "<div class='pagination $other_class'>";
|
$output = "<div class='pagination $other_class'>";
|
||||||
@ -2908,6 +2900,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$input_id_server_value = $parameters['input_id_server_value'];
|
$input_id_server_value = $parameters['input_id_server_value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$from_ux_transaction = ''; //Default value
|
||||||
|
if (isset($parameters['from_ux'])) {
|
||||||
|
$from_ux_transaction = $parameters['from_ux'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$metaconsole_enabled = false; //Default value
|
$metaconsole_enabled = false; //Default value
|
||||||
if (isset($parameters['metaconsole_enabled'])) {
|
if (isset($parameters['metaconsole_enabled'])) {
|
||||||
@ -2995,8 +2992,37 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$javascript_name_function_select = $parameters['javascript_name_function_select'];
|
$javascript_name_function_select = $parameters['javascript_name_function_select'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($from_ux_transaction != "") {
|
||||||
|
$javascript_code_function_select = '
|
||||||
|
function function_select_' . $input_name . '(agent_name) {
|
||||||
|
console.log(agent_name);
|
||||||
|
$("#' . $selectbox_id . '").empty();
|
||||||
|
|
||||||
|
var inputs = [];
|
||||||
|
inputs.push ("id_agent=" + $("#' . $hidden_input_idagent_id . '").val());
|
||||||
|
inputs.push ("get_agent_transactions=1");
|
||||||
|
inputs.push ("page=enterprise/include/ajax/ux_transaction.ajax");
|
||||||
|
|
||||||
|
jQuery.ajax ({
|
||||||
|
data: inputs.join ("&"),
|
||||||
|
type: "POST",
|
||||||
|
url: action="' . $javascript_ajax_page . '",
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data) {
|
||||||
|
$("#' . $selectbox_id . '").append ($("<option value=0>None</option>"));
|
||||||
|
jQuery.each (data, function (id, value) {
|
||||||
|
$("#' . $selectbox_id . '").append ($("<option value=" + id + ">" + value + "</option>"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
';
|
||||||
|
}
|
||||||
|
else {
|
||||||
$javascript_code_function_select = '
|
$javascript_code_function_select = '
|
||||||
function function_select_' . $input_name . '(agent_name) {
|
function function_select_' . $input_name . '(agent_name) {
|
||||||
|
|
||||||
@ -3058,6 +3084,8 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
';
|
';
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($parameters['javascript_code_function_select'])) {
|
if (isset($parameters['javascript_code_function_select'])) {
|
||||||
$javascript_code_function_select = $parameters['javascript_code_function_select'];
|
$javascript_code_function_select = $parameters['javascript_code_function_select'];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user