@@ -37,27 +37,27 @@ discard block |
||
37 | 37 | $countUnreadMessages = DB::table('personal_conversations') |
38 | 38 | ->select(DB::raw('count(read_status) as unread_count')) |
39 | 39 | |
40 | - ->where('read_status','=',1) |
|
41 | - ->where('to_user_id','=',Auth::user()->id)->first(); |
|
40 | + ->where('read_status', '=', 1) |
|
41 | + ->where('to_user_id', '=', Auth::user()->id)->first(); |
|
42 | 42 | |
43 | 43 | $countUnreadGeneralMessages = DB::table('team_conversations_read_status') |
44 | 44 | ->select(DB::raw('count(read_status) as unread_count')) |
45 | 45 | |
46 | - ->where('read_status','=',1) |
|
47 | - ->where('user_id','=',Auth::user()->id)->first(); |
|
46 | + ->where('read_status', '=', 1) |
|
47 | + ->where('user_id', '=', Auth::user()->id)->first(); |
|
48 | 48 | |
49 | 49 | $countUnreadJoinMessages = DB::table('invitation_notification') |
50 | 50 | ->select(DB::raw('count(read_status) as unread_count')) |
51 | 51 | |
52 | - ->where('read_status','=',1) |
|
52 | + ->where('read_status', '=', 1) |
|
53 | 53 | |
54 | 54 | ->where('invitation_notification.new_user', '!=', Auth::user()->id) |
55 | - ->where('team_user','=',Auth::user()->id)->first(); |
|
55 | + ->where('team_user', '=', Auth::user()->id)->first(); |
|
56 | 56 | /* |
57 | 57 | * pass each notifcation count in array |
58 | 58 | */ |
59 | 59 | |
60 | - $data=array( |
|
60 | + $data = array( |
|
61 | 61 | |
62 | 62 | "unreadMessageCount"=>$countUnreadMessages["unread_count"], |
63 | 63 | "userDetailsArray"=>$userDetailsArray, |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | "unreadJoinMessageCount"=>$countUnreadJoinMessages["unread_count"], |
66 | 66 | |
67 | 67 | ); |
68 | - return View::make('templates/home')->with("data",$data); |
|
68 | + return View::make('templates/home')->with("data", $data); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function index() { |
11 | 11 | |
12 | 12 | $conversation = Conversation::where('name', Input::get('conversation'))->first(); |
13 | - $messages = Message::where('conversation_id', $conversation->id)->orderBy('created_at')->get(); |
|
13 | + $messages = Message::where('conversation_id', $conversation->id)->orderBy('created_at')->get(); |
|
14 | 14 | |
15 | 15 | return View::make('templates/messages')->with('messages', $messages)->render(); |
16 | 16 | } |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | * @return Response |
22 | 22 | */ |
23 | 23 | public function send_message() { |
24 | - $isPersonalSet=Input::get('isPersonalFlag'); |
|
24 | + $isPersonalSet = Input::get('isPersonalFlag'); |
|
25 | 25 | $rules = array('body' => 'required'); |
26 | 26 | $validator = Validator::make(Input::all(), $rules); |
27 | 27 | |
28 | - if($validator->fails()) { |
|
28 | + if ($validator->fails()) { |
|
29 | 29 | return Response::json([ |
30 | 30 | 'success' => false, |
31 | 31 | 'result' => $validator->messages() |
@@ -47,46 +47,46 @@ discard block |
||
47 | 47 | * Get the id of the last inserted message |
48 | 48 | */ |
49 | 49 | if (strpos(Input::get('body'), '<img') !== false) { |
50 | - $lastId= DB::table('messages')->insertGetId( |
|
51 | - ['message' => strip_tags( Input::get('body'),'<img></img><img /><p></p><br/><br><span></span></code><code><table><td></td><tr></tr><a></a>')] |
|
50 | + $lastId = DB::table('messages')->insertGetId( |
|
51 | + ['message' => strip_tags(Input::get('body'), '<img></img><img /><p></p><br/><br><span></span></code><code><table><td></td><tr></tr><a></a>')] |
|
52 | 52 | ); |
53 | 53 | } |
54 | - else{ |
|
55 | - $lastId= DB::table('messages')->insertGetId( |
|
56 | - ['message' => strip_tags(preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>', Input::get('body')),'<img></img><img /><p></p><br/><br><span></span></code><code><table><td></td><tr></tr><a></a>')] |
|
57 | - );} |
|
54 | + else { |
|
55 | + $lastId = DB::table('messages')->insertGetId( |
|
56 | + ['message' => strip_tags(preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i", '<$1$2>', Input::get('body')), '<img></img><img /><p></p><br/><br><span></span></code><code><table><td></td><tr></tr><a></a>')] |
|
57 | + ); } |
|
58 | 58 | |
59 | 59 | |
60 | 60 | /** |
61 | 61 | * if personal flag is set to true insert into personal conversations |
62 | 62 | * |
63 | 63 | */ |
64 | - if($isPersonalSet){ |
|
65 | - $teamChannelId=explode("_",Input::get('channelId')); |
|
64 | + if ($isPersonalSet) { |
|
65 | + $teamChannelId = explode("_", Input::get('channelId')); |
|
66 | 66 | |
67 | 67 | DB::table('personal_conversations')->insert( |
68 | - ['team_channel_id' => $teamChannelId[1], 'to_user_id' => Input::get('toUserId'),'from_user_id' => Auth::user()->id,'message_id' => $lastId,'read_status'=>1] |
|
68 | + ['team_channel_id' => $teamChannelId[1], 'to_user_id' => Input::get('toUserId'), 'from_user_id' => Auth::user()->id, 'message_id' => $lastId, 'read_status'=>1] |
|
69 | 69 | ); |
70 | 70 | } |
71 | - else{ |
|
71 | + else { |
|
72 | 72 | DB::table('team_conversations')->insert( |
73 | - ['team_channel_id' => Input::get('channelId'), 'user_id' => Input::get('userId'),'message_id' => $lastId] |
|
73 | + ['team_channel_id' => Input::get('channelId'), 'user_id' => Input::get('userId'), 'message_id' => $lastId] |
|
74 | 74 | ); |
75 | - $this->insertIntoTeamConversationReadStatus(Input::get('channelId'),$lastId); |
|
75 | + $this->insertIntoTeamConversationReadStatus(Input::get('channelId'), $lastId); |
|
76 | 76 | } |
77 | 77 | // Publish Data To Redis |
78 | 78 | |
79 | - if($isPersonalSet){ |
|
79 | + if ($isPersonalSet) { |
|
80 | 80 | $data = array( |
81 | 81 | 'room' => Input::get('channelId'), |
82 | - 'message' => array( 'body' => Input::get('body'),'to_channel_id'=>Auth::user()->id."_".$teamChannelId[1], 'user_id' => Auth::user()->id,'first_name'=> Session::get('firstName'),'last_name'=> Session::get('lastName'),'profile_pic'=> Session::get('profilePic'),'message_id'=>$lastId ,'to_user_id'=>Input::get('toUserId')) |
|
82 | + 'message' => array('body' => Input::get('body'), 'to_channel_id'=>Auth::user()->id."_".$teamChannelId[1], 'user_id' => Auth::user()->id, 'first_name'=> Session::get('firstName'), 'last_name'=> Session::get('lastName'), 'profile_pic'=> Session::get('profilePic'), 'message_id'=>$lastId, 'to_user_id'=>Input::get('toUserId')) |
|
83 | 83 | ); |
84 | 84 | Event::fire(ChatMessagesEventHandler::EVENT, array(json_encode($data))); |
85 | 85 | } |
86 | - else{ |
|
86 | + else { |
|
87 | 87 | $data = array( |
88 | 88 | 'room' => Input::get('channelId'), |
89 | - 'message' => array( 'body' => Input::get('body'), 'user_id' => Input::get('userId'),'first_name'=> Session::get('firstName'),'last_name'=> Session::get('lastName'),'profile_pic'=> Session::get('profilePic'),'team_encoded_id'=> Input::get('channelId'),'team_decoded_id'=> $team_decoded_id['id'],'message_id'=>$lastId) |
|
89 | + 'message' => array('body' => Input::get('body'), 'user_id' => Input::get('userId'), 'first_name'=> Session::get('firstName'), 'last_name'=> Session::get('lastName'), 'profile_pic'=> Session::get('profilePic'), 'team_encoded_id'=> Input::get('channelId'), 'team_decoded_id'=> $team_decoded_id['id'], 'message_id'=>$lastId) |
|
90 | 90 | ); |
91 | 91 | Event::fire(ChatConversationsEventHandler::EVENT, array(json_encode($data))); |
92 | 92 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ]); |
98 | 98 | } |
99 | 99 | |
100 | - function insertIntoTeamConversationReadStatus($channelId,$messageId){ |
|
100 | + function insertIntoTeamConversationReadStatus($channelId, $messageId) { |
|
101 | 101 | |
102 | 102 | $teamId = DB::table('team_channels') |
103 | 103 | ->select('id') |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | if ($memeber['id'] != Session::get('userId')) |
116 | 116 | DB::table('team_conversations_read_status')->insert( |
117 | - ['team_channel_id' => $teamId['id'], 'message_id' => $messageId,'user_id' => $memeber['id']] |
|
117 | + ['team_channel_id' => $teamId['id'], 'message_id' => $messageId, 'user_id' => $memeber['id']] |
|
118 | 118 | ); |
119 | 119 | } |
120 | 120 | } |
@@ -12,17 +12,17 @@ discard block |
||
12 | 12 | |
13 | 13 | switch ($name) { |
14 | 14 | case "chat":$folderName = "userUploads"; |
15 | - $this->validateAndUpload($folderName,false);//set true for db operations,else false |
|
15 | + $this->validateAndUpload($folderName, false); //set true for db operations,else false |
|
16 | 16 | break; |
17 | 17 | |
18 | 18 | case "task":$folderName = "userTaskFiles"; |
19 | - $this->validateAndUpload($folderName,true); |
|
19 | + $this->validateAndUpload($folderName, true); |
|
20 | 20 | break; |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | - function validateAndUpload($folderName,$dbSave) { |
|
25 | + function validateAndUpload($folderName, $dbSave) { |
|
26 | 26 | $successStatus; |
27 | 27 | $fileErr; |
28 | 28 | // Build the input for our validation |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | $file = Input::file('file'); |
42 | 42 | foreach ($file as $files) { |
43 | 43 | |
44 | - $upload_success = $files->move('fusionmate/public/plugins/' . $folderName . '', $files->getClientOriginalName()); |
|
44 | + $upload_success = $files->move('fusionmate/public/plugins/'.$folderName.'', $files->getClientOriginalName()); |
|
45 | 45 | |
46 | 46 | $imgPath = $files->getClientOriginalName(); |
47 | 47 | |
48 | 48 | if ($upload_success) { |
49 | - if($dbSave){ |
|
49 | + if ($dbSave) { |
|
50 | 50 | $this->taskRepository->saveTaskFiles($imgPath); |
51 | 51 | } |
52 | 52 | $fileErr = false; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $fileErr = true; |
56 | 56 | } |
57 | 57 | } |
58 | - if (!$fileErr) { |
|
58 | + if ( ! $fileErr) { |
|
59 | 59 | |
60 | 60 | $successStatus = Response::json('success', 200); |
61 | 61 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | //Make admin as default team head |
42 | 42 | \DB::table('team_heads')->insertGetId( |
43 | - [ "team_id" => $id, 'author_id' => \Session::get("userId"), "user_id" =>\Session::get("userId")] |
|
43 | + ["team_id" => $id, 'author_id' => \Session::get("userId"), "user_id" =>\Session::get("userId")] |
|
44 | 44 | ); |
45 | 45 | $data = array("create_team" => true, "message" => "Team Created Succesfully.", "teamId" => $id); |
46 | 46 | return View::make('templates/greeting')->with('data', $data); |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $channelId = Input::get('channelId'); |
54 | 54 | if (Session::get("role") == 1) { |
55 | 55 | $teams = DB::table('channels') |
56 | - ->select('team_channels.id','team_channels.team_channel_id', 'channels.channel_name', 'team_channels.channel_view_name', 'channels.author_id', "team_channels.created_at",'team_heads.author_id','team_heads.user_id as team_head_id') |
|
56 | + ->select('team_channels.id', 'team_channels.team_channel_id', 'channels.channel_name', 'team_channels.channel_view_name', 'channels.author_id', "team_channels.created_at", 'team_heads.author_id', 'team_heads.user_id as team_head_id') |
|
57 | 57 | ->leftJoin('team_channels', 'channels.id', '=', 'team_channels.channel_name_id') |
58 | 58 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
59 | 59 | ->where('team_channels.id', '!=', '') |
60 | 60 | ->where('channels.id', '=', $channelId)->distinct()->get(); |
61 | 61 | } else { |
62 | 62 | $teams = DB::table('team_channels') |
63 | - ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at','team_heads.author_id','team_heads.user_id as team_head_id') |
|
63 | + ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at', 'team_heads.author_id', 'team_heads.user_id as team_head_id') |
|
64 | 64 | ->leftJoin('team_channel_users', 'team_channel_users.team_channel_name_id', '=', 'team_channels.id') |
65 | 65 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
66 | 66 | ->where('team_channel_users.user_id', '=', Auth::user()->id)->distinct()->get(); |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | ['team_channel_name_id' => $teamId, 'user_id' => $userId['id']] |
104 | 104 | ); |
105 | 105 | |
106 | - $this->teamRepository->updateNewMemberJoinNotification($teamId,$userId['id']); |
|
106 | + $this->teamRepository->updateNewMemberJoinNotification($teamId, $userId['id']); |
|
107 | 107 | } else { |
108 | 108 | $failCheck = true; |
109 | - $failedEmail.=$email; |
|
109 | + $failedEmail .= $email; |
|
110 | 110 | } |
111 | 111 | } else { |
112 | 112 | /* new user,trigger email |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $token = Crypt::encrypt(time()); |
118 | 118 | ; |
119 | - $url = Config::get('constants.constants_list.BASE_URL') . "invitation/" . $token; |
|
119 | + $url = Config::get('constants.constants_list.BASE_URL')."invitation/".$token; |
|
120 | 120 | $data = array("teamId" => $teamId, "email" => $email, "url" => $url, "token" => $token); |
121 | 121 | |
122 | 122 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return "There was an error in sending email to one of the recipients"; |
130 | 130 | } else { |
131 | 131 | DB::table('invitation_token')->insert( |
132 | - ['token' => $data['token'],'team_id'=>$data['teamId'],'email'=>$data['email']] |
|
132 | + ['token' => $data['token'], 'team_id'=>$data['teamId'], 'email'=>$data['email']] |
|
133 | 133 | ); |
134 | 134 | } |
135 | 135 | }); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if ($failCheck != true) |
140 | 140 | return View::make('templates/greeting')->with('message', "Invited Successfully!"); |
141 | 141 | else |
142 | - return View::make('templates/greeting')->with('danger', "Email already exists." . ":" . $failedEmail); |
|
142 | + return View::make('templates/greeting')->with('danger', "Email already exists.".":".$failedEmail); |
|
143 | 143 | // Create a random 'pass' and send invitation via mail |
144 | 144 | // $id = DB::table('users')->insertGetId( |
145 | 145 | // ['first_name' => Input::get('email'),'last_name' => Input::get('email'),'email' => Input::get('email'), 'password' => Hash::make(Input::get('email'))] |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | */ |
185 | 185 | $status = DB::table('login_status')->select('status')->where('user_id', $memeber["id"])->first(); |
186 | - $teamArr[$values["channel_view_name"] . "_" . $values["team_channel_id"]."_".$values["id"]][] = $memeber["first_name"] . "_" . $memeber["id"] . "_" . $status['status']; |
|
186 | + $teamArr[$values["channel_view_name"]."_".$values["team_channel_id"]."_".$values["id"]][] = $memeber["first_name"]."_".$memeber["id"]."_".$status['status']; |
|
187 | 187 | // } |
188 | 188 | } |
189 | 189 | } |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | */ |
214 | 214 | $status = DB::table('login_status')->select('status')->where('user_id', $memeber["id"])->first(); |
215 | 215 | if ($memeber['id'] != Session::get('userId')) |
216 | - $teamArr[] = $memeber["first_name"] . "_" . $memeber["last_name"] . "_" . $memeber["id"] . "_" . $status['status']; |
|
216 | + $teamArr[] = $memeber["first_name"]."_".$memeber["last_name"]."_".$memeber["id"]."_".$status['status']; |
|
217 | 217 | } |
218 | 218 | return View::make('templates/list_members')->with('members', $teamArr); |
219 | 219 | } |
220 | 220 | |
221 | - function activate_invited_member( $token) { |
|
221 | + function activate_invited_member($token) { |
|
222 | 222 | //Validate token for security reasons |
223 | 223 | $isValidToken = DB::table('invitation_token') |
224 | 224 | ->select('token') |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | //Team Name |
227 | 227 | |
228 | 228 | if (count($isValidToken) > 0) { |
229 | - $invitationDetails= DB::table('invitation_token') |
|
230 | - ->select('team_id','email') |
|
229 | + $invitationDetails = DB::table('invitation_token') |
|
230 | + ->select('team_id', 'email') |
|
231 | 231 | ->where('token', '=', $token)->first(); |
232 | 232 | |
233 | 233 | $teamName = DB::table('team_channels') |
@@ -239,20 +239,20 @@ discard block |
||
239 | 239 | else |
240 | 240 | return "your not authorized to access this page"; |
241 | 241 | } |
242 | -function deleteTeam(){ |
|
243 | - $enTeamId=Input::get("teamId"); |
|
244 | - $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
|
242 | +function deleteTeam() { |
|
243 | + $enTeamId = Input::get("teamId"); |
|
244 | + $teamId = $this->teamRepository->getTeamDecodedId($enTeamId); |
|
245 | 245 | DB::table('team_conversations_read_status')->where('team_channel_id', $teamId)->delete(); |
246 | 246 | DB::table('team_conversations')->where('team_channel_id', $teamId)->delete(); |
247 | 247 | DB::table('team_channel_users')->where('team_channel_name_id', $teamId)->delete(); |
248 | - $status= DB::table('team_channels')->where('id', $teamId)->delete(); |
|
248 | + $status = DB::table('team_channels')->where('id', $teamId)->delete(); |
|
249 | 249 | return json_encode($status); |
250 | 250 | } |
251 | 251 | |
252 | 252 | public function list_teams_memebers() { |
253 | 253 | |
254 | - $offlineSort=array(); |
|
255 | - $onlineSort=array(); |
|
254 | + $offlineSort = array(); |
|
255 | + $onlineSort = array(); |
|
256 | 256 | /** |
257 | 257 | * |
258 | 258 | * Get all team details where the user is a memeber |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | foreach ($teamName as $values) { |
275 | 275 | |
276 | 276 | $teamMembers = DB::table('users') |
277 | - ->select('users.first_name','users.last_name', 'users.id','users.profile_pic','team_channels.channel_view_name','team_channels.id as team_id') |
|
277 | + ->select('users.first_name', 'users.last_name', 'users.id', 'users.profile_pic', 'team_channels.channel_view_name', 'team_channels.id as team_id') |
|
278 | 278 | ->leftJoin('team_channel_users', 'team_channel_users.user_id', '=', 'users.id') |
279 | 279 | ->leftJoin('team_channels', 'team_channels.id', '=', 'team_channel_users.team_channel_name_id') |
280 | 280 | ->where('team_channel_users.team_channel_name_id', '=', $values["id"])->get(); |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | * left join `team_channels` on `team_channels`.`id` = `team_channel_users`.`team_channel_name_id` |
286 | 286 | */ |
287 | 287 | $status = DB::table('login_status')->select('status')->where('user_id', $memeber["id"])->first(); |
288 | - $memeber['status']=$status; |
|
289 | - if($status['status']=="offline") |
|
290 | - $offlineSort[]=$memeber; |
|
288 | + $memeber['status'] = $status; |
|
289 | + if ($status['status'] == "offline") |
|
290 | + $offlineSort[] = $memeber; |
|
291 | 291 | else |
292 | - $onlineSort[]=$memeber; |
|
292 | + $onlineSort[] = $memeber; |
|
293 | 293 | |
294 | - if(count($onlineSort)==0)//if there are no online users do not merge |
|
295 | - $data[]=$memeber; |
|
294 | + if (count($onlineSort) == 0)//if there are no online users do not merge |
|
295 | + $data[] = $memeber; |
|
296 | 296 | |
297 | 297 | } |
298 | 298 | |
@@ -301,31 +301,31 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | |
304 | - if(count($onlineSort)>0){// if online users are there pass merged data else pass non merged data |
|
304 | + if (count($onlineSort) > 0) {// if online users are there pass merged data else pass non merged data |
|
305 | 305 | |
306 | - return View::make('templates/team_members')->with('data', array_merge($onlineSort,$offlineSort)); |
|
306 | + return View::make('templates/team_members')->with('data', array_merge($onlineSort, $offlineSort)); |
|
307 | 307 | } |
308 | 308 | else |
309 | - return View::make('templates/team_members')->with('data',$data ); |
|
309 | + return View::make('templates/team_members')->with('data', $data); |
|
310 | 310 | } |
311 | 311 | |
312 | - public function get_team_name(){ |
|
313 | - $enTeamId=Input::get("teamId"); |
|
314 | - $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
|
312 | + public function get_team_name() { |
|
313 | + $enTeamId = Input::get("teamId"); |
|
314 | + $teamId = $this->teamRepository->getTeamDecodedId($enTeamId); |
|
315 | 315 | $data = $this->teamRepository->getTeamName($teamId); |
316 | 316 | return $data; |
317 | 317 | } |
318 | 318 | |
319 | - public function update_team_name(){ |
|
320 | - $enTeamId=Input::get("teamId"); |
|
321 | - $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
|
319 | + public function update_team_name() { |
|
320 | + $enTeamId = Input::get("teamId"); |
|
321 | + $teamId = $this->teamRepository->getTeamDecodedId($enTeamId); |
|
322 | 322 | $data = $this->teamRepository->updateTeamName($teamId); |
323 | 323 | return $data; |
324 | 324 | } |
325 | 325 | |
326 | - public function update_team_head(){ |
|
327 | - $enTeamId=Input::get("teamId"); |
|
328 | - $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
|
326 | + public function update_team_head() { |
|
327 | + $enTeamId = Input::get("teamId"); |
|
328 | + $teamId = $this->teamRepository->getTeamDecodedId($enTeamId); |
|
329 | 329 | $data = $this->teamRepository->updateTeamHead($teamId); |
330 | 330 | return $data; |
331 | 331 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | public function drive() |
11 | 11 | { |
12 | - $output= exec("ls -l"); |
|
12 | + $output = exec("ls -l"); |
|
13 | 13 | echo $output; |
14 | 14 | exit; |
15 | 15 | $url_array = explode('?', 'http://'.$_SERVER ['HTTP_HOST'].$_SERVER['REQUEST_URI']); |
@@ -27,17 +27,17 @@ discard block |
||
27 | 27 | //echo Session::get('code'); |
28 | 28 | //exit; |
29 | 29 | |
30 | -if (Session::get('code')!='') { |
|
30 | +if (Session::get('code') != '') { |
|
31 | 31 | $_SESSION['accessToken'] = $client->authenticate($_GET['code']); |
32 | 32 | header('location:'.$url); |
33 | -} elseif (Session::get('accessToken')!='') { |
|
33 | +} elseif (Session::get('accessToken') != '') { |
|
34 | 34 | $client->authenticate(); |
35 | 35 | |
36 | 36 | |
37 | 37 | } |
38 | 38 | //echo Session::get('accessToken'); |
39 | 39 | // exit; |
40 | -$files= array(); |
|
40 | +$files = array(); |
|
41 | 41 | $dir = dir('fusionmate/files'); |
42 | 42 | while ($file = $dir->read()) { |
43 | 43 | if ($file != '.' && $file != '..') { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $file->setTitle($file_name); |
57 | 57 | $file->setDescription('This is a '.$mime_type.' document'); |
58 | 58 | $file->setMimeType($mime_type); |
59 | - $a= $service->files->insert( |
|
59 | + $a = $service->files->insert( |
|
60 | 60 | $file, |
61 | 61 | array( |
62 | 62 | 'data' => file_get_contents($file_path), |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | use LaravelRealtimeChat\Repositories\Team\DbTeamRepository; |
8 | -class SecurityHelper { |
|
8 | +class SecurityHelper { |
|
9 | 9 | |
10 | 10 | |
11 | 11 | public static function authorizeWrite($type) { |
@@ -23,16 +23,16 @@ discard block |
||
23 | 23 | * Cross check |
24 | 24 | */ |
25 | 25 | $teamRepository = new DbTeamRepository(); |
26 | - $teamId= \Input::get("teamId"); |
|
26 | + $teamId = \Input::get("teamId"); |
|
27 | 27 | $id = $teamRepository->getTeamDecodedId($teamId); |
28 | - $teamId=$id; |
|
29 | - $projectId=\Input::get("projectId"); |
|
28 | + $teamId = $id; |
|
29 | + $projectId = \Input::get("projectId"); |
|
30 | 30 | $user_id = \DB::table('team_heads') |
31 | 31 | ->select('user_id') |
32 | 32 | ->where('team_heads.team_id', '=', $teamId) |
33 | 33 | ->where('team_heads.project_id', '=', $projectId) |
34 | 34 | ->first(); |
35 | - if($user_id['user_id']==\Session::get('userId')) |
|
35 | + if ($user_id['user_id'] == \Session::get('userId')) |
|
36 | 36 | return "allowed"; |
37 | 37 | else |
38 | 38 | return "notAllowed"; |
@@ -24,17 +24,17 @@ discard block |
||
24 | 24 | function toDateTime($timesTamp) { |
25 | 25 | |
26 | 26 | $tzName = Session::get('tzName'); |
27 | - if($tzName!='Asia/Kolkata'){ |
|
27 | + if ($tzName != 'Asia/Kolkata') { |
|
28 | 28 | $tz = new DateTimeZone(trim($tzName)); |
29 | 29 | |
30 | 30 | $date = new DateTime($timesTamp); |
31 | 31 | $date->setTimezone($tz); |
32 | - $dateTime=$date->format('F jS, Y h:m:s A'); |
|
32 | + $dateTime = $date->format('F jS, Y h:m:s A'); |
|
33 | 33 | return $dateTime; |
34 | 34 | } |
35 | - else{ |
|
35 | + else { |
|
36 | 36 | $date = new DateTime($timesTamp); |
37 | - $dateTime= $date->format('F jS, Y h:m:s A'); |
|
37 | + $dateTime = $date->format('F jS, Y h:m:s A'); |
|
38 | 38 | return $dateTime; |
39 | 39 | } |
40 | 40 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @return string unique id |
48 | 48 | */ |
49 | 49 | |
50 | -function generateId(){ |
|
50 | +function generateId() { |
|
51 | 51 | $date = date_create(); |
52 | - $id=md5(date_timestamp_get($date)); |
|
52 | + $id = md5(date_timestamp_get($date)); |
|
53 | 53 | return $id; |
54 | 54 | |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php namespace LaravelRealtimeChat\Repositories\Task; |
2 | 2 | |
3 | -interface TaskRepository { |
|
3 | +interface TaskRepository { |
|
4 | 4 | |
5 | 5 | |
6 | 6 | public function createProject(); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | foreach ($files as $file_name) { |
304 | 304 | $result['file_name'][] = $file_name['file_name']; |
305 | 305 | } |
306 | - $row=$result; |
|
306 | + $row = $result; |
|
307 | 307 | |
308 | 308 | return $row; |
309 | 309 | } |
@@ -343,16 +343,16 @@ discard block |
||
343 | 343 | foreach ($files as $file_name) { |
344 | 344 | $values['file_name'][] = $file_name['file_name']; |
345 | 345 | } |
346 | - $row[]=$values; |
|
346 | + $row[] = $values; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | |
350 | 350 | return $row; |
351 | 351 | } |
352 | 352 | |
353 | - function getProjectTeams($id){ |
|
353 | + function getProjectTeams($id) { |
|
354 | 354 | $teams = \DB::table('team_channels') |
355 | - ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at','team_heads.user_id') |
|
355 | + ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at', 'team_heads.user_id') |
|
356 | 356 | ->leftJoin('team_channel_users', 'team_channel_users.team_channel_name_id', '=', 'team_channels.id') |
357 | 357 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
358 | 358 | ->where('team_heads.project_id', '=', $id) |