[open-ils-commits] [GIT] Evergreen ILS branch master updated. 5e479ec7f42f570ba7db2f7668d6c3ac82b8975c

Evergreen Git git at git.evergreen-ils.org
Mon Oct 16 15:37:42 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  5e479ec7f42f570ba7db2f7668d6c3ac82b8975c (commit)
       via  87dc85c0661203f203af5ef60434ce6e1f2b6325 (commit)
      from  23ab19f6ecc45315137681d5c43d0b4a22f74560 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5e479ec7f42f570ba7db2f7668d6c3ac82b8975c
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Thu Sep 21 15:58:49 2017 -0400

    LP#1717025 - make Specific Due Dates Until Logout in Patron Checkout
    
    Made a few (opinionated) changes, that try to follow some JS
    best practices. Changed Bool flags like date_options.sticky_date
    to has_sticky_date, which avoids confusion with the checkoutArgs
    property of the same name, and provides a clue about it's type
    and function. Also added semicolons to any JS statements and
    function expressions that were missing them.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
index a2db38e..773d911 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
@@ -48,20 +48,20 @@
       <ul class="pull-right" uib-dropdown-menu>
         <li>
           <a href
-            ng-click="toggle_opt('sticky_date')">
-            <span ng-if="date_options.sticky_date"
+            ng-click="toggle_opt('has_sticky_date')">
+            <span ng-if="date_options.has_sticky_date"
               class="label label-success">&#x2713;</span>
-            <span ng-if="!date_options.sticky_date"
+            <span ng-if="!date_options.has_sticky_date"
               class="label label-warning">&#x2717;</span>
             <span>[% l('Specific Due Date') %]</span>
           </a>
         </li>
         <li>
           <a href
-            ng-click="toggle_opt('until_logout')">
-            <span ng-if="date_options.until_logout"
+            ng-click="toggle_opt('is_until_logout')">
+            <span ng-if="date_options.is_until_logout"
               class="label label-success">&#x2713;</span>
-            <span ng-if="!date_options.until_logout"
+            <span ng-if="!date_options.is_until_logout"
               class="label label-warning">&#x2717;</span>
             <span>[% l('Use Specific Due Date Until Logout') %]</span>
           </a>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index 7c42a27..52f7944 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -47,11 +47,11 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
 
     $scope.date_options = {
         due_date : egCore.hatch.getSessionItem('eg.circ.checkout.due_date'),
-        sticky_date : egCore.hatch.getSessionItem('eg.circ.checkout.until_logout'),
-        until_logout : egCore.hatch.getSessionItem('eg.circ.checkout.until_logout')
-    }
+        has_sticky_date : egCore.hatch.getSessionItem('eg.circ.checkout.is_until_logout'),
+        is_until_logout : egCore.hatch.getSessionItem('eg.circ.checkout.is_until_logout')
+    };
 
-    if ($scope.date_options.until_logout) { // If until_logout is set there should also be a date set. 
+    if ($scope.date_options.is_until_logout) { // If until_logout is set there should also be a date set.
         $scope.checkoutArgs.due_date = new Date($scope.date_options.due_date);
         $scope.checkoutArgs.sticky_date = true;
     }
@@ -62,32 +62,32 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
         } else {
             $scope.date_options[opt] = true;
         }
-    }
+    };
 
     // The interactions between these options are complicated enough that $watch'ing them all is the only safe way to keep things sane.
-    $scope.$watch('date_options.sticky_date', function(newval) {
+    $scope.$watch('date_options.has_sticky_date', function(newval) {
         if ( newval ) { // was false, is true
             // $scope.date_options.due_date = checkoutArgs.due_date;
         } else {
-            $scope.date_options.until_logout = false;
+            $scope.date_options.is_until_logout = false;
         }
         $scope.checkoutArgs.sticky_date = newval;
     });
 
-    $scope.$watch('date_options.until_logout', function(newval) {
+    $scope.$watch('date_options.is_until_logout', function(newval) {
         if ( newval ) { // was false, is true
-            $scope.date_options.sticky_date = true;
+            $scope.date_options.has_sticky_date = true;
             $scope.date_options.due_date = $scope.checkoutArgs.due_date;
-            egCore.hatch.setSessionItem('eg.circ.checkout.until_logout', true);
+            egCore.hatch.setSessionItem('eg.circ.checkout.is_until_logout', true);
             egCore.hatch.setSessionItem('eg.circ.checkout.due_date', $scope.checkoutArgs.due_date);
         } else {
-            egCore.hatch.removeSessionItem('eg.circ.checkout.until_logout');
+            egCore.hatch.removeSessionItem('eg.circ.checkout.is_until_logout');
             egCore.hatch.removeSessionItem('eg.circ.checkout.due_date');
         }
     });
 
     $scope.$watch('checkoutArgs.due_date', function(newval) {
-        if ( $scope.date_options.until_logout ) {
+        if ( $scope.date_options.is_until_logout ) {
             egCore.hatch.setSessionItem('eg.circ.checkout.due_date', newval);
         }
     });

commit 87dc85c0661203f203af5ef60434ce6e1f2b6325
Author: Jason Boyer <JBoyer at library.in.gov>
Date:   Wed Sep 13 15:36:47 2017 -0500

    LP1717025: Persist Specific Due Dates Until Logout
    
    Add an option to the specific due date feature to
    save the specified date until logout. This allows
    all circulations from a given workstation to be due
    on the same date.
    
    Signed-off-by: Jason Boyer <JBoyer at library.in.gov>
    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
index 9343c92..a2db38e 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
@@ -38,20 +38,48 @@
   <div class="col-md-6">
     <div class="flex-row">
       <div class="flex-cell"></div>
-      <div class="checkbox pad-horiz">
+
+<div class="input-group">
+<div class="input-group-btn" uib-dropdown>
+      <button type="button" class="btn btn-default" uib-dropdown-toggle>
+        [% l('Date Options') %]
+        <span class="caret"></span>
+      </button>
+      <ul class="pull-right" uib-dropdown-menu>
+        <li>
+          <a href
+            ng-click="toggle_opt('sticky_date')">
+            <span ng-if="date_options.sticky_date"
+              class="label label-success">&#x2713;</span>
+            <span ng-if="!date_options.sticky_date"
+              class="label label-warning">&#x2717;</span>
+            <span>[% l('Specific Due Date') %]</span>
+          </a>
+        </li>
+        <li>
+          <a href
+            ng-click="toggle_opt('until_logout')">
+            <span ng-if="date_options.until_logout"
+              class="label label-success">&#x2713;</span>
+            <span ng-if="!date_options.until_logout"
+              class="label label-warning">&#x2717;</span>
+            <span>[% l('Use Specific Due Date Until Logout') %]</span>
+          </a>
+        </li>
+      </ul>
+</div>
+
+      <!-- <div class="checkbox pad-horiz">
         <label>
           <input type="checkbox" ng-model="checkoutArgs.sticky_date"/>
           [% l('Specific Due Date') %]
         </label>
-      </div>
-      <!--
-      <div><input type="checkbox" class="checkbox" ng-model="checkoutArgs.sticky_date"/></div>
-      <div class="pad-horiz">[% l('Specific Due Date') %]</div>
-      -->
+      </div> -->
       <!-- FIXME: This needs a time component as well, but type="datetime" 
             is not yet supported by any browsers -->
       <div><eg-date-input ng-model="checkoutArgs.due_date"></eg-date-input>
       </div>
+</div>
     </div>
   </div>
 </div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index e85a3f7..7c42a27 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -45,6 +45,53 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
         }
     }
 
+    $scope.date_options = {
+        due_date : egCore.hatch.getSessionItem('eg.circ.checkout.due_date'),
+        sticky_date : egCore.hatch.getSessionItem('eg.circ.checkout.until_logout'),
+        until_logout : egCore.hatch.getSessionItem('eg.circ.checkout.until_logout')
+    }
+
+    if ($scope.date_options.until_logout) { // If until_logout is set there should also be a date set. 
+        $scope.checkoutArgs.due_date = new Date($scope.date_options.due_date);
+        $scope.checkoutArgs.sticky_date = true;
+    }
+
+    $scope.toggle_opt = function(opt) {
+        if ($scope.date_options[opt]) {
+            $scope.date_options[opt] = false;
+        } else {
+            $scope.date_options[opt] = true;
+        }
+    }
+
+    // The interactions between these options are complicated enough that $watch'ing them all is the only safe way to keep things sane.
+    $scope.$watch('date_options.sticky_date', function(newval) {
+        if ( newval ) { // was false, is true
+            // $scope.date_options.due_date = checkoutArgs.due_date;
+        } else {
+            $scope.date_options.until_logout = false;
+        }
+        $scope.checkoutArgs.sticky_date = newval;
+    });
+
+    $scope.$watch('date_options.until_logout', function(newval) {
+        if ( newval ) { // was false, is true
+            $scope.date_options.sticky_date = true;
+            $scope.date_options.due_date = $scope.checkoutArgs.due_date;
+            egCore.hatch.setSessionItem('eg.circ.checkout.until_logout', true);
+            egCore.hatch.setSessionItem('eg.circ.checkout.due_date', $scope.checkoutArgs.due_date);
+        } else {
+            egCore.hatch.removeSessionItem('eg.circ.checkout.until_logout');
+            egCore.hatch.removeSessionItem('eg.circ.checkout.due_date');
+        }
+    });
+
+    $scope.$watch('checkoutArgs.due_date', function(newval) {
+        if ( $scope.date_options.until_logout ) {
+            egCore.hatch.setSessionItem('eg.circ.checkout.due_date', newval);
+        }
+    });
+
     $scope.has_email_address = function() {
         return (
             patronSvc.current &&

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/staff/circ/patron/t_checkout.tt2 |   40 ++++++++++++++---
 .../js/ui/default/staff/circ/patron/checkout.js    |   47 ++++++++++++++++++++
 2 files changed, 81 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list