You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

728 lines
28 KiB

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017-2020 Rémy Taymans <remytaymans@gmail.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Add menu entries -->
<template id="my_shift_link" name="Link to frontend portal"
inherit_id="portal.frontend_layout">
<xpath expr="//a[@id='o_logout']" position="before">
<a href="/my/shift" class="dropdown-item" role="menuitem">My Shift
</a>
</xpath>
</template>
<!-- Reusable templates -->
<template
id="my_shift_title"
name="My Shift Title">
<h1>
Your shifts
</h1>
</template>
<template
id="my_shift_worker_status_title"
name="My Shift Worker Status Title">
<h2>
Worker status
<!-- TODO specific view -->
</h2>
</template>
<template
id="my_shift_worker_status_common"
name="My Shift Worker Status Common">
<p>
<label class="font-weight-bold">Working Mode:</label>
<t t-esc="dict(status.fields_get(allfields=['working_mode'])['working_mode']['selection'])[status.working_mode]"/>
</p>
<p t-if="status.super">
You are a Super Cooperator
</p>
<p>
<label class="font-weight-bold">Status:</label>
<t t-esc="dict(status.fields_get(allfields=['status'])['status']['selection'])[status.status]"/>
</p>
<p t-if="status.holiday_start_time and status.holiday_start_time > status.today or status.status == 'holiday'">
<label class="font-weight-bold">Begin of Holiday:</label>
<t t-esc="status.holiday_start_time"/>
</p>
<p t-if="status.holiday_end_time and status.holiday_end_time > status.today or status.status == 'holiday'">
<label class="font-weight-bold">End of Holiday:</label>
<t t-esc="status.holiday_end_time"/>
</p>
</template>
<template
id="shift_status_label"
name="Shift Status Label">
<!-- TODO specific to beescoop -->
<span t-if="shift.state == 'done'"
t-attf-class="badge badge-success {{label_css}}">
<t t-esc="shift.state"/>
</span>
<span t-if="shift.state == 'absent'"
t-attf-class="badge badge-danger {{label_css}}">
<t t-esc="shift.state"/>
</span>
<span t-if="shift.state == 'cancel'"
t-attf-class="badge badge-warning {{label_css}}">
<t t-esc="shift.state"/>
</span>
</template>
<template
id="my_shift_next_shifts"
name="My Shift : Next Shifts">
<h2>
Your next shifts
</h2>
<div class="alert alert-warning">
<strong>Warning !</strong>
For the moment public holidays are not taken into account. If your
shift
occures during a public holiday, you do not have to do it.
</div>
<t t-foreach="subscribed_shifts" t-as="shift">
<div t-att-class="'card mb-4 %s' % highlight_class">
<div t-att-class="'card-header %s clearfix' % highlight_header_class">
<div class="pull-left">
<span t-field="shift.start_time"/>
-
<span t-field="shift.end_time"
t-options='{"format": "HH:mm"}'/>
</div>
<t t-call="beesdoo_website_shift.shift_status_label">
<t t-set="label_css" t-value="'pull-right'"/>
</t>
</div>
<div class="card-body clearfix">
<t t-esc="shift.task_type_id.name"/>
<button
type="button"
class="btn btn-default btn-sm pull-right"
t-if="shift.super_coop_id.name"
data-toggle="modal"
t-att-data-target="'#super_coop-shift-%s' % shift_index"
>
<span class="fa fa-info" aria-hidden="true"></span>
Super Cooperator Info
</button>
</div>
</div>
</t>
<!-- Super Cooperator info modal -->
<t t-foreach="subscribed_shifts" t-as="shift">
<div class="modal fade" t-if="shift.super_coop_id.name"
t-att-id="'super_coop-shift-%s' % shift_index" tabindex="-1"
role="dialog"
t-att-aria-labelledby="'super_coop-shift-%s-label' % shift_index">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title"
t-att-id="'super_coop-shift-%s-label' % shift_index">
<t t-esc="shift.super_coop_id.name"/>
</h4>
</div>
<div class="modal-body">
<i class="fa fa-phone" aria-hidden="true"></i>
<t t-esc="shift.super_coop_id.phone"/>
<br/>
<i class="fa fa-envelope" aria-hidden="true"></i>
<a t-att-href="'mailto:%s' % shift.super_coop_id.email">
<t t-esc="shift.super_coop_id.email"/>
</a>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
data-dismiss="modal">Close
</button>
</div>
</div>
</div>
</div>
</t>
<div class="alert alert-warning" t-if="not subscribed_shifts">
<strong>Warning !</strong>
You have not yet signed up to a shift.
</div>
</template>
<template
id="my_shift_past_shifts"
name="My Shift : Past Shifts">
<h2>
Your past shifts
</h2>
<t t-foreach="past_shifts" t-as="shift">
<div t-att-class="'card mb-4 %s' % highlight_class">
<div t-att-class="'card-header %s clearfix' % highlight_header_class">
<div class="pull-left">
<span t-field="shift.start_time"/>
-
<span t-field="shift.end_time"
t-options='{"format": "HH:mm"}'/>
</div>
<t t-call="beesdoo_website_shift.shift_status_label">
<t t-set="label_css" t-value="'pull-right'"/>
</t>
</div>
<div class="card-body clearfix">
<t t-esc="shift.task_type_id.name"/>
</div>
</div>
</t>
<t t-if="not past_shifts">
<div class="alert alert-info">
<strong>Info !</strong>
You don't have any past shift.
</div>
</t>
</template>
<template
id="available_shift_irregular_worker"
name="Available Shift for Irregular Worker"
>
<!-- Inherited View -->
<t t-foreach="shift_templates" t-as="shift_count_subscribed">
<t t-set="shift" t-value="shift_count_subscribed[0]"/>
<t t-set="count" t-value="shift_count_subscribed[1]"/>
<t t-set="is_subscribed" t-value="shift_count_subscribed[2]"/>
<t t-set="has_enough_workers" t-value="shift_count_subscribed[3]"/>
<t t-set="highlight_class" t-value="'panel-warning' if not has_enough_workers else 'panel-default'"/>
<t t-set="need_super" t-value="shift.task_type_id.super_only" />
<t t-set="user_super" t-value="request.env.user.partner_id.super" />
<div t-att-class="'card mb-4 %s' % highlight_class" t-if="not need_super or (need_super and user_super)">
<div t-att-class="'card-header %s clearfix' % highlight_header_class">
<div class="pull-left">
<span t-field="shift.start_time"/>
-
<span t-field="shift.end_time" t-options="{&quot;format&quot;: &quot;HH:mm&quot;}"/>
</div>
<div class="badge badge-secondary pull-right" t-if="count &gt; 0">
<t t-esc="count"/>
space(s)
</div>
<div class="badge badge-secondary pull-right" t-if="count == 0">
full
</div>
</div>
<div class="card-body clearfix">
<t t-esc="shift.task_type_id.name"/>
<div class="badge badge-dark pull-right" t-if="is_subscribed">
Already Subscribed
</div>
<button type="button" class="btn btn-primary btn-sm pull-right" data-toggle="modal" t-att-data-target="'#subscribe-shift-%s' % shift.id" t-if="irregular_enable_sign_up and not is_subscribed">
<span class="fa fa-user-plus" aria-hidden="true"/>
Subscribe
</button>
</div>
</div>
<!-- Subscribe check -->
<div class="modal fade" t-att-id="'subscribe-shift-%s' % shift.id" tabindex="-1" role="dialog" t-att-aria-labelledby="'subscribe-shift-%s-label' % shift.id">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" t-att-id="'subscribe-shift-%s-label' % shift.id">
Please confirm subscription
</h4>
</div>
<div class="modal-body">
<span t-field="shift.start_time"/>
-
<span t-field="shift.end_time" t-options="{&quot;format&quot;: &quot;HH:mm&quot;}"/>
<br/>
<t t-esc="shift.task_type_id.name"/>
<br/>
<t t-esc="count"/>
available space(s)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close
</button>
<a class="btn btn-primary" t-if="irregular_enable_sign_up" t-att-href="'/shift/%s/subscribe?nexturl=%s' % (shift.id, nexturl)">
Subscribe
</a>
</div>
</div>
</div>
</div>
</t>
</template>
<!-- Help Texts -->
<template
id="help_text_title"
name="Help Text Title">
<h2>
Help
</h2>
</template>
<template
id="help_text_common"
name="Help Text Common">
<div class="alert alert-info">
<strong>Info!</strong>
If you do not agree with your status, please contact the members
office by mail (membre@bees-coop.be) or during the open hours of the
office (Monday 5PM to 7:30PM, Wednesday 5PM to 7:30 PM and Friday
2:30PM to 5 PM).
</div>
<p>
Explanation of the status:
</p>
<p>
<strong>Up To Date:</strong>
That's perfect! You are in order. Thanks a lot. You can come and
shop, so can your eaters if you have any.
</p>
</template>
<template
id="help_text_regular_worker"
name="Help Text for Regular Worker">
<p class="h_reg_alert">
<strong>Alert:</strong>
If you are in alert status, that means you didn't do your last
shift. You have
until your next scheduled shift to do your compensation shift
according to your situation.
Your compensation is either simple or double. If you don't how how
many compensation shifts you have to do, please contact your
supercooperator.
To do your compensation shift, no need to subscribe in advance : you
come at the beginning of the shift that best suits you.
Add your name and the indication "compensation shift" on the
attendance list.
No panic, you still can come and shop, so can your eaters if you
have any.
</p>
<p class="h_reg_suspended">
<strong>Suspended:</strong>
If you are suspended, that means you didn't come to a shift and you
didn't do you compensation shifts in the delay (4 weeks).
You cannot shop (so as your eaters). But no need to panic : a
two-weeks delay is activable on demand at the entrance of the
supermarket.
You will be able to shop during 2 more weeks and to put your
situation in order.
To do your compensation shift, no need to subscribe in advance : you
come at the beginning of the shift that best suits you.
Add your name and the indication "compensation shift" on the
attendance list.
</p>
<p class="h_reg_autoextension">
<strong>Auto-Extension:</strong>
You didn't manage to do your compensation shifts in the delay but
you benefit from the auto-extension.
This is two more weeks to do your compensation shifts. You can shop.
If you don't do your compensation shifts, you'll be suspended.
</p>
<p class="h_reg_unsubscribed">
<strong>Unsubscribed:</strong>
You did not attend two consecutive shifts. You are now unsubscribed.
You cannot shop (nor can your eaters) nor come to work.
To subscribe again, please contact membre@bees-coop.be or come to
the members office during the opening hours.
</p>
</template>
<template
id="help_text_irregular_worker"
name="Help Text for Irregular Worker">
<p class="h_irreg_alert">
<strong>Alert:</strong>
If you are in alert status, that means you didn't anticipate enough
shifts.
Your counter is now negative, directly to -2.
You have 4 weeks to do 2 shifts to be up to date.
For the compensation shifts, subscribe like you do for a normal
shift.
Be careful, in addition to these 2 shifts, don't forget to do your
normal shift in the same delay to prevent to be in the same
situation next month.
</p>
<p class="h_irreg_suspended">
<strong>Suspended:</strong>
You did not anticipate enough shifts and you did not come back to a
normal situation in the delay.
You cannot shop anymore, nor can your eaters.
But no need to panic : a two-weeks delay is activable on demand at
the entrance of the supermarket.
You will be able to shop during 2 more weeks and to put your
situation in order.
For the compensation shifts, subscribe like you do for a normal
shift.
</p>
<!-- TODO make the modif in herited view-->
<p class="h_irreg_unsubscribed">
<strong>Unsubscribed:</strong>
Your counter is negative and you haven't come to work for more than
8 weeks.
You are unsubscribed. You cannot shop nor can your eaters.
To subscribe again of if it's a mistake, please contact
membre@bees-coop.be or come to the members office during the opening
hours.
</p>
</template>
<!-- Shift for non-worker -->
<template
id="my_shift_non_worker"
name="My Shift for Non Worker"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt16">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col">
<div class="alert alert-info">
You don't have to participate to shift system.
</div>
</div>
</div>
</div>
</t>
</template>
<!-- Shift for new worker -->
<template
id="my_shift_new_worker"
name="My Shift for New Worker"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt6">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col">
<div class="alert alert-info">
Please contact the members office to suscribe to
shifts.
</div>
</div>
</div>
</div>
</t>
</template>
<!-- Shifts Exempted Workers -->
<template
id="my_shift_exempted_worker"
name="My Shifts for Exempted Workers"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt16">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 m-auto text-justify">
<t t-call="beesdoo_website_shift.my_shift_worker_status_title"/>
<t t-call="beesdoo_website_shift.my_shift_worker_status_common"/>
<p t-if="status.exempt_reason_id">
<label class="font-weight-bold">Exempt Reason:
</label>
<t t-esc="status.exempt_reason_id.name"/>
</p>
</div>
<div class="col-12 col-lg-8 m-auto">
<div class="alert alert-info">
You don't have to participate to shift system.
</div>
</div>
</div>
</div>
</t>
</template>
<!-- Shifts regular worker without shift -->
<template
id="my_shift_regular_worker_without_shift"
name="My Shifts for regular worker without shift"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt16">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 m-auto text-justify">
<t t-call="beesdoo_website_shift.my_shift_worker_status_title"/>
<t t-call="beesdoo_website_shift.my_shift_worker_status_common"/>
</div>
<div class="col-12 col-lg-8 m-auto">
<div class="alert alert-info">
Please contact the members office to suscribe to
shifts.
</div>
</div>
</div>
</div>
</t>
</template>
<!-- Shifts for Regular Workers -->
<template
id="my_shift_regular_worker"
name="My Shifts for Regular Workers"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt16">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 m-auto text-justify">
<t t-call="beesdoo_website_shift.my_shift_worker_status_title"/>
<t t-call="beesdoo_website_shift.my_shift_worker_status_common"/>
<p t-if="status.sr != 0">
<label class="font-weight-bold">Shift in Advance:
</label>
<t t-esc="status.sr"/>
</p>
<p t-if="status.sc != 0">
<label class="font-weight-bold">Compensation
Shift:
</label>
<t t-esc="status.sc"/>
</p>
<p t-if="status.alert_start_time">
<label class="font-weight-bold">In Alert Since:
</label>
<t t-esc="status.alert_start_time"/>
</p>
<p t-if="status.extension_start_time">
<label class="font-weight-bold">In Extension
Since:
</label>
<t t-esc="status.extension_start_time"/>
</p>
</div>
<div class="col-12 col-lg-8">
<t t-call="beesdoo_website_shift.my_shift_next_shifts"/>
<t t-call="beesdoo_website_shift.my_shift_past_shifts"/>
</div>
<div class="col-12 col-lg-4 text-justify">
<t t-call="beesdoo_website_shift.help_text_title"/>
<t t-call="beesdoo_website_shift.help_text_common"/>
<t t-call="beesdoo_website_shift.help_text_irregular_worker"/>
</div>
</div>
</div>
</t>
</template>
<!-- Shifts for Irregular Workers -->
<template
id="my_shift_irregular_worker"
name="Shifts for Irregular Workers"
>
<t t-call="portal.portal_layout">
<t t-set="no_breadcrumbs" t-value="True"/>
<div class="container mt16">
<div class="row">
<div class="col text-center">
<t t-call="beesdoo_website_shift.my_shift_title"/>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 m-auto text-justify">
<t t-call="beesdoo_website_shift.my_shift_worker_status_title"/>
<t t-call="beesdoo_website_shift.my_shift_worker_status_common"/>
<p>
<label class="font-weight-bold">Shift in Advance:
</label>
<t t-esc="status.sr"/>
</p>
<!-- TODO specific view for beescoop -->
<p t-if="status.irregular_absence_date">
<label class="font-weight-bold">Last Absence Date:
</label>
<t t-esc="status.irregular_absence_date"/>
</p>
<p t-if="status.irregular_absence_counter">
<label class="font-weight-bold">Number of Absence:
</label>
<t t-esc="status.irregular_absence_counter"/>
</p>
</div>
<div class="col-12 col-lg-8">
<div t-if="back_from_subscription"
role="alert"
t-att-class="'alert alert-%s alert-dismissible' % ('success' if success else 'danger',)">
<button type="button" class="close"
data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<t t-if="success">
<strong>Success!</strong>
Your subscription has succeded.
</t>
<t t-if="not success">
<strong>Failed!</strong>
Your subscription has failed. Someone
subscribed before you or the shift was deleted.
Try again in a
moment.
Please note that you can't subscribe
<t t-esc="subscription_time_limit"/>
minutes before the shift.
</t>
</div>
<t t-call="beesdoo_website_shift.my_shift_next_shifts"/>
<h2>
Available Shifts
</h2>
<div class="row">
<div class="col-12 col-md-6 text-justify">
<p>
Please, subscribe, in priority, to the
highlighted shifts. To sign up to a shift
click on the
subscribe button. Notice that you can not
unsubscribe online. To unsubscribe to a
shift, please,
contact us.
</p>
</div>
</div>
<t t-call="beesdoo_website_shift.available_shift_irregular_worker"/>
<t t-call="beesdoo_website_shift.my_shift_past_shifts"/>
</div>
<div class="col-12 col-lg-4 text-justify">
<t t-call="beesdoo_website_shift.help_text_title"/>
<t t-call="beesdoo_website_shift.help_text_common"/>
<t t-call="beesdoo_website_shift.help_text_irregular_worker"/>
</div>
</div>
</div>
</t>
</template>
</odoo>