Commit 73ec6bfb authored by mcramer's avatar mcramer
Browse files

Fixed theme paths

Implemented:  FS#2388 - Optional confirm window on changing tabs
parent 76a4f750
......@@ -77,4 +77,6 @@ $wb['globalsearch_noresults_text_txt'] = 'Keine Treffer.';
$wb['globalsearch_noresults_limit_txt'] = '0 Treffer';
$wb['globalsearch_searchfield_watermark_txt'] = 'Suche';
$wb['globalsearch_suggestions_text_txt'] = 'Vorschläge';
$wb['global_tabchange_warning_txt'] = 'Die Eingaben in diesem Tab werden gespeichert, wenn Sie OK klicken, bei Abbrechen werden die Änderungen verworfen.';
$wb['global_tabchange_discard_txt'] = 'Achtung, Sie haben ungespeicherte Änderungen in diesem Tab. Wenn Sie fortfahren werden die Änderungen verworfen.';
?>
......@@ -77,4 +77,6 @@ $wb['globalsearch_noresults_text_txt'] = "No results.";
$wb['globalsearch_noresults_limit_txt'] = "0 results";
$wb['globalsearch_searchfield_watermark_txt'] = "Search";
$wb['globalsearch_suggestions_text_txt'] = "Suggestions";
$wb['global_tabchange_warning_txt'] = 'Changed data in this tab will be changed if you press OK. On cancel they will be discarded.';
$wb['global_tabchange_discard_txt'] = 'You have unsaved changes in this tab. Changes will be discarded if you continue.';
?>
......@@ -334,6 +334,18 @@ $form["tabs"]['misc'] = array (
'default' => '',
'value' => ''
),
'tab_change_discard' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'tab_change_warning' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'maintenance_mode' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -2,6 +2,9 @@
$wb['system_config_desc_txt'] = '';
$wb['smtp_missing_admin_mail_txt'] = 'Bitte geben Sie die Administrator E-Mail und den Namen ein, wenn Sie SMTP Versand nutzen wollen.';
$wb['warning'] = 'Bearbeiten Sie diese Werte sorgfältig! Entfernen Sie die Prefixe nicht auf Systemen mit mehr als einem Client.';
$wb['tab_change_warning_txt'] = 'Tab-Wechsel-Warnung';
$wb['tab_change_discard_txt'] = 'Verwerfe Änderungen bei Tab-Wechsel';
$wb['tab_change_warning_note_txt'] = 'Zeigt eine Warnung an, wenn der Tab in einem Formular gewechselt wird und Daten geändert wurden.';
$wb['dbname_prefix_txt'] = 'Datenbanknamen Prefix';
$wb['dbuser_prefix_txt'] = 'Datenbankbenutzer Prefix';
$wb['shelluser_prefix_txt'] = 'Shellbenutzer Prefix';
......
......@@ -5,6 +5,9 @@ $wb['dashboard_atom_url_admin_txt'] = 'Dashboard atom feed URL (admin)';
$wb['dashboard_atom_url_reseller_txt'] = 'Dashboard atom feed URL (reseller)';
$wb['dashboard_atom_url_client_txt'] = 'Dashboard atom feed URL (client)';
$wb["warning"] = 'Edit these values carefully! Do not remove the prefixes on a systems with more then one client.';
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data have been altered by the user.';
$wb["dbname_prefix_txt"] = 'Database name prefix';
$wb["dbuser_prefix_txt"] = 'Database user prefix';
$wb["shelluser_prefix_txt"] = 'Shell user prefix';
......
......@@ -21,6 +21,18 @@
<label for="monitor_key">{tmpl_var name='monitor_key_txt'}</label>
<input name="monitor_key" id="monitor_key" value="{tmpl_var name='monitor_key'}" size="" maxlength="" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='tab_change_discard_txt'}</p>
<div class="multiField">
{tmpl_var name='tab_change_discard'}
</div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='tab_change_warning_txt'}</p>
<div class="multiField">
{tmpl_var name='tab_change_warning'}<br/>{tmpl_var name='tab_change_warning_note_txt'}
</div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='maintenance_mode_txt'}</p>
<div class="multiField">
......
......@@ -36,6 +36,21 @@ if(!isset($_SESSION['s']['module']['name'])) $_SESSION['s']['module']['name'] =
$app->uses('tpl');
$app->tpl->newTemplate('main.tpl.htm');
// tab change warning?
// read misc config
$app->uses('getconf');
$sys_config = $app->getconf->get_global_config('misc');
if($sys_config['tab_change_warning'] == 'y') {
$app->tpl->setVar('tabchange_warning_enabled', 'y');
$app->tpl->setVar('global_tabchange_warning_txt', $app->lng('global_tabchange_warning_txt'));
} else {
$app->tpl->setVar('tabchange_warning_enabled', 'n');
}
$app->tpl->setVar('tabchange_discard_enabled', $sys_config['tab_change_discard']);
if($sys_config['tab_change_discard'] == 'y') {
$app->tpl->setVar('global_tabchange_discard_txt', $app->lng('global_tabchange_discard_txt'));
}
$app->tpl_defaults();
$app->tpl->pparse();
?>
\ No newline at end of file
......@@ -4,7 +4,11 @@
$lang = (isset($_SESSION['s']['language']) && $_SESSION['s']['language'] != '')?$_SESSION['s']['language']:'en';
include_once(ISPC_ROOT_PATH.'/web/strengthmeter/lib/lang/'.$lang.'_strengthmeter.lng');
?>
var pageFormChanged = false;
var tabChangeWarningTxt = '';
var tabChangeDiscardTxt = '';
var tabChangeWarning = false;
var tabChangeDiscard = false;
redirect = '';
function reportError(request) {
......@@ -24,6 +28,7 @@ function loadContentRefresh(pagename) {
dataType: "html",
success: function(data, textStatus, jqXHR) {
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
},
error: function() {
reportError('Ajax Request was not successful.'+pagename);
......@@ -87,6 +92,7 @@ function submitLoginForm(formname) {
document.location.href = 'index.php';
} else {
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
}
loadMenus();
},
......@@ -118,6 +124,7 @@ function submitForm(formname,target) {
//window.setTimeout('loadContent(redirect)', 1000);
} else {
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
}
},
error: function(jqXHR, textStatus, errorThrown) {
......@@ -150,6 +157,7 @@ function submitFormConfirm(formname,target,confirmation) {
//window.setTimeout('loadContent(redirect)', 1000);
} else {
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
}
},
error: function(jqXHR, textStatus, errorThrown) {
......@@ -202,8 +210,10 @@ function submitUploadForm(formname,target) {
}
function loadContent(pagename) {
var params = arguments[1];
var pageContentObject2 = jQuery.ajax({ type: "GET",
url: pagename,
data: (params ? params : null),
dataType: "html",
beforeSend: function() {
jQuery('#pageContent').html('<div id="ajaxloader"><img src="themes/default/images/ajax-loader.gif" /></div>');
......@@ -222,6 +232,7 @@ function loadContent(pagename) {
//jQuery.each(reponseScript, function(idx, val) { eval(val.text); } );
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
}
},
error: function() {
......@@ -242,6 +253,7 @@ function loadInitContent() {
loadContent(parts[1]);
} else {
jQuery('#pageContent').html(jqXHR.responseText);
pageFormChanged = false;
}
},
error: function() {
......@@ -293,7 +305,28 @@ function loadMenus() {
function changeTab(tab,target) {
//document.forms[0].next_tab.value = tab;
document.pageForm.next_tab.value = tab;
submitForm('pageForm',target);
var id = document.pageForm.id.value;
if(tabChangeDiscard == 'y') {
if(id && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
var next_tab = tab;
loadContent(target, {'next_tab': next_tab, 'id': id});
} else {
return false;
}
} else {
if(id && tabChangeWarning == 'y' && pageFormChanged == true) {
if(window.confirm(tabChangeWarningTxt)) {
submitForm('pageForm', target);
} else {
var next_tab = tab;
var id = document.pageForm.id.value;
loadContent(target, {'next_tab': next_tab, 'id': id});
}
} else {
submitForm('pageForm',target);
}
}
}
function del_record(link,confirmation) {
......
......@@ -44,8 +44,10 @@
jQuery('.ttip').tipsy({live: true, gravity: 'ne', html: true});
tabChangeDiscard = '<tmpl_var name="tabchange_discard_enabled>';
tabChangeWarning = '<tmpl_var name="tabchange_warning_enabled>';
tabChangeWarningTxt = '<tmpl_var name="global_tabchange_warning_txt">';
tabChangeDiscardTxt = '<tmpl_var name="global_tabchange_discard_txt">';
});
......
......@@ -5,9 +5,9 @@
<ul>
<tmpl_loop name="formTab">
<tmpl_if name="active">
<li class="active"><a href="javascript:changeTab('<tmpl_var name='name'>','<tmpl_var name='app_module'>/<tmpl_var name='form_action'>')"><tmpl_var name='title'></a></li>
<li class="active"><a href="#" onclick="return changeTab('<tmpl_var name='name'>','<tmpl_var name='app_module'>/<tmpl_var name='form_action'>')"><tmpl_var name='title'></a></li>
<tmpl_else>
<li><a href="javascript:changeTab('<tmpl_var name='name'>','<tmpl_var name='app_module'>/<tmpl_var name='form_action'>')"><tmpl_var name='title'></a></li>
<li><a href="#" onclick="return changeTab('<tmpl_var name='name'>','<tmpl_var name='app_module'>/<tmpl_var name='form_action'>')"><tmpl_var name='title'></a></li>
</tmpl_if>
</tmpl_loop>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment