Bug 17942: Remove type for messages
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 2 May 2017 21:24:23 +0000 (18:24 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 9 May 2017 20:54:31 +0000 (20:54 +0000)
It it no longer in used by the templates.

Also add the include files for step5 (if the circ rule is not inserted)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
installer/onboarding.pl
koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt

index 02d4827..8b032c9 100755 (executable)
@@ -76,12 +76,10 @@ if ( $step == 1 ) {
 
         eval { $library->store; };
         unless ($@) {
-            push @messages,
-              { type => 'message', code => 'success_on_insert_library' };
+            push @messages, { code => 'success_on_insert_library' };
         }
         else {
-            push @messages,
-              { type => 'message', code => 'error_on_insert_library' };
+            push @messages, { code => 'error_on_insert_library' };
         }
     }
 
@@ -130,12 +128,10 @@ if ( $step == 2 ) {
         eval { $category->store; };
 
         unless ($@) {
-            push @messages,
-              { type => 'message', code => 'success_on_insert_category' };
+            push @messages, { code => 'success_on_insert_category' };
         }
         else {
-            push @messages,
-              { type => 'message', code => 'error_on_insert_category' };
+            push @messages, { code => 'error_on_insert_category' };
         }
     }
 
@@ -152,21 +148,15 @@ if ( $step == 3 ) {
 
         if ( my $error_code = checkcardnumber($cardnumber) ) {
             if ( $error_code == 1 ) {
-                push @messages,
-                  {
-                    type => 'alert',
-                    code => 'ERROR_cardnumber_already_exists'
-                  };
+                push @messages, { code => 'ERROR_cardnumber_already_exists' };
             }
             elsif ( $error_code == 2 ) {
-                push @messages,
-                  { type => 'alert', code => 'ERROR_cardnumber_length' };
+                push @messages, { code => 'ERROR_cardnumber_length' };
             }
         }
         elsif ( $firstpassword ne $secondpassword ) {
 
-            push @messages,
-              { type => 'alert', code => 'ERROR_password_mismatch' };
+            push @messages, { code => 'ERROR_password_mismatch' };
         }
         else {
 
@@ -194,12 +184,10 @@ if ( $step == 3 ) {
 
             #Error handling checking if the patron was created successfully
             if ($borrowernumber) {
-                push @messages,
-                  { type => 'message', code => 'success_on_insert_patron' };
+                push @messages, { code => 'success_on_insert_patron' };
             }
             else {
-                push @messages,
-                  { type => 'error', code => 'error_on_insert_patron' };
+                push @messages, { code => 'error_on_insert_patron' };
             }
         }
     }
@@ -221,12 +209,10 @@ if ( $step == 4 ) {
         eval { $itemtype->store; };
 
         unless ($@) {
-            push @messages,
-              { type => 'message', code => 'success_on_insert_itemtype' };
+            push @messages, { code => 'success_on_insert_itemtype' };
         }
         else {
-            push @messages,
-              { type => 'message', code => 'error_on_insert_itemtype' };
+            push @messages, { code => 'error_on_insert_itemtype' };
         }
     }
 
@@ -269,12 +255,10 @@ if ( $step == 5 ) {
         eval { $issuingrule->store; };
 
         unless ($@) {
-            push @messages,
-              { type => 'message', code => 'success_on_insert_circ_rule' };
+            push @messages, { code => 'success_on_insert_circ_rule' };
         }
         else {
-            push @messages,
-              { type => 'message', code => 'error_on_insert_circ_rule' };
+            push @messages, { code => 'error_on_insert_circ_rule' };
         }
     }
 
index af203ed..dfae544 100644 (file)
@@ -21,6 +21,7 @@
                 [% IF all_done %]
 
                     <h2>Web installer &rsaquo; Complete</h2>
+                    [% INCLUDE 'onboarding_messages.inc' %]
                     <h3>Congratulations you have finished and are ready to use Koha</h3>
                     <a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a>