From 16c5d8b0ce92e2969b506d6d11f0a63d82e95719 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Wed, 5 Dec 2007 12:43:46 -0600 Subject: [PATCH] Adding in permission blocks for staff members as per previous commits. Much of this is repeat of previous commits, and then some to finish off. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../prog/en/includes/circ-toolbar.inc | 41 +++++++++++++++---- .../prog/en/includes/members-toolbar.inc | 40 ++++++++++++++---- .../prog/en/modules/help/admin/categorie.tmpl | 16 ++++---- .../en/modules/members/memberentrygen.tmpl | 6 +-- members/deletemem.pl | 3 ++ members/member-flags.pl | 2 +- members/memberentry.pl | 10 ++--- 7 files changed, 88 insertions(+), 30 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc index a02c3cb7e3..cc10df5598 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc @@ -41,8 +41,12 @@ function confirm_reregistration() { var moremenu = [ { text: "Renew Patron", onclick: { fn: confirm_reregistration } }, - { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=",disabled: true, }, - { text: "Delete", onclick: { fn: confirm_deletion } }, + { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=", + + disabled: true, + + disabled: true, }, + { text: "Delete", disabled: true, onclick: { fn: confirm_deletion } }, ] new YAHOO.widget.Button({ @@ -64,12 +68,22 @@ function confirm_reregistration() { new YAHOO.widget.Button("addchild"); new YAHOO.widget.Button("editpatron"); new YAHOO.widget.Button("addnote"); - new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("changepassword"); new YAHOO.widget.Button("printslilp"); new YAHOO.widget.Button("printpage"); new YAHOO.widget.Button("renewpatron"); - new YAHOO.widget.Button("patronflags"); - new YAHOO.widget.Button("deletepatron"); + + + + new YAHOO.widget.Button("patronflags"); + + + new YAHOO.widget.Button("patronflags"); + + + new YAHOO.widget.Button("deletepatron"); + new YAHOO.widget.Button("deletepatron"); } //]]> @@ -90,8 +104,21 @@ function confirm_reregistration() { ">Add Note --> -
  • &destination=circ">Change Password
  • +
  • ">Change Password
  • +
  • ">Change Password
  • &print=page">Print Page
  • &print=slip">Print Slip
  • -
  • ">Renew Account
  • ">Set Permissions
  • ">Delete
  • +
  • ">Renew Account
  • + + + +
  • ">Set Permissions
  • + + +
  • ">Set Permissions
  • + + +
  • Delete
  • +
  • Delete
  • + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 4144df622f..12f3d5aa42 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -41,8 +41,12 @@ function confirm_reregistration() { var moremenu = [ { text: "Renew Patron", onclick: { fn: confirm_reregistration } }, - { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=",disabled: true, }, - { text: "Delete", onclick: { fn: confirm_deletion } }, + { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=", + + disabled: true, + + disabled: true, }, + { text: "Delete", disabled: true, onclick: { fn: confirm_deletion } }, ] new YAHOO.widget.Button({ @@ -64,12 +68,22 @@ function confirm_reregistration() { new YAHOO.widget.Button("addchild"); new YAHOO.widget.Button("editpatron"); new YAHOO.widget.Button("addnote"); - new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("changepassword"); new YAHOO.widget.Button("printslilp"); new YAHOO.widget.Button("printpage"); new YAHOO.widget.Button("renewpatron"); - new YAHOO.widget.Button("patronflags"); - new YAHOO.widget.Button("deletepatron"); + + + + new YAHOO.widget.Button("patronflags"); + + + new YAHOO.widget.Button("patronflags"); + + + new YAHOO.widget.Button("deletepatron"); + new YAHOO.widget.Button("deletepatron"); } //]]> @@ -90,8 +104,20 @@ function confirm_reregistration() { ">Add Note --> -
  • ">Change Password
  • +
  • ">Change Password
  • +
  • ">Change Password
  • &print=page">Print Page
  • &print=slip">Print Slip
  • -
  • ">Renew Account
  • ">Set Permissions
  • Delete
  • +
  • ">Renew Account
  • + + + +
  • ">Set Permissions
  • + + +
  • ">Set Permissions
  • + + +
  • Delete
  • +
  • Delete
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/categorie.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/categorie.tmpl index 4d0a11e184..7ff176e033 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/categorie.tmpl @@ -8,15 +8,17 @@

    This is where you define the types of users of your library and how they will be handled.

    -

    Category, Descriptions and Types

    -

    Start by assigning a Category Code and a Description to each patron category. Each Category can be one of four types:

    +

    Categories, Descriptions and Types

    +

    Start by assigning a Category Code and a Description to each patron category. Each Category can be one of five types:

      -
    • Adult Patrons can be linked as "guarantors" to other patrons who are their dependents.
    • -
    • Child Patrons a patron category that has a "guarantor"
    • -
    • Organisational Patrons can be used for institutional members, like other libraries that borrow from you, in which case Koha expects slightly different information about the institution;
    • -
    • Professional Patrons
    • +
    • Adult Patrons: can be linked as "guarantors" to other patrons who are their dependents.
    • +
    • Child Patrons: a patron category that has a "guarantor"
    • +
    • Organizational Patrons: can be used for institutional members, e.g. other libraries that borrow from you, in which case Koha expects slightly different information about the institution;
    • +
    • Professional Patrons
    • +
    • Staff Members: A member of the library staff.
    - +

    Note on Permissions

    +

    Patrons in any category type may be assigned permissions in the staff interface.

    Enrollment Period

    Enrollment period is a number indicating how many years a user's enrollment is valid. If you consider enrollments to expire after four years for example (as in a school, perhaps), then set this number to 4. If enrollments never expire, set this to an impossibly high number (99).

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index e126b83e96..82e1890c16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -1,7 +1,7 @@ Koha › Patrons › -<!-- TMPL_IF NAME="opadd" --> Add<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --> -patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!-- TMPL_ELSE -->Modify<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --> +<!-- TMPL_IF NAME="opadd" --> Add<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff <!--/TMPL_IF --> +patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!-- TMPL_ELSE -->Modify<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff<!--/TMPL_IF --> patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!-- /TMPL_IF --> @@ -459,7 +459,7 @@ patron - There is no category type to add an Adulta Childan Institutiona professionnal. + There is no category type to add an Adulta Childan Institutiona professionnala Staff Member. Please create one diff --git a/members/deletemem.pl b/members/deletemem.pl index 481355ca46..0aa7e5cc31 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -36,6 +36,9 @@ my $input = new CGI; my $flagsrequired; $flagsrequired->{borrowers}=1; +if( $bor->{'category_type'} eq 'S' ) { + $flagsrequired->{'staffaccess'} = 1; +} my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired); diff --git a/members/member-flags.pl b/members/member-flags.pl index 1106b2c044..e633c4a1c7 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -20,7 +20,7 @@ my $input = new CGI; my $flagsrequired = { permissions => 1 }; my $member=$input->param('member'); my $bor = GetMemberDetails( $member,''); -if(( $bor->{'category_type'} eq 'S' ) || ($bor->{'authflags'}->{'catalogue'} )) { +if( $bor->{'category_type'} eq 'S' ) { $flagsrequired->{'staffaccess'} = 1; } my ($template, $loggedinuser, $cookie) diff --git a/members/memberentry.pl b/members/memberentry.pl index 809ff48bef..e1ead4749a 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -73,7 +73,7 @@ my $default_city; my $check_categorytype=$input->param('check_categorytype'); # NOTE: Alert for ethnicity and ethnotes fields, they are unvalided in all borrowers form my $borrower_data; -my $noUpdateLogin; +my $NoUpdateLogin; my $userenv = C4::Context->userenv; $template->param("uppercasesurnames" => C4::Context->preference('uppercasesurnames')); @@ -111,8 +111,8 @@ if ($op eq 'insert' || $op eq 'modify' || $op eq 'save') { $newdata{'dateexpiry'} =format_date_in_iso($newdata{'dateexpiry'} ) if ($newdata{dateexpiry}); $newdata{'dateofbirth'} =format_date_in_iso($newdata{'dateofbirth'} ) if ($newdata{dateofbirth}); # check permission to modify login info. - if ($borrower_data && ($borrower_data->{'category_type'} eq 'S') && (! C4::Auth::haspermission($dbh,$userenv->{'id'},{'staffaccess'=>1}))) { - $noUpdateLogin =1; + if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($dbh,$userenv->{'id'},{'staffaccess'=>1})) ) { + $NoUpdateLogin =1; } } @@ -216,7 +216,7 @@ if ($op eq 'insert'){ if ($op eq 'save'){ # test to know if another user have the same password and same login unless ($nok){ - if($noUpdateLogin) { + if($NoUpdateLogin) { delete $newdata{'password'}; delete $newdata{'userid'}; } @@ -493,7 +493,7 @@ $template->param( CGIbranch => $CGIbranch, memberofinstution => $member_of_institution, CGIorganisations => $CGIorganisations, - noUpdateLogin => $noUpdateLogin + NoUpdateLogin => $NoUpdateLogin ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5