Bug 6190: BorrowerUnwantedField syspref and removing fields from the patron entry
authorSrdjan Jankovic <srdjan@catalyst.net.nz>
Mon, 10 Oct 2011 00:12:27 +0000 (13:12 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 6 Jan 2012 16:30:25 +0000 (17:30 +0100)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with example from bug and by deleting parts of it:
cardnumber|surname|firstname|title|othernames|initials|streetnumber|streettype|address|address2|city|state|zipcode|country|email|phone|mobile|fax|emailpro|phonepro|B_streetnumber|B_streettype|B_address|B_address2|B_city|B_state|B_zipcode|B_country|B_email|B_phone|dateofbirth|branchcode|categorycode|dateenrolled|dateexpiry|gonenoaddress|lost|debarred|contactname|contactfirstname|contacttitle|borrowernotes|relationship|sex|password|userid|opacnote|contactnote|sort1|sort2|altcontactfirstname|altcontactsurname|altcontactaddress1|altcontactaddress2|altcontactaddress3|altcontactstate|altcontactzipcode|altcontactcountry|altcontactphone

Note: This only affects the edit screen, not the patron detail tab.
A nice enhancement would be to make this page follow the system preference too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
QA comments on Bugzilla. Passing QA.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
* DBrev defined
* small improvement suggested by Marcel added = there is now a link to the schema page on the systempreference

admin/systempreferences.pl
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
kohaversion.pl
members/memberentry.pl

index 78d0768..f4069ae 100755 (executable)
@@ -224,6 +224,7 @@ $tabsysprefs{intranetreadinghistory}       = "Patrons";
 $tabsysprefs{NotifyBorrowerDeparture}      = "Patrons";
 $tabsysprefs{memberofinstitution}          = "Patrons";
 $tabsysprefs{BorrowerMandatoryField}       = "Patrons";
+$tabsysprefs{BorrowerUnwantedField}        = "Patrons";
 $tabsysprefs{borrowerRelationship}         = "Patrons";
 $tabsysprefs{BorrowersTitles}              = "Patrons";
 $tabsysprefs{patronimages}                 = "Patrons";
index 128c9b2..9777596 100755 (executable)
@@ -325,6 +325,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES (
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn           | a|a     d', NULL, NULL, 'Textarea');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
index a4942d8..d1d84bf 100755 (executable)
@@ -4585,6 +4585,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.07.00.005";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BorrowerUnwantedField','','Name the fields you don''t need to store for a patron''s account',NULL,'free')");
+    print "Upgrade to $DBversion done (BorrowerUnwantedField syspref)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index fd43bec..0e2f73b 100644 (file)
@@ -29,11 +29,16 @@ Patrons:
                no: "Don't"
          - default the card number field on the patron addition screen to the next available card number (for example, if the largest currently used card number is 26345000012941, then this field will default to 26345000012942).
      -
-         - "The following database columns must be filled in on the patron entry screen:"
+         - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:"
          - pref: BorrowerMandatoryField
            class: multi
          - (separate columns with |)
      -
+         - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron entry screen:"
+         - pref: BorrowerUnwantedField
+           class: multi
+         - (separate columns with |)
+     -
          - "Guarantors can be the following of those they guarantee:"
          - pref: borrowerRelationship
            class: multi
index f61f5c1..fb91651 100644 (file)
@@ -22,6 +22,7 @@
        <li>Enter the identifying information regarding your patron
 <ul>
        <li>Required fields are defined in the BorrowerMandatoryField system preference</li>
+       <li>Unwanted fields are defined in the BorrowerUnwantedField system preference</li>
        <li>Salutation is populated by the BorrowersTitles system preference</li>
 </ul>
 </li>
index 62ecace..02d39f5 100644 (file)
 [% END %]
 
 [% IF ( step_1 ) %]
+[%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
        <fieldset class="rows" id="memberentry_identity">
                <legend>[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
                <ol>
                [% UNLESS ( I ) %]
+        [% UNLESS notitle %]
                [% IF ( title_cgipopup ) %]
             <li>
             [% IF ( mandatorytitle ) %]
             </li>
                [% END %]
         [% END %]
+               [% END %]
+        [% UNLESS nosurname %]
                <li>
                [% IF ( mandatorysurname ) %]
                <label for="surname" class="required">
                [% END %]
                [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
                </li>
+        [% END %]
                [% UNLESS ( I ) %]
+        [% UNLESS nofirstname %]
             <li>
                 [% IF ( mandatoryfirstname ) %]
                 <label for="firstname" class="required">
                 <input type="text" id="firstname" name="firstname" size="20"  value="[% IF ( opduplicate ) %][% ELSE %][% firstname %][% END %]" />
                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
             </li>
+        [% END %]
+        [% UNLESS nodateofbirth %]
             <li>
                 [% IF ( mandatorydateofbirth ) %]
                 <label for="dateofbirth" class="required">
         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
             </li>
+        [% END %]
+        [% UNLESS noinitials %]
             <li>
                 [% IF ( mandatoryinitials ) %]
                     <label for="initials" class="required">
                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
+        [% END %]
+        [% UNLESS noothernames %]
                <li>
                        [% IF ( mandatoryothernames ) %]
                        <label for="othernames" class="required">
 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
                [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
                </li>
+        [% END %]
     [% UNLESS ( I ) %]
+        [% UNLESS nosex %]
                <li class="radio">
                
                [% IF ( female ) %]
                                <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
 [% END %]
                </li>
+        [% END %]
     [% END %]
                </ol>
        </fieldset>
+[% END # hide fieldset %]
        
 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid"   value="[% guarantorid %]" />
     <fieldset class="rows">
  [% END %]
      <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
  </li>
+        [% UNLESS nocontactname %]
  <li>
      <label for="contactname">Surname: </label>
      [% IF ( guarantorid ) %]
                [% END %]
      [% END %]
  </li>
+        [% END %]
+        [% UNLESS nocontactfirstname %]
  <li>
      <label for="contactfirstname">First name: </label>
      [% IF ( guarantorid ) %]
             [% END %]
      [% END %]
  </li>
+        [% END %]
  [% IF ( relshiploop ) %]
  <li>
      <label for="relationship">Relationship: </label>
     </fieldset>
 
 [% END %]
+[% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
 <fieldset class="rows">
     <legend>Main address</legend><ol>
+        [% UNLESS nostreetnumber %]
     <li>
       [% IF ( mandatorystreetnumber ) %]
       <label for="streetnumber" class="required">
       [% END %]
 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS nostreettype %]
     [% IF ( road_cgipopup ) %]
       <li>
       [% IF ( mandatorystreettype ) %]
          [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
       </li>
     [% END %] 
+        [% END %]
+        [% UNLESS noaddress %]
     <li>
       [% IF ( mandatoryaddress ) %]
       <label for="address" class="required">
       [% END %]
          [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS noaddress2 %]
     <li>
       [% IF ( mandatoryaddress2 ) %]
       <label for="address2" class="required">
       [% END %]
          [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
     </li>  
+        [% END %]
+        [% UNLESS nocity %]
     <li>
       [% IF ( mandatorycity ) %]
         <label for="city" class="required">
         [% END %]
          [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS nostate %]
     <li> 
       [% IF ( mandatorystate ) %]
         <label for="state" class="required">
       <input type="text" name="state" id="state" size="20" value="[% state %]" />
          [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS nozipcode %]
     <li> 
       [% IF ( mandatoryzipcode ) %]
         <label for="zipcode" class="required">
       [% END %]
          [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
     </li>
-    
+        [% END %]
+        [% UNLESS nocountry %]
     <li> 
       [% IF ( mandatorycountry ) %]
         <label for="country" class="required">
       [% END %]
          [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
     </li>    
-  
+        [% END %]
        </ol>
     </fieldset>
+[% END # nostreet && nocity etc group%]
+
+[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
   <fieldset class="rows" id="memberentry_contact">
     <legend>Contact</legend><ol>
+        [% UNLESS nophone %]
       <li>
       [% IF ( mandatoryphone ) %] 
       <label for="phone" class="required">
          [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
 
     </li>
+        [% END %]
+        [% UNLESS nophonepro %]
     <li>
       [% IF ( mandatoryphonepro ) %]
       <label for="phonepro" class="required">
       [% END %]
          [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS nomobile %]
     <li>
       [% IF ( mandatorymobile ) %]
       <label for="mobile" class="required">
       [% END %]
          [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS noemail %]
     <li>
       [% IF ( mandatoryemail ) %]
       <label for="email" class="required">
          [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
 
     </li>
+        [% END %]
+        [% UNLESS noemailpro %]
     <li>
       [% IF ( mandatoryemailpro ) %] 
       <label for="emailpro" class="required">
       [% END %]
          [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
+        [% UNLESS nofax %]
     <li>
       [% IF ( mandatoryfax ) %]
       <label for="fax" class="required">
       [% END %]
          [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
        </ol>
   </fieldset>
-
+[%END # hide fieldset %]
 
 <!-- ************************ STEP_1 *********************** -->
 [% END %]
 [% IF ( step_6 ) %]
 
+    [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
                <fieldset class="rows" id="memberentry_address">
                <legend>Alternate address</legend><ol>
+        [% UNLESS noB_address %]
                        <li>
                                [% IF ( mandatoryB_address ) %]
                                        <label for="B_address" class="required">
                                [% END %]
          [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_address2 %]
                        <li>
                                [% IF ( mandatoryB_address2 ) %]
                                        <label for="B_address2" class="required">
                                [% END %]
          [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_city %]
                        <li>
                                [% IF ( mandatoryB_city ) %]
                                        <label for="B_city" class="required" >
                                <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
          [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_state %]
                        <li>
                                [% IF ( mandatoryB_state ) %]
                                        <label for="B_state" class="required" >
                                <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
          [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_zipcode %]
                        <li>
                                [% IF ( mandatoryB_zipcode ) %]
                                        <label for="B_zipcode" class="required">
                                [% END %]
          [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_country %]
                        <li>
                                [% IF ( mandatoryB_country ) %]
                                        <label for="B_country" class="required">
                                [% END %]
          [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noB_phone %]
             <li>
                 [% IF ( mandatoryB_phone ) %]
                 <label for="B_phone" class="required">
                 [% END %]
                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
             </li>
+        [% END %]
+        [% UNLESS noB_email %]
                        <li> 
         [% IF ( mandatoryB_email ) %]
           <label for="B_email" class="required">
                        <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
                [% END %]
                [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
+        [% END %]
+        [% UNLESS nocontactnote %]
             <li>
                 [% IF ( mandatorycontactnote ) %]
                 <label for="contactnote" class="required">
                 <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
         [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
             </li>
+        [% END %]
                        </ol>
                </fieldset>
+    [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
 [% END %]              
 [% IF ( step_2 ) %]
+    [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
                <fieldset class="rows" id="memberentry_altaddress">       
                    <legend>Alternate Contact</legend><ol>
+        [% UNLESS noaltcontactsurname %]
                        <li>
                            [% IF ( mandatoryaltcontactsurname ) %]
                                <label for="altcontactsurname" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactfirstname %]
                        <li>
                            [% IF ( mandatoryaltcontactfirstname ) %]
                                <label for="altcontactfirstname" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactaddress1 %]
                        <li>
                            [% IF ( mandatoryaltcontactaddress1 ) %]
                                <label for="altcontactaddress1" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactaddress2 %]
                        <li>
                            [% IF ( mandatoryaltcontactaddress2 ) %]
                                <label for="altcontactaddress2" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactaddress3 %]
                        <li>
                            [% IF ( mandatoryaltcontactaddress3 ) %]
                                <label for="altcontactaddress3" class="required">
                                <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
                                [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactstate %]
                        <li>
                            [% IF ( mandatoryaltcontactstate ) %]
                                <label for="altcontactstate" class="required">
                                <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
                                [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactzipcode %]
                        <li>
                            [% IF ( mandatoryaltcontactzipcode ) %]
                                <label for="altcontactzipcode" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
+        [% UNLESS noaltcontactcountry %]
                        <li>
                            [% IF ( mandatoryaltcontactcountry ) %]
                                <label for="altcontactcountry" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
                        </li>                   
+        [% END %]
+        [% UNLESS noaltcontactphone %]
                        <li>
                            [% IF ( mandatoryaltcontactphone ) %]
                                <label for="altcontactphone" class="required">
                                [% END %]
                                [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
                        </li>
+        [% END %]
             </ol>
         </fieldset>
+    [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
 
 [% END %]
 [% IF ( step_3 ) %]
 
   <fieldset class="rows" id="memberentry_library_management">
     <legend>Library Management</legend><ol>
+        [% UNLESS nocardnumber %]
    <li> [% IF ( mandatorycardnumber ) %]
       <label for="cardnumber" class="required">
     [% ELSE %]
                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
     [% END %]
          [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
+        [% END %]
+        [% UNLESS nobranchcode %]
     <li>
       [% IF ( mandatorybranchcode ) %]
         <label for="branchcode" class="required">
       [% CGIbranch %]
          [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
     </li>
+        [% END %]
     <li>
         <label for="categorycode">Category: </label>
         <select id="categorycode" name="categorycode">
        [% END %]
        </select>
     </li>
+        [% UNLESS nosort1 %]
     <li>
       [% IF ( mandatorysort1 ) %]
         <label for="sort1" class="required">
          [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
       [% END %]   
     </li>
+        [% END %]
+        [% UNLESS nosort2 %]
     <li>
     [% IF ( mandatorysort2 ) %]
     <label for="sort2" class="required">
          [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
     [% END %] 
     </li>
+        [% END %]
        </ol>
   </fieldset>
+    [% UNLESS nodateenrolled && nodateexpiry &&  noopacnote && noborrowernotes %]
        <fieldset class="rows" id="memberentry_subscription">
        <legend>Library set-up</legend><ol>
+        [% UNLESS nodateenrolled %]
                <li>
                        [% IF ( mandatorydateenrolled ) %]
                        <label for="dateenrolled" class="required">
                [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                </li>
+        [% END %]
+        [% UNLESS nodateexpiry %]
                <li>
                        [% IF ( mandatorydateexpiry ) %]
                        <label for="dateexpiry" class="required">
                [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                </li>
+        [% END %]
+        [% UNLESS noopacnote %]
                <li>
                        [% IF ( mandatoryopacnote ) %]
                                <label for="opacnote" class="required">
                        <div class="hint">This message appears on this patron's user page in the OPAC</div>
          [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
                </li>
+        [% END %]
+        [% UNLESS noborrowernotes %]
                <li>
                        [% IF ( mandatoryborrowernotes ) %]     
                                <label for="borrowernotes" class="required">
                        <div class="hint">This message displays when checking out to this patron</div>
          [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
                </li>
+        [% END %]
                </ol>
        </fieldset>
+    [% END # hide fieldset %]
+
+    [% UNLESS nouserid && nopassword %]
        <fieldset class="rows" id="memberentry_userid">
                <legend>OPAC/Staff Login</legend><ol>
+        [% UNLESS nouserid %]
                <li>
                        [% IF ( mandatoryuserid ) %]
                        <label for="userid" class="required">
 
          [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
                </li>
+        [%END %]
+        [% UNLESS nopassword %]
                <li>
                        [% IF ( mandatorypassword ) %]
                        <label for="password" class="required">
                        [% END %]
          [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
-               </li></ol>
+               </li>
+        [% END %]
+    </ol>
                </fieldset>
+        [% END # hide fieldset %]
                <!--this zones are not necessary in modif mode -->
                [% UNLESS ( opadd ) %]
                <fieldset class="rows">
index 398c5fe..5586b98 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.07.00.004';
+    our $VERSION = '3.07.00.005';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index c047873..6de07bf 100755 (executable)
@@ -100,6 +100,13 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField);
 foreach (@field_check) {
        $template->param( "mandatory$_" => 1);    
 }
+# function to designate unwanted fields
+my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField");
+@field_check=split(/\|/,$check_BorrowerUnwantedField);
+foreach (@field_check) {
+    next unless m/\w/o;
+       $template->param( "no$_" => 1);
+}
 $template->param( "add" => 1 ) if ( $op eq 'add' );
 $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' );
 $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );