Quipu Customizations
authorTerran McCanna <tmccanna@georgialibraries.org>
Tue, 1 Sep 2020 18:06:15 +0000 (14:06 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 20 Oct 2020 14:02:04 +0000 (10:02 -0400)
Move library card application link to top menu instead of bottom menu,
cleaned up a lot of whitespace issues and old commented out text,
added CSS controls for parts of the Quipu form.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/footer.tt2
Open-ILS/src/templates/opac/parts/topnav_links.tt2

index 1e47c2a..bbef61d 100644 (file)
@@ -29,7 +29,7 @@ my @api_fields = (
     {name => 'home_ou', class => 'au', required => 1},
     {name => 'ident_type', class => 'au', required => 1},
     {name => 'ident_value', class => 'au', required => 1},
-    {name => 'guardian',
+    {name => 'ident_value2',
      class => 'au', 
      notes => "AKA parent/guardian",
      required_if => 'Patron is less than 18 years old'
@@ -62,93 +62,93 @@ my @api_fields = (
 # TODO: wrap the following in a check for a library setting as to whether or not
 # to require emailed verification
 
-# Random 6-character alpha-numeric code that avoids look-alike characters
-# https://ux.stackexchange.com/questions/53341/are-there-any-letters-numbers-that-should-be-avoided-in-an-id
-# Also exclude vowels to avoid creating any real (potentially offensive) words.
-my @code_chars = ('C','D','F','H','J'..'N','P','R','T','V','W','X','3','4','7','9');
-sub generate_verify_code {
-    my $string = '';
-    $string .= $code_chars[rand @code_chars] for 1..6;
-    return $string;
-}
-
-
-# only if we're verifying the card via email
-sub load_ecard_verify {
-    my $self = shift;
-    my $cgi = $self->cgi;
-    $self->collect_header_footer;
-
-    # Loading the form.
-    return Apache2::Const::OK if $cgi->request_method eq 'GET';
-
-    #$self->verify_ecard;
-    return Apache2::Const::OK;
-}
-
-sub verify_ecard {
-    my $self = shift;
-    my $cgi = $self->cgi;
-    my $ctx = $self->ctx;
-    $self->log_params;
-
-    my $verify_code = $ctx->{verify_code} = $cgi->param('verification_code');
-    my $barcode = $ctx->{barcode} = $cgi->param('barcode');
-
-    $ctx->{verify_failed} = 1;
-
-    my $e = new_editor();
-
-    my $au = $e->search_actor_user({
-        profile => $PROVISIONAL_ECARD_GRP,
-        ident_type => $ECARD_VERIFY_IDENT,
-        ident_value => $verify_code
-    })->[0];
-
-    if (!$au) {
-        $logger->warn(
-            "ECARD: No provisional ecard found with code $verify_code");
-        sleep 2; # Mitigate brute-force attacks
-        return;
-    }
-
-    my $card = $e->search_actor_card({
-        usr => $au->id,
-        barcode => $barcode
-    })->[0];
-
-    if (!$card) {
-        $logger->warn("ECARD: Failed to match verify code ".
-            "($verify_code) with provided barcode ($barcode)");
-        sleep 2; # Mitigate brute-force attacks
-        return;
-    }
-
-    # Verification looks good.  Update the account.
-
-    my $grp = new_editor()->retrieve_permission_grp_tree($FULL_ECARD_GRP);
-
-    $au->profile($grp->id);
-    $au->expire_date(
-        DateTime->now(time_zone => 'local')->add(
-            seconds => interval_to_seconds($grp->perm_interval))->iso8601()
-    );
-
-    $e->xact_begin;
-
-    unless ($e->update_actor_user($au)) {
-        $logger->error("ECARD update failed for $barcode: " . $e->die_event);
-        return;
-    }
-    
-    $e->commit;
-    $logger->info("ECARD: Update to full ecard succeeded for $barcode");
-
-    $ctx->{verify_success} = 1;
-    $ctx->{verify_failed} = 0;
-
-    return;
-}
+## Random 6-character alpha-numeric code that avoids look-alike characters
+## https://ux.stackexchange.com/questions/53341/are-there-any-letters-numbers-that-should-be-avoided-in-an-id
+## Also exclude vowels to avoid creating any real (potentially offensive) words.
+#my @code_chars = ('C','D','F','H','J'..'N','P','R','T','V','W','X','3','4','7','9');
+#sub generate_verify_code {
+#    my $string = '';
+#    $string .= $code_chars[rand @code_chars] for 1..6;
+#    return $string;
+#}
+#
+#
+## only if we're verifying the card via email
+#sub load_ecard_verify {
+#    my $self = shift;
+#    my $cgi = $self->cgi;
+#    $self->collect_header_footer;
+#
+#    # Loading the form.
+#    return Apache2::Const::OK if $cgi->request_method eq 'GET';
+#
+#    #$self->verify_ecard;
+#    return Apache2::Const::OK;
+#}
+#
+#sub verify_ecard {
+#    my $self = shift;
+#    my $cgi = $self->cgi;
+#    my $ctx = $self->ctx;
+#    $self->log_params;
+#
+#    my $verify_code = $ctx->{verify_code} = $cgi->param('verification_code');
+#    my $barcode = $ctx->{barcode} = $cgi->param('barcode');
+#
+#    $ctx->{verify_failed} = 1;
+#
+#    my $e = new_editor();
+#
+#    my $au = $e->search_actor_user({
+#        profile => $PROVISIONAL_ECARD_GRP,
+#        ident_type => $ECARD_VERIFY_IDENT,
+#        ident_value => $verify_code
+#    })->[0];
+#
+#    if (!$au) {
+#        $logger->warn(
+#            "ECARD: No provisional ecard found with code $verify_code");
+#        sleep 2; # Mitigate brute-force attacks
+#        return;
+#    }
+#
+#    my $card = $e->search_actor_card({
+#        usr => $au->id,
+#        barcode => $barcode
+#    })->[0];
+#
+#    if (!$card) {
+#        $logger->warn("ECARD: Failed to match verify code ".
+#            "($verify_code) with provided barcode ($barcode)");
+#        sleep 2; # Mitigate brute-force attacks
+#        return;
+#    }
+#
+#    # Verification looks good.  Update the account.
+#
+#    my $grp = new_editor()->retrieve_permission_grp_tree($FULL_ECARD_GRP);
+#
+#    $au->profile($grp->id);
+#    $au->expire_date(
+#        DateTime->now(time_zone => 'local')->add(
+#            seconds => interval_to_seconds($grp->perm_interval))->iso8601()
+#    );
+#
+#    $e->xact_begin;
+#
+#    unless ($e->update_actor_user($au)) {
+#        $logger->error("ECARD update failed for $barcode: " . $e->die_event);
+#        return;
+#    }
+#    
+#    $e->commit;
+#    $logger->info("ECARD: Update to full ecard succeeded for $barcode");
+#
+#    $ctx->{verify_success} = 1;
+#    $ctx->{verify_failed} = 0;
+#
+#    return;
+#}
 
 
 sub log_params {
@@ -346,8 +346,8 @@ sub make_user {
 
         my $val = $cgi->param($field);
 
+        $field = 'guardian' if $field eq 'ident_value2' && $val;
         $au->juvenile(1) if $field eq 'guardian' && $val;
-        $au->day_phone(undef) if $field eq 'day_phone' && $val eq '--';
 
         if ($field_info->{required} && !$val) {
             my $msg = "Value required for field: '$field'";
@@ -356,6 +356,7 @@ sub make_user {
             $logger->error("ECARD $msg");
         }
 
+        $val = undef if $field eq 'day_phone' && $val eq '--';
         $self->verify_dob($val) if $field eq 'dob' && $val;
         $au->$field($val);
     }
@@ -499,10 +500,10 @@ sub add_addresses {
 
         if ($field =~ /physical/) {
             (my $col_field = $field) =~ s/physical_//g;
-            $physical_addr->$col_field($val);
+            $physical_addr->$col_field($val) if $val;
         } else {
             (my $col_field = $field) =~ s/mailing_//g;
-            $mailing_addr->$col_field($val);
+            $mailing_addr->$col_field($val) if $val;
         }
 
     }
@@ -554,31 +555,31 @@ sub add_survey_responses {
 # TODO: this is KCLS-specific, but maybe we can make it something
 # generic for adding stat cats to the patron
 
-sub add_stat_cats {
-    my $self = shift;
-    my $cgi = $self->cgi;
-    my $user = $self->ctx->{user};
-
-    my $ds_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
-    $ds_map->isnew(1);
-    $ds_map->stat_cat(12);
-    $ds_map->stat_cat_entry('KCLS');
-
-    my $events = $cgi->param('events_mailing');
-    my $em_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
-    $em_map->isnew(1);
-    $em_map->stat_cat(3);
-    $em_map->stat_cat_entry($events ? 'Y' : 'N');
-
-    my $foundation = $cgi->param('foundation_mailing');
-    my $fm_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
-    $fm_map->isnew(1);
-    $fm_map->stat_cat(4);
-    $fm_map->stat_cat_entry($foundation ? 'Y' : 'N');
-
-    $user->stat_cat_entries([$ds_map, $em_map, $fm_map]);
-    return 1;
-}
+#sub add_stat_cats {
+#    my $self = shift;
+#    my $cgi = $self->cgi;
+#    my $user = $self->ctx->{user};
+#
+#    my $ds_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
+#    $ds_map->isnew(1);
+#    $ds_map->stat_cat(12);
+#    $ds_map->stat_cat_entry('KCLS');
+#
+#    my $events = $cgi->param('events_mailing');
+#    my $em_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
+#    $em_map->isnew(1);
+#    $em_map->stat_cat(3);
+#    $em_map->stat_cat_entry($events ? 'Y' : 'N');
+#
+#    my $foundation = $cgi->param('foundation_mailing');
+#    my $fm_map = Fieldmapper::actor::stat_cat_entry_user_map->new;
+#    $fm_map->isnew(1);
+#    $fm_map->stat_cat(4);
+#    $fm_map->stat_cat_entry($foundation ? 'Y' : 'N');
+#
+#    $user->stat_cat_entries([$ds_map, $em_map, $fm_map]);
+#    return 1;
+#}
 
 # Returns true if no dupes found, false if dupes are found.
 sub check_dupes {
index cfbfa25..09eea88 100644 (file)
@@ -3556,6 +3556,27 @@ label[for*=expert_]
     color: #00593d;
 }
 
+/* QUIPU CUSTOMIZATIONS */
+.radioLabel {
+    text-decoration: none;
+    color: #000;
+    padding-right: 10px;
+}
+
+.eCARDPreferredNameDivClass {
+    padding: 10px;
+    font-size: .9em;
+}
+
+.eCARDPatronNumber {
+    border:3px solid forestgreen;
+    padding:20px;max-width:700px;
+    font-weight:bold;
+    text-align:center;
+}
+
+
+
 @media only screen and (max-width: 1200px) {
     .carousel {
         margin-left:430px;
index 5edef57..830b234 100644 (file)
@@ -1,38 +1,24 @@
 [% IF !ctx.is_staff %]
 <div id="footer-wrap">
 <div id="footer">
-    [% IF ctx.get_org_setting(
-        ctx.physical_loc || ctx.aou_tree.id, 'opac.allow_pending_user') %]
-    <a href="[% mkurl(ctx.opac_root _ '/register') %]">
-           <img alt="[% l('Request Library Card') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-               [% l('Request Library Card') %]</a> &nbsp; &nbsp; &nbsp; &nbsp;
-    [% END %]
-    <!-- <a href="/eg/kpac/home">[% l("Kids Catalog") %]</a> &nbsp;|&nbsp; -->
-    <!-- <a href="http://pines.georgialibraries.org/pinesLocator/locator.html">[% l('Library Locations') %]</a> &nbsp;|&nbsp;-->
-    <!-- <a href="http://pines.georgialibraries.org/catalog-help">[% l('Help') %]</a> &nbsp;|&nbsp; -->
+<div id="footer-menu-wrapper">
     <a href="http://pines.georgialibraries.org/about">
-           <img alt="[% l('About PINES') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" /> [%- l('Learn More About PINES') %]</a> <!-- &nbsp;|&nbsp; -->
-        &nbsp; &nbsp; &nbsp; &nbsp;        
+        <img alt="[% l('About PINES') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" /> [%- l('Learn More About PINES') %]</a>
+        &nbsp; &nbsp; &nbsp; &nbsp;
     <a href="http://pines.georgialibraries.org/catalog-help">
         <img alt="[% l('Help') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
         [% l('Help') %]</a>
-        &nbsp; &nbsp; &nbsp; &nbsp;
-        
-    <!-- &nbsp;|&nbsp; -->
-    <!-- <a href="/">[% l('Dynamic catalog') -%]</a> &nbsp;|&nbsp; -->
-    <!-- [% gurl = mkurl(ctx.opac_root _ '/galileo', {}, 1) %]
-    <a href="[% gurl %]"> [% l('GALILEO') %] </a> -->
 </div>
 <div id="footer-menu-slim">
     <a href="/eg/opac/home">[% l("Home") %]</a><br/>
-       <a href="http://pines.georgialibraries.org/pinesLocator/locator.html">
-           [% l('Library Locations') %]</a><br/>
+    <a href="http://pines.georgialibraries.org/pinesLocator/locator.html">
+        [% l('Library Locations') %]</a><br/>
     <a href="/eg/kpac/home">
-           [% l("Kids' Catalog") %]</a><br/>
+        [% l("Kids' Catalog") %]</a><br/>
     [% IF ctx.get_org_setting(
         ctx.physical_loc || ctx.aou_tree.id, 'opac.allow_pending_user') %]
-    <a href="[% mkurl(ctx.opac_root _ '/register') %]">
-           [% l('Request Library Card') %]</a><br/>
+        <a href="[% mkurl(ctx.opac_root _ '/register') %]">
+        [% l('Request Library Card') %]</a><br/>
     [% END %]   
     [% IF ctx.physical_loc;
         # patron is at the branch, no redirect needed
         # send patron to galileo auth redirector
         gurl = mkurl(ctx.opac_root _ '/galileo', {}, 1);
     END %]
-   <a href="[% gurl %]">
-               [% l('GALILEO Research Databases') %]</a><br/>
-       <a href="http://pines.georgialibraries.org/about">
-           [%- l('Learn More About PINES') %]</a><br/>
-    <a href="http://pines.georgialibraries.org/news-2017-03-07-app">
+    <a href="[% gurl %]">
+        [% l('GALILEO Research Databases') %]</a><br/>
+    <a href="http://pines.georgialibraries.org/about">
+        [%- l('Learn More About PINES') %]</a><br/>
+    <a href="https://play.google.com/store/apps/details?id=net.kenstir.apps.pines">
         PINES Android App</a><br/>
     <a href="http://pines.georgialibraries.org/catalog-help">
-               [% l('Help') %]</a>     
-               
-       <hr style="margin-top:20px;">
-</div> 
-       
+        [% l('Help') %]</a>
+
+    <hr style="margin-top:20px;">
+</div>
+
     [% IF ctx.timing %]
     <div id="timing">
         [% FOR event IN ctx.timing %]
@@ -76,8 +62,8 @@
         <div style="float:left; margin:10px 10px 0px 0px;"><a href="http://www.imls.gov">
             <img src="[% ctx.media_prefix %]/images/IMLS-logo.jpg" style="border:none; width: 150px;" alt="IMLS"></a>
         </div>
-               <p style="font-weight:normal;font-style:italic;">
-        [% l('Funding Note') %]</p>            
+        <p style="font-weight:normal;font-style:italic;">
+        [% l('Funding Note') %]</p>
     </div>
 </div>
 </div>
index 2db429d..52bc570 100644 (file)
@@ -1,35 +1,36 @@
 <div id="gold-links-holder">
     <div id="gold-links">
-    <div id="header-links">
-        <a href="/eg/opac/home">
-                   <img alt="[% l('PINES Home Page') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-                   [% l("Home") %]</a>
-       <!--
-       [% IF ctx.get_org_setting(
-               ctx.physical_loc || ctx.aou_tree.id, 'opac.allow_pending_user') %]
-       <a href="[% mkurl(ctx.opac_root _ '/register') %]">[%
-               l('Apply for a PINES Library Card') %]</a> 
-       [% END %]
-       -->
-       <a href="http://pines.georgialibraries.org/pinesLocator/locator.html">
-           <img alt="[% l('Library Locations') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-               [% l('Library Locations') %]</a>
-       <a href="/eg/kpac/home">
-           <img alt="[% l('Kids Catalog') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-               [% l("Kids Catalog") %]</a> 
-    <a href="https://pines.georgialibraries.org/app">
-        <img alt="[% l('PINES App') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-        [% l("Download the PINES App") %]</a>
-   [% IF ctx.physical_loc;
-        # patron is at the branch, no redirect needed
-        gurl = 'http://www.galileo.usg.edu/express';
-    ELSE;
-        # send patron to galileo auth redirector
-        gurl = mkurl(ctx.opac_root _ '/galileo', {}, 1);
-    END %]
-    <a href="[% gurl %]">
-        <img alt="[% l('GALILEO') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
-        [% l('GALILEO Virtual Library') %]</a>
-    </div>
+        <div id="header-links">
+            <a href="/eg/opac/home">
+                <img alt="[% l('PINES Home Page') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                [% l("Home") %]</a>
+            <a href="http://pines.georgialibraries.org/pinesLocator/locator.html">
+                <img alt="[% l('Library Locations') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                [% l('Library Locations') %]</a>
+            <a href="/eg/kpac/home">
+                <img alt="[% l('Kids Catalog') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                [% l("Kids Catalog") %]</a> 
+            <a href="https://pines.georgialibraries.org/app">
+                <img alt="[% l('PINES App') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                [% l("Download the PINES App") %]</a>
+            [% IF ctx.physical_loc;
+                # patron is at the branch, no redirect needed
+                gurl = 'http://www.galileo.usg.edu/express';
+            ELSE;
+                # send patron to galileo auth redirector
+                gurl = mkurl(ctx.opac_root _ '/galileo', {}, 1);
+            END %]
+            <a href="[% gurl %]">
+                <img alt="[% l('GALILEO') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                [% l('GALILEO Virtual Library') %]</a>
+            [% IF ctx.get_org_setting(
+                ctx.physical_loc || ctx.aou_tree.id, 'opac.allow_pending_user') %]
+                <a href="[% mkurl(ctx.opac_root _ '/register') %]">
+                    <img alt="[% l('Apply for a PINES Library Card') %]" src="[% ctx.media_prefix %]/images/pines-dot.png" />
+                    [% l('Apply for a PINES Library Card') %]</a>
+            [% END %]
+        </div>
     </div>
 </div>
+
+<div style="clear:both;" />