Commit graph

248 commits

Author SHA1 Message Date
Galen Charlton
1e84b1217a Bug 10481: (follow-up) fix typo in POD
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 15:08:42 +00:00
Jonathan Druart
f8eb19163b Bug 10481: FIX No enrollment fee when changing patron category.
When a patron changes to a category with enrollment fee, they
are not generated.

Test plan:
- Choose a category without fee (e.g. Kid)
- Add an enrollment fee for another category (e.g. Young adult)
- Choose a kid and change his category to "Young adult".
- Note the warning message "Fees & Charges: Patron has Outstanding fees
  & charges of XX" on the check out page.

This patch also moves all instances of adding the enrollment fee
to a new routine in C4::Members, AddEnrolmentFeeIfNeeded(), so
additional tests include:

- Register a new patron and give it a category that has
  an enrollment fee.  Verify that the fee is charged.
- Renew the patron.  Verify that the additional fee is charged.
- Register a new patron with a child patron category.
- Use the 'update child to adult' menu option to change the
  patron's category to one that is fee-bearing.  Verify that the
  enrollment fee was charged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 15:07:50 +00:00
Galen Charlton
a36b3ad43a Bug 7785: (follow-up) standardize POD
This makes the POD for the columns() function consistent
with the rest of C4/Members.pm.  It also removes a note
that can be relegated to the bug report and the Git
history.

Also, since C4::Members::columns() is not actually a
class method, this patch changes the invocation to
not call it that way.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-13 16:15:30 +00:00
Mark Tompsett
07716ca15b Bug 7785: remove MySQL-specific syntax from C4::Members::columns()
The initial thought was to remove this function. However,
tools/import_borrowers.pl uses it. So rather than remove
it to solve the problem, it was reworked to a more generic
solution which runs faster.

By accessing $sth->{NAME} directly, the driver becomes
responsible for filling it correctly. This happens when a SELECT
is done on the borrowers table. It does not even have to have
data in the result set!

The columns method could be more generic and used elsewhere too.
Comparison between the old method and the STH method showed a
significant time difference. The old method took 35 seconds
for 40k iterations versus 19 seconds for the same amount of
iterations with the STH method regardless of the size of the
borrowers table.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-13 16:14:35 +00:00
Colin Campbell
ced4ca4e2d Bug 10529: Remove hardcoded dollar from patron message
The message fields which are returned in the SIP
Screen message field in a Patron Information response
had the dollar symbol hardcoded.

It would be possible to get the symbol from currency
but omitting any symbol would be consistent with the UI
and avoid problems with devices using weird encodings
for local currency symbols (e.g. the many variations
of UK Pound sign)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-12 20:26:13 +00: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
b900f5f056 Bug 9014 - Add time due to slips
This patch modifies Koha::DateUtils::output_pref to support the new system preference TimeFormat, which defines the visual format for a time as either the 24 hour format ( default ), or the 12 hour format (HH:MM AM/PM).

The patch also modifies C4::Members::IssueSlip to use output_pref rather than format_date.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Issue an item to a patron, verify the times are in 24 hour format.
4) Switch TimeFormat to the 12 hour format.
5) Revisit the patron record you issued an item to, times should now be in a 12 hour format.
6) Print a slip for this patron, you should now see the time as well as the date.

Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests after fixing the test count in t/DateUtils.t.
Fixed conflicts in syspref.sql and updatedatabase.pl.

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
As we have another sign-off on this now I gave it a quick
run through and it works as expected.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 11:07:42 -04:00
271bfff521 Bug 9718 - Add POD and comments for Check_Userid and Generate_Userid subs
Add plain English explanations in POD blocks for how the Check_Userid and Generate_Userid subs work.

Also add a comment explaining how the do loop works with the while condition in Generate_Userid, since the condition is worded awkwardly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
String patch adding documentation.
POD test and other tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 09:57:21 -04:00
Fridolyn SOMERS
7061e74676 Bug 9103: overdue_notices.pl should use AutoEmailPrimaryAddress syspref
Script overdue_notices.pl creates a printed letter if borrower as no email.
Actually, unless --email option is used, first valid email of borrower is used. Email field should depend on AutoEmailPrimaryAddress syspref like in other letter creations.

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Following test plan from Julien Sicot from Bugzilla:

- with patron's email address specified on "primary email"
  field AND syspref "AutoEmailPrimaryAddress" on "home"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  field AND syspref "AutoEmailPrimaryAddress" on "work"
  => notice sent to patron | OK

- with patron's email address specified on "alternate email"
  field AND syspref "AutoEmailPrimaryAddress" on "alternate"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  OR "alternate email" field AND syspref "AutoEmailPrimaryAddress" on "home"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email" OR
- with patron's email address specified on "primary email" field
  AND syspref "AutoEmailPrimaryAddress" on "home"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email" field
  AND syspref "AutoEmailPrimaryAddress" on "work"
  => notice sent to patron | OK

- with patron's email address specified on "alternate email" field
  AND syspref "AutoEmailPrimaryAddress" on "alternate"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  OR "alternate email" field AND syspref "AutoEmailPrimaryAddress"
  on "home"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email"
  OR "secondary email" field AND syspref "AutoEmailPrimaryAddress"
  on "alternate"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email"
  OR "secondary email" OR "alternate email" field and syspref
  "AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK"secondary email" field AND syspref "AutoEmailPrimaryAddress" on "alternate" => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email" OR
  "secondary email" OR "alternate email" field and syspref
  "AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK

Note: Options for AutoEmailPrimaryAddress should be like the field names  on
the patron form (primary, secondary...), but this is outside the scope of this
patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-19 22:50:39 -04:00
Bernardo Gonzalez Kriegel
9205e732fb Bug 9827: remove 'insecure' system preference
This patch removes 'insecure' system preference.

Also removes remaining code that make use of
the preference. It's broken anyway.

Only remains a reference in POD of C4/Boolean.pm

To test:
1) If you like, enable 'insecure' syspref. Broken system.
WARN: be prepared to revert value in database.

2) Apply the patch

3) Run updatedatabase.pl

4) Check that Staff login proceeds as usual.

5) Check that 'insecure' syspref is no more.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: Remove 2 occurrences of insecure (in comment only)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-19 21:46:34 -04:00
Liz Rea
63412f0ecd Bug 8682 - Renewals do not appear on quick slips
To test:
Issue two books to a patron.
Do a renewal on one of them.
update the issuedate on the item that has been renewed to something before today (renewals on the same day will work even without this patch)
I did: select * from issues;
update issues set issuedate="2013-01-25 14:00:00" where itemnumber = 948; (itemnumber is variable depending on your test data.)

Print a quick slip before the patch - the renewal will not show up as one of today's issues.
Print a quick slip after the patch - the renewal will show up as one of today's issues.

If you need reasoning as to why a renewal should show up on the quick slip, think of it as a record of everything
a borrower did today, without the hassle of overdues.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-24 10:10:30 -05:00
Robin Sheat
3582ac806c Bug 9592 - remove db-dependency from Members.pm
This was causing test cases to fail on package builds, introduced in bug
7243.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-15 08:06:51 -05:00
Srdjan
95077493bd Bug 7243: Rewording and renaming
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passed-QA-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-24 09:17:12 -05:00
Srdjan
1b4a266915 Bug 7243: Be selective when summing up charges for blocking issues
Added RentalsInNoissueCharges and ManInvlsInNoissueCharges sys prefs

Created C4::Members::cwGetMemberAccountBallance()
* A wrapper for GetMemberAccountRecords that gives info on non-issue and
  other charges
* Other charges are:
  'Res'
  'Rent' if RentalsInNoissueCharges is Mo
  authorised_values MANUAL_INV if ManInvlsInNoissueCharges is No

C4::Members::GetMemberAccountRecords() changes:
* Dropped input param $date, it is not used

Use split charges in C4::Circulation::CanBookBeIssued() and
C4::Members::patronflags(). That way only fines decide whether an item
can be issued, and not other non-fine charges

Signed-off-by: Marc Veron <veron@veron.ch>

Rebased (updatedatabase.pl)

ManInvInNoissueCharges and RentalsInNoissueCharges ar both included by default (= behaviour as before)

All variants tested: Both included, none included, manual invoice included, rentals included.
Works fine, blocks/does not blok as appropirate, messages appear as expected.

[Oct 12, 2012 marcelr:] Amended for updatedatabase.pl
Signed-off-by: M. de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-24 09:12:59 -05:00
280037da0c Bug 9076 - QA Followup - Rename GetBorrowersWhoHaveNotBorrowedSince to GetBorrowersToExpunge
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-07 22:01:36 -05:00
568a4c1230 Bug 9076 - Add ability to delete borrowers by expiration date and category code to cleanborrowers.pl
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested per plan, works. Staff category is not shown, and patch passes automated testing.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-07 22:01:35 -05:00
Jared Camins-Esakov
c27a981856 Merge branch 'bug_7919' into 3.12-master 2013-01-02 16:51:37 -05:00
Jonathan Druart
7dacc32501 Bug 7919: FIX the "all" categories method
The C4::Category->all method must return fields from the categories
table only.
Without this patch, there is 2 "categorycode" values, the second one is
sometimes undef (if no branch limitation).

same for the GetBorrowercategoryList routine (some category codes are
undefined)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed off for also fixing problems with patron searching noted by Katrin.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Problems fixed by this patch include:
- on patron search result list the category description is shown again
- it's possible to limit a patron search to a patron category again

All tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-02 16:50:52 -05:00
92782d3832 Bug 7067 - OPAC Borrower Self Registration
This development will add the ability for a new patron to register
himself or herself. The self-registration will attempt to match this
newly inputted data to any existing patrons and if any possible matches
are found, ask if the patron is sure he or she doesn't already have an
account at the library. A system preference may be set to prevent patron
self-registration if the system detects the possibility that the person
may already have an account.

Once the patron has registered, passing a captcha (or similar
bot-stopper), the patron will then be optionally verified a second time
via email. At this point, the patron will be able to print a temporary
library card (optional by system preference), and will be provided any
details necessary to access electronic resources (this body of text
would be a template in the slips and notices system). At the library's
choice, this new patron would either be set to a temporary patron status
(patron type set via system preference), or a fully-fledged patron
(allow patron type to be determined by age and/or other attributes).
Assuming the library uses temporary patron types for OPAC registrations,
this patron will next enter a queue and would need to physically enter
the library to verify himself and become a fully-fledged patron (most
likely by bringing in physical proof of address, etc.). The librarian
would look up the patron record and modify the patron type. If a
temporary patron has not been verified within a certain time frame
(defined by a system preference), the patron record will be deleted
from the system via a cron job.

For registered patrons, the system will allow each person to also
update his or her personal data via the OPAC. When a patron updates his
or her information, the changes will be entered into a queue to be
verified by a librarian (preventing a patron from inputting obviously
bogus data). The staff client home page will display the number of
patron records with changes awaiting approval. A librarian would then be
able to click through a list of modification requests, and approve or
deny each (with approval and denial alerts being sent to the patron via
the standard messaging system).

NEW SYSTEM PREFERENCES
* PatronSelfRegistration
* PatronSelfRegistrationDetectDuplicates
* PatronSelfRegistrationVerifyByEmail
* PatronSelfRegistrationPrintTemporaryCard
* PatronSelfRegistrationUseTemporaryStatus
* PatronSelfRegistrationExpireTemporaryAccountsDelay

NEW NOTICE
* Verify by email notice

NEW SLIP
* Temporary card slip

NEW CRON JOB
* delete_expired_opac_registrations.pl
  - Deletes patrons that have not been upgraded from the temporary
    status within the specified delay
* delete_unverified_opac_registrations.pl
  - Deletes the unverified patrons based on the length of time specified
    in the PatronSelfRegistrationExpireTemporaryAccountsDelay

The patron will register from self_registration.pl, linked off opac-main.pl if enabled. The registration page will be translatable to other languages in the same way that existing templates are.

Test Plan:
1) Enable PatronSelfRegistration
2) Set PatronSelfRegistrationExpireTemporaryAccountsDelay to a number
   of days
3) Create a self-registered borrower category
4) Set PatronSelfRegistrationUseTemporaryStatus
5) Set PatronSelfRegistrationVerifyByEmail to "Don't require"
6) Go to OPAC, log out if logged in.
7) You should see the "Register here" link below the login box
8) Attempt to register yourself
9) Verify you can log in with your temporary password.
10) Set PatronSelfRegistrationVerifyByEmail to "Require"
11) Attempt another self-registration
12) Check the messages table, you should see a new message with a
    verification link.
13) Copy and paste the link into a web browser to verify the registration
14) Log in with the given credentials to verify the account was created.

