portal_tickets_emergency.xml 10.1 KB
Newer Older
Arturo Jasso Origel committed
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="portal_my_911" name="Mis Tickets">
        <t t-call="portal.portal_layout">
            <t t-set="breadcrumbs_searchbar" t-value="True" />

            <t t-call="portal.portal_searchbar">
                <t t-set="title">TI 911</t>
            </t>
10
            <input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
Arturo Jasso Origel committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
            <div id="createticketModal" class="modal fade" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-body">
                            <div class="row">
                                <div class="col-sm-12 col-md-6 col-lg-6 border-right">
                                    <h4 style="color:red;">Ticket de Emergencía</h4>
                                    <form action="/portal-create-ticket-911" method="POST"  id="form_id" class="form-horizontal mt32" enctype="multipart/form-data">

                                        <input type="hidden" name="tck_type" id="tck_type" value="911"/>
                                        <input type="hidden" name="sh_file_size" id="sh_file_size" t-att-value="request.env.company.sh_file_size"/>

                                        <div t-attf-class="form-group #{error and 'portal_incidence' in error and 'has-error' or ''}">
                                            <label class="control-label" for="portal_incidence" style="color:red;">Problema Crítico:</label>
                                            <select class="form-control form-field o_website_form_required_custom" id="portal_incidence" name="portal_incidence" required="True"> 
                                                <option></option>
                                                <option value="mclick">Falla Morsa Click Nacional</option>
                                                <option value="odoo"> Falla ERP Nacional</option>
                                                <option value="suc">Sucursal Detenida</option>
                                            </select>
                                        </div>

                                        <div class="form-group">
                                            <t t-if="request.env.user.has_group('base.group_portal') and request.env.user.sh_portal_user_access or not request.env.user.has_group('base.group_portal')">
                                                <label class="control-label" for="partner">Usuario:</label>
                                                <input class="form-control" list="partner_ids" name="partner" id="partner" />
                                                <input type="hidden" name="partner_id" id="partner_id" />
                                                <datalist id="partner_ids"> </datalist>
                                            </t>
                                        </div>
                                    
                                        <t t-if="request.env.user.has_group('base.group_portal') and not request.env.user.sh_portal_user_access">
                                            <div t-attf-class="form-group #{error and 'portal_contact_name' in error and 'has-error' or ''}">
                                                <label class="control-label" for="portal_contact_name">Nombre:</label>
                                                <input type="text" class="form-control" id="portal_contact_name" name="portal_contact_name" t-att-value="request.env.user.partner_id.name" readonly="True" />
                                            </div>
                                            <div name="portal_email_from_container" t-attf-class="form-group #{error and 'portal_email' in error and 'has-error' or ''}">
                                                <label class="control-label" for="portal_email">Correo:</label>
                                                <input type="email" class="form-control" id="portal_email" name="portal_email" t-att-value="request.env.user.partner_id.email" readonly="True" />
                                            </div>
                                        </t>


                                        <t t-else="">
                                            <div t-attf-class="form-group #{error and 'portal_contact_name' in error and 'has-error' or ''}">
                                                <label class="control-label" for="portal_contact_name">Nombre:</label>
                                                <input type="text" class="form-control" id="portal_contact_name" name="portal_contact_name" required="True" />
                                            </div>
                                            <div name="portal_email_from_container" t-attf-class="form-group #{error and 'portal_email' in error and 'has-error' or ''}">
                                                <label class="control-label" for="portal_email">Correo:</label>
                                                <input type="email" class="form-control" id="portal_email" name="portal_email" required="True" />
                                            </div>
                                        </t>


                                        <div t-attf-class="form-group">
                                            <label class="control-label" for="portal_phone">Teléfono:</label>
                                            <input type="text" class="form-control  form-field o_website_form_required_custom" id="portal_phone" name="portal_phone" required="True" />
                                        </div>

                                        

                                        <div name="portal_file_container" t-attf-class="form-group #{error and 'portal_file' in error and 'has-error' or ''}">
                                            <label class="control-label" for="portal_file">Adjuntos:</label>
                                            <label class="custom-file">
                                                <input name="portal_file" id="portal_file" type="file" multiple="multiple" />
                                                <span class="custom-file-control" />
                                            </label>
                                        </div>
                                        <div class="row mb-2">
                                            <div class="col-12 text-center border-top ">
                                                <button type="submit" id="create_helpdesk_ticket" class="btn btn-primary mt-2 rounded">Crear Ticket</button>
                                            </div>
                                        </div>
                                        
                                    </form>
                                </div>
                                <div class="col-sm-12 col-md-6 col-lg-6 o_center_object mt-2">
                                    <button type="button" class="btn btn-secondary rounded" data-dismiss="modal">Ver mis tickets</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <t t-if="not tickets">
                <p>There are currently no tickets for your account.</p>
            </t>

            <t t-if="grouped_tickets" t-call="portal.portal_table">
                <t t-foreach="grouped_tickets" t-as="ticket">
                    <thead>
                        <tr t-attf-class="{{'thead-light' if not groupby == 'none' else ''}}">
                            <th t-if="groupby == 'create_by'">
                                <em class="font-weight-normal text-muted">Creado por:</em>
                                <span t-field="ticket[0].create_uid.name" />
                            </th>
                            <th t-if="groupby == 'ticket_type'">
                                <em class="font-weight-normal text-muted">Tipo de Ticket:</em>
                                <span t-field="ticket[0].ticket_type.name" />
                            </th>
                            <th t-if="groupby == 'status'">
                                <em class="font-weight-normal text-muted">Estado:</em>
                                <span t-esc="ticket[0].stage_id.name" />
                            </th>
                
                            <th t-if="groupby == 'priority'">
                                <em class="font-weight-normal text-muted">Prioridad:</em>
                                <span t-esc="ticket[0].priority.name" />
                            </th>
                            <th t-if="groupby == 'state'">
                                <em class="font-weight-normal text-muted">Estatus de respuesta:</em>
                                <span t-esc="ticket[0].state" />
                            </th>
                            <th>Fecha de creación</th>
                            <th>Última actualización</th>
                            <th>Tipo de Ticket</th>
                            <th>Estado</th>
                        </tr>
                    </thead>
                    <tbody>
                        <t t-foreach="ticket" t-as="t">
                            <tr>
                                <td>
                                    <a t-att-href="t.get_portal_url()" t-att-title="t.name">
                                        <t t-esc="t.name" t-if="t.name" />
                                        <em t-else="">Ticket</em>
                                    </a>
                                </td>
                                <td><span t-field="t.create_date" t-options='{"widget": "date"}' /></td>
                                <td><span t-field="t.write_date" t-options='{"widget": "date"}' /></td>
                                <td><span t-field="t.ticket_type" /></td>
                                <td><span t-field="t.stage_id" /></td>
                            </tr>
                        </t>
                    </tbody>
                </t>
            </t>
        </t>
    </template>
</odoo>