Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2624/head
Angel Fernando Quiroz Campos 7 years ago
commit c740acac40
  1. 23
      main/admin/legal_add.php
  2. 24
      main/inc/ajax/admin.ajax.php
  3. 5
      main/inc/lib/extra_field.lib.php
  4. 16
      main/inc/lib/internationalization.lib.php
  5. 30
      main/inc/lib/legal.lib.php
  6. 71
      main/social/personal_data.php
  7. 25
      src/Chamilo/CoreBundle/Entity/Repository/BranchSyncRepository.php
  8. 106
      src/Chamilo/UserBundle/Repository/UserRepository.php

@ -25,6 +25,26 @@ $term_preview = [
'content' => '', 'content' => '',
'changes' => '', 'changes' => '',
]; ];
$extraField = new ExtraField('terms_and_condition');
$types = LegalManager::getTreatmentTypeList();
foreach ($types as $variable => $name) {
$label = 'PersonalData'.ucfirst($name).'Title';
$params = [
'variable' => $variable,
'display_text' => $label,
'field_type' => ExtraField::FIELD_TYPE_TEXTAREA,
'default_value' => '',
'visible' => true,
'changeable' => true,
'filter' => true,
'visible_to_self' => true,
'visible_to_others' => true,
];
$extraField->save($params);
}
if ($form->validate()) { if ($form->validate()) {
$check = Security::check_token('post'); $check = Security::check_token('post');
if ($check) { if ($check) {
@ -67,7 +87,7 @@ if ($form->validate()) {
$tok = Security::get_token(); $tok = Security::get_token();
header('Location: legal_list.php?sec_token='.$tok); header('Location: legal_list.php?sec_token='.$tok);
exit(); exit();
} elseif ($submit == 'preview') { } elseif ($submit === 'preview') {
$defaults['type'] = $type; $defaults['type'] = $type;
$defaults['content'] = $content; $defaults['content'] = $content;
$defaults['changes'] = $changes; $defaults['changes'] = $changes;
@ -128,7 +148,6 @@ if (isset($_POST['language'])) {
} }
$termId = isset($term_preview['id']) ? $term_preview['id'] : 0; $termId = isset($term_preview['id']) ? $term_preview['id'] : 0;
$extraField = new ExtraField('terms_and_condition');
$returnParams = $extraField->addElements( $returnParams = $extraField->addElements(
$form, $form,
$termId, $termId,

@ -1,5 +1,10 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use \Chamilo\CoreBundle\Entity\Repository\BranchSyncRepository;
use \Chamilo\CoreBundle\Entity\BranchSync;
use \Doctrine\Common\Collections\Criteria;
/** /**
* Responses to AJAX calls. * Responses to AJAX calls.
*/ */
@ -108,13 +113,9 @@ function version_check()
/** /**
* Check if the current installation is up to date * Check if the current installation is up to date
* The code is borrowed from phpBB and slighlty modified. * The code is borrowed from phpBB and slighlty modified.
*
* @author The phpBB Group <support@phpbb.com> (the code)
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University (the modifications)
* @author Yannick Warnier <ywarnier@beeznest.org> for the move to HTTP request
* @copyright (C) 2001 The phpBB Group
*
* @return string language string with some layout (color) * @return string language string with some layout (color)
* @throws \Exception
* @throws \InvalidArgumentException
*/ */
function check_system_version() function check_system_version()
{ {
@ -162,6 +163,16 @@ function check_system_version()
$packager = 'chamilo'; $packager = 'chamilo';
} }
$uniqueId = '';
$entityManager = Database::getManager();
/** @var BranchSyncRepository $branch */
$repository = $entityManager->getRepository('ChamiloCoreBundle:BranchSync');
/** @var BranchSync $branch */
$branch = $repository->getTopBranch();
if (is_a($branch, '\Chamilo\CoreBundle\Entity\BranchSync')) {
$uniqueId = $branch->getUniqueId();
}
$data = [ $data = [
'url' => api_get_path(WEB_PATH), 'url' => api_get_path(WEB_PATH),
'campus' => api_get_setting('siteName'), 'campus' => api_get_setting('siteName'),
@ -183,6 +194,7 @@ function check_system_version()
// the default config file (main/install/configuration.dist.php) // the default config file (main/install/configuration.dist.php)
// or in the installed config file. The default value is 'chamilo' // or in the installed config file. The default value is 'chamilo'
'packager' => $packager, 'packager' => $packager,
'unique_id' => $uniqueId,
]; ];
$version = null; $version = null;

@ -1049,6 +1049,11 @@ class ExtraField extends Model
$freezeElement = $field_details['visible_to_self'] == 0 || $field_details['changeable'] == 0; $freezeElement = $field_details['visible_to_self'] == 0 || $field_details['changeable'] == 0;
} }
$translatedDisplayText = get_lang($field_details['display_text'], true);
if (!empty($translatedDisplayText)) {
$field_details['display_text'] = $translatedDisplayText;
}
switch ($field_details['field_type']) { switch ($field_details['field_type']) {
case self::FIELD_TYPE_TEXT: case self::FIELD_TYPE_TEXT:
$form->addElement( $form->addElement(

@ -60,11 +60,11 @@ define('PERSON_NAME_EMAIL_ADDRESS', PERSON_NAME_WESTERN_ORDER);
define('PERSON_NAME_DATA_EXPORT', PERSON_NAME_EASTERN_ORDER); define('PERSON_NAME_DATA_EXPORT', PERSON_NAME_EASTERN_ORDER);
/** /**
* Returns a translated (localized) string, called by its identificator. * Returns a translated (localized) string, called by its ID.
* *
* @param string $variable this is the identificator (name) of the translated string to be retrieved * @param string $variable this is the ID (name) of the translated string to be retrieved
* @param string $reserved this parameter has been reserved for future use * @param bool $strict If variable is not found, then: if false: returns variable name with or without brackets; true: returns ''
* @param string $language (optional) Language indentificator. If it is omited, the current interface language is assumed. * @param string $language (optional) Language ID. If it is omitted, the current interface language is assumed.
* *
* @return string returns the requested string in the correspondent language * @return string returns the requested string in the correspondent language
* *
@ -82,7 +82,7 @@ define('PERSON_NAME_DATA_EXPORT', PERSON_NAME_EASTERN_ORDER);
* *
* @see http://translate.chamilo.org/ * @see http://translate.chamilo.org/
*/ */
function get_lang($variable, $reserved = null, $language = null) function get_lang($variable, $strict = false, $language = null)
{ {
// For serving some old hacks: // For serving some old hacks:
// By manipulating this global variable the translation may // By manipulating this global variable the translation may
@ -141,17 +141,18 @@ function get_lang($variable, $reserved = null, $language = null)
// - from a local variable after reloading the language files - on test server mode or when requested language // - from a local variable after reloading the language files - on test server mode or when requested language
// is different than the genuine interface language. // is different than the genuine interface language.
$read_global_variables = $is_interface_language; $read_global_variables = $is_interface_language;
$langvar = '';
if ($read_global_variables) { if ($read_global_variables) {
if (isset($GLOBALS[$variable])) { if (isset($GLOBALS[$variable])) {
$langvar = $GLOBALS[$variable]; $langvar = $GLOBALS[$variable];
} elseif (isset($GLOBALS["lang$variable"])) { } elseif (isset($GLOBALS["lang$variable"])) {
$langvar = $GLOBALS["lang$variable"]; $langvar = $GLOBALS["lang$variable"];
} else { } elseif (!$strict) {
$langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable; $langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable;
} }
} }
if (empty($langvar) || !is_string($langvar)) { if (empty($langvar) || !is_string($langvar) && !$strict) {
$langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable; $langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable;
} }
$ret = $cache[$language][$variable] = $langvar; $ret = $cache[$language][$variable] = $langvar;
@ -168,6 +169,7 @@ function get_lang($variable, $reserved = null, $language = null)
* @param bool $setParentLanguageName * @param bool $setParentLanguageName
* *
* @return string the current language of the interface * @return string the current language of the interface
* @throws Exception
*/ */
function api_get_interface_language( function api_get_interface_language(
$purified = false, $purified = false,

@ -386,21 +386,21 @@ class LegalManager
public static function getTreatmentTypeList() public static function getTreatmentTypeList()
{ {
return [ return [
101 => 'collection', 'privacy_terms_collection' => 'collection',
102 => 'recording', 'privacy_terms_recording' => 'recording',
103 => 'organization', 'privacy_terms_organization' => 'organization',
104 => 'structure', 'privacy_terms_structure' => 'structure',
105 => 'conservation', 'privacy_terms_conservation' => 'conservation',
106 => 'adaptation', 'privacy_terms_adaptation' => 'adaptation',
107 => 'extraction', 'privacy_terms_extraction' => 'extraction',
108 => 'consultation', 'privacy_terms_consultation' => 'consultation',
109 => 'usage', 'privacy_terms_usage' => 'usage',
110 => 'communication', 'privacy_terms_communication' => 'communication',
111 => 'interconnection', 'privacy_terms_interconnection' => 'interconnection',
112 => 'limitation', 'privacy_terms_limitation' => 'limitation',
113 => 'deletion', 'privacy_terms_deletion' => 'deletion',
114 => 'destruction', 'privacy_terms_destruction' => 'destruction',
115 => 'profiling', 'privacy_terms_profiling' => 'profiling',
]; ];
} }
} }

@ -249,10 +249,33 @@ $webCoursePath = api_get_path(WEB_COURSE_PATH);
foreach ($properties as $key => $value) { foreach ($properties as $key => $value) {
if (is_array($value) || is_object($value)) { if (is_array($value) || is_object($value)) {
switch ($key) { switch ($key) {
case 'classes':
foreach ($value as $category => $subValue) {
$categoryName = 'Social group';
if ($category == 0) {
$categoryName = 'Class';
}
$personalDataContent .= '<li class="advanced_options" id="personal-data-list-'.$category.'">';
$personalDataContent .= '<u>'.$categoryName.'</u> &gt;</li>';
$personalDataContent .= '<ul id="personal-data-list-'.$category.'_options" style="display:none;">';
if (empty($subValue)) {
$personalDataContent .= '<li>'.get_lang('NoData').'</li>';
} else {
foreach ($subValue as $subSubValue) {
$personalDataContent .= '<li>'.$subSubValue.'</li>';
}
}
$personalDataContent .= '</ul>';
}
break;
case 'extraFields': case 'extraFields':
$personalDataContent .= '<li>'.$key.': </li><ul>'; $personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $subValue) { if (empty($value)) {
$personalDataContent .= '<li>'.$subValue->variable.': '.$subValue->value.'</li>'; $personalDataContent .= '<li>'.get_lang('NoData').'</li>';
} else {
foreach ($value as $subValue) {
$personalDataContent .= '<li>'.$subValue->variable.': '.$subValue->value.'</li>';
}
} }
$personalDataContent .= '</ul>'; $personalDataContent .= '</ul>';
break; break;
@ -261,15 +284,19 @@ foreach ($properties as $key => $value) {
$personalDataContent .= '<li class="advanced_options" id="personal-data-list-'.$category.'">'; $personalDataContent .= '<li class="advanced_options" id="personal-data-list-'.$category.'">';
$personalDataContent .= '<u>'.get_lang($category).'</u> &gt;</li>'; $personalDataContent .= '<u>'.get_lang($category).'</u> &gt;</li>';
$personalDataContent .= '<ul id="personal-data-list-'.$category.'_options" style="display:none;">'; $personalDataContent .= '<ul id="personal-data-list-'.$category.'_options" style="display:none;">';
foreach ($subValue as $subSubValue) { if (empty($subValue)) {
if ($category === 'DocumentsAdded') { $personalDataContent .= '<li>'.get_lang('NoData').'</li>';
$documentLink = Display::url( } else {
$webCoursePath.$subSubValue->directory.'/document'.$subSubValue->path, foreach ($subValue as $subSubValue) {
$subSubValue->code_path if ($category === 'DocumentsAdded') {
); $documentLink = Display::url(
$personalDataContent .= '<li>'.$documentLink.'</li>'; $subSubValue->code_path,
} else { $webCoursePath.$subSubValue->directory.'/document'.$subSubValue->path
$personalDataContent .= '<li>'.$subSubValue.'</li>'; );
$personalDataContent .= '<li>'.$documentLink.'</li>';
} else {
$personalDataContent .= '<li>'.$subSubValue.'</li>';
}
} }
} }
$personalDataContent .= '</ul>'; $personalDataContent .= '</ul>';
@ -280,13 +307,16 @@ foreach ($properties as $key => $value) {
case 'roles': case 'roles':
case 'achievedSkills': case 'achievedSkills':
case 'sessionAsGeneralCoach': case 'sessionAsGeneralCoach':
case 'classes':
case 'courses': case 'courses':
case 'groupNames': case 'groupNames':
case 'groups': case 'groups':
$personalDataContent .= '<li>'.$key.': </li><ul>'; $personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $subValue) { if (empty($subValue)) {
$personalDataContent .= '<li>'.$subValue.'</li>'; $personalDataContent .= '<li>'.get_lang('NoData').'</li>';
} else {
foreach ($value as $subValue) {
$personalDataContent .= '<li>'.$subValue.'</li>';
}
} }
$personalDataContent .= '</ul>'; $personalDataContent .= '</ul>';
break; break;
@ -294,8 +324,12 @@ foreach ($properties as $key => $value) {
$personalDataContent .= '<li>'.$key.': </li><ul>'; $personalDataContent .= '<li>'.$key.': </li><ul>';
foreach ($value as $session => $courseList) { foreach ($value as $session => $courseList) {
$personalDataContent .= '<li>'.$session.'<ul>'; $personalDataContent .= '<li>'.$session.'<ul>';
foreach ($courseList as $course) { if (empty($courseList)) {
$personalDataContent .= '<li>'.$course.'</li>'; $personalDataContent .= '<li>'.get_lang('NoData').'</li>';
} else {
foreach ($courseList as $course) {
$personalDataContent .= '<li>'.$course.'</li>';
}
} }
$personalDataContent .= '</ul>'; $personalDataContent .= '</ul>';
} }
@ -369,7 +403,7 @@ $legalTermsRepo = $em->getRepository('ChamiloCoreBundle:Legal');
// Get data about the treatment of data // Get data about the treatment of data
$treatmentTypes = LegalManager::getTreatmentTypeList(); $treatmentTypes = LegalManager::getTreatmentTypeList();
foreach ($treatmentTypes as $id => $item) { /*foreach ($treatmentTypes as $id => $item) {
$personalData['treatment'][$item]['title'] = get_lang('PersonalData'.ucfirst($item).'Title'); $personalData['treatment'][$item]['title'] = get_lang('PersonalData'.ucfirst($item).'Title');
$legalTerm = $legalTermsRepo->findOneByTypeAndLanguage($id, api_get_language_id($user_language)); $legalTerm = $legalTermsRepo->findOneByTypeAndLanguage($id, api_get_language_id($user_language));
$legalTermContent = ''; $legalTermContent = '';
@ -377,7 +411,8 @@ foreach ($treatmentTypes as $id => $item) {
$legalTermContent = $legalTerm[0]['content']; $legalTermContent = $legalTerm[0]['content'];
} }
$personalData['treatment'][$item]['content'] = $legalTermContent; $personalData['treatment'][$item]['content'] = $legalTermContent;
} }*/
$officerName = api_get_configuration_value('data_protection_officer_name'); $officerName = api_get_configuration_value('data_protection_officer_name');
$officerRole = api_get_configuration_value('data_protection_officer_role'); $officerRole = api_get_configuration_value('data_protection_officer_role');
$officerEmail = api_get_configuration_value('data_protection_officer_email'); $officerEmail = api_get_configuration_value('data_protection_officer_email');

@ -37,4 +37,29 @@ class BranchSyncRepository extends NestedTreeRepository
return $q->execute(); return $q->execute();
} }
/**
* Gets the first branch with parent_id = NULL
* @return mixed
*/
public function getTopBranch()
{
$qb = $this->createQueryBuilder('a');
//Selecting user info
$qb->select('DISTINCT b');
$qb->from('Chamilo\CoreBundle\Entity\BranchSync', 'b');
$qb->where('b.parentId IS NULL');
$qb->add('orderBy', 'b.id ASC');
$qb->setMaxResults(1);
$q = $qb->getQuery()->getResult();
if (empty($q)) {
return null;
} else {
foreach ($q as $result) {
return $result;
}
}
}
} }

@ -12,6 +12,7 @@ use Chamilo\CoreBundle\Entity\Message;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUser; use Chamilo\CoreBundle\Entity\SkillRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUserComment;
use Chamilo\CoreBundle\Entity\TrackEAccess; use Chamilo\CoreBundle\Entity\TrackEAccess;
use Chamilo\CoreBundle\Entity\TrackEAttempt; use Chamilo\CoreBundle\Entity\TrackEAttempt;
use Chamilo\CoreBundle\Entity\TrackECourseAccess; use Chamilo\CoreBundle\Entity\TrackECourseAccess;
@ -22,8 +23,10 @@ use Chamilo\CoreBundle\Entity\TrackELastaccess;
use Chamilo\CoreBundle\Entity\TrackELogin; use Chamilo\CoreBundle\Entity\TrackELogin;
use Chamilo\CoreBundle\Entity\TrackEOnline; use Chamilo\CoreBundle\Entity\TrackEOnline;
use Chamilo\CoreBundle\Entity\TrackEUploads; use Chamilo\CoreBundle\Entity\TrackEUploads;
use Chamilo\CoreBundle\Entity\UserApiKey;
use Chamilo\CoreBundle\Entity\UserCourseCategory; use Chamilo\CoreBundle\Entity\UserCourseCategory;
use Chamilo\CoreBundle\Entity\UsergroupRelUser; use Chamilo\CoreBundle\Entity\UsergroupRelUser;
use Chamilo\CoreBundle\Entity\UserRelCourseVote;
use Chamilo\CourseBundle\Entity\CAttendanceResult; use Chamilo\CourseBundle\Entity\CAttendanceResult;
use Chamilo\CourseBundle\Entity\CAttendanceSheet; use Chamilo\CourseBundle\Entity\CAttendanceSheet;
use Chamilo\CourseBundle\Entity\CBlogPost; use Chamilo\CourseBundle\Entity\CBlogPost;
@ -43,6 +46,7 @@ use Chamilo\TicketBundle\Entity\Ticket;
use Chamilo\UserBundle\Entity\User; use Chamilo\UserBundle\Entity\User;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\Serializer;
@ -511,17 +515,31 @@ class UserRepository extends EntityRepository
$courses = $user->getCourses(); $courses = $user->getCourses();
$list = []; $list = [];
$chatFiles = [];
/** @var CourseRelUser $course */ /** @var CourseRelUser $course */
foreach ($courses as $course) { foreach ($courses as $course) {
$list[] = $course->getCourse()->getCode(); $list[] = $course->getCourse()->getCode();
$courseDir = api_get_path(SYS_COURSE_PATH).$course->getCourse()->getDirectory();
$documentDir = $courseDir.'/document/chat_files/';
if (is_dir($documentDir)) {
$fs = new Finder();
$fs->files()->in($documentDir);
foreach ($fs as $file) {
$chatFiles[] =
$course->getCourse()->getDirectory().'/document/chat_files/'.$file->getFilename().' - '.
get_lang('ContentNotAccessibleRequestFromDataPrivacyOfficer');
}
}
} }
$user->setCourses($list); $user->setCourses($list);
$classes = $user->getClasses(); $classes = $user->getClasses();
$list = []; $list = [];
/** @var UsergroupRelUser $class */ /** @var UsergroupRelUser $class */
foreach ($classes as $class) { foreach ($classes as $class) {
$list[] = $class->getUsergroup()->getName(); $name = $class->getUsergroup()->getName();
$list[$class->getUsergroup()->getGroupType()][] = $name.' - Status: '.$class->getRelationType();
} }
$user->setClasses($list); $user->setClasses($list);
@ -580,8 +598,8 @@ class UserRepository extends EntityRepository
'IP: '.$item->getUserIp(), 'IP: '.$item->getUserIp(),
'Start: '.$item->getExeDate()->format($dateFormat), 'Start: '.$item->getExeDate()->format($dateFormat),
'Status: '.$item->getStatus(), 'Status: '.$item->getStatus(),
'Result: '.$item->getExeResult(), // 'Result: '.$item->getExeResult(),
'Weighting: '.$item->getExeWeighting(), // 'Weighting: '.$item->getExeWeighting(),
]; ];
$trackEExercises[] = implode(', ', $list); $trackEExercises[] = implode(', ', $list);
} }
@ -597,9 +615,9 @@ class UserRepository extends EntityRepository
$list = [ $list = [
'Attempt #'.$item->getExeId(), 'Attempt #'.$item->getExeId(),
'Course # '.$item->getCId(), 'Course # '.$item->getCId(),
'Answer: '.$item->getAnswer(), //'Answer: '.$item->getAnswer(),
'Session #'.$item->getSessionId(), 'Session #'.$item->getSessionId(),
'Marks: '.$item->getMarks(), //'Marks: '.$item->getMarks(),
'Position: '.$item->getPosition(), 'Position: '.$item->getPosition(),
'Date: '.$item->getTms()->format($dateFormat), 'Date: '.$item->getTms()->format($dateFormat),
]; ];
@ -733,7 +751,7 @@ class UserRepository extends EntityRepository
foreach ($result as $item) { foreach ($result as $item) {
$list = [ $list = [
'Evaluation id# '.$item->getEvaluationId(), 'Evaluation id# '.$item->getEvaluationId(),
'Score: '.$item->getScore(), //'Score: '.$item->getScore(),
'Creation date: '.$item->getCreatedAt()->format($dateFormat), 'Creation date: '.$item->getCreatedAt()->format($dateFormat),
]; ];
$gradebookResult[] = implode(', ', $list); $gradebookResult[] = implode(', ', $list);
@ -797,6 +815,21 @@ class UserRepository extends EntityRepository
$cForumThreadList[] = implode(', ', $list); $cForumThreadList[] = implode(', ', $list);
} }
// CForumAttachment
/*$criteria = [
'threadPosterId' => $userId,
];
$result = $em->getRepository('ChamiloCourseBundle:CForumAttachment')->findBy($criteria);
$cForumThreadList = [];
* @var CForumThread $item
foreach ($result as $item) {
$list = [
'Title: '.$item->getThreadTitle(),
'Creation date: '.$item->getThreadDate()->format($dateFormat),
];
$cForumThreadList[] = implode(', ', $list);
}*/
// cGroupRelUser // cGroupRelUser
$criteria = [ $criteria = [
'userId' => $userId, 'userId' => $userId,
@ -869,7 +902,8 @@ class UserRepository extends EntityRepository
$list = [ $list = [
'Title: '.$item->getTitle(), 'Title: '.$item->getTitle(),
'Sent date: '.$item->getSendDate()->format($dateFormat), 'Sent date: '.$item->getSendDate()->format($dateFormat),
'To user# '.$item->getUserReceiverId(), 'To user # '.$item->getUserReceiverId(),
'Status'.$item->getMsgStatus(),
]; ];
$messageList[] = implode(', ', $list); $messageList[] = implode(', ', $list);
} }
@ -915,6 +949,7 @@ class UserRepository extends EntityRepository
foreach ($result as $item) { foreach ($result as $item) {
$list = [ $list = [
'File #'.$item->getFileId(), 'File #'.$item->getFileId(),
'Course #'.$item->getCId(),
]; ];
$cDropboxPerson[] = implode(', ', $list); $cDropboxPerson[] = implode(', ', $list);
} }
@ -1042,12 +1077,63 @@ class UserRepository extends EntityRepository
$list = [ $list = [
'Subject: '.$item->getSubject(), 'Subject: '.$item->getSubject(),
'IP: '.$item->getIpAddress(), 'IP: '.$item->getIpAddress(),
'Status: '. $item->getStatus(), 'Status: '.$item->getStatus(),
'Creation date: '.$item->getInsertDateTime()->format($dateFormat), 'Creation date: '.$item->getInsertDateTime()->format($dateFormat),
]; ];
$ticketMessage[] = implode(', ', $list); $ticketMessage[] = implode(', ', $list);
} }
// SkillRelUserComment
$criteria = [
'feedbackGiver' => $userId,
];
$result = $em->getRepository('ChamiloCoreBundle:SkillRelUserComment')->findBy($criteria);
$skillRelUserComment = [];
/** @var SkillRelUserComment $item */
foreach ($result as $item) {
$list = [
'Feedback: '.$item->getFeedbackText(),
'Value: '.$item->getFeedbackValue(),
'Created at: '.$item->getFeedbackDateTime()->format($dateFormat),
];
$skillRelUserComment[] = implode(', ', $list);
}
// UserRelCourseVote
$criteria = [
'userId' => $userId,
];
$result = $em->getRepository('ChamiloCoreBundle:UserRelCourseVote')->findBy($criteria);
$userRelCourseVote = [];
/** @var UserRelCourseVote $item */
foreach ($result as $item) {
$list = [
'Course #'.$item->getCId(),
'Session #'.$item->getSessionId(),
'Vote: '.$item->getVote(),
];
$userRelCourseVote[] = implode(', ', $list);
}
// UserApiKey
$criteria = [
'userId' => $userId,
];
$result = $em->getRepository('ChamiloCoreBundle:UserApiKey')->findBy($criteria);
$userApiKey = [];
/** @var UserApiKey $item */
foreach ($result as $item) {
$list = [
'ApiKey #'.$item->getApiKey(),
'Service: '.$item->getApiService(),
'EndPoint: '.$item->getApiEndPoint(),
'Validity start date: '.$item->getValidityEndDate()->format($dateFormat),
'Validity enddate: '.$item->getValidityStartDate()->format($dateFormat),
'Created at: '.$item->getCreatedDate()->format($dateFormat),
];
$userApiKey[] = implode(', ', $list);
}
$user->setDropBoxSentFiles( $user->setDropBoxSentFiles(
[ [
'Friends' => $friendList, 'Friends' => $friendList,
@ -1064,11 +1150,15 @@ class UserRepository extends EntityRepository
'GradebookResult' => $gradebookResult, 'GradebookResult' => $gradebookResult,
'Downloads' => $trackEDownloads, 'Downloads' => $trackEDownloads,
'UserCourseCategory' => $userCourseCategory, 'UserCourseCategory' => $userCourseCategory,
'SkillRelUserComment' => $skillRelUserComment,
'UserRelCourseVote' => $userRelCourseVote,
'UserApiKey' => $userApiKey,
// courses // courses
'AttendanceResult' => $cAttendanceResult, 'AttendanceResult' => $cAttendanceResult,
'Blog' => $cBlog, 'Blog' => $cBlog,
'DocumentsAdded' => $documents, 'DocumentsAdded' => $documents,
'Chat' => $chatFiles,
'ForumPost' => $cForumPostList, 'ForumPost' => $cForumPostList,
'ForumThread' => $cForumThreadList, 'ForumThread' => $cForumThreadList,
'TrackEExercises' => $trackEExercises, 'TrackEExercises' => $trackEExercises,

Loading…
Cancel
Save