Minor - format code

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent b1f204eb3a
commit 9ce170d4db
  1. 5
      main/inc/lib/pdf.lib.php
  2. 1
      main/inc/lib/plugin.class.php
  3. 41
      main/inc/lib/sessionmanager.lib.php
  4. 5
      plugin/bbb/lib/bbb.lib.php

@ -226,7 +226,6 @@ class PDF
self::format_pdf($course_data, $complete_style);
$counter = 1;
foreach ($html_file_array as $file) {
//Add a page break per file
$page_break = '<pagebreak>';
if ($counter == count($html_file_array)) {
@ -282,9 +281,9 @@ class PDF
$filename = str_replace('_', ' ', $filename);
if ($extension === 'html') {
$filename = basename($filename,'.html');
$filename = basename($filename, '.html');
} elseif($extension === 'htm'){
$filename = basename($filename,'.htm');
$filename = basename($filename, '.htm');
}
$document_html = @file_get_contents($file);

@ -397,7 +397,6 @@ class Plugin
$courseId = (int) $courseId;
if (empty($courseId)) {
return false;
}

@ -1287,7 +1287,6 @@ class SessionManager
//foreach
foreach ($data as $key => $info) {
$sql = "SELECT
name
FROM $sessionTable
@ -1324,6 +1323,7 @@ class SessionManager
#add ip to final array
$return[$key]['ip'] = $ip['user_ip'];
}
return $return;
}
@ -1357,6 +1357,7 @@ class SessionManager
}
return false;
}
return $session_name;
}
@ -1624,17 +1625,17 @@ class SessionManager
}
/**
* @param int $id_promotion
* @param int $id promotion id
*
* @return bool
*/
public static function clear_session_ref_promotion($id_promotion)
public static function clear_session_ref_promotion($id)
{
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$id_promotion = intval($id_promotion);
$id = intval($id);
$sql = "UPDATE $tbl_session
SET promotion_id = 0
WHERE promotion_id = $id_promotion";
WHERE promotion_id = $id";
if (Database::query($sql)) {
return true;
} else {
@ -1681,8 +1682,10 @@ class SessionManager
if (empty($session_visibility)) {
$session_visibility = $session->getVisibility();
//default status loaded if empty
if (empty($session_visibility))
$session_visibility = SESSION_VISIBLE_READ_ONLY; // by default readonly 1
// by default readonly 1
if (empty($session_visibility)) {
$session_visibility = SESSION_VISIBLE_READ_ONLY;
}
} else {
if (!in_array($session_visibility, array(SESSION_VISIBLE_READ_ONLY, SESSION_VISIBLE, SESSION_INVISIBLE))) {
$session_visibility = SESSION_VISIBLE_READ_ONLY;
@ -1705,8 +1708,7 @@ class SessionManager
$course_list[] = $row['c_id'];
}
if (
$session->getSendSubscriptionNotification() &&
if ($session->getSendSubscriptionNotification() &&
is_array($user_list)
) {
// Sending emails only
@ -2116,12 +2118,12 @@ class SessionManager
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$delete_sql = "DELETE FROM $tbl_session_rel_user
WHERE
session_id = $session_id AND
user_id = $user_id AND
relation_type <> " . SESSION_RELATION_TYPE_RRHH . "";
$result = Database::query($delete_sql);
$sql = "DELETE FROM $tbl_session_rel_user
WHERE
session_id = $session_id AND
user_id = $user_id AND
relation_type <> " . SESSION_RELATION_TYPE_RRHH . "";
$result = Database::query($sql);
$return = Database::affected_rows($result);
// Update number of users
@ -2153,7 +2155,8 @@ class SessionManager
if (Database::affected_rows($result)) {
// Update number of users in this relation
$sql = "UPDATE $tbl_session_rel_course SET nbr_users = nbr_users - 1
$sql = "UPDATE $tbl_session_rel_course SET
nbr_users = nbr_users - 1
WHERE session_id = $session_id AND c_id = $courseId";
Database::query($sql);
}
@ -2210,7 +2213,6 @@ class SessionManager
// Remove existing courses from the session.
if ($removeExistingCoursesWithUsers === true && !empty($existingCourses)) {
foreach ($existingCourses as $existingCourse) {
if (!in_array($existingCourse['c_id'], $courseList)) {
@ -2282,7 +2284,6 @@ class SessionManager
$oldCategoryId= $cat->get_id();
$newId = $cat->add();
$newCategoryIdList[$oldCategoryId] = $newId;
$parentId = $cat->get_parent_id();
if (!empty($parentId)) {
@ -2366,8 +2367,8 @@ class SessionManager
/**
* Unsubscribe course from a session
*
* @param int Session id
* @param int Course id
* @param int $session_id
* @param int $course_id
* @return bool True in case of success, false otherwise
*/
public static function unsubscribe_course_from_session($session_id, $course_id)

@ -1035,18 +1035,13 @@ class bbb
*/
public function getUrlParams()
{
$courseInfo = api_get_course_info();
if (empty($this->courseCode)) {
if ($this->isGlobalConferencePerUserEnabled()) {
return 'global=1&user_id='.$this->userId;
}
if ($this->isGlobalConference()) {
return 'global=1';
}

Loading…
Cancel
Save