@@ -46,34 +46,34 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * Get the id of the last inserted message |
| 48 | 48 | */ |
| 49 | - if (strpos(Input::get('body'), '<img') !== false) { |
|
| 50 | - $lastId= DB::table('messages')->insertGetId( |
|
| 49 | + if (strpos(Input::get('body'), '<img') !== false) { |
|
| 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{ |
|
| 55 | - $lastId= DB::table('messages')->insertGetId( |
|
| 53 | + } |
|
| 54 | + else{ |
|
| 55 | + $lastId= DB::table('messages')->insertGetId( |
|
| 56 | 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 | 57 | );} |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * if personal flag is set to true insert into personal conversations |
|
| 62 | - * |
|
| 63 | - */ |
|
| 64 | - if($isPersonalSet){ |
|
| 65 | - $teamChannelId=explode("_",Input::get('channelId')); |
|
| 60 | + /** |
|
| 61 | + * if personal flag is set to true insert into personal conversations |
|
| 62 | + * |
|
| 63 | + */ |
|
| 64 | + if($isPersonalSet){ |
|
| 65 | + $teamChannelId=explode("_",Input::get('channelId')); |
|
| 66 | 66 | |
| 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] |
|
| 69 | - ); |
|
| 70 | - } |
|
| 71 | - else{ |
|
| 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] |
|
| 69 | + ); |
|
| 70 | + } |
|
| 71 | + else{ |
|
| 72 | 72 | DB::table('team_conversations')->insert( |
| 73 | - ['team_channel_id' => Input::get('channelId'), 'user_id' => Input::get('userId'),'message_id' => $lastId] |
|
| 74 | - ); |
|
| 75 | - $this->insertIntoTeamConversationReadStatus(Input::get('channelId'),$lastId); |
|
| 76 | - } |
|
| 73 | + ['team_channel_id' => Input::get('channelId'), 'user_id' => Input::get('userId'),'message_id' => $lastId] |
|
| 74 | + ); |
|
| 75 | + $this->insertIntoTeamConversationReadStatus(Input::get('channelId'),$lastId); |
|
| 76 | + } |
|
| 77 | 77 | // Publish Data To Redis |
| 78 | 78 | |
| 79 | 79 | if($isPersonalSet){ |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | ]); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - function insertIntoTeamConversationReadStatus($channelId,$messageId){ |
|
| 100 | + function insertIntoTeamConversationReadStatus($channelId,$messageId){ |
|
| 101 | 101 | |
| 102 | - $teamId = DB::table('team_channels') |
|
| 102 | + $teamId = DB::table('team_channels') |
|
| 103 | 103 | ->select('id') |
| 104 | 104 | |
| 105 | 105 | ->where('team_channel_id', '=', $channelId)->first(); |
@@ -114,8 +114,8 @@ 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']] |
|
| 118 | - ); |
|
| 117 | + ['team_channel_id' => $teamId['id'], 'message_id' => $messageId,'user_id' => $memeber['id']] |
|
| 118 | + ); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | use LaravelRealtimeChat\Repositories\Team\TeamRepository; |
| 3 | 3 | use LaravelRealtimeChat\Repositories\Task\TaskRepository; |
| 4 | 4 | class FileUploadController extends AuthController { |
| 5 | - private $taskRepository; |
|
| 5 | + private $taskRepository; |
|
| 6 | 6 | |
| 7 | 7 | public function __construct(TeamRepository $teamRepository, TaskRepository $taskRepository) { |
| 8 | 8 | $this->teamRepository = $teamRepository; |
@@ -22,7 +22,7 @@ discard block |
||
| 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 |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // Within the ruleset, make sure we let the validator know that this |
| 31 | 31 | // file should be an image |
| 32 | 32 | $rules = array( |
| 33 | - 'file' => 'max:100000000', |
|
| 33 | + 'file' => 'max:100000000', |
|
| 34 | 34 | ); |
| 35 | 35 | $validation = Validator::make($input, $rules); |
| 36 | 36 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | if ($upload_success) { |
| 49 | 49 | if($dbSave){ |
| 50 | - $this->taskRepository->saveTaskFiles($imgPath); |
|
| 50 | + $this->taskRepository->saveTaskFiles($imgPath); |
|
| 51 | 51 | } |
| 52 | 52 | $fileErr = false; |
| 53 | 53 | } |
@@ -2,9 +2,9 @@ discard block |
||
| 2 | 2 | use LaravelRealtimeChat\Repositories\Team\TeamRepository; |
| 3 | 3 | use LaravelRealtimeChat\Repositories\Task\TaskRepository; |
| 4 | 4 | class TeamController extends \BaseController { |
| 5 | - /** |
|
| 6 | - * @var LaravelRealtimeChat\Repositories\TeamRepository |
|
| 7 | - */ |
|
| 5 | + /** |
|
| 6 | + * @var LaravelRealtimeChat\Repositories\TeamRepository |
|
| 7 | + */ |
|
| 8 | 8 | private $teamRepository; |
| 9 | 9 | /** |
| 10 | 10 | * @var LaravelRealtimeChat\Repositories\TaskRepository |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ); |
| 40 | 40 | |
| 41 | 41 | //Make admin as default team head |
| 42 | - \DB::table('team_heads')->insertGetId( |
|
| 42 | + \DB::table('team_heads')->insertGetId( |
|
| 43 | 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); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | // } |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | - // echo $this->db->last_query(); exit; |
|
| 190 | + // echo $this->db->last_query(); exit; |
|
| 191 | 191 | // print_r($teamArr); |
| 192 | 192 | return json_encode($teamArr); |
| 193 | 193 | } |
@@ -195,7 +195,6 @@ discard block |
||
| 195 | 195 | /** |
| 196 | 196 | @function gets team members |
| 197 | 197 | @param team id - id of team to list its members |
| 198 | - |
|
| 199 | 198 | */ |
| 200 | 199 | function getTeamMembers() { |
| 201 | 200 | $teamId = Input::get('teamId'); |
@@ -240,28 +239,28 @@ discard block |
||
| 240 | 239 | return "your not authorized to access this page"; |
| 241 | 240 | } |
| 242 | 241 | function deleteTeam(){ |
| 243 | - $enTeamId=Input::get("teamId"); |
|
| 242 | + $enTeamId=Input::get("teamId"); |
|
| 244 | 243 | $teamId=$this->teamRepository->getTeamDecodedId($enTeamId); |
| 245 | 244 | DB::table('team_conversations_read_status')->where('team_channel_id', $teamId)->delete(); |
| 246 | - DB::table('team_conversations')->where('team_channel_id', $teamId)->delete(); |
|
| 245 | + DB::table('team_conversations')->where('team_channel_id', $teamId)->delete(); |
|
| 247 | 246 | DB::table('team_channel_users')->where('team_channel_name_id', $teamId)->delete(); |
| 248 | 247 | $status= DB::table('team_channels')->where('id', $teamId)->delete(); |
| 249 | 248 | return json_encode($status); |
| 250 | 249 | } |
| 251 | 250 | |
| 252 | - public function list_teams_memebers() { |
|
| 251 | + public function list_teams_memebers() { |
|
| 253 | 252 | |
| 254 | - $offlineSort=array(); |
|
| 253 | + $offlineSort=array(); |
|
| 255 | 254 | $onlineSort=array(); |
| 256 | - /** |
|
| 257 | - * |
|
| 258 | - * Get all team details where the user is a memeber |
|
| 259 | - * |
|
| 260 | - * |
|
| 261 | - * |
|
| 262 | - */ |
|
| 255 | + /** |
|
| 256 | + * |
|
| 257 | + * Get all team details where the user is a memeber |
|
| 258 | + * |
|
| 259 | + * |
|
| 260 | + * |
|
| 261 | + */ |
|
| 263 | 262 | $teamArr = array(); |
| 264 | - $data = array(); |
|
| 263 | + $data = array(); |
|
| 265 | 264 | $teamName = DB::table('team_channels') |
| 266 | 265 | ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id') |
| 267 | 266 | ->leftJoin('team_channel_users', 'team_channel_users.team_channel_name_id', '=', 'team_channels.id') |
@@ -9,9 +9,9 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | public function drive() |
| 11 | 11 | { |
| 12 | - $output= exec("ls -l"); |
|
| 13 | - echo $output; |
|
| 14 | - exit; |
|
| 12 | + $output= exec("ls -l"); |
|
| 13 | + echo $output; |
|
| 14 | + exit; |
|
| 15 | 15 | $url_array = explode('?', 'http://'.$_SERVER ['HTTP_HOST'].$_SERVER['REQUEST_URI']); |
| 16 | 16 | $url = $url_array[0]; |
| 17 | 17 | echo $url; |
@@ -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), |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | 67 | finfo_close($finfo); |
| 68 | - print_r($a); |
|
| 69 | - // header('location:'.$url);exit; |
|
| 68 | + print_r($a); |
|
| 69 | + // header('location:'.$url);exit; |
|
| 70 | 70 | |
| 71 | 71 | //include 'fusionmate/index.phtml'; |
| 72 | 72 | } |
@@ -24,18 +24,18 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | $teamRepository = new DbTeamRepository(); |
| 26 | 26 | $teamId= \Input::get("teamId"); |
| 27 | - $id = $teamRepository->getTeamDecodedId($teamId); |
|
| 28 | - $teamId=$id; |
|
| 27 | + $id = $teamRepository->getTeamDecodedId($teamId); |
|
| 28 | + $teamId=$id; |
|
| 29 | 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 | - ->where('team_heads.project_id', '=', $projectId) |
|
| 34 | - ->first(); |
|
| 33 | + ->where('team_heads.project_id', '=', $projectId) |
|
| 34 | + ->first(); |
|
| 35 | 35 | if($user_id['user_id']==\Session::get('userId')) |
| 36 | 36 | return "allowed"; |
| 37 | 37 | else |
| 38 | - return "notAllowed"; |
|
| 38 | + return "notAllowed"; |
|
| 39 | 39 | } |
| 40 | 40 | else |
| 41 | 41 | return "notAllowed"; |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | $tz = new DateTimeZone(trim($tzName)); |
| 29 | 29 | |
| 30 | 30 | $date = new DateTime($timesTamp); |
| 31 | - $date->setTimezone($tz); |
|
| 31 | + $date->setTimezone($tz); |
|
| 32 | 32 | $dateTime=$date->format('F jS, Y h:m:s A'); |
| 33 | 33 | return $dateTime; |
| 34 | 34 | } |
| 35 | 35 | else{ |
| 36 | - $date = new DateTime($timesTamp); |
|
| 36 | + $date = new DateTime($timesTamp); |
|
| 37 | 37 | $dateTime= $date->format('F jS, Y h:m:s A'); |
| 38 | 38 | return $dateTime; |
| 39 | 39 | } |
@@ -42,7 +42,6 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - |
|
| 46 | 45 | * @function generates a unique ID |
| 47 | 46 | * @return string unique id |
| 48 | 47 | */ |
@@ -296,7 +296,7 @@ |
||
| 296 | 296 | |
| 297 | 297 | $files = \DB::table('task_activities') |
| 298 | 298 | ->select('tracker_files.file_name') |
| 299 | - ->leftJoin('tracker_files', 'tracker_files.tracker_activity_un_id', '=', 'task_activities.un_id') |
|
| 299 | + ->leftJoin('tracker_files', 'tracker_files.tracker_activity_un_id', '=', 'task_activities.un_id') |
|
| 300 | 300 | ->where('tracker_files.tracker_activity_un_id', '=', $result['un_id']) |
| 301 | 301 | ->get(); |
| 302 | 302 | |
@@ -17,38 +17,38 @@ |
||
| 17 | 17 | public function getMembers($id); |
| 18 | 18 | |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Decode a team ecnoded Id |
|
| 22 | - * |
|
| 23 | - * @param $id |
|
| 24 | - */ |
|
| 20 | + /** |
|
| 21 | + * Decode a team ecnoded Id |
|
| 22 | + * |
|
| 23 | + * @param $id |
|
| 24 | + */ |
|
| 25 | 25 | public function getTeamDecodedId($id); |
| 26 | - /** |
|
| 27 | - * fetch a team name by Id |
|
| 28 | - * |
|
| 29 | - * @param $id |
|
| 30 | - */ |
|
| 26 | + /** |
|
| 27 | + * fetch a team name by Id |
|
| 28 | + * |
|
| 29 | + * @param $id |
|
| 30 | + */ |
|
| 31 | 31 | public function getTeamName($id); |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * update a team name by Id |
|
| 35 | - * |
|
| 36 | - * @param $id |
|
| 37 | - */ |
|
| 33 | + /** |
|
| 34 | + * update a team name by Id |
|
| 35 | + * |
|
| 36 | + * @param $id |
|
| 37 | + */ |
|
| 38 | 38 | public function updateTeamName($id); |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * update a team head by Id |
|
| 42 | - * |
|
| 43 | - * @param $id |
|
| 44 | - */ |
|
| 40 | + /** |
|
| 41 | + * update a team head by Id |
|
| 42 | + * |
|
| 43 | + * @param $id |
|
| 44 | + */ |
|
| 45 | 45 | public function updateTeamHead($id); |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * update a notification |
|
| 49 | - * |
|
| 50 | - * @param $id,$teamid |
|
| 51 | - */ |
|
| 47 | + /** |
|
| 48 | + * update a notification |
|
| 49 | + * |
|
| 50 | + * @param $id,$teamid |
|
| 51 | + */ |
|
| 52 | 52 | public function updateNewMemberJoinNotification($team_id,$user_id); |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $teams = \DB::table('channels') |
| 14 | 14 | ->select('team_channels.id', 'channels.channel_name', 'team_channels.channel_view_name', 'channels.author_id', "team_channels.created_at", 'team_channels.team_channel_id','team_heads.user_id') |
| 15 | 15 | ->leftJoin('team_channels', 'channels.id', '=', 'team_channels.channel_name_id') |
| 16 | - ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
|
| 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 | 19 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | ->select('team_channels.channel_view_name', 'team_channels.team_channel_id', 'team_channels.id', 'team_channels.created_at','team_heads.user_id') |
| 23 | 23 | ->leftJoin('team_channel_users', 'team_channel_users.team_channel_name_id', '=', 'team_channels.id') |
| 24 | 24 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
| 25 | - ->where('team_channel_users.user_id', '=', \Auth::user()->id)->distinct()->get(); |
|
| 25 | + ->where('team_channel_users.user_id', '=', \Auth::user()->id)->distinct()->get(); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | return $teams; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | return $team['id']; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function getTeamName($id) { |
|
| 55 | + public function getTeamName($id) { |
|
| 56 | 56 | $team = \DB::table('team_channels') |
| 57 | 57 | ->select('team_channels.channel_view_name',\DB::raw('CONCAT(users.first_name, " ", users.last_name) AS full_name')) |
| 58 | 58 | ->leftJoin('team_heads', 'team_heads.team_id', '=', 'team_channels.id') |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | $teamArr = array(); |
| 114 | 114 | |
| 115 | - $details= $this->getUserDetails($user_id); |
|
| 115 | + $details= $this->getUserDetails($user_id); |
|
| 116 | 116 | |
| 117 | 117 | $teamMembers =\DB::table('users') |
| 118 | 118 | ->select('users.first_name','users.last_name', 'users.id','team_channels.channel_view_name','team_channels.team_channel_id','team_channels.id as team_id_decoded') |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | foreach ($teamMembers as $memeber) { |
| 124 | 124 | //insert notification |
| 125 | - $lastId = \DB::table('invitation_notification')->insertGetId( |
|
| 125 | + $lastId = \DB::table('invitation_notification')->insertGetId( |
|
| 126 | 126 | ['team_id' => $team_id, "team_user" => $memeber["id"],'new_user'=>$user_id] |
| 127 | 127 | ); |
| 128 | 128 | //Publish data to redis |
@@ -135,19 +135,19 @@ discard block |
||
| 135 | 135 | 'message' => array('new_user_id'=>$user_id,'new_user_channel_id' => $user_id."_".$teamChannelId,'user_id' =>$memeber["id"] ,'name'=>$details['first_name']." ".$details['last_name'],'team_name'=>$memeber['channel_view_name'],'team_id'=>$memeber['team_id_decoded']) |
| 136 | 136 | ); |
| 137 | 137 | // print_r($data); |
| 138 | - \Event::fire(\JoinNotificationEventHandler::EVENT, array(json_encode($data))); |
|
| 138 | + \Event::fire(\JoinNotificationEventHandler::EVENT, array(json_encode($data))); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| 145 | - public function getUserDetails($user_id){ |
|
| 146 | - $details =\DB::table('users') |
|
| 147 | - ->select('users.first_name','users.last_name') |
|
| 148 | - ->where('id', '=', $user_id) |
|
| 149 | - ->first(); |
|
| 150 | - return $details; |
|
| 151 | - } |
|
| 145 | + public function getUserDetails($user_id){ |
|
| 146 | + $details =\DB::table('users') |
|
| 147 | + ->select('users.first_name','users.last_name') |
|
| 148 | + ->where('id', '=', $user_id) |
|
| 149 | + ->first(); |
|
| 150 | + return $details; |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | \ No newline at end of file |