Completed
Push — master ( bcb82e...80085e )
by vijay
07:39
created
app/Plugins/ServiceDesk/Controllers/Procurment/ProcurmentController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
             return \Datatable::Collection($procurments)
29 29
                             ->showColumns('name')
30 30
                             ->addColumn('Action', function($model) {
31
-                                return "<a href=" . url('service-desk/procurement/' . $model->id . '/edit') . " class='btn btn-info btn-xs'>Edit</a> ";
31
+                                return "<a href=".url('service-desk/procurement/'.$model->id.'/edit')." class='btn btn-info btn-xs'>Edit</a> ";
32 32
                                 //. "<a href=" . url('service-desk/procurement/' . $model->id . '/delete') . " class='btn btn-warning btn-xs btn-flat'>Delete</a>";
33 33
                             })
34 34
                             ->searchColumns('name')
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Assetstypes/AssetstypesController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             return \Datatable::Collection($assets)
41 41
                             ->showColumns('name', 'created_at', 'updated_at')
42 42
                             ->addColumn('action', function($model) {
43
-                                return "<a href=" . url('service-desk/assetstypes/' . $model->id . '/edit') . " class='btn btn-info btn-xs'>Edit</a> ";
43
+                                return "<a href=".url('service-desk/assetstypes/'.$model->id.'/edit')." class='btn btn-info btn-xs'>Edit</a> ";
44 44
                             })
45 45
                             ->searchColumns('name', 'created_at', 'updated_at')
46 46
                             ->orderColumns('name', 'created_at', 'updated_at')
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Location/LocationController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                             })
40 40
                             ->showColumns('title', 'email', 'phone', 'address')
