Fixed the ajax calls with timepicker in other languages instead english.

This commit is contained in:
mdtrooper 2015-02-19 18:33:42 +01:00
parent dac81d2640
commit 15c93c3bd9
2 changed files with 10 additions and 13 deletions

View File

@ -69,17 +69,6 @@ if ($get_module_detail) {
ui_include_time_picker();
ui_require_jquery_file("ui.datepicker-" . get_user_language(),
"include/javascript/i18n/");
ui_require_jquery_file ("ui-timepicker-addon");
// This script is included manually to be included after jquery and avoid error
echo '<script type="text/javascript" src="' .
ui_get_full_url('include/javascript/i18n/jquery-ui-timepicker-' .
get_user_language(), false, false, false) . '"></script>';
ui_require_jquery_file("ui.datepicker-" . get_user_language(),
"include/javascript/i18n/");
$module_id = get_parameter ('id_module');
$period = get_parameter ("period", 86400);
$group = agents_get_agentmodule_group ($module_id);

View File

@ -3472,10 +3472,18 @@ function ui_get_error ($error_code) {
}
function ui_include_time_picker() {
ui_require_jquery_file ("ui-timepicker-addon");
if (is_ajax ()) {
echo '<script type="text/javascript" src="' .
ui_get_full_url(false, false, false, false) .
'include/javascript/jquery.ui-timepicker-addon.js' . '"></script>';
}
else {
ui_require_jquery_file ("ui-timepicker-addon");
}
if (file_exists('include/javascript/i18n/jquery-ui-timepicker-' . substr(get_user_language(), 0, 2) . '.js')) {
echo '<script type="text/javascript" src="' . ui_get_full_url('include/javascript/i18n/jquery-ui-timepicker-' . substr(get_user_language(), 0, 2) . '.js', false, false, false) . '"></script>';
echo '<script type="text/javascript" src="' .
ui_get_full_url('include/javascript/i18n/jquery-ui-timepicker-' . substr(get_user_language(), 0, 2) . '.js', false, false, false) . '"></script>';
}
}
?>