Test Plan - Part 2 - Borrower Modifications

1) Log in to OPAC, go to "my personal details" tab.
2) Make some modifications to your details.
3) Repeat steps 1 and 2 for two more borrowers.
4) Log in to Koha intranet with a user that can modify borrowers.
5) At the bottom of mainpage.pl, you should see:
  Patrons requesting modifications: 3
6) Click the link
7) Approve one change, deny a different one, and ignore the third, then
   submit.
8) Check the records, you should see the changes take affect on the
   approved one, and no changes to the other two. You should also see
   "Patrons requesting modifications: 1" at the bottom of mainpage.pl
   now.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Bug 7067 - OPAC Borrower Self Registration - Followup

* Rename PatronSelfRegistrationUseTemporaryStatus to PatronSelfRegistrationDefaultCategory
* Hide register link unless PatronSelfRegistrationDefaultCategory is set.
* Add invalid token page
* Add documentation and switches to cron scripts
* Add required fields check for editing exiting patrons
* Don't force require email address for existing patrons when
  PatronSelfRegistrationVerifyByEmail is enabled.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-14 08:08:59 -05:00
Jonathan Druart
acbfe26c9e Bug 7919 : Display of values depending on the connexion library
In a librairies network, we would like to declare specific values just
for one (or more) library.
Here we implement the ability to associate categories, patron attributes
types and/or authorised_values with librairies (branches).

This patch adds 3 new association tables:
- categories_branches ( association table between categories and branches )
- authorised_values_branches ( association table between
  authorised_values and branches )
- borrower_attribute_types_branches (association table between
  borrower_attribute_types and branches )

Plan test:
  - Create (or modify) categories, patron attributes and
    authorised_values and link it with one (or more) library.
  - Set one of these librairies
  - Go to one of the multiple pages where this specific value must be displayed
    and check that it does appear.
  - Set a library not concerned.
  - Check on the same pages this value is doest not appear.

A page list:
cataloguing/addbiblio.pl
cataloguing/additems.pl
members/members-home.pl
members/memberentry.pl
acqui/neworderempty.pl
tools/modborrowers.pl
and others :)

Please say me if filters don't work on some pages.

Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>
Signed-off-by: Koha Team Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-05 10:10:57 -05:00
Colin Campbell
ef7ebc4ed4 Bug 8017 reduce manipulation of GetAllIssues return
GetAllIssues can produce large lists
For performance purposes:
Dont loop over the list without cause
Dont do expensive processing in the loop
Dont needlessly copy the array
Do display formatting in the template
Dont extract the barcode list unless we are producing it
Reduce db calls by using the data to hand

Make the table in the template a bit more readable
where everything was stuffed into one line

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 18:51:45 +02:00
787aa9819c Bug 8533 - Non-numeric cardnumbers screw up autoMemberNum
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Removes a warning from mysql:
    Truncated incorrect INTEGER value: 'P13000'

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-31 18:23:43 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
Katrin Fischer
21fb688276 Bug 7411: Remove diacritics from generated userid
Patch introduces a new module Text::Unaccent.

To test:
1) Add a new patron with diacritics in surname and first name, leave userid empty.
2) Save user and check the created userid has only the base characters and
diacritics have been removed correctly.
3) Create another user with the same surname and first name, check userid
is generated correctly.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 16:43:39 +02:00
Liz Rea
e4c1e89691 Bug 8129 - Quickslips not printing
Implemented from the suggestions attached to the bug.

To test:
Check out a book to a patron
Click print -> quick slip

Slip should show only today's checkouts.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-05 15:29:43 +02:00
Srdjan
722ca127dd bug_8056: sorted out slip print calls
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
preference works as expected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Tested that CircAutoPrintQuickSlip clear the screen still works well
2012-05-28 13:52:39 +02:00
D Ruth Bavousett
b023de813b Bug 8009: Item descriptive data not populated on pay.pl
GetBorNotifyAcctRecord was not populating the {title} element of the
hash, which pay.tt will use.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-25 17:26:02 +02:00
Jonathan Druart
a6c6946dfc But 5742: Batch edit patrons
new permission : edit_patrons

Plan test:
- Go on the page: tools > Patrons modification (modborrowers.pl)
- Enter a list of cardnumbers (or use a file)
- Modify one or more patron's fields (you can modify surname, firstname,
branchname, category, sort1, sort2, date of enrollment, date of expiry,
debarred date, debarred comment and borrower note)
- Save
- Check on the result page (or in database for non-displayed fields) if
modifications have been correctly made.
- re test with different attributes. For each attributes filled with an
authorized value category, you can select a value in a drop-down list.
Else it's a free input text. If your attribute is filled with a patron
category, the modification performs only on patrons belonging to this
category
- Save
- Verify on the result page

Signed-off-by: Mathilde Formery <mathilde.formery@ville-nimes.fr>
Signed-off-by: Stéphane Delaye <stephane.delaye@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-15 17:44:19 +02:00
Paul Poulain
90d13965d3 Revert "Bug 7785: Remove unused function columns() which uses a MySQLism."
This reverts commit 1c8df08aea.

See:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7785#c5
and
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7975

This patch broke tools/import_borrowers.pl

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 10:21:58 +02:00
Marc Balmer
1c8df08aea Bug 7785: Remove unused function columns() which uses a MySQLism.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-05 10:31:49 +02:00
Elliott Davis
49c35ba38e Bug 5549 : fixed datetime issue so time is shown in output for circulation.pl and moremember.pl 2012-03-20 13:41:25 +13:00
Colin Campbell
7c260e550e Bug 5549 : replace curdate with now in a couple of sql lines
duedate is now datetime and comparing with curdate
causes a system error
2012-03-20 13:20:42 +13:00
Colin Campbell
f74da1e834 Bug 5549 : GetPendingIssues now returns DateTime objects
Show due times in addition to dates in using screens
2012-03-20 12:33:37 +13:00
Colin Campbell
00bf7cc774 Bug 5549 : Get basic 24 Hr loan working 2012-03-20 12:13:34 +13:00
Paul Poulain
2eb590c269 C4::Members follow-up
Overdues already loaded, must set full sub patch

http://bugs.koha-community.org/show_bug.cgi?id=6875
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Fixes issue with circ/branchoverdues.pl
Passes tests.
2012-03-19 17:49:40 +01:00
Robin Sheat
4cbeeedbe8 Bug 6296: allow users to be authenticated by SSL client certs
This adds a new syspref: AllowPKIAuth. It can have one of three states:
* None
* Common Name
* emailAddress

If a) this is set to something that's not "None", and b) the webserver
is passing SSL client cert details on to Koha, then the relevant field
in the user's certificate will be matched up against the field in the
database and they will be automatically logged in. This is used as a
secure form of single sign-on in some organisations.

The "Common Name" field is matched up against the userid, while
"emailAddress" is matched against the primary email.

This is an example of what might go in the Apache configuration for the
virtual host:

    #SSLVerifyClient require # only allow PKI authentication
    SSLVerifyClient optional
    SSLVerifyDepth 2
    SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
    SSLOptions +StdEnvVars

The last line ensures that the required details are
passed to Koha.

To test the PKI authentication, use the following curl command:
    curl -k --cert client.crt --key client.key  https://URL/
(look through the output to find the "Welcome," line to indicate that a user
has been authenticated or the "Log in to Your Account" to indicate that a
user has not been authenticated)

To create the certificates needed for the above command, the following series
of commands will work:
    # Create the CA Key and Certificate for signing Client Certs
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    # This is the ca.crt file that the Apache config needs to know about,
    # so put the file at /etc/apache2/ssl/test/ca.crt

    # Create the Server Key, CSR, and Certificate
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.csr

    # We're self signing our own server cert here.  This is a no-no in
    # production.
    openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
        -set_serial 01 -out server.crt

    # Create the Client Key and CSR
    openssl genrsa -des3 -out client.key 1024
    openssl req -new -key client.key -out client.csr

    # Sign the client certificate with our CA cert. Unlike signing our own
    # server cert, this is what we want to do.
    openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
        -set_serial 02 -out client.crt
    openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12
    # In theory we can install this client.p12 file in Firefox or Chrome, but
    # the exact steps for doing so are unclear, and outside the scope of this
    # patch

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested with Common Name and E-mail authentication, as well as with PKI
authentication disabled. Regular logins continue to work in all cases when
SSL authentication is set to optional on the server.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
QA comment: synchronized updatedatabase.pl version of syspref with sysprefs.sql
version, to avoid divergent databases between new and upgrading users.
2012-03-19 17:02:44 +01:00
Srdjan Jankovic
a9ded4fa00 bug_7001: Issue and Reserve slips are notices.
Branches can have their own version of notices - added branchcode to
letter table.
Support html notices - added is_html to letter table.
Support for borrower attributes in templates.
GetPreparedletter() is the interface for compiling letters (notices).
Sysprefs for notice and slips stylesheets
Added TRANSFERSLIP to the letters

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-09 10:11:20 +01:00
Koustubha Kale
bafc25c9d2 Renew membership from expiry date or from current date based on a syspref
This patch adds a system preference under Patron -> BorrowerRenewalPeriodBase
Using this preference the patch allows renewal of Patron account either from todays date or from existing expiry date in the patrons account.

To test : Apply patch; Set System Preference BorrowerRenewalPeriodBase ( under Patron ) to "current membership expiry date";
Renew a patron; You will observe that patrons account expiry date has been calculated from previuos expiry date instead of today's date
( as is the default in Koha prior to this patch ).
2012-02-01 22:53:40 +01:00
Chris Cormack
288c1a768d Bug 7139 : Log addition and deletion of circulation messages
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Changed the two action names into caps no-spaces.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-13 18:05:04 +01:00
Paul Poulain
41b42dbe32 Bug 6328 follow-up for QA comments
* fixed documentation in C4/Auth_with_ldap.pm
* updated ILSDI/Utility.pm to work with debarred being a date
* updated Members.pm/patronflags to work with debarred being a date (copy/paste of BibLibre code that had not been backported)
* fixed opac-reserve to check correctly for debarred status

I also have removed a duplicate line on circulation.pl when the patron was restricted = the information was displayed twice
2011-11-25 14:00:47 +01:00
Paul Poulain
1fe3514c3c Bug 6328 fine in days does not work
Some code coming from BibLibre has been lost in the process of inclusion in
3.4. The result is that fine in days does not work at all (you can setup rules,
but it does nothing)

Step to reproduce:

- Koha > Admin > circ rules > set 1 day fine every day of overdue for default
  rule
- Issue a book return date last week
- check-in the book => no debarment is set

The following patch will fix all of those problems by :

* updating borrowers.debarred to a date field (instead of tinyint). It contains
  the limit of the debarment
* changing API of DebarMember and UpdateBorrowerDebarred to pass a date
* display debarrdate where applicable. Note that a debarrdate of 31/12/9999 is
  considered as unlimited and not displayed
* added a debarrcomment, usefull to explain why a patron is debarred (this is
  independant from debarrdate changes and can be used when placing an unlimited
  debarment too)

[2011-05-12] F. Demians. It works as described. And I can confirm this
functionality is impatiently awaited by French libraries since one year. Thanks
BibLibre for the good work and for contributing this code.

Bug 6328 Followup--update DB structure

Thanks Katrin.

Bug 6328: make comment a textbox / fix debar by notice trigger

Debarring by notice triggers was broken, because the new function
expects a date as second parameter.

The comment field in patron account details was a very long text field.
Patch changes it to be a textbox instead.

Bug 6328: Lift debarment leaves patron account

'Lift debarment' redirects to an empty circulation page.

BZ6328 follow-up 3

Fixes comment 23 from Fernando L. Canizo : when the patron was debarred and debar removed
he still could not check-out.

The changes in the IsMemberBlocked (that were on biblibre/master) were lost somewhere
The sub was still checking for old_issues instead of calling CheckBorrowerDebarred
to get a debardate if applicable

Note : this bug was appearing only is you had issuing rules defined for itemtype/categorycode/branch.
Seemed to work if you had only default rules. That's probably why it hadn't been spotted before

BZ6328 follow-up 4
Comments fron Zeno Tajoli: The patch is OK and I sign-off it. Two little changes done on
installer/data/mysql/kohastructure.sql and installer/data/mysql/updatedatabase.pl

Signed-off-by: koha <koha@kohabase.localdomain>
2011-11-25 14:00:47 +01:00
Srdjan Jankovic
2b2e544f05 Bug 6303: Display Organisation and Parent Organisation names when viewing a borrower of type organisation
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as advertised, doesn't affect display for non-organisational patrons.

