Línea 42... |
Línea 42... |
42 |
use LeadersLinked\Model\HighPerformanceTeamsGroupsMembers;
|
42 |
use LeadersLinked\Model\HighPerformanceTeamsGroupsMembers;
|
43 |
use LeadersLinked\Model\HighPerformanceTeamsGroups;
|
43 |
use LeadersLinked\Model\HighPerformanceTeamsGroups;
|
44 |
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMembersMapper;
|
44 |
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMembersMapper;
|
45 |
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMapper;
|
45 |
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMapper;
|
46 |
use LeadersLinked\Mapper\UtilMapper;
|
46 |
use LeadersLinked\Mapper\UtilMapper;
|
- |
|
47 |
use LeadersLinked\Mapper\NetworkMapper;
|
Línea 47... |
Línea 48... |
47 |
|
48 |
|
48 |
class FeedController extends AbstractActionController
|
49 |
class FeedController extends AbstractActionController
|
49 |
{
|
50 |
{
|
50 |
/**
|
51 |
/**
|
Línea 1152... |
Línea 1153... |
1152 |
* @return array
|
1153 |
* @return array
|
1153 |
*/
|
1154 |
*/
|
1154 |
private function renderFeed($feed_id, $now , $group_uuid = '', $myt_id = '' )
|
1155 |
private function renderFeed($feed_id, $now , $group_uuid = '', $myt_id = '' )
|
1155 |
{
|
1156 |
{
|
Línea 1156... |
Línea -... |
1156 |
|
- |
|
1157 |
$sandbox = $this->config['leaderslinked.runmode.sandbox'];
|
- |
|
1158 |
if($sandbox) {
|
- |
|
1159 |
$company_profile_url = $this->config['leaderslinked.frontend.sandbox_company_profile'];
|
- |
|
1160 |
$user_profile_url = $this->config['leaderslinked.frontend.sandbox_user_profile'];
|
1157 |
|
1161 |
|
- |
|
1162 |
} else {
|
- |
|
1163 |
$company_profile_url = $this->config['leaderslinked.frontend.production_company_profile'];
|
- |
|
1164 |
$user_profile_url = $this->config['leaderslinked.frontend.production_user_profile'];
|
- |
|
1165 |
}
|
- |
|
Línea 1166... |
Línea 1158... |
1166 |
|
1158 |
|
1167 |
|
1159 |
|
Línea 1174... |
Línea 1166... |
1174 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
1166 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
1175 |
$company = $companyMapper->fetchOne($currentCompany->id);
|
1167 |
$company = $companyMapper->fetchOne($currentCompany->id);
|
Línea 1176... |
Línea 1168... |
1176 |
|
1168 |
|
1177 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
1169 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
1178 |
$owner = $companyUserMapper->fetchOwnerByCompanyId($currentCompany->id);
|
- |
|
1179 |
|
1170 |
$owner = $companyUserMapper->fetchOwnerByCompanyId($currentCompany->id);
|
- |
|
1171 |
|
- |
|
1172 |
$currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
|
Línea 1180... |
Línea 1173... |
1180 |
|
1173 |
$network = $currentNetworkPlugin->getNetwork();
|
Línea 1181... |
Línea 1174... |
1181 |
|
1174 |
|
1182 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
1175 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
Línea 1198... |
Línea 1191... |
1198 |
'feed_priority'=> $feed->priority,
|
1191 |
'feed_priority'=> $feed->priority,
|
1199 |
];
|
1192 |
];
|
1200 |
if($feed->type == Feed::TYPE_HPTG)
|
1193 |
if($feed->type == Feed::TYPE_HPTG)
|
1201 |
{
|
1194 |
{
|
Línea -... |
Línea 1195... |
- |
|
1195 |
|
1202 |
|
1196 |
|
1203 |
$uuid = $this->params()->fromRoute('hptg_id');
|
1197 |
$uuid = $this->params()->fromRoute('hptg_id');
|
1204 |
if($group_uuid!=''){
|
1198 |
if($group_uuid!=''){
|
1205 |
$uuid=$group_uuid;
|
1199 |
$uuid=$group_uuid;
|
1206 |
}
|
1200 |
}
|
1207 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1201 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1208 |
$user = $userMapper->fetchOne($feed->user_id);
|
1202 |
$user = $userMapper->fetchOne($feed->user_id);
|
1209 |
$item['owner_url'] = str_replace('[uuid]', $user->uuid, $user_profile_url);
|
1203 |
$item['owner_url'] = 'https://'. $network->main_hostname . '/profile/view/' . $user->uuid;
|
1210 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image]);
|
1204 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image]);
|
1211 |
$item['owner_name'] = $user->first_name . ' ' . $user->last_name;
|
1205 |
$item['owner_name'] = $user->first_name . ' ' . $user->last_name;
|
1212 |
$highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
|
1206 |
$highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
|
Línea 1248... |
Línea 1242... |
1248 |
$uuid=$myt_id;
|
1242 |
$uuid=$myt_id;
|
1249 |
}
|
1243 |
}
|
1250 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1244 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1251 |
$user = $userMapper->fetchOne($feed->user_id);
|
1245 |
$user = $userMapper->fetchOne($feed->user_id);
|
1252 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1246 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1253 |
$item['owner_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1247 |
$item['owner_url'] = 'https://'. $network->main_hostname . '/company/view/' . $company->uuid;
|
1254 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'user', 'filename' => $company->image]);
|
1248 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'user', 'filename' => $company->image]);
|
1255 |
$item['owner_name'] = $company->name;
|
1249 |
$item['owner_name'] = $company->name;
|
1256 |
} else if($feed->type == Feed::TYPE_MYT_ANSWER){
|
1250 |
} else if($feed->type == Feed::TYPE_MYT_ANSWER){
|
1257 |
$uuid = $this->params()->fromRoute('myt_id');
|
1251 |
$uuid = $this->params()->fromRoute('myt_id');
|
1258 |
if($myt_id!=''){
|
1252 |
if($myt_id!=''){
|
1259 |
$uuid=$myt_id;
|
1253 |
$uuid=$myt_id;
|
1260 |
}
|
1254 |
}
|
1261 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1255 |
$userMapper = UserMapper::getInstance($this->adapter);
|
1262 |
$user = $userMapper->fetchOne($feed->user_id);
|
1256 |
$user = $userMapper->fetchOne($feed->user_id);
|
1263 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1257 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1264 |
$item['owner_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1258 |
$item['owner_url'] = 'https://'. $network->main_hostname . '/company/view/' . $company->uuid;
|
1265 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'user', 'filename' => $company->image]);
|
1259 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'user', 'filename' => $company->image]);
|
1266 |
$item['owner_name'] = $company->name;
|
1260 |
$item['owner_name'] = $company->name;
|
1267 |
}else {
|
1261 |
}else {
|
1268 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1262 |
$item['feed_delete_url'] = $this->url()->fromRoute('feeds/delete', $params);
|
1269 |
$item['owner_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1263 |
$item['owner_url'] = 'https://'. $network->main_hostname . '/company/view/' . $company->uuid;
|
1270 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'company', 'filename' => $company->image]);
|
1264 |
$item['owner_image'] = $this->url()->fromRoute('storage', ['code' => $company->uuid, 'type' => 'company', 'filename' => $company->image]);
|
1271 |
$item['owner_name'] = $company->name;
|
1265 |
$item['owner_name'] = $company->name;
|
1272 |
}
|
1266 |
}
|
Línea 1273... |
Línea 1267... |
1273 |
|
1267 |
|
Línea 1322... |
Línea 1316... |
1322 |
$comment_count++;
|
1316 |
$comment_count++;
|
1323 |
$comment['comment_index']=$comment_count;
|
1317 |
$comment['comment_index']=$comment_count;
|
1324 |
$user = $userMapper->fetchOne($record->user_id);
|
1318 |
$user = $userMapper->fetchOne($record->user_id);
|
1325 |
if($user->id == $owner->user_id) {
|
1319 |
if($user->id == $owner->user_id) {
|
1326 |
$comment['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1320 |
$comment['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1327 |
$comment['user_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1321 |
$comment['user_url'] = 'https://'. $network->main_hostname . '/company/view/' . $company->uuid;
|
1328 |
$comment['user_name'] = $company->name;
|
1322 |
$comment['user_name'] = $company->name;
|
1329 |
} else {
|
1323 |
} else {
|
1330 |
$comment['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1324 |
$comment['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1331 |
$comment['user_url'] = str_replace('[uuid]', $user->uuid, $user_profile_url);
|
1325 |
$comment['user_url'] = 'https://'. $network->main_hostname . '/profile/view/' .$user->uuid;
|
1332 |
$comment['user_name'] = $user->first_name . ' ' . $user->last_name;
|
1326 |
$comment['user_name'] = $user->first_name . ' ' . $user->last_name;
|
1333 |
}
|
1327 |
}
|
1334 |
if($feed->type == Feed::TYPE_HPTG)
|
1328 |
if($feed->type == Feed::TYPE_HPTG)
|
1335 |
{
|
1329 |
{
|
1336 |
if($record->user_id == $currentUser->id||$highPerformanceTeamsGroupsMember->type!=HighPerformanceTeamsGroupsMembers::TYPE_USER) {
|
1330 |
if($record->user_id == $currentUser->id||$highPerformanceTeamsGroupsMember->type!=HighPerformanceTeamsGroupsMembers::TYPE_USER) {
|
Línea 1359... |
Línea 1353... |
1359 |
|
1353 |
|
1360 |
|
1354 |
|
1361 |
$user = $userMapper->fetchOne($record2->user_id);
|
1355 |
$user = $userMapper->fetchOne($record2->user_id);
|
1362 |
if($user->id == $owner->user_id) {
|
1356 |
if($user->id == $owner->user_id) {
|
1363 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1357 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1364 |
$answer['user_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1358 |
$answer['user_url'] = 'https://'. $network->main_hostname . '/company/view/' .$company->uuid;
|
1365 |
$answer['user_name'] = $company->name;
|
1359 |
$answer['user_name'] = $company->name;
|
1366 |
} else {
|
1360 |
} else {
|
1367 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1361 |
$answer['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1368 |
$answer['user_url'] = str_replace('[uuid]', $user->uuid, $user_profile_url);
|
1362 |
$answer['user_url'] = 'https://'. $network->main_hostname . '/profile/view/' . $user->uuid;
|
1369 |
$answer['user_name'] = $user->first_name . ' ' . $user->last_name;
|
1363 |
$answer['user_name'] = $user->first_name . ' ' . $user->last_name;
|
1370 |
}
|
1364 |
}
|
1371 |
if($feed->type == Feed::TYPE_HPTG)
|
1365 |
if($feed->type == Feed::TYPE_HPTG)
|
Línea 1406... |
Línea 1400... |
1406 |
*/
|
1400 |
*/
|
1407 |
private function renderComment($comment_id, $now)
|
1401 |
private function renderComment($comment_id, $now)
|
1408 |
{
|
1402 |
{
|
1409 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
1403 |
$currentUserPlugin = $this->plugin('currentUserPlugin');
|
1410 |
$currentUser = $currentUserPlugin->getUser();
|
1404 |
$currentUser = $currentUserPlugin->getUser();
|
- |
|
1405 |
|
- |
|
1406 |
$currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
|
- |
|
1407 |
$network = $currentNetworkPlugin->getNetwork();
|
- |
|
1408 |
|
- |
|
1409 |
|
1411 |
$currentCompany = $currentUserPlugin->getCompany();
|
1410 |
$currentCompany = $currentUserPlugin->getCompany();
|
Línea 1412... |
Línea 1411... |
1412 |
|
1411 |
|
1413 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
1412 |
$companyMapper = CompanyMapper::getInstance($this->adapter);
|
- |
|
1413 |
$company = $companyMapper->fetchOne($currentCompany->id);
|
Línea 1414... |
Línea 1414... |
1414 |
$company = $companyMapper->fetchOne($currentCompany->id);
|
1414 |
|
1415 |
|
1415 |
|
Línea 1416... |
Línea -... |
1416 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
- |
|
1417 |
$owner = $companyUserMapper->fetchOwnerByCompanyId($currentCompany->id);
|
- |
|
1418 |
|
- |
|
1419 |
|
- |
|
1420 |
|
- |
|
1421 |
$sandbox = $this->config['leaderslinked.runmode.sandbox'];
|
- |
|
1422 |
if($sandbox) {
|
- |
|
1423 |
$company_profile_url = $this->config['leaderslinked.frontend.sandbox_company_profile'];
|
1416 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
Línea 1424... |
Línea 1417... |
1424 |
$user_profile_url = $this->config['leaderslinked.frontend.sandbox_user_profile'];
|
1417 |
$owner = $companyUserMapper->fetchOwnerByCompanyId($currentCompany->id);
|
Línea 1425... |
Línea 1418... |
1425 |
} else {
|
1418 |
|
Línea 1445... |
Línea 1438... |
1445 |
|
1438 |
|
1446 |
|
1439 |
|
1447 |
$user = $userMapper->fetchOne($record->user_id);
|
1440 |
$user = $userMapper->fetchOne($record->user_id);
|
1448 |
if($user->id == $owner->user_id) {
|
1441 |
if($user->id == $owner->user_id) {
|
1449 |
$item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1442 |
$item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image ]);
|
1450 |
$item['user_url'] = str_replace('[uuid]', $company->uuid, $company_profile_url);
|
1443 |
$item['user_url'] = 'https://'. $network->main_hostname . '/company/view/' . $company->uuid;
|
1451 |
$item['user_name'] = $company->name;
|
1444 |
$item['user_name'] = $company->name;
|
1452 |
} else {
|
1445 |
} else {
|
1453 |
$item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1446 |
$item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image ]);
|
1454 |
$item['user_url'] = str_replace('[uuid]', $user->uuid, $user_profile_url);
|
1447 |
$item['user_url'] = 'https://'. $network->main_hostname . '/profile/view/' . $user->uuid;
|