[open-ils-commits] r13354 - trunk/Open-ILS/web/js/ui/default/actor/user (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jun 9 16:40:37 EDT 2009
Author: erickson
Date: 2009-06-09 16:40:33 -0400 (Tue, 09 Jun 2009)
New Revision: 13354
Modified:
trunk/Open-ILS/web/js/ui/default/actor/user/register.js
Log:
plugged in 'auto-set-juvenile-flag-by-dob' handler
Modified: trunk/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2009-06-09 20:12:29 UTC (rev 13353)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2009-06-09 20:40:33 UTC (rev 13354)
@@ -265,6 +265,7 @@
un.widget.attr('value', this.attr('value'));
}
);
+ return;
}
}
@@ -286,6 +287,27 @@
this.store.fetch({onComplete:found, query:{id:this.attr('value')}});
}
);
+ return;
+
+ case 'dob':
+ dojo.connect(widget.widget, 'onChange',
+ function(newDob) {
+ if(!newDob) return;
+ var oldDob = patron.dob();
+ if(dojo.date.stamp.fromISOString(oldDob) == newDob) return;
+
+ var juvInterval = orgSettings['global.juvenile_age_threshold'] || '18 years';
+ var juvWidget = findWidget('au', 'juvenile');
+ var base = new Date();
+ base.setTime(base.getTime() - Number(openils.Util.intervalToSeconds(juvInterval) + '000'));
+
+ if(newDob <= base) // older than global.juvenile_age_threshold
+ juvWidget.widget.attr('value', false);
+ else
+ juvWidget.widget.attr('value', true);
+ }
+ );
+ return;
}
}
@@ -310,6 +332,7 @@
);
}
);
+ return;
}
}
}
More information about the open-ils-commits
mailing list