From 16039eae5a00dfe8fcd51b97ba7fba9e2c0d9ec3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 12 Jul 2010 16:41:28 -0400 Subject: [PATCH] Fix for Bug 4991, Overhaul of Calendar interface - Put hints, key, and existing holidays into right column - Style entry form for added clarity and consistency with other forms in Koha - Change the way dynamically displayed hints are shown to better match existing static hints in Koha's interface - Add branch name (instead of branch code) for clarity - Add the ability to add and edit holiday titles (previously only description could be edited). - Add links to the list of existing single-day holidays and exceptions which opens the calendar to that month/year Signed-off-by: Galen Charlton Signed-off-by: Chris Nighswonger --- C4/Calendar.pm | 2 +- .../prog/en/css/staff-global.css | 6 +- .../prog/en/modules/tools/holidays.tmpl | 329 +++++++++--------- tools/holidays.pl | 20 +- 4 files changed, 173 insertions(+), 184 deletions(-) diff --git a/C4/Calendar.pm b/C4/Calendar.pm index b5a3436f50..dc9037b9c8 100644 --- a/C4/Calendar.pm +++ b/C4/Calendar.pm @@ -37,7 +37,7 @@ BEGIN { &insert_day_month_holiday &insert_single_holiday &insert_exception_holiday - &ModWeekdayholiday + &ModWeekdayholiday &ModDaymonthholiday &ModSingleholiday &ModExceptionholiday diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 13ac2c7752..7803604c10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -499,7 +499,8 @@ fieldset.brief { border : 1px solid #E8E8E8; } -fieldset.brief label { +fieldset.brief label, +fieldset.brief span.label { display : block; font-weight : bold; padding : .3em 0; @@ -535,7 +536,8 @@ div.yui-b fieldset.brief select { div.yui-b fieldset.brief li.radio { padding : .7em 0; } -div.yui-b fieldset.brief li.radio label { +div.yui-b fieldset.brief li.radio label, +div.yui-b fieldset.brief li.radio span.label { display : inline; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl index 01f718c7e6..423c7da37e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl @@ -1,46 +1,14 @@ -Koha › Tools › Calendar +Koha › Tools › <!-- TMPL_VAR NAME="branchname" --> Calendar - - + -
+
- - - - - - - - -
- - - - -
-

-
-
- - - - - -

Define the holidays for :

- +

Calendar

+
+
+ -
    -
  • Search in the calendar the day you want to set as holiday.
  • -
  • Complete the information in the right area.
  • -
  • Once you finish the steps above, click Save.
  • -
-

- Working day - Unique holiday - Repeatable holiday - Holiday exception -

@@ -206,39 +147,49 @@ h1 select { width: 20em; }
-

Edit this holiday

-

- - -

-

- - - -

-
- - - -
+
+

Edit this holiday

+ +
    +
  1. + Library: + +
  2. +
  3. + Date: + , + + ////// + + + + + + +
  4. +
  5. - -

    -
    + -

    -
    + +
  6. - /../img/more.gif" border="0" alt="More information" />
    -
    - - /../img/more.gif" border="0" alt="More information" />
    - - /../img/more.gif" border="0" alt="More information" /> -

    + [?] +

    You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.
    +
  7. +
  8. + [?] +
    This will delete this holiday rule. If it is a repeatable holiday, this option checks for posible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.
  9. +
  10. + [?] +
    This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.
  11. + +
+
- -

+ Cancel +
+
@@ -246,44 +197,56 @@ h1 select { width: 20em; }
" /> -

Add new holiday

-

- - -

-

- - - -

-
- - - -
-

-
+

+

Add new holiday

+
    +
  1. + Library + + +
  2. +
  3. + Date: + , + + ////// + + + + + + +
  4. +
  5. +
  6. -

    - - . - /../img/more.gif" border="0" alt="More information" /> -
    - - . - /../img/more.gif" border="0" alt="More information" /> -
    - - . - /../img/more.gif" border="0" alt="More information" /> -

    +

  7. +
  8. + . + [?] +
    Make a single holiday. For example, selecting August 1st, 2012 will make it holiday, but will not affect August 1st in other years.
    +
  9. +
  10. + . + [?] +
    Make this weekday a holiday, every week. For example, if your library is closed on Saturdays, use this option to make every Saturday a holiday.
    +
  11. +
  12. + . + [?] +
    This will take this day and month as a reference to make it holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1st will make August 1st a holiday every year.
    +
  13. +
  14. . - /../img/more.gif" border="0" alt="More information" /> -

    + [?] +

    If checked, this holiday will be copied to all libraries. If the holiday already exists for a library, no change is made.
    +
+
- -

+ Cancel +
+
@@ -294,7 +257,7 @@ h1 select { width: 20em; } -

Calendar information

+

Calendar information

+ +
+
+
+
+

Hints

+
    +
  • Search in the calendar the day you want to set as holiday.
  • +
  • Click the date to add or edit a holiday.
  • +
  • Enter a title and description for the holdiay.
  • +
  • Specify how the holiday should repeat.
  • +
  • Click Save to finish.
  • +
+

Key

+

+ Working day + Unique holiday + Repeatable holiday + Holiday exception +

+
@@ -383,7 +367,7 @@ h1 select { width: 20em; } - + &calendardate="> @@ -457,7 +441,7 @@ h1 select { width: 20em; } - + &calendardate="> @@ -469,6 +453,7 @@ h1 select { width: 20em; }
+
diff --git a/tools/holidays.pl b/tools/holidays.pl index a6afcaa20c..eb3bc9c377 100755 --- a/tools/holidays.pl +++ b/tools/holidays.pl @@ -64,6 +64,7 @@ my $onlymine=(C4::Context->preference('IndependantBranches') && if ( $onlymine ) { $branch = C4::Context->userenv->{'branch'}; } +my $branchname = GetBranchName($branch); my $branches = GetBranches($onlymine); my @branchloop; for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { @@ -136,15 +137,16 @@ foreach my $yearMonthDay (keys %$single_holidays) { } $template->param(WEEK_DAYS_LOOP => \@week_days, - branchloop => \@branchloop, - HOLIDAYS_LOOP => \@holidays, - EXCEPTION_HOLIDAYS_LOOP => \@exception_holidays, - DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays, - calendardate => $calendardate, - keydate => $keydate, - branchcodes => $branchcodes, - branch => $branch - ); + branchloop => \@branchloop, + HOLIDAYS_LOOP => \@holidays, + EXCEPTION_HOLIDAYS_LOOP => \@exception_holidays, + DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays, + calendardate => $calendardate, + keydate => $keydate, + branchcodes => $branchcodes, + branch => $branch, + branchname => $branchname + ); # Shows the template with the real values replaced output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5