@@ -1,10 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +/** |
|
| 4 | + * @param string $context |
|
| 5 | + * @param string $message |
|
| 6 | + */ |
|
| 3 | 7 | function loging($context, $message, $level = 'error', $array = []) |
| 4 | 8 | { |
| 5 | 9 | \Log::$level($message.':-:-:-'.$context, $array); |
| 6 | 10 | } |
| 7 | 11 | |
| 12 | +/** |
|
| 13 | + * @param string $key |
|
| 14 | + */ |
|
| 8 | 15 | function checkArray($key, $array) |
| 9 | 16 | { |
| 10 | 17 | $value = ''; |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | /** |
| 118 | 118 | *@category Funcion to set rule if send opt is enabled |
| 119 | 119 | * |
| 120 | - *@param object $settings (instance of Model common settings) |
|
| 120 | + *@param CommonSettings $settings (instance of Model common settings) |
|
| 121 | 121 | * |
| 122 | 122 | *@author [email protected] |
| 123 | 123 | * |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | /** |
| 59 | 59 | *@category Funcion to set rule if send opt is enabled |
| 60 | 60 | * |
| 61 | - *@param object $settings (instance of Model common settings) |
|
| 61 | + *@param CommonSettings $settings (instance of Model common settings) |
|
| 62 | 62 | * |
| 63 | 63 | *@author [email protected] |
| 64 | 64 | * |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | *@category Funcion to set rule if send opt is enabled |
| 47 | 47 | * |
| 48 | - *@param object $settings (instance of Model common settings) |
|
| 48 | + *@param CommonSettings $settings (instance of Model common settings) |
|
| 49 | 49 | * |
| 50 | 50 | *@author [email protected] |
| 51 | 51 | * |
@@ -59,6 +59,9 @@ |
||
| 59 | 59 | return $size; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param \Exception $e |
|
| 64 | + */ |
|
| 62 | 65 | public function error($e) |
| 63 | 66 | { |
| 64 | 67 | if ($this->ajax() || $this->wantsJson()) { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * |
| 73 | 73 | * @param CreateLocationRequest $request |
| 74 | - * @return type |
|
| 74 | + * @return \Illuminate\Http\RedirectResponse |
|
| 75 | 75 | */ |
| 76 | 76 | public function handleCreate(CreateLocationRequest $request) { |
| 77 | 77 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | /** |
| 123 | 123 | * |
| 124 | 124 | * @param CreateLocationRequest $request |
| 125 | - * @return type |
|
| 125 | + * @return \Illuminate\Http\RedirectResponse |
|
| 126 | 126 | */ |
| 127 | 127 | public function handleEdit(CreateLocationRequest $request) { |
| 128 | 128 | try { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * |
| 147 | 147 | * @param type $id |
| 148 | - * @return type |
|
| 148 | + * @return \Illuminate\Http\RedirectResponse |
|
| 149 | 149 | */ |
| 150 | 150 | public function handledelete($id) { |
| 151 | 151 | try { |
@@ -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; |
@@ -171,6 +171,9 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | + /** |
|
| 175 | + * @param Request $request |
|
| 176 | + */ |
|
| 174 | 177 | public function store($request) { |
| 175 | 178 | try { |
| 176 | 179 | $sd_problems = new SdProblem; |
@@ -188,6 +191,9 @@ discard block |
||
| 188 | 191 | } |
| 189 | 192 | } |
| 190 | 193 | |
| 194 | + /** |
|
| 195 | + * @param CreateProblemRequest $request |
|
| 196 | + */ |
|
| 191 | 197 | public function update($id, $request) { |
| 192 | 198 | try { |
| 193 | 199 | $sd_problems = new SdProblem; |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | return $ticket_status_name; |
| 58 | 58 | }) |
| 59 | 59 | ->addColumn('Action', function($model) { |
| 60 | - $url = url('service-desk/problem/' . $model->id . '/delete'); |
|
| 60 | + $url = url('service-desk/problem/'.$model->id.'/delete'); |
|
| 61 | 61 | $delete = \App\Itil\Controllers\UtilityController::deletePopUp($model->id, $url, "Delete $model->subject"); |
| 62 | - return "<a href=" . url('service-desk/problem/' . $model->id . '/edit') . " class='btn btn-info btn-sm'>Edit</a> " |
|
| 62 | + return "<a href=".url('service-desk/problem/'.$model->id.'/edit')." class='btn btn-info btn-sm'>Edit</a> " |
|
| 63 | 63 | . $delete |
| 64 | - . " <a href=" . url('service-desk/problem/' . $model->id . '/show') . " class='btn btn-primary btn-sm'>View</a>"; |
|
| 64 | + . " <a href=".url('service-desk/problem/'.$model->id.'/show')." class='btn btn-primary btn-sm'>View</a>"; |
|
| 65 | 65 | }) |
| 66 | 66 | ->searchColumns('description') |
| 67 | 67 | ->orderColumns('department', 'ticket_type', 'priority_id', 'location_type_id', 'agent_id') |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | public function marbleHtml($ticketid, $problemid, $subject, $content) { |
| 252 | 252 | $subject_trim = str_limit($subject, 20); |
| 253 | 253 | $content_trim = str_limit($content, 20); |
| 254 | - $url = url('service-desk/problem/detach/' . $ticketid . '/' . $problemid); |
|
| 254 | + $url = url('service-desk/problem/detach/'.$ticketid.'/'.$problemid); |
|
| 255 | 255 | $detach_popup = \App\Itil\Controllers\UtilityController::deletePopUp($problemid, $url, "Delete", " ", "Delete", true); |
| 256 | 256 | return "<div class='box box-primary'>" |
| 257 | 257 | . "<div class='box-header'>" |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | . "<div class='col-md-12'>" |
| 262 | 262 | . "<table class='table'>" |
| 263 | 263 | . "<tr>" |
| 264 | - . "<th>" . ucfirst($subject_trim) . "</th>" |
|
| 265 | - . "<th>" . ucfirst($content_trim) . "</th>" |
|
| 266 | - . "<th>" . $detach_popup |
|
| 267 | - . " | <a href=" . url('service-desk/problem/' . $problemid . '/show') . ">View</a></th>" |
|
| 264 | + . "<th>".ucfirst($subject_trim)."</th>" |
|
| 265 | + . "<th>".ucfirst($content_trim)."</th>" |
|
| 266 | + . "<th>".$detach_popup |
|
| 267 | + . " | <a href=".url('service-desk/problem/'.$problemid.'/show').">View</a></th>" |
|
| 268 | 268 | . "</table>" |
| 269 | 269 | . "</div>" |
| 270 | 270 | . "</div>" |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $changes = $change->select('id', 'subject')->get(); |
| 319 | 319 | return \Datatable::Collection($changes) |
| 320 | 320 | ->addColumn('id', function($model) { |
| 321 | - return "<input type='radio' name='change' value='" . $model->id . "'>"; |
|
| 321 | + return "<input type='radio' name='change' value='".$model->id."'>"; |
|
| 322 | 322 | }) |
| 323 | 323 | ->addColumn('subject', function($model) { |
| 324 | 324 | return str_limit($model->subject, 20); |
@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | return $asset; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param \App\Itil\Models\Problem\SdProblem $model |
|
| 31 | + */ |
|
| 29 | 32 | public static function getModelWithSelect($model, $select = []) { |
| 30 | 33 | try { |
| 31 | 34 | if (count($select) > 0) { |
@@ -37,6 +40,9 @@ discard block |
||
| 37 | 40 | } |
| 38 | 41 | } |
| 39 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $table |
|
| 45 | + */ |
|
| 40 | 46 | public static function saveTicketRelation($ticketid, $table, $id) { |
| 41 | 47 | |
| 42 | 48 | $relation = new \App\Itil\Models\Common\TicketRelation(); |
@@ -93,6 +99,9 @@ discard block |
||
| 93 | 99 | return $asset; |
| 94 | 100 | } |
| 95 | 101 | |
| 102 | + /** |
|
| 103 | + * @param string $table |
|
| 104 | + */ |
|
| 96 | 105 | public static function detachAsset($table,$id) { |
| 97 | 106 | $relation = new \App\Itil\Models\Common\AssetRelation(); |
| 98 | 107 | $model = $relation->where('owner', "$table:$id")->first(); |
@@ -101,6 +110,9 @@ discard block |
||
| 101 | 110 | } |
| 102 | 111 | } |
| 103 | 112 | |
| 113 | + /** |
|
| 114 | + * @param string $table |
|
| 115 | + */ |
|
| 104 | 116 | public static function getRelationOfTicketByTable($ticketid, $table) { |
| 105 | 117 | $realtions = new \App\Itil\Models\Common\TicketRelation(); |
| 106 | 118 | $realtion = $realtions->where('ticket_id', $ticketid)->where('owner', 'LIKE', $table . "%")->first(); |
@@ -195,6 +207,10 @@ discard block |
||
| 195 | 207 | } |
| 196 | 208 | } |
| 197 | 209 | |
| 210 | + /** |
|
| 211 | + * @param integer $saved |
|
| 212 | + * @param string $value |
|
| 213 | + */ |
|
| 198 | 214 | public static function storeAttachment($saved, $owner, $value, $type, $size) { |
| 199 | 215 | $attachments = new Attachments(); |
| 200 | 216 | $attachments->create([ |
@@ -206,6 +222,9 @@ discard block |
||
| 206 | 222 | ]); |
| 207 | 223 | } |
| 208 | 224 | |
| 225 | + /** |
|
| 226 | + * @param string $table |
|
| 227 | + */ |
|
| 209 | 228 | public static function deleteAttachments($id, $table) { |
| 210 | 229 | $owner = "$table:$id"; |
| 211 | 230 | $attachments = new Attachments(); |
@@ -237,6 +256,9 @@ discard block |
||
| 237 | 256 | return $attach; |
| 238 | 257 | } |
| 239 | 258 | |
| 259 | + /** |
|
| 260 | + * @param string $table |
|
| 261 | + */ |
|
| 240 | 262 | public static function storeAssetRelation($table, $id, $asset_ids = [], $update = false) { |
| 241 | 263 | $relations = new AssetRelation(); |
| 242 | 264 | $owner = "$table:$id"; |
@@ -438,6 +460,9 @@ discard block |
||
| 438 | 460 | return $result; |
| 439 | 461 | } |
| 440 | 462 | |
| 463 | + /** |
|
| 464 | + * @param string $activity |
|
| 465 | + */ |
|
| 441 | 466 | public static function cabMessage($cabid, $activity, $url) { |
| 442 | 467 | $cabs = new \App\Itil\Models\Cab(); |
| 443 | 468 | $cab = $cabs->find($cabid); |
@@ -481,6 +506,9 @@ discard block |
||
| 481 | 506 | } |
| 482 | 507 | } |
| 483 | 508 | |
| 509 | + /** |
|
| 510 | + * @param \Illuminate\Http\Request $requests |
|
| 511 | + */ |
|
| 484 | 512 | public static function storeGeneralInfo($modelid, $table, $requests) { |
| 485 | 513 | $owner = "$table:$modelid"; |
| 486 | 514 | $request = $requests->except('_token', 'attachment', 'identifier'); |
@@ -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 | |
@@ -294,8 +294,9 @@ discard block |
||
| 294 | 294 | foreach ($namespaces as $prefix => $namespace) { |
| 295 | 295 | foreach ($xml->attributes($namespace) as $attributeName => $attribute) { |
| 296 | 296 | //replace characters in attribute name |
| 297 | - if ($options['keySearch']) |
|
| 298 | - $attributeName = str_replace($options['keySearch'], $options['keyReplace'], $attributeName); |
|
| 297 | + if ($options['keySearch']) { |
|
| 298 | + $attributeName = str_replace($options['keySearch'], $options['keyReplace'], $attributeName); |
|
| 299 | + } |
|
| 299 | 300 | $attributeKey = $options['attributePrefix'] |
| 300 | 301 | . ($prefix ? $prefix . $options['namespaceSeparator'] : '') |
| 301 | 302 | . $attributeName; |
@@ -312,11 +313,13 @@ discard block |
||
| 312 | 313 | list($childTagName, $childProperties) = each($childArray); |
| 313 | 314 | |
| 314 | 315 | //replace characters in tag name |
| 315 | - if ($options['keySearch']) |
|
| 316 | - $childTagName = str_replace($options['keySearch'], $options['keyReplace'], $childTagName); |
|
| 316 | + if ($options['keySearch']) { |
|
| 317 | + $childTagName = str_replace($options['keySearch'], $options['keyReplace'], $childTagName); |
|
| 318 | + } |
|
| 317 | 319 | //add namespace prefix, if any |
| 318 | - if ($prefix) |
|
| 319 | - $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName; |
|
| 320 | + if ($prefix) { |
|
| 321 | + $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName; |
|
| 322 | + } |
|
| 320 | 323 | |
| 321 | 324 | if (!isset($tagsArray[$childTagName])) { |
| 322 | 325 | //only entry with this key |
@@ -337,8 +340,9 @@ discard block |
||
| 337 | 340 | //get text content of node |
| 338 | 341 | $textContentArray = array(); |
| 339 | 342 | $plainText = trim((string) $xml); |
| 340 | - if ($plainText !== '') |
|
| 341 | - $textContentArray[$options['textContent']] = $plainText; |
|
| 343 | + if ($plainText !== '') { |
|
| 344 | + $textContentArray[$options['textContent']] = $plainText; |
|
| 345 | + } |
|
| 342 | 346 | |
| 343 | 347 | //stick it all together |
| 344 | 348 | $propertiesArray = !$options['autoText'] || $attributesArray || $tagsArray || ($plainText === '') ? array_merge($attributesArray, $tagsArray, $textContentArray) : $plainText; |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * Execute the job. |
| 35 | 35 | * |
| 36 | - * @return void |
|
| 36 | + * @return integer |
|
| 37 | 37 | */ |
| 38 | 38 | public function handle(PhpMailController $PhpMailController) |
| 39 | 39 | { |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | class SendEmail extends Job implements SelfHandling, ShouldQueue |
| 12 | 12 | { |
| 13 | - use InteractsWithQueue,SerializesModels; |
|
| 13 | + use InteractsWithQueue, SerializesModels; |
|
| 14 | 14 | |
| 15 | 15 | protected $from; |
| 16 | 16 | protected $to; |