[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_6 updated. 47527912924be48c7093b2513e16b5be58052dda

Evergreen Git git at git.evergreen-ils.org
Mon May 19 08:59:00 EDT 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, rel_2_6 has been updated
       via  47527912924be48c7093b2513e16b5be58052dda (commit)
       via  088fe576b399a802c9c2a87d59a6d4af8b19f090 (commit)
       via  3ea7a983bd22a2c0f4ff2da4d06ed09f15b6b8c6 (commit)
      from  5b6bde7bcceea46f982fe7d65bcc252182b16b5a (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 47527912924be48c7093b2513e16b5be58052dda
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Fri May 16 10:40:49 2014 -0700

    LP#1320048: remove the Date.W3CDTF() JavaScript module
    
    With the closed dates editor now using util.date, and
    no other active use of Date.W3CDTF() going on, it can go.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/web/opac/common/js/Date.W3CDTF.js b/Open-ILS/web/opac/common/js/Date.W3CDTF.js
deleted file mode 100644
index 5e1c24e..0000000
--- a/Open-ILS/web/opac/common/js/Date.W3CDTF.js
+++ /dev/null
@@ -1,132 +0,0 @@
-// Date/W3CDTF.js -- W3C Date and Time Formats
-
-Date.W3CDTF = function ( dtf ) {
-    var dd = new Date();
-    dd.setW3CDTF = Date.W3CDTF.prototype.setW3CDTF;
-    dd.getW3CDTF = Date.W3CDTF.prototype.getW3CDTF;
-    if ( dtf ) this.setW3CDTF( dtf );
-    return dd;
-};
-
-Date.W3CDTF.VERSION = "0.03";
-
-Date.W3CDTF.prototype.setW3CDTF = function( dtf ) {
-    var sp = dtf.split( /[^0-9]/ );
-
-    // invalid format
-    if ( sp.length < 6 || sp.length > 8 ) return;
-
-    // invalid time zone
-    if ( sp.length == 7 ) {
-        if ( dtf.charAt( dtf.length-1 ) != "Z" ) return;
-    }
-
-    // to numeric
-    for( var i=0; i<sp.length; i++ ) sp[i] = sp[i]-0;
-
-    // invalid range
-    if ( sp[0] < 1970 ||                // year
-         sp[1] < 1 || sp[1] > 12 ||     // month
-         sp[2] < 1 || sp[2] > 31 ||     // day
-         sp[3] < 0 || sp[3] > 23 ||     // hour
-         sp[4] < 0 || sp[4] > 59 ||     // min
-         sp[5] < 0 || sp[5] > 60 ) {    // sec
-        return;                         // invalid date 
-    }
-
-    // get UTC milli-second
-
-    var msec = Date.UTC( sp[0], sp[1]-1, sp[2], sp[3], sp[4], sp[5] );
-
-    // time zene offset
-    if ( sp.length == 8 ) {
-        if ( dtf.indexOf("+") < 0 ) sp[6] *= -1;
-        if ( sp[6] < -12 || sp[6] > 13 ) return;    // time zone offset hour
-        if ( sp[7] < 0 || sp[7] > 59 ) return;      // time zone offset min
-        msec -= (sp[6]*60+sp[7]) * 60000;
-    }
-
-    // set by milli-second;
-    return this.setTime( msec );
-};
-
-Date.W3CDTF.prototype.getW3CDTF = function() {
-    var year = this.getFullYear();
-    var mon  = this.getMonth()+1;
-    var day  = this.getDate();
-    var hour = this.getHours();
-    var min  = this.getMinutes();
-    var sec  = this.getSeconds();
-
-    // time zone
-    var tzos = this.getTimezoneOffset();
-    var tzpm = ( tzos > 0 ) ? "-" : "+";
-    if ( tzos < 0 ) tzos *= -1;
-    var tzhour = tzos / 60;
-    var tzmin  = tzos % 60;
-
-    // sprintf( "%02d", ... )
-    if ( mon  < 10 ) mon  = "0"+mon;
-    if ( day  < 10 ) day  = "0"+day;
-    if ( hour < 10 ) hour = "0"+hour;
-    if ( min  < 10 ) min  = "0"+min;
-    if ( sec  < 10 ) sec  = "0"+sec;
-    if ( tzhour < 10 ) tzhour = "0"+tzhour;
-    if ( tzmin  < 10 ) tzmin  = "0"+tzmin;
-    var dtf = year+"-"+mon+"-"+day+"T"+hour+":"+min+":"+sec+tzpm+tzhour+":"+tzmin;
-    return dtf;
-};
-
-/*
-
-=head1 NAME
-
-Date.W3CDTF - W3C Date and Time Formats
-
-=head1 SYNOPSIS
-
-    var dd = new Date.W3CDTF();         // now
-    document.write( "getW3CDTF: "+ dd.getW3CDTF() +"\n" );
-
-    dd.setW3CDTF( "2005-04-23T17:20:00+09:00" );
-    document.write( "toLocaleString: "+ dd.toLocaleString() +"\n" );
-
-=head1 DESCRIPTION
-
-This module understands the W3CDTF date/time format, an ISO 8601 profile, 
-defined by W3C. This format as the native date format of RSS 1.0.
-It can be used to parse these formats in order to create the appropriate objects.
-
-=head1 METHODS
-
-=head2 new()
-
-This constructor method creates a new Date object which has 
-following methods in addition to Date's all native methods.
-
-=head2 setW3CDTF( "2006-02-15T19:40:00Z" )
-
-This method parse a W3CDTF datetime string and sets it.
-
-=head2 getW3CDTF()
-
-This method returns a W3CDTF datetime string.
-Its timezone is always local timezone configured on OS.
-
-=head1 SEE ALSO
-
-http://www.w3.org/TR/NOTE-datetime
-
-=head1 AUTHOR
-
-Yusuke Kawasaki http://www.kawa.net/
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (c) 2005-2006 Yusuke Kawasaki. All rights reserved.
-This program is free software; you can redistribute it and/or 
-modify it under the Artistic license. Or whatever license I choose,
-which I will do instead of keeping this documentation like it is.
-
-=cut
-*/
diff --git a/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml b/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml
index 5d00be1..2849ffd 100644
--- a/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml
+++ b/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml
@@ -1,9 +1,6 @@
 
 <div id='myopac_checked_div' xmlns:xi="http://www.w3.org/2001/XInclude" >
 
-    <!--
-	<script language='javascript' type='text/javascript' src='<!||#echo var="OILS_JS_BASE"||>/Date.W3CDTF.js'/>
-    -->
 
    <table width='100%'><tbody>
       <tr>
diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml
index d443b9f..294f4fe 100644
--- a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml
+++ b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml
@@ -1,6 +1,5 @@
 <table class='hide_me'>
 	<script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/copy_details.js'></script>
-	<script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/Date.W3CDTF.js'></script>
 	<tbody>
 		<tr style='border: 3px solid #E0E0E0;' id='rdetail_volume_details_row' templateRow='1'>
 			<td colspan='10'>

commit 088fe576b399a802c9c2a87d59a6d4af8b19f090
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Fri May 16 10:35:01 2014 -0700

    LP#1320048: remove last use of Date.W3CDTF() from closed dates editor
    
    To test, verify that the closed dates editor continues to
    function normally, i.e.,
    
    * single all-day closures can be added
    * a multi-day closing can be added
    * one can set a "detailed closing" with a custom start
      time and end time
    * existing closures are display properly
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/xul/staff_client/server/admin/closed_dates.js b/Open-ILS/xul/staff_client/server/admin/closed_dates.js
index 45a9a6a..e5ee4a8 100644
--- a/Open-ILS/xul/staff_client/server/admin/closed_dates.js
+++ b/Open-ILS/xul/staff_client/server/admin/closed_dates.js
@@ -275,7 +275,7 @@ function cdVerifyTime(t) {
 
 function cdDateStrToDate( str ) {
 
-    var date = new Date.W3CDTF();
+    var date = new Date();
     var data = str.split(/ /);
 
     var year = data[0];
@@ -396,8 +396,8 @@ function cdGetOrgList(org) {
 function cdCreateOne( org, start, end, note, refresh ) {
     var date = new aoucd();
 
-    date.close_start(start.getW3CDTF());
-    date.close_end(end.getW3CDTF());
+    date.close_start(util.date.formatted_date(start, '%{iso8601}'));
+    date.close_end(util.date.formatted_date(end, '%{iso8601}'));
     date.org_unit(org);
     date.reason(note);
 
diff --git a/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml b/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
index 12032c3..c4e1bf0 100644
--- a/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
+++ b/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
@@ -10,6 +10,8 @@
 
     <head>
         <title>&staff.server.admin.closed_dates.title;</title>
+        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
+        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/openils_dojo.js"></script>
         <script type='text/javascript' src='/opac/common/js/utils.js'> </script>
         <script type='text/javascript' src='/opac/common/js/config.js'> </script>
         <script type='text/javascript' src='/opac/common/js/CGI.js'> </script>
@@ -21,8 +23,8 @@
         <script type='text/javascript' src='/opac/common/js/org_utils.js'> </script>
         <script type='text/javascript' src='/opac/common/js/init.js'> </script>
         <script type='text/javascript' src='/opac/common/js/RemoteRequest.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/Date.W3CDTF.js'> </script>
         <script type="text/javascript" src="/xul/server/main/JSAN.js"></script>
+        <script type="text/javascript" src="/xul/server/main/constants.js" />
         <script type='text/javascript' src='adminlib.js'> </script>
         <script type='text/javascript' src='closed_dates.js'> </script>
 

commit 3ea7a983bd22a2c0f4ff2da4d06ed09f15b6b8c6
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Fri May 16 10:03:45 2014 -0700

    LP#1320048: correctly display closures in the closed dates editor
    
    This patch fixes a problem introduced by the patch for bug 1187035
    that caused the closed dates editor to display all closures as if
    they started and ended at the current time.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/xul/staff_client/server/admin/closed_dates.js b/Open-ILS/xul/staff_client/server/admin/closed_dates.js
index d784ff6..45a9a6a 100644
--- a/Open-ILS/xul/staff_client/server/admin/closed_dates.js
+++ b/Open-ILS/xul/staff_client/server/admin/closed_dates.js
@@ -1,3 +1,4 @@
+var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
 var FETCH_CLOSED_DATES    = 'open-ils.actor:open-ils.actor.org_unit.closed.retrieve.all';
 var FETCH_CLOSED_DATE    = 'open-ils.actor:open-ils.actor.org_unit.closed.retrieve';
 var CREATE_CLOSED_DATE    = 'open-ils.actor:open-ils.actor.org_unit.closed.create';
@@ -23,6 +24,19 @@ var myPerms = [
 
 function cdEditorInit() {
 
+    try {
+        if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+        JSAN.errorLevel = "die"; // none, warn, or die
+        JSAN.addRepository('..');
+        JSAN.use('util.error'); g.error = new util.error();
+        JSAN.use('util.date');
+    } catch(E) {
+        var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
+            "system administrator or software developer the following:\nadmin/closed_dates.xhtml\n" + E + '\n';
+        try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
+        alert(err_msg);
+    }
+
     /* set the various template rows */
     cdTbody = $('cd_tbody');
     cdRowTemplate                    = cdTbody.removeChild($('cd_row'));
@@ -162,32 +176,11 @@ function cdBuild(r) {
 }
 
 function cdDateToHours(date) {
-    var d = new Date.W3CDTF();
-    d.setW3CDTF(date.replace(/\.\d+/,'') + ":00");
-
-    var h = d.getHours() +'';
-    var m = d.getMinutes() +'';
-    var s = d.getSeconds() +'';
-
-    if(h.length == 1) h = '0'+h;
-    if(m.length == 1) m = '0'+m;
-    if(s.length == 1) s = '0'+s;
-
-    return  h + ':' + m + ':' + s;
+    return util.date.formatted_date(date, '%H:%M');
 }
 
 function cdDateToDate(date) {
-    var d = new Date.W3CDTF();
-    d.setW3CDTF(date.replace(/\.\d+/,'') + ":00");
-
-    var y = d.getFullYear()+'';
-    var m = (d.getMonth() + 1)+'';
-    var d = d.getDate()+'';
-
-    if(m.length == 1) m = '0'+m;
-    if(d.length == 1) d = '0'+d;
-
-    return  y + '-' + m + '-' + d;
+    return util.date.formatted_date(date, '%F');
 }
 
 
@@ -272,8 +265,6 @@ function cdDelete(row, date) {
 }
 
 
-/* getW3CDTF */
-
 function cdVerifyDate(d) {
     return d && d.match(/\d{4}-\d{2}-\d{2}/);
 }
diff --git a/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml b/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
index c831f7d..12032c3 100644
--- a/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
+++ b/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
@@ -22,6 +22,7 @@
         <script type='text/javascript' src='/opac/common/js/init.js'> </script>
         <script type='text/javascript' src='/opac/common/js/RemoteRequest.js'> </script>
         <script type='text/javascript' src='/opac/common/js/Date.W3CDTF.js'> </script>
+        <script type="text/javascript" src="/xul/server/main/JSAN.js"></script>
         <script type='text/javascript' src='adminlib.js'> </script>
         <script type='text/javascript' src='closed_dates.js'> </script>
 

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

Summary of changes:
 Open-ILS/web/opac/common/js/Date.W3CDTF.js         |  132 --------------------
 .../skin/default/xml/myopac/myopac_checked.xml     |    3 -
 .../default/xml/rdetail/rdetail_cn_details.xml     |    1 -
 .../xul/staff_client/server/admin/closed_dates.js  |   47 +++----
 .../staff_client/server/admin/closed_dates.xhtml   |    5 +-
 5 files changed, 23 insertions(+), 165 deletions(-)
 delete mode 100644 Open-ILS/web/opac/common/js/Date.W3CDTF.js


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list