Commit 629f108f by Yvon Kerdoncuff

#7345 : remove more code related to extensions/delay

parent 4c1f03cb
......@@ -122,13 +122,6 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'class': 'link',
'sort_order': 16
},
'member_cant_have_delay_form_link': {
'title': 'Lien vers le formulaire pour les membres n\'ayant pas rattrapé leur service après la durée de l\'extension',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 21
},
'on_picking_shift_template_msg': {
'title': 'Afficher une info à la sélection d\'un créneau (jour,heure) en respectant la syntaxe en exemple : lundi 14:00 Ici votre message',
'type': 'text',
......
......@@ -180,7 +180,7 @@ class CagetteMember(models.Model):
'amount_subscription', 'active_tmpl_reg_line_count', 'is_exempted',
'shift_type', 'current_template_name',
'final_standard_point', 'final_ftop_point',
'date_alert_stop','date_delay_stop', 'sex']
'date_alert_stop', 'sex']
else:
fields = ['name', 'email', 'birthdate_date',
'sex', 'country_id', 'total_partner_owned_share',
......@@ -1354,7 +1354,7 @@ class CagetteMembers(models.Model):
if len(ids) > 0:
cond.append(['id','in', ids])
fields = ['id', 'name', 'display_std_points', 'display_ftop_points', 'shift_type', 'makeups_to_do', 'date_delay_stop']
fields = ['id', 'name', 'display_std_points', 'display_ftop_points', 'shift_type', 'makeups_to_do']
res = api.search_read('res.partner', cond, fields)
# There are two things we need to do now :
......
......@@ -73,25 +73,6 @@ function display_makeups_members() {
title: "Nom"
},
{
data: "id",
title: "",
className: "dt-body-center",
orderable: false,
width: "10%",
render: function (data, type, row) {
return `<button class="btn--primary extend_delay_button" data-member-id="${row.id}">Augmenter le délai</button>`;
}
},
{
data: "date_delay_stop",
title: "<div class='title_center'>Limite du délai</div>",
className: "dt-body-center",
width: "10%",
render: function (data) {
return (data === false) ? "Pas de délai en cours" : new Date(data).toLocaleDateString();
}
},
{
data: "shift_type",
title: "<div class='title_center'>Type de créneau</div>",
className: "dt-body-center",
......
......@@ -136,7 +136,7 @@
white-space: normal;
}
#my_info .delay_date_stop_container {
#my_info .leave_date_stop_container {
white-space: nowrap;
}
......
......@@ -13,25 +13,10 @@
text-align: center;
}
#shifts_exchange .select_makeups, #shifts_exchange .unsuscribed_form_link, .cant_have_delay_form_link {
#shifts_exchange .select_makeups, #shifts_exchange .unsuscribed_form_link {
margin: 1.5rem 0;
}
/* -- Suspended can't have delay screen */
#suspended_cant_have_delay_content {
align-items: center;
text-align: center;
width: 50%;
}
@media screen and (max-width:992px) {
#suspended_cant_have_delay_content {
align-items: center;
text-align: center;
width: 90%;
}
}
/* -- Calendar screen, area on top of the calendar */
#calendar_top_info {
......
......@@ -235,7 +235,7 @@ body {
}
}
.delay_date_stop_container {
.leave_date_stop_container {
color: #f0ad4e;
margin-top: -1rem;
margin-bottom: 1rem;
......
......@@ -176,13 +176,7 @@ function init_my_info_data() {
.text(possible_cooperative_state[partner_data.cooperative_state])
.addClass("member_status_" + partner_data.cooperative_state);
if (partner_data.cooperative_state === 'delay' && partner_data.date_delay_stop !== 'False') {
const d = new Date(Date.parse(partner_data.date_delay_stop));
const f_date_delay_stop = d.getDate()+'/'+("0" + (d.getMonth() + 1)).slice(-2)+'/'+d.getFullYear();
$(".delay_date_stop").text(f_date_delay_stop);
$(".delay_date_stop_container").show();
} else if (partner_data.cooperative_state === 'unsubscribed' || partner_data.cooperative_state === 'gone') {
if (partner_data.cooperative_state === 'unsubscribed' || partner_data.cooperative_state === 'gone') {
$(".member_shift_name").text('X');
$(".unsuscribed_form_link")
......@@ -195,10 +189,10 @@ function init_my_info_data() {
});
} else if (partner_data.cooperative_state === 'exempted') {
const d = new Date(Date.parse(partner_data.leave_stop_date));
const f_date_delay_stop = d.getDate()+'/'+("0" + (d.getMonth() + 1)).slice(-2)+'/'+d.getFullYear();
const f_date_leave_stop = d.getDate()+'/'+("0" + (d.getMonth() + 1)).slice(-2)+'/'+d.getFullYear();
$(".delay_date_stop").text(f_date_delay_stop);
$(".delay_date_stop_container").show();
$(".leave_date_stop").text(f_date_leave_stop);
$(".leave_date_stop_container").show();
}
if (
......
......@@ -109,13 +109,10 @@ def index(request, exception=None):
md5_calc = hashlib.md5(partnerData['parent_create_date'].encode('utf-8')).hexdigest()
partnerData['parent_verif_token'] = md5_calc
partnerData['makeups_to_do'] = partnerData['parent_makeups_to_do']
partnerData['date_delay_stop'] = partnerData['parent_date_delay_stop']
partnerData['can_have_delay'] = cs.member_can_have_delay(int(partnerData["parent_id"]))
partnerData['extra_shift_done'] = partnerData["parent_extra_shift_done"]
else:
partnerData["parent_name"] = False
partnerData['can_have_delay'] = cs.member_can_have_delay(int(partner_id))
# look for associated partner for parents
cm = CagetteMember(partner_id)
......@@ -157,9 +154,6 @@ def index(request, exception=None):
context['unsuscribe_form_link'] = ( msettings['unsuscribe_form_link']['value']
if 'unsuscribe_form_link' in msettings
else '')
context['member_cant_have_delay_form_link'] = ( msettings['member_cant_have_delay_form_link']['value']
if 'member_cant_have_delay_form_link' in msettings
else '')
context['abcd_calendar_link'] = ( msettings['abcd_calendar_link']['value']
if 'abcd_calendar_link' in msettings
else '')
......
......@@ -178,7 +178,7 @@ class CagetteShift(models.Model):
"""Retrieve partner data useful to make decision about shift options"""
cond = [['id', '=', id]]
fields = ['display_name', 'display_std_points',
'shift_type', 'date_alert_stop', 'date_delay_stop', 'extension_ids',
'shift_type', 'date_alert_stop', 'extension_ids',
'cooperative_state', 'final_standard_point', 'create_date',
'final_ftop_point', 'shift_type', 'leave_ids', 'makeups_to_do', 'barcode_base',
'street', 'street2', 'zip', 'city', 'mobile', 'phone', 'function', 'email',
......@@ -188,12 +188,11 @@ class CagetteShift(models.Model):
partnerData = partnerData[0]
if partnerData['suppleant_member_id']:
cond = [['id', '=', partnerData['parent_id'][0]]]
fields = ['create_date', 'makeups_to_do', 'date_delay_stop', 'extra_shift_done']
fields = ['create_date', 'makeups_to_do', 'extra_shift_done']
parentData = self.o_api.search_read('res.partner', cond, fields, 1)
if parentData:
partnerData['parent_create_date'] = parentData[0]['create_date']
partnerData['parent_makeups_to_do'] = parentData[0]['makeups_to_do']
partnerData['parent_date_delay_stop'] = parentData[0]['date_delay_stop']
partnerData['parent_extra_shift_done'] = parentData[0]['extra_shift_done']
if partnerData['shift_type'] == 'standard':
......@@ -469,14 +468,6 @@ class CagetteShift(models.Model):
fields = ['makeups_to_do']
return self.o_api.search_read('res.partner', cond, fields)[0]["makeups_to_do"]
def member_can_have_delay(self, partner_id):
""" Can a member have a delay? """
answer = False
try:
answer = self.o_api.execute('res.partner', 'can_have_extension', [partner_id])
except Exception as e:
coop_logger.error("member_can_have_delay : %s", str(e))
return answer
def update_counter_event(self, fields):
""" Add/remove points """
......
......@@ -11,8 +11,8 @@
<div class="tile_content">
{# <p><span class="member_info member_name"></span></p> #}
<p class="member_status_text_container">Mon statut : <span class="member_info member_status"></span></p>
<div class="delay_date_stop_container">
( jusqu'au <span class="delay_date_stop"></span> )
<div class="leave_date_stop_container">
( jusqu'au <span class="leave_date_stop"></span> )
</div>
<div id="member_status_action">
<a href="#" target="_blank" class="btn--warning unsuscribed_form_link">
......
......@@ -129,7 +129,6 @@
var helper_unsubscribe_form_link = '{{helper_unsubscribe_form_link}}';
var covid_form_link = '{{covid_form_link}}';
var covid_end_form_link = '{{covid_end_form_link}}';
var member_cant_have_delay_form_link = '{{member_cant_have_delay_form_link}}';
var abcd_calendar_link = "{{abcd_calendar_link}}"
var days_to_hide = "{{daysToHide}}"
var on_picking_shift_template_msg = "{{on_picking_shift_template_msg}}"
......@@ -140,7 +139,6 @@
"date_delay_stop":"{{partnerData.date_delay_stop}}",
"cooperative_state":"{{partnerData.cooperative_state}}",
"regular_shift_name":"{{partnerData.regular_shift_name}}",
"can_have_delay" : "{{partnerData.can_have_delay}}",
"makeups_to_do" : "{{partnerData.makeups_to_do}}",
"barcode_base" : "{{partnerData.barcode_base}}",
"street" : "{{partnerData.street}}",
......
......@@ -15,8 +15,8 @@
</div>
<div class="my_info_line_right">
<p class="member_info member_status"></p>
<div class="delay_date_stop_container">
( jusqu'au <span class="delay_date_stop"></span> )
<div class="leave_date_stop_container">
( jusqu'au <span class="leave_date_stop"></span> )
</div>
<div id="member_status_action">
<a href="#" target="_blank" class="btn--warning unsuscribed_form_link">
......
......@@ -5,12 +5,6 @@
J'accède au formulaire
</a>
</div>
<div id="suspended_cant_have_delay_content" class="shifts_exchange_page_content">
<div class="suspended_cant_have_delay_msg"></div>
<a href="#" target="_blank" class="btn--warning cant_have_delay_form_link">
J'accède au formulaire
</a>
</div>
<div id="comite_content" class="shifts_exchange_page_content">
<div class="comite_content_msg"></div>
<div id="read_only_calendar"></div>
......
......@@ -11,8 +11,8 @@
<div class="tile_content">
{# <p><span class="member_info member_name"></span></p> #}
<p class="member_status_text_container">Mon statut : <span class="member_info member_status"></span></p>
<div class="delay_date_stop_container">
( jusqu'au <span class="delay_date_stop"></span> )
<div class="leave_date_stop_container">
( jusqu'au <span class="leave_date_stop"></span> )
</div>
<div id="member_status_action">
<button type="button" class="btn--danger choose_makeups">
......
......@@ -18,8 +18,8 @@
<div class="tile_content">
{# <p><span class="member_info member_name"></span></p> #}
<p class="member_status_text_container">Mon statut : <span class="member_info member_status"></span></p>
<div class="delay_date_stop_container">
( jusqu'au <span class="delay_date_stop"></span> )
<div class="leave_date_stop_container">
( jusqu'au <span class="leave_date_stop"></span> )
</div>
<div id="member_status_action">
<a href="#" target="_blank" class="btn--warning unsuscribed_form_link">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment