Merge remote-tracking branch 'origin/1.11.x' into 1.11.x

pull/2624/head
Yannick Warnier 7 years ago
commit 3552fd0fb4
  1. 24
      main/admin/index.php
  2. 69
      main/admin/user_list.php
  3. 697
      main/admin/user_list_consent.php
  4. 2
      main/auth/inscription.php
  5. 10
      main/badge/issued.php
  6. 21
      main/badge/issued_all.php
  7. 1
      main/cron/lang/langstats.class.php
  8. 1
      main/cron/lang/list_unused_langvars.php
  9. 1
      main/extra/myStudents.php
  10. 13
      main/inc/lib/api.lib.php
  11. 11
      main/inc/lib/formvalidator/FormValidator.class.php
  12. 16
      main/inc/lib/message.lib.php
  13. 48
      main/inc/lib/skill.lib.php
  14. 1
      main/inc/lib/template.lib.php
  15. 92
      main/inc/lib/usermanager.lib.php
  16. 2
      main/lp/lp_final_item.php
  17. 12
      main/lp/lp_view.php
  18. 184
      main/social/personal_data.php
  19. 19
      main/template/default/social/personal_data.tpl
  20. 28
      src/Chamilo/CoreBundle/Entity/AccessUrl.php
  21. 17
      src/Chamilo/CoreBundle/Entity/AccessUrlRelCourse.php
  22. 10
      src/Chamilo/CoreBundle/Entity/AccessUrlRelCourseCategory.php
  23. 4
      src/Chamilo/CoreBundle/Entity/AccessUrlRelSession.php
  24. 27
      src/Chamilo/CoreBundle/Entity/AccessUrlRelUser.php
  25. 6
      src/Chamilo/CoreBundle/Entity/AccessUrlRelUserGroup.php
  26. 4
      src/Chamilo/CoreBundle/Entity/Admin.php
  27. 4
      src/Chamilo/CoreBundle/Entity/AnnouncementRelGroup.php
  28. 12
      src/Chamilo/CoreBundle/Entity/Block.php
  29. 52
      src/Chamilo/CoreBundle/Entity/BranchSync.php
  30. 24
      src/Chamilo/CoreBundle/Entity/BranchTransaction.php
  31. 4
      src/Chamilo/CoreBundle/Entity/BranchTransactionStatus.php
  32. 12
      src/Chamilo/CoreBundle/Entity/Career.php
  33. 12
      src/Chamilo/CoreBundle/Entity/Chat.php
  34. 10
      src/Chamilo/CoreBundle/Entity/ChatVideo.php
  35. 6
      src/Chamilo/CoreBundle/Entity/ClassItem.php
  36. 4
      src/Chamilo/CoreBundle/Entity/ClassUser.php
  37. 4
      src/Chamilo/CoreBundle/Entity/Course.php
  38. 16
      src/Chamilo/CoreBundle/Entity/CourseCategory.php
  39. 30
      src/Chamilo/CoreBundle/Entity/CourseModule.php
  40. 10
      src/Chamilo/CoreBundle/Entity/CourseType.php
  41. 12
      src/Chamilo/CoreBundle/Entity/EventEmailTemplate.php
  42. 8
      src/Chamilo/CoreBundle/Entity/EventSent.php
  43. 2
      src/Chamilo/CoreBundle/Entity/ExtraFieldOptionRelFieldOption.php
  44. 8
      src/Chamilo/CoreBundle/Entity/ExtraFieldRelTag.php
  45. 10
      src/Chamilo/CoreBundle/Entity/GradeComponents.php
  46. 12
      src/Chamilo/CoreBundle/Entity/GradeModel.php
  47. 32
      src/Chamilo/CoreBundle/Entity/GradebookCategory.php
  48. 12
      src/Chamilo/CoreBundle/Entity/GradebookCertificate.php
  49. 24
      src/Chamilo/CoreBundle/Entity/GradebookEvaluation.php
  50. 20
      src/Chamilo/CoreBundle/Entity/GradebookLink.php
  51. 18
      src/Chamilo/CoreBundle/Entity/GradebookLinkevalLog.php
  52. 10
      src/Chamilo/CoreBundle/Entity/GradebookResult.php
  53. 10
      src/Chamilo/CoreBundle/Entity/GradebookScoreLog.php
  54. 12
      src/Chamilo/CoreBundle/Entity/HookCall.php
  55. 6
      src/Chamilo/CoreBundle/Entity/HookEvent.php
  56. 8
      src/Chamilo/CoreBundle/Entity/HookObserver.php
  57. 16
      src/Chamilo/CoreBundle/Entity/Language.php
  58. 14
      src/Chamilo/CoreBundle/Entity/Legal.php
  59. 2
      src/Chamilo/CoreBundle/Entity/Manager/SessionManager.php
  60. 22
      src/Chamilo/CoreBundle/Entity/Message.php
  61. 12
      src/Chamilo/CoreBundle/Entity/MessageAttachment.php
  62. 16
      src/Chamilo/CoreBundle/Entity/Notification.php
  63. 16
      src/Chamilo/CoreBundle/Entity/OpenidAssociation.php
  64. 20
      src/Chamilo/CoreBundle/Entity/PersonalAgenda.php
  65. 10
      src/Chamilo/CoreBundle/Entity/PersonalAgendaRepeat.php
  66. 4
      src/Chamilo/CoreBundle/Entity/PersonalAgendaRepeatNot.php
  67. 12
      src/Chamilo/CoreBundle/Entity/PortfolioCategory.php
  68. 14
      src/Chamilo/CoreBundle/Entity/Promotion.php
  69. 2
      src/Chamilo/CoreBundle/Entity/Repository/SequenceRepository.php
  70. 14
      src/Chamilo/CoreBundle/Entity/Room.php
  71. 12
      src/Chamilo/CoreBundle/Entity/SearchEngineRef.php
  72. 10
      src/Chamilo/CoreBundle/Entity/Sequence.php
  73. 12
      src/Chamilo/CoreBundle/Entity/SequenceCondition.php
  74. 6
      src/Chamilo/CoreBundle/Entity/SequenceFormula.php
  75. 12
      src/Chamilo/CoreBundle/Entity/SequenceMethod.php
  76. 6
      src/Chamilo/CoreBundle/Entity/SequenceResource.php
  77. 12
      src/Chamilo/CoreBundle/Entity/SequenceRowEntity.php
  78. 4
      src/Chamilo/CoreBundle/Entity/SequenceRule.php
  79. 6
      src/Chamilo/CoreBundle/Entity/SequenceRuleCondition.php
  80. 8
      src/Chamilo/CoreBundle/Entity/SequenceRuleMethod.php
  81. 8
      src/Chamilo/CoreBundle/Entity/SequenceTypeEntity.php
  82. 6
      src/Chamilo/CoreBundle/Entity/SequenceValid.php
  83. 22
      src/Chamilo/CoreBundle/Entity/SequenceValue.php
  84. 8
      src/Chamilo/CoreBundle/Entity/SequenceVariable.php
  85. 30
      src/Chamilo/CoreBundle/Entity/Session.php
  86. 8
      src/Chamilo/CoreBundle/Entity/SessionCategory.php
  87. 26
      src/Chamilo/CoreBundle/Entity/SettingsCurrent.php
  88. 8
      src/Chamilo/CoreBundle/Entity/SettingsOptions.php
  89. 22
      src/Chamilo/CoreBundle/Entity/SharedSurvey.php
  90. 18
      src/Chamilo/CoreBundle/Entity/SharedSurveyQuestion.php
  91. 10
      src/Chamilo/CoreBundle/Entity/SharedSurveyQuestionOption.php
  92. 18
      src/Chamilo/CoreBundle/Entity/Skill.php
  93. 6
      src/Chamilo/CoreBundle/Entity/SkillProfile.php
  94. 8
      src/Chamilo/CoreBundle/Entity/SkillRelGradebook.php
  95. 6
      src/Chamilo/CoreBundle/Entity/SkillRelProfile.php
  96. 10
      src/Chamilo/CoreBundle/Entity/SkillRelSkill.php
  97. 74
      src/Chamilo/CoreBundle/Entity/SkillRelUser.php
  98. 12
      src/Chamilo/CoreBundle/Entity/SkillRelUserComment.php
  99. 6
      src/Chamilo/CoreBundle/Entity/SpecificField.php
  100. 12
      src/Chamilo/CoreBundle/Entity/SpecificFieldValues.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -534,8 +534,30 @@ if (api_is_platform_admin()) {
}
}
/* Chamilo.org */
// Data protection
$blocks['data_privacy']['icon'] = Display::return_icon(
'platform.png',
get_lang('Platform'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['data_privacy']['label'] = api_ucfirst(get_lang('PersonalDataPrivacy'));
$blocks['data_privacy']['class'] = 'block-admin-platform';
$blocks['data_privacy']['editable'] = false;
$items = [];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH).'admin/user_list_consent.php',
'label' => get_lang('UserList'),
];
$blocks['data_privacy']['items'] = $items;
$blocks['data_privacy']['extra'] = null;
$blocks['data_privacy']['search_form'] = null;
/* Chamilo.org */
$blocks['chamilo']['icon'] = Display::return_icon(
'platform.png',
'Chamilo.org',

@ -46,12 +46,6 @@ if (isset($_GET['user_id']) && $action == 'login_as') {
api_protect_admin_script(true);
// Blocks the possibility to delete a user
$deleteUserAvailable = true;
if (api_get_configuration_value('deny_delete_users')) {
$deleteUserAvailable = false;
}
trimVariables();
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=get_user_courses';
@ -870,40 +864,10 @@ if (!empty($action)) {
}
break;
case 'delete_user':
$allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin');
if (api_is_platform_admin() ||
($allowDelete && api_is_session_admin())
) {
$userToUpdate = $_GET['user_id'];
$userToUpdateInfo = api_get_user_info($userToUpdate);
$currentUserId = api_get_user_id();
if ($userToUpdateInfo && $deleteUserAvailable &&
api_global_admin_can_edit_admin($_GET['user_id'], null, $allowDelete)
) {
if ($userToUpdate != $currentUserId &&
UserManager::delete_user($_GET['user_id'])
) {
$message = Display::return_message(
get_lang('UserDeleted').': '.$userToUpdateInfo['complete_name_with_username'],
'confirmation'
);
} else {
$message = Display::return_message(
get_lang('CannotDeleteUserBecauseOwnsCourse'),
'error'
);
}
} else {
$message = Display::return_message(
get_lang('CannotDeleteUser'),
'error'
);
}
$message = UserManager::deleteUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: '.api_get_self());
exit;
}
break;
case 'delete':
if (api_is_platform_admin()) {
@ -984,39 +948,10 @@ if (!empty($action)) {
}
break;
case 'anonymize':
if (api_is_platform_admin() ||
($allowDelete && api_is_session_admin())
) {
$userToUpdate = (int) $_GET['user_id'];
$userToUpdateInfo = api_get_user_info($userToUpdate);
$currentUserId = api_get_user_id();
if ($userToUpdateInfo &&
api_global_admin_can_edit_admin($userToUpdate, null, $allowDelete)
) {
if ($userToUpdate != $currentUserId &&
UserManager::anonymize($userToUpdate)
) {
$message = Display::return_message(
sprintf(get_lang('UserXAnonymized'), $userToUpdateInfo['complete_name_with_username']),
'confirmation'
);
} else {
$message = Display::return_message(
sprintf(get_lang('CannotAnonymizeUserX'), $userToUpdateInfo['complete_name_with_username']),
'error'
);
}
} else {
$message = Display::return_message(
sprintf(get_lang('NoPermissionToAnonymizeUserX'), $userToUpdateInfo['complete_name_with_username']),
'error'
);
}
$message = UserManager::anonymizeUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: '.api_get_self());
exit;
}
break;
}
Security::clear_token();

@ -0,0 +1,697 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* @author Bart Mollet
* @author Julio Montoya <gugli100@gmail.com> BeezNest 2011
*
* @package chamilo.admin
*/
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$urlId = api_get_current_access_url_id();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
api_protect_admin_script();
$this_section = SECTION_PLATFORM_ADMIN;
/**
* Prepares the shared SQL query for the user table.
* See get_user_data() and get_number_of_users().
*
* @param bool $getCount Whether to count, or get data
*
* @return string SQL query
*/
function prepare_user_sql_query($getCount)
{
$sql = '';
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
if ($getCount) {
$sql .= "SELECT COUNT(u.id) AS total_number_of_items FROM $user_table u";
} else {
$sql .= "SELECT u.id AS col0, u.official_code AS col2, ";
if (api_is_western_name_order()) {
$sql .= "u.firstname AS col3, u.lastname AS col4, ";
} else {
$sql .= "u.lastname AS col3, u.firstname AS col4, ";
}
$sql .= " u.username AS col5,
u.email AS col6,
u.status AS col7,
u.active AS col8,
u.id AS col9,
u.registration_date AS col10,
u.expiration_date AS exp,
u.password
FROM $user_table u";
}
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql .= " INNER JOIN $access_url_rel_user_table url_rel_user
ON (u.id=url_rel_user.user_id)";
}
$extraFieldId = UserManager::create_extra_field(
'request_for_legal_agreement_consent_removal',
1, //text
'Request for legal agreement consent removal',
''
);
$extraFieldValue = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$sql .= " INNER JOIN $extraFieldValue v
ON (u.id = v.item_id AND field_id = $extraFieldId) ";
$keywordList = [
'keyword_firstname',
'keyword_lastname',
'keyword_username',
'keyword_email',
'keyword_officialcode',
'keyword_status',
'keyword_active',
'keyword_inactive',
'check_easy_passwords',
];
$keywordListValues = [];
$atLeastOne = false;
foreach ($keywordList as $keyword) {
$keywordListValues[$keyword] = null;
if (isset($_GET[$keyword]) && !empty($_GET[$keyword])) {
$keywordListValues[$keyword] = $_GET[$keyword];
$atLeastOne = true;
}
}
if ($atLeastOne == false) {
$keywordListValues = [];
}
if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$keywordFiltered = Database::escape_string("%".$_GET['keyword']."%");
$sql .= " WHERE (
u.firstname LIKE '$keywordFiltered' OR
u.lastname LIKE '$keywordFiltered' OR
concat(u.firstname, ' ', u.lastname) LIKE '$keywordFiltered' OR
concat(u.lastname,' ',u.firstname) LIKE '$keywordFiltered' OR
u.username LIKE '$keywordFiltered' OR
u.official_code LIKE '$keywordFiltered' OR
u.email LIKE '$keywordFiltered'
)
";
} elseif (isset($keywordListValues) && !empty($keywordListValues)) {
$query_admin_table = '';
$keyword_admin = '';
if (isset($keywordListValues['keyword_status']) &&
$keywordListValues['keyword_status'] == PLATFORM_ADMIN
) {
$query_admin_table = " , $admin_table a ";
$keyword_admin = ' AND a.user_id = u.id ';
$keywordListValues['keyword_status'] = '%';
}
$keyword_extra_value = '';
$sql .= " $query_admin_table
WHERE (
u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
u.lastname LIKE '".Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND
u.username LIKE '".Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND
u.email LIKE '".Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND
u.status LIKE '".Database::escape_string($keywordListValues['keyword_status'])."' ";
if (!empty($keywordListValues['keyword_officialcode'])) {
$sql .= " AND u.official_code LIKE '".Database::escape_string("%".$keywordListValues['keyword_officialcode']."%")."' ";
}
$sql .= "
$keyword_admin
$keyword_extra_value
";
if (isset($keywordListValues['keyword_active']) &&
!isset($keywordListValues['keyword_inactive'])
) {
$sql .= " AND u.active = 1";
} elseif (isset($keywordListValues['keyword_inactive']) &&
!isset($keywordListValues['keyword_active'])
) {
$sql .= " AND u.active = 0";
}
$sql .= " ) ";
}
$preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users');
if (api_is_session_admin() && $preventSessionAdminsToManageAllUsers === 'true') {
$sql .= " AND u.creator_id = ".api_get_user_id();
}
$variables = Session::read('variables_to_show', []);
if (!empty($variables)) {
$extraField = new ExtraField('user');
$extraFieldResult = [];
$extraFieldHasData = [];
foreach ($variables as $variable) {
if (isset($_GET['extra_'.$variable])) {
if (is_array($_GET['extra_'.$variable])) {
$values = $_GET['extra_'.$variable];
} else {
$values = [$_GET['extra_'.$variable]];
}
if (empty($values)) {
continue;
}
$info = $extraField->get_handler_field_info_by_field_variable(
$variable
);
if (empty($info)) {
continue;
}
foreach ($values as $value) {
if (empty($value)) {
continue;
}
if ($info['field_type'] == ExtraField::FIELD_TYPE_TAG) {
$result = $extraField->getAllUserPerTag(
$info['id'],
$value
);
$result = empty($result) ? [] : array_column(
$result,
'user_id'
);
} else {
$result = UserManager::get_extra_user_data_by_value(
$variable,
$value
);
}
$extraFieldHasData[] = true;
if (!empty($result)) {
$extraFieldResult = array_merge(
$extraFieldResult,
$result
);
}
}
}
}
if (!empty($extraFieldHasData)) {
$sql .= " AND (u.id IN ('".implode("','", $extraFieldResult)."')) ";
}
}
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) &&
api_get_multiple_access_url()
) {
$sql .= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
}
return $sql;
}
/**
* Get the total number of users on the platform.
*
* @see SortableTable#get_total_number_of_items()
*/
function get_number_of_users()
{
$sql = prepare_user_sql_query(true);
$res = Database::query($sql);
$obj = Database::fetch_object($res);
return $obj->total_number_of_items;
}
/**
* Get the users to display on the current page (fill the sortable-table).
*
* @param int offset of first user to recover
* @param int Number of users to get
* @param int Column to sort on
* @param string Order (ASC,DESC)
*
* @return array Users list
*
* @see SortableTable#get_table_data($from)
*/
function get_user_data($from, $number_of_items, $column, $direction)
{
$sql = prepare_user_sql_query(false);
if (!in_array($direction, ['ASC', 'DESC'])) {
$direction = 'ASC';
}
$column = (int) $column;
$from = intval($from);
$number_of_items = intval($number_of_items);
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
$res = Database::query($sql);
$users = [];
$t = time();
while ($user = Database::fetch_row($res)) {
$userPicture = UserManager::getUserPicture(
$user[0],
USER_IMAGE_SIZE_SMALL
);
$photo = '<img
src="'.$userPicture.'" width="22" height="22"
alt="'.api_get_person_name($user[2], $user[3]).'"
title="'.api_get_person_name($user[2], $user[3]).'" />';
if ($user[7] == 1 && !empty($user[10])) {
// check expiration date
$expiration_time = convert_sql_date($user[10]);
// if expiration date is passed, store a special value for active field
if ($expiration_time < $t) {
$user[7] = '-1';
}
}
// forget about the expiration date field
$users[] = [
$user[0],
$photo,
$user[1],
$user[2],
$user[3],
$user[4],
$user[5],
$user[6],
$user[7],
api_get_local_time($user[9]),
$user[0],
];
}
return $users;
}
/**
* Returns a mailto-link.
*
* @param string $email An email-address
*
* @return string HTML-code with a mailto-link
*/
function email_filter($email)
{
return Display::encrypted_mailto_link($email, $email);
}
/**
* Returns a mailto-link.
*
* @param string $email An email-address
* @param array $params Deprecated
* @param array $row
*
* @return string HTML-code with a mailto-link
*/
function user_filter($name, $params, $row)
{
return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
}
/**
* Build the modify-column of the table.
*
* @param int The user id
* @param string URL params to add to table links
* @param array Row of elements to alter
*
* @throws Exception
*
* @return string Some HTML-code with modify-buttons
*/
function modify_filter($user_id, $url_params, $row)
{
$_admins_list = Session::read('admin_list', []);
$is_admin = in_array($user_id, $_admins_list);
$token = Security::getTokenFromSession();
$result = '';
$result .= '<a href="user_information.php?user_id='.$user_id.'">'.
Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>&nbsp;&nbsp;';
$result .= Display::url(
get_lang('SendMessage'),
api_get_path(WEB_CODE_PATH).'messages/new_message.php?send_to_user='.$user_id
);
$result .= '&nbsp;&nbsp;';
$result .= Display::url(
get_lang('RemoveTerms'),
api_get_self().'?user_id='.$user_id.'&action=delete_terms&sec_token='.$token
);
$result .= '&nbsp;&nbsp;';
$result .= ' <a href="'.api_get_self().'?action=anonymize&user_id='.$user_id.'&'.$url_params.'&sec_token='.$token.'" onclick="javascript:if(!confirm('."'".addslashes(
api_htmlentities(get_lang("ConfirmYourChoice"))
)."'".')) return false;">'.
Display::return_icon(
'anonymous.png',
get_lang('Anonymize'),
[],
ICON_SIZE_SMALL
).
'</a>';
if ($user_id != api_get_user_id()) {
$result .= ' <a href="'.api_get_self().'?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.$token.'" onclick="javascript:if(!confirm('."'".addslashes(
api_htmlentities(get_lang("ConfirmYourChoice"))
)."'".')) return false;">'.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
).
'</a>';
}
$editProfileUrl = Display::getProfileEditionLink($user_id, true);
$result .= '<a href="'.$editProfileUrl.'">'.
Display::return_icon(
'edit.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
).
'</a>&nbsp;';
if ($is_admin) {
$result .= Display::return_icon(
'admin_star.png',
get_lang('IsAdministrator'),
['width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL]
);
} else {
$result .= Display::return_icon(
'admin_star_na.png',
get_lang('IsNotAdministrator')
);
}
return $result;
}
/**
* Build the active-column of the table to lock or unlock a certain user
* lock = the user can no longer use this account.
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*
* @param int $active the current state of the account
* @param string $params
* @param array $row
*
* @return string Some HTML-code with the lock/unlock button
*/
function active_filter($active, $params, $row)
{
$_user = api_get_user_info();
if ($active == '1') {
$action = 'Lock';
$image = 'accept';
} elseif ($active == '-1') {
$action = 'edit';
$image = 'warning';
} elseif ($active == '0') {
$action = 'Unlock';
$image = 'error';
}
$result = '';
if ($action === 'edit') {
$result = Display::return_icon(
$image.'.png',
get_lang('AccountExpired'),
[],
16
);
} elseif ($row['0'] != $_user['user_id']) {
// you cannot lock yourself out otherwise you could disable all the
// accounts including your own => everybody is locked out and nobody
// can change it anymore.
$result = Display::return_icon(
$image.'.png',
get_lang(ucfirst($action)),
['onclick' => 'active_user(this);', 'id' => 'img_'.$row['0']],
16
);
}
return $result;
}
/**
* Instead of displaying the integer of the status, we give a translation for the status.
*
* @param int $status
*
* @return string translation
*
* @version march 2008
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
*/
function status_filter($status)
{
$statusname = api_get_status_langvars();
return $statusname[$status];
}
if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
$interbreadcrumb[] = ["url" => 'index.php', "name" => get_lang('PlatformAdmin')];
$interbreadcrumb[] = ["url" => 'user_list.php', "name" => get_lang('UserList')];
$tool_name = get_lang('SearchUsers');
} else {
$interbreadcrumb[] = ["url" => 'index.php', "name" => get_lang('PlatformAdmin')];
$tool_name = get_lang('UserList');
}
$message = '';
if (!empty($action)) {
$check = Security::check_token('get');
if ($check) {
switch ($action) {
case 'delete_terms':
$extraFieldValue = new ExtraFieldValue('user');
$value = $extraFieldValue->get_values_by_handler_and_field_variable(
$_GET['user_id'],
'legal_accept'
);
$result = $extraFieldValue->delete($value['id']);
$value = $extraFieldValue->get_values_by_handler_and_field_variable(
$_GET['user_id'],
'request_for_legal_agreement_consent_removal'
);
$result = $extraFieldValue->delete($value['id']);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: '.api_get_self());
exit;
break;
case 'delete_user':
$message = UserManager::deleteUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: '.api_get_self());
exit;
break;
case 'delete':
if (api_is_platform_admin()) {
$number_of_selected_users = count($_POST['id']);
$number_of_affected_users = 0;
if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $index => $user_id) {
if ($user_id != $_user['user_id']) {
if (UserManager::delete_user($user_id)) {
$number_of_affected_users++;
}
}
}
}
if ($number_of_selected_users == $number_of_affected_users) {
$message = Display::return_message(
get_lang('SelectedUsersDeleted'),
'confirmation'
);
} else {
$message = Display::return_message(
get_lang('SomeUsersNotDeleted'),
'error'
);
}
}
break;
case 'anonymize':
$message = UserManager::anonymizeUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: '.api_get_self());
exit;
break;
}
Security::clear_token();
}
}
// Create a search-box
$form = new FormValidator('search_simple', 'get', null, null, null, 'inline');
$form->addText(
'keyword',
get_lang('Search'),
false,
[
'aria-label' => get_lang("SearchUsers"),
]
);
$form->addButtonSearch(get_lang('Search'));
$actionsLeft = '';
$actionsCenter = '';
$actionsRight = '';
$actionsLeft .= $form->returnForm();
if (isset($_GET['keyword'])) {
$parameters = ['keyword' => Security::remove_XSS($_GET['keyword'])];
} elseif (isset($_GET['keyword_firstname'])) {
$parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']);
$parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']);
$parameters['keyword_username'] = Security::remove_XSS($_GET['keyword_username']);
$parameters['keyword_email'] = Security::remove_XSS($_GET['keyword_email']);
$parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
$parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']);
$parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']);
$parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']);
}
// Create a sortable table with user-data
$parameters['sec_token'] = Security::get_token();
$_admins_list = array_keys(UserManager::get_all_administrators());
Session::write('admin_list', $_admins_list);
// Display Advanced search form.
$form = new FormValidator(
'advanced_search',
'get',
'',
'',
[],
FormValidator::LAYOUT_HORIZONTAL
);
$form->addElement('html', '<div id="advanced_search_form" style="display:none;">');
$form->addElement('header', get_lang('AdvancedSearch'));
$form->addText('keyword_firstname', get_lang('FirstName'), false);
$form->addText('keyword_lastname', get_lang('LastName'), false);
$form->addText('keyword_username', get_lang('LoginName'), false);
$form->addText('keyword_email', get_lang('Email'), false);
$form->addText('keyword_officialcode', get_lang('OfficialCode'), false);
$status_options = [];
$status_options['%'] = get_lang('All');
$status_options[STUDENT] = get_lang('Student');
$status_options[COURSEMANAGER] = get_lang('Teacher');
$status_options[DRH] = get_lang('Drh');
$status_options[SESSIONADMIN] = get_lang('SessionsAdmin');
$status_options[PLATFORM_ADMIN] = get_lang('Administrator');
$form->addElement(
'select',
'keyword_status',
get_lang('Profile'),
$status_options
);
$form->addButtonSearch(get_lang('SearchUsers'));
$defaults = [];
$defaults['keyword_active'] = 1;
$defaults['keyword_inactive'] = 1;
$form->setDefaults($defaults);
$form->addElement('html', '</div>');
$form = $form->returnForm();
$table = new SortableTable(
'users',
'get_number_of_users',
'get_user_data',
(api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2
);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, 'width="18px"');
$table->set_header(1, get_lang('Photo'), false);
$table->set_header(2, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
$table->set_header(3, get_lang('FirstName'));
$table->set_header(4, get_lang('LastName'));
} else {
$table->set_header(3, get_lang('LastName'));
$table->set_header(4, get_lang('FirstName'));
}
$table->set_header(5, get_lang('LoginName'));
$table->set_header(6, get_lang('Email'));
$table->set_header(7, get_lang('Profile'));
$table->set_header(8, get_lang('Active'), true, 'width="15px"');
$table->set_header(9, get_lang('RegistrationDate'), true, 'width="90px"');
$table->set_header(10, get_lang('Action'), false, 'width="220px"');
$table->set_column_filter(3, 'user_filter');
$table->set_column_filter(4, 'user_filter');
$table->set_column_filter(6, 'email_filter');
$table->set_column_filter(7, 'status_filter');
$table->set_column_filter(8, 'active_filter');
$table->set_column_filter(10, 'modify_filter');
// Only show empty actions bar if delete users has been blocked
$actionsList = [];
if (api_is_platform_admin() &&
!api_get_configuration_value('deny_delete_users')
) {
$actionsList['delete'] = get_lang('DeleteFromPlatform');
}
$actionsList['disable'] = get_lang('Disable');
$actionsList['enable'] = get_lang('Enable');
$table->set_form_actions($actionsList);
$table_result = $table->return_table();
$extra_search_options = '';
$toolbarActions = Display::toolbarAction(
'toolbarUser',
[$actionsLeft, $actionsCenter, $actionsRight],
[4, 4, 4]
);
$notice = Display::return_message(get_lang('InformationRightToBeForgottenText'), 'normal', false);
$tpl = new Template($tool_name);
$tpl->assign('actions', $toolbarActions);
$tpl->assign('message', $message);
$tpl->assign('content', $form.$table_result.$extra_search_options.$notice);
$tpl->display_one_col_template();

