Minor - fixes from ofaj_dev

pull/2865/head
Julio 7 years ago
parent ef4e78caef
commit 6d912ac390
  1. 5
      main/inc/lib/api.lib.php
  2. 28
      main/inc/lib/extra_field.lib.php
  3. 4
      main/inc/lib/groupmanager.lib.php
  4. 2
      main/inc/lib/sessionmanager.lib.php

@ -1906,7 +1906,7 @@ function api_get_anonymous_id()
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tableU = Database::get_main_table(TABLE_MAIN_USER);
$ip = Database::escape_string(api_get_real_ip());
$max = api_get_configuration_value('max_anonymous_users');
$max = (int) api_get_configuration_value('max_anonymous_users');
if ($max >= 2) {
$sql = "SELECT * FROM $table as TEL
JOIN $tableU as U
@ -1919,7 +1919,7 @@ function api_get_anonymous_id()
if (empty(Database::num_rows($result))) {
$login = uniqid('anon_');
$anonList = UserManager::get_user_list(['status' => ANONYMOUS], ['registration_date ASC']);
if (count($anonList) == $max) {
if (count($anonList) >= $max) {
foreach ($anonList as $userToDelete) {
UserManager::delete_user($userToDelete['user_id']);
break;
@ -3327,7 +3327,6 @@ function api_is_allowed_to_edit(
$check_student_view = true
) {
$allowSessionAdminEdit = api_get_configuration_value('session_admins_edit_courses_content') === true;
// Admins can edit anything.
if (api_is_platform_admin($allowSessionAdminEdit)) {
//The student preview was on

@ -1379,13 +1379,13 @@ class ExtraField extends Model
continue;
}
$tagsSelect->addOption(
$tag['tag'],
$tag['tag'],
$tag['tag'],
[
'selected' => 'selected',
'class' => 'selected',
]
);
);
$selectedOptions[] = $tag['tag'];
}
}
@ -1411,9 +1411,9 @@ class ExtraField extends Model
continue;
}
$tagsSelect->addOption(
$tag->getTag(),
$tag->getTag()
);
$tag->getTag(),
$tag->getTag()
);
$selectedOptions[] = $tag->getTag();
}
@ -1433,7 +1433,7 @@ class ExtraField extends Model
$fieldTags = $em->getRepository('ChamiloCoreBundle:ExtraFieldRelTag')
->findBy(
[
'fieldId' => $field_id,
'fieldId' => $field_id,
]
);
$tagsAdded = [];
@ -1451,10 +1451,10 @@ class ExtraField extends Model
}
$tagsSelect->addOption(
$tag->getTag(),
$tag->getTag(),
[]
);
$tag->getTag(),
$tag->getTag(),
[]
);
$tagsAdded[] = $tagText;
}
@ -1463,10 +1463,10 @@ class ExtraField extends Model
}
$form->setDefaults(
[
'extra_'.$field_details['variable'] => $selectedOptions,
]
);
[
'extra_'.$field_details['variable'] => $selectedOptions,
]
);
if ($useTagAsSelect == false) {
$jquery_ready_content .= "

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CGroupRelUser;
/**
* This library contains some functions for group-management.
*
@ -1345,7 +1347,7 @@ class GroupManager
->getResult();
$users = [];
/** @var CGroupRelUser $subscription */
foreach ($subscriptions as $subscription) {
$users[] = api_get_user_info($subscription['id']);
}

@ -7730,7 +7730,7 @@ SQL;
case 1:
return get_lang('ReadOnly');
case 2:
return get_lang('Visible');
return get_lang('Visible');
case 3:
return api_ucfirst(get_lang('Invisible'));
}

Loading…
Cancel
Save