From: Moritz Bunkus
Date: Thu, 30 Dec 2010 14:43:43 +0000 (+0100)
Subject: Einführung eines simplen Anzeige-Systems für Fehler, Warnungen, Informationen
X-Git-Tag: release-2.6.2beta1~17^2~6^2~10
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4856da7e20f5dba5c1ecca440869de3f6bb0a70a;p=kivitendo-erp.git
Einführung eines simplen Anzeige-Systems für Fehler, Warnungen, Informationen
Minimal an Rails' "flash"-Methode angelehnt, heißt auch so,
funktioniert aber noch nicht über Request-Grenzen hinweg. Ausgabe
erfolgt momentan nur in alle Einkaufs- und
Verkaufsbeleg-Bearbeiten-Masken.
Conflicts:
bin/mozilla/io.pl
templates/webpages/do/form_header.html
templates/webpages/ir/form_header.html
templates/webpages/is/form_header.html
templates/webpages/oe/form_header.html
---
diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl
index 82a988ec5..57acc954d 100644
--- a/bin/mozilla/common.pl
+++ b/bin/mozilla/common.pl
@@ -727,6 +727,18 @@ sub gl_transaction {
$main::lxdebug->leave_sub();
}
+sub flash {
+ my $category = shift;
+
+ $::form->{FLASH} ||= { };
+ $::form->{FLASH}->{ $category } ||= [ ];
+ push @{ $::form->{FLASH}->{ $category } }, @_;
+}
+
+sub render_flash {
+ return $::form->parse_html_template('common/flash');
+}
+
if ($::use_rdbo) {
eval {
require SL::DB::Helpers::Mappings;
diff --git a/css/lx-office-erp.css b/css/lx-office-erp.css
index 202bd179e..7283a32ec 100644
--- a/css/lx-office-erp.css
+++ b/css/lx-office-erp.css
@@ -288,3 +288,24 @@ label {
height:0;
visibility:hidden;
}
+
+.flash_message_error {
+ background-color:#FFD6D6;
+ border: 1px solid #AE0014;
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
+.flash_message_warning {
+ background-color:#FFE8C7;
+ border: 1px solid #FF6600;
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
+.flash_message_info {
+ background-color:#DCF2FF;
+ border: 1px solid #4690FF;
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html
index 2410439c3..29f8ad97f 100644
--- a/templates/webpages/do/form_header.html
+++ b/templates/webpages/do/form_header.html
@@ -50,6 +50,8 @@
[% title %]
+[%- INCLUDE 'common/flash.html' %]
+
[%- IF ERRORS && ERRORS.size %]
[% ERRORS.join('
') %]
[%- END %]
diff --git a/templates/webpages/ir/form_header.html b/templates/webpages/ir/form_header.html
index c0260e861..63d514072 100644
--- a/templates/webpages/ir/form_header.html
+++ b/templates/webpages/ir/form_header.html
@@ -26,6 +26,8 @@
[% title %]
+[%- INCLUDE 'common/flash.html' %]
+
diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html
index 919f37b66..a6c21975b 100644
--- a/templates/webpages/is/form_header.html
+++ b/templates/webpages/is/form_header.html
@@ -26,6 +26,8 @@
[% saved_message %]
+[%- INCLUDE 'common/flash.html' %]
+
diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html
index 0bd60026e..87555df39 100644
--- a/templates/webpages/oe/form_header.html
+++ b/templates/webpages/oe/form_header.html
@@ -25,6 +25,8 @@
[% title %]
+[%- INCLUDE 'common/flash.html' %]
+
| |