@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | |
32 | 32 | $viewData = array(); |
33 | 33 | |
34 | - if(Input::has('conversation')) { |
|
34 | + if (Input::has('conversation')) { |
|
35 | 35 | $viewData['current_conversation'] = $this->conversationRepository->getByName(Input::get('conversation')); |
36 | 36 | } else { |
37 | 37 | $viewData['current_conversation'] = Auth::user()->conversations()->first(); |
38 | 38 | } |
39 | 39 | |
40 | - if($viewData['current_conversation']) { |
|
40 | + if ($viewData['current_conversation']) { |
|
41 | 41 | Session::set('current_conversation', $viewData['current_conversation']->name); |
42 | 42 | |
43 | - foreach($viewData['current_conversation']->messages_notifications as $notification) { |
|
43 | + foreach ($viewData['current_conversation']->messages_notifications as $notification) { |
|
44 | 44 | $notification->read = true; |
45 | 45 | $notification->save(); |
46 | 46 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $users = $this->userRepository->getAllExcept(Auth::user()->id); |
50 | 50 | |
51 | - foreach($users as $key => $user) { |
|
51 | + foreach ($users as $key => $user) { |
|
52 | 52 | $viewData['recipients'][$user->id] = $user->username; |
53 | 53 | } |
54 | 54 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $userDetailsArray = $value; |
13 | 13 | } |
14 | 14 | // print_r($userDetailsArray); |
15 | - $data['userDetailsArray']=$userDetailsArray; |
|
15 | + $data['userDetailsArray'] = $userDetailsArray; |
|
16 | 16 | return View::make('layouts/profile')->with("userDetailsArray", $userDetailsArray); |
17 | 17 | } |
18 | 18 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | return Redirect::back()->withErrors($validator); |
115 | 115 | } else { |
116 | - $password= Hash::make(Input::get('new_password')); |
|
116 | + $password = Hash::make(Input::get('new_password')); |
|
117 | 117 | DB::table('users')->where('id', Auth::user()->id)->update(array( |
118 | 118 | 'password' => $password |
119 | 119 | ) |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | return Redirect::to('/settings/'); |
123 | 123 | } |
124 | 124 | |
125 | - function deactivateAccount(){ |
|
125 | + function deactivateAccount() { |
|
126 | 126 | if (Auth::user()) { |
127 | - $loggedInUser=Auth::user()->id; |
|
127 | + $loggedInUser = Auth::user()->id; |
|
128 | 128 | $userProfile = DB::table('users')->select('profile_pic')->where('id', Auth::user()->id)->get(); |
129 | 129 | foreach ($userProfile as $key => $value) { |
130 | 130 | $userDetailsArray = $value; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // )); |
53 | 53 | |
54 | 54 | |
55 | - if(Input::get('token')!=''){ |
|
55 | + if (Input::get('token') != '') { |
|
56 | 56 | $rules = array( |
57 | 57 | 'email' => 'required|email', |
58 | 58 | 'password' => 'required|min:6|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{1,}$/' |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $messages = array( |
61 | 61 | 'password.regex' => 'The password must containt atleast 1 Upper Case letters[A-Z],1 Lower Case Letter[a-z],1 numeric letter [0-9] and 1 special character.', |
62 | 62 | |
63 | - );} |
|
64 | - else{ |
|
63 | + ); } |
|
64 | + else { |
|
65 | 65 | $rules = array( |
66 | 66 | 'email' => 'required|email', |
67 | 67 | 'password' => 'required' |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | - $validator = Validator::make(Input::all(), $rules,$messages); |
|
76 | + $validator = Validator::make(Input::all(), $rules, $messages); |
|
77 | 77 | |
78 | 78 | if ($validator->fails()) { |
79 | 79 | return Response::json(array( |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | if ($token != '') { |
87 | 87 | |
88 | 88 | $result = DB::table('invitation_token')->where('token', '=', $token)->first(); |
89 | - if (count($result)>0) {//token was valid and was deleted |
|
89 | + if (count($result) > 0) {//token was valid and was deleted |
|
90 | 90 | //Create invited account |
91 | - $userInfo=explode('@',$result['email']); |
|
91 | + $userInfo = explode('@', $result['email']); |
|
92 | 92 | $id = DB::table('users')->insertGetId( |
93 | 93 | ['first_name' => $userInfo[0], 'last_name' => '', 'email' => $result['email'], 'password' => Hash::make(Input::get('password'))] |
94 | 94 | ); |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | ); |
101 | 101 | //delete token from database before creating invited account |
102 | 102 | DB::table('invitation_token')->where('token', '=', $token)->delete(); |
103 | - $this->teamRepository->updateNewMemberJoinNotification($result['team_id'],$id); |
|
103 | + $this->teamRepository->updateNewMemberJoinNotification($result['team_id'], $id); |
|
104 | 104 | } |
105 | - else{ |
|
105 | + else { |
|
106 | 106 | return Response::json(array( |
107 | 107 | 'success' => false, |
108 | 108 | 'errors' => "Invalid Request", |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'success' => true |
135 | 135 | ), 200); |
136 | 136 | } |
137 | - else{ |
|
137 | + else { |
|
138 | 138 | $errorMsg = array( |
139 | 139 | 'errormsg' => 'Invalid Email or Password' |
140 | 140 | ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | foreach ($teamMembers as $memeber) { |
194 | 194 | //Publish data to redis |
195 | - $channelId = $memeber["id"] . "_" . $values["team_channel_id"]; |
|
195 | + $channelId = $memeber["id"]."_".$values["team_channel_id"]; |
|
196 | 196 | |
197 | 197 | $teamChannelId = $values["team_channel_id"]; |
198 | 198 | $data = array( |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
207 | - public function updateTimeZone(){ |
|
208 | - $tzName=Input::get('tz'); |
|
207 | + public function updateTimeZone() { |
|
208 | + $tzName = Input::get('tz'); |
|
209 | 209 | |
210 | 210 | |
211 | 211 | storeUserTimeZone($tzName); |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | 'password.regex' => 'The password must containt atleast 1 Upper Case letters[A-Z],1 Lower Case Letter[a-z],1 numeric letter [0-9] and 1 special character.', |
25 | 25 | |
26 | 26 | ); |
27 | - $validator = Validator::make($input, $rules,$messages); |
|
27 | + $validator = Validator::make($input, $rules, $messages); |
|
28 | 28 | $messages = $validator->messages(); |
29 | - if($validator->fails()) { |
|
29 | + if ($validator->fails()) { |
|
30 | 30 | |
31 | 31 | return Response::json(array( |
32 | 32 | 'success' => false, |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $id = DB::table('users')->insertGetId( |
39 | - ['first_name' => Input::get('firstName'),'last_name' => Input::get('lastName'),'email' => Input::get('email'), 'password' => Hash::make(Input::get('password'))] |
|
39 | + ['first_name' => Input::get('firstName'), 'last_name' => Input::get('lastName'), 'email' => Input::get('email'), 'password' => Hash::make(Input::get('password'))] |
|
40 | 40 | ); |
41 | 41 | DB::table('user_roles')->insert( |
42 | 42 | ['user_id' => $id, 'role_id' => Input::get('role')] |
43 | 43 | ); |
44 | - $channelId= Hash::make(Input::get('password')); |
|
44 | + $channelId = Hash::make(Input::get('password')); |
|
45 | 45 | DB::table('channels')->insert( |
46 | 46 | ['channel_name' => $channelId, 'author_id' => $id] |
47 | 47 | ); |
48 | - if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password')),true)) { |
|
48 | + if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password')), true)) { |
|
49 | 49 | |
50 | 50 | /* Store basic information in session of logged in user */ |
51 | 51 | $role = DB::table('roles') |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | if ($type == "messages") { |
11 | 11 | $unReadMessages = DB::table('messages') |
12 | - ->select(DB::raw('count(from_user_id) as fromCount'), 'personal_conversations.*','team_channels.id as team_id', 'messages.*', 'users_from.first_name as from_first_name', 'users_from.first_name as from_last_name') |
|
12 | + ->select(DB::raw('count(from_user_id) as fromCount'), 'personal_conversations.*', 'team_channels.id as team_id', 'messages.*', 'users_from.first_name as from_first_name', 'users_from.first_name as from_last_name') |
|
13 | 13 | ->leftJoin('personal_conversations', 'messages.id', '=', 'personal_conversations.message_id') |
14 | 14 | ->leftJoin('team_channels', 'team_channels.id', '=', 'personal_conversations.team_channel_id') |
15 | 15 | ->leftJoin('users as users_from', 'users_from.id', '=', 'personal_conversations.from_user_id') |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | break; |
66 | 66 | case "general": |
67 | - $teamId = explode("_",Input::get('teamId')); |
|
67 | + $teamId = explode("_", Input::get('teamId')); |
|
68 | 68 | |
69 | 69 | DB::table('team_conversations_read_status') |
70 | 70 | ->where('user_id', Auth::user()->id) |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | break; |
74 | 74 | |
75 | 75 | case "join": |
76 | - $teamId = explode("_",Input::get('teamId')); |
|
76 | + $teamId = explode("_", Input::get('teamId')); |
|
77 | 77 | |
78 | 78 | DB::table('invitation_notification') |
79 | 79 | ->where('team_user', Auth::user()->id) |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | $conversations = array(); |
14 | 14 | |
15 | - if($conversations_users) { |
|
15 | + if ($conversations_users) { |
|
16 | 16 | $conversations = Conversation::whereIn('id', $conversations_users)->get(); |
17 | 17 | } |
18 | 18 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | $validator = Validator::make($input, $rules); |
24 | 24 | $messages = $validator->messages(); |
25 | - if($validator->fails()) { |
|
25 | + if ($validator->fails()) { |
|
26 | 26 | |
27 | 27 | return Response::json(array( |
28 | 28 | 'success' => false, |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | $id = DB::table('users')->insertGetId( |
35 | - ['first_name' => Input::get('firstName'),'last_name' => Input::get('lastName'),'email' => Input::get('email'), 'password' => Hash::make(Input::get('password'))] |
|
35 | + ['first_name' => Input::get('firstName'), 'last_name' => Input::get('lastName'), 'email' => Input::get('email'), 'password' => Hash::make(Input::get('password'))] |
|
36 | 36 | ); |
37 | 37 | DB::table('user_roles')->insert( |
38 | 38 | ['user_id' => $id, 'role_id' => Input::get('role')] |
39 | 39 | ); |
40 | - $channelId= Hash::make(Input::get('password')); |
|
40 | + $channelId = Hash::make(Input::get('password')); |
|
41 | 41 | DB::table('channels')->insert( |
42 | 42 | ['channel_name' => $channelId, 'author_id' => $id] |
43 | 43 | ); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $trackers = $this->taskRepository->getTracker(); |
25 | 25 | $status = $this->taskRepository->getStatus(); |
26 | 26 | $priotities = $this->taskRepository->getPriorities(); |
27 | - $data = array("teams" => $teams, "projects" => $projects,"trackers"=>$trackers,"status"=>$status,"priorities"=>$priotities); |
|
27 | + $data = array("teams" => $teams, "projects" => $projects, "trackers"=>$trackers, "status"=>$status, "priorities"=>$priotities); |
|
28 | 28 | |
29 | 29 | return View::make('templates/task/dashboard')->with('data', $data); |
30 | 30 | } |
@@ -56,20 +56,20 @@ discard block |
||
56 | 56 | @return null |
57 | 57 | */ |
58 | 58 | public function get_members() { |
59 | - $enTeamId=Input::get("teamId"); |
|
60 | - $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
|
59 | + $enTeamId = Input::get("teamId"); |
|
60 | + $teamId = $this->teamRepository->getTeamDecodedId($enTeamId); |
|
61 | 61 | $members = $this->teamRepository->getMembers($teamId); |
62 | 62 | /* |
63 | 63 | * Prepare html select options |
64 | 64 | */ |
65 | 65 | |
66 | - $data=''; |
|
67 | - $data.="<option value=''>Select User</option>"; |
|
68 | - foreach($members as $values){ |
|
69 | - $memDetail=explode("_",$values); |
|
70 | - $data.="<option value=".$memDetail[2].">".$memDetail[0]." ".$memDetail[1]."</option>"; |
|
66 | + $data = ''; |
|
67 | + $data .= "<option value=''>Select User</option>"; |
|
68 | + foreach ($members as $values) { |
|
69 | + $memDetail = explode("_", $values); |
|
70 | + $data .= "<option value=".$memDetail[2].">".$memDetail[0]." ".$memDetail[1]."</option>"; |
|
71 | 71 | } |
72 | - return trim($data,'"'); |
|
72 | + return trim($data, '"'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -101,19 +101,19 @@ discard block |
||
101 | 101 | $page = \Input::get('current'); |
102 | 102 | $rowCount = \Input::get('rowCount'); |
103 | 103 | |
104 | - $total=''; |
|
104 | + $total = ''; |
|
105 | 105 | $result = $this->taskRepository->filterGrid(); |
106 | - foreach($result as $values){ |
|
107 | - $rows[]=array('un_id'=>$values['un_id'], |
|
106 | + foreach ($result as $values) { |
|
107 | + $rows[] = array('un_id'=>$values['un_id'], |
|
108 | 108 | 'priority_name'=>$values['priority_name'], |
109 | 109 | 'status_name'=>$values['status_name'], |
110 | 110 | 'tracker'=>$values['tracker'], |
111 | 111 | 'assignee'=>$values['first_name']." ".$values['last_name'], |
112 | 112 | 'created_at'=>$values['created_at'], |
113 | 113 | 'start_date'=>$values['start_date'], |
114 | - 'end_date'=>$values['end_date']) ; |
|
114 | + 'end_date'=>$values['end_date']); |
|
115 | 115 | } |
116 | - $data=array('current'=>$page,'rowCount'=>$rowCount,'rows'=>$rows,'total'=>count($rows)); |
|
116 | + $data = array('current'=>$page, 'rowCount'=>$rowCount, 'rows'=>$rows, 'total'=>count($rows)); |
|
117 | 117 | return json_encode($data); |
118 | 118 | } |
119 | 119 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $priotities = $this->taskRepository->getPriorities(); |
128 | 128 | $taskData = $this->taskRepository->getTaskData(); |
129 | 129 | $members = $this->teamRepository->getMembers($taskData['team_id']); |
130 | - $data = array("trackers"=>$trackers,"status"=>$status,"priorities"=>$priotities,'members'=>$members,'task_data'=>$taskData); |
|
130 | + $data = array("trackers"=>$trackers, "status"=>$status, "priorities"=>$priotities, 'members'=>$members, 'task_data'=>$taskData); |
|
131 | 131 | return View::make('templates/task/create_task_modal')->with('data', $data); |
132 | 132 | } |
133 | 133 | |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | @return html view |
137 | 137 | */ |
138 | 138 | public function recent_updates($parent_task_id) { |
139 | - $result=$this->taskRepository->getUpdates($parent_task_id); |
|
140 | - return View::make('templates/task/recent_task_updates')->with("result",$result); |
|
139 | + $result = $this->taskRepository->getUpdates($parent_task_id); |
|
140 | + return View::make('templates/task/recent_task_updates')->with("result", $result); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | @return html view |
147 | 147 | */ |
148 | 148 | public function get_project_teams() { |
149 | - $result=$this->taskRepository->getProjectTeams(Input::get('projectId')); |
|
150 | - $data=''; |
|
151 | - $data.="<option value=''>Select Team</option>"; |
|
152 | - foreach($result as $teamDetail){ |
|
149 | + $result = $this->taskRepository->getProjectTeams(Input::get('projectId')); |
|
150 | + $data = ''; |
|
151 | + $data .= "<option value=''>Select Team</option>"; |
|
152 | + foreach ($result as $teamDetail) { |
|
153 | 153 | |
154 | - $data.="<option value=".$teamDetail['team_channel_id'].">".$teamDetail['channel_view_name']."</option>"; |
|
154 | + $data .= "<option value=".$teamDetail['team_channel_id'].">".$teamDetail['channel_view_name']."</option>"; |
|
155 | 155 | } |
156 | - return trim($data,'"'); |
|
156 | + return trim($data, '"'); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | \ No newline at end of file |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | * @return Response |
9 | 9 | */ |
10 | 10 | public function index() { |
11 | -$message='typing'; |
|
11 | +$message = 'typing'; |
|
12 | 12 | $data = array( |
13 | 13 | 'room' => Input::get('conversation'), |
14 | - 'message' => array( 'body' => Str::words($message, 5), 'user_id' => '') |
|
14 | + 'message' => array('body' => Str::words($message, 5), 'user_id' => '') |
|
15 | 15 | ); |
16 | 16 | |
17 | 17 | Event::fire(ChatMessagesEventHandler::EVENT, array(json_encode($data))); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $rules = array('body' => 'required'); |
33 | 33 | $validator = Validator::make(Input::all(), $rules); |
34 | 34 | |
35 | - if($validator->fails()) { |
|
35 | + if ($validator->fails()) { |
|
36 | 36 | return Response::json([ |
37 | 37 | 'success' => false, |
38 | 38 | 'result' => $validator->messages() |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Create Message Notifications |
54 | 54 | $messages_notifications = array(); |
55 | 55 | |
56 | - foreach($conversation->users()->get() as $user) { |
|
56 | + foreach ($conversation->users()->get() as $user) { |
|
57 | 57 | array_push($messages_notifications, new MessageNotification(array('user_id' => $user->id, 'conversation_id' => $conversation->id, 'read' => false))); |
58 | 58 | } |
59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | // Publish Data To Redis |
63 | 63 | $data = array( |
64 | 64 | 'room' => Input::get('conversation'), |
65 | - 'message' => array( 'body' => Str::words($message->body, 5), 'user_id' => Input::get('user_id')) |
|
65 | + 'message' => array('body' => Str::words($message->body, 5), 'user_id' => Input::get('user_id')) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | Event::fire(ChatMessagesEventHandler::EVENT, array(json_encode($data))); |