diff --git a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte index b00f8b63..aa9c65cf 100644 --- a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte +++ b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte @@ -74,6 +74,8 @@ onMount(() => { // console.log(`ae_loc = `, get(ae_loc)); return true; }); + + // console.log($slct.sponsorship_obj.address_li_json.mailing); }); const cForm = 'border border-surface-200 p-4 space-y-4 rounded-container-token'; @@ -246,7 +248,9 @@ async function handle_submit_form(event) { sponsorship_do['paid'] = !!sponsorship_di.paid; } - let temp_questions = {}; + + // These questions are coming in from multiple forms. We need to make sure we do not clear out any existing question responses. + let temp_questions = $slct.sponsorship_obj.questions_li_json; // q_accomodations if (typeof sponsorship_di.accommodations_text !== 'undefined') { @@ -266,20 +270,46 @@ async function handle_submit_form(event) { // q_public_recognition - Friend level and above + if (typeof sponsorship_di.q_public_recognition !== 'undefined') { + temp_questions['public_recognition'] = Number(sponsorship_di.q_public_recognition); + } // q_social_email - Champion level and above + if (typeof sponsorship_di.q_social_email !== 'undefined') { + temp_questions['social_email'] = Number(sponsorship_di.q_social_email); + } // q_dedicated_promos - Signature Partner level only + if (typeof sponsorship_di.q_dedicated_promos !== 'undefined') { + temp_questions['dedicated_promos'] = Number(sponsorship_di.q_dedicated_promos); + } // Exibit booth related questions // q_table_exhibit - Supporter level and above if (typeof sponsorship_di.q_table_exhibit !== 'undefined') { - temp_questions['table_exhibit'] = sponsorship_di.q_table_exhibit; + temp_questions['table_exhibit'] = Number(sponsorship_di.q_table_exhibit); } // q_table_power - Supporter level and above if (typeof sponsorship_di.q_table_power !== 'undefined') { - temp_questions['table_power'] = sponsorship_di.q_table_power; + temp_questions['table_power'] = Number(sponsorship_di.q_table_power); + } + + // Virtual sessions related questions + // q_virtual_session - Champion level and above + if (typeof sponsorship_di.q_virtual_session !== 'undefined') { + temp_questions['virtual_session'] = Number(sponsorship_di.q_virtual_session); + } + + // Plenary sessions related questions + // q_plenary_session - Advocate level and above + if (typeof sponsorship_di.q_plenary_session !== 'undefined') { + temp_questions['plenary_session'] = Number(sponsorship_di.q_plenary_session); + } + + // q_plenary_opening - Advocate level and above + if (typeof sponsorship_di.q_plenary_opening !== 'undefined') { + temp_questions['plenary_opening'] = Number(sponsorship_di.q_plenary_opening); } console.log(temp_questions); @@ -288,16 +318,11 @@ async function handle_submit_form(event) { sponsorship_do['questions_li_json'] = temp_questions; } - // Virtual sessions related questions - // q_virtual_session - Champion level and above - - // Plenary sessions related questions - // q_plenary_session - Advocate level and above - // q_plenary_opening - Advocate level and above // q_promo_video - Presenting Partner level and above // This is taken care of below with the file uploads. + // Loop through possible guest list (up to 20) and add to the guest_li_json array. let temp_guest_li = []; @@ -308,12 +333,18 @@ async function handle_submit_form(event) { given_name: sponsorship_di[`guest_${i}_given_name`], family_name: sponsorship_di[`guest_${i}_family_name`], full_name: guest_x_full_name, - email: sponsorship_di[`guest_${i}_email`], - phone_mobile: sponsorship_di[`guest_${i}_phone_mobile`], - phone_home: sponsorship_di[`guest_${i}_phone_home`], - phone_office: sponsorship_di[`guest_${i}_phone_office`], - city: sponsorship_di[`guest_${i}_city`], - other_text: sponsorship_di[`guest_${i}_other_text`], + title: sponsorship_di[`guest_${i}_title`], + affiliations: sponsorship_di[`guest_${i}_affiliations`], + ada: sponsorship_di[`guest_${i}_ada`], + dietary: sponsorship_di[`guest_${i}_dietary`], + + // email: sponsorship_di[`guest_${i}_email`], + // phone_mobile: sponsorship_di[`guest_${i}_phone_mobile`], + // phone_home: sponsorship_di[`guest_${i}_phone_home`], + // phone_office: sponsorship_di[`guest_${i}_phone_office`], + // city: sponsorship_di[`guest_${i}_city`], + + comments: sponsorship_di[`guest_${i}_comments`], }); } } @@ -372,6 +403,19 @@ async function handle_submit_form(event) { $ae_sess.mod.sponsorships.disable_submit__sponsorship_obj = false; $ae_sess.mod.sponsorships.submit_status = 'updated'; } + + if ($store_current_tab == 'start') { + $store_current_tab = 'marketing'; + } else if ($store_current_tab == 'marketing') { + $store_current_tab = 'exhibit'; + } else if ($store_current_tab == 'exhibit') { + $store_current_tab = 'sessions'; + } else if ($store_current_tab == 'sessions') { + $store_current_tab = 'files'; + } else if ($store_current_tab == 'files') { + $store_current_tab = 'guests'; + } + } async function handle_submit_form_files(event) { @@ -659,10 +703,12 @@ async function handle_update__sponsorship({ Marketing + {#if $slct.sponsorship_obj.level_num > 1} Exhibitor Info + {/if} Session Info @@ -819,7 +865,7 @@ async function handle_update__sponsorship({