Bug 21890: Handle can_reset_password on the staff interface
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 31 Jan 2019 19:28:39 +0000 (16:28 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 12 Apr 2019 02:32:02 +0000 (02:32 +0000)
This patch makes the staff interface handle the new flag when editing
the categories. I didn't add the flag to the list of categories table
because it makes it too big, but can be easily added if required by
users or QA.

To test:
- Along with other patches from this bug, edit patron categories
=> SUCCESS: Notice the changes are correctly stored
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
admin/categories.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt

index b6b6975..ba0d11e 100755 (executable)
@@ -92,6 +92,7 @@ elsif ( $op eq 'add_validate' ) {
     my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
     my $checkPrevCheckout = $input->param('checkprevcheckout');
     my $default_privacy = $input->param('default_privacy');
+    my $can_reset_password = $input->param('can_reset_password');
     my @branches = grep { $_ ne q{} } $input->multi_param('branches');
 
     my $is_a_modif = $input->param("is_a_modif");
@@ -122,6 +123,7 @@ elsif ( $op eq 'add_validate' ) {
         $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
         $category->checkprevcheckout($checkPrevCheckout);
         $category->default_privacy($default_privacy);
+        $category->can_reset_password($can_reset_password);
         eval {
             $category->store;
             $category->replace_branch_limitations( \@branches );
@@ -148,6 +150,7 @@ elsif ( $op eq 'add_validate' ) {
             BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
             checkprevcheckout => $checkPrevCheckout,
             default_privacy => $default_privacy,
+            can_reset_password => $can_reset_password,
         });
         eval {
             $category->store;
index a7ddf14..ff48b74 100644 (file)
                     <span>Select <i>All branches</i> if this category type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
                     </span>
                 </li>
+                <li>
+                    <label for="can_reset_password">Password reset in OPAC: </label>
+                    <select name="can_reset_password" id="can_reset_password">
+                        [% IF category.can_reset_password %]
+                            <option value="0">Allowed</option>
+                            <option value="1" selected="selected">Not allowed</option>
+                        [% ELSE %]
+                            <option value="0" selected="selected">Allowed</option>
+                            <option value="1">Not allowed</option>
+                        [% END %]
+                    </select>
+                </li>
                 <li><label for="block_expired">Block expired patrons:</label>
                     <select name="BlockExpiredPatronOpacActions" id="block_expired">
                         [% IF not category or category.BlockExpiredPatronOpacActions == -1%]