41 41
                             ->addColumn('action', function($model) {
42
-                                return "<a href=" . url('service-desk/location-types/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> <a href=" . url('service-desk/location-types/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>";
42
+                                return "<a href=".url('service-desk/location-types/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> <a href=".url('service-desk/location-types/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>";
43 43
                             })
44 44
                             ->searchColumns('title', 'email', 'phone', 'address')
45 45
                             ->orderColumns('location_category_id', 'title', 'email', 'phone', 'address')
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $locations = $location->lists('title', 'id')->toArray();
168 168
         if (count($locations) > 0) {
169 169
             foreach ($locations as $key => $value) {
170
-                $html .= "<option value='" . $key . "'>" . $value . "</option>";
170
+                $html .= "<option value='".$key."'>".$value."</option>";
171 171
             }
172 172
         }
173 173
         return $html;
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Problem/ProblemController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
             $problems = $problem->select('id', 'department', 'status_type_id', 'from', 'subject')->get();
38 38
             return \Datatable::Collection($problems)
39 39
                             ->showColumns('from')
40
-                            ->addColumn('subject',function($model){
41
-                                return str_limit($model->subject,10);
40
+                            ->addColumn('subject', function($model) {
41
+                                return str_limit($model->subject, 10);
42 42
                             })
43 43
                             ->addColumn('department', function($model) {
44 44
                                 $depertment_type_name = "Common";
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
                                 return $ticket_status_name;
60 60
                             })
61 61
                             ->addColumn('Action', function($model) {
62
-                                $url = url('service-desk/problem/' . $model->id . '/delete');
62
+                                $url = url('service-desk/problem/'.$model->id.'/delete');
63 63
                                 $delete = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject");
64
-                                return "<a href=" . url('service-desk/problem/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> "
64
+                                return "<a href=".url('service-desk/problem/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> "
65 65
                                         . $delete
66
-                                        . " <a href=" . url('service-desk/problem/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>";
66
+                                        . " <a href=".url('service-desk/problem/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>";
67 67
                             })
68 68
                             ->searchColumns('description')
69 69
                             ->orderColumns('department', 'ticket_type', 'priority_id', 'location_type_id', 'agent_id')
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     public function marbleHtml($ticketid, $problemid, $subject, $content) {
249 249
         $subject_trim = str_limit($subject, 20);
250 250
         $content_trim = str_limit($content, 20);
251
-        $url = url('service-desk/problem/detach/' . $ticketid);
251
+        $url = url('service-desk/problem/detach/'.$ticketid);
252 252
         $detach_popup = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($ticketid, $url, "Delete", " ", "Delete", true);
253 253
         return "<div class='box box-primary'>"
254 254
                 . "<div class='box-header'>"
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
                 . "<div class='col-md-12'>"
259 259
                 . "<table class='table'>"
260 260
                 . "<tr>"
261
-                . "<th>" . ucfirst($subject_trim) . "</th>"
262
-                . "<th>" . ucfirst($content_trim) . "</th>"
261
+                . "<th>".ucfirst($subject_trim)."</th>"
262
+                . "<th>".ucfirst($content_trim)."</th>"
263 263
                 . "<th>".$detach_popup
264
-                . "  | <a href=" . url('service-desk/problem/' . $problemid . '/show') . ">View</a></th>"
264
+                . "  | <a href=".url('service-desk/problem/'.$problemid.'/show').">View</a></th>"
265 265
                 . "</table>"
266 266
                 . "</div>"
267 267
                 . "</div>"
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
         $changes = $change->select('id', 'subject')->get();
313 313
         return \Datatable::Collection($changes)
314 314
                         ->addColumn('id', function($model) {
315
-                            return "<input type='radio' name='change' value='" . $model->id . "'>";
315
+                            return "<input type='radio' name='change' value='".$model->id."'>";
316 316
                         })
317 317
                         ->addColumn('subject', function($model) {
318 318
                             return str_limit($model->subject, 20);
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Products/ProductsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
                                 return $status;
48 48
                             })
49 49
                             ->addColumn('action', function($model) {
50
-                                return "<a href=" . url('service-desk/products/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> <a href=" . url('service-desk/products/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>";
50
+                                return "<a href=".url('service-desk/products/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> <a href=".url('service-desk/products/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>";
51 51
                             })
52 52
                             ->searchColumns('name', 'manufacturer')
53 53
                             ->orderColumns('name', 'manufacturer', 'asset_type_id', 'product_status_id', 'product_mode_procurement_id', 'all_department', 'status')
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/BaseServiceDeskController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use App\Http\Controllers\Controller;
5 5
 
6
-class BaseServiceDeskController extends Controller{
6
+class BaseServiceDeskController extends Controller {
7 7
     
8 8
     public function __construct() {
9 9
         \Event::fire('service.desk.activate', array());
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Changes/ChangesController.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
     public function getChanges() {
35 35
         try {
36 36
             $change = new SdChanges();
37
-            $changes = $change->select('id', 'description', 'subject',  'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id')->get();
37
+            $changes = $change->select('id', 'description', 'subject', 'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id')->get();
38 38
             return \Datatable::Collection($changes)
39 39
                             ->showColumns('subject', 'reason')
40 40
                             ->addColumn('action', function($model) {
41
-                                $url = url('service-desk/changes/' . $model->id . '/delete');
41
+                                $url = url('service-desk/changes/'.$model->id.'/delete');
42 42
                                 $delete = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject");
43 43
                                 //dd($delete);
44
-                                return "<a href=" . url('service-desk/changes/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> "
44
+                                return "<a href=".url('service-desk/changes/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> "
45 45
                                         . $delete
46
-                                        . " <a href=" . url('service-desk/changes/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>";
46
+                                        . " <a href=".url('service-desk/changes/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>";
47 47
                             })
48 48
                             ->searchColumns('description')
49 49
                             ->orderColumns('description', 'subject', 'reason', 'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id')
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
         }
145 145
     }
146 146
     
147
-    public function close($id){
147
+    public function close($id) {
148 148
         try {
149 149
             $changes = new SdChanges();
150 150
             $change = $changes->find($id);
151 151
             if ($change) {
152 152
                   $change->status_id = 6;
153 153
                   $change->save();
154
-                  return redirect()->back()->with('success','Updated');
154
+                  return redirect()->back()->with('success', 'Updated');
155 155
             } else {
156 156
                 throw new \Exception('Sorry we can not find your request');
157 157
             }
@@ -160,28 +160,28 @@  discard block
 block discarded – undo
160 160
         }
161 161
     }
162 162
     
163
-    public function getReleases(){
163
+    public function getReleases() {
164 164
         $release = new \App\Plugins\ServiceDesk\Model\Releases\SdReleases();
165
-        $releases = $release->select('id','subject')->get();
165
+        $releases = $release->select('id', 'subject')->get();
166 166
         return \Datatable::Collection($releases)
167
-                ->addColumn('id',function($model){
167
+                ->addColumn('id', function($model) {
168 168
                     return "<input type='radio' name='release' value='".$model->id."'>";
169 169
                 })
170
-                ->addColumn('subject',function($model){
171
-                    return str_limit($model->subject,20);
170
+                ->addColumn('subject', function($model) {
171
+                    return str_limit($model->subject, 20);
172 172
                 })
173 173
                 ->orderColumns('subject')
174 174
                 ->searchColumns('subject')
175 175
                 ->make();
176 176
     }
177 177
     
178
-    public function attachNewRelease($id, CreateReleaseRequest $request){
179
-        try{
178
+    public function attachNewRelease($id, CreateReleaseRequest $request) {
179
+        try {
180 180
             $release_controller = new \App\Plugins\ServiceDesk\Controllers\Releses\RelesesController();
181 181
             $release = $release_controller->releaseshandleCreate($request, true);
182 182
             $this->releaseAttach($id, $release->id);
183
-            if($release){
184
-                return redirect()->back()->with('success','Updated');
183
+            if ($release) {
184
+                return redirect()->back()->with('success', 'Updated');
185 185
             }
186 186
         } catch (\Exception $ex) {
187 187
             dd($ex);
@@ -189,22 +189,22 @@  discard block
 block discarded – undo
189 189
         }
190 190
     }
191 191
     
192
-    public function attachExistingRelease($id,Request $request){
193
-        try{
192
+    public function attachExistingRelease($id, Request $request) {
193
+        try {
194 194
             $releaseid = $request->input('release');
195 195
             $store = $this->releaseAttach($id, $releaseid);
196
-            if($store){
197
-                return redirect()->back()->with('success','Updated');
196
+            if ($store) {
197
+                return redirect()->back()->with('success', 'Updated');
198 198
             }
199 199
         } catch (\Exception $ex) {
200 200
             return redirect()->back()->with('fails', $ex->getMessage());
201 201
         }
202 202
     }
203 203
     
204
-    public function releaseAttach($changeid,$releaseid){
204
+    public function releaseAttach($changeid, $releaseid) {
205 205
         $relation = new \App\Plugins\ServiceDesk\Model\Changes\ChangeReleaseRelation();
206
-        $relations =  $relation->where('change_id',$changeid)->first();
207
-        if($relations){
206
+        $relations = $relation->where('change_id', $changeid)->first();
207
+        if ($relations) {
208 208
             $relations->delete();
209 209
         }
210 210
         
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
         ]);
215 215
     } 
216 216
     
217
-    public function detachRelease($changeid){
218
-        try{
217
+    public function detachRelease($changeid) {
218
+        try {
219 219
             $relations = new \App\Plugins\ServiceDesk\Model\Changes\ChangeReleaseRelation();
220
-            $relation = $relations->where('change_id',$changeid)->first();
221
-            if($relation){
220
+            $relation = $relations->where('change_id', $changeid)->first();
221
+            if ($relation) {
222 222
                 $relation->delete();
223 223
             }
224
-            return redirect()->back()->with('success','Updated');
224
+            return redirect()->back()->with('success', 'Updated');
225 225
         } catch (\Exception $ex) {
226 226
             return redirect()->back()->with('fails', $ex->getMessage());
227 227
         }
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/ActivateController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function activate() {
14 14
         try {
15
-            if(!Schema::hasTable('sd_assets')){
15
+            if (!Schema::hasTable('sd_assets')) {
16 16
                 $this->migrate();
17 17
                 $this->seed();
18 18
             }
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
         }
34 34
     }
35 35
     
36
-    public function migrate(){
37
-        try{
36
+    public function migrate() {
37
+        try {
38 38
             $path = "app".DIRECTORY_SEPARATOR."Plugins".DIRECTORY_SEPARATOR."ServiceDesk".DIRECTORY_SEPARATOR."database".DIRECTORY_SEPARATOR."migrations";
39 39
             Artisan::call('migrate', [
40 40
             '--path' => $path,
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
         }
46 46
     }
47 47
     
48
-    public function seed(){
49
-         try{
48
+    public function seed() {
49
+         try {
50 50
              $controller = new ServiceDeskSeeder();
51 51
              $controller->run();
52 52
              return 1;
Please login to merge, or discard this patch.
app/Plugins/ServiceDesk/Controllers/Assets/AssetController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
                             })
48 48
                             // ->showColumns('assigned_on')
49 49
                             ->addColumn('action', function($model) {
50
-                                $url = url('service-desk/assets/' . $model->id . '/delete');
50
+                                $url = url('service-desk/assets/'.$model->id.'/delete');
51 51
                                 $delete = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject");
52
-                                return "<a href=" . url('service-desk/assets/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> "
52
+                                return "<a href=".url('service-desk/assets/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> "
53 53
                                         . $delete
54
-                                        . " <a href=" . url('service-desk/assets/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>";
54
+                                        . " <a href=".url('service-desk/assets/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>";
55 55
                             })
56 56
                             ->searchColumns('name', 'department_id', 'asset_type_id', 'impact_type_id', 'managed_by', 'used_by', 'location_id')
57 57
                             ->orderColumns('description', 'subject', 'reason', 'impact', 'rollout_plan', 'backout_plan', 'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id')
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $asset_type_id = $request->input('asset_type');
217 217
             return \Datatable::table()
218 218
                             ->addColumn('#', 'Assets', 'Used By')
219
-                            ->setUrl(url('service-desk/asset-type/' . $asset_type_id))
219
+                            ->setUrl(url('service-desk/asset-type/'.$asset_type_id))
220 220
                             ->render();
221 221
         } catch (Exception $ex) {
222 222
             
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                             ->addColumn('used_by', function($model) {
245 245
                                 $users = new \App\User();
246 246
                                 $user = $users->find($model->used_by);
247
-                                return $user->first_name . ' ' . $user->last_name;
247
+                                return $user->first_name.' '.$user->last_name;
248 248
                             })
249 249
                             ->searchColumns('names')
250 250
                             ->make();
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
         $user = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::getManagedByAssetId($asset->id);
275 275
         $managed = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::getManagedByAssetId($asset->id);
276 276
         $asset_name = $asset->name;
277
-        $user_name = $user->first_name . ' ' . $user->last_name;
278
-        $managed_by = $managed->first_name . ' ' . $managed->last_name;
277
+        $user_name = $user->first_name.' '.$user->last_name;
278
+        $managed_by = $managed->first_name.' '.$managed->last_name;
279 279
         return $this->marbleHtml($ticketid, $asset_name, $user_name, $managed_by, $asset->id);
280 280
     }
281 281
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      * @return type
289 289
      */
290 290
     public function marbleHtml($ticketid, $asset_name, $user_name, $managed_by, $assetid) {
291
-        $url = url('service-desk/asset/detach/' . $ticketid);
291
+        $url = url('service-desk/asset/detach/'.$ticketid);
292 292
         $detach_popup = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($ticketid, $url, "Delete", " ", "Delete", true);
293 293
 
294 294
         return "<div class='box box-primary'>"
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                 . "<div class='col-md-12'>"
300 300
                 . "<table class='table'>"
301 301
                 . "<tr>"
302
-                . "<th>" . ucfirst($asset_name) . "</th>"
303
-                . "<th><i>Used by: </i> " . ucfirst($user_name) . "</th>"
304
-                . "<th><i>Managed by: </i> " . ucfirst($managed_by) . "</th>"
305
-                . "<th>" . $detach_popup
306
-                . " | <a href=" . url('service-desk/assets/' . $assetid . '/show/') . ">View</a></th>"
302
+                . "<th>".ucfirst($asset_name)."</th>"
303
+                . "<th><i>Used by: </i> ".ucfirst($user_name)."</th>"
304
+                . "<th><i>Managed by: </i> ".ucfirst($managed_by)."</th>"
305
+                . "<th>".$detach_popup
306
+                . " | <a href=".url('service-desk/assets/'.$assetid.'/show/').">View</a></th>"
307 307
                 . "</table>"
308 308
                 . "</div>"
309 309
                 . "</div>"
@@ -417,13 +417,13 @@  discard block
 block discarded – undo
417 417
             $date = $request->input('date');
418 418
             $date = str_replace(' ', '', $date);
419 419
             $date_array = explode(':', $date);
420
-            $first = $date_array[0] . " 00:00:00";
421
-            $second = $date_array[1] . " 23:59:59";
420
+            $first = $date_array[0]." 00:00:00";
421
+            $second = $date_array[1]." 23:59:59";
422 422
             $first_date = $this->convertDate($first);
423 423
             $second_date = $this->convertDate($second);
424 424
             $assets = $this->getAssets($first_date, $second_date);
425 425
             $excel_controller = new \App\Http\Controllers\Common\ExcelController();
426
-            $filename = "assets" . $date;
426
+            $filename = "assets".$date;
427 427
             $excel_controller->export($filename, $assets);
428 428
         } catch (Exception $ex) {
429 429
             return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.