[open-ils-commits] r17524 - in branches/rel_2_0/Open-ILS: src/sql/Pg src/sql/Pg/upgrade web/css/skin/default web/js/ui/default/actor/user web/templates/default/actor/user (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Sep 8 16:02:24 EDT 2010


Author: phasefx
Date: 2010-09-08 16:02:19 -0400 (Wed, 08 Sep 2010)
New Revision: 17524

Added:
   branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql
   branches/rel_2_0/Open-ILS/web/css/skin/default/register.css
Modified:
   branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
   branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js
   branches/rel_2_0/Open-ILS/web/templates/default/actor/user/register.tt2
Log:
Backport 17516, 17517, 17522, 17523: Allows us to create an /openils/var/web/css/skin/default/register_custom.css file containing local CSS for styling the patron editor.  Example:

TR[fmfield=ident_type] { display: none; } /* be sure to set the ui.patron.default_ident_type setting */
TR[fmfield=ident_value2] { border: solid thick red; font-size: x-large; }
TR[fmfield=barred] { display: none; }
TR[fmfield=country] { display: none; } /* be sure to set the ui.patron.default_country setting */
TR[fmfield=master_account] { display: none; }
TR[fmfield=alert_message] { display: none; }
TR[fmfield=ident_value] { z-index: -1; }
TR[stat_cat_id='1'] { border: solid thick red; font-size: x-large; }



Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-09-08 19:57:33 UTC (rev 17523)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-09-08 20:02:19 UTC (rev 17524)
@@ -68,7 +68,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0387'); -- gmc
+INSERT INTO config.upgrade_log (version) VALUES ('0388'); -- phasefx
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-09-08 19:57:33 UTC (rev 17523)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-09-08 20:02:19 UTC (rev 17524)
@@ -6842,3 +6842,37 @@
         'bool'
 );
 
+-- 0388.data.org-setting-ui.patron.editor_defaults.sql
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, fm_class ) VALUES (
+        'ui.patron.default_ident_type',
+        oils_i18n_gettext(
+            'ui.patron.default_ident_type',
+            'GUI: Default Ident Type for Patron Registration', 
+            'coust', 
+            'label'),
+        oils_i18n_gettext(
+            'ui.patron.default_ident_type',
+            'This is the default Ident Type for new users in the patron editor.',
+            'coust', 
+            'description'),
+        'link',
+        'cit'
+);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+        'ui.patron.default_country',
+        oils_i18n_gettext(
+            'ui.patron.default_country',
+            'GUI: Default Country for New Addresses in Patron Editor', 
+            'coust', 
+            'label'),
+        oils_i18n_gettext(
+            'ui.patron.default_country',
+            'This is the default Country for new addresses in the patron editor.',
+            'coust', 
+            'description'),
+        'string'
+);
+
+

Copied: branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql (from rev 17517, trunk/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql)
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql	                        (rev 0)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql	2010-09-08 20:02:19 UTC (rev 17524)
@@ -0,0 +1,36 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0388'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, fm_class ) VALUES (
+        'ui.patron.default_ident_type',
+        oils_i18n_gettext(
+            'ui.patron.default_ident_type',
+            'GUI: Default Ident Type for Patron Registration', 
+            'coust', 
+            'label'),
+        oils_i18n_gettext(
+            'ui.patron.default_ident_type',
+            'This is the default Ident Type for new users in the patron editor.',
+            'coust', 
+            'description'),
+        'link',
+        'cit'
+);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+        'ui.patron.default_country',
+        oils_i18n_gettext(
+            'ui.patron.default_country',
+            'GUI: Default Country for New Addresses in Patron Editor', 
+            'coust', 
+            'label'),
+        oils_i18n_gettext(
+            'ui.patron.default_country',
+            'This is the default Country for new addresses in the patron editor.',
+            'coust', 
+            'description'),
+        'string'
+);
+
+COMMIT;

