Bug 9016: (follow-up) various fixes
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 24 Feb 2014 15:13:35 +0000 (16:13 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 20:29:17 +0000 (20:29 +0000)
* Fixes POD of GetMessageTransportTypes.
* Removes the useless map in GetMessageTransportTypes.
* Textual: "You must specify a title and a content" ->
           "Please specify title and content".
* Reintroduces << and >> around the field name.
* Change message for the update DB entry.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Letters.pm
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt

index bbefa44..51020b6 100644 (file)
@@ -851,22 +851,18 @@ ENDSQL
 
   my @mtt = GetMessageTransportTypes();
 
-  returns a list of hashes
+  returns an arrayref of transport types
 
 =cut
 
 sub GetMessageTransportTypes {
     my $dbh = C4::Context->dbh();
-    my $sth = $dbh->prepare("
+    my $mtts = $dbh->selectcol_arrayref("
         SELECT message_transport_type
         FROM message_transport_types
         ORDER BY message_transport_type
     ");
-    $sth->execute;
-    my @mtts = map{
-        $_->[0]
-    } @{ $sth->fetchall_arrayref() };
-    return \@mtts;
+    return $mtts;
 }
 
 =head2 _add_attachements
index 6a4cdf9..9b95433 100755 (executable)
@@ -8295,7 +8295,7 @@ if ( CheckVersion($DBversion) ) {
         }
     }
 
-    print "Upgrade done (Bug 9016: Adds the association table overduerules_transport_types)\n";
+    print "Upgrade done (Bug 9016: Adds multi transport types management for notices)\n";
     SetVersion($DBversion);
 }
 
index a6608d7..144c2e6 100644 (file)
@@ -34,7 +34,7 @@ $(document).ready(function() {
                  || ( title.length > 0 && content.length == 0 )
             ) {
                 var mtt = $(this).find('input[name="message_transport_type"]').val();
-                var msg = _("You must specify a title and a content for %s");
+                var msg = _("Please specify title and content for %s");
                 msg = msg.replace( "%s", mtt );
                 alert(msg)
                 event.preventDefault();
@@ -95,7 +95,7 @@ $(document).ready(function() {
                         chaineAj += $(this).val();
                     }
                 } );
-                $(myQuery).insertAtCaret(chaineAj);
+                $(myQuery).insertAtCaret("<<" + chaineAj + ">>");
             }
         }
        [% END %]