@ -898,7 +898,7 @@ if ($form->validate()) {
Event::addEvent(
LOG_TERM_CONDITION_ACCEPTED,
LOG_USER_OBJECT,
api_get_user_info(),
api_get_user_info($user_id),
api_get_utc_datetime()
);

@ -3,6 +3,7 @@
use Chamilo\CoreBundle\Entity\SkillRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUserComment;
use SkillRelUser as SkillRelUserManager;
/**
* Show information about the issued badge.
@ -107,7 +108,7 @@ $skillIssueInfo = [
'skill_short_code' => $skillIssue->getSkill()->getShortCode(),
'skill_description' => $skillIssue->getSkill()->getDescription(),
'skill_criteria' => $skillIssue->getSkill()->getCriteria(),
'badge_assertion' => $skillIssue->getAssertionUrl(),
'badge_assertion' => SkillRelUserManager::getAssertionUrl($skillIssue),
'comments' => [],
'feedback_average' => $skillIssue->getAverage(),
];
@ -120,7 +121,6 @@ $skillId = $skillIssueInfo['skill_id'];
/** @var SkillRelUserComment $comment */
foreach ($skillIssueComments as $comment) {
$commentDate = api_get_local_time($comment->getFeedbackDateTime());
$skillIssueInfo['comments'][] = [
'text' => $comment->getFeedbackText(),
'value' => $comment->getFeedbackValue(),
@ -157,7 +157,6 @@ if (!$profile) {
if ($profile) {
$profileId = $profile->getId();
$levels = $skillLevelRepo->findBy([
'profile' => $profileId,
]);
@ -168,7 +167,6 @@ if ($profile) {
}
ksort($profileLevels); // Sort the array by Position.
foreach ($profileLevels as $profileLevel) {
$profileId = key($profileLevel);
$acquiredLevel[$profileId] = $profileLevel[$profileId];
@ -193,7 +191,7 @@ if ($showLevels && $allowToEdit) {
$entityManager->flush();
Display::addFlash(Display::return_message(get_lang('Saved')));
header("Location: ".$skillIssue->getIssueUrl());
header('Location: '.SkillRelUserManager::getIssueUrl($skillIssue));
exit;
}
}
@ -226,7 +224,7 @@ if ($form->validate() && $allowComment && $allowToEdit) {
$entityManager->flush();
Display::addFlash(Display::return_message(get_lang('Added')));
header("Location: ".$skillIssue->getIssueUrl());
header('Location: '.SkillRelUserManager::getIssueUrl($skillIssue));
exit;
}

@ -4,6 +4,7 @@
use Chamilo\CoreBundle\Entity\SkillRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUserComment;
use Chamilo\UserBundle\Entity\User;
use SkillRelUser as SkillRelUserManager;
/**
* Show information about all issued badges with same skill by user.
@ -14,8 +15,8 @@ use Chamilo\UserBundle\Entity\User;
*/
require_once __DIR__.'/../inc/global.inc.php';
$userId = isset($_GET['user']) ? intval($_GET['user']) : 0;
$skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0;
$userId = isset($_GET['user']) ? (int) $_GET['user'] : 0;
$skillId = isset($_GET['skill']) ? (int) $_GET['skill'] : 0;
if (!$userId || !$skillId) {
api_not_allowed(true);
@ -26,7 +27,6 @@ Skill::isAllowed($userId);
$em = Database::getManager();
$user = api_get_user_entity($userId);
$skill = $em->find('ChamiloCoreBundle:Skill', $skillId);
$currentUserId = api_get_user_id();
if (!$user || !$skill) {
@ -80,7 +80,10 @@ foreach ($userSkills as $index => $skillIssue) {
'datetime' => api_format_date($skillIssueDate, DATE_TIME_FORMAT_SHORT),
'acquired_level' => $currentSkillLevel,
'argumentation_author_id' => $skillIssue->getArgumentationAuthorId(),
'argumentation_author_name' => api_get_person_name($argumentationAuthor['firstname'], $argumentationAuthor['lastname']),
'argumentation_author_name' => api_get_person_name(
$argumentationAuthor['firstname'],
$argumentationAuthor['lastname']
),
'argumentation' => $skillIssue->getArgumentation(),
'source_name' => $skillIssue->getSourceName(),
'user_id' => $skillIssue->getUser()->getId(),
@ -91,7 +94,7 @@ foreach ($userSkills as $index => $skillIssue) {
'skill_short_code' => $skillIssue->getSkill()->getShortCode(),
'skill_description' => $skillIssue->getSkill()->getDescription(),
'skill_criteria' => $skillIssue->getSkill()->getCriteria(),
'badge_assertion' => $skillIssue->getAssertionUrl(),
'badge_assertion' => SkillRelUserManager::getAssertionUrl($skillIssue),
'comments' => [],
'feedback_average' => $skillIssue->getAverage(),
];
@ -156,7 +159,7 @@ foreach ($userSkills as $index => $skillIssue) {
$formAcquiredLevel = new FormValidator(
'acquired_level'.$skillIssue->getId(),
'post',
$skillIssue->getIssueUrlAll()
SkillRelUserManager::getIssueUrlAll($skillIssue)
);
$formAcquiredLevel->addSelect('acquired_level', get_lang('AcquiredLevel'), $acquiredLevel);
$formAcquiredLevel->addHidden('user', $skillIssue->getUser()->getId());
@ -172,14 +175,14 @@ foreach ($userSkills as $index => $skillIssue) {
$em->persist($skillIssue);
$em->flush();
header("Location: ".$skillIssue->getIssueUrlAll());
header('Location: '.SkillRelUserManager::getIssueUrlAll($skillIssue));
exit;
}
$form = new FormValidator(
'comment'.$skillIssue->getId(),
'post',
$skillIssue->getIssueUrlAll()
SkillRelUserManager::getIssueUrlAll($skillIssue)
);
$form->addTextarea('comment', get_lang('NewComment'), ['rows' => 4]);
$form->applyFilter('comment', 'trim');
@ -207,7 +210,7 @@ foreach ($userSkills as $index => $skillIssue) {
$em->persist($skillUserComment);
$em->flush();
header("Location: ".$skillIssue->getIssueUrlAll());
header('Location: '.SkillRelUserManager::getIssueUrlAll($skillIssue));
exit;
}

@ -139,6 +139,7 @@ class langstats
return $this->db->lastInsertRowID();
}
}
return true;
}

@ -61,7 +61,6 @@ foreach ($files as $file) {
}
$usedTerms[$term] = $shortFile;
}
}
} else {
$myTerms = [];

@ -64,7 +64,6 @@ if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
$this_section = SECTION_COURSES;
}
$nameTools = get_lang('StudentDetails');
$em = Database::getManager();

@ -273,6 +273,7 @@ define('LOG_MY_FOLDER_NEW_PATH', 'new_path');
define('LOG_TERM_CONDITION_ACCEPTED', 'term_condition_accepted');
define('LOG_USER_CONFIRMED_EMAIL', 'user_confirmed_email');
define('LOG_USER_REMOVED_LEGAL_ACCEPT', 'user_removed_legal_accept');
define('USERNAME_PURIFIER', '/[^0-9A-Za-z_\.]/');
@ -3875,13 +3876,13 @@ function convert_sql_date($last_post_datetime)
* the only one that is actually from the session, in case there are results from
* session 0 *AND* session n).
*
* @param array Course properties array (result of api_get_course_info())
* @param string Tool (learnpath, document, etc)
* @param int The item ID in the given tool
* @param int The session ID (optional)
* @param string $tool
* @param array $_course Course properties array (result of api_get_course_info())
* @param string $tool Tool (learnpath, document, etc)
* @param int $id The item ID in the given tool
* @param int $session The session ID (optional)
* @param int $user_id
* @param string $type
* @param string $group_id
*
* @return int -1 on error, 0 if invisible, 1 if visible
*/
@ -3939,7 +3940,7 @@ function api_get_item_visibility(
}
$row = Database::fetch_array($res);
return $row['visibility'];
return (int) $row['visibility'];
}
/**

@ -296,12 +296,19 @@ EOT;
* @param string $name
* @param string $label
* @param array $attributes
* @param bool $required
*
* @return HTML_QuickForm_textarea
*/
public function addTextarea($name, $label, $attributes = [])
public function addTextarea($name, $label, $attributes = [], $required = false)
{
return $this->addElement('textarea', $name, $label, $attributes);
$element = $this->addElement('textarea', $name, $label, $attributes);
if ($required) {
$this->addRule($name, get_lang('ThisFieldIsRequired'), 'required');
}
return $element;
}
/**

@ -2598,6 +2598,22 @@ class MessageManager
}
}
/**
* @param int $senderId
* @param string $subject
* @param string $message
*/
public static function sendMessageToAllAdminUsers(
$senderId,
$subject,
$message
) {
$admins = UserManager::get_all_administrators();
foreach ($admins as $admin) {
self::send_message_simple($admin['user_id'], $subject, $message, $senderId);
}
}
/**
* Execute the SQL necessary to know the number of messages in the database.
*

@ -3,6 +3,7 @@
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Entity\Skill as SkillEntity;
use Chamilo\CoreBundle\Entity\SkillRelUser as SkillRelUserEntity;
use Chamilo\SkillBundle\Entity\SkillRelCourse;
use Chamilo\SkillBundle\Entity\SkillRelItem;
use Chamilo\UserBundle\Entity\User;
@ -12,6 +13,8 @@ use Fhaculty\Graph\Vertex;
/**
* Class SkillProfile.
*
* @todo break the file in different classes
*
* @package chamilo.library
*/
class SkillProfile extends Model
@ -614,6 +617,51 @@ class SkillRelUser extends Model
'where' => $where,
], 'first');
}
/**
* Get the URL for the issue.
*
* @param SkillRelUserEntity $skillIssue
*
* @return string
*/
public static function getIssueUrl(SkillRelUserEntity $skillIssue)
{
return api_get_path(WEB_PATH)."badge/{$skillIssue->getId()}";
}
/**
* Get the URL for the All issues page.
*
* @param SkillRelUserEntity $skillIssue
*
* @return string
*/
public static function getIssueUrlAll(SkillRelUserEntity $skillIssue)
{
return api_get_path(WEB_PATH)."skill/{$skillIssue->getSkill()->getId()}/user/{$skillIssue->getUser()->getId()}";
}
/**
* Get the URL for the assertion.
*
* @param SkillRelUserEntity $skillIssue
*
* @return string
*/
public static function getAssertionUrl(SkillRelUserEntity $skillIssue)
{
$url = api_get_path(WEB_CODE_PATH).'badge/assertion.php?';
$url .= http_build_query([
'user' => $skillIssue->getUser()->getId(),
'skill' => $skillIssue->getSkill()->getId(),
'course' => $skillIssue->getCourse() ? $skillIssue->getCourse()->getId() : 0,
'session' => $skillIssue->getSession() ? $skillIssue->getSession()->getId() : 0,
]);
return $url;
}
}
/**

@ -1376,6 +1376,7 @@ class Template
{
$queryString = empty($_SERVER['QUERY_STRING']) ? '' : $_SERVER['QUERY_STRING'];
$requestURI = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
return [
'web' => api_get_path(WEB_PATH),
'web_url' => api_get_web_url(),

@ -6157,6 +6157,98 @@ SQL;
return true;
}
/**
* @param int $userId
*
* @throws Exception
*
* @return string
*/
public static function anonymizeUserWithVerification($userId)
{
$allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin');
$message = '';
if (api_is_platform_admin() ||
($allowDelete && api_is_session_admin())
) {
$userToUpdateInfo = api_get_user_info($userId);
$currentUserId = api_get_user_id();
if ($userToUpdateInfo &&
api_global_admin_can_edit_admin($userId, null, $allowDelete)
) {
if ($userId != $currentUserId &&
self::anonymize($userId)
) {
$message = Display::return_message(
sprintf(get_lang('UserXAnonymized'), $userToUpdateInfo['complete_name_with_username']),
'confirmation'
);
} else {
$message = Display::return_message(
sprintf(get_lang('CannotAnonymizeUserX'), $userToUpdateInfo['complete_name_with_username']),
'error'
);
}
} else {
$message = Display::return_message(
sprintf(get_lang('NoPermissionToAnonymizeUserX'), $userToUpdateInfo['complete_name_with_username']),
'error'
);
}
}
return $message;
}
/**
* @param int $userId
*
* @throws Exception
*
* @return string
*/
public static function deleteUserWithVerification($userId)
{
$allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin');
$deleteUserAvailable = api_get_configuration_value('deny_delete_users');
$message = '';
if (api_is_platform_admin() ||
($allowDelete && api_is_session_admin())
) {
$userToUpdateInfo = api_get_user_info($userId);
$currentUserId = api_get_user_id();
if ($userToUpdateInfo && $deleteUserAvailable &&
api_global_admin_can_edit_admin($userId, null, $allowDelete)
) {
if ($userId != $currentUserId &&
UserManager::delete_user($userId)
) {
$message = Display::return_message(
get_lang('UserDeleted').': '.$userToUpdateInfo['complete_name_with_username'],
'confirmation'
);
} else {
$message = Display::return_message(
get_lang('CannotDeleteUserBecauseOwnsCourse'),
'error'
);
}
} else {
$message = Display::return_message(
get_lang('CannotDeleteUser'),
'error'
);
}
}
return $message;
}
/**
* @return EncoderFactory
*/

