lots of fixes, data wrangling.
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 21:41:49 +0000 (21:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 21:41:49 +0000 (21:41 +0000)
creating users now works (needs more tests)
editing existing users has not been handled yet.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@3169 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/user_editor.js
Open-ILS/xul/staff_client/server/patron/user_editor.xml

index c45dc26..fb73ba2 100644 (file)
@@ -1,16 +1,20 @@
 
-var cgi                                        = null;
-var patron                             = null;
-var advanced                   = false;
-var SC_FETCH_ALL     = 'open-ils.circ:open-ils.circ.stat_cat.actor.retrieve.all';
-var SC_CREATE_MAP              = 'open-ils.circ:open-ils.circ.stat_cat.actor.user_map.create';
-var SV_FETCH_ALL               = 'open-ils.circ:open-ils.circ.survey.retrieve.all';
-var FETCH_ID_TYPES     = 'open-ils.actor:open-ils.actor.user.ident_types.retrieve';
-var FETCH_GROUPS               = 'open-ils.actor:open-ils.actor.groups.tree.retrieve';
-var identTypes                 = {};
-var groupTree                  = null;
-var cachedSurveys              = {};
-var ERRORS                             = ""; /* global set of errors */
+var cgi                                                        = null;
+var patron                                             = null;
+var advanced                                   = false;
+var SC_FETCH_ALL                               = 'open-ils.circ:open-ils.circ.stat_cat.actor.retrieve.all';
+var SC_CREATE_MAP                              = 'open-ils.circ:open-ils.circ.stat_cat.actor.user_map.create';
+var SV_FETCH_ALL                               = 'open-ils.circ:open-ils.circ.survey.retrieve.all';
+var FETCH_ID_TYPES                     = 'open-ils.actor:open-ils.actor.user.ident_types.retrieve';
+var FETCH_GROUPS                               = 'open-ils.actor:open-ils.actor.groups.tree.retrieve';
+var UPDATE_PATRON                              = 'open-ils.actor:open-ils.actor.patron.update';
+var identTypes                                 = {};
+var groupTree                                  = null;
+var cachedSurveys                              = {};
+var cachedSurveyQuestions      = {};
+var cachedSurveyAnswers                = {};
+var cachedStatCats                     = {};
+var ERRORS                                             = ""; /* global set of errors */
 
 var myPerms            = [ 'CREATE_USER', 'UPDATE_USER', 'CREATE_PATRON_STAT_CAT_ENTRY_MAP' ];
 
@@ -156,13 +160,26 @@ function uEditFetchSurveys() {
 /* ------------------------------------------------------------------------------ */
 /* Save the user
 /* ------------------------------------------------------------------------------ */
-var uEditExistingStatEnties;
+var uEditExistingStatEntries;
 var uEditExistingSurveyResponses;
 
 function uEditSaveUser() {
        uEditCollectData();
-       if(ERRORS) { alert(ERRORS); ERRORS = ""; }
-       else alert(js2JSON(patron));
+
+       if(ERRORS) { 
+               alert(ERRORS); 
+               ERRORS = ""; 
+               return;
+       }
+
+       //alert(js2JSON(patron));
+
+       var req = new Request(UPDATE_PATRON, SESSION, patron);
+       req.send(true);
+       var result = req.result();
+       if( checkILSEvent(result) ) alert(js2JSON(result));
+       else alert($('ue_success').innerHTML);
+
 }
 
 function uEditCollectData() {
@@ -179,10 +196,13 @@ function uEditCollectData() {
 
        } else { 
 
-               patron.ischanged(1); 
-               patron.isnew(0);
-               uEditExistingStatEnties = patron.stat_cat_entries();
-               uEditExistingSurveyResponses = patron.survey_responses();
+               /* if this function is called again, patron will exist */
+               if(!patron.isnew()) { 
+                       patron.ischanged(1); 
+                       patron.isnew(0);
+                       uEditExistingStatEntries = patron.stat_cat_entries();
+                       uEditExistingSurveyResponses = patron.survey_responses();
+               }
        }
 
        patron.stat_cat_entries([]);
@@ -205,7 +225,9 @@ function uEditCollectData() {
 /* Draw the user
 /* ------------------------------------------------------------------------------ */
 function uEditDrawUser(patron) {
-       if(!patron) return 0;
+       if(!patron) {
+               
+       }
 }
 
 
@@ -258,10 +280,12 @@ function uEditInsertCat( tbody, row, cat, idx ) {
                }
        );
 
+       cachedStatCats[cat.id()] = cat;
+
        row.setAttribute('statcat', cat.id());
        var newval = $n(row, 'ue_stat_cat_newval');
        newval.onchange = function(){ 
-               findParentNodeByName(newval,'tr').setAttribute('changed', '1'); }
+               findParentByNodeName(newval,'tr').setAttribute('changed', '1'); }
 
        var selector = $n(row, 'ue_stat_cat_selector');
        selector.onchange = function(){ 
@@ -291,8 +315,10 @@ function uEditReapStatCats(patron) {
                if( !row || row.nodeName != 'tr' ) continue;
                if( row.getAttribute('changed') ) {
                        var val = $n( row, 'ue_stat_cat_newval' );
-                       uEditCreateStatEntry( patron, row.getAttribute('statcat'), 
-                               val.value, val.getAttribute('entry') );
+                       if(val.value) {
+                               uEditCreateStatEntry( patron, row.getAttribute('statcat'), 
+                                       val.value, val.getAttribute('entry') );
+                       }
                }
        }
 }
@@ -346,7 +372,9 @@ function uEditInsertSurvey( div, table, survey, sidx ) {
        var idx = 1;
        for( var q in survey.questions() ) {
                var row = templ.cloneNode(true);
-               uEditInsertSurveyQuestion( div, table, tbody, row, survey, survey.questions()[q], sidx );
+               var quest = survey.questions()[q];
+               cachedSurveyQuestions[quest.id()] = quest;
+               uEditInsertSurveyQuestion( div, table, tbody, row, survey, quest, sidx );
                tbody.appendChild(row);
        }
 }
@@ -374,26 +402,29 @@ function uEditInsertSurveyQuestion( div, table, tbody, row, survey, question, si
        for( var a in question.answers() ) {
 
                var answer = question.answers()[a];
+               cachedSurveyAnswers[answer.id()] = answer;
 
                if( survey.poll() ) {
 
                        unHideMe(polldiv);
                        var prow = pollrow.cloneNode(true);
 
-                       prow.onselect   = function() {
-                               row.setAttribute('answer', answer.id());
-                               row.setAttribute('changed', '1');
-                       }
 
                        $n(prow, 'ue_survey_answer_poll_answer').appendChild(text(answer.answer()));
 
-                       $n(prow, 'ue_survey_answer_poll_radio').appendChild(
-                               elem('input', { 
+
+                       var input = elem('input', { 
                                        type    : 'radio', 
                                        name    : 'survey_poll_answer_'+survey.id(),
                                        id              :  answer.id()
-                               }));
+                               });
+
+                       input.onchange  = function() {
+                               row.setAttribute('answer', answer.id());
+                               row.setAttribute('changed', '1');
+                       }
 
+                       $n(prow, 'ue_survey_answer_poll_radio').appendChild(input);
                        polltbody.appendChild(prow);
 
                } else {
@@ -419,6 +450,8 @@ function uEditReapSurveys(patron) {
 
                for( var r in rows ) {
                        var row = rows[r];
+                       if(!row.getAttribute('changed')) continue;
+
                        var resp        = new asvr();
                        resp.isnew(1);
                        resp.survey(survey.id());
@@ -642,16 +675,17 @@ function uEditBuildAddress( patron, tbody, row ) {
                addr.isnew(1);
        }
 
-       if($n(row, 'ue_addr_mailing_yes')) patron.mailing_address(addr.id());
-       if($n(row, 'ue_addr_billing_yes')) patron.billing_address(addr.id());
+       if($n(row, 'ue_addr_mailing_yes').checked) patron.mailing_address(addr.id());
+       if($n(row, 'ue_addr_billing_yes').checked) patron.billing_address(addr.id());
+       if($n(row, 'ue_addr_valid_yes').checked) addr.valid(1);
+       if($n(row, 'ue_addr_street2').value) addr.street2($n(row, 'ue_addr_street2').value);
 
-       uEditSetVal(addr, "address_type",       $n(row, 'ue_addr_address_type'),        null, 'ue_bad_addr_address_type' );
+       uEditSetVal(addr, "address_type",       $n(row, 'ue_addr_label'),                       null, 'ue_bad_addr_label' );
        uEditSetVal(addr, "street1",                    $n(row, 'ue_addr_street1'),             null, 'ue_bad_addr_street' );
-       uEditSetVal(addr, "street2",                    $n(row, 'ue_addr_street2'),             null, 'ue_bad_addr_street' );
        uEditSetVal(addr, "city",                               $n(row, 'ue_addr_city'),                        null, 'ue_bad_addr_city' );
        uEditSetVal(addr, "county",                     $n(row, 'ue_addr_county'),                      null, 'ue_bad_addr_county' );
        uEditSetVal(addr, "state",                              $n(row, 'ue_addr_state'),                       null, 'ue_bad_addr_state' );
-       uEditSetVal(addr, "post_code",          $n(row, 'ue_addr_post_code'),           null, 'ue_bad_addr_post_code' );
+       uEditSetVal(addr, "post_code",          $n(row, 'ue_addr_zip'),                         null, 'ue_bad_addr_zip' );
        uEditSetVal(addr, "country",                    $n(row, 'ue_addr_country'),             null, 'ue_bad_addr_country' );
 
        return addr;
@@ -659,17 +693,34 @@ function uEditBuildAddress( patron, tbody, row ) {
 
 
 var uEditAddrTemplate;
+var uEditOrigAddrRow;
 function uEditFetchAddrs() {
 
        var tbody = $('ue_address_tbody');
        uEditAddrTemplate = tbody.removeChild($('ue_address_template'));
 
        $('ue_address_new').onclick = 
-               function() { tbody.appendChild(uEditAddrTemplate.cloneNode(true)); }
+               function() { 
+                       /* we have to retain the mailing/billing radio input values */
+                       var rows = getElementsByTagNameFlat(tbody,'tr');
+                       var mailrow;
+                       var billrow;
+                       for( var r in rows ) {
+                               var row = rows[r];
+                               if($n(row,'ue_addr_mailing_yes').checked) mailrow = row;
+                               if($n(row,'ue_addr_billing_yes').checked) billrow = row;
+                       }
+                       var newrow = uEditAddrTemplate.cloneNode(true);
+                       tbody.appendChild(newrow); 
+                       $n(newrow, 'ue_addr_label').focus();
+                       if(mailrow) $n(mailrow,'ue_addr_mailing_yes').checked = true;
+                       if(billrow) $n(billrow,'ue_addr_billing_yes').checked = true;
+               }
 
        /* go ahead and add a blank addr */
        if(!patron) {
                var row = uEditAddrTemplate.cloneNode(true);
+               uEditOrigAddrRow = row;
                $n( row, 'ue_addr_label').id = 'ue_addr_label_1';
                tbody.appendChild(row); 
                return;
@@ -679,39 +730,132 @@ function uEditFetchAddrs() {
 
 function uEditShowSummary() {
        uEditCollectData();
-       var table = $('ue_summary_table');
+       var table = $('ue_summary_table').cloneNode(true);;
        uEditFleshSummaryTable(table);
        var win = window.open("", $('ue_summary_window').innerHTML );   
-       win.document.body.appendChild(table.cloneNode(true));
+       win.document.body.innerHTML = "";
+       win.document.body.appendChild(table);
 }
 
 function uEditFleshSummaryTable(table) {
+
+       var yes = $('yes').innerHTML;
+       var no = $('no').innerHTML;
+
        var identt1 = "";
        var identt2 = "";
        var homeorg = "";
+       var profile     = "";
 
        if( patron.ident_type() != null) 
                identt1 = identTypes[patron.ident_type()].name();
        if( patron.ident_type2() != null ) 
-               identt2 = identTypes[patron.ident_type()].name();
+               identt2 = identTypes[patron.ident_type2()].name();
        if( patron.home_ou() != null )
                homeorg = findOrgUnit(patron.home_ou()).name();
+       if( patron.profile() != null )
+               profile = findTreeItemById(groupTree, patron.profile()).name();
+
+
+       $n(table, 'ue_summary_username').appendChild(text(patron.usrname()));
+       $n(table, 'ue_summary_firstname').appendChild(text(patron.first_given_name()));
+       $n(table, 'ue_summary_middlename').appendChild(text(patron.second_given_name()));
+       $n(table, 'ue_summary_lastname').appendChild(text(patron.family_name()));
+       $n(table, 'ue_summary_suffix').appendChild(text(patron.suffix()));
+       $n(table, 'ue_summary_dob').appendChild(text(patron.dob()));
+       $n(table, 'ue_summary_primary_ident_type').appendChild(text(identt1));
+       $n(table, 'ue_summary_primary_ident').appendChild(text(patron.ident_value()));
+       $n(table, 'ue_summary_secondary_ident_type').appendChild(text(identt2));
+       $n(table, 'ue_summary_secondary_ident').appendChild(text(patron.ident_value2()));
+       $n(table, 'ue_summary_email').appendChild(text(patron.email()));
+       $n(table, 'ue_summary_dayphone').appendChild(text(patron.day_phone()));
+       $n(table, 'ue_summary_nightphone').appendChild(text(patron.evening_phone()));
+       $n(table, 'ue_summary_otherphone').appendChild(text(patron.other_phone()));
+       $n(table, 'ue_summary_home_lib').appendChild(text(homeorg));
+       $n(table, 'ue_summary_profile').appendChild(text(profile));
+       $n(table, 'ue_summary_expire').appendChild(text(patron.expire_date()));
+       $n(table, 'ue_summary_family_lead').appendChild(text( (patron.master_account()) ? yes : no ));
+       $n(table, 'ue_summary_claims_returned').appendChild(text(patron.claims_returned_count()));
+       $n(table, 'ue_summary_alert_message').appendChild(text(patron.alert_message()));
+
+       uEditFleshSummaryAddresses( table, patron );
+       uEditFleshSummaryStatCats( table, patron );
+       uEditFleshSummarySurveys( table, patron );
+       uEditFleshSummaryErrors( table );
+
+
+}
+
+function uEditFleshSummaryAddresses( table, patron ) {
+
+       var addrtbody = $n(table, 'ue_summary_addr_tbody');
+       var rowtmpl = addrtbody.removeChild($n(addrtbody, 'ue_summary_addr_row'));
+       var yes = $('yes').innerHTML;
+       var no = $('no').innerHTML;
+
+       for( var a in patron.addresses() ) {
+
+               var address = patron.addresses()[a];
+               var row = rowtmpl.cloneNode(true);
+
+               $n(row, 'label').appendChild(text(address.address_type()));
+               $n(row, 'street1').appendChild(text(address.street1()));
+               $n(row, 'street2').appendChild(text(address.street2()));
+               $n(row, 'city').appendChild(text(address.city()));
+               $n(row, 'county').appendChild(text(address.county()));
+               $n(row, 'state').appendChild(text(address.state()));
+               $n(row, 'country').appendChild(text(address.country()));
+               $n(row, 'zip').appendChild(text(address.post_code()));
+               $n(row, 'valid').appendChild(text( (address.valid()) ? yes : no ));
+
+               $n(row, 'mailing').appendChild(text( 
+                       (patron.mailing_address() == address.id()) ? yes : no ));
+
+               $n(row, 'billing').appendChild(text( 
+                       (patron.billing_address() == address.id()) ? yes : no ));
+
+               addrtbody.appendChild(row);
+       }
+}
+
 
-       $('ue_summary_username').appendChild(text(patron.usrname()));
-       $('ue_summary_firstname').appendChild(text(patron.first_given_name()));
-       $('ue_summary_middlename').appendChild(text(patron.second_given_name()));
-       $('ue_summary_lastname').appendChild(text(patron.family_name()));
-       $('ue_summary_suffix').appendChild(text(patron.suffix()));
-       $('ue_summary_dob').appendChild(text(patron.dob()));
-       $('ue_summary_primary_ident_type').appendChild(text(identt1));
-       $('ue_summary_primary_ident').appendChild(text(patron.ident_value()));
-       $('ue_summary_secondary_ident_type').appendChild(text(identt2));
-       $('ue_summary_secondary_ident').appendChild(text(patron.ident_value2()));
-       $('ue_summary_email').appendChild(text(patron.email()));
-       $('ue_summary_dayphone').appendChild(text(patron.day_phone()));
-       $('ue_summary_nightphone').appendChild(text(patron.evening_phone()));
-       $('ue_summary_otherphone').appendChild(text(patron.other_phone()));
-       $('ue_summary_home_lib').appendChild(text(homeorg));
+function uEditFleshSummaryStatCats( table, patron ) {
+       var tbody = $n(table, 'ue_summary_stats_tbody');
+       var rowtmpl = tbody.removeChild($n(tbody, 'ue_summary_stats_row'));
+       for( var s in patron.stat_cat_entries() ) {
+               unHideMe($n(table, 'ue_summary_stat_cat_td'));
+               row = rowtmpl.cloneNode(true);
+               var entry = patron.stat_cat_entries()[s];
+               var cat = cachedStatCats[entry.stat_cat()];
+               $n(row, 'ue_summary_stat_name').appendChild(text(cat.name()));
+               $n(row, 'ue_summary_stat_value').appendChild(text(entry.stat_cat_entry()));
+               tbody.appendChild(row);
+       }
 }
 
 
+function uEditFleshSummarySurveys( table, patron ) {
+       var tbody       = $n(table, 'ue_summary_survey_tbody');
+       var rowtmpl = tbody.removeChild($n(tbody, 'ue_summary_survey_row'));
+       for( var r in patron.survey_responses() ) {
+               unHideMe($n(table, 'ue_summary_survey_td'));
+               var row         = rowtmpl.cloneNode(rowtmpl);
+               var resp                = patron.survey_responses()[r];
+               var survey      = cachedSurveys[resp.survey()];
+               var quest       = cachedSurveyQuestions[resp.question()];
+               var answer      = cachedSurveyAnswers[resp.answer()];
+               $n(row, 'ue_summary_survey_name').appendChild(text(survey.name()));
+               $n(row, 'ue_summary_survey_question').appendChild(text(quest.question()));
+               $n(row, 'ue_summary_survey_answer').appendChild(text(answer.answer()));
+               tbody.appendChild(row);
+       }
+}
+
+
+function uEditFleshSummaryErrors( table ) {
+       if(ERRORS) {
+               unHideMe($n(table, 'ue_summary_errors_row'));
+               var errors = ERRORS.replace(/\n/g, "<br/>");
+               $n(table, 'ue_summary_errors').innerHTML += errors;
+       }
+}
index 9a6f149..bbe5da5 100644 (file)
                                                                                <td><input type='checkbox' name='ue_addr_valid_yes' checked='checked'/></td>
                                                                                <td>
                                                                                        <div style='width: 100%; -moz-border-radius: 8px;'>
-                                                                                               <input type='radio' name='ue_addr_mailing_yes' 
+                                                                                               <input type='radio' name='ue_addr_mailing_yes' checked='checked'
                                                                                                        onclick='uEditAddrHighlight(this, "mailing");'/>
                                                                                        </div>
                                                                                </td>
                                                                                <td>
                                                                                        <div style='width: 100%; -moz-border-radius: 8px;'>
-                                                                                               <input type='radio' name='ue_addr_billing_yes' 
+                                                                                               <input type='radio' name='ue_addr_billing_yes' checked='checked'
                                                                                                        onclick='uEditAddrHighlight(this, "billing");'/>
                                                                                        </div>
                                                                                </td>
                                                                </thead>
                                                                <tbody name='ue_survey_tbody'>
                                                                        <tr name='ue_survey_row'>
-                                                                               <td name='ue_survey_question' style='width: 60%; text-align: left; padding-left: 40px;'/>
+                                                                               <td name='ue_survey_question' 
+                                                                                       style='width: 60%; text-align: left; padding-left: 40px;'/>
                                                                                <td class='hide_me'>
                                                                                        <select name='ue_survey_answer'>
                                                                                                <option> -- Select One -- </option>
                                                <!-- ************************************************************** -->
                                                <div id='uedit_finalize' class='main_div hide_me'>
                                                        <div class='has_color' style='width: 95%; margin-top: 40px; text-align: center'>
-                                                               <div>
+                                                               <div style='padding: 5px;'>
                                                                        You are now ready to save the user to the database.  <br/>
                                                                        To view or print a summary of the changes, click on the "View Summary" link.  <br/>
                                                                        To save the user, click on the 'Save User' button.
                                                                <br/>
                                                                <a style='margin-right: 30px;' id='ue_view_summary' 
                                                                        href='javascript:uEditShowSummary();'>View Summary</a>
-                                                               <input style='margin-left: 30px;' type='submit' value='Save User' onclick='uEditSaveUser();'/>
+                                                               <input style='margin-left: 30px;' 
+                                                                       type='submit' value='Save User' onclick='uEditSaveUser();'/>
                                                        </div>
                                                </div>
 
                                                                <tr id='uedit_nav_bar'>
                                                                        <td width='10%'/>
                                                                        <td width='40%'>
-                                                                               <a id='ue_back' class='nav_link hide_me' href='javascript:uEditPrev()'>&lt;&lt; Back</a>
+                                                                               <a id='ue_back' class='nav_link hide_me' 
+                                                                                       href='javascript:uEditPrev()'>&lt;&lt; Back</a>
                                                                        </td>
                                                                        <td width='40%'>
-                                                                               <a id='ue_fwd' class='nav_link' href='javascript:uEditNext()'>Forward &gt;&gt;</a>
+                                                                               <a id='ue_fwd' class='nav_link' 
+                                                                                       href='javascript:uEditNext()'>Forward &gt;&gt;</a>
                                                                        </td>
                                                                        <td width='10%'/>
                                                                </tr>
        </center>
 
        <div id='ue_summary_page' class='hide_me'>
-               <table id='ue_summary_table' class='summary_grid'>
+               <table id='ue_summary_table' class='summary_grid' width='55%'>
                        <style type='text/css'>
                                .summary_grid { padding: 5px; }
                                .summary_grid thead tr { background: #E0F0E0; font-weight: bold;}
                                .summary_grid tbody tr td { border: 1px solid #E0F0E0; }
+                               .hide_me{ visibility: hidden; display: none }
                        </style>
                        <thead><tr><td colspan='2'>User Summary Information</td></tr></thead>
-                       <tbody id='ue_summary_page_tbody'>
-                               <tr><td>Username</td><td id='ue_summary_username'/></tr>
-                               <tr><td>First Name</td><td id='ue_summary_firstname'/></tr>
-                               <tr><td>Middle Name</td><td id='ue_summary_middlename'/></tr>
-                               <tr><td>Last Name</td><td id='ue_summary_lastname'/></tr>
-                               <tr><td>Suffix</td><td id='ue_summary_suffix'/></tr>
-                               <tr><td>Date of Birth</td><td id='ue_summary_dob'/></tr>
-                               <tr><td>Primary Identification Type</td><td id='ue_summary_primary_ident_type'/></tr>
-                               <tr><td>Primary Identification</td><td id='ue_summary_primary_ident'/></tr>
-                               <tr><td>Secondary Identification Type</td><td id='ue_summary_secondary_ident_type'/></tr>
-                               <tr><td>Secondary Identification</td><td id='ue_summary_secondary_ident'/></tr>
-                               <tr><td>Email Address</td><td id='ue_summary_email'/></tr>
-                               <tr><td>Day Phone</td><td id='ue_summary_dayphone'/></tr>
-                               <tr><td>Evening Phone</td><td id='ue_summary_nightphone'/></tr>
-                               <tr><td>Other Phone</td><td id='ue_summary_otherphone'/></tr>
-                               <tr><td>Home Library</td><td id='ue_summary_home_lib'/></tr>
+                       <tbody name='ue_summary_page_tbody'>
+                               <tr>
+                                       <td><input type='submit' value='Print Page' onclick='window.print();'/></td>
+                                       <td><input type='submit' value='Close Window' onclick='window.close();'/></td>
+                               </tr>
+                               <tr><td>Username</td><td name='ue_summary_username'/></tr>
+                               <tr><td>First Name</td><td name='ue_summary_firstname'/></tr>
+                               <tr><td>Middle Name</td><td name='ue_summary_middlename'/></tr>
+                               <tr><td>Last Name</td><td name='ue_summary_lastname'/></tr>
+                               <tr><td>Suffix</td><td name='ue_summary_suffix'/></tr>
+                               <tr><td>Date of Birth</td><td name='ue_summary_dob'/></tr>
+                               <tr><td>Primary Identification Type</td><td name='ue_summary_primary_ident_type'/></tr>
+                               <tr><td>Primary Identification</td><td name='ue_summary_primary_ident'/></tr>
+                               <tr><td>Secondary Identification Type</td><td name='ue_summary_secondary_ident_type'/></tr>
+                               <tr><td>Secondary Identification</td><td name='ue_summary_secondary_ident'/></tr>
+                               <tr><td>Email Address</td><td name='ue_summary_email'/></tr>
+                               <tr><td>Day Phone</td><td name='ue_summary_dayphone'/></tr>
+                               <tr><td>Evening Phone</td><td name='ue_summary_nightphone'/></tr>
+                               <tr><td>Other Phone</td><td name='ue_summary_otherphone'/></tr>
+                               <tr><td>Home Library</td><td name='ue_summary_home_lib'/></tr>
                                <tr>
                                        <td colspan='2'>
-                                               <table>
-                                                       <thead><tr><td colspan='2'>Addresses</td></tr></thead>
-                                                       <tbody id='ue_summary_addr_tbody'>
-                                                               <tr>
+                                               <table width='100%' style='margin-top: 15px; margin-bottom: 15px;'>
+                                                       <thead><tr><td>Addresses</td></tr></thead>
+                                                       <tbody name='ue_summary_addr_tbody'>
+                                                               <tr name='ue_summary_addr_row'>
                                                                        <td>
-                                                                               <table id='ue_summary_addr_table'>
+                                                                               <table name='ue_summary_addr_table' width='100%'>
+                                                                                       <thead><tr><td colspan='4'/><span> </span></tr></thead>
                                                                                        <tbody>
-                                                                                               <tr><td>Address Label</td><td name='label'/></tr>
-                                                                                               <tr><td>Street1</td><td name='street1'/></tr>
-                                                                                               <tr><td>Street2</td><td name='street2'/></tr>
-                                                                                               <tr><td>City</td><td name='city'/></tr>
-                                                                                               <tr><td>County</td><td name='county'/></tr>
-                                                                                               <tr><td>State</td><td name='state'/></tr>
-                                                                                               <tr><td>Zip Code</td><td name='zip'/></tr>
-                                                                                               <tr><td>Country</td><td name='country'/></tr>
+                                                                                               <tr>
+                                                                                                       <td>Address Label</td><td name='label'/>
+                                                                                                       <td>Zip Code</td><td name='zip'/>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>Street1</td><td name='street1'/>
+                                                                                                       <td>Country</td><td name='country'/>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>Street2</td><td name='street2'/>
+                                                                                                       <td>Mailing</td><td name='mailing'/>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>City</td><td name='city'/>
+                                                                                                       <td>Billing</td><td name='billing'/>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>County</td><td name='county'/>
+                                                                                                       <td>Valid</td><td name='valid'/>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>State</td><td name='state'/>
+                                                                                                       <td>Incorporated</td><td name='incorporated'/>
+                                                                                               </tr>
                                                                                        </tbody>
                                                                                </table>
                                                                        </td>
                                                </table>
                                        </td>
                                </tr>
-                               <tr><td>Profile</td><td id='ue_summary_profile'/></tr>
-                               <tr><td>Expire Date</td><td id='ue_summary_expire'/></tr>
-                               <tr><td>Family Lead Account</td><td id='ue_summary_family_lead'/></tr>
-                               <tr><td>Claims Returned Count</td><td id='ue_summary_claims_returned'/></tr>
-                               <tr><td>Alert Message</td><td id='ue_summary_alert_message'/></tr>
-                               <tr>
-                                       <td>
-                                               <table>
+                               <tr><td>Profile</td><td name='ue_summary_profile'/></tr>
+                               <tr><td>Expire Date</td><td name='ue_summary_expire'/></tr>
+                               <tr><td>Family Lead Account</td><td name='ue_summary_family_lead'/></tr>
+                               <tr><td>Claims Returned Count</td><td name='ue_summary_claims_returned'/></tr>
+                               <tr><td>Alert Message</td><td name='ue_summary_alert_message'/></tr>
+                               <tr class='hide_me' name='ue_summary_stat_cat_td'>
+                                       <td colspan='2' >
+                                               <table width='100%' style='margin-top: 15px; margin-bottom: 15px;'>
                                                        <thead><tr><td colspan='2'>Statistical Category Updates</td></tr></thead>
-                                                       <tbody id='ue_summary_stats_tbody'>
-                                                               <tr id='ue_summary_stats_row'>
-                                                                       <td name='name'/><td name='value'/>
+                                                       <tbody name='ue_summary_stats_tbody'>
+                                                               <tr name='ue_summary_stats_row'>
+                                                                       <td name='ue_summary_stat_name'/><td name='ue_summary_stat_value'/>
                                                                </tr>
                                                        </tbody>
                                                </table>
                                        </td>
                                </tr>
-                               <tr>
-                                       <td>
-                                               <table>
-                                                       <thead><tr><td colspan='2'>Survey Responses</td></tr></thead>
-                                                       <tbody id='ue_summary_survey_tbody'>
-                                                               <tr id='ue_summary_survey_row'>
-                                                                       <td name='name'/><td name='value'/>
+                               <tr class='hide_me' name='ue_summary_survey_td'>
+                                       <td colspan='2'>
+                                               <table width='100%' style='margin-top: 15px; margin-bottom: 15px;'>
+                                                       <thead><tr><td>Survey</td><td>Question</td><td>Answer</td></tr></thead>
+                                                       <tbody name='ue_summary_survey_tbody'>
+                                                               <tr name='ue_summary_survey_row'>
+                                                                       <td name='ue_summary_survey_name'/>
+                                                                       <td name='ue_summary_survey_question'/>
+                                                                       <td name='ue_summary_survey_answer'/>
                                                                </tr>
                                                        </tbody>
                                                </table>
                                        </td>
                                </tr>
+                               <tr name='ue_summary_errors_row' class='hide_me'>
+                                       <td colspan='2'>
+                                               <table width='100%' style='margin-top: 15px; margin-bottom: 15px;'>
+                                                       <thead>
+                                                               <tr>
+                                                                       <td style='color: red;' ><b>Errors you would see if you saved now...</b></td>
+                                                               </tr>
+                                                       </thead>
+                                                       <tbody><tr><td name='ue_summary_errors'/></tr></tbody>
+                                               </table>
+                                       </td>
+                               </tr>
                                <tr>
-                                       <td><input type='submit' value='Print Page'/></td>
-                                       <td><input type='submit' value='Close Window'/></td>
+                                       <td><input type='submit' value='Print Page' onclick='window.print();'/></td>
+                                       <td><input type='submit' value='Close Window' onclick='window.close();'/></td>
                                </tr>
                        </tbody>
                </table>
                <span id='ue_bad_claims_returned'>The claims returned count is invalid</span>
                <span id='ue_no_profile'>A profile group must be selected</span>
                <span id='ue_unknown_error'>An unknown formatting error occurred</span>
-               <span id='ue_bad_addr_lable'>Address label is invalid</span>
+               <span id='ue_bad_addr_label'>Address label is invalid</span>
                <span id='ue_bad_addr_street'>Address street is invalid</span>
                <span id='ue_bad_addr_city'>Address city is invalid</span>
                <span id='ue_bad_addr_county'>Address county is invalid</span>
                <span id='yes'>Yes</span>
                <span id='no'>No</span>
                <span id='ue_summary_window'>Patron Summary</span>
+               <span id='ue_success'>User update succeeded</span>
        </div>
 
        </body>