Subversion Repositories SmartDukaan

Rev

Rev 35626 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35626 Rev 36040
Line 23... Line 23...
23
        getPartnerAheadOptions($("#typeaheadpartnernameforassignee"), function (selectedPartner) {
23
        getPartnerAheadOptions($("#typeaheadpartnernameforassignee"), function (selectedPartner) {
24
            $("#assignee-ticket-search-by-partner-name").data('id', selectedPartner.partnerId);
24
            $("#assignee-ticket-search-by-partner-name").data('id', selectedPartner.partnerId);
25
            $("#assignee-partner-name-input").val(selectedPartner.partnerId);
25
            $("#assignee-partner-name-input").val(selectedPartner.partnerId);
26
        });
26
        });
27
 
27
 
-
 
28
        // Quick filter functionality for table
-
 
29
        initTableQuickFilter();
28
    });
30
    });
-
 
31
 
-
 
32
    // Table quick filter function
-
 
33
    function initTableQuickFilter() {
-
 
34
        var filterInput = jQuery('#table-quick-filter');
-
 
35
        var clearBtn = jQuery('#clear-quick-filter');
-
 
36
        var resultCount = jQuery('#filter-result-count');
-
 
37
 
-
 
38
        filterInput.on('keyup', function () {
-
 
39
            var searchText = jQuery(this).val().toLowerCase().trim();
-
 
40
            filterTable(searchText);
-
 
41
 
-
 
42
            // Show/hide clear button
-
 
43
            if (searchText.length > 0) {
-
 
44
                clearBtn.show();
-
 
45
            } else {
-
 
46
                clearBtn.hide();
-
 
47
                resultCount.text('');
-
 
48
            }
-
 
49
        });
-
 
50
 
-
 
51
        clearBtn.on('click', function () {
-
 
52
            filterInput.val('');
-
 
53
            filterTable('');
-
 
54
            jQuery(this).hide();
-
 
55
            resultCount.text('');
-
 
56
        });
-
 
57
    }
-
 
58
 
-
 
59
    function filterTable(searchText) {
-
 
60
        var table = jQuery('#ticket-table');
-
 
61
        var tbody = table.find('tbody');
-
 
62
        var rows = tbody.find('tr');
-
 
63
        var resultCount = jQuery('#filter-result-count');
-
 
64
        var visibleCount = 0;
-
 
65
        var totalCount = rows.length;
-
 
66
 
-
 
67
        // If no search text, show all rows
-
 
68
        if (!searchText) {
-
 
69
            rows.show();
-
 
70
            resultCount.text('');
-
 
71
            return;
-
 
72
        }
-
 
73
 
-
 
74
        // Filter rows based on search text
-
 
75
        rows.each(function () {
-
 
76
            var row = jQuery(this);
-
 
77
            var rowText = row.text().toLowerCase();
-
 
78
 
-
 
79
            // Check if any cell contains the search text
-
 
80
            if (rowText.indexOf(searchText) > -1) {
-
 
81
                row.show();
-
 
82
                visibleCount++;
-
 
83
            } else {
-
 
84
                row.hide();
-
 
85
            }
-
 
86
        });
-
 
87
 
-
 
88
        // Update result count
-
 
89
        if (visibleCount === 0) {
-
 
90
            resultCount.html('<span class="text-danger">No matches found</span>');
-
 
91
        } else {
-
 
92
            resultCount.text('Showing ' + visibleCount + ' of ' + totalCount + ' rows');
-
 
93
        }
-
 
94
    }
-
 
95
 
-
 
96
    // Re-apply filter when new content is loaded via AJAX (pagination, etc.)
-
 
97
    jQuery(document).on('ajaxComplete', function (event, xhr, settings) {
-
 
98
        // Check if this is a ticket-related AJAX call
-
 
99
        if (settings.url && settings.url.indexOf('ticket') > -1) {
-
 
100
            var searchText = jQuery('#table-quick-filter').val();
-
 
101
            if (searchText) {
-
 
102
                // Small delay to ensure DOM is updated
-
 
103
                setTimeout(function () {
-
 
104
                    filterTable(searchText.toLowerCase().trim());
-
 
105
                }, 100);
-
 
106
            }
-
 
107
        }
-
 
108
    });
-
 
109
 
-
 
110
    // Clear filter when status or order dropdowns change (these change the dataset)
-
 
111
    jQuery(document).on('change', '#ticketStatus, #orderBy', function () {
-
 
112
        clearQuickFilter();
-
 
113
    });
-
 
114
 
-
 
115
    function clearQuickFilter() {
-
 
116
        jQuery('#table-quick-filter').val('');
-
 
117
        jQuery('#clear-quick-filter').hide();
-
 
118
        jQuery('#filter-result-count').text('');
-
 
119
    }
29
</script>
120
</script>
30
<style>
121
<style>
31
    .pagination-wrapper {
122
    .pagination-wrapper {
32
        display: flex;
123
        display: flex;
33
        align-items: center;
124
        align-items: center;
Line 75... Line 166...
75
        white-space: nowrap;
166
        white-space: nowrap;
76
        overflow: hidden;
167
        overflow: hidden;
77
        text-overflow: ellipsis;
168
        text-overflow: ellipsis;
78
        max-width: 200px;
169
        max-width: 200px;
79
    }
170
    }
-
 
171
 
-
 
172
    /* Quick filter styles */
-
 
173
    #table-quick-filter {
-
 
174
        border-left: none;
-
 
175
    }
-
 
176
 
-
 
177
    #table-quick-filter:focus {
-
 
178
        border-color: #66afe9;
-
 
179
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
-
 
180
    }
-
 
181
 
-
 
182
    #clear-quick-filter {
-
 
183
        border-left: none;
-
 
184
    }
-
 
185
 
-
 
186
    .input-group-addon {
-
 
187
        background-color: #fff;
-
 
188
        border-right: none;
-
 
189
    }
-
 
190
 
-
 
191
    #filter-result-count {
-
 
192
        font-size: 13px;
-
 
193
    }
-
 
194
 
-
 
195
    #ticket-table tbody tr.filter-highlight td {
-
 
196
        background-color: #fff3cd !important;
-
 
197
    }
80
</style>
198
</style>
81
#parse("activity-modal-styles.vm")
199
#parse("activity-modal-styles.vm")
82
<section class="wrapper">
200
<section class="wrapper">
83
    <div class="row">
201
    <div class="row">
84
        <div class="col-lg-12">
202
        <div class="col-lg-12">
Line 91... Line 209...
91
    </div>
209
    </div>
92
 
210
 
93
    ## Search Form
211
    ## Search Form
94
    <div class="row search-form">
212
    <div class="row search-form">
95
        <div class="col-lg-12">
213
        <div class="col-lg-12">
96
            <form id="ticket-search-form" class="form-inline" onsubmit="return false;">
214
            #*<form id="ticket-search-form" class="form-inline" onsubmit="return false;">
97
                <div class="form-group">
215
                <div class="form-group">
98
                    <input type="text" id="ticket-search-input" class="form-control" style="width: 300px;"
216
                    <input type="text" id="ticket-search-input" class="form-control" style="width: 300px;"
99
                           placeholder="Search ticket ID, partner, category, creator..."
217
                           placeholder="Search ticket ID, partner, category, creator..."
100
                           value="$!searchText">
218
                           value="$!searchText">
101
                </div>
219
                </div>
102
                <button type="submit" class="btn btn-primary" id="ticket-search-btn">Search</button>
220
                <button type="submit" class="btn btn-primary" id="ticket-search-btn">Search</button>
103
                <a href="javascript:void(0)" class="btn btn-default" id="ticket-search-clear"
221
                <a href="javascript:void(0)" class="btn btn-default" id="ticket-search-clear"
104
                   style="#if(!$searchText || $searchText == '')display:none;#end">Clear</a>
222
                   style="#if(!$searchText || $searchText == '')display:none;#end">Clear</a>
105
            </form>
223
            </form>*#
-
 
224
            <div class="row" style="margin-bottom: 10px;">
-
 
225
                <div class="col-lg-4">
-
 
226
                    <div class="input-group">
-
 
227
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
-
 
228
                        <input type="text" id="table-quick-filter" class="form-control"
-
 
229
                               placeholder="Filter current page...">
-
 
230
                        <span class="input-group-btn">
-
 
231
                    <button class="btn btn-default" type="button" id="clear-quick-filter" style="display:none;">
-
 
232
                        <i class="fa fa-times"></i>
-
 
233
                    </button>
-
 
234
                </span>
-
 
235
                    </div>
-
 
236
                </div>
-
 
237
                <div class="col-lg-2">
-
 
238
                    <span id="filter-result-count" class="text-muted" style="line-height: 34px;"></span>
-
 
239
                </div>
-
 
240
            </div>
106
        </div>
241
        </div>
107
    </div>
242
    </div>
108
 
243
 
109
    <div class="row">
244
    <div class="row">
110
        <div class="col-lg-2 form-group">
245
        <div class="col-lg-2 form-group">
Line 150... Line 285...
150
                #end
285
                #end
151
            </select>
286
            </select>
152
        </div>
287
        </div>
153
        #if($roleType)
288
        #if($roleType)
154
        <div class="col-lg-6 form-group pull-right">
289
        <div class="col-lg-6 form-group pull-right">
-
 
290
            ## Quick Filter for Table
-
 
291
 
155
            <div class="col-lg-6">
292
            #*<div class="col-lg-6">
156
                <select class="form-control" id="assigneesearchType" name="assigneesearchType"
293
                <select class="form-control" id="assigneesearchType" name="assigneesearchType"
157
                        placeholder="Search Type">
294
                        placeholder="Search Type">
158
                    <option value="" disabled selected>Search Type</option>
295
                    <option value="" disabled selected>Search Type</option>
159
                    #foreach($searchType1 in $ticketSearchTypes)
296
                    #foreach($searchType1 in $ticketSearchTypes)
160
                        #if($ticketSearchType.getValue()==$searchType1.getValue())
297
                        #if($ticketSearchType.getValue()==$searchType1.getValue())
Line 162... Line 299...
162
                        #else
299
                        #else
163
                            <option value="$searchType1">$searchType1.getValue()</option>
300
                            <option value="$searchType1">$searchType1.getValue()</option>
164
                        #end
301
                        #end
165
                    #end
302
                    #end
166
                </select>
303
                </select>
167
            </div>
304
            </div>*#
168
 
305
 
169
 
306
 
170
            <div class="col-lg-6">
307
            #*<div class="col-lg-6">
171
                <input type="hidden" id="assignee-partner-name-input" name="assignee-partner-name-input" value="">
308
                <input type="hidden" id="assignee-partner-name-input" name="assignee-partner-name-input" value="">
172
                <div class="assigneebyPartnerName" style="display: none;">
309
                <div class="assigneebyPartnerName" style="display: none;">
173
                    <div class="input-group">
310
                    <div class="input-group">
174
                        <input placeholder="Partner Name" type="text" class="typeahead form-control"
311
                        <input placeholder="Partner Name" type="text" class="typeahead form-control"
175
                               id="typeaheadpartnernameforassignee" value="" name="Item" data-provide="typeahead"
312
                               id="typeaheadpartnernameforassignee" value="" name="Item" data-provide="typeahead"
Line 188... Line 325...
188
	      			<button class="btn btn-primary" id="assignee-retailer-details-search-button-by-ticketId"
325
	      			<button class="btn btn-primary" id="assignee-retailer-details-search-button-by-ticketId"
189
                            type="button">Go!</button>
326
                            type="button">Go!</button>
190
	    		</span>
327
	    		</span>
191
                    </div>
328
                    </div>
192
                </div>
329
                </div>
193
            </div>
330
            </div>*#
194
        #end
331
        #end
195
    </div>
332
    </div>
196
    </div>
333
    </div>
197
 
334
 
-
 
335
 
198
    <div id="ticket-content-area">
336
    <div id="ticket-content-area">
199
    #parse("ticket-content.vm")
337
    #parse("ticket-content.vm")
200
    </div>
338
    </div>
201
 
339
 
202
</section>
340
</section>