@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | return \Datatable::Collection($relese) |
29 | 29 | ->showColumns('subject', 'planned_start_date', 'planned_end_date') |
30 | 30 | ->addColumn('Action', function($model) { |
31 | - $url = url('service-desk/releases/' . $model->id . '/delete'); |
|
31 | + $url = url('service-desk/releases/'.$model->id.'/delete'); |
|
32 | 32 | $delete = \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject"); |
33 | - return "<a href=" . url('service-desk/releases/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> " |
|
33 | + return "<a href=".url('service-desk/releases/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> " |
|
34 | 34 | . $delete |
35 | - . " <a href=" . url('service-desk/releases/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>"; |
|
35 | + . " <a href=".url('service-desk/releases/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>"; |
|
36 | 36 | }) |
37 | - ->searchColumns('subject','description') |
|
37 | + ->searchColumns('subject', 'description') |
|
38 | 38 | ->orderColumns('subject', 'reason', 'impact', 'rollout_plan', 'backout_plan', 'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id') |
39 | 39 | ->make(); |
40 | 40 | } catch (Exception $ex) { |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | $releases = new SdReleases(); |
48 | 48 | $release = $releases->find($id); |
49 | 49 | //dd($release); |
50 | - if($release){ |
|
50 | + if ($release) { |
|
51 | 51 | return view('service::releases.show', compact('release')); |
52 | - }else{ |
|
52 | + } else { |
|
53 | 53 | throw new \Exception('Sorry we can not find your request'); |
54 | 54 | } |
55 | 55 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - public function releaseshandleCreate(CreateReleaseRequest $request,$return=false) { |
|
76 | + public function releaseshandleCreate(CreateReleaseRequest $request, $return = false) { |
|
77 | 77 | //dd($return); |
78 | 78 | try { |
79 | 79 | // dd($request); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::attachment($sd_releases->id, 'sd_releases', $request->file('attachments')); |
92 | 92 | \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::storeAssetRelation('sd_releases', $sd_releases->id, $request->input('asset')); |
93 | 93 | |
94 | - if($return===false){ |
|
94 | + if ($return === false) { |
|
95 | 95 | return \Redirect::route('service-desk.releases.index')->with('message', 'Release successfully create !!!'); |
96 | 96 | } |
97 | 97 | return $sd_releases; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $sd_release_status = SdReleasestatus::lists('name', 'id')->toArray(); |
107 | 107 | $sd_release_priorities = SdReleasepriorities::lists('name', 'id')->toArray(); |
108 | 108 | $sd_release_types = SdReleasetypes::lists('name', 'id')->toArray(); |
109 | - $sd_locations = SdLocations::lists('title','id')->toArray(); |
|
109 | + $sd_locations = SdLocations::lists('title', 'id')->toArray(); |
|
110 | 110 | $assets = SdAssets::lists('name', 'id')->toArray(); |
111 | 111 | |
112 | 112 | return view('service::releases.edit', compact('assets', 'sd_release_status', 'sd_release_priorities', 'sd_release_types', 'sd_locations', 'locations_address', 'release')); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - public function releaseshandleEdit($id,CreateReleaseRequest $request) { |
|
118 | + public function releaseshandleEdit($id, CreateReleaseRequest $request) { |
|
119 | 119 | try { |
120 | 120 | |
121 | 121 | $sd_releases = SdReleases::findOrFail($id); |
@@ -140,25 +140,25 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - public function sendCab($id,$cabid){ |
|
144 | - $activity='sd_releases'; |
|
143 | + public function sendCab($id, $cabid) { |
|
144 | + $activity = 'sd_releases'; |
|
145 | 145 | $owner = "$activity:$id"; |
146 | 146 | $url = url("service-desk/cabs/vote/$cabid/$owner"); |
147 | 147 | \App\Plugins\ServiceDesk\Controllers\Library\UtilityController::cabMessage($cabid, $activity, $url); |
148 | 148 | |
149 | 149 | } |
150 | 150 | |
151 | - public function complete($id){ |
|
152 | - try{ |
|
151 | + public function complete($id) { |
|
152 | + try { |
|
153 | 153 | $releases = new SdReleases(); |
154 | 154 | $release = $releases->find($id); |
155 | - if($release){ |
|
155 | + if ($release) { |
|
156 | 156 | $release->status_id = 5; |
157 | 157 | $release->save(); |
158 | - }else{ |
|
158 | + } else { |
|
159 | 159 | throw new Exception('Sorry we can not find your request'); |
160 | 160 | } |
161 | - return redirect()->back()->with('success','updated'); |
|
161 | + return redirect()->back()->with('success', 'updated'); |
|
162 | 162 | } catch (Exception $ex) { |
163 | 163 | return redirect()->back()->with('fails', $ex->getMessage()); |
164 | 164 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | return \Datatable::Collection($license_type) |
25 | 25 | ->showColumns('name', 'created_at', 'updated_at') |
26 | 26 | ->addColumn('action', function($model) { |
27 | - return "<a href=" . url('service-desk/license-types/' . $model->id . '/edit') . " class='btn btn-info btn-xs'>Edit</a>"; |
|
27 | + return "<a href=".url('service-desk/license-types/'.$model->id.'/edit')." class='btn btn-info btn-xs'>Edit</a>"; |
|
28 | 28 | }) |
29 | 29 | ->searchColumns('name', 'created_at', 'updated_at') |
30 | 30 | ->orderColumns('name', 'created_at', 'updated_at') |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | public static function assetSearch($query, $format = 'json') { |
16 | 16 | $assets = new SdAssets(); |
17 | - $asset = $assets->where('name', 'LIKE', '%' . $query . '%')->select('name as label', 'id as value'); |
|
17 | + $asset = $assets->where('name', 'LIKE', '%'.$query.'%')->select('name as label', 'id as value'); |
|
18 | 18 | |
19 | 19 | if ($format == 'json') { |
20 | 20 | $asset = $asset->get()->toJson(); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public static function saveTicketRelation($ticketid, $table, $id) { |
43 | 43 | |
44 | 44 | $relation = new \App\Plugins\ServiceDesk\Model\Common\TicketRelation(); |
45 | - $relations = $relation->where('ticket_id', $ticketid)->where('owner','LIKE',$table."%")->get(); |
|
45 | + $relations = $relation->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table."%")->get(); |
|
46 | 46 | if ($relations->count() > 0) { |
47 | 47 | foreach ($relations as $del) { |
48 | 48 | $del->delete(); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | return $asset; |
96 | 96 | } |
97 | 97 | |
98 | - public static function getRelationOfTicketByTable($ticketid,$table) { |
|
99 | - $realtions = new \App\Plugins\ServiceDesk\Model\Common\TicketRelation(); |
|
100 | - $realtion = $realtions->where('ticket_id',$ticketid)->where('owner','LIKE',$table."%")->first(); |
|
101 | - if($realtion){ |
|
98 | + public static function getRelationOfTicketByTable($ticketid, $table) { |
|
99 | + $realtions = new \App\Plugins\ServiceDesk\Model\Common\TicketRelation(); |
|
100 | + $realtion = $realtions->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table."%")->first(); |
|
101 | + if ($realtion) { |
|
102 | 102 | return $realtion; |
103 | 103 | } |
104 | 104 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if ($attachment) { |
176 | 176 | $name = $attachment->getClientOriginalName(); |
177 | 177 | $destinationPath = 'uploads/service-desk/attachments'; |
178 | - $value = rand(0000, 9999) . '.' . $name; |
|
178 | + $value = rand(0000, 9999).'.'.$name; |
|
179 | 179 | $type = $attachment->getClientOriginalExtension(); |
180 | 180 | $size = $attachment->getSize(); |
181 | 181 | if ($saved == 2) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $saved = $attachment->saved; |
215 | 215 | if ($saved == 2) { |
216 | 216 | $file = $attachment->value; |
217 | - $path = public_path('uploads' . DIRECTORY_SEPARATOR . 'service-desk' . DIRECTORY_SEPARATOR . 'attachments' . DIRECTORY_SEPARATOR . $file); |
|
217 | + $path = public_path('uploads'.DIRECTORY_SEPARATOR.'service-desk'.DIRECTORY_SEPARATOR.'attachments'.DIRECTORY_SEPARATOR.$file); |
|
218 | 218 | unlink($path); |
219 | 219 | } |
220 | 220 | $attachment->delete(); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $saved = $attachment->saved; |
225 | 225 | if ($saved == 2) { |
226 | 226 | $file = $attachment->value; |
227 | - $attach = public_path('uploads' . DIRECTORY_SEPARATOR . 'service-desk' . DIRECTORY_SEPARATOR . 'attachments' . DIRECTORY_SEPARATOR . $file); |
|
227 | + $attach = public_path('uploads'.DIRECTORY_SEPARATOR.'service-desk'.DIRECTORY_SEPARATOR.'attachments'.DIRECTORY_SEPARATOR.$file); |
|
228 | 228 | } else { |
229 | 229 | $attach = $attachment->value; |
230 | 230 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | if ($options['keySearch']) |
292 | 292 | $attributeName = str_replace($options['keySearch'], $options['keyReplace'], $attributeName); |
293 | 293 | $attributeKey = $options['attributePrefix'] |
294 | - . ($prefix ? $prefix . $options['namespaceSeparator'] : '') |
|
294 | + . ($prefix ? $prefix.$options['namespaceSeparator'] : '') |
|
295 | 295 | . $attributeName; |
296 | 296 | $attributesArray[$attributeKey] = (string) $attribute; |
297 | 297 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $childTagName = str_replace($options['keySearch'], $options['keyReplace'], $childTagName); |
311 | 311 | //add namespace prefix, if any |
312 | 312 | if ($prefix) |
313 | - $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName; |
|
313 | + $childTagName = $prefix.$options['namespaceSeparator'].$childTagName; |
|
314 | 314 | |
315 | 315 | if (!isset($tagsArray[$childTagName])) { |
316 | 316 | //only entry with this key |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | $value = self::value($item); |
356 | 356 | $options = true; |
357 | 357 | } elseif ($options == false) { |
358 | - $it = '=' . '"' . $item . '" '; |
|
359 | - $field .= $index . $it; |
|
358 | + $it = '='.'"'.$item.'" '; |
|
359 | + $field .= $index.$it; |
|
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | public static function value($item) { |
376 | 376 | $result = ""; |
377 | 377 | foreach ($item as $k => $v) { |
378 | - $result .= '<option value=' . '"' . $k . '"' . '>' . $v . '</option>'; |
|
378 | + $result .= '<option value='.'"'.$k.'"'.'>'.$v.'</option>'; |
|
379 | 379 | } |
380 | 380 | return $result; |
381 | 381 | } |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | public static function deletePopUp($id, $url, $title = "Delete", $class = "btn btn-sm btn-danger", $btn_name = "Delete", $button_check = true) { |
384 | 384 | $button = ""; |
385 | 385 | if ($button_check == true) { |
386 | - $button = '<a href="#delete" class="' . $class . '" data-toggle="modal" data-target="#delete' . $id . '">' . $btn_name . '</a>'; |
|
386 | + $button = '<a href="#delete" class="'.$class.'" data-toggle="modal" data-target="#delete'.$id.'">'.$btn_name.'</a>'; |
|
387 | 387 | } |
388 | - return $button . '<div class="modal fade" id="delete' . $id . '"> |
|
388 | + return $button.'<div class="modal fade" id="delete'.$id.'"> |
|
389 | 389 | <div class="modal-dialog"> |
390 | 390 | <div class="modal-content"> |
391 | 391 | <div class="modal-header"> |
392 | 392 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
393 | - <h4 class="modal-title">' . $title . '</h4> |
|
393 | + <h4 class="modal-title">' . $title.'</h4> |
|
394 | 394 | </div> |
395 | 395 | <div class="modal-body"> |
396 | 396 | <div class="row"> |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | </div> |
402 | 402 | <div class="modal-footer"> |
403 | 403 | <button type="button" id="close" class="btn btn-default pull-left" data-dismiss="modal">Close</button> |
404 | - <a href="' . $url . '" class="btn btn-danger">Delete</a> |
|
404 | + <a href="' . $url.'" class="btn btn-danger">Delete</a> |
|
405 | 405 | </div> |
406 | 406 | </div> |
407 | 407 | </div> |
@@ -456,9 +456,9 @@ discard block |
||
456 | 456 | //dd($url); |
457 | 457 | if ($user) { |
458 | 458 | $email = $user->email; |
459 | - $name = $user->first_name . " " . $user->last_name; |
|
459 | + $name = $user->first_name." ".$user->last_name; |
|
460 | 460 | if ($leader) { |
461 | - $heads = $leader->first_name . " " . $leader->last_name; |
|
461 | + $heads = $leader->first_name." ".$leader->last_name; |
|
462 | 462 | } |
463 | 463 | //dd([$email,$name,$heads,$url]); |
464 | 464 | $php_mailer = new \App\Http\Controllers\Common\PhpMailController(); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | public static function getAttachmentSize($size) { |
508 | 508 | $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); |
509 | 509 | $power = $size > 0 ? floor(log($size, 1024)) : 0; |
510 | - $value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power]; |
|
510 | + $value = number_format($size / pow(1024, $power), 2, '.', ',').' '.$units[$power]; |
|
511 | 511 | return $value; |
512 | 512 | } |
513 | 513 |
@@ -9,43 +9,43 @@ discard block |
||
9 | 9 | class InterfaceController extends BaseServiceDeskController { |
10 | 10 | |
11 | 11 | public function agentSidebar() { |
12 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
12 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
13 | 13 | \View::addNamespace('plugins', $path); |
14 | 14 | return view('plugins::agent.sidebar'); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function agentTopbar() { |
18 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
18 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
19 | 19 | \View::addNamespace('plugins', $path); |
20 | 20 | return view('plugins::agent.topbar'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | public function agentTopSubbar() { |
24 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
24 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
25 | 25 | \View::addNamespace('plugins', $path); |
26 | 26 | return view('plugins::agent.topsubbar'); |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function adminSidebar() { |
30 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
30 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
31 | 31 | \View::addNamespace('plugins', $path); |
32 | 32 | return view('plugins::admin.sidebar'); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function adminTopbar() { |
36 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
36 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
37 | 37 | \View::addNamespace('plugins', $path); |
38 | 38 | return view('plugins::admin.topbar'); |
39 | 39 | } |
40 | 40 | |
41 | 41 | public function adminTopSubbar() { |
42 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
42 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
43 | 43 | \View::addNamespace('plugins', $path); |
44 | 44 | return view('plugins::admin.topsubbar'); |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function adminSettings() { |
48 | - $path = app_path() . '/Plugins/ServiceDesk/views/interface'; |
|
48 | + $path = app_path().'/Plugins/ServiceDesk/views/interface'; |
|
49 | 49 | \View::addNamespace('plugins', $path); |
50 | 50 | return view('plugins::admin.settings'); |
51 | 51 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $attachments = new \App\Plugins\ServiceDesk\Model\Common\Attachments(); |
110 | 110 | $atach_owner = str_replace(":", ":$identifier:", $owner); |
111 | 111 | $attachment = $attachments->where('owner', $atach_owner)->first(); |
112 | - if($attachment){ |
|
112 | + if ($attachment) { |
|
113 | 113 | Library\UtilityController::removeAttachment($attachment); |
114 | 114 | } |
115 | 115 | if ($identifier == "solution") { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | return $head; |
39 | 39 | }) |
40 | 40 | ->addColumn('action', function($model) { |
41 | - return "<a href=" . url('service-desk/cabs/' . $model->id . '/edit') . " class='btn btn-info'>Edit</a>"; |
|
41 | + return "<a href=".url('service-desk/cabs/'.$model->id.'/edit')." class='btn btn-info'>Edit</a>"; |
|
42 | 42 | }) |
43 | 43 | ->orderColumns('name', 'head') |
44 | 44 | ->searchColumns('name', 'head') |
@@ -150,20 +150,20 @@ discard block |
||
150 | 150 | $users = new \App\User(); |
151 | 151 | $user = $users->find($userid); |
152 | 152 | $name = ""; |
153 | - if ($user){ |
|
153 | + if ($user) { |
|
154 | 154 | $name = $user->first_name." ".$user->last_name; |
155 | - if($name==" "){ |
|
155 | + if ($name == " ") { |
|
156 | 156 | $name = $user->user_name; |
157 | 157 | } |
158 | 158 | } |
159 | 159 | return ucfirst($name); |
160 | 160 | } |
161 | 161 | |
162 | - public static function checkVote($vote){ |
|
162 | + public static function checkVote($vote) { |
|
163 | 163 | $value = ""; |
164 | - if($vote==1){ |
|
164 | + if ($vote == 1) { |
|
165 | 165 | $value = "Voted for proceed"; |
166 | - }else{ |
|
166 | + } else { |
|
167 | 167 | $value = "Voted for not proceed"; |
168 | 168 | } |
169 | 169 | return $value; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->sendDepartment($department, $message); |
39 | 39 | break; |
40 | 40 | } |
41 | - return redirect()->back()->with('success','Announced'); |
|
41 | + return redirect()->back()->with('success', 'Announced'); |
|
42 | 42 | } catch (Exception $ex) { |
43 | 43 | return redirect()->back()->with('fails', $ex->getMessage()); |
44 | 44 | } |
@@ -8,12 +8,12 @@ |
||
8 | 8 | * and open the template in the editor. |
9 | 9 | */ |
10 | 10 | |
11 | -class SdLocationCategorySeeder extends Seeder{ |
|
11 | +class SdLocationCategorySeeder extends Seeder { |
|
12 | 12 | public function run() { |
13 | - $names=['Asia','Europe','America','Australia']; |
|
13 | + $names = ['Asia', 'Europe', 'America', 'Australia']; |
|
14 | 14 | $created_at = date('Y-d-m H:m:i'); |
15 | 15 | $updated_at = date('Y-d-m H:m:i'); |
16 | - foreach($names as $name){ |
|
16 | + foreach ($names as $name) { |
|
17 | 17 | DB::table('sd_location_categories') |
18 | 18 | ->insert(['name'=>$name, |
19 | 19 | 'created_at'=>$created_at, |
@@ -8,12 +8,12 @@ |
||
8 | 8 | * and open the template in the editor. |
9 | 9 | */ |
10 | 10 | |
11 | -class SdContractTypes extends Seeder{ |
|
11 | +class SdContractTypes extends Seeder { |
|
12 | 12 | public function run() { |
13 | - $names = ['Lease','Software License','Maintenance',]; |
|
13 | + $names = ['Lease', 'Software License', 'Maintenance', ]; |
|
14 | 14 | $created_at = date('Y-d-m H:m:i'); |
15 | 15 | $updated_at = date('Y-d-m H:m:i'); |
16 | - foreach($names as $name){ |
|
16 | + foreach ($names as $name) { |
|
17 | 17 | DB::table('sd_contract_types') |
18 | 18 | ->insert(['name'=>$name, |
19 | 19 | 'created_at'=>$created_at, |
@@ -8,12 +8,12 @@ |
||
8 | 8 | * and open the template in the editor. |
9 | 9 | */ |
10 | 10 | |
11 | -class SdAssetAttachmentTypes extends Seeder{ |
|
11 | +class SdAssetAttachmentTypes extends Seeder { |
|
12 | 12 | public function run() { |
13 | - $names = ['Database','File',]; |
|
13 | + $names = ['Database', 'File', ]; |
|
14 | 14 | $created_at = date('Y-d-m H:m:i'); |
15 | 15 | $updated_at = date('Y-d-m H:m:i'); |
16 | - foreach($names as $name){ |
|
16 | + foreach ($names as $name) { |
|
17 | 17 | DB::table('sd_attachment_types') |
18 | 18 | ->insert(['name'=>$name, |
19 | 19 | 'created_at'=>$created_at, |