if ($breaks)
br($breaks);
echo "<input type=\"hidden\" name=\"_focus\" value=\"".get_post('_focus')."\">\n";
+ echo "<input type=\"hidden\" name=\"_modified\" value=\"".get_post('_modified', 0)."\">\n";
echo "</form>\n";
}
return 0;
} else
return get_post('DialogConfirm', 0);
-}
+}
+
+/*
+ Block menu/shortcut links during transaction procesing.
+*/
+function page_processing($msg = false)
+{
+ global $Ajax;
+
+ if ($msg === true)
+ $msg = _('Entered data has not been saved yet.\nDo you want to abandon changes?');
+
+ $js = "_validate._processing=" . (
+ $msg ? '\''.strtr($msg, array("\n"=>'\\n')) . '\';' : 'null;');
+ if (in_ajax()) {
+ $Ajax->addScript(true, $js);
+ } else
+ add_js_source($js);
+}
+
+function page_modified($status = true)
+{
+ global $Ajax;
+
+ $js = "_validate._modified=" . ($status ? 1:0).';';
+ if (in_ajax()) {
+ $Ajax->addScript(true, $js);
+ } else
+ add_js_source($js);
+}
?>
\ No newline at end of file
return false;
}
}
+ // prevent unneeded transaction entry abortion
+ if (e.className == 'shortcut'
+ || e.className == 'menu_option'
+ || e.className == 'menu_tab'
+ || e.className == 'selected')
+ e.onclick = function(ev) {
+ if (_validate._processing
+ && _validate._modified
+ && !confirm(_validate._processing)) {
+ ev.returnValue = false;
+ return false;
+ }
+ }
},
'ul.ajaxtabs': function(ul) {
var ulist=ul.getElementsByTagName("li");
foreach($applications as $app)
{
$acc = access_string($app->name);
- echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app->id
+ echo "<a class='".($sel_app == $app->id ? 'selected' : 'menu_tab')
+ ."' href='$local_path_to_root/index.php?application=".$app->id
."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
$indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
- echo " <td class='logoutBarRight'><a href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
- echo " <a href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
+ echo " <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
+ echo " <a class='shortcut' href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
if ($help_base_url != null)
{
echo "$himg<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url()."'>" . _("Help") . "</a> ";
}
- echo "$img<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
+ echo "$img<a class='shortcut' href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
echo "</td></tr></table>";
}
echo "</td></tr></table>";
foreach($applications as $app)
{
$acc = access_string($app->name);
- echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app->id
+ echo "<a class='".($sel_app == $app->id ? 'selected' : 'menu_tab')
+ ."' href='$local_path_to_root/index.php?application=".$app->id
."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
$indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
- echo " <td class='logoutBarRight'><a href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
- echo " <a href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
+ echo " <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
+ echo " <a class='shortcut' href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
if ($help_base_url != null)
{
echo "$himg<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url()."'>" . _("Help") . "</a> ";
}
- echo "$img<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
+ echo "$img<a class='shortcut' href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
echo "</td></tr></table>";
}
echo "</td></tr></table>";
foreach($applications as $app)
{
$acc = access_string($app->name);
- echo "<a ".($sel_app == $app->id ?
- ("class='selected'") : "")
- ." href='$local_path_to_root/index.php?application=".$app->id
+ echo "<a class='".($sel_app == $app->id ? 'selected' : 'menu_tab')
+ ."' href='$local_path_to_root/index.php?application=".$app->id
."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
$indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
- echo " <td class='logoutBarRight'><a href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
- echo " <a href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
+ echo " <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
+ echo " <a class='shortcut' href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
if ($help_base_url != null)
{
echo "$himg<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url()."'>" . _("Help") . "</a> ";
}
- echo "$img<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
+ echo "$img<a class='shortcut' href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
echo "</td></tr><tr><td colspan=3>";
echo "</td></tr></table>";
}