Minor - Format code

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent c6254c87af
commit 48374a29f4
  1. 37
      plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php

@ -160,7 +160,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
null, null,
['location' => $wsUrl, 'uri' => $wsUrl] ['location' => $wsUrl, 'uri' => $wsUrl]
); );
$userInfo = api_get_user_info($params['user_id'], false, false, true); $userInfo = api_get_user_info(
$params['user_id'],
false,
false,
true
);
try { try {
$profileCompleted = $client->__soapCall( $profileCompleted = $client->__soapCall(
@ -458,10 +463,16 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
* @param array $fileAttachments * @param array $fileAttachments
* @return bool|int * @return bool|int
*/ */
public function sendMailMessage($studentId, $receiverId, $subject, $content, $sessionId, $save = false, $fileAttachments = array()) public function sendMailMessage(
{ $studentId,
if ( $receiverId,
!empty($fileAttachments) && $subject,
$content,
$sessionId,
$save = false,
$fileAttachments = array()
) {
if (!empty($fileAttachments) &&
is_array($fileAttachments) && is_array($fileAttachments) &&
isset($fileAttachments['files']) && isset($fileAttachments['files']) &&
isset($fileAttachments['comments']) isset($fileAttachments['comments'])
@ -957,10 +968,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
); );
if (count($row) == 1) { if (count($row) == 1) {
return $row[0]['status']; return $row[0]['status'];
} else { } else {
return ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE; return ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE;
} }
} }
@ -977,7 +986,10 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{ {
if (!empty($sessionId)) { if (!empty($sessionId)) {
$extra = new ExtraFieldValue('session'); $extra = new ExtraFieldValue('session');
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'vacancies'); $var = $extra->get_values_by_handler_and_field_variable(
$sessionId,
'vacancies'
);
$vacancy = intval($var['value']); $vacancy = intval($var['value']);
if (!empty($vacancy)) { if (!empty($vacancy)) {
$vacancy -= $this->countQueueByParams( $vacancy -= $this->countQueueByParams(
@ -987,7 +999,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
) )
); );
if ($vacancy >= 0) { if ($vacancy >= 0) {
return $vacancy; return $vacancy;
} else { } else {
return 0; return 0;
@ -1068,7 +1079,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/ */
public function getStatusMessage($status, $isAble = true) public function getStatusMessage($status, $isAble = true)
{ {
$message = '';
switch ($status) { switch ($status) {
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE: case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE:
if ($isAble) { if ($isAble) {
@ -1163,7 +1173,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
'e='.intval($params['newStatus']).'&'. 'e='.intval($params['newStatus']).'&'.
'u='.intval($params['studentUserId']).'&'. 'u='.intval($params['studentUserId']).'&'.
'q='.intval($params['queueId']).'&'. 'q='.intval($params['queueId']).'&'.
'is_connected=' . 1 .'&'. 'is_connected=1&'.
'profile_completed='.intval($params['profile_completed']).'&'. 'profile_completed='.intval($params['profile_completed']).'&'.
'v='.$this->generateHash($params); 'v='.$this->generateHash($params);
@ -1254,7 +1264,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
); );
return $return; return $return;
} }
/** /**
@ -1394,7 +1403,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
); );
if (count($row) > 0) { if (count($row) > 0) {
return $row[0]['last_message_id']; return $row[0]['last_message_id'];
} }
} }
@ -1464,8 +1472,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
false false
); );
if ( if (count($courseCategories) > 0 &&
count($courseCategories) > 0 &&
Category::userFinishedCourse($userId, $courseCategories[0]) Category::userFinishedCourse($userId, $courseCategories[0])
) { ) {
$numberOfApprovedCourses++; $numberOfApprovedCourses++;

Loading…
Cancel
Save