Bug 6863: Shelf Browser images not showing up
[koha.git] / admin / preferences.pl
index 5c59e5d..d523c75 100755 (executable)
@@ -13,9 +13,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -43,8 +43,13 @@ sub GetTab {
 
     my $tab_template = C4::Output::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input );
 
+    my $active_currency = GetCurrency();
+    my $local_currency;
+    if ($active_currency) {
+        $local_currency = $active_currency->{currency};
+    }
     $tab_template->param(
-        local_currency => GetCurrency()->{'currency'}, # currency code is used, because we do not know how a given currency is formatted.
+        local_currency => $local_currency, # currency code is used, because we do not know how a given currency is formatted.
     );
 
     return YAML::Syck::Load( $tab_template->output() );
@@ -58,6 +63,8 @@ sub _get_chunk {
 
     if ( $options{'class'} && $options{'class'} eq 'password' ) {
         $chunk->{'input_type'} = 'password';
+    } elsif ( $options{'class'} && $options{'class'} eq 'date' ) {
+        $chunk->{'dateinput'} = 1;
     } elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) {
         my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) };
 
@@ -157,7 +164,7 @@ sub TransformPrefsToHTML {
                 }
             }
 
-            push @lines, { CHUNKS => \@chunks, NAMES => \@names };
+            push @lines, { CHUNKS => \@chunks, NAMES => \@names, is_group_title => 0 };
         }
     }
 
@@ -261,7 +268,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 $lang = $template->param( 'lang' );
 my $op = $input->param( 'op' ) || '';
 my $tab = $input->param( 'tab' );
-$tab ||= 'local-use';
+$tab ||= 'acquisitions'; # Ideally this should be "local-use" but preferences.pl
+                         # does not presently support local use preferences
 
 my $highlighted;