@@ -28,11 +28,11 @@ |
||
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\Itil\Controllers\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 | 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') |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | public static function assetSearch($query, $format = 'json') { |
14 | 14 | $assets = new SdAssets(); |
15 | - $asset = $assets->where('name', 'LIKE', '%' . $query . '%')->select('name as label', 'id as value'); |
|
15 | + $asset = $assets->where('name', 'LIKE', '%'.$query.'%')->select('name as label', 'id as value'); |
|
16 | 16 | |
17 | 17 | if ($format == 'json') { |
18 | 18 | $asset = $asset->get()->toJson(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public static function saveTicketRelation($ticketid, $table, $id) { |
41 | 41 | |
42 | 42 | $relation = new \App\Itil\Models\Common\TicketRelation(); |
43 | - $relations = $relation->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table . "%")->get(); |
|
43 | + $relations = $relation->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table."%")->get(); |
|
44 | 44 | if ($relations->count() > 0) { |
45 | 45 | foreach ($relations as $del) { |
46 | 46 | $del->delete(); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | return $asset; |
94 | 94 | } |
95 | 95 | |
96 | - public static function detachAsset($table,$id) { |
|
96 | + public static function detachAsset($table, $id) { |
|
97 | 97 | $relation = new \App\Itil\Models\Common\AssetRelation(); |
98 | 98 | $model = $relation->where('owner', "$table:$id")->first(); |
99 | 99 | if ($model) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | public static function getRelationOfTicketByTable($ticketid, $table) { |
105 | 105 | $realtions = new \App\Itil\Models\Common\TicketRelation(); |
106 | - $realtion = $realtions->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table . "%")->first(); |
|
106 | + $realtion = $realtions->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table."%")->first(); |
|
107 | 107 | if ($realtion) { |
108 | 108 | return $realtion; |
109 | 109 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if ($attachment) { |
182 | 182 | $name = $attachment->getClientOriginalName(); |
183 | 183 | $destinationPath = public_path('uploads/service-desk/attachments'); |
184 | - $value = rand(0000, 9999) . '.' . $name; |
|
184 | + $value = rand(0000, 9999).'.'.$name; |
|
185 | 185 | $type = $attachment->getClientOriginalExtension(); |
186 | 186 | $size = $attachment->getSize(); |
187 | 187 | if ($saved == 2) { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $saved = $attachment->saved; |
221 | 221 | if ($saved == 2) { |
222 | 222 | $file = $attachment->value; |
223 | - $path = public_path('uploads' . DIRECTORY_SEPARATOR . 'service-desk' . DIRECTORY_SEPARATOR . 'attachments' . DIRECTORY_SEPARATOR . $file); |
|
223 | + $path = public_path('uploads'.DIRECTORY_SEPARATOR.'service-desk'.DIRECTORY_SEPARATOR.'attachments'.DIRECTORY_SEPARATOR.$file); |
|
224 | 224 | unlink($path); |
225 | 225 | } |
226 | 226 | $attachment->delete(); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $saved = $attachment->saved; |
231 | 231 | if ($saved == 2) { |
232 | 232 | $file = $attachment->value; |
233 | - $attach = public_path('uploads' . DIRECTORY_SEPARATOR . 'service-desk' . DIRECTORY_SEPARATOR . 'attachments' . DIRECTORY_SEPARATOR . $file); |
|
233 | + $attach = public_path('uploads'.DIRECTORY_SEPARATOR.'service-desk'.DIRECTORY_SEPARATOR.'attachments'.DIRECTORY_SEPARATOR.$file); |
|
234 | 234 | } else { |
235 | 235 | $attach = $attachment->value; |
236 | 236 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | if ($options['keySearch']) |
298 | 298 | $attributeName = str_replace($options['keySearch'], $options['keyReplace'], $attributeName); |
299 | 299 | $attributeKey = $options['attributePrefix'] |
300 | - . ($prefix ? $prefix . $options['namespaceSeparator'] : '') |
|
300 | + . ($prefix ? $prefix.$options['namespaceSeparator'] : '') |
|
301 | 301 | . $attributeName; |
302 | 302 | $attributesArray[$attributeKey] = (string) $attribute; |
303 | 303 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $childTagName = str_replace($options['keySearch'], $options['keyReplace'], $childTagName); |
317 | 317 | //add namespace prefix, if any |
318 | 318 | if ($prefix) |
319 | - $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName; |
|
319 | + $childTagName = $prefix.$options['namespaceSeparator'].$childTagName; |
|
320 | 320 | |
321 | 321 | if (!isset($tagsArray[$childTagName])) { |
322 | 322 | //only entry with this key |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | $value = self::value($item); |
362 | 362 | $options = true; |
363 | 363 | } elseif ($options == false) { |
364 | - $it = '=' . '"' . $item . '" '; |
|
365 | - $field .= $index . $it; |
|
364 | + $it = '='.'"'.$item.'" '; |
|
365 | + $field .= $index.$it; |
|
366 | 366 | } |
367 | 367 | } |
368 | 368 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | public static function value($item) { |
382 | 382 | $result = ""; |
383 | 383 | foreach ($item as $k => $v) { |
384 | - $result .= '<option value=' . '"' . $k . '"' . '>' . $v . '</option>'; |
|
384 | + $result .= '<option value='.'"'.$k.'"'.'>'.$v.'</option>'; |
|
385 | 385 | } |
386 | 386 | return $result; |
387 | 387 | } |
@@ -389,14 +389,14 @@ discard block |
||
389 | 389 | public static function deletePopUp($id, $url, $title = "Delete", $class = "btn btn-sm btn-danger", $btn_name = "Delete", $button_check = true) { |
390 | 390 | $button = ""; |
391 | 391 | if ($button_check == true) { |
392 | - $button = '<a href="#delete" class="' . $class . '" data-toggle="modal" data-target="#delete' . $id . '">' . $btn_name . '</a>'; |
|
392 | + $button = '<a href="#delete" class="'.$class.'" data-toggle="modal" data-target="#delete'.$id.'">'.$btn_name.'</a>'; |
|
393 | 393 | } |
394 | - return $button . '<div class="modal fade" id="delete' . $id . '"> |
|
394 | + return $button.'<div class="modal fade" id="delete'.$id.'"> |
|
395 | 395 | <div class="modal-dialog"> |
396 | 396 | <div class="modal-content"> |
397 | 397 | <div class="modal-header"> |
398 | 398 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
399 | - <h4 class="modal-title">' . $title . '</h4> |
|
399 | + <h4 class="modal-title">' . $title.'</h4> |
|
400 | 400 | </div> |
401 | 401 | <div class="modal-body"> |
402 | 402 | <div class="row"> |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | </div> |
408 | 408 | <div class="modal-footer"> |
409 | 409 | <button type="button" id="close" class="btn btn-default pull-left" data-dismiss="modal">Close</button> |
410 | - <a href="' . $url . '" class="btn btn-danger">Delete</a> |
|
410 | + <a href="' . $url.'" class="btn btn-danger">Delete</a> |
|
411 | 411 | </div> |
412 | 412 | </div> |
413 | 413 | </div> |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | //dd($url); |
463 | 463 | if ($user) { |
464 | 464 | $email = $user->email; |
465 | - $name = $user->first_name . " " . $user->last_name; |
|
465 | + $name = $user->first_name." ".$user->last_name; |
|
466 | 466 | if ($leader) { |
467 | - $heads = $leader->first_name . " " . $leader->last_name; |
|
467 | + $heads = $leader->first_name." ".$leader->last_name; |
|
468 | 468 | } |
469 | 469 | //dd([$email,$name,$heads,$url]); |
470 | 470 | $php_mailer = new \App\Http\Controllers\Common\PhpMailController(); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | public static function getAttachmentSize($size) { |
514 | 514 | $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); |
515 | 515 | $power = $size > 0 ? floor(log($size, 1024)) : 0; |
516 | - $value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power]; |
|
516 | + $value = number_format($size / pow(1024, $power), 2, '.', ',').' '.$units[$power]; |
|
517 | 517 | return $value; |
518 | 518 | } |
519 | 519 |
@@ -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; |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | $name = "--"; |
37 | 37 | $location_categories = new SdLocationcategories; |
38 | 38 | $location_category = $location_categories->where('id', $model->location_category_id)->first(); |
39 | - if($location_category){ |
|
39 | + if ($location_category) { |
|
40 | 40 | $name = $location_category->name; |
41 | 41 | } |
42 | 42 | return $name; |
43 | 43 | }) |
44 | 44 | ->showColumns('title', 'email', 'phone', 'address') |
45 | 45 | ->addColumn('action', function($model) { |
46 | - 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>"; |
|
46 | + 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>"; |
|
47 | 47 | }) |
48 | 48 | ->searchColumns('title', 'email', 'phone', 'address') |
49 | 49 | ->orderColumns('location_category_id', 'title', 'email', 'phone', 'address') |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $departments_name = ""; |
104 | 104 | $sd_location = Location::findOrFail($id); |
105 | 105 | $departments = Department::whereid($sd_location->departments)->first(); |
106 | - if($departments){ |
|
106 | + if ($departments) { |
|
107 | 107 | $departments_name = $departments->name; |
108 | 108 | } |
109 | 109 | $location_category = SdLocationcategories::whereid($sd_location->location_category_id)->first(); |
110 | - if($location_category){ |
|
110 | + if ($location_category) { |
|
111 | 111 | $location_category_name = $location_category->name; |
112 | 112 | } |
113 | 113 | $departments = Department::all(array('id', 'name')); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $asset = $assets->find($id); |
178 | 178 | $location_id = ''; |
179 | 179 | $select = ""; |
180 | - if($asset){ |
|
180 | + if ($asset) { |
|
181 | 181 | $location_id = $asset->location_id; |
182 | 182 | } |
183 | 183 | $html = "<option value=''>Select</option>"; |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | $locations = $location->lists('title', 'id')->toArray(); |
187 | 187 | if (count($locations) > 0) { |
188 | 188 | foreach ($locations as $key => $value) { |
189 | - if($key==$location_id){ |
|
189 | + if ($key == $location_id) { |
|
190 | 190 | $select = 'selected'; |
191 | 191 | } |
192 | - $html .= "<option value='" . $key . "' $select>" . $value . "</option>"; |
|
192 | + $html .= "<option value='".$key."' $select>".$value."</option>"; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | return $html; |
@@ -27,9 +27,9 @@ |
||
27 | 27 | ->showColumns('name', 'created_at', 'updated_at') |
28 | 28 | ->addColumn('action', function($model) { |
29 | 29 | $url = url('service-desk/location-category-types/'.$model->id.'/delete'); |
30 | - $delete = \App\Itil\Controllers\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject",'btn btn-danger btn-sm'); |
|
30 | + $delete = \App\Itil\Controllers\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject", 'btn btn-danger btn-sm'); |
|
31 | 31 | |
32 | - return "<a href=" . url('service-desk/location-category-types/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a>" |
|
32 | + return "<a href=".url('service-desk/location-category-types/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a>" |
|
33 | 33 | . $delete; |
34 | 34 | }) |
35 | 35 | ->searchColumns('name') |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $attachments = new \App\Itil\Models\Common\Attachments(); |
103 | 103 | $atach_owner = str_replace(":", ":$identifier:", $owner); |
104 | 104 | $attachment = $attachments->where('owner', $atach_owner)->first(); |
105 | - if($attachment){ |
|
105 | + if ($attachment) { |
|
106 | 106 | UtilityController::removeAttachment($attachment); |
107 | 107 | } |
108 | 108 | if ($identifier == "solution") { |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | return \Datatable::Collection($changes) |
38 | 38 | ->showColumns('subject', 'reason') |
39 | 39 | ->addColumn('action', function($model) { |
40 | - $url = url('service-desk/changes/' . $model->id . '/delete'); |
|
40 | + $url = url('service-desk/changes/'.$model->id.'/delete'); |
|
41 | 41 | $delete = \App\Itil\Controllers\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject"); |
42 | 42 | //dd($delete); |
43 | - return "<a href=" . url('service-desk/changes/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> " |
|
43 | + return "<a href=".url('service-desk/changes/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> " |
|
44 | 44 | . $delete |
45 | - . " <a href=" . url('service-desk/changes/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>"; |
|
45 | + . " <a href=".url('service-desk/changes/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>"; |
|
46 | 46 | }) |
47 | 47 | ->searchColumns('description') |
48 | 48 | ->orderColumns('description', 'subject', 'reason', 'status_id', 'priority_id', 'change_type_id', 'impact_id', 'location_id', 'approval_id') |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $releases = $release->select('id', 'subject')->get(); |
168 | 168 | return \Datatable::Collection($releases) |
169 | 169 | ->addColumn('id', function($model) { |
170 | - return "<input type='radio' name='release' value='" . $model->id . "'>"; |
|
170 | + return "<input type='radio' name='release' value='".$model->id."'>"; |
|
171 | 171 | }) |
172 | 172 | ->addColumn('subject', function($model) { |
173 | 173 | return str_limit($model->subject, 20); |
@@ -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,13 +8,13 @@ |
||
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 | |
13 | 13 | public function run() { |
14 | - $names = ['Database','File',]; |
|
14 | + $names = ['Database', 'File', ]; |
|
15 | 15 | $created_at = date('Y-d-m H:m:i'); |
16 | 16 | $updated_at = date('Y-d-m H:m:i'); |
17 | - foreach($names as $name){ |
|
17 | + foreach ($names as $name) { |
|
18 | 18 | DB::table('sd_attachment_types') |
19 | 19 | ->insert(['name'=>$name, |
20 | 20 | 'created_at'=>$created_at, |