CREATE OR REPLACE PACKAGE BODY efnow097$ IS PROCEDURE msg_subs_js IS BEGIN htp.p(' function setChanged() { document.getElementById(''p_changes'').value = ''changed''; } function submitMsgForm() { var checkChanges = document.getElementById(''p_changes''); if ( checkChanges.value == ''changed'' ) { //clear all unwanted named input from the form var allInputs = document.forms[0]; //alert(allInputs.length); for (i=0;i 0) { allSucaItems[smsIndex].previousSibling.previousSibling.value = ''N''; allSucaItems[smsIndex].previousSibling.checked = false; if (emailChecked == ''Y'') { allSucaItems[smsIndex].previousSibling.disabled = false; } else { allSucaItems[smsIndex].previousSibling.disabled = true; } } } '); END msg_subs_js; PROCEDURE msg_subs_css IS BEGIN htp.p(' .msgSubsTable { border-left-width : 1px; border-left-style : solid; border-left-color : black; border-right-width : 1px; border-right-style : solid; border-right-color : black; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : black; } .msgSubsAllTypes { background-color : #D9D9D9; text-align : center; border-left-width : 1px; border-left-style : solid; border-left-color : #F21C0A; border-right-width : 1px; border-right-style : solid; border-right-color : #F21C0A; border-top-width : 1px; border-top-style : solid; border-top-color : #F21C0A; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : #F21C0A; font-weight : normal; height : 16px; } .msgSeparateTH { background-color : #D9D9D9; border-left : none; border-right-width : 1px; border-right-style : solid; border-right-color : #F21C0A; border-top-width : 1px; border-top-style : solid; border-top-color : #F21C0A; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : #F21C0A; } .msgSubsEmailTH { background-color : #D9D9D9; text-align : center; width : 250px; font-weight : normal; border-left-width : 1px; border-left-style : solid; border-left-color : #F21C0A; border-right : none; border-top-width : 1px; border-top-style : solid; border-top-color : #F21C0A; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : #F21C0A; height : 16px; } .msgSubsUserTH { background-color : #D9D9D9; text-align : center; width : 100px; font-weight : normal; border-left-width : 1px; border-left-style : solid; border-left-color : #F21C0A; border-right : none; border-top-width : 1px; border-top-style : solid; border-top-color : #F21C0A; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : #F21C0A; height : 16px; } .msgSubsTypeTH { background-color : #D9D9D9; text-align : center; width : 100px; font-weight : normal; border-left-width : 1px; border-left-style : solid; border-left-color : #F21C0A; border-right-width : 1px; border-right-style : solid; border-right-color : #F21C0A; border-top-width : 1px; border-top-style : solid; border-top-color : #F21C0A; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : #F21C0A; height : 16px; } .msgSubsTR1 { background-color : #FFFFFF; text-align : left; border-style : none; } .msgSubsTR2 { background-color : #F5F5F5; text-align : left; border-style : none; } .msgSeparate { border-right : 1px solid black; } .msgSubsCheckBox { text-align : center; } '); END msg_subs_css; PROCEDURE display_message( p_success IN VARCHAR2 , p_error IN VARCHAR2 , p_err_msg IN VARCHAR2 ) IS BEGIN -- IF p_success = 'Y' THEN htp.p(''||caco_utilities.get_module_text(876)||'

'); -- Success! ELSIF p_error = 'Y' THEN htp.p(''||caco_utilities.get_module_text(2340)||'
'); -- Update failed htp.p(''||p_err_msg||'

'); END IF; -- END display_message; PROCEDURE startup( p_success IN VARCHAR2 DEFAULT NULL , p_error IN VARCHAR2 DEFAULT NULL , p_err_msg IN VARCHAR2 DEFAULT NULL ) IS -- TYPE suca_sms_tab IS TABLE OF VARCHAR2(1) INDEX BY BINARY_INTEGER; -- CURSOR c_users IS SELECT uscd.uscd_id , syus.syus_id , syus.db_username , uscd.email_address , uscd.default_address , uscd.sms_number FROM user_contact_details uscd , system_users syus WHERE syus.syus_id = uscd.syus_id AND syus.cust_id = caco_utilities.get_cust_id; -- CURSOR c_suca IS SELECT suca_id , msg_group_en , msg_group_hu , name_en , name_hu FROM subscription_categories ORDER BY NVL(msg_group_en,'AAAA') ASC , display_sequence ASC; -- l_prev_suca_rec c_suca%ROWTYPE; l_suca_rec c_suca%ROWTYPE; -- l_suca_sms_tab suca_sms_tab; -- l_user_count NUMBER := 0; l_count_suca NUMBER := 0; l_value_and_checkbox VARCHAR2(255); already_subscribed BOOLEAN := FALSE; l_language system_users.LANGUAGE%TYPE := 'EN'; -- l_msg_group_cats NUMBER := 1; -- BEGIN -- IF NOT caco_security.security_check('efnow097$') THEN RETURN; END IF; -- -- Get the current language l_language := caco_utilities.get_syus_lang; -- -- htp.p(''); -- htp.p(''); wsgl.openpagehead(g_title); --wsgl.metatag; --htp.p(''); caco_system.content_type; htp.p(''); -- htp.p(''); htp.p(''); htp.p(''); htp.p(''); htp.p( ''); htp.p(' '); htp.p(' '); -- wsgl.closepagehead; wsgl.openpagebody(FALSE); htp.p(caco_system.menu); -- htp.p('

'||caco_utilities.get_module_text(2067)||'

'); -- Message Subscriptions -- -- Put out success or error messages from completed or failed update display_message( p_success => p_success , p_error => p_error , p_err_msg => p_err_msg ); -- htp.p('
'); -- -- -- How many Subscription categories are there? l_count_suca := efno_msgsubs.count_suca; htp.p(''); -- -- Create the Message Subscriptions table header rows htp.p(' '); -- /* CGR 29-MAY-2007 Added new table header for username */ -- htp.p(' '); htp.p(' '); -- Email Address htp.p(' '); -- Message Types htp.p(' '); -- -- Dynamically create the Message Subscriptions tables header row(s) -- First put out ungrouped message types and group names htp.p(''); OPEN c_suca; FETCH c_suca INTO l_prev_suca_rec; WHILE c_suca%FOUND LOOP l_suca_rec := NULL; FETCH c_suca INTO l_suca_rec; -- IF NVL(l_suca_rec.msg_group_en,'*$%()L*') != NVL(l_prev_suca_rec.msg_group_en,'##~&"L%"') THEN -- -- If we have a standalone category (not grouped), then rowspan the header -- otherwise put out the group name colspanning the number of categories in the group IF l_prev_suca_rec.msg_group_en IS NULL THEN htp.p(''); ELSE htp.p(l_prev_suca_rec.name_en||''); END IF; ELSE htp.p(''); ELSE htp.p(l_prev_suca_rec.msg_group_en||''); END IF; END IF; -- l_msg_group_cats := 1; -- ELSE l_msg_group_cats := l_msg_group_cats + 1; END IF; -- l_prev_suca_rec := l_suca_rec; -- END LOOP; CLOSE c_suca; htp.p(''); -- -- Finally put out TH names of the subscription categories that are in groups. htp.p(''); FOR r IN c_suca LOOP -- IF r.msg_group_en IS NOT NULL THEN -- IF l_language = 'HU' THEN htp.p(''); ELSE htp.p(''); END IF; -- END IF; -- END LOOP; htp.p(''); -- -- -- Now loop through all the User Email address/Telephone Number combinations -- and put out a row for each type -- Check if value is already set or not FOR user_rec IN c_users LOOP -- l_suca_sms_tab.DELETE; l_user_count := l_user_count + 1; -- -- First row for the email IF MOD(l_user_count,2) = 0 THEN htp.p(''); ELSE htp.p(''); END IF; -- -- Output details and hidden parameters htp.p(''); htp.p(''); -- /* CGR 29-MAY-2007 Added the db_username as can be many emails for a customer/user combination */ -- htp.p(''); htp.p(''); htp.p(''); -- Email -- FOR r2 IN c_suca LOOP -- already_subscribed := FALSE; -- htp.p(''); -- END LOOP; -- -- End the 1st row for the given user htp.p(''); -- -- Second row for the SMS IF MOD(l_user_count,2) = 0 THEN htp.p(''); ELSE htp.p(''); END IF; -- htp.p(''); htp.p(''); -- /*CGR 29-MAY-2007 Added to pad out the cell below username */ -- htp.p(''); htp.p(''); htp.p(''); -- SMS -- FOR r2 IN c_suca LOOP -- already_subscribed := FALSE; -- htp.p(''); -- END LOOP; -- -- End the 2nd row for the given user htp.p(''); -- END LOOP; -- -- Close the table htp.p('
'||caco_utilities.get_module_text(345)||''||caco_utilities.get_module_text(1054)||'  '||caco_utilities.get_module_text(2070)||'
'); IF l_language = 'HU' THEN htp.p(l_prev_suca_rec.name_hu||''); IF l_language = 'HU' THEN htp.p(l_prev_suca_rec.msg_group_hu||'
'||r.name_hu||''||r.name_en||'
'||user_rec.db_username||''||user_rec.email_address||''||caco_utilities.get_module_text(2068)||''); htp.p(''); -- already_subscribed := efno_msgsubs.check_msg_subscription( user_rec.uscd_id , r2.suca_id , 'EMAIL' ); -- l_value_and_checkbox := '' ||''; -- htp.p(l_value_and_checkbox); -- htp.p('
 '||user_rec.sms_number||''||caco_utilities.get_module_text(2069)||''); htp.p(''); -- already_subscribed := efno_msgsubs.check_msg_subscription( user_rec.uscd_id , r2.suca_id , 'SMS' ); -- l_value_and_checkbox := '' ||''; -- htp.p(l_value_and_checkbox); -- htp.p('
'); -- -- Submit button htp.p('

'); -- -- Close Form msgsubsform htp.p('
'); -- Close margin div htp.p('
'); -- -- Close the menu div's and close the body caco_system.footer( TRUE ); -- -- Close the html tag htp.p(''); -- END startup; /** -- FUNCTION about -- -- Returns the version number and VSS header for this package -- -- %return The version number and VSS header for this package */ FUNCTION about RETURN VARCHAR2 IS BEGIN RETURN ( g_package_name || CHR(10) ||g_revision||chr(10)|| g_header ); END about; BEGIN -- Initialization NULL; -- END efnow097$; /