Note: Display change in OPAC only affects the summary tab.
It would be a little bit more consistent to make the name show the
same on all tabs in OPAC patron account.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
I repeated Katrin's signoff here (with permission). The patch only changed for some minor rebasing and cosmetic QA requests. Passed QA now.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-24 11:30:08 +01:00
Srdjan Jankovic
18b8991cf1 bug_6253: Unified member Search()
Removed SearchMembers() and replaced with more generic Search()
Amended Search() to try cardnumber first
Replaced SearchMembers() calls with Search()
Replaced SELECT with Search() where appropriate
C4::SQLHelper:
- added support for '' key for search filter.
- when passing an array to filter, join with OR (rather than AND)
- added support for key => [val1, val2] in filter
- did not document - there was no input documentation to start with,
  and SQLHelper should be replaced with something better anyway

Signed-off-by: Liz Rea <lrea@nekls.org>
(again - testing merge issue)
The functionality of the patch seems to be maintained with Biblibre's changes.

I tested the following:
Extended attribute searching: works
3 part name searching: works
2 part name searching: works
1 part name searching: works

From:
mainpage.pl
members-home.pl
	Patron search limited by branch: Works
	Patron search limited by patron category: works
	Ordering by cardnumber instead of surname: works
The "Check Out" field in the masthead.

Circ Autocomplete is not reliably functional at this time, but the problem appears to predate this patch.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:23:02 +13:00
Colin Campbell
0cf8194d5f Bug 6667 Correct documentation of function
Return list was documented as being in the reverse order
to how it is returned. Correct the perldoc description

also removed comments which did not help anyone trying
to make sense of this subroutine

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Just improving text comments. No code changes involved.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 20:24:04 +13:00
Ian Walls
26acaf3dfa Bug 6801: checkoverdues returns unnecessary fields, causing slowness
Explicitly specifies which fields to return in C4::Overdues::checkoverdues
SQL:  all of biblio, items, and issues, and everything in biblioitems
EXCEPT marc, marcxml and timestamp.

Bug 6801: member details page taking long time to load when many checkouts present

This patch removes the call to GetMemberDetails in build_issue_data; this heavy-weight
subroutine was being run for every single item a patron (or their relatives) have checked out.
Instead, the borrowers first name, surname and cardnumber are added to the GetPendingIssues query.
I believe this is reasonable since GetPendingIssues can now return issues for multiple borrowers.

Also corrects the $borrowernumber used for GetIssuesCharges and CanItemBeRenewed; was using the borrower whose
page we were on, NOT the borrower of that specific item (which would be different in the Relatives Checkouts tab).

Template calls to [% scope.borrowername %] are now broken up into [% scope.firstname %] [% scope.surname %].

Signed-off-by: Liz Rea <lrea@nekls.org>
On my test data, a patron with 180 checkouts (without this patch) would take more than a minute to bring back the circulation.pl and moremember.pl pages.
With this patch, the time is reduced to 5 or so seconds.

Big ups to Ian for tenaciously hunting this one down.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-27 09:43:25 +13:00
Meenakshi.R
8b75f5b38c Bug:6781--Log membership renewal
If patron related logging is tuned on, log membership renewal

Signed-off-by: Amit Gupta <amit.gupta@osslabs.biz>
Signed-off-by: Nicole Engard <nengard@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-26 11:30:27 +13:00
Robin Sheat
4c1d203980 Bug 6857: display a charge warning alert for reserves
If a user is placing a reserve on the OPAC, this'll let them know that
it's going to cost them.

Author: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-11 21:35:52 +12:00
Colin Campbell
c435c8c7d1 Bug 6280 : Don't generate invalid SQL in GetPendingIssues
Change to parameter list in GetPendingIssues made it
callable by an empty list resulting in invalid sql being
sent to server. As this was occuring on most issues error log
was filling up. Put safeguard in the routine
Also don't bother calling when you have no need

Some of the processing was needlessly obscure

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-11 12:53:15 +12:00
902d19dfa9 Fix for Bug 5433 - Separate state field for cities
- Updates cities management (admin/cities.pl) to record a separate
  state and country field.
- Updates the cities table with these new columns
- Modifies the patron entry form to populate city, state, zip
  and country when the user chooses a prepopulated city entry

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-04 20:54:49 +12:00
Chris Cormack
8ae5719d16 Merge remote-tracking branch 'kc/new/bug_6521' into kcmaster 2011-08-01 11:32:43 +12:00