Copied: branches/rel_2_0/Open-ILS/web/css/skin/default/register.css (from rev 17516, trunk/Open-ILS/web/css/skin/default/register.css)
===================================================================
--- branches/rel_2_0/Open-ILS/web/css/skin/default/register.css	                        (rev 0)
+++ branches/rel_2_0/Open-ILS/web/css/skin/default/register.css	2010-09-08 20:02:19 UTC (rev 17524)
@@ -0,0 +1,83 @@
+ at import url("register_custom.css");
+
+/* XXX Move me into the CSS tree XXX */
+
+#uedit-tbody tr td {
+    padding: 5px;
+    text-align: left;
+}
+
+
+#uedit-save-div {
+    position: fixed;
+    top:40px;
+    right:30px;
+    width:300px;
+    border:2px solid #d9e8f9;
+    -moz-border-radius: 10px;
+    font-weight: bold;
+    padding: 12px;
+    text-align:center;
+    vertical-align:middle;
+}
+
+#uedit-help-div {
+    position: fixed;
+    top:124px;
+    right:30px;
+    width:300px;
+    border:2px dashed #d9e8f9;
+    -moz-border-radius: 10px;
+    font-weight: bold;
+    padding: 20px;
+}
+
+#uedit-dupe-div {
+    position: fixed;
+    top:124px;
+    right:30px;
+    width:300px;
+    border:2px dashed #d9e8f9;
+    -moz-border-radius: 10px;
+    font-weight: bold;
+    padding: 20px;
+}
+
+.uedit-help {
+    width: 25px;
+    border:1px solid #e0e0e0;
+    text-align:center;
+    vertical-align:middle;
+}
+.divider td {
+    min-height:10px;
+    background-color: #e0e0e0;
+}
+
+.divider span { padding: 0px 5px 0px 5px; }
+
+.newaddr-row td {
+    text-align: right;
+    border-top:1px dashed #d9e8f9;
+}
+.newaddr-row td:last-child {
+    border-right:1px dashed #d9e8f9;
+}
+
+.pending-addr-row td { border:1px solid #aaa; }
+
+.uedit-addr-del-button {margin-left: 10px; color:red;}
+
+.dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+
+.hide-non-required tr:not([required]) {
+    visibility:hidden;
+    display:none;
+}
+
+#require-toggle {
+    margin-top:10px;
+    margin-bottom:-5px;
+}
+
+

Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js	2010-09-08 19:57:33 UTC (rev 17523)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js	2010-09-08 20:02:19 UTC (rev 17524)
@@ -82,6 +82,8 @@
         'global.juvenile_age_threshold',
         'patron.password.use_phone',
         'ui.patron.default_inet_access_level',
+        'ui.patron.default_ident_type',
+        'ui.patron.default_country',
         'circ.holds.behind_desk_pickup_supported',
         'circ.patron_edit.clone.copy_address'
     ]);
@@ -454,6 +456,9 @@
         var stat = statCats[idx];
         var row = statCatTemplate.cloneNode(true);
         row.id = 'stat-cat-row-' + idx;
+        row.setAttribute('stat_cat_owner',stat.owner());
+        row.setAttribute('stat_cat_name',stat.name());
+        row.setAttribute('stat_cat_id',stat.id());
         tbody.appendChild(row);
         getByName(row, 'name').innerHTML = stat.name();
         var valtd = getByName(row, 'widget');
@@ -520,6 +525,8 @@
     var wclass = row.getAttribute('wclass');
     var wstyle = row.getAttribute('wstyle');
     var wconstraints = row.getAttribute('wconstraints');
+    /* use CSS to set the zindex for widgets you want to disable. */
+    var disabled = dojo.style(row, 'zIndex') == -1 ? true : false;
 
     var isPasswd2 = (fmfield == 'passwd2');
     if(isPasswd2) fmfield = 'passwd';
@@ -549,7 +556,6 @@
     wtd.appendChild(span);
 
     var fmObject = null;