@ -54,7 +54,7 @@ if ($checker) {
'normal',
false
),
'<a href="'.$url.'">'. $url .'</a>'
'<a href="'.$url.'">'.$url.'</a>'
);
$tpl->assign('content', $content);
$tpl->display_blank_template();

@ -35,7 +35,7 @@ $show_learnpath = true;
api_protect_course_script();
$lp_id = !empty($_GET['lp_id']) ? intval($_GET['lp_id']) : 0;
$lp_id = !empty($_GET['lp_id']) ? (int) $_GET['lp_id'] : 0;
$sessionId = api_get_session_id();
$course_code = api_get_course_id();
$course_id = api_get_course_int_id();
@ -60,8 +60,8 @@ $visibility = api_get_item_visibility(
$sessionId
);
if (!api_is_allowed_to_edit(false, true, false, false) &&
intval($visibility) == 0
if ($visibility === 0 &&
!api_is_allowed_to_edit(false, true, false, false)
) {
api_not_allowed(true);
}
@ -113,7 +113,7 @@ if (!$is_allowed_to_edit) {
}
}
$platform_theme = api_get_setting('stylesheets'); // Platform's css.
$platform_theme = api_get_setting('stylesheets');
$my_style = $platform_theme;
$ajaxUrl = api_get_path(WEB_AJAX_PATH).'lp.ajax.php?a=get_item_prerequisites&'.api_get_cidreq();
$htmlHeadXtra[] = '<script>
@ -309,9 +309,9 @@ if (!empty($_REQUEST['exeId']) &&
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
$safe_item_id = intval($_GET['lp_item_id']);
$safe_item_id = (int) $_GET['lp_item_id'];
$safe_id = $lp_id;
$safe_exe_id = intval($_REQUEST['exeId']);
$safe_exe_id = (int) $_REQUEST['exeId'];
if ($safe_id == strval(intval($safe_id)) &&
$safe_item_id == strval(intval($safe_item_id))

@ -17,6 +17,7 @@ if (!api_get_configuration_value('enable_gdpr')) {
}
$userId = api_get_user_id();
$userInfo = api_get_user_info();
$substitutionTerms = [
'password' => get_lang('EncryptedData'),
@ -24,6 +25,135 @@ $substitutionTerms = [
'empty' => get_lang('NoData'),
];
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$formToString = '';
if (api_get_setting('allow_terms_conditions') === 'true') {
$form = new FormValidator('term', 'post', api_get_self().'?action=delete_legal&user_id='.$userId);
$form->addHtml(Display::return_message(get_lang('WhyYouWantToDeleteYourLegalAgreement')));
$form->addTextarea('explanation', get_lang('ExplanationDeleteLegal'), [], true);
$form->addButtonSave(get_lang('DeleteLegal'));
$form->addHidden('action', 'delete_legal');
$formToString = $form->returnForm();
}
switch ($action) {
case 'send_legal':
$language = api_get_interface_language();
$language = api_get_language_id($language);
$terms = LegalManager::get_last_condition($language);
if (!$terms) {
//look for the default language
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$terms = LegalManager::get_last_condition($language);
}
$legalAcceptType = $terms['version'].':'.$terms['language_id'].':'.time();
UserManager::update_extra_field_value(
$userId,
'legal_accept',
$legalAcceptType
);
Event::addEvent(
LOG_TERM_CONDITION_ACCEPTED,
LOG_USER_OBJECT,
api_get_user_info($userId),
api_get_utc_datetime()
);
$bossList = UserManager::getStudentBossList($userId);
if (!empty($bossList)) {
$bossList = array_column($bossList, 'boss_id');
$currentUserInfo = api_get_user_info($userId);
foreach ($bossList as $bossId) {
$subjectEmail = sprintf(
get_lang('UserXSignedTheAgreement'),
$currentUserInfo['complete_name']
);
$contentEmail = sprintf(
get_lang('UserXSignedTheAgreementTheY'),
$currentUserInfo['complete_name'],
api_get_local_time($time)
);
MessageManager::send_message_simple(
$bossId,
$subjectEmail,
$contentEmail,
$user_id
);
}
}
Display::addFlash(Display::return_message(get_lang('Saved')));
break;
case 'delete_legal':
if ($form->validate()) {
$explanation = $form->getSubmitValue('explanation');
UserManager::create_extra_field(
'request_for_legal_agreement_consent_removal',
1, //text
'Request for legal agreement consent removal',
''
);
UserManager::update_extra_field_value(
$userId,
'request_for_legal_agreement_consent_removal',
1
);
UserManager::create_extra_field(
'request_for_legal_agreement_consent_removal_justification',
1, //text
'Request for legal agreement consent removal justification',
''
);
UserManager::update_extra_field_value(
$userId,
'request_for_legal_agreement_consent_removal_justification',
$explanation
);
$extraFieldValue = new ExtraFieldValue('user');
$value = $extraFieldValue->get_values_by_handler_and_field_variable(
$userId,
'legal_accept'
);
$result = $extraFieldValue->delete($value['id']);
Display::addFlash(Display::return_message(get_lang('Deleted')));
Event::addEvent(
LOG_USER_REMOVED_LEGAL_ACCEPT,
LOG_USER_OBJECT,
$userInfo
);
$url = api_get_path(WEB_CODE_PATH).'admin/';
$link = Display::url($url, $url);
$subject = get_lang('RequestForLegalConsentRemoval');
$content = sprintf(
get_lang('TheUserXAskRemovalWithJustifactionYGoHere'),
$userInfo['complete_name'],
$explanation,
$link
);
$email = api_get_configuration_value('data_protection_officer_email');
if (!empty($email)) {
api_mail_html('', $email, $subject, $content);
} else {
MessageManager::sendMessageToAllAdminUsers(api_get_user_id(), $subject, $content);
}
}
break;
}
$propertiesToJson = UserManager::getRepository()->getPersonalDataToJson($userId, $substitutionTerms);
if (!empty($_GET['export'])) {
@ -70,12 +200,36 @@ $properties = json_decode($propertiesToJson);
foreach ($properties as $key => $value) {
if (is_array($value) || is_object($value)) {
if ($key === 'extraFields') {
switch ($key) {
case 'extraFields':
$personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $subValue) {
$personalDataContent .= '<li>'.$subValue->variable.': '.$subValue->value.'</li>';
}
$personalDataContent .= '</ul>';
break;
case 'portals':
case 'achievedSkills':
case 'sessionAsGeneralCoach':
case 'classes':
case 'courses':
$personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $subValue) {
$personalDataContent .= '<li>'.$subValue.'</li>';
}
$personalDataContent .= '</ul>';
break;
case 'sessionCourseSubscriptions':
$personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $session => $courseList) {
$personalDataContent .= '<li>'.$session.'<ul>';
foreach ($courseList as $course) {
$personalDataContent .= '<li>'.$course.'</li>';
}
$personalDataContent .= '</ul>';
}
$personalDataContent .= '</ul>';
break;
}
/*foreach ($value as $subValue) {
@ -97,45 +251,42 @@ foreach ($properties as $key => $value) {
$personalDataContent .= '</ul>';
// Check terms acceptation
$termsAndConditionsAcceptance = [];
$termsAndConditionsAcceptance['accepted'] = false;
$permitionBlock = '';
if (api_get_setting('allow_terms_conditions') === 'true') {
$extraFieldValue = new ExtraFieldValue('user');
$value = $extraFieldValue->get_values_by_handler_and_field_variable(
$userId,
'legal_accept'
);
$termsAndConditionsAcceptance['icon'] = Display::return_icon('accept_na.png', get_lang('NotAccepted'));
$permitionBlock .= Display::return_icon('accept_na.png', get_lang('NotAccepted'));
if (isset($value['value']) && !empty($value['value'])) {
list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']);
$termsAndConditionsAcceptance['accepted'] = true;
$termsAndConditionsAcceptance['icon'] = Display::return_icon('accept.png', get_lang('LegalAgreementAccepted'));
$termsAndConditionsAcceptance['date'] = api_get_local_time($legalTime);
// @TODO add action handling for button
$termsAndConditionsAcceptance['button'] = Display::url(
$permitionBlock = get_lang('CurrentStatus').': '.
Display::return_icon('accept.png', get_lang('LegalAgreementAccepted')).get_lang('LegalAgreementAccepted').
'<br />';
$permitionBlock .= get_lang('Date').': '.api_get_local_time($legalTime).'<br />';
$permitionBlock .= $formToString;
/*$permitionBlock .= Display::url(
get_lang('DeleteLegal'),
api_get_self().'?action=delete_legal&user_id='.$userId,
['class' => 'btn btn-danger btn-xs']
);
);*/
} else {
// @TODO add action handling for button
$termsAndConditionsAcceptance['button'] = Display::url(
$permitionBlock .= Display::url(
get_lang('SendLegal'),
api_get_self().'?action=send_legal&user_id='.$userId,
['class' => 'btn btn-primary btn-xs']
);
}
$termsAndConditionsAcceptance['label'] = get_lang('LegalAccepted');
} else {
$termsAndConditionsAcceptance['label'] = get_lang('NoTermsAndConditionsAvailable');
$permitionBlock .= get_lang('NoTermsAndConditionsAvailable');
}
//Build the final array to pass to template
$personalData = [];
$personalData['data'] = $personalDataContent;
$icon = Display::return_icon('export_excel.png', get_lang('Export'), null, ICON_SIZE_MEDIUM);
$personalData['data_export_icon'] = $icon;
$personalData['permissions'] = $termsAndConditionsAcceptance;
//$personalData['responsible'] = api_get_setting('personal_data_responsible_org');
$em = Database::getManager();
@ -187,6 +338,7 @@ if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('personal_data_block', $personalDataContent);
}
$tpl->assign('permission', $permitionBlock);
$tpl->assign('term_link', $termLink);
$socialLayout = $tpl->get_template('social/personal_data.tpl');
$tpl->display($socialLayout);

@ -12,24 +12,7 @@
<div class="col-md-9">
{{ display.panel('PersonalDataIntroductionTitle' | get_lang , 'PersonalDataIntroductionText' | get_lang) }}
{{ display.panel('PersonalDataKeptOnYou' | get_lang, personal_data.data) }}
<div class="panel personal-data-permissions">
<div class="panel-title">{{ 'PersonalDataPermissionsYouGaveUs' | get_lang }}</div>
<div class="personal-data-raw-data">
{{ personal_data.permissions.label }}
<ul>
{% if personal_data.permissions.accepted %}
<li>
{{ 'CurrentStatus' | get_lang }}: {{ personal_data.permissions.icon }} ({{ 'LegalAgreementAccepted' | get_lang }})
</li>
<li>
{{ 'Date' | get_lang }}: {{ personal_data.permissions.date }}
</li>
{% endif %}
<li>{{ personal_data.permissions.button }}</li>
</ul>
</div>
</div>
{{ display.panel('PersonalDataPermissionsYouGaveUs' | get_lang, permission) }}
{% if personal_data.responsible %}
{{ display.panel('PersonalDataResponsibleOrganizationTitle' | get_lang , personal_data.responsible ) }}

@ -13,10 +13,6 @@ use Doctrine\ORM\Mapping as ORM;
*/
class AccessUrl
{
/**
* @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
protected $course;
/**
* @var int
*
@ -24,49 +20,54 @@ class AccessUrl
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
protected $id;
/**
* @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
protected $course;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=255, nullable=false, unique=false)
*/
private $url;
protected $url;
/**
* @var string
*
* @ORM\Column(name="description", type="text", unique=false)
*/
private $description;
protected $description;
/**
* @var int
*
* @ORM\Column(name="active", type="integer", nullable=false, unique=false)
*/
private $active;
protected $active;
/**
* @var int
*
* @ORM\Column(name="created_by", type="integer", nullable=false, unique=false)
*/
private $createdBy;
protected $createdBy;
/**
* @var \DateTime
*
* @ORM\Column(name="tms", type="datetime", nullable=true)
*/
private $tms;
protected $tms;
/**
* @var bool
*
* @ORM\Column(name="url_type", type="boolean", nullable=true)
*/
private $urlType;
protected $urlType;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SettingsCurrent", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
@ -76,8 +77,11 @@ class AccessUrl
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
private $sessionCategory;
protected $sessionCategory;
/**
* AccessUrl constructor.
*/
public function __construct()
{
$this->tms = new \DateTime();

@ -13,6 +13,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class AccessUrlRelCourse
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Course", inversedBy="urls", cascade={"persist"})
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
@ -24,14 +33,6 @@ class AccessUrlRelCourse
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
*/
protected $url;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @return string

@ -20,28 +20,28 @@ class AccessUrlRelCourseCategory
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="access_url_id", type="integer")
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var int
*
* @ORM\Column(name="course_category_id", type="integer")
*/
private $courseCategoryId;
protected $courseCategoryId;
/**
* Set accessUrlId.
*
* @param int $accessUrlId
*
* @return AccessUrlRelSession
* @return $this
*/
public function setAccessUrlId($accessUrlId)
{
@ -71,7 +71,7 @@ class AccessUrlRelCourseCategory
/**
* @param int $courseCategoryId
*
* @return AccessUrlRelCourseCategory
* @return $this
*/
public function setCourseCategoryId($courseCategoryId)
{

@ -20,7 +20,7 @@ class AccessUrlRelSession
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var int
@ -29,7 +29,7 @@ class AccessUrlRelSession
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $sessionId;
protected $sessionId;
/**
* Set accessUrlId.

@ -20,24 +20,13 @@ use Doctrine\ORM\Mapping as ORM;
*/
class AccessUrlRelUser
{
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\AccessUrl")
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
*/
protected $portal;
/**
* @var int
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\Column(name="access_url_id", type="integer")
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var int
@ -45,7 +34,19 @@ class AccessUrlRelUser
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\Column(name="user_id", type="integer")
*/
private $userId;
protected $userId;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\AccessUrl")
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
*/
protected $portal;
/**
* Set accessUrlId.

@ -20,21 +20,21 @@ class AccessUrlRelUserGroup
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="access_url_id", type="integer")
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var int
*
* @ORM\Column(name="usergroup_id", type="integer")
*/
private $userGroupId;
protected $userGroupId;
/**
* Set accessUrlId.

@ -20,14 +20,14 @@ class Admin
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* Set userId.

@ -20,7 +20,7 @@ class AnnouncementRelGroup
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $groupId;
protected $groupId;
/**
* @var int
@ -29,7 +29,7 @@ class AnnouncementRelGroup
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $announcementId;
protected $announcementId;
/**
* Set groupId.

@ -20,42 +20,42 @@ class Block
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=true)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="path", type="string", length=255, nullable=false)
*/
private $path;
protected $path;
/**
* @var string
*
* @ORM\Column(name="controller", type="string", length=100, nullable=false)
*/
private $controller;
protected $controller;
/**
* @var bool
*
* @ORM\Column(name="active", type="boolean", nullable=false)
*/
private $active;
protected $active;
/**
* Set name.

@ -22,181 +22,181 @@ class BranchSync
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="access_url_id", type="integer", nullable=false, unique=false)
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var string
*
* @ORM\Column(name="unique_id", type="string", length=50, nullable=false, unique=true)
*/
private $uniqueId;
protected $uniqueId;
/**
* @var string
*
* @ORM\Column(name="branch_name", type="string", length=250, nullable=false, unique=false)
*/
private $branchName;
protected $branchName;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="branch_ip", type="string", length=40, nullable=true, unique=false)
*/
private $branchIp;
protected $branchIp;
/**
* @var float
*
* @ORM\Column(name="latitude", type="decimal", nullable=true, unique=false)
*/
private $latitude;
protected $latitude;
/**
* @var float
*
* @ORM\Column(name="longitude", type="decimal", nullable=true, unique=false)
*/
private $longitude;
protected $longitude;
/**
* @var int
*
* @ORM\Column(name="dwn_speed", type="integer", nullable=true, unique=false)
*/
private $dwnSpeed;
protected $dwnSpeed;
/**
* @var int
*
* @ORM\Column(name="up_speed", type="integer", nullable=true, unique=false)
*/
private $upSpeed;
protected $upSpeed;
/**
* @var int
*
* @ORM\Column(name="delay", type="integer", nullable=true, unique=false)
*/
private $delay;
protected $delay;
/**
* @var string
*
* @ORM\Column(name="admin_mail", type="string", length=250, nullable=true, unique=false)
*/
private $adminMail;
protected $adminMail;
/**
* @var string
*
* @ORM\Column(name="admin_name", type="string", length=250, nullable=true, unique=false)
*/
private $adminName;
protected $adminName;
/**
* @var string
*
* @ORM\Column(name="admin_phone", type="string", length=250, nullable=true, unique=false)
*/
private $adminPhone;
protected $adminPhone;
/**
* @var int
*
* @ORM\Column(name="last_sync_trans_id", type="bigint", nullable=true, unique=false)
*/
private $lastSyncTransId;
protected $lastSyncTransId;
/**
* @var \DateTime
*
* @ORM\Column(name="last_sync_trans_date", type="datetime", nullable=true, unique=false)
*/
private $lastSyncTransDate;
protected $lastSyncTransDate;
/**
* @var string
*
* @ORM\Column(name="last_sync_type", type="string", length=20, nullable=true, unique=false)
*/
private $lastSyncType;
protected $lastSyncType;
/**
* @var string
*
* @ORM\Column(name="ssl_pub_key", type="string", length=250, nullable=true, unique=false)
*/
private $sslPubKey;
protected $sslPubKey;
/**
* @var string
*
* @ORM\Column(name="branch_type", type="string", length=250, nullable=true, unique=false)
*/
private $branchType;
protected $branchType;
/**
* @var int
* @Gedmo\TreeLeft
* @ORM\Column(name="lft", type="integer", nullable=true, unique=false)
*/
private $lft;
protected $lft;
/**
* @var int
* @Gedmo\TreeRight
* @ORM\Column(name="rgt", type="integer", nullable=true, unique=false)
*/
private $rgt;
protected $rgt;
/**
* @var int
* @Gedmo\TreeLevel
* @ORM\Column(name="lvl", type="integer", nullable=true, unique=false)
*/
private $lvl;
protected $lvl;
/**
* @var int
* @Gedmo\TreeRoot
* @ORM\Column(name="root", type="integer", nullable=true, unique=false)
*/
private $root;
protected $root;
/**
* @var int
*
* @ORM\Column(name="parent_id", type="integer", nullable=true, unique=false)
*/
private $parentId;
protected $parentId;
/**
* @Gedmo\TreeParent
* @ORM\ManyToOne(targetEntity="BranchSync", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $parent;
protected $parent;
/**
* @ORM\OneToMany(targetEntity="BranchSync", mappedBy="parent")
* @ORM\OrderBy({"lft" = "ASC"})
*/
private $children;
protected $children;
/**
* Constructor.

@ -20,7 +20,7 @@ class BranchTransaction
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var Room
@ -28,70 +28,70 @@ class BranchTransaction
* @ORM\ManyToOne(targetEntity="BranchTransactionStatus")
* @ORM\JoinColumn(name="status_id", referencedColumnName="id")
*/
private $branchTransactionStatus;
protected $branchTransactionStatus;
/**
* @var int
*
* @ORM\Column(name="transaction_id", type="bigint", nullable=false, unique=false)
*/
private $externalTransactionId;
protected $externalTransactionId;
/**
* @var string
*
* @ORM\Column(name="action", type="string", length=20, nullable=true, unique=false)
*/
private $action;
protected $action;
/**
* @var string
*
* @ORM\Column(name="item_id", type="string", length=255, nullable=true, unique=false)
*/
private $itemId;
protected $itemId;
/**
* @var string
*
* @ORM\Column(name="origin", type="string", length=255, nullable=true, unique=false)
*/
private $origin;
protected $origin;
/**
* @var string
*
* @ORM\Column(name="dest_id", type="string", length=255, nullable=true, unique=false)
*/
private $destId;
protected $destId;
/**
* @var string
*
* @ORM\Column(name="external_info", type="string", length=255, nullable=true, unique=false)
*/
private $externalInfo;
protected $externalInfo;
/**
* @var \DateTime
*
* @ORM\Column(name="time_insert", type="datetime", nullable=false, unique=false)
*/
private $timeInsert;
protected $timeInsert;
/**
* @var \DateTime
*
* @ORM\Column(name="time_update", type="datetime", nullable=false, unique=false)
*/
private $timeUpdate;
protected $timeUpdate;
/**
* @var int
*
* @ORM\Column(name="failed_attempts", type="integer", nullable=false, unique=false)
*/
private $failedAttempts;
protected $failedAttempts;
/**
* @var BranchSync
@ -99,7 +99,7 @@ class BranchTransaction
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\BranchSync")
* @ORM\JoinColumn(name="branch_id", referencedColumnName="id")
*/
private $branch;
protected $branch;
/**
* Set id.

@ -20,14 +20,14 @@ class BranchTransactionStatus
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true, unique=false)
*/
private $title;
protected $title;
/**
* Get id.

@ -20,42 +20,42 @@ class Career
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var int
*
* @ORM\Column(name="status", type="integer", nullable=false)
*/
private $status;
protected $status;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=false)
*/
private $updatedAt;
protected $updatedAt;
/**
* Get id.

@ -23,42 +23,42 @@ class Chat
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="from_user", type="integer", nullable=true)
*/
private $fromUser;
protected $fromUser;
/**
* @var int
*
* @ORM\Column(name="to_user", type="integer", nullable=true)
*/
private $toUser;
protected $toUser;
/**
* @var string
*
* @ORM\Column(name="message", type="text", nullable=false)
*/
private $message;
protected $message;
/**
* @var \DateTime
*
* @ORM\Column(name="sent", type="datetime", nullable=false)
*/
private $sent;
protected $sent;
/**
* @var int
*
* @ORM\Column(name="recd", type="integer", nullable=false)
*/
private $recd;
protected $recd;
/**
* Get id.

@ -27,35 +27,35 @@ class ChatVideo
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="from_user", type="integer", nullable=false)
*/
private $fromUser;
protected $fromUser;
/**
* @var int
*
* @ORM\Column(name="to_user", type="integer", nullable=false)
*/
private $toUser;
protected $toUser;
/**
* @var string
*
* @ORM\Column(name="room_name", type="string", nullable=false)
*/
private $roomName;
protected $roomName;
/**
* @var \DateTime
*
* @ORM\Column(name="datetime", type="datetime", nullable=false)
*/
private $datetime;
protected $datetime;
/**
* Set fromUser.

@ -18,14 +18,14 @@ class ClassItem
*
* @ORM\Column(name="code", type="string", length=40, nullable=true)
*/
private $code;
protected $code;
/**
* @var string
*
* @ORM\Column(name="name", type="text", nullable=false)
*/
private $name;
protected $name;
/**
* @var int
@ -34,7 +34,7 @@ class ClassItem
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set code.

@ -20,7 +20,7 @@ class ClassUser
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $classId;
protected $classId;
/**
* @var int
@ -29,7 +29,7 @@ class ClassUser
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $userId;
protected $userId;
/**
* Set classId.

@ -1181,7 +1181,7 @@ class Course
*
* @return bool
*/
private function hasSubscription(CourseRelUser $subscription)
protected function hasSubscription(CourseRelUser $subscription)
{
if ($this->getUsers()->count()) {
$criteria = Criteria::create()->where(
@ -1206,7 +1206,7 @@ class Course
* @param string $role
* @param string $status
*/
private function addUser(User $user, $relationType, $role, $status)
protected function addUser(User $user, $relationType, $role, $status)
{
$courseRelUser = new CourseRelUser();
$courseRelUser->setCourse($this);

@ -29,56 +29,56 @@ class CourseCategory
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=40, nullable=false)
*/
private $code;
protected $code;
/**
* @var string
*
* @ORM\Column(name="parent_id", type="string", length=40, nullable=true)
*/
private $parentId;
protected $parentId;
/**
* @var int
*
* @ORM\Column(name="tree_pos", type="integer", nullable=true)
*/
private $treePos;
protected $treePos;
/**
* @var int
*
* @ORM\Column(name="children_count", type="smallint", nullable=true)
*/
private $childrenCount;
protected $childrenCount;
/**
* @var string
*
* @ORM\Column(name="auth_course_child", type="string", length=40, nullable=true)
*/
private $authCourseChild;
protected $authCourseChild;
/**
* @var string
*
* @ORM\Column(name="auth_cat_child", type="string", length=40, nullable=true)
*/
private $authCatChild;
protected $authCatChild;
/**
* @return string

@ -13,56 +13,56 @@ use Doctrine\ORM\Mapping as ORM;
*/
class CourseModule
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="link", type="string", length=255, nullable=false)
*/
private $link;
protected $link;
/**
* @var string
*
* @ORM\Column(name="image", type="string", length=100, nullable=true)
*/
private $image;
protected $image;
/**
* @var int
*
* @ORM\Column(name="row", type="integer", nullable=false)
*/
private $row;
protected $row;
/**
* @var int
*
* @ORM\Column(name="column", type="integer", nullable=false)
*/
private $column;
protected $column;
/**
* @var string
*
* @ORM\Column(name="position", type="string", length=20, nullable=false)
*/
private $position;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $position;
/**
* Set name.

@ -18,28 +18,28 @@ class CourseType
*
* @ORM\Column(name="name", type="string", length=50, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="translation_var", type="string", length=40, nullable=true)
*/
private $translationVar;
protected $translationVar;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="props", type="text", nullable=true)
*/
private $props;
protected $props;
/**
* @var int
@ -48,7 +48,7 @@ class CourseType
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set name.

@ -18,35 +18,35 @@ class EventEmailTemplate
*
* @ORM\Column(name="message", type="text", nullable=true)
*/
private $message;
protected $message;
/**
* @var string
*
* @ORM\Column(name="subject", type="string", length=255, nullable=true)
*/
private $subject;
protected $subject;
/**
* @var string
*
* @ORM\Column(name="event_type_name", type="string", length=255, nullable=true)
*/
private $eventTypeName;
protected $eventTypeName;
/**
* @var bool
*
* @ORM\Column(name="activated", type="boolean", nullable=false)
*/
private $activated;
protected $activated;
/**
* @var int
*
* @ORM\Column(name="language_id", type="integer", nullable=true)
*/
private $languageId;
protected $languageId;
/**
* @var int
@ -55,7 +55,7 @@ class EventEmailTemplate
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set message.

@ -20,28 +20,28 @@ class EventSent
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="user_from", type="integer", nullable=false)
*/
private $userFrom;
protected $userFrom;
/**
* @var int
*
* @ORM\Column(name="user_to", type="integer", nullable=true)
*/
private $userTo;
protected $userTo;
/**
* @var string
*
* @ORM\Column(name="event_type_name", type="string", length=100, nullable=true)
*/
private $eventTypeName;
protected $eventTypeName;
/**
* Set userFrom.

@ -51,7 +51,7 @@ class ExtraFieldOptionRelFieldOption
*
* @ORM\Column(name="field_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/
private $fieldId;
protected $fieldId;
/**
* Get id.

@ -26,21 +26,21 @@ class ExtraFieldRelTag
*
* @ORM\Column(name="field_id", type="integer", nullable=false)
*/
private $fieldId;
protected $fieldId;
/**
* @var int
*
* @ORM\Column(name="tag_id", type="integer", nullable=false)
*/
private $tagId;
protected $tagId;
/**
* @var int
*
* @ORM\Column(name="item_id", type="integer", nullable=false)
*/
private $itemId;
protected $itemId;
/**
* @var int
@ -49,7 +49,7 @@ class ExtraFieldRelTag
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set fieldId.

@ -20,35 +20,35 @@ class GradeComponents
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="percentage", type="string", length=255, nullable=false)
*/
private $percentage;
protected $percentage;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=false)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="acronym", type="string", length=255, nullable=false)
*/
private $acronym;
protected $acronym;
/**
* @var int
*
* @ORM\Column(name="grade_model_id", type="integer", nullable=false)
*/
private $gradeModelId;
protected $gradeModelId;
/**
* Set percentage.

@ -20,42 +20,42 @@ class GradeModel
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var bool
*
* @ORM\Column(name="default_lowest_eval_exclude", type="boolean", nullable=true)
*/
private $defaultLowestEvalExclude;
protected $defaultLowestEvalExclude;
/**
* @var bool
*
* @ORM\Column(name="default_external_eval", type="boolean", nullable=true)
*/
private $defaultExternalEval;
protected $defaultExternalEval;
/**
* @var string
*
* @ORM\Column(name="default_external_eval_prefix", type="string", length=140, nullable=true)
*/
private $defaultExternalEvalPrefix;
protected $defaultExternalEvalPrefix;
/**
* Set name.

@ -20,105 +20,105 @@ class GradebookCategory
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="text", nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var string
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=true)
*/
private $courseCode;
protected $courseCode;
/**
* @var int
*
* @ORM\Column(name="parent_id", type="integer", nullable=true)
*/
private $parentId;
protected $parentId;
/**
* @var float
*
* @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
*/
private $weight;
protected $weight;
/**
* @var bool
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
*/
private $visible;
protected $visible;
/**
* @var int
*
* @ORM\Column(name="certif_min_score", type="integer", nullable=true)
*/
private $certifMinScore;
protected $certifMinScore;
/**
* @var int
*
* @ORM\Column(name="session_id", type="integer", nullable=true)
*/
private $sessionId;
protected $sessionId;
/**
* @var int
*
* @ORM\Column(name="document_id", type="integer", nullable=true)
*/
private $documentId;
protected $documentId;
/**
* @var int
*
* @ORM\Column(name="locked", type="integer", nullable=false)
*/
private $locked;
protected $locked;
/**
* @var bool
*
* @ORM\Column(name="default_lowest_eval_exclude", type="boolean", nullable=true)
*/
private $defaultLowestEvalExclude;
protected $defaultLowestEvalExclude;
/**
* @var bool
*
* @ORM\Column(name="generate_certificates", type="boolean", nullable=false)
*/
private $generateCertificates;
protected $generateCertificates;
/**
* @var int
*
* @ORM\Column(name="grade_model_id", type="integer", nullable=true)
*/
private $gradeModelId;
protected $gradeModelId;
/**
* @var bool
@ -130,7 +130,7 @@ class GradebookCategory
* options={"default": 0 }
* )
*/
private $isRequirement;
protected $isRequirement;
/**
* Set name.

@ -20,42 +20,42 @@ class GradebookCertificate
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="cat_id", type="integer", nullable=false)
*/
private $catId;
protected $catId;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var float
*
* @ORM\Column(name="score_certificate", type="float", precision=10, scale=0, nullable=false)
*/
private $scoreCertificate;
protected $scoreCertificate;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var string
*
* @ORM\Column(name="path_certificate", type="text", nullable=true)
*/
private $pathCertificate;
protected $pathCertificate;
/**
* Set catId.

@ -20,84 +20,84 @@ class GradebookEvaluation
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="text", nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var string
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=true)
*/
private $courseCode;
protected $courseCode;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=true)
*/
private $categoryId;
protected $categoryId;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var float
*
* @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
*/
private $weight;
protected $weight;
/**
* @var float
*
* @ORM\Column(name="max", type="float", precision=10, scale=0, nullable=false)
*/
private $max;
protected $max;
/**
* @var int
*
* @ORM\Column(name="visible", type="integer", nullable=false)
*/
private $visible;
protected $visible;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=40, nullable=false)
*/
private $type;
protected $type;
/**
* @var int
*
* @ORM\Column(name="locked", type="integer", nullable=false)
*/
private $locked;
protected $locked;
/**
* Set name.

@ -20,70 +20,70 @@ class GradebookLink
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="type", type="integer", nullable=false)
*/
private $type;
protected $type;
/**
* @var int
*
* @ORM\Column(name="ref_id", type="integer", nullable=false)
*/
private $refId;
protected $refId;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var string
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=false)
*/
private $courseCode;
protected $courseCode;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=false)
*/
private $categoryId;
protected $categoryId;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var float
*
* @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
*/
private $weight;
protected $weight;
/**
* @var int
*
* @ORM\Column(name="visible", type="integer", nullable=false)
*/
private $visible;
protected $visible;
/**
* @var int
*
* @ORM\Column(name="locked", type="integer", nullable=false)
*/
private $locked;
protected $locked;
/**
* Set type.

@ -18,56 +18,56 @@ class GradebookLinkevalLog
*
* @ORM\Column(name="id_linkeval_log", type="integer", nullable=false)
*/
private $idLinkevalLog;
protected $idLinkevalLog;
/**
* @var string
*
* @ORM\Column(name="name", type="text", nullable=true)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var int
*
* @ORM\Column(name="weight", type="smallint", nullable=true)
*/
private $weight;
protected $weight;
/**
* @var bool
*
* @ORM\Column(name="visible", type="boolean", nullable=true)
*/
private $visible;
protected $visible;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=20, nullable=false)
*/
private $type;
protected $type;
/**
* @var int
*
* @ORM\Column(name="user_id_log", type="integer", nullable=false)
*/
private $userIdLog;
protected $userIdLog;
/**
* @var int
@ -76,7 +76,7 @@ class GradebookLinkevalLog
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set idLinkevalLog.

@ -18,28 +18,28 @@ class GradebookResult
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var int
*
* @ORM\Column(name="evaluation_id", type="integer", nullable=false)
*/
private $evaluationId;
protected $evaluationId;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var float
*
* @ORM\Column(name="score", type="float", precision=10, scale=0, nullable=true)
*/
private $score;
protected $score;
/**
* @var int
@ -48,7 +48,7 @@ class GradebookResult
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set userId.

@ -25,35 +25,35 @@ class GradebookScoreLog
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=false)
*/
private $categoryId;
protected $categoryId;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=false)
*/
private $userId;
protected $userId;
/**
* @var float
*
* @ORM\Column(name="score", type="float", precision=10, scale=0, nullable=false)
*/
private $score;
protected $score;
/**
* @var \DateTime
*
* @ORM\Column(name="registered_at", type="datetime", nullable=false)
*/
private $registeredAt;
protected $registeredAt;
/**
* Get the category id.

@ -18,35 +18,35 @@ class HookCall
*
* @ORM\Column(name="hook_event_id", type="integer", nullable=false)
*/
private $hookEventId;
protected $hookEventId;
/**
* @var int
*
* @ORM\Column(name="hook_observer_id", type="integer", nullable=false)
*/
private $hookObserverId;
protected $hookObserverId;
/**
* @var bool
*
* @ORM\Column(name="type", type="boolean", nullable=false)
*/
private $type;
protected $type;
/**
* @var int
*
* @ORM\Column(name="hook_order", type="integer", nullable=false)
*/
private $hookOrder;
protected $hookOrder;
/**
* @var bool
*
* @ORM\Column(name="enabled", type="boolean", nullable=false)
*/
private $enabled;
protected $enabled;
/**
* @var int
@ -55,7 +55,7 @@ class HookCall
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set hookEventId.

@ -18,14 +18,14 @@ class HookEvent
*
* @ORM\Column(name="class_name", type="string", length=255, nullable=true)
*/
private $className;
protected $className;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=255, nullable=true)
*/
private $description;
protected $description;
/**
* @var int
@ -34,7 +34,7 @@ class HookEvent
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set className.

@ -18,21 +18,21 @@ class HookObserver
*
* @ORM\Column(name="class_name", type="string", length=255, nullable=true)
*/
private $className;
protected $className;
/**
* @var string
*
* @ORM\Column(name="path", type="string", length=255, nullable=false)
*/
private $path;
protected $path;
/**
* @var string
*
* @ORM\Column(name="plugin_name", type="string", length=255, nullable=true)
*/
private $pluginName;
protected $pluginName;
/**
* @var int
@ -41,7 +41,7 @@ class HookObserver
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set className.

@ -21,55 +21,55 @@ class Language
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="original_name", type="string", length=255, nullable=true)
*/
private $originalName;
protected $originalName;
/**
* @var string
*
* @ORM\Column(name="english_name", type="string", length=255, nullable=true)
*/
private $englishName;
protected $englishName;
/**
* @var string
*
* @ORM\Column(name="isocode", type="string", length=10, nullable=true)
*/
private $isocode;
protected $isocode;
/**
* @var string
*
* @ORM\Column(name="dokeos_folder", type="string", length=250, nullable=true)
*/
private $dokeosFolder;
protected $dokeosFolder;
/**
* @var bool
*
* @ORM\Column(name="available", type="boolean", nullable=false)
*/
private $available;
protected $available;
/**
* @var \Chamilo\CoreBundle\Entity\Language
* @ORM\ManyToOne(targetEntity="Language", inversedBy="subLanguages")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true)
*/
private $parent;
protected $parent;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="Language", mappedBy="parent")
*/
private $subLanguages;
protected $subLanguages;
/**
* Language constructor.

@ -20,49 +20,49 @@ class Legal
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="date", type="integer", nullable=false)
*/
private $date;
protected $date;
/**
* @var string
*
* @ORM\Column(name="content", type="text", nullable=true)
*/
private $content;
protected $content;
/**
* @var int
*
* @ORM\Column(name="type", type="integer", nullable=false)
*/
private $type;
protected $type;
/**
* @var string
*
* @ORM\Column(name="changes", type="text", nullable=false)
*/
private $changes;
protected $changes;
/**
* @var int
*
* @ORM\Column(name="version", type="integer", nullable=true)
*/
private $version;
protected $version;
/**
* @var int
*
* @ORM\Column(name="language_id", type="integer")
*/
private $languageId;
protected $languageId;
/**
* @return int

@ -121,7 +121,7 @@ class SessionManager extends BaseEntityManager
* @param Course $course
* @param Session $session
*/
private function addUserInCourse(
protected function addUserInCourse(
$status,
User $user,
Course $course,

@ -27,77 +27,77 @@ class Message
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="user_sender_id", type="integer", nullable=false)
*/
private $userSenderId;
protected $userSenderId;
/**
* @var int
*
* @ORM\Column(name="user_receiver_id", type="integer", nullable=false)
*/
private $userReceiverId;
protected $userReceiverId;
/**
* @var bool
*
* @ORM\Column(name="msg_status", type="boolean", nullable=false)
*/
private $msgStatus;
protected $msgStatus;
/**
* @var \DateTime
*
* @ORM\Column(name="send_date", type="datetime", nullable=false)
*/
private $sendDate;
protected $sendDate;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=false)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="content", type="text", nullable=false)
*/
private $content;
protected $content;
/**
* @var int
*
* @ORM\Column(name="group_id", type="integer", nullable=false)
*/
private $groupId;
protected $groupId;
/**
* @var int
*
* @ORM\Column(name="parent_id", type="integer", nullable=false)
*/
private $parentId;
protected $parentId;
/**
* @var \DateTime
*
* @ORM\Column(name="update_date", type="datetime", nullable=true)
*/
private $updateDate;
protected $updateDate;
/**
* @var int
*
* @ORM\Column(name="votes", type="integer", nullable=true)
*/
private $votes;
protected $votes;
/**
* Set userSenderId.

@ -20,42 +20,42 @@ class MessageAttachment
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="path", type="string", length=255, nullable=false)
*/
private $path;
protected $path;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", nullable=true)
*/
private $comment;
protected $comment;
/**
* @var int
*
* @ORM\Column(name="size", type="integer", nullable=false)
*/
private $size;
protected $size;
/**
* @var int
*
* @ORM\Column(name="message_id", type="integer", nullable=false)
*/
private $messageId;
protected $messageId;
/**
* @var string
*
* @ORM\Column(name="filename", type="string", length=255, nullable=false)
*/
private $filename;
protected $filename;
/**
* Set path.

@ -27,49 +27,49 @@ class Notification
*
* @ORM\Column(name="dest_user_id", type="integer", nullable=false)
*/
private $destUserId;
protected $destUserId;
/**
* @var string
*
* @ORM\Column(name="dest_mail", type="string", length=255, nullable=true)
*/
private $destMail;
protected $destMail;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="content", type="text", nullable=true)
*/
private $content;
protected $content;
/**
* @var int
*
* @ORM\Column(name="send_freq", type="smallint", nullable=true)
*/
private $sendFreq;
protected $sendFreq;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="sent_at", type="datetime", nullable=true)
*/
private $sentAt;
protected $sentAt;
/**
* @var int
@ -78,7 +78,7 @@ class Notification
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set destUserId.

@ -18,49 +18,49 @@ class OpenidAssociation
*
* @ORM\Column(name="idp_endpoint_uri", type="text", nullable=false)
*/
private $idpEndpointUri;
protected $idpEndpointUri;
/**
* @var string
*
* @ORM\Column(name="session_type", type="string", length=30, nullable=false)
*/
private $sessionType;
protected $sessionType;
/**
* @var string
*
* @ORM\Column(name="assoc_handle", type="text", nullable=false)
*/
private $assocHandle;
protected $assocHandle;
/**
* @var string
*
* @ORM\Column(name="assoc_type", type="text", nullable=false)
*/
private $assocType;
protected $assocType;
/**
* @var int
*
* @ORM\Column(name="expires_in", type="bigint", nullable=false)
*/
private $expiresIn;
protected $expiresIn;
/**
* @var string
*
* @ORM\Column(name="mac_key", type="text", nullable=false)
*/
private $macKey;
protected $macKey;
/**
* @var int
*
* @ORM\Column(name="created", type="bigint", nullable=false)
*/
private $created;
protected $created;
/**
* @var int
@ -69,7 +69,7 @@ class OpenidAssociation
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set idpEndpointUri.

@ -21,70 +21,70 @@ class PersonalAgenda
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="user", type="integer", nullable=true)
*/
private $user;
protected $user;
/**
* @var string
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="text", type="text", nullable=true)
*/
private $text;
protected $text;
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
protected $date;
/**
* @var \DateTime
*
* @ORM\Column(name="enddate", type="datetime", nullable=true)
*/
private $enddate;
protected $enddate;
/**
* @var string
*
* @ORM\Column(name="course", type="string", length=255, nullable=true)
*/
private $course;
protected $course;
/**
* @var int
*
* @ORM\Column(name="parent_event_id", type="integer", nullable=true)
*/
private $parentEventId;
protected $parentEventId;
/**
* @var int
*
* @ORM\Column(name="all_day", type="integer", nullable=false)
*/
private $allDay;
protected $allDay;
/**
* @var string
*
* @ORM\Column(name="color", type="string", length=255, nullable=true)
*/
private $color;
protected $color;
/**
* Set user.

@ -18,28 +18,28 @@ class PersonalAgendaRepeat
*
* @ORM\Column(name="cal_type", type="string", length=20, nullable=true)
*/
private $calType;
protected $calType;
/**
* @var int
*
* @ORM\Column(name="cal_end", type="integer", nullable=true)
*/
private $calEnd;
protected $calEnd;
/**
* @var int
*
* @ORM\Column(name="cal_frequency", type="integer", nullable=true)
*/
private $calFrequency;
protected $calFrequency;
/**
* @var string
*
* @ORM\Column(name="cal_days", type="string", length=7, nullable=true)
*/
private $calDays;
protected $calDays;
/**
* @var int
@ -48,7 +48,7 @@ class PersonalAgendaRepeat
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $calId;
protected $calId;
/**
* Set calType.

@ -20,7 +20,7 @@ class PersonalAgendaRepeatNot
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $calId;
protected $calId;
/**
* @var int
@ -29,7 +29,7 @@ class PersonalAgendaRepeatNot
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $calDate;
protected $calDate;
/**
* Set calId.

@ -31,21 +31,21 @@ class PortfolioCategory
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255)
*/
private $title;
protected $title;
/**
* @var null
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description = null;
protected $description = null;
/**
* @var User
@ -53,21 +53,21 @@ class PortfolioCategory
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $user;
protected $user;
/**
* @var bool
*
* @ORM\Column(name="is_visible", type="boolean", options={"default": true})
*/
private $isVisible = true;
protected $isVisible = true;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Portfolio", mappedBy="category")
*/
private $items;
protected $items;
/**
* PortfolioCategory constructor.

@ -20,21 +20,21 @@ class Promotion
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var Career
@ -42,28 +42,28 @@ class Promotion
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Career")
* @ORM\JoinColumn(name="career_id", referencedColumnName="id")
*/
private $career;
protected $career;
/**
* @var int
*
* @ORM\Column(name="status", type="integer", nullable=false)
*/
private $status;
protected $status;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private $createdAt;
protected $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=false)
*/
private $updatedAt;
protected $updatedAt;
/**
* Get id.

@ -215,7 +215,7 @@ class SequenceRepository extends EntityRepository
*
* @return array
*/
private function findSessionFromVerticesEdges(Vertices $verticesEdges)
protected function findSessionFromVerticesEdges(Vertices $verticesEdges)
{
$sessionVertices = [];
foreach ($verticesEdges as $supVertex) {

@ -20,42 +20,42 @@ class Room
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true, unique=false)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="geolocation", type="string", length=255, nullable=true, unique=false)
*/
private $geolocation;
protected $geolocation;
/**
* @var string
*
* @ORM\Column(name="ip", type="string", length=39, nullable=true, unique=false)
*/
private $ip;
protected $ip;
/**
* @var string
*
* @ORM\Column(name="ip_mask", type="string", length=6, nullable=true, unique=false)
*/
private $ipMask;
protected $ipMask;
/**
* @var BranchSync
@ -63,7 +63,7 @@ class Room
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\BranchSync")
* @ORM\JoinColumn(name="branch_id", referencedColumnName="id")
*/
private $branch;
protected $branch;
/**
* Get id.

@ -18,35 +18,35 @@ class SearchEngineRef
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=false)
*/
private $courseCode;
protected $courseCode;
/**
* @var string
*
* @ORM\Column(name="tool_id", type="string", length=100, nullable=false)
*/
private $toolId;
protected $toolId;
/**
* @var int
*
* @ORM\Column(name="ref_id_high_level", type="integer", nullable=false)
*/
private $refIdHighLevel;
protected $refIdHighLevel;
/**
* @var int
*
* @ORM\Column(name="ref_id_second_level", type="integer", nullable=true)
*/
private $refIdSecondLevel;
protected $refIdSecondLevel;
/**
* @var int
*
* @ORM\Column(name="search_did", type="integer", nullable=false)
*/
private $searchDid;
protected $searchDid;
/**
* @var int
@ -55,7 +55,7 @@ class SearchEngineRef
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set courseCode.

@ -22,21 +22,21 @@ class Sequence
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string")
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="graph", type="text", nullable=true)
*/
private $graph;
protected $graph;
/**
* @var \DateTime
@ -44,7 +44,7 @@ class Sequence
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
protected $createdAt;
/**
* @var \DateTime
@ -52,7 +52,7 @@ class Sequence
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_at", type="datetime")
*/
private $updatedAt;
protected $updatedAt;
/**
* @return string

@ -20,42 +20,42 @@ class SequenceCondition
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="mat_op", type="string")
*/
private $mathOperation;
protected $mathOperation;
/**
* @var string
*
* @ORM\Column(name="param", type="float")
*/
private $param;
protected $param;
/**
* @var string
*
* @ORM\Column(name="act_true", type="integer")
*/
private $actTrue;
protected $actTrue;
/**
* @var string
*
* @ORM\Column(name="act_false", type="string")
*/
private $actFalse;
protected $actFalse;
/**
* Get id.

@ -20,19 +20,19 @@ class SequenceFormula
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @ORM\ManyToOne(targetEntity="SequenceMethod")
* @ORM\JoinColumn(name="sequence_method_id", referencedColumnName="id")
*/
private $method;
protected $method;
/**
* @ORM\ManyToOne(targetEntity="SequenceVariable")
* @ORM\JoinColumn(name="sequence_variable_id", referencedColumnName="id")
*/
private $variable;
protected $variable;
/**
* Get id.

@ -20,42 +20,42 @@ class SequenceMethod
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="formula", type="text")
*/
private $formula;
protected $formula;
/**
* @var string
*
* @ORM\Column(name="assign", type="integer")
*/
private $assign;
protected $assign;
/**
* @var string
*
* @ORM\Column(name="met_type", type="string")
*/
private $metType;
protected $metType;
/**
* @var string
*
* @ORM\Column(name="act_false", type="string")
*/
private $actFalse;
protected $actFalse;
/**
* Get id.

@ -31,21 +31,21 @@ class SequenceResource
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="type", type="integer")
*/
private $type;
protected $type;
/**
* @var int
*
* @ORM\Column(name="resource_id", type="integer")
*/
private $resourceId;
protected $resourceId;
/**
* Get id.

@ -20,41 +20,41 @@ class SequenceRowEntity
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="c_id", type="integer")
*/
private $cId;
protected $cId;
/**
* @var int
*
* @ORM\Column(name="session_id", type="integer")
*/
private $sessionId;
protected $sessionId;
/**
* @var int
*
* @ORM\Column(name="row_id", type="integer")
*/
private $rowId;
protected $rowId;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @ORM\ManyToOne(targetEntity="SequenceTypeEntity")
* @ORM\JoinColumn(name="sequence_type_entity_id", referencedColumnName="id")
*/
private $type;
protected $type;
/**
* Get id.

@ -20,14 +20,14 @@ class SequenceRule
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* Get id.

@ -20,19 +20,19 @@ class SequenceRuleCondition
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @ORM\ManyToOne(targetEntity="SequenceRule")
* @ORM\JoinColumn(name="sequence_rule_id", referencedColumnName="id")
*/
private $rule;
protected $rule;
/**
* @ORM\ManyToOne(targetEntity="SequenceCondition")
* @ORM\JoinColumn(name="sequence_condition_id", referencedColumnName="id")
*/
private $condition;
protected $condition;
/**
* Get id.

@ -20,26 +20,26 @@ class SequenceRuleMethod
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="method_order", type="integer")
*/
private $methodOrder;
protected $methodOrder;
/**
* @ORM\ManyToOne(targetEntity="SequenceRule")
* @ORM\JoinColumn(name="sequence_rule_id", referencedColumnName="id")
*/
private $rule;
protected $rule;
/**
* @ORM\ManyToOne(targetEntity="SequenceMethod")
* @ORM\JoinColumn(name="sequence_method_id", referencedColumnName="id")
*/
private $method;
protected $method;
/**
* Get id.

@ -20,28 +20,28 @@ class SequenceTypeEntity
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="ent_table", type="string", length=255, nullable=false)
*/
private $entityTable;
protected $entityTable;
/**
* Get id.

@ -20,19 +20,19 @@ class SequenceValid
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @ORM\ManyToOne(targetEntity="SequenceVariable")
* @ORM\JoinColumn(name="sequence_variable_id", referencedColumnName="id")
*/
private $variable;
protected $variable;
/**
* @ORM\ManyToOne(targetEntity="SequenceCondition")
* @ORM\JoinColumn(name="sequence_condition_id", referencedColumnName="id")
*/
private $condition;
protected $condition;
/**
* Get id.

@ -20,76 +20,76 @@ class SequenceValue
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer")
*/
private $userId;
protected $userId;
/**
* @ORM\ManyToOne(targetEntity="SequenceRowEntity")
* @ORM\JoinColumn(name="sequence_row_entity_id", referencedColumnName="id")
*/
private $entity;
protected $entity;
/**
* @var int
*
* @ORM\Column(name="advance", type="float")
*/
private $advance;
protected $advance;
/**
* @var int
*
* @ORM\Column(name="complete_items", type="integer")
*/
private $completeItems;
protected $completeItems;
/**
* @var int
*
* @ORM\Column(name="total_items", type="integer")
*/
private $totalItems;
protected $totalItems;
/**
* @var int
*
* @ORM\Column(name="success", type="boolean")
*/
private $success;
protected $success;
/**
* @var \DateTime
*
* @ORM\Column(name="success_date", type="datetime", nullable=true)
*/
private $successDate;
protected $successDate;
/**
* @var int
*
* @ORM\Column(name="available", type="boolean")
*/
private $available;
protected $available;
/**
* @var \DateTime
*
* @ORM\Column(name="available_start_date", type="datetime", nullable=true)
*/
private $availableStartDate;
protected $availableStartDate;
/**
* @var \DateTime
*
* @ORM\Column(name="available_end_date", type="datetime", nullable=true)
*/
private $availableEndDate;
protected $availableEndDate;
/**
* Get id.

@ -20,28 +20,28 @@ class SequenceVariable
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", nullable=true)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
protected $description;
/**
* @var string
*
* @ORM\Column(name="default_val", type="string", nullable=true)
*/
private $defaultValue;
protected $defaultValue;
/**
* Get id.

@ -411,7 +411,7 @@ class Session
{
if ($this->getCourses()->count()) {
$criteria = Criteria::create()->where(
Criteria::expr()->eq("course", $course)
Criteria::expr()->eq('course', $course)
);
$relation = $this->getCourses()->matching($criteria);
@ -508,14 +508,14 @@ class Session
public function getUserInCourse(User $user, Course $course, $status = null)
{
$criteria = Criteria::create()->where(
Criteria::expr()->eq("course", $course)
Criteria::expr()->eq('course', $course)
)->andWhere(
Criteria::expr()->eq("user", $user)
Criteria::expr()->eq('user', $user)
);
if (!is_null($status)) {
$criteria->andWhere(
Criteria::expr()->eq("status", $status)
Criteria::expr()->eq('status', $status)
);
}
@ -527,7 +527,7 @@ class Session
*
* @param string $name
*
* @return Session
* @return $this
*/
public function setName($name)
{
@ -551,7 +551,7 @@ class Session
*
* @param string $description
*
* @return Groups
* @return $this
*/
public function setDescription($description)
{
@ -919,11 +919,7 @@ class Session
{
$now = new \Datetime('now');
if ($now > $this->getAccessStartDate()) {
return true;
}
return false;
return $now > $this->getAccessStartDate();
}
/**
@ -1021,11 +1017,11 @@ class Session
{
if ($this->getUserCourseSubscriptions()->count()) {
$criteria = Criteria::create()->where(
Criteria::expr()->eq("user", $subscription->getUser())
Criteria::expr()->eq('user', $subscription->getUser())
)->andWhere(
Criteria::expr()->eq("course", $subscription->getCourse())
Criteria::expr()->eq('course', $subscription->getCourse())
)->andWhere(
Criteria::expr()->eq("session", $subscription->getSession())
Criteria::expr()->eq('session', $subscription->getSession())
);
$relation = $this->getUserCourseSubscriptions()->matching($criteria);
@ -1085,7 +1081,7 @@ class Session
/**
* Get user from course by status.
*
* @param \Chamilo\CoreBundle\Entity\Course $course
* @param Course $course
* @param int $status
*
* @return \Doctrine\Common\Collections\ArrayCollection|\Doctrine\Common\Collections\Collection
@ -1094,10 +1090,10 @@ class Session
{
$criteria = Criteria::create()
->where(
Criteria::expr()->eq("course", $course)
Criteria::expr()->eq('course', $course)
)
->andWhere(
Criteria::expr()->eq("status", $status)
Criteria::expr()->eq('status', $status)
);
return $this->userCourseSubscriptions->matching($criteria);

@ -30,28 +30,28 @@ class SessionCategory
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100, nullable=true, unique=false)
*/
private $name;
protected $name;
/**
* @var \DateTime
*
* @ORM\Column(name="date_start", type="date", nullable=true, unique=false)
*/
private $dateStart;
protected $dateStart;
/**
* @var \DateTime
*
* @ORM\Column(name="date_end", type="date", nullable=true, unique=false)
*/
private $dateEnd;
protected $dateEnd;
/**
* @return string

@ -23,91 +23,91 @@ class SettingsCurrent
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="variable", type="string", length=255, nullable=true)
*/
private $variable;
protected $variable;
/**
* @var string
*
* @ORM\Column(name="subkey", type="string", length=255, nullable=true)
*/
private $subkey;
protected $subkey;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=255, nullable=true)
*/
private $type;
protected $type;
/**
* @var string
*
* @ORM\Column(name="category", type="string", length=255, nullable=true)
*/
private $category;
protected $category;
/**
* @var string
*
* @ORM\Column(name="selected_value", type="string", length=255, nullable=true)
*/
private $selectedValue;
protected $selectedValue;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=false)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="comment", type="string", length=255, nullable=true)
*/
private $comment;
protected $comment;
/**
* @var string
*
* @ORM\Column(name="scope", type="string", length=50, nullable=true)
*/
private $scope;
protected $scope;
/**
* @var string
*
* @ORM\Column(name="subkeytext", type="string", length=255, nullable=true)
*/
private $subkeytext;
protected $subkeytext;
/**
* @var int
*
* @ORM\Column(name="access_url", type="integer", nullable=false, options={"default": 1 } )
*/
private $accessUrl;
protected $accessUrl;
/**
* @var int
*
* @ORM\Column(name="access_url_changeable", type="integer", nullable=false)
*/
private $accessUrlChangeable;
protected $accessUrlChangeable;
/**
* @var int
*
* @ORM\Column(name="access_url_locked", type="integer", nullable=false, options={"default": 0 } )
*/
private $accessUrlLocked = 0;
protected $accessUrlLocked = 0;
/**
* Set variable.

@ -20,28 +20,28 @@ class SettingsOptions
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="variable", type="string", length=255, nullable=true)
*/
private $variable;
protected $variable;
/**
* @var string
*
* @ORM\Column(name="value", type="string", length=255, nullable=true)
*/
private $value;
protected $value;
/**
* @var string
*
* @ORM\Column(name="display_text", type="string", length=255, nullable=false)
*/
private $displayText;
protected $displayText;
/**
* Set variable.

@ -18,70 +18,70 @@ class SharedSurvey
*
* @ORM\Column(name="code", type="string", length=20, nullable=true)
*/
private $code;
protected $code;
/**
* @var string
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
private $title;
protected $title;
/**
* @var string
*
* @ORM\Column(name="subtitle", type="text", nullable=true)
*/
private $subtitle;
protected $subtitle;
/**
* @var string
*
* @ORM\Column(name="author", type="string", length=250, nullable=true)
*/
private $author;
protected $author;
/**
* @var string
*
* @ORM\Column(name="lang", type="string", length=20, nullable=true)
*/
private $lang;
protected $lang;
/**
* @var string
*
* @ORM\Column(name="template", type="string", length=20, nullable=true)
*/
private $template;
protected $template;
/**
* @var string
*
* @ORM\Column(name="intro", type="text", nullable=true)
*/
private $intro;
protected $intro;
/**
* @var string
*
* @ORM\Column(name="surveythanks", type="text", nullable=true)
*/
private $surveythanks;
protected $surveythanks;
/**
* @var \DateTime
*
* @ORM\Column(name="creation_date", type="datetime", nullable=false)
*/
private $creationDate;
protected $creationDate;
/**
* @var string
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=false)
*/
private $courseCode;
protected $courseCode;
/**
* @var int
@ -90,7 +90,7 @@ class SharedSurvey
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $surveyId;
protected $surveyId;
/**
* Set code.

@ -18,56 +18,56 @@ class SharedSurveyQuestion
*
* @ORM\Column(name="survey_id", type="integer", nullable=false)
*/
private $surveyId;
protected $surveyId;
/**
* @var string
*
* @ORM\Column(name="survey_question", type="text", nullable=false)
*/
private $surveyQuestion;
protected $surveyQuestion;
/**
* @var string
*
* @ORM\Column(name="survey_question_comment", type="text", nullable=false)
*/
private $surveyQuestionComment;
protected $surveyQuestionComment;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=250, nullable=false)
*/
private $type;
protected $type;
/**
* @var string
*
* @ORM\Column(name="display", type="string", length=10, nullable=false)
*/
private $display;
protected $display;
/**
* @var int
*
* @ORM\Column(name="sort", type="integer", nullable=false)
*/
private $sort;
protected $sort;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=40, nullable=false)
*/
private $code;
protected $code;
/**
* @var int
*
* @ORM\Column(name="max_value", type="integer", nullable=false)
*/
private $maxValue;
protected $maxValue;
/**
* @var int
@ -76,7 +76,7 @@ class SharedSurveyQuestion
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $questionId;
protected $questionId;
/**
* Set surveyId.

@ -18,28 +18,28 @@ class SharedSurveyQuestionOption
*
* @ORM\Column(name="question_id", type="integer", nullable=false)
*/
private $questionId;
protected $questionId;
/**
* @var int
*
* @ORM\Column(name="survey_id", type="integer", nullable=false)
*/
private $surveyId;
protected $surveyId;
/**
* @var string
*
* @ORM\Column(name="option_text", type="text", nullable=false)
*/
private $optionText;
protected $optionText;
/**
* @var int
*
* @ORM\Column(name="sort", type="integer", nullable=false)
*/
private $sort;
protected $sort;
/**
* @var int
@ -48,7 +48,7 @@ class SharedSurveyQuestionOption
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $questionOptionId;
protected $questionOptionId;
/**
* Set questionId.

@ -52,63 +52,63 @@ class Skill
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="short_code", type="string", length=100, nullable=false)
*/
private $shortCode;
protected $shortCode;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* @var int
*
* @ORM\Column(name="access_url_id", type="integer", nullable=false)
*/
private $accessUrlId;
protected $accessUrlId;
/**
* @var string
*
* @ORM\Column(name="icon", type="string", length=255, nullable=false)
*/
private $icon;
protected $icon;
/**
* @var string
*
* @ORM\Column(name="criteria", type="text", nullable=true)
*/
private $criteria;
protected $criteria;
/**
* @var int
*
* @ORM\Column(name="status", type="integer", nullable=false, options={"default": 1})
*/
private $status;
protected $status;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=false)
*/
private $updatedAt;
protected $updatedAt;
/**
* @return string

@ -20,21 +20,21 @@ class SkillProfile
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
private $description;
protected $description;
/**
* Set name.

@ -20,28 +20,28 @@ class SkillRelGradebook
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="gradebook_id", type="integer", nullable=false)
*/
private $gradebookId;
protected $gradebookId;
/**
* @var int
*
* @ORM\Column(name="skill_id", type="integer", nullable=false)
*/
private $skillId;
protected $skillId;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=10, nullable=false)
*/
private $type;
protected $type;
/**
* Set gradebookId.

@ -20,21 +20,21 @@ class SkillRelProfile
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="skill_id", type="integer", nullable=false)
*/
private $skillId;
protected $skillId;
/**
* @var int
*
* @ORM\Column(name="profile_id", type="integer", nullable=false)
*/
private $profileId;
protected $profileId;
/**
* Set skillId.

@ -20,35 +20,35 @@ class SkillRelSkill
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @var int
*
* @ORM\Column(name="skill_id", type="integer", nullable=false)
*/
private $skillId;
protected $skillId;
/**
* @var int
*
* @ORM\Column(name="parent_id", type="integer", nullable=false)
*/
private $parentId;
protected $parentId;
/**
* @var int
*
* @ORM\Column(name="relation_type", type="integer", nullable=false)
*/
private $relationType;
protected $relationType;
/**
* @var int
*
* @ORM\Column(name="level", type="integer", nullable=false)
*/
private $level;
protected $level;
/**
* Set skillId.

@ -24,10 +24,6 @@ use Doctrine\ORM\Mapping as ORM;
*/
class SkillRelUser
{
/**
* @ORM\OneToMany(targetEntity="SkillRelUserComment", mappedBy="skillRelUser")
*/
protected $comments;
/**
* @var int
*
@ -35,39 +31,44 @@ class SkillRelUser
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @ORM\OneToMany(targetEntity="SkillRelUserComment", mappedBy="skillRelUser")
*/
protected $comments;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="achievedSkills", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
protected $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Skill", inversedBy="issuedSkills", cascade={"persist"})
* @ORM\JoinColumn(name="skill_id", referencedColumnName="id", nullable=false)
*/
private $skill;
protected $skill;
/**
* @var \DateTime
*
* @ORM\Column(name="acquired_skill_at", type="datetime", nullable=false)
*/
private $acquiredSkillAt;
protected $acquiredSkillAt;
/**
* @var int
*
* @ORM\Column(name="assigned_by", type="integer", nullable=false)
*/
private $assignedBy;
protected $assignedBy;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="issuedSkills", cascade={"persist"})
* @ORM\JoinColumn(name="course_id", referencedColumnName="id", nullable=true)
*/
private $course;
protected $course;
/**
* @var Session
@ -75,7 +76,7 @@ class SkillRelUser
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="issuedSkills", cascade={"persist"})
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true)
*/
private $session;
protected $session;
/**
* @var Level
@ -83,21 +84,21 @@ class SkillRelUser
* @ORM\ManyToOne(targetEntity="Chamilo\SkillBundle\Entity\Level")
* @ORM\JoinColumn(name="acquired_level", referencedColumnName="id")
*/
private $acquiredLevel;
protected $acquiredLevel;
/**
* @var string
*
* @ORM\Column(name="argumentation", type="text")
*/
private $argumentation;
protected $argumentation;
/**
* @var int
*
* @ORM\Column(name="argumentation_author_id", type="integer")
*/
private $argumentationAuthorId;
protected $argumentationAuthorId;
/**
* SkillRelUser constructor.
@ -342,56 +343,17 @@ class SkillRelUser
{
$source = '';
if ($this->session && $this->session->getId() != 0) {
$source .= "[{$this->session->getName()}] ";
if ($this->session && $this->getSession()->getId() != 0) {
$source .= "[{$this->getSession()->getName()}] ";
}
if ($this->course) {
$source .= $this->course->getTitle();
$source .= $this->getCourse()->getTitle();
}
return $source;
}
/**
* Get the URL for the issue.
*
* @return string
*/
public function getIssueUrl()
{
return api_get_path(WEB_PATH)."badge/{$this->id}";
}
/**
* Get the URL for the All issues page.
*
* @return string
*/
public function getIssueUrlAll()
{
return api_get_path(WEB_PATH)."skill/{$this->skill->getId()}/user/{$this->user->getId()}";
}
/**
* Get the URL for the assertion.
*
* @return string
*/
public function getAssertionUrl()
{
$url = api_get_path(WEB_CODE_PATH).'badge/assertion.php?';
$url .= http_build_query([
'user' => $this->getUser()->getId(),
'skill' => $this->getSkill()->getId(),
'course' => $this->course ? $this->getCourse()->getId() : 0,
'session' => $this->session ? $this->getSession()->getId() : 0,
]);
return $url;
}
/**
* Get comments.
*

@ -26,40 +26,40 @@ class SkillRelUserComment
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", inversedBy="comments")
* @ORM\JoinColumn(name="skill_rel_user_id", referencedColumnName="id")
*/
private $skillRelUser;
protected $skillRelUser;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="commentedUserSkills")
* @ORM\JoinColumn(name="feedback_giver_id", referencedColumnName="id")
*/
private $feedbackGiver;
protected $feedbackGiver;
/**
* @var string
*
* @ORM\Column(name="feedback_text", type="text")
*/
private $feedbackText;
protected $feedbackText;
/**
* @var int
*
* @ORM\Column(name="feedback_value", type="integer", nullable=true, options={"default":1})
*/
private $feedbackValue;
protected $feedbackValue;
/**
* @var \DateTime
*
* @ORM\Column(name="feedback_datetime", type="datetime")
*/
private $feedbackDateTime;
protected $feedbackDateTime;
/**
* Get id.

@ -20,14 +20,14 @@ class SpecificField
*
* @ORM\Column(name="code", type="string", length=1, nullable=false)
*/
private $code;
protected $code;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=200, nullable=false)
*/
private $name;
protected $name;
/**
* @var int
@ -36,7 +36,7 @@ class SpecificField
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set code.

@ -18,35 +18,35 @@ class SpecificFieldValues
*
* @ORM\Column(name="course_code", type="string", length=40, nullable=false)
*/
private $courseCode;
protected $courseCode;
/**
* @var string
*
* @ORM\Column(name="tool_id", type="string", length=100, nullable=false)
*/
private $toolId;
protected $toolId;
/**
* @var int
*
* @ORM\Column(name="ref_id", type="integer", nullable=false)
*/
private $refId;
protected $refId;
/**
* @var int
*
* @ORM\Column(name="field_id", type="integer", nullable=false)
*/
private $fieldId;
protected $fieldId;
/**
* @var string
*
* @ORM\Column(name="value", type="string", length=200, nullable=false)
*/
private $value;
protected $value;
/**
* @var int
@ -55,7 +55,7 @@ class SpecificFieldValues
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
protected $id;
/**
* Set courseCode.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save