@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | //update end of day list for both building and lab. Retrieve list |
| 67 | 67 | $duties = Duty::all(); |
| 68 | - $this->dutyLists = $duties->map(function ($item) { |
|
| 68 | + $this->dutyLists = $duties->map(function($item) { |
|
| 69 | 69 | $userDateArray = (new DutyList($item))->emailOutput(); |
| 70 | 70 | $userDateArray->put('duty', $item); |
| 71 | 71 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'monday' => Carbon::now()->startOfWeek(), |
| 93 | 93 | 'dutyLists' => $this->dutyLists, |
| 94 | 94 | 'destroyed' => $this->destroyed, |
| 95 | - ], function ($m) use ($reportAddress) { |
|
| 95 | + ], function($m) use ($reportAddress) { |
|
| 96 | 96 | $m->to($reportAddress->secondary, $reportAddress->primary) |
| 97 | 97 | ->subject('Weekly Report'); |
| 98 | 98 | }); |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | Mail::send('emails.duty_today', [ |
| 72 | 72 | 'user' => $user, |
| 73 | 73 | 'duty' => $duty, |
| 74 | - ], function ($m) use ($user, $duty) { |
|
| 74 | + ], function($m) use ($user, $duty) { |
|
| 75 | 75 | $m->to($user->email, $user->userFullName) |
| 76 | - ->subject('Reminder: You have '.$duty->name.' security check today.'); |
|
| 76 | + ->subject('Reminder: You have ' . $duty->name . ' security check today.'); |
|
| 77 | 77 | }); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'user' => $user, |
| 84 | 84 | 'date' => $date, |
| 85 | 85 | 'duty' => $duty, |
| 86 | - ], function ($m) use ($user, $duty, $date) { |
|
| 86 | + ], function($m) use ($user, $duty, $date) { |
|
| 87 | 87 | $filename = $this->generateICS($duty, Carbon::createFromFormat('Y-m-d', $date)); |
| 88 | 88 | |
| 89 | 89 | if ($duty->cycle = 'daily') { |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | $filename = 'schedule.ics'; |
| 130 | 130 | $meetingDuration = (1800); // 30 minutes |
| 131 | 131 | $time = 'T15:30:00.00'; |
| 132 | - $meetingstamp = strtotime($date->toFormattedDateString().$time); |
|
| 132 | + $meetingstamp = strtotime($date->toFormattedDateString() . $time); |
|
| 133 | 133 | $dtstart = gmdate('Ymd\THis\Z', $meetingstamp); |
| 134 | 134 | $dtend = gmdate('Ymd\THis\Z', $meetingstamp + $meetingDuration); |
| 135 | 135 | $todaystamp = gmdate('Ymd\THis\Z'); |
| 136 | 136 | $title = "You have $duty->name security check"; |
| 137 | - $organizer = 'MAILTO:'.$reportAddress->secondary; |
|
| 137 | + $organizer = 'MAILTO:' . $reportAddress->secondary; |
|
| 138 | 138 | |
| 139 | 139 | // ICS |
| 140 | 140 | $mail = []; |
@@ -144,16 +144,16 @@ discard block |
||
| 144 | 144 | $mail[3] = 'CALSCALE:GREGORIAN'; |
| 145 | 145 | $mail[4] = 'METHOD:REQUEST'; |
| 146 | 146 | $mail[5] = 'BEGIN:VEVENT'; |
| 147 | - $mail[6] = 'DTSTART;TZID=America/Chicago:'.$dtstart; |
|
| 148 | - $mail[7] = 'DTEND;TZID=America/Chicago:'.$dtend; |
|
| 149 | - $mail[8] = 'DTSTAMP;TZID=America/Chicago:'.$todaystamp; |
|
| 150 | - $mail[9] = 'UID:'.date('Ymd').'T'.date('His').'-'.rand().'@teamscci.com'; |
|
| 151 | - $mail[10] = 'ORGANIZER;'.$organizer; |
|
| 152 | - $mail[11] = 'CREATED:'.$todaystamp; |
|
| 153 | - $mail[12] = 'LAST-MODIFIED:'.$todaystamp; |
|
| 147 | + $mail[6] = 'DTSTART;TZID=America/Chicago:' . $dtstart; |
|
| 148 | + $mail[7] = 'DTEND;TZID=America/Chicago:' . $dtend; |
|
| 149 | + $mail[8] = 'DTSTAMP;TZID=America/Chicago:' . $todaystamp; |
|
| 150 | + $mail[9] = 'UID:' . date('Ymd') . 'T' . date('His') . '-' . rand() . '@teamscci.com'; |
|
| 151 | + $mail[10] = 'ORGANIZER;' . $organizer; |
|
| 152 | + $mail[11] = 'CREATED:' . $todaystamp; |
|
| 153 | + $mail[12] = 'LAST-MODIFIED:' . $todaystamp; |
|
| 154 | 154 | $mail[14] = 'SEQUENCE:0'; |
| 155 | 155 | $mail[15] = 'STATUS:CONFIRMED'; |
| 156 | - $mail[16] = 'SUMMARY:'.$title; |
|
| 156 | + $mail[16] = 'SUMMARY:' . $title; |
|
| 157 | 157 | $mail[17] = 'TRANSP:OPAQUE'; |
| 158 | 158 | $mail[18] = 'X-MICROSOFT-CDO-IMPORTANTCE:1'; |
| 159 | 159 | $mail[19] = $rrule; |
@@ -67,16 +67,16 @@ |
||
| 67 | 67 | foreach ($supervisors as $supervisor) { |
| 68 | 68 | $newNotes = new Collection(); |
| 69 | 69 | |
| 70 | - $this->trainingUsers->each(function ($item) use ($supervisor, $newNotes) { |
|
| 70 | + $this->trainingUsers->each(function($item) use ($supervisor, $newNotes) { |
|
| 71 | 71 | if ($item->user->supervisor_id == $supervisor->id) { |
| 72 | 72 | $newNotes->push($item); |
| 73 | 73 | } |
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | 76 | if (!$newNotes->isEmpty()) { |
| 77 | - Mail::send('emails.supervisor_reminder', ['notes' => $newNotes], function ($m) use ($supervisor) { |
|
| 77 | + Mail::send('emails.supervisor_reminder', ['notes' => $newNotes], function($m) use ($supervisor) { |
|
| 78 | 78 | $m->to($supervisor->email, $supervisor->userFullName) |
| 79 | - ->subject($supervisor->email.' Training that your employees need to complete.'); |
|
| 79 | + ->subject($supervisor->email . ' Training that your employees need to complete.'); |
|
| 80 | 80 | }); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | foreach ($array as $training) { |
| 113 | 113 | foreach ($training as $trainingUser) { |
| 114 | - $trainingUser['userLink'] = "<a href='".url('user', $trainingUser->user_id)."'>".$trainingUser->user->userFullName.'</a>'; |
|
| 114 | + $trainingUser['userLink'] = "<a href='" . url('user', $trainingUser->user_id) . "'>" . $trainingUser->user->userFullName . '</a>'; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | private function separatedList() |
| 125 | 125 | { |
| 126 | - return User::where(function ($q) { |
|
| 126 | + return User::where(function($q) { |
|
| 127 | 127 | $q->where('status', 'separated')->orWhere('status', 'destroyed'); |
| 128 | 128 | }) |
| 129 | 129 | ->whereBetween('destroyed_date', [$this->start, $this->end]) |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | private function travelsList() |
| 137 | 137 | { |
| 138 | 138 | return Travel::with('user') |
| 139 | - ->where(function ($query) { |
|
| 139 | + ->where(function($query) { |
|
| 140 | 140 | $query->whereBetween('leave_date', [$this->start, $this->end]) |
| 141 | 141 | ->orWhereBetween('return_date', [$this->start, $this->end]); |
| 142 | 142 | }) |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | $storagePath = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix(); |
| 24 | 24 | |
| 25 | - return $storagePath.$fileName; |
|
| 25 | + return $storagePath . $fileName; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function getFilters() |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | foreach ($this->list as $entry) { |
| 28 | 28 | if (Gate::allows('view')) { |
| 29 | - $rowvalue = "<a href='".url('user', $entry['user']->id)."'>".$entry['user']->userFullName.'</a>'; |
|
| 29 | + $rowvalue = "<a href='" . url('user', $entry['user']->id) . "'>" . $entry['user']->userFullName . '</a>'; |
|
| 30 | 30 | } else { |
| 31 | 31 | $rowvalue = $entry['user']->userFullName; |
| 32 | 32 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function emailOutput() |
| 49 | 49 | { |
| 50 | - $collection = $this->list->map(function ($value) { |
|
| 50 | + $collection = $this->list->map(function($value) { |
|
| 51 | 51 | return [ |
| 52 | 52 | 'users' => new Collection([$value['user']]), |
| 53 | 53 | 'date' => $value['date'], |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function emailOutput() |
| 36 | 36 | { |
| 37 | - $collection = $this->list->map(function ($value) { |
|
| 37 | + $collection = $this->list->map(function($value) { |
|
| 38 | 38 | return [ |
| 39 | 39 | 'users' => $value['group'], |
| 40 | 40 | 'date' => $value['date'], |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $row = ''; |
| 115 | 115 | foreach ($entry['group'] as $user) { |
| 116 | 116 | if (Gate::allows('view')) { |
| 117 | - $row .= "<a href='".url('user', $user->id)."'>".$user->userFullName.'</a> & '; |
|
| 117 | + $row .= "<a href='" . url('user', $user->id) . "'>" . $user->userFullName . '</a> & '; |
|
| 118 | 118 | } else { |
| 119 | - $row .= $user->userFullName.' & '; |
|
| 119 | + $row .= $user->userFullName . ' & '; |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | $row = rtrim($row, '& '); |
@@ -19,15 +19,15 @@ |
||
| 19 | 19 | |
| 20 | 20 | public static function upload($model, $files, $encrypted = false) |
| 21 | 21 | { |
| 22 | - $modelName = strtolower(class_basename($model)).'_'; |
|
| 22 | + $modelName = strtolower(class_basename($model)) . '_'; |
|
| 23 | 23 | |
| 24 | 24 | foreach ($files as $file) { |
| 25 | 25 | $data = []; |
| 26 | 26 | |
| 27 | - Storage::makeDirectory($modelName.$model->id); |
|
| 27 | + Storage::makeDirectory($modelName . $model->id); |
|
| 28 | 28 | |
| 29 | 29 | Storage::disk('local') |
| 30 | - ->put($modelName.$model->id.'/'.$file->getClientOriginalName(), self::encryptFileContents($file, $encrypted)); |
|
| 30 | + ->put($modelName . $model->id . '/' . $file->getClientOriginalName(), self::encryptFileContents($file, $encrypted)); |
|
| 31 | 31 | |
| 32 | 32 | $data['filename'] = $file->getClientOriginalName(); |
| 33 | 33 | $data['mime'] = $file->getClientMimeType(); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function scopeActiveUsers($query) |
| 40 | 40 | { |
| 41 | - return $query->whereHas('user', function ($q) { |
|
| 41 | + return $query->whereHas('user', function($q) { |
|
| 42 | 42 | $q->where('status', 'active'); |
| 43 | 43 | }); |
| 44 | 44 | } |