-    var disabled = false;
     switch(fmcls) {
         case 'au' : fmObject = patron; break;
         case 'ac' : fmObject = patron.card(); break;
@@ -1003,6 +1009,7 @@
     patron.card(card);
     patron.cards([card]);
     patron.net_access_level(orgSettings['ui.patron.default_inet_access_level'] || 1);
+    patron.ident_type(orgSettings['ui.patron.default_ident_type']);
     patron.stat_cat_entries([]);
     patron.survey_responses([]);
     patron.addresses([]);
@@ -1060,6 +1067,7 @@
                     addr.id(w._addr);
                     addr.isnew(1);
                     addr.usr(patron.id());
+                    addr.country(orgSettings['ui.patron.default_country']);
                     var t = patron.addresses();
                         if (!t) { t = []; }
                         t.push(addr);
@@ -1208,6 +1216,10 @@
                 if(id < 0 && row.getAttribute('fmfield') == 'valid') 
                     widget.widget.attr('value', true); 
 
+                // make new addresses use the org setting for default country 
+                if(id < 0 && row.getAttribute('fmfield') == 'country') 
+                    widget.widget.attr('value',orgSettings['ui.patron.default_country']);
+
             } else if(row.getAttribute('name') == 'uedit-addr-pending-row') {
 
                 // if it's a pending address, show the 'approve' button

Modified: branches/rel_2_0/Open-ILS/web/templates/default/actor/user/register.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/actor/user/register.tt2	2010-09-08 19:57:33 UTC (rev 17523)
+++ branches/rel_2_0/Open-ILS/web/templates/default/actor/user/register.tt2	2010-09-08 20:02:19 UTC (rev 17524)
@@ -1,91 +1,8 @@
 [% ctx.page_title = 'User Editor' %]
 [% WRAPPER default/base.tt2 %]
 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/actor/user/register.js'></script>
+<link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/[% ctx.skin %]/register.css" />
 
-<style type="text/css">
-
-    /* XXX Move me into the CSS tree XXX */
-
-    #uedit-tbody tr td {
-        padding: 5px;
-        text-align: left;
-    }
-
-
-    #uedit-save-div {
-        position: fixed;
-        top:40px;
-        right:30px;
-        width:300px;
-        border:2px solid #d9e8f9;
-        -moz-border-radius: 10px;
-        font-weight: bold;
-        padding: 12px;
-        text-align:center;
-        vertical-align:middle;
-    }
-
-    #uedit-help-div {
-        position: fixed;
-        top:124px;
-        right:30px;
-        width:300px;
-        border:2px dashed #d9e8f9;
-        -moz-border-radius: 10px;
-        font-weight: bold;
-        padding: 20px;
-    }
-
-    #uedit-dupe-div {
-        position: fixed;
-        top:124px;
-        right:30px;
-        width:300px;
-        border:2px dashed #d9e8f9;
-        -moz-border-radius: 10px;
-        font-weight: bold;
-        padding: 20px;
-    }
-
-    .uedit-help {
-        width: 25px;
-        border:1px solid #e0e0e0;
-        text-align:center;
-        vertical-align:middle;
-    }
-    .divider td {
-        min-height:10px;
-        background-color: #e0e0e0;
-    }
-
-    .divider span { padding: 0px 5px 0px 5px; }
-
-    .newaddr-row td {
-        text-align: right;
-        border-top:1px dashed #d9e8f9;
-    }
-    .newaddr-row td:last-child {
-        border-right:1px dashed #d9e8f9;
-    }
-
-    .pending-addr-row td { border:1px solid #aaa; }
-
-    .uedit-addr-del-button {margin-left: 10px; color:red;}
-
-    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
-
-    .hide-non-required tr:not([required]) {
-        visibility:hidden;
-        display:none;
-    }
-
-    #require-toggle {
-        margin-top:10px;
-        margin-bottom:-5px;
-    }
-
-</style>
-
 <div dojoType="dijit.form.Form" id="myForm" jsId="myForm" encType="multipart/form-data" action="" method="">
     <script type="dojo/method" event="onSubmit">
         /* we don't want to use the form action, but uEditSave and UEditSaveClone from the Save buttons.  We



More information about the open-ils-commits mailing list