@@ -60,8 +60,7 @@ 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 | + );} else{ |
|
| 65 | 64 | $rules = array( |
| 66 | 65 | 'email' => 'required|email', |
| 67 | 66 | 'password' => 'required' |
@@ -101,8 +100,7 @@ discard block |
||
| 101 | 100 | //delete token from database before creating invited account |
| 102 | 101 | DB::table('invitation_token')->where('token', '=', $token)->delete(); |
| 103 | 102 | $this->teamRepository->updateNewMemberJoinNotification($result['team_id'],$id); |
| 104 | - } |
|
| 105 | - else{ |
|
| 103 | + } else{ |
|
| 106 | 104 | return Response::json(array( |
| 107 | 105 | 'success' => false, |
| 108 | 106 | 'errors' => "Invalid Request", |
@@ -133,8 +131,7 @@ discard block |
||
| 133 | 131 | return Response::json(array( |
| 134 | 132 | 'success' => true |
| 135 | 133 | ), 200); |
| 136 | - } |
|
| 137 | - else{ |
|
| 134 | + } else{ |
|
| 138 | 135 | $errorMsg = array( |
| 139 | 136 | 'errormsg' => 'Invalid Email or Password' |
| 140 | 137 | ); |
@@ -42,7 +42,9 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function getReset($token = null) |
| 44 | 44 | { |
| 45 | - if (is_null($token)) App::abort(404); |
|
| 45 | + if (is_null($token)) { |
|
| 46 | + App::abort(404); |
|
| 47 | + } |
|
| 46 | 48 | |
| 47 | 49 | return View::make('templates/password_reset/reset')->with('token', $token); |
| 48 | 50 | } |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | $lastId= DB::table('messages')->insertGetId( |
| 51 | 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 | - } |
|
| 54 | - else{ |
|
| 53 | + } else{ |
|
| 55 | 54 | $lastId= DB::table('messages')->insertGetId( |
| 56 | 55 | ['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 | 56 | );} |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | DB::table('personal_conversations')->insert( |
| 68 | 67 | ['team_channel_id' => $teamChannelId[1], 'to_user_id' => Input::get('toUserId'),'from_user_id' => Auth::user()->id,'message_id' => $lastId,'read_status'=>1] |
| 69 | 68 | ); |
| 70 | - } |
|
| 71 | - else{ |
|
| 69 | + } else{ |
|
| 72 | 70 | DB::table('team_conversations')->insert( |
| 73 | 71 | ['team_channel_id' => Input::get('channelId'), 'user_id' => Input::get('userId'),'message_id' => $lastId] |
| 74 | 72 | ); |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | '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 | 81 | ); |
| 84 | 82 | Event::fire(ChatMessagesEventHandler::EVENT, array(json_encode($data))); |
| 85 | - } |
|
| 86 | - else{ |
|
| 83 | + } else{ |
|
| 87 | 84 | $data = array( |
| 88 | 85 | 'room' => Input::get('channelId'), |
| 89 | 86 | '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) |
@@ -112,10 +109,11 @@ discard block |
||
| 112 | 109 | foreach ($teamMembers as $memeber) { |
| 113 | 110 | |
| 114 | 111 | |
| 115 | - if ($memeber['id'] != Session::get('userId')) |
|
| 116 | - DB::table('team_conversations_read_status')->insert( |
|
| 112 | + if ($memeber['id'] != Session::get('userId')) { |
|
| 113 | + DB::table('team_conversations_read_status')->insert( |
|
| 117 | 114 | ['team_channel_id' => $teamId['id'], 'message_id' => $messageId,'user_id' => $memeber['id']] |
| 118 | 115 | ); |
| 116 | + } |
|
| 119 | 117 | } |
| 120 | 118 | } |
| 121 | 119 | } |
@@ -50,16 +50,14 @@ |
||
| 50 | 50 | $this->taskRepository->saveTaskFiles($imgPath); |
| 51 | 51 | } |
| 52 | 52 | $fileErr = false; |
| 53 | - } |
|
| 54 | - else { |
|
| 53 | + } else { |
|
| 55 | 54 | $fileErr = true; |
| 56 | 55 | } |
| 57 | 56 | } |
| 58 | 57 | if (!$fileErr) { |
| 59 | 58 | |
| 60 | 59 | $successStatus = Response::json('success', 200); |
| 61 | - } |
|
| 62 | - else { |
|
| 60 | + } else { |
|
| 63 | 61 | $successStatus = Response::json('error', 400); |
| 64 | 62 | } |
| 65 | 63 | return $successStatus; |
@@ -21,9 +21,10 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function create_team_channels() { |
| 23 | 23 | $teamName = Input::get('name'); |
| 24 | - if ($teamName == '') |
|
| 25 | - return View::make('templates/greeting')->with('danger', "Please provide a team name!"); |
|
| 26 | -//Check for duplicates |
|
| 24 | + if ($teamName == '') { |
|
| 25 | + return View::make('templates/greeting')->with('danger', "Please provide a team name!"); |
|
| 26 | + } |
|
| 27 | + //Check for duplicates |
|
| 27 | 28 | $exists = DB::table('team_channels') |
| 28 | 29 | ->select('channel_view_name') |
| 29 | 30 | ->where('channel_view_name', '=', $teamName) |
@@ -136,11 +137,12 @@ discard block |
||
| 136 | 137 | } |
| 137 | 138 | } |
| 138 | 139 | |
| 139 | - if ($failCheck != true) |
|
| 140 | - return View::make('templates/greeting')->with('message', "Invited Successfully!"); |
|
| 141 | - else |
|
| 142 | - return View::make('templates/greeting')->with('danger', "Email already exists." . ":" . $failedEmail); |
|
| 143 | -// Create a random 'pass' and send invitation via mail |
|
| 140 | + if ($failCheck != true) { |
|
| 141 | + return View::make('templates/greeting')->with('message', "Invited Successfully!"); |
|
| 142 | + } else { |
|
| 143 | + return View::make('templates/greeting')->with('danger', "Email already exists." . ":" . $failedEmail); |
|
| 144 | + } |
|
| 145 | + // Create a random 'pass' and send invitation via mail |
|
| 144 | 146 | // $id = DB::table('users')->insertGetId( |
| 145 | 147 | // ['first_name' => Input::get('email'),'last_name' => Input::get('email'),'email' => Input::get('email'), 'password' => Hash::make(Input::get('email'))] |
| 146 | 148 | // ); |
@@ -212,8 +214,9 @@ discard block |
||
| 212 | 214 | * |
| 213 | 215 | */ |
| 214 | 216 | $status = DB::table('login_status')->select('status')->where('user_id', $memeber["id"])->first(); |
| 215 | - if ($memeber['id'] != Session::get('userId')) |
|
| 216 | - $teamArr[] = $memeber["first_name"] . "_" . $memeber["last_name"] . "_" . $memeber["id"] . "_" . $status['status']; |
|
| 217 | + if ($memeber['id'] != Session::get('userId')) { |
|
| 218 | + $teamArr[] = $memeber["first_name"] . "_" . $memeber["last_name"] . "_" . $memeber["id"] . "_" . $status['status']; |
|
| 219 | + } |
|
| 217 | 220 | } |
| 218 | 221 | return View::make('templates/list_members')->with('members', $teamArr); |
| 219 | 222 | } |
@@ -235,9 +238,9 @@ discard block |
||
| 235 | 238 | ->where('id', '=', $invitationDetails['team_id'])->first(); |
| 236 | 239 | $data = array("teamName" => $teamName['channel_view_name'], "email" => $invitationDetails['email'], "token" => $token, "teamId" => $invitationDetails['team_id']); |
| 237 | 240 | return View::make('layouts/invitation_view')->with('data', $data); |
| 241 | + } else { |
|
| 242 | + return "your not authorized to access this page"; |
|
| 238 | 243 | } |
| 239 | - else |
|
| 240 | - return "your not authorized to access this page"; |
|
| 241 | 244 | } |
| 242 | 245 | function deleteTeam(){ |
| 243 | 246 | $enTeamId=Input::get("teamId"); |
@@ -286,13 +289,16 @@ discard block |
||
| 286 | 289 | */ |
| 287 | 290 | $status = DB::table('login_status')->select('status')->where('user_id', $memeber["id"])->first(); |
| 288 | 291 | $memeber['status']=$status; |
| 289 | - if($status['status']=="offline") |
|
| 290 | - $offlineSort[]=$memeber; |
|
| 291 | - else |
|
| 292 | - $onlineSort[]=$memeber; |
|
| 292 | + if($status['status']=="offline") { |
|
| 293 | + $offlineSort[]=$memeber; |
|
| 294 | + } else { |
|
| 295 | + $onlineSort[]=$memeber; |
|
| 296 | + } |
|
| 293 | 297 | |
| 294 | - if(count($onlineSort)==0)//if there are no online users do not merge |
|
| 298 | + if(count($onlineSort)==0) { |
|
| 299 | + //if there are no online users do not merge |
|
| 295 | 300 | $data[]=$memeber; |
| 301 | + } |
|
| 296 | 302 | |
| 297 | 303 | } |
| 298 | 304 | |
@@ -304,9 +310,9 @@ discard block |
||
| 304 | 310 | if(count($onlineSort)>0){// if online users are there pass merged data else pass non merged data |
| 305 | 311 | |
| 306 | 312 | return View::make('templates/team_members')->with('data', array_merge($onlineSort,$offlineSort)); |
| 313 | + } else { |
|
| 314 | + return View::make('templates/team_members')->with('data',$data ); |
|
| 307 | 315 | } |
| 308 | - else |
|
| 309 | - return View::make('templates/team_members')->with('data',$data ); |
|
| 310 | 316 | } |
| 311 | 317 | |
| 312 | 318 | public function get_team_name(){ |
@@ -11,10 +11,11 @@ discard block |
||
| 11 | 11 | public static function authorizeWrite($type) { |
| 12 | 12 | switch ($type) { |
| 13 | 13 | case "create_project": |
| 14 | - if (Session::get('role')) |
|
| 15 | - return "allowed"; |
|
| 16 | - else |
|
| 17 | - return "notAllowed"; |
|
| 14 | + if (Session::get('role')) { |
|
| 15 | + return "allowed"; |
|
| 16 | + } else { |
|
| 17 | + return "notAllowed"; |
|
| 18 | + } |
|
| 18 | 19 | break; |
| 19 | 20 | case "create_task": |
| 20 | 21 | if (Session::get('role')) |
@@ -32,13 +33,14 @@ discard block |
||
| 32 | 33 | ->where('team_heads.team_id', '=', $teamId) |
| 33 | 34 | ->where('team_heads.project_id', '=', $projectId) |
| 34 | 35 | ->first(); |
| 35 | - if($user_id['user_id']==\Session::get('userId')) |
|
| 36 | - return "allowed"; |
|
| 37 | - else |
|
| 38 | - return "notAllowed"; |
|
| 36 | + if($user_id['user_id']==\Session::get('userId')) { |
|
| 37 | + return "allowed"; |
|
| 38 | + } else { |
|
| 39 | + return "notAllowed"; |
|
| 40 | + } |
|
| 41 | + } else { |
|
| 42 | + return "notAllowed"; |
|
| 39 | 43 | } |
| 40 | - else |
|
| 41 | - return "notAllowed"; |
|
| 42 | 44 | break; |
| 43 | 45 | } |
| 44 | 46 | } |
@@ -31,8 +31,7 @@ |
||
| 31 | 31 | $date->setTimezone($tz); |
| 32 | 32 | $dateTime=$date->format('F jS, Y h:m:s A'); |
| 33 | 33 | return $dateTime; |
| 34 | - } |
|
| 35 | - else{ |
|
| 34 | + } else{ |
|
| 36 | 35 | $date = new DateTime($timesTamp); |
| 37 | 36 | $dateTime= $date->format('F jS, Y h:m:s A'); |
| 38 | 37 | return $dateTime; |
@@ -181,8 +181,9 @@ |
||
| 181 | 181 | "description" => $description, |
| 182 | 182 | ] |
| 183 | 183 | ); |
| 184 | - if ($taskId == '') |
|
| 185 | - $taskId = $lastUnId['un_id']; |
|
| 184 | + if ($taskId == '') { |
|
| 185 | + $taskId = $lastUnId['un_id']; |
|
| 186 | + } |
|
| 186 | 187 | \DB::table('task_updated_activities')->insertGetId( |
| 187 | 188 | ['un_id' => generateId(), |
| 188 | 189 | "tracker_activity_un_id" => $lastUnId['un_id'], |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
| 17 | 17 | ->where('team_channels.id', '!=', '') |
| 18 | 18 | ->where('channels.id', '=', $id)->distinct()->get(); |
| 19 | - } |
|
| 20 | - else { |
|
| 19 | + } else { |
|
| 21 | 20 | $teams = \DB::table('team_channels') |
| 22 | 21 | ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at','team_heads.user_id') |
| 23 | 22 | ->leftJoin('team_channel_users', 'team_channel_users.team_channel_name_id', '=', 'team_channels.id') |
@@ -63,8 +62,9 @@ discard block |
||
| 63 | 62 | |
| 64 | 63 | public function updateTeamName($id) { |
| 65 | 64 | $name = \Input::get('name'); |
| 66 | - if(empty($name)) |
|
| 67 | - return "empty"; |
|
| 65 | + if(empty($name)) { |
|
| 66 | + return "empty"; |
|
| 67 | + } |
|
| 68 | 68 | try { |
| 69 | 69 | //validate for duplicates |
| 70 | 70 | $data = \DB::table('team_channels') |
@@ -75,8 +75,9 @@ discard block |
||
| 75 | 75 | \DB::table('team_channels') |
| 76 | 76 | ->where('id', $id) |
| 77 | 77 | ->update(['channel_view_name' => $name]); |
| 78 | - } else |
|
| 79 | - return "exists"; |
|
| 78 | + } else { |
|
| 79 | + return "exists"; |
|
| 80 | + } |
|
| 80 | 81 | } catch (\Exception $e) { |
| 81 | 82 | //coudnt update |
| 82 | 83 | return "false"; |
@@ -86,8 +87,9 @@ discard block |
||
| 86 | 87 | |
| 87 | 88 | public function updateTeamHead($id) { |
| 88 | 89 | $userId = \Input::get('userId'); |
| 89 | - if (empty($userId)) |
|
| 90 | - return "empty"; |
|
| 90 | + if (empty($userId)) { |
|
| 91 | + return "empty"; |
|
| 92 | + } |
|
| 91 | 93 | try { |
| 92 | 94 | |
| 93 | 95 | //perform update |