ticket_dashboard_templates.xml 16.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="sh_action_ticket_dashboard" model="ir.actions.client">
        <field name="name">Ticket Dashboard</field>
        <field name="tag">ticket_dashboard.dashboard</field>
    </record>
    <menuitem id="helpdesk_dashboard_menu" name="Dashboard" parent="sh_all_in_one_helpdesk.helpdesk_main_menu" sequence="1" action="sh_action_ticket_dashboard" />
    <template id="ticket_dashboard_count" name="My Dashboard Count">
        <div id="js_ticket_count_div">
            <div>
                <div class="row">
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
                    <t t-if="dict_all">
                        <t t-foreach="dict_all.keys()" t-as="value">
                            <t t-set="all_ids" t-value="dict_all[value]"/>
                            <div class="col-lg-3 col-md-4 col-sm-12">
                                <a class="sh_title_click_all custom"  href="#" t-att-data-res_ids="all_ids">
                                    <div class="card card_1 custom-card" href="#">
                                        <div class="sh-card-body dash1 badge-info" style="background-color: #445ee9;">
                                            <div class="media">
                                                <i class="fa fa-clock-o fs-20 text-white align-self-center mr-3"></i>
                                                <div style="display: inline-block;color: white;">
                                                    <h3 class="mt-0" style="color:white;">
                                                        <t t-esc="len(all_ids)" />
                                                    </h3>
                                                    <p>
                                                        <span t-esc="value" style="color:white;"/>
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        </t>        
                    </t>
36 37
                    <t t-if="data_dict">
                        <t t-foreach="data_dict.keys()" t-as="value">
38
                            <t t-set="  " t-value="data_dict[value][0][0]" /> 
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
                            <t t-set="error" t-value="data_dict[value][0][1]" />
                            <div class="col-lg-3 col-md-4 col-sm-12">
                                <a class="sh_tile_click custom" href="#" t-att-data-res_ids="list_ids or []">
                                    <div class="card card_1 custom-card" href="#">
                                        <t t-if="error == 1">
                                            <div class="sh-card-body dash1 badge-info btn-danger">
                                                <div class="media">
                                                    <i class="fa fa-clock-o fs-20 text-white align-self-center mr-3"></i>
                                                    <div style="display: inline-block;color: white;">
                                                        <h3 class="mt-0" style="color:white;">
                                                            <t t-esc="len(list_ids)" />
                                                        </h3>
                                                        <p>
                                                            <span t-esc="value" style="color:white;"/>
                                                        </p>
                                                    </div>
                                                </div>
                                            </div>
                                        </t>
                                        <t t-elif="error == 3">
                                            <div class="sh-card-body dash1 badge-info btn-warning">
                                                <div class="media">
                                                    <i class="fa fa-clock-o fs-20 text-white align-self-center mr-3"></i>
                                                    <div style="display: inline-block;color: white;">
                                                        <h3 class="mt-0" style="color:white;">
                                                            <t t-esc="len(list_ids)" />
                                                        </h3>
                                                        <p>
                                                            <span t-esc="value" style="color:white;"/>
                                                        </p>
                                                    </div>
                                                </div>
                                            </div>
                                        </t>
                                        <t t-else="">
                                            <div class="sh-card-body dash1 badge-info" style="background-color: #445ee9;">
                                                <div class="media">
                                                    <i class="fa fa-clock-o fs-20 text-white align-self-center mr-3"></i>
                                                    <div style="display: inline-block;color: white;">
                                                        <h3 class="mt-0" style="color:white;">
                                                            <t t-esc="len(list_ids)" />
                                                        </h3>
                                                        <p>
                                                            <span t-esc="value" style="color:white;"/>
                                                        </p>
                                                    </div>
                                                </div>
                                            </div>
                                        </t>
                                    </div>
                                </a>
                            </div>
                        </t>
                        
                    </t>
                </div>
            </div>
        </div>
    </template>
    <template id="ticket_dashboard_tbl" name="My Ticket Table">
        <div id="js_ticket_tbl_div">
            <div>
                <div class="row" style="margin: 0;">
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 153 154 155 156 157 158
                    <t t-if="ticket_data_dic">
                        <div class="modal fade whatsapp_modal" tabindex="-1" role="dialog" aria-labelledby="whatsappModalLabel" aria-hidden="true">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="whatsappModalLabel">Send By Whatsapp</h5>
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                            <span aria-hidden="true">&amp;times;</span>
                                        </button>
                                    </div>
                                    <div class="modal-body">
                                        <form>
                                            <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
                                            <div class="form-group" style="display: flex;align-items: center;">
                                                <label for="ticket_partner_id" style="margin-bottom: 0;font-weight: 600;width:100px">Partner</label>
                                                <select class="form-select form-select-lg mb-3 custom-select" id="ticket_partner_id" required="True" style="margin-bottom: 0 !important;">
                                                    <option value="select_partner">Select Partner</option>
                                                    <t t-foreach="request.env['res.partner'].sudo().search([])" t-as="partner">
                                                        <option t-att-value="partner.id">
                                                            <t t-esc="partner.name_get()[0][1]" />
                                                        </option>
                                                    </t>
                                                </select>
                                            </div>
                                            <div class="form-group" style="display: flex;align-items: center;margin-bottom: 1.3rem;">
                                                <label for="partner_mobile_no" style="font-weight: 600;margin-bottom: 0;width: 100px;">Mobile No</label>
                                                <input id="partner_mobile_no" name="partner_mobile_no" class="form-control" type="text" placeholder="Enter Mobile No with conutry code" required="True" />
                                            </div>
                                            <div class="form-group" style="display: flex;align-items: center;margin-bottom: 1.3rem;">
                                                <label for="whatsapp_message" style="font-weight: 600;width: 100px;margin-bottom: 0;">Message</label>
                                                <textarea class="form-control rounded-0" id="whatsapp_message" required="True"></textarea>
                                            </div>
                                            <div class="form-group">
                                                <p>
                                                    <strong>Note:</strong>
                                                    <br />
                                                    1) Use *text* to make text bold.
                                                    <br />
                                                    2) Use _text_ to make text italic.
                                                    <br />
                                                    3) Use %0A after/before Text if you want to add blank line.
                                                    <br />
                                                    4) use %20 after/before any Text if you want to give space.
                                                    <br />
                                                    5) go to users => preferences to add signature.
                                                </p>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                        <button type="button" class="btn btn-primary" id="send">Send</button>
                                    </div>
                                </div>
                            </div>
                        </div>
159
                       
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
                        <t t-foreach="ticket_data_dic.keys()" t-as="ticket">
                            <div class="col-md-12" style="margin-bottom: 20px; box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); padding-left: 0 !important; padding-right: 0 !important;">
                                <h3 style="padding: 10px; margin-top: 7px; margin-bottom: 7px;">
                                    <b>
                                        <span>Stage :</span>
                                        <span t-esc="ticket" />
                                    </b>
                                </h3>
                                <div class="table-responsive">
                                    <table class="table" style="margin-bottom: 0.5rem;">
                                        <tr>
                                            <th>Ticket No</th>
                                            <th>Customer Name</th>
                                            <th>Mobile Number</th>
                                            <th>Create Date</th>
                                            <th>Last Update Date</th>
                                            <th>Assign User</th>
                                            <th style="padding-left: 25px;">Action</th>
                                            <th style="display: none;"></th>
                                        </tr>
                                        <t t-if="len(ticket_data_dic[ticket])==0">
                                            <tr>
                                                <td colspan="7">
                                                    Data not available.
                                                </td>
                                            </tr>
                                        </t>
                                        <t t-if="len(ticket_data_dic[ticket])&gt;0">
                                            <tr t-foreach="ticket_data_dic[ticket]" t-as="order">
                                                <td>
                                                    <a t-att-href="'/web#id=%s&amp;view_type=form&amp;model=helpdesk.ticket' % (order.get('ticket_id'))" target="_blank">
                                                        <span t-esc="order.get('ticket_no')" />
                                                    </a>
                                                </td>
                                                <td>
                                                    <span t-esc="order.get('partner_name')" />
                                                </td>
                                                <td>
                                                    <span t-esc="order.get('partner_mobile')" />
                                                </td>
                                                <td>
                                                    <span t-esc="order.get('create_date')" />
                                                </td>
                                                <td>
                                                    <span t-esc="order.get('write_date')" />
                                                </td>
                                                <td>
                                                    <span t-esc="order.get('user_id')" />
                                                </td>
                                                <td>
                                                    <div style="display:flex;">
                                                        <a style="cursor: pointer;" class="btn-success" t-att-href="'/web#id=%s&amp;view_type=form&amp;model=helpdesk.ticket' % (order.get('ticket_id'))" target="_blank">
                                                            <i class="fa fa-eye" />
                                                        </a>
                                                        &amp;nbsp;
                                                        <!--<button style="cursor: pointer;" class="btn-success mark-whatsapp">
                                                            <i class="fa fa-whatsapp" />
                                                        </button>-->
                                                    </div>
                                                </td>
                                                <td style="display: none;">
                                                    <input type="hidden" id="partner_id" name="partner_id" t-att-value="order.get('partner_id')" t-att-data-mobile="order.get('partner_mobile') or ''" />
                                                </td>
                                            </tr>
                                        </t>
                                    </table>
                                </div>
                            </div>
                            <br />
                        </t>
                    </t>
                </div>
            </div>
        </div>
    </template>
</odoo>