From e010bab531af2c0734c2ce380956abfc98d3c381 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Feb 2023 20:25:18 +0100 Subject: [PATCH] #13 --- controllers/kalachakra.py | 29 ++++- static/js/kalachakra.js | 66 ++++++++++- static/src/css/tree.css | 13 +++ views/account.xml | 3 + views/asset.xml | 1 + views/event.xml | 3 + views/website_event_registration.xml | 165 ++++++++++++++++++++++----- 7 files changed, 243 insertions(+), 37 deletions(-) create mode 100644 static/src/css/tree.css diff --git a/controllers/kalachakra.py b/controllers/kalachakra.py index c7ee481..346f08b 100755 --- a/controllers/kalachakra.py +++ b/controllers/kalachakra.py @@ -609,6 +609,24 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): request.session['status']=partner.member_status return http.request.render('kalachakra.registration_step1',data) + @http.route(['/event/registration/contactform'], type='http', auth='user', website=True, sitemap=False,csrf=False) + #def event_registration_contactform(self,event_id,*args,**kw): + def event_registration_contactform(self,*args,**kw): + data={} + #contact lié à l'utilisateur + + userid=request.env.context.get('uid') + data['lang']=request.env.context.get('lang') + user=request.env['res.users'].search([('id','=',int(userid))]) + partner=request.env['res.partner'].sudo().search([('id','=',int(user.partner_id))]) + data['partner']=partner + #évenement + # event=request.env['event.event'].sudo().search([('id','=',int(event_id))]) + # request.session['event_id']=int(event_id) + #data['event']=event + + return http.request.render('kalachakra.registration_contactform',data) + @http.route(['/event/registration/step1b'], type='http', auth='user', website=True, sitemap=False,csrf=False) def event_registration_step1b(self,event_id,*args,**kw): data={} @@ -646,7 +664,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): data['online']=False data['headphone']=False - if (post.get('headphone2')=='yes') or (post.get('headphone3')=='yes'):data['headphone']=True + if post.get('headphone')=='true' :data['headphone']=True if event.online_event: if post.get('online')=='yes':data['online']=True @@ -677,7 +695,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): vals={} vals['event_id']=request.session['event_id'] vals['partner_id']=request.session['partner_id'] - if (post.get('headphone2')=='yes') or (post.get('headphone3')=='yes'):vals['headphone']=True + if post.get('headphone')=='true':vals['headphone']=True else:vals['headphone']=False if event.online_event: @@ -695,9 +713,10 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): invoice_id=request.env['event.registration'].sudo().action_generate_participation_invoice(int(res.id),'CB',membership) else: - data['headphone']=True - if (post.get('headphone2')=='yes') or (post.get('headphone3')=='yes'):data['headphone']=True - res.headphone=True + data['headphone']=False + if (post.get('headphone')=='true') : + data['headphone']=True + res.headphone=True request.session['res_id']=res.id diff --git a/static/js/kalachakra.js b/static/js/kalachakra.js index 154a0a9..5238080 100755 --- a/static/js/kalachakra.js +++ b/static/js/kalachakra.js @@ -1,12 +1,74 @@ odoo.define('kalachakra.main', function (require) { + if ($('#lang').val()=='en_GB') + { + var message_phone= 'please filling your mobile or phone number' + var message_name= 'please filling your name' + var message_firstname= 'please filling your firstname' + var message_zip= 'please filling your zip code' + var message_city= 'please filling your city' + + } + if ($('#lang').val()=='fr_FR') + { + var message_phone= 'merci de saisir votre numéro de mobile ou de téléphone' + var message_name= 'merci de saisir votre nom' + var message_firstname= 'merci de saisir votre prénom' + var message_zip= 'merci de saisir votre code postal' + var message_city= 'merci de saisir votre ville' + } $(document).ready(function() { - - + + }); + $( "#contact_form_continue_button" ).click(function() { + const mobile=$('#contact_mobile').val(); + const phone=$('#contact_phone').val(); + console.log(message_phone) + if (mobile.trim()=='' && phone.trim()=='') + { + + $('#validation_message').text(message_phone) + $('#validation_message').show() + } + else + { + if ($('#contact_name').val().trim()=='') + { + $('#validation_message').text(message_name) + $('#validation_message').show() + + + } + else if ($('#contact_firstname').val().trim()=='') + { + $('#validation_message').text(message_firstname) + $('#validation_message').show() + + + } + + else if ($('#contact_city').val().trim()=='') + { + $('#validation_message').text(message_city) + $('#validation_message').show() + + + } + else + { + $('#form1').submit() + } + + + + } + }); + + $( ".list-group-item" ).click(function() { var txtamount = $( this ).text(); l=txtamount.length diff --git a/static/src/css/tree.css b/static/src/css/tree.css new file mode 100644 index 0000000..5cfe52c --- /dev/null +++ b/static/src/css/tree.css @@ -0,0 +1,13 @@ + + +.account_tree_class .o_list_table thead > tr>th:nth-child(4) { + width: 200px !important; + max-width: 200px !important; +} + + .event_tree_class .o_list_table thead > tr>th:nth-child(2){ + width: 300px !important; + max-width: 300px !important; + } + + diff --git a/views/account.xml b/views/account.xml index 7df4f81..7fb1bde 100644 --- a/views/account.xml +++ b/views/account.xml @@ -13,6 +13,9 @@ + + + account_tree_class diff --git a/views/asset.xml b/views/asset.xml index 8ae05f8..ba767eb 100755 --- a/views/asset.xml +++ b/views/asset.xml @@ -2,6 +2,7 @@ \ No newline at end of file diff --git a/views/event.xml b/views/event.xml index 3f0a099..ff87d9b 100755 --- a/views/event.xml +++ b/views/event.xml @@ -41,6 +41,9 @@ event.event + + event_tree_class + diff --git a/views/website_event_registration.xml b/views/website_event_registration.xml index 983127e..439d4a8 100755 --- a/views/website_event_registration.xml +++ b/views/website_event_registration.xml @@ -17,38 +17,28 @@
-
- - - -
- -
-
-
- - - -
- -
-
-
- - - -
- -
-
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +

@@ -317,4 +307,119 @@ + \ No newline at end of file