From af36e5ea900b4414e436eed9d59b608aea84b8da Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 23 Sep 2010 16:57:11 -0400 Subject: Modal dialog for enrollment The enroll facet has been converted into a dialog box. This dialog box will appear when the user clicks the enroll button above the association list. When the user clicks the enroll button in the dialog box, the new associations will be created, then the list will be refreshed to show the changes. The SerialAssociator and BulkAssociator have been modified to accept an on_success function which will be called when the whole operation is completed successfully. This is used to refresh the list and close the dialog box appropriately. Some other changes were also made to improve code clarity. --- install/static/entity.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'install/static/entity.js') diff --git a/install/static/entity.js b/install/static/entity.js index 7adc3921..85bbc074 100644 --- a/install/static/entity.js +++ b/install/static/entity.js @@ -80,6 +80,7 @@ function ipa_entity_setup(jobj) }; function setup_associate_facet() { + var pkey = $.bbq.getState(obj_name + '-pkey', true) || ''; var enroll_obj_name = $.bbq.getState(obj_name + '-enroll', true) || ''; var attr = ipa_get_member_attribute(obj_name, enroll_obj_name); var columns = [ @@ -88,18 +89,11 @@ function ipa_entity_setup(jobj) column: attr + '_' + enroll_obj_name } ]; - var frm = new AssociationList(obj_name, 'enroll', columns, jobj); + var frm = new AssociationList(obj_name, pkey, enroll_obj_name, columns, jobj); ipa_entity_generate_views(obj_name, jobj); frm.setup(); }; - function setup_enroll_facet() { - var enroll_obj_name = $.bbq.getState(obj_name + '-enroll', true) || ''; - var pkey = ipa_objs[enroll_obj_name].primary_key; - var frm = new AssociationForm(obj_name, enroll_obj_name, pkey, jobj); - frm.setup(); - }; - jobj.empty(); var facet = $.bbq.getState(obj_name + '-facet', true) || 'search'; @@ -109,8 +103,6 @@ function ipa_entity_setup(jobj) setup_details_facet(); } else if (facet == 'associate') { setup_associate_facet(); - } else if (facet == 'enroll') { - setup_enroll_facet(); } } -- cgit