[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. c317a6ec9450119fc75c2510f6e01f6f30b184f5

Evergreen Git git at git.evergreen-ils.org
Fri Feb 14 02:30:24 EST 2014


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  c317a6ec9450119fc75c2510f6e01f6f30b184f5 (commit)
       via  6807a06a11d309e94dbc5e286e45a5fdd3eaecab (commit)
      from  dc58382c0a8092626b7cd09f67899dc616a7618f (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 c317a6ec9450119fc75c2510f6e01f6f30b184f5
Author: Jeff Godin <jgodin at tadl.org>
Date:   Wed Jan 22 23:40:50 2014 -0500

    Release notes for "Update Expire Date" button
    
    Add release notes for "Update Expire Date" button in user editor.
    
    Signed-off-by: Jeff Godin <jgodin at tadl.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/user_editor_update_expire_date_button.txt b/docs/RELEASE_NOTES_NEXT/Circulation/user_editor_update_expire_date_button.txt
new file mode 100644
index 0000000..1b66ade
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/user_editor_update_expire_date_button.txt
@@ -0,0 +1,17 @@
+User Editor: "Update Expire Date" button
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+A new button labeled "Update Expire Date" is added in the user
+editor next to expire date field. This button can be used to
+re-calculate the user's expire date based on the current profile's
+permission interval and today's date.
+
+This is similar to how the expire date is populated when creating a
+new user, or when changing the profile group.
+
+This button simplifies the process of "renewing" a user, by
+eliminating the requirement that staff manually enter a new expire
+date.
+
+A button is used here so that the updating of the expire date
+remains an  intentional process, not one that happens upon any edit.
+

commit 6807a06a11d309e94dbc5e286e45a5fdd3eaecab
Author: Jeff Godin <jgodin at tadl.org>
Date:   Wed Oct 30 15:42:15 2013 -0400

    Add button to update expire date field
    
    When updating/renewing a patron (expired or not), it would be
    convenient to have a means of populating the expire date field with
    a value of perm_interval + today. Currently, staff are required to
    manually enter a date, or could toggle the profile from one profile
    then back to the desired profile, but this is not ideal.
    
    This commit adds a new button next to the expire date, which when
    activated will re-calculate the date based on the current profile's
    perm_interval and today's date.
    
    This is similar to how the expire date is populated when creating a
    new user, or when changing the profile group. A button is used here
    so that the updating of the expire date is an intentional process,
    not one that happens upon any edit.
    
    Signed-off-by: Jeff Godin <jgodin at tadl.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/actor/user/register_table.tt2 b/Open-ILS/src/templates/actor/user/register_table.tt2
index ba3f246..cdb5fa3 100644
--- a/Open-ILS/src/templates/actor/user/register_table.tt2
+++ b/Open-ILS/src/templates/actor/user/register_table.tt2
@@ -41,7 +41,12 @@
     <tr fmclass='au' fmfield='other_phone'/>
     <tr fmclass='au' fmfield='home_ou' required='required'/>
     <tr fmclass='au' fmfield='profile' required='required'/>
-    <tr fmclass='au' fmfield='expire_date' required='required'/>
+    <tr fmclass='au' fmfield='expire_date' required='required'>
+        <td/><td/><td/>
+        <td>
+            <button dojoType='dijit.form.Button' jsId='setExpireDate' scrollOnFocus='false'></button>
+        </td>
+    </tr>
     <tr fmclass='au' fmfield='net_access_level' required='required'/>
     <tr fmclass='au' fmfield='active'/>
     <tr fmclass='au' fmfield='barred'/>
diff --git a/Open-ILS/web/js/dojo/openils/actor/nls/register.js b/Open-ILS/web/js/dojo/openils/actor/nls/register.js
index f7d13b6..d6dbd71 100644
--- a/Open-ILS/web/js/dojo/openils/actor/nls/register.js
+++ b/Open-ILS/web/js/dojo/openils/actor/nls/register.js
@@ -40,5 +40,6 @@
     "HOLD_NOTIFY_PHONE": "Phone: ",
     "HOLD_NOTIFY_EMAIL": "Email: ",
     "HOLD_NOTIFY_SMS": "SMS: ",
-    "REQUESTING_USER" : "Account requested by ${0} ${1}"
+    "REQUESTING_USER" : "Account requested by ${0} ${1}",
+    "UPDATE_EXPIRE_DATE": "Update Expire Date"
 }
diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js
index 671502a..c31eb2f 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -84,6 +84,7 @@ function load() {
     allCards.attr("label", localeStrings.SEE_ALL);
     dojo.byId('uedit-dupe-username-warning').innerHTML = localeStrings.DUPE_USERNAME;
     generatePassword.attr("label", localeStrings.RESET_PASSWORD);
+    setExpireDate.attr("label", localeStrings.UPDATE_EXPIRE_DATE);
     dojo.byId('verifyPassword').innerHTML = localeStrings.VERIFY_PASSWORD;
     dojo.byId('parentGuardian').innerHTML = localeStrings.PARENT_OR_GUARDIAN;
     dojo.byId('userSettings').innerHTML = localeStrings.USER_SETTINGS;
@@ -293,6 +294,8 @@ function load() {
 
 	dojo.connect(generatePassword, 'onClick', generatePasswordHandler);
 
+	dojo.connect(setExpireDate, 'onClick', setExpireDateHandler);
+
     if(!patron.isnew() && !checkGrpAppPerm(patron.profile()) && patron.id() != openils.User.user.id()) {
         // we are not allowed to edit this user, so disable the save option
         saveButton.attr('disabled', true);
@@ -494,6 +497,28 @@ function generatePasswordHandler() {
 }
 
 /**
+ * Set Expire Date field based on today and current profile group
+ */
+function setExpireDateHandler() {
+    var profileWidget, expireWidget;
+    profileWidget = findWidget('au', 'profile');
+    expireWidget = findWidget('au', 'expire_date');
+
+    // This technique is borrowed with slight modifications
+    // from the profile widget onChange handler
+    function found(items) {
+        if (items.length == 0) return;
+        var item = items[0];
+        var interval = profileWidget.widget.store.getValue(item, 'perm_interval');
+        expireWidget.widget.attr('value', dojo.date.add(new Date(),
+            'second', openils.Util.intervalToSeconds(interval)));
+    }
+
+    profileWidget.widget.store.fetch({onComplete:found, query:{id:profileWidget.widget.attr('value')}});
+
+}
+
+/**
  * Loads a staged user and turns them into something the editor can understand
  */
 function uEditLoadStageUser(stageUname) {

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

Summary of changes:
 .../src/templates/actor/user/register_table.tt2    |    7 ++++-
 Open-ILS/web/js/dojo/openils/actor/nls/register.js |    3 +-
 Open-ILS/web/js/ui/default/actor/user/register.js  |   25 ++++++++++++++++++++
 .../user_editor_update_expire_date_button.txt      |   17 +++++++++++++
 4 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/user_editor_update_expire_date_button.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list