Commit graph

92 commits

Author SHA1 Message Date
Te Rauhina Jackson
d10513dfc0 Bug 20019: use Modern::Perl in misc perl scripts
Test Plan:
Test Plan:
Check the following files have been updated from
use strict;
use warnings;
to
use Modern::Perl;

services/itemrecorddisplay.pl
suggestion/suggestion.pl
tags/list.pl
tags/review.pl
virtualshelves/sendshelf.pl
help.pl
changelanguage.pl
koha_perl_deps.pl
debian/bd-to-depends
debian/build-git-snapshot
debian/list-deps
docs/CAS/CASProxy/examples/koha_webservice.pl
docs/CAS/CASProxy/examples/proxy_cas.pl
docs/CAS/CASProxy/examples/proxy_cas_callback.pl
docs/CAS/CASProxy/examples/proxy_cas_data.pl

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-05 09:47:08 -03:00
Alex Arnaud
7b9140e8ef Bug 18399: Add reasons in edit suggestion page
Test plan:

 - Fill the authorised values's category 'SUGGEST' with reason
 - Edit a pending suggestion. Set the status to rejected
   and select a reason
 - Check the reason has been saved (i.e in the suggestions
   table of rejected tab)
 - Check in the corresponding message_queue that the reason
   is here
 - Re-edit the same suggestion
 - Check that the correct reason is selected by defaut
 - Edit an other pending suggetion. Set the status to rejected,
   select other reason and fill the input text
 - Re-edit the previews suggestion and make sure the input
   "other" is displayed by default with the correct value

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-11 13:05:39 -03:00
Chris Kirby
afddf4145f Bug 18839: Suggestion.pl spelling mistake
On the suggestion management page, 'unknown' is spelled 'unkown'

This patch corrects this spelling mistake in

suggestion/suggestion.pl

koha-tmpl/intranet-tmpl/prog/en/include/strings.inc

koha-tmpl/intranet-tmpl/prog/en/include/search_indexes.inc

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: sonia BOUIS <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-13 16:42:04 -03:00
fd28b02202 Bug 12349: Show card number in detailled suggestion pages
This patch modifies the main suggestion management page to link patron
names to their details rather than with a "mailto:" link.

This patch also includes the following changes:

- A fix for Bug 18154, Show card number in suggestion details view.
- Changes for brevity to labels in the suggestion details & edit view.
- Addition of the datepicker class to date fields in the suggestion edit
  view.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 18:10:03 -03:00
2b90ea2cb0 Bug 17829: Move GetMember to Koha::Patron
GetMember returned a patron given a borrowernumber, cardnumber or
userid.
All of these 3 attributes are defined as a unique key at the DB level
and so we can use Koha::Patrons->find to replace this subroutine.
Additionaly GetMember set category_type and description.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:14:19 -03:00
cb0e33f046 Bug 17835: Add an additional LEFT JOIN condition using DBIx::Class
The previous query was wrong. If an item type did not contain the
translation in the interface's language, the ->search_with_localization
did not return it at all.

What we need is definitely to add a second condition on the join.

For reference:
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Relationship/Base.pm#condition
https://blog.afoolishmanifesto.com/posts/dbix-class-parameterized-relationships/

That sounds hacky but seems to be the DBIx::Class path to follow.

Bug 17835: follow-up

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Lari Taskula <lari.taskula@jns.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-14 10:43:52 -04:00
8d5b4306e0 Bug 17835: Replace GetItemTypes with Koha::ItemTypes
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Lari Taskula <lari.taskula@jns.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-14 10:43:51 -04:00
cd7b84f675 Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 15:35:21 +00:00
df97814f30 Bug 15758: Koha::Libraries - Remove GetBranches
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:03 +00:00
19a977dc7b Bug 15758: Koha::Libraries - Remove GetBranchName
This is the fourth and last patch set to remove C4::Branch.
The real purpose of this patch is to standardise and refactor some code
which is related to the libraries selection/display.
Its unconfessed purpose is to remove the C4::Branch package.

Before this patch set, only 6 subroutines still existed in the C4::Branch
package:
- GetBranchName
- GetBranchesLoop
- mybranch
- onlymine
- GetBranches
- GetBranch

GetBranchName basically returns the branchname for a given branchcode.
The branchname is only used for a display purpose and we don't need to
retrieve it in package or pl scripts (unless for a few exceptions).
We have a `Branches` template plugin with a `GetName` method which does
exactly this job.
To achieve this removal, we will use this template plugin and delete the
GetBranchName from pl and pm files.
The `Branches.all()` will now select the library of the logged in user
if no `selected` parameter has been passed.
This new behavior could cause regressions, for instance there are some
places where we do not want an option preselected (batch item
modification for instance), keep that in mind when testing.

GetBranchesLoop took 3 parameters: $branch and $onlymine.
The first one was used to set a "selected" flag, for a display purpose:
select an option in the libraries dropdown lists.
The second one was useless: If not passed or set to 0, the
`C4::Branch::onlymine` subroutine was called.
This onlymine flag was use to know if the logged in user was able to see
other libraries infos.
A patron can see the infos from other libraries if IndependentBranches
is not set OR if he has the superlibrarian permission.
Prior to this patch set, the "onlymine test" was done on different
places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the
Branches TT plugin. In this patch set, this test is only done on one
place (C4::Context::only_my_library, code moved from
C4::Branch::onlymine).
To accomplish the same job as this subroutine, we just need to call the
`Branches.all()` method from the `Branches` TT plugin. It already
accepts a `selected` parameter to set a flag on the option to select.
To avoid the repetitive
  [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %]
pattern, a new `html_helpers` TT include file has been created, it
defines an `options_for_libraries` block, which takes a `selected`
parameter. We could imagine to use this include file for other
selects.

The 'mybranch` and `onlymine` subroutines of the C4::Branch package have
been moved to C4::Context. onlymine has been renamed with
only_my_library. There are only 4 occurrences of it, against 11 before
this patch set.
There 2 subroutines are Context-centric and it makes sense to put them
in `C4::Context` (at least it's the least worst place!)

GetBranches is the tricky part of this patch set: It retrieves all the
libraries, independently of the value of IndependentBranches.
To keep the same way as the existing calls of `Branches.all()`, I have
added a `unfiltered` parameter. If set, the `Branches.all()` will call
a usual Koha::Libraries->search method, otherwise
Koha::Libraries->search_filtered will be called. This new method will
check if the logged in user is allowed to see other libraries or only
its library.
Note that this `GetBranches` subroutine also created a `category` key:
it allowed to get the list of groups (of libraries) where this library
existed. Thanks to a previous patch set (bug 15295), this value was
not used anymore (I may have missed something!).

Note that the only use of `GetBranch` was buggy (see bug 15746).

Test plan (for the whole patch set):
The best way to test this whole patch set is to test with 2 instances: 1
with the patch set applied, 1 using master, to be sure there is no
regression.
It would be good to test the same with `IndependentBranches` and the
without `IndependentBranches`.
No difference should be found.
The tester must focus on the library dropdowns on as many forms as
possible.
You will notice changes in the order of the options: the libraries will
now be ordered by branchname (instead of branchcode in some places).
A special attention will be given to the following page:
- acqui/neworderempty.pl
- catalogue/search.pl
- members/members-home.pl (header?)
- opac/opac-topissues.pl
- tools/holidays.pl
- admin/branch_transfer_limits.pl
- admin/item_circulation_alerts.pl
- rotating_collections/transferCollection.pl
- suggestion/suggestion.pl
- tools/export.pl

Notes for QA:
- There are 2 FIXMEs in the patch set, I have kept the existing behavior,
but I am not sure it's the good one. Feel free to open a bug report and
I will fill a patch if you think it's not correct. Otherwise, remove the
FIXME lines in a follow-up patch.
- The whole patch set is huge and makes a lot of changes.
But it finally will tremendously reduce the number of lines:
716 insertions for 1910 deletions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:01 +00:00
66aacace08 Bug 16154: CGI->multi_param - Declare a list
This patch replaces the occurrences of
  my @foo = $cgi->param('foo');
with
  my @foo = $cgi->multi_param('foo');

perl -p -i -e
's/^(\s*my\s*@\w+\s*=\s*)\$(cgi|input|query)\->param\(/$1\$$2\->multi_param\(/xms'
**/*.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 23:16:42 +00:00
b64e6be1c4 Bug 16157: Move the selected flag from GetAuthorisedValues to the templates
From C4::Koha::GetAuthorisedValues

    # TODO: the "selected" feature should be replaced by a utility function
    # somewhere else, it doesn't belong in here. For starters it makes
    # caching much more complicated. Or just let the UI logic handle it, it's
    # what it's for.

Indeed, it's not a job for a subroutine, the template should take care of that.
Note that a perf gain could be won with this patch \o/

Test plan:
- Edit an itemtype and check the value of the "Search category" dropdown list
- Edit a patron attribute type and check the value of the "Class" dropdown list
- Detail for a catalogue record, the Status column should be correctly
  populated if items are damaged and/or lost
- Item details for a catalogue record, the lost, damaged and withdrawn
  value should be correctly displayed
- Edit a patron, the "street type" should be correctly selected
- Create a patron attribute type linked to an authorised value list.
- Edit a patron, set a value for this attribute, edit it again. The
  correct value should be selected.
- Search for subscriptions. The 'Location' dropdown list should behave
  correctly (select the entry you have choosen before, etc.)
- Edit a subscription, the location dropdown list should select the
  correct value.
- Edit and view a suggestion with a 'reason for suggestion' set (you
  should have at least 1 OPAC_SUG AV defined)

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-04-07 00:16:09 +00:00
1538e9ecf4 Bug 15084: Replace C4::Budgets::GetCurrencies with Koha::Acquisition::Currencies->search
Most part of the code here is unnecessary complex. We should selected
the currency if it is selected, that's all :)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:01 +00:00
Gus
9c2b0ea115 Bug 15624: Spelling mistake in suggestion.pl
Test - due to noone being in a comparison name it was not changed
1. search for choosen, see that it was removed
2. search for agregate, see that it was removed

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Typos fixed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 05:09:09 +00:00
Galen Charlton
15f9efb7bd Bug 9468: use new SUGGEST_FORMAT list
This patch uses the new SUGGEST_FORMAT authorized value list for
populating the list of suggestion item types/document types.  It
also improves the display by using the staff or OPAC description of
the authorised value rather than the code.

To test:

[1] Enter a suggestion via the OPAC and select an item type (which
    I will call "desired format" for the rest of this test plan).
[2] Verify that the saved suggestion displays the desired format
    description in both staff and OPAC.
[3] Verify that organizing the list of suggestions by item type
    now works in the staff interface, rather than displaying "Unknown"
    in each tab header.
[4] Verify that existing suggestions' desired formats are displayed
    correctly.
[5] Verify that suggestions can have their desired format edited
    in the staff inteface.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:46:57 -03:00
Jonathan Druart
81ab20e6bb Bug 10752: Alert the librarian if the suggestion has not been added
Test plan:
- Create a new suggestion, chose a short term as your title and copy it.
- Leave all other fields of the suggestion form untouched.
- Save your first suggestion.
- Enter a second suggestion with the same title.

Before this patch, the suggestion was not inserted without alert.
With this patch, an alert is displayed on the interface.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: Love the simplicity and ability to expand. :)

Tested with all pateches applied. Wors as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-28 15:11:42 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Jonathan Druart
45e5afb77b Bug 13731: Suggestions reason does not save on updating the status
On the suggestion list view, if you set a status, it won't be saved.

Test plan:
1/ Create a suggestion
2/ Go on the suggestion list view (suggestion/suggestion.pl)
3/ Select a suggestion and marked it as "rejected" (or the status you
want) and choose a reason
4/ Save
5/ Browse you suggestions DB table (using your favorite MySQL CLI) and
verify that the "reason" field is correctly filled.

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, thx!

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-02 15:47:24 +01:00
Jonathan Druart
e20270fec4 Bug 11944: use CGI( -utf8 ) everywhere
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:21 -03:00
Jonathan Druart
a71b96295f Bug 12627: Fix default values
The default value for *by and *date fields is NULL.
But without this patch, the values are 0 or 0000-00-00.
It comes from the fact that the form set to an empty string the values
and DBIX::Class does not consider them as undefined.

This patch is very ugly, not sure how we can fix that.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
No regressions found, adding and editing suggestions from
OPAC and staff.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:10 -03:00
Jonathan Druart
d536bb46f7 Bug 12627: Bug 12627: Fix default values - TT changes
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:07 -03:00
Jonathan Druart
8dfc4326e8 Bug 12627: Fix date management
C4::Dates->today returns a string formatted depending on the dateformat
syspref.

Before the original patch, SQLHelper managed both format (string
formatted and DateTime.

Now DBIX::Class only manages DateTime, so the call to NewSuggestion and
ModSuggestion should pass a DateTime object

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:05 -03:00
Jonathan Druart
81ff0a449d Bug 12627: Remove warnings
suggestion.pl: keys on reference is experimental

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:04 -03:00
Yohann Dufour
1c2744a83f Bug 12627: SQLHelper replacement - C4::Suggestions
With this patch, the subroutines NewSuggestion and ModSuggestion use DBIx::Class instead of C4::SQLHelper.
Moreover, the tests and the .pl have been adapted.

Test plan:
1) Apply the patch.

2) Execute the unit tests by launching :
prove t/db_dependent/Suggestions.t

3) The result has to be a success without error or warning :
t/db_dependent/Suggestions.t .. ok
All tests successful.
Files=1, Tests=91,  2 wallclock secs ( 0.05 usr  0.01 sys +  1.65 cusr  0.09 csys =  1.80 CPU)
Result: PASS

4) Log in the intranet, create a suggestion and verify the created suggestion.

5) Edit a suggestion from the intranet and verify the suggestion is correctly modified.

6) Log in the OPAC and verify you can add a suggestion.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, suggestion created on staff and opac,
suggestion edited without problems, no koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script:
Also tested:
- adding suggestion from staff and OPAC
- edit suggestion from staff
- deleting suggestion from OPAC
- changing to a normal status (email got created)
- changing to a custom status (SUGGEST_STATUS)
- display of custom status in OPAC

No problems found.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:00 -03:00
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
Jacek Ablewicz
4c6fde24e8 Bug 10519: (followup) Fix context for evalyating $borrowernumber
Follow-up to fix additional suggestion statuses, which are not working
properly due to

   416:  borrowernumber           => $input->param('borrowernumber'),

being evaluated in list context inside $template->param() call arguments.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-14 16:02:36 -03:00
Jacek Ablewicz
e19736fa83 Bug 10519: Suggestions: 'Organize by' and correct display of tab descriptions broken
The tabbed display in suggestions offers different options to organize
the tabs. The descriptions on the tabs and some of the search options were
not working correctly, displaying as "Unknown".

To test:
- Add several suggestions to your installation, make sure you have:
  - suggestions from different users
  - suggestions managed by different users
  - suggestions with different statuses
  - suggestions with different selected item types

Test all the 'organize by' options (except "Organize by: Library"
- see note below), make sure that the tabs and search options
have correct descriptions and do no longer display as "Unknown".

- Add 1 or 2 custom status to SUGGEST_STATUS authorized value.
  - Verify display is still correct and your new status are displayed.

Note: "Organize by: Library" option is currently severely broken
(and not easily fixable, especially for 'IndependentBranches'
enabled). But this turns out to be a separate issue, with a different
underlaying causes, and it's outside the scope of this patch.
This should be dealt with later, in it's own bug report.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-14 16:02:20 -03:00
Galen Charlton
fb8d47beda Bug 4068: (follow-up) use URI::Escape
This allows for suggestions that contain characters such
as the ampersand to have their status changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-08 16:36:10 +00:00
769f18a6a9 Bug 4068: ensure accepting a suggestion does not hide the 'pending' tab
Prior to this patch:

1) Moving a suggestion from status 'pending' to 'accepted
   - After saving only tab 'accepted' is shown.
2) Moving a suggestion back from 'accepted' to 'pending'
   - After saving only tab 'pending' is shown.

Test Plan:
1) Verify the bug by taking the actions listed above
2) Apply this patch
3) Verify the bug no longer exists

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It is not very elegant but I have nothing else to suggest.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-08 16:35:32 +00:00
fb4025b67b Bug 10277 - Add C4::Context->IsSuperLibrarian()
The method of checking the logged in user for superlibrarian privileges
is obtuse ( $userenv && $userenv->{flags} % 2 != 1 ) to say the least.
The codebase is littered with these lines, with no explanation given. It
would be much better if we had one subroutine that returned a boolean
value to tell us if the logged in user is a superlibrarian or not.

Test Plan:
1) Apply this patch
2) Verify superlibrarian behavior remains unchanged

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-30 15:47:23 +00:00
87aabcd249 Bug 9261: (follow-up) remove reference to deprecated DHTMLcalendar
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-15 00:23:59 +00:00
8505942344 Bug 9261: (follow-up) fix various issues identified during QA
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-15 00:22:11 +00:00
be51854e46 Bug 9261 - Allow librarians to make purchase suggestions for patrons
This patch adds a new tab to the patron side menu for purchase
suggestions.  From this new tab, a librarian can view the patron's
existing purchase suggestios and also create new suggestions in the
name of that patron.

Test Plan:
1) Apply patch
2) Ensure the system preference 'suggestions' is enabled
3) View the details for a patron
4) Click the new 'Purchase suggestions' tab
5) Click the 'New purchase suggestion' button
6) Add the new purchase suggestions
7) You should now end up back at the borrower's purchase suggestions
8) Verify the new purchase suggestion was added

Signed-off-by: Corey Fuimaono <agent.075@gmail.com>

Step though the test plan. All OK.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-15 00:20:23 +00:00
Jonathan Druart
e2b49e1e28 Bug 9307: QA Followup
- Remove an old DHTMLcalendar_dateformat variable
- Add SUGGEST_STATUS to the "Koha system categories"

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2013-06-19 07:19:39 -07:00
490688ea53 Bug 9307 - Allow libraries to add/edit status for suggestion management.
This patch allows for the addition of new suggestion status by adding
authorised values of the category SUGGEST_STATUS

I sign it off. Details of my test plan :
1. Applying the patch
2. Checking existing suggestions, in staff view and opac :  ok
3. Creating a new suggestion in staff and in opac :  ok
4. Moving a suggestion into one of the old categories : ok
5. Adding a new authorized value category named SUGGEST_STATUS and fill it with 3 values :
value    Description    Description (OPAC) =)>
tata    tatapro         tataopac
titi    titipro         titiopac
toto    totopro         totoopac
For "tata", I defined a branch restriction on branche B.
6. Connecting in staff interface as a librarian of branch A : I could only use codes titipro and totopro. On OPAC, these codes were displayed as totoopac and titiopac
7. Connecting as librarian of branch B : I could use the 3 codes
8. Checking tabs visible : new tabs for tata, titi, toto, but also a new "Unknown" tab with 0 record.

Maybe point 8 could be fixed in a followup.
I sign off the patch.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2013-06-19 07:19:38 -07:00
b00ec06968 Bug 10080 - Change system pref IndependantBranches to IndependentBranches
Test Plan:
1) Enable IndependantBranches
2) Apply this patch
3) Run updatedatabase.pl
4) Verify that the system preference still functions correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-22 07:58:23 -07:00
Fridolyn SOMERS
fe48757668 Bug 9226: Wrong branch filter after suggestion creation
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Before the patch, upon submitting a new suggestion in the staff client I
was redirected to a view which was not filtered by branch. After the
patch I was redirected to a view which was filtered by my logged-in
branch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-15 08:34:11 -05:00
Jonathan Druart
a469663d7b Bug 9108: Followup: send the dateformat value from C4::Auth
- the dateformat value is send to all templates (from
  C4::Auth::get_template_and_user)
- remove all assignment of dateformat in all .pl files
- the DHTMLcalendar_dateformat variable is unused

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed conflicts:
 - opac/sco/sco-main.pl
 - reports/acquisitions_stats.pl
 - tools/cleanborrowers.pl

All tests pass, perlcritic problems appeared in some files
before and after these patches were applied.

Checked sorting in following pages:
- acqui/addorderiso2709.tt - list of staged imports in acq
- acqui/histsearch.tt - sorting of dates in acq search result list
- acqui/invoices.tt - billing date in list of invoices in acq
- acqui/lateorders.tt - list of late orders in acq
- acqui/ordered.tt - ordered titles and estimated costs for a fund
- acqui/parcels.tt - receive shipment page
- acqui/spent.tt - received titles and actual costs for a fund
...
- serials-search.tt - subscription search result list
...
- opac/sco/sco-main.tt - due dates in list of checked out items
- reports/acquisitions-stats.tt - date searches, display of dates
- tools/cleanborrowers.tt
- tools.holidays.tt - different views of dates library is closed,
  adding dates

Checked dates display according to system preference everywhere and
searching, entering dates etc. still worked as expected.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-17 21:59:30 -05:00
Fridolyn SOMERS
7ca9093f03 Bug 8443: Suggestions publication year and copyright date
Main patch correcting suggestions search :
- allow filtering on copyrightdate, manageddate and accepteddate
- entered dates remains in filter during search
- empty and null values are in the same tab
- null/empty values are not present in filers comboboxes

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-15 22:10:59 -05:00
Fridolyn SOMERS
81823c55cc Bug 8440: Dates does not appear in suggestions management
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-24 17:04:32 +02:00
Julian Maurice
203757e353 Bug 7304: More permissions for budgets
- Possibility to add users to a budget
- Restrictions changed to:
  - None
  - Owner
  - Owner and users
  - Owner, users and library
- Restricted users cannot spent on these budgets (they cannot modify them
  either)

Modified pages:
 - admin/aqbudgets.pl
 - admin/aqplan.pl
 - suggestion/suggestion.pl
 - acqui/acqui-home.pl
 - acqui/addorderiso2709.pl
 - acqui/basket.pl
 - acqui/neworderempty.pl

Unit tests in t/Budgets/CanUserUseBudget.t and t/Budgets/CanUserModifyBudget.t

Bug 7304 tmp

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-27 16:25:44 +02:00
Adrien Saurat
abf03414c3 Bug 7871: prevents crash when suggestion linked to erased budget
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 13:41:16 +02:00
Matthias Meusburger
24bbe80563 Bug 7300 : Show working branch suggestions by default
By default, let the librarian see only suggestions made by patrons of his library.
The patron can choose to see other's as well, it's just the default.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 05:57:59 +01:00
Paul Poulain
90ba8e846a bug 7086 follow-up: removed warn 2012-03-20 13:48:33 +01:00
Adrien Saurat
dc18719e3a Bug 7086 : "suggested by" fixed for staff members
Now:
- suggested by is stored when a staff member makes a suggestion
- managed by is only updated when a suggestion is edited (not when
it is created)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-20 13:46:41 +01:00
Jonathan Druart
e70728ff47 Bug 7577: Adds a display page for suggestions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
2012-03-12 13:52:22 +01:00
Katrin Fischer
624b1562d8 Bug 6894: Order from suggestion defaulting to wrong currency
This problem turned out to be a bit different, than I initally thought.

This patch fixes the currency selections for new orders created in staff.
Before this patch, the first currency in the list was selected instead
of the active currency. So you needed to change it explicitly.

After patch it should work like this:

1) Suggestion created in OPAC - currency defaults to NULL in database
2) Editing a suggestion created in OPAC will default to active currency.
3) Creating a new suggestion in staff will default to active currency.
4) When ordering, the currency will default to the vendor currency, if no
currency is set in the suggestion. (still happens, when suggestions are accepted
in batch from the list.

I hope this is right - comments and testing appreciated.

Signed-off-by: Liz Rea <lrea@nekls.org>
Verified that in the above places, active currency was displayed or selected. Tested both suggestions entered from the OPAC and from the intranet.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Verified the existence of the bug, and that the fix works as advertised.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-28 10:22:04 +01:00
Katrin Fischer
e660cef0e2 Bug 7117: Bug 7117 - Small display problems when organising suggestion tabs by name
To test:
1) Add some suggestions
2) Go to suggestions in staff
3) Choose from filters 'suggested by' or 'managed by'
4) Compare names shown on tabs with names in list of suggestions

Before patch: tab name has the wrong order, while list name is correct.
After patch: all names should be consistent and correct.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-05 05:58:54 +01:00
Colin Campbell
b5b71339f3 Bug 5453 Move declarations out of conditionals
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-15 15:50:23 +12:00
Frédérick Capovilla
0a43ba114d Corrects an error when showing a suggestion linked to a deleted budget.
If a suggestion is associated to a budget that was deleted, an error was
returned because we try to get the name of a budget that doesn't exist.
With this fix, the page is shown without errors.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-05 10:04:08 +12:00