|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | Route::group(['middleware' => \PanicHD\PanicHD\Helpers\LaravelVersion::authMiddleware()], function () use ($main_route, $main_route_path, $admin_route, $admin_route_path) { |
4 | | - |
| 4 | + |
5 | 5 | //Route::group(['middleware' => '', function () use ($main_route) { |
6 | 6 |
|
7 | 7 | //Ticket public route |
8 | 8 | Route::get("$main_route_path/complete", 'PanicHD\PanicHD\Controllers\TicketsController@indexComplete') |
9 | 9 | ->name("$main_route-complete"); |
10 | | - |
| 10 | + |
11 | 11 | // Get newest tickets list |
12 | 12 | Route::get("$main_route_path/newest", 'PanicHD\PanicHD\Controllers\TicketsController@indexNewest') |
13 | 13 | ->name("$main_route-newest") |
|
20 | 20 | Route::get("$main_route_path/notices", function(){ |
21 | 21 | return view('panichd::notices.index'); |
22 | 22 | })->name("$main_route.notices"); |
23 | | - |
| 23 | + |
24 | 24 | // Hide or show ticket to user |
25 | 25 | Route::get("$main_route_path/hide/{value}/{ticket}", 'PanicHD\PanicHD\Controllers\TicketsController@hide')->name("$main_route.hide"); |
26 | | - |
| 26 | + |
27 | 27 | $field_name = last(explode('/', $main_route_path)); |
28 | 28 | Route::resource($main_route_path, 'PanicHD\PanicHD\Controllers\TicketsController', [ |
29 | 29 | 'names' => [ |
|
40 | 40 | ], |
41 | 41 | ]); |
42 | 42 |
|
| 43 | + // Open Ticket create page with one or more parameters set by URL |
| 44 | + Route::get("$main_route_path/createwithvalues/{parameters}", 'PanicHD\PanicHD\Controllers\TicketsController@create_with_values') |
| 45 | + ->where('parameters', '(.*)') |
| 46 | + ->name("$main_route.create-with-values"); |
| 47 | + |
43 | 48 | // Open Ticket edit page with one or more parameters set by URL |
44 | 49 | Route::get("$main_route_path/{id}/editwithvalues/{parameters}", 'PanicHD\PanicHD\Controllers\TicketsController@edit_with_values') |
45 | 50 | ->where('parameters', '(.*)') |
46 | 51 | ->name("$main_route.edit-with-values"); |
47 | | - |
| 52 | + |
48 | 53 | // Attachment routes |
49 | 54 | Route::get("$main_route_path/download-attachment/{attachment}", 'PanicHD\PanicHD\Controllers\TicketsController@downloadAttachment') |
50 | 55 | ->name("$main_route.download-attachment"); |
51 | | - |
| 56 | + |
52 | 57 | Route::get("$main_route_path/view-attachment/{attachment}", 'PanicHD\PanicHD\Controllers\TicketsController@viewAttachment') |
53 | 58 | ->name("$main_route.view-attachment"); |
54 | 59 |
|
|
78 | 83 | Route::get("$main_route_path/{id}/reopen", 'PanicHD\PanicHD\Controllers\TicketsController@reopen') |
79 | 84 | ->name("$main_route.reopen"); |
80 | 85 | //}); |
81 | | - |
| 86 | + |
82 | 87 | // Returns permission_level for category_id |
83 | 88 | Route::get("$main_route_path/permissionLevel/{category_id?}", [ |
84 | 89 | 'as' => $main_route.'-permissionLevel', |
|
88 | 93 | // Ticket list: Change agent for a ticket |
89 | 94 | Route::patch("$main_route_path-change.agent", 'PanicHD\PanicHD\Controllers\TicketsController@changeAgent') |
90 | 95 | ->name("$main_route-change.agent"); |
91 | | - |
| 96 | + |
92 | 97 | // Ticket list: Change priority for a ticket |
93 | 98 | Route::patch("$main_route_path-change.priority", 'PanicHD\PanicHD\Controllers\TicketsController@changePriority') |
94 | 99 | ->name("$main_route-change.priority"); |
|
98 | 103 | // Send again comment (reply) notification |
99 | 104 | Route::post("$main_route_path-notification.resend", 'PanicHD\PanicHD\Controllers\NotificationsController@notificationResend') |
100 | 105 | ->name("$main_route-notification.resend"); |
101 | | - |
| 106 | + |
102 | 107 | //API return list of agents in particular category |
103 | 108 | Route::get("$main_route_path/agents/list/{category_id?}/{ticket_id?}", [ |
104 | 109 | 'as' => $main_route.'agentselectlist', |
105 | 110 | 'uses' => 'PanicHD\PanicHD\Controllers\TicketsController@agentSelectList', |
106 | 111 | ]); |
107 | | - |
| 112 | + |
108 | 113 | // Remove all filters |
109 | 114 | Route::get("$main_route_path/filter/removeall/{list?}", 'PanicHD\PanicHD\Controllers\FiltersController@removeall') |
110 | 115 | ->name("$main_route-filter-removeall"); |
111 | 116 |
|
112 | 117 | // Alter ticket filter |
113 | 118 | Route::get("$main_route_path/filter/{filter}/{value}", 'PanicHD\PanicHD\Controllers\FiltersController@manage'); |
114 | | - |
| 119 | + |
115 | 120 | // Use single filter in specified list |
116 | 121 | Route::get("$main_route_path/filteronly/{filter}/{value}/{list}", 'PanicHD\PanicHD\Controllers\FiltersController@only') |
117 | 122 | ->name("$main_route-filteronly"); |
|
151 | 156 | 'edit' => "$admin_route.priority.edit", |
152 | 157 | ], |
153 | 158 | ]); |
154 | | - |
| 159 | + |
155 | 160 | Route::post("$admin_route_path/priority/reorder", 'PanicHD\PanicHD\Controllers\PrioritiesController@reorder') |
156 | 161 | ->name("$admin_route.priority.reorder"); |
157 | | - |
| 162 | + |
158 | 163 |
|
159 | 164 | //Agents management routes (ex. http://url/panichd/agent) |
160 | 165 | Route::resource("$admin_route_path/agent", 'PanicHD\PanicHD\Controllers\AgentsController', [ |
|
181 | 186 | 'edit' => "$admin_route.category.edit", |
182 | 187 | ], |
183 | 188 | ]); |
184 | | - |
| 189 | + |
185 | 190 | // Members management routes (ex. http://url/panichd/member) |
186 | 191 | Route::resource("$admin_route_path/member", 'PanicHD\PanicHD\Controllers\MembersController', [ |
187 | 192 | 'names' => [ |
188 | 193 | 'index' => "$admin_route.member.index", |
189 | | - 'store' => "$admin_route.member.store", |
190 | | - 'update' => "$admin_route.member.update", |
191 | | - 'destroy' => "$admin_route.member.destroy", |
| 194 | + 'store' => "$admin_route.member.store", |
| 195 | + 'update' => "$admin_route.member.update", |
| 196 | + 'destroy' => "$admin_route.member.destroy", |
192 | 197 | ], |
193 | 198 | ]); |
194 | | - |
| 199 | + |
195 | 200 | //Departments management routes (ex. http://url/panichd/agent) |
196 | 201 | Route::resource("$admin_route_path/notice", 'PanicHD\PanicHD\Controllers\NoticesController', [ |
197 | 202 | 'names' => [ |
198 | 203 | 'index' => "$admin_route.notice.index", |
199 | | - 'store' => "$admin_route.notice.store", |
200 | | - 'update' => "$admin_route.notice.update", |
201 | | - 'destroy' => "$admin_route.notice.destroy", |
| 204 | + 'store' => "$admin_route.notice.store", |
| 205 | + 'update' => "$admin_route.notice.update", |
| 206 | + 'destroy' => "$admin_route.notice.destroy", |
202 | 207 | ], |
203 | 208 | ]); |
204 | 209 |
|
|
0 commit comments