Minor - merge with 1.11.x

pull/2487/merge
Julio Montoya 7 years ago
parent 95973606cc
commit 88bc49f75b
  1. 18
      src/CoreBundle/Entity/AccessUrl.php
  2. 19
      src/CoreBundle/Entity/AccessUrlRelCourse.php
  3. 4
      src/CoreBundle/Entity/AccessUrlRelCourseCategory.php
  4. 18
      src/CoreBundle/Entity/AccessUrlRelSession.php
  5. 66
      src/CoreBundle/Entity/Course.php
  6. 10
      src/CoreBundle/Entity/CourseCategory.php
  7. 18
      src/CoreBundle/Entity/CourseModule.php
  8. 29
      src/CoreBundle/Entity/CourseRelUser.php
  9. 19
      src/CoreBundle/Entity/CourseRelUserCatalogue.php
  10. 698
      src/CoreBundle/Entity/ExtraField.php
  11. 2
      src/CoreBundle/Entity/Legal.php
  12. 2
      src/CoreBundle/Entity/PortfolioCategory.php
  13. 64
      src/CoreBundle/Entity/Session.php
  14. 24
      src/CoreBundle/Entity/SessionRelCourseRelUser.php
  15. 5
      src/CoreBundle/Entity/SessionRelUser.php
  16. 24
      src/CoreBundle/Entity/Skill.php
  17. 19
      src/CoreBundle/Entity/SkillRelUser.php
  18. 31
      src/CourseBundle/Entity/CItemProperty.php
  19. 1
      src/CourseBundle/Entity/CTool.php

@ -13,6 +13,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class AccessUrl
{
/**
* @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\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
@ -32,14 +41,7 @@ class AccessUrl
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
protected $sessionCategory;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string

@ -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()
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Course", inversedBy="urls", cascade={"persist"})
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
@ -24,21 +33,13 @@ 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()
*/
protected $id;
/**
* @return string
*/
public function __toString()
{
return strval('-');
return '-';
}
/**

@ -41,7 +41,7 @@ class AccessUrlRelCourseCategory
*
* @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)
{

@ -13,6 +13,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class AccessUrlRelSession
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue()
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Session", inversedBy="urls", cascade={"persist"})
* @ORM\JoinColumn(name="session_id", referencedColumnName="id")
@ -24,14 +33,7 @@ class AccessUrlRelSession
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
*/
protected $url;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue()
*/
protected $id;
/**
* Get id.

@ -38,6 +38,15 @@ class Course
const OPEN_WORLD = 3;
const HIDDEN = 4;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* "orphanRemoval" is needed to delete the CourseRelUser relation
* in the CourseAdmin class. The setUsers, getUsers, removeUsers and
@ -137,15 +146,6 @@ class Course
*/
protected $sharedSurveys;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
@ -365,7 +365,7 @@ class Course
*/
public function __toString()
{
return strval($this->getTitle());
return (string) $this->getTitle();
}
/**
@ -714,6 +714,14 @@ class Course
return $this->title;
}
/**
* @return string
*/
public function getTitleAndCode()
{
return $this->getTitle().' ('.$this->getCode().')';
}
/**
* Set description.
*
@ -1295,37 +1303,7 @@ class Course
public function getIssuedSkills()
{
return $this->issuedSkills;
}
/**
* Check if the course has a picture.
*
* @return bool
*/
public function hasPicture()
{
return file_exists(api_get_path(SYS_COURSE_PATH).$this->directory.'/course-pic85x85.png');
}
/**
* Get the course picture path.
*
* @param bool $fullSize
*
* @return null|string
*/
public function getPicturePath($fullSize = false)
{
if (!$this->hasPicture()) {
return null;
}
if ($fullSize) {
return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic.png';
}
return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic85x85.png';
}
}
/**
* @param CourseRelUser $subscription
@ -1336,11 +1314,11 @@ class Course
{
if ($this->getUsers()->count()) {
$criteria = Criteria::create()->where(
Criteria::expr()->eq("user", $subscription->getUser())
Criteria::expr()->eq('user', $subscription->getUser())
)->andWhere(
Criteria::expr()->eq("status", $subscription->getStatus())
Criteria::expr()->eq('status', $subscription->getStatus())
)->andWhere(
Criteria::expr()->eq("relationType", $subscription->getRelationType())
Criteria::expr()->eq('relationType', $subscription->getRelationType())
);
$relation = $this->getUsers()->matching($criteria);

@ -23,10 +23,6 @@ use Doctrine\ORM\Mapping as ORM;
*/
class CourseCategory
{
/**
* @ORM\OneToMany(targetEntity="CourseCategory", mappedBy="parent")
*/
protected $children;
/**
* @var int
*
@ -36,6 +32,12 @@ class CourseCategory
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="CourseCategory", mappedBy="parent")
*/
protected $children;
/**
* @var string
*

@ -13,6 +13,15 @@ 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
*
@ -55,15 +64,6 @@ class CourseModule
*/
protected $position;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* Set name.
*

@ -21,6 +21,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class CourseRelUser
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="courses", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
@ -32,14 +41,6 @@ class CourseRelUser
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var int
@ -47,14 +48,14 @@ class CourseRelUser
* @todo use status instead of this
*
* @deprecated
* @ORM\Column(name="relation_type", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Column(name="relation_type", type="integer", nullable=false, unique=false)
*/
protected $relationType;
/**
* @var bool
*
* @ORM\Column(name="status", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Column(name="status", type="integer", nullable=false, unique=false)
*/
protected $status;
@ -68,21 +69,21 @@ class CourseRelUser
/**
* @var int
*
* @ORM\Column(name="sort", type="integer", precision=0, scale=0, nullable=true, unique=false)
* @ORM\Column(name="sort", type="integer", nullable=true, unique=false)
*/
protected $sort;
/**
* @var int
*
* @ORM\Column(name="user_course_cat", type="integer", precision=0, scale=0, nullable=true, unique=false)
* @ORM\Column(name="user_course_cat", type="integer", nullable=true, unique=false)
*/
protected $userCourseCat;
/**
* @var int
*
* @ORM\Column(name="legal_agreement", type="integer", precision=0, scale=0, nullable=true, unique=false)
* @ORM\Column(name="legal_agreement", type="integer", nullable=true, unique=false)
*/
protected $legalAgreement;
@ -99,7 +100,7 @@ class CourseRelUser
*/
public function __toString()
{
return strval($this->getCourse()->getCode());
return (string) $this->getCourse()->getCode();
}
/**

@ -21,6 +21,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class CourseRelUserCatalogue
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="courses", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
@ -32,14 +41,6 @@ class CourseRelUserCatalogue
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var bool
@ -60,7 +61,7 @@ class CourseRelUserCatalogue
*/
public function __toString()
{
return strval($this->getCourse()->getCode());
return (string) $this->getCourse()->getCode();
}
/**

@ -7,353 +7,353 @@ use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* Class ExtraField.
*
* @ORM\Entity
* @ORM\Table(name="extra_field")
*
* @ORM\MappedSuperclass
*/
class ExtraField // extends BaseAttribute
{
const USER_FIELD_TYPE = 1;
const COURSE_FIELD_TYPE = 2;
const SESSION_FIELD_TYPE = 3;
const QUESTION_FIELD_TYPE = 4;
const CALENDAR_FIELD_TYPE = 5;
const LP_FIELD_TYPE = 6;
const LP_ITEM_FIELD_TYPE = 7;
const SKILL_FIELD_TYPE = 8;
const WORK_FIELD_TYPE = 9;
const CAREER_FIELD_TYPE = 10;
const USER_CERTIFICATE = 11;
const SURVEY_FIELD_TYPE = 12;
const SCHEDULED_ANNOUNCEMENT = 13;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var int
*
* @ORM\Column(name="extra_field_type", type="integer", nullable=false, unique=false)
*/
protected $extraFieldType;
/**
* @var int
*
* @ORM\Column(name="field_type", type="integer", nullable=false, unique=false)
*/
protected $fieldType;
/**
* @var string
*
* @ORM\Column(name="variable", type="string", length=255, nullable=false, unique=false)
*/
protected $variable;
/**
* @var string
*
* @ORM\Column(name="display_text", type="string", length=255, nullable=true, unique=false)
*/
protected $displayText;
/**
* @var string
*
* @ORM\Column(name="default_value", type="text", nullable=true, unique=false)
*/
protected $defaultValue;
/**
* @var int
*
* @ORM\Column(name="field_order", type="integer", nullable=true, unique=false)
*/
protected $fieldOrder;
/**
* @var bool
*
* @ORM\Column(name="visible_to_self", type="boolean", nullable=true, unique=false)
*/
protected $visibleToSelf;
/**
* @var bool
*
* @ORM\Column(name="visible_to_others", type="boolean", nullable=true, unique=false)
*/
protected $visibleToOthers;
/**
* @var bool
*
* @ORM\Column(name="changeable", type="boolean", nullable=true, unique=false)
*/
protected $changeable;
/**
* @var bool
*
* @ORM\Column(name="filter", type="boolean", nullable=true, unique=false)
*/
protected $filter;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ExtraFieldOptions", mappedBy="field")
*/
protected $options;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* ExtraField constructor.
*/
public function __construct()
{
//parent::__construct();
$this->visibleToOthers = false;
$this->visibleToSelf = false;
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return int
*/
public function getExtraFieldType()
{
return $this->extraFieldType;
}
/**
* @param int $extraFieldType
*
* @return $this
*/
public function setExtraFieldType($extraFieldType)
{
$this->extraFieldType = $extraFieldType;
return $this;
}
/**
* @return int
*/
public function getFieldType()
{
return $this->fieldType;
}
/**
* @param int $fieldType
*
* @return $this
*/
public function setFieldType($fieldType)
{
$this->fieldType = $fieldType;
return $this;
}
/**
* @return string
*/
public function getVariable()
{
return $this->variable;
}
/**
* @param string $variable
*
* @return $this
*/
public function setVariable($variable)
{
$this->variable = $variable;
return $this;
}
/**
* @param bool $translated Optional. Whether translate the display text
*
* @return string
*/
public function getDisplayText($translated = true)
{
if ($translated) {
return \ExtraField::translateDisplayName($this->variable, $this->displayText);
}
return $this->displayText;
}
/**
* @param string $displayText
*
* @return $this
*/
public function setDisplayText($displayText)
{
$this->displayText = $displayText;
return $this;
}
/**
* @return string
*/
public function getDefaultValue()
{
return $this->defaultValue;
}
/**
* @param string $defaultValue
*
* @return $this
*/
public function setDefaultValue($defaultValue)
{
$this->defaultValue = $defaultValue;
return $this;
}
/**
* @return int
*/
public function getFieldOrder()
{
return $this->fieldOrder;
}
/**
* @param int $fieldOrder
*
* @return $this
*/
public function setFieldOrder($fieldOrder)
{
$this->fieldOrder = $fieldOrder;
return $this;
}
/**
* @return bool
*/
public function isChangeable()
{
return $this->changeable;
}
/**
* @param bool $changeable
*
* @return $this
*/
public function setChangeable($changeable)
{
$this->changeable = $changeable;
return $this;
}
/**
* @return bool
*/
public function isFilter()
{
return $this->filter;
}
/**
* @param bool $filter
*
* @return $this
*/
public function setFilter($filter)
{
$this->filter = $filter;
return $this;
}
/**
* @return bool
*/
public function isVisibleToSelf()
{
return $this->visibleToSelf;
}
/**
* @param bool $visibleToSelf
*
* @return ExtraField
*/
public function setVisibleToSelf($visibleToSelf)
{
$this->visibleToSelf = $visibleToSelf;
return $this;
}
/**
* @return bool
*/
public function isVisibleToOthers()
{
return $this->visibleToOthers;
}
/**
* @param bool $visibleToOthers
*
* @return ExtraField
*/
public function setVisibleToOthers($visibleToOthers)
{
$this->visibleToOthers = $visibleToOthers;
return $this;
}
/**
* @return string
*/
public function getTypeToString()
{
switch ($this->type) {
* Class ExtraField.
*
* @ORM\Entity
* @ORM\Table(name="extra_field")
*
* @ORM\MappedSuperclass
*/
class ExtraField // extends BaseAttribute
{
const USER_FIELD_TYPE = 1;
const COURSE_FIELD_TYPE = 2;
const SESSION_FIELD_TYPE = 3;
const QUESTION_FIELD_TYPE = 4;
const CALENDAR_FIELD_TYPE = 5;
const LP_FIELD_TYPE = 6;
const LP_ITEM_FIELD_TYPE = 7;
const SKILL_FIELD_TYPE = 8;
const WORK_FIELD_TYPE = 9;
const CAREER_FIELD_TYPE = 10;
const USER_CERTIFICATE = 11;
const SURVEY_FIELD_TYPE = 12;
const SCHEDULED_ANNOUNCEMENT = 13;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var int
*
* @ORM\Column(name="extra_field_type", type="integer", nullable=false, unique=false)
*/
protected $extraFieldType;
/**
* @var int
*
* @ORM\Column(name="field_type", type="integer", nullable=false, unique=false)
*/
protected $fieldType;
/**
* @var string
*
* @ORM\Column(name="variable", type="string", length=255, nullable=false, unique=false)
*/
protected $variable;
/**
* @var string
*
* @ORM\Column(name="display_text", type="string", length=255, nullable=true, unique=false)
*/
protected $displayText;
/**
* @var string
*
* @ORM\Column(name="default_value", type="text", nullable=true, unique=false)
*/
protected $defaultValue;
/**
* @var int
*
* @ORM\Column(name="field_order", type="integer", nullable=true, unique=false)
*/
protected $fieldOrder;
/**
* @var bool
*
* @ORM\Column(name="visible_to_self", type="boolean", nullable=true, unique=false)
*/
protected $visibleToSelf;
/**
* @var bool
*
* @ORM\Column(name="visible_to_others", type="boolean", nullable=true, unique=false)
*/
protected $visibleToOthers;
/**
* @var bool
*
* @ORM\Column(name="changeable", type="boolean", nullable=true, unique=false)
*/
protected $changeable;
/**
* @var bool
*
* @ORM\Column(name="filter", type="boolean", nullable=true, unique=false)
*/
protected $filter;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ExtraFieldOptions", mappedBy="field")
*/
protected $options;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* ExtraField constructor.
*/
public function __construct()
{
//parent::__construct();
$this->visibleToOthers = false;
$this->visibleToSelf = false;
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return int
*/
public function getExtraFieldType()
{
return $this->extraFieldType;
}
/**
* @param int $extraFieldType
*
* @return $this
*/
public function setExtraFieldType($extraFieldType)
{
$this->extraFieldType = $extraFieldType;
return $this;
}
/**
* @return int
*/
public function getFieldType()
{
return $this->fieldType;
}
/**
* @param int $fieldType
*
* @return $this
*/
public function setFieldType($fieldType)
{
$this->fieldType = $fieldType;
return $this;
}
/**
* @return string
*/
public function getVariable()
{
return $this->variable;
}
/**
* @param string $variable
*
* @return $this
*/
public function setVariable($variable)
{
$this->variable = $variable;
return $this;
}
/**
* @param bool $translated Optional. Whether translate the display text
*
* @return string
*/
public function getDisplayText($translated = true)
{
if ($translated) {
return \ExtraField::translateDisplayName($this->variable, $this->displayText);
}
return $this->displayText;
}
/**
* @param string $displayText
*
* @return $this
*/
public function setDisplayText($displayText)
{
$this->displayText = $displayText;
return $this;
}
/**
* @return string
*/
public function getDefaultValue()
{
return $this->defaultValue;
}
/**
* @param string $defaultValue
*
* @return $this
*/
public function setDefaultValue($defaultValue)
{
$this->defaultValue = $defaultValue;
return $this;
}
/**
* @return int
*/
public function getFieldOrder()
{
return $this->fieldOrder;
}
/**
* @param int $fieldOrder
*
* @return $this
*/
public function setFieldOrder($fieldOrder)
{
$this->fieldOrder = $fieldOrder;
return $this;
}
/**
* @return bool
*/
public function isChangeable()
{
return $this->changeable;
}
/**
* @param bool $changeable
*
* @return $this
*/
public function setChangeable($changeable)
{
$this->changeable = $changeable;
return $this;
}
/**
* @return bool
*/
public function isFilter()
{
return $this->filter;
}
/**
* @param bool $filter
*
* @return $this
*/
public function setFilter($filter)
{
$this->filter = $filter;
return $this;
}
/**
* @return bool
*/
public function isVisibleToSelf()
{
return $this->visibleToSelf;
}
/**
* @param bool $visibleToSelf
*
* @return ExtraField
*/
public function setVisibleToSelf($visibleToSelf)
{
$this->visibleToSelf = $visibleToSelf;
return $this;
}
/**
* @return bool
*/
public function isVisibleToOthers()
{
return $this->visibleToOthers;
}
/**
* @param bool $visibleToOthers
*
* @return ExtraField
*/
public function setVisibleToOthers($visibleToOthers)
{
$this->visibleToOthers = $visibleToOthers;
return $this;
}
/**
* @return string
*/
public function getTypeToString()
{
switch ($this->type) {
case \ExtraField::FIELD_TYPE_TEXT:
case \ExtraField::FIELD_TYPE_TEXTAREA:
return 'text';
@ -363,5 +363,5 @@ use Gedmo\Mapping\Annotation as Gedmo;
default:
return 'text';
}
}
}
}
}

@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
* Legal.
*
* @ORM\Table(name="legal")
* @ORM\Entity
* @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Entity\Repository\LegalRepository")
*/
class Legal
{

@ -51,7 +51,7 @@ class PortfolioCategory
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected $user;

@ -38,6 +38,15 @@ class Session
const DRH = 1;
const COACH = 2;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true)
@ -76,15 +85,6 @@ class Session
*/
protected $currentUrl;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
@ -382,11 +382,11 @@ class Session
{
if ($this->getUsers()->count()) {
$criteria = Criteria::create()->where(
Criteria::expr()->eq("user", $subscription->getUser())
Criteria::expr()->eq('user', $subscription->getUser())
)->andWhere(
Criteria::expr()->eq("session", $subscription->getSession())
Criteria::expr()->eq('session', $subscription->getSession())
)->andWhere(
Criteria::expr()->eq("relationType", $subscription->getRelationType())
Criteria::expr()->eq('relationType', $subscription->getRelationType())
);
$relation = $this->getUsers()->matching($criteria);
@ -435,7 +435,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);
@ -551,7 +551,7 @@ class Session
*
* @param string $name
*
* @return Session
* @return $this
*/
public function setName($name)
{
@ -575,7 +575,7 @@ class Session
*
* @param string $description
*
* @return Session
* @return $this
*/
public function setDescription($description)
{
@ -1071,11 +1071,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);
@ -1146,8 +1146,8 @@ class Session
/**
* Get user from course by status.
*
* @param \Chamilo\CoreBundle\Entity\Course $course
* @param int $status
* @param Course $course
* @param int $status
*
* @return \Doctrine\Common\Collections\ArrayCollection|\Doctrine\Common\Collections\Collection
*/
@ -1155,35 +1155,15 @@ 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);
}
public function getBuyCoursePluginPrice()
{
// start buycourse validation
// display the course price and buy button if the buycourses plugin is enabled and this course is configured
$plugin = \BuyCoursesPlugin::create();
$isThisCourseInSale = $plugin->buyCoursesForGridCatalogValidator($this->id, \BuyCoursesPlugin::PRODUCT_TYPE_SESSION);
$return = [];
if ($isThisCourseInSale) {
// set the Price label
$return['html'] = $isThisCourseInSale['html'];
// set the Buy button instead register.
if ($isThisCourseInSale['verificator']) {
$return['buy_button'] = $plugin->returnBuyCourseButton($this->id, \BuyCoursesPlugin::PRODUCT_TYPE_SESSION);
}
}
// end buycourse validation
return $return;
}
/**
* @param ArrayCollection $studentPublications
*

@ -28,6 +28,15 @@ class SessionRelCourseRelUser
2 => 'course_coach',
];
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var User
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="sessionCourseSubscriptions", cascade={"persist"})
@ -52,30 +61,21 @@ class SessionRelCourseRelUser
/**
* @var int
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var int
*
* @ORM\Column(name="visibility", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Column(name="visibility", type="integer", nullable=false, unique=false)
*/
protected $visibility;
/**
* @var int
*
* @ORM\Column(name="status", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Column(name="status", type="integer", nullable=false, unique=false)
*/
protected $status;
/**
* @var int
*
* @ORM\Column(name="legal_agreement", type="integer", precision=0, scale=0, nullable=true, unique=false)
* @ORM\Column(name="legal_agreement", type="integer", nullable=true, unique=false)
*/
protected $legalAgreement;

@ -23,6 +23,7 @@ class SessionRelUser
0 => 'student',
1 => 'drh',
];
/**
* @var int
*
@ -30,7 +31,7 @@ class SessionRelUser
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $iid;
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Session", inversedBy="users", cascade={"persist"})
@ -90,7 +91,7 @@ class SessionRelUser
*/
public function __construct()
{
$this->moved_to = null;
$this->movedTo = null;
$this->movedStatus = null;
$this->movedAt = null;
$this->registeredAt = new \DateTime('now', new \DateTimeZone('UTC'));

@ -261,30 +261,6 @@ class Skill
return $this->icon;
}
/**
* Get the icon (badge image) URL.
*
* @param bool $getSmall Optional. Allow get the small image
*
* @return string
*/
public function getWebIconPath($getSmall = false)
{
if ($getSmall) {
if (empty($this->icon)) {
return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_BIG, null, true);
}
return api_get_path(WEB_UPLOAD_PATH).'badges/'.sha1($this->name).'-small.png';
}
if (empty($this->icon)) {
return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_HUGE, null, true);
}
return api_get_path(WEB_UPLOAD_PATH)."badges/{$this->icon}";
}
/**
* Set criteria.
*

@ -24,6 +24,16 @@ use Doctrine\ORM\Mapping as ORM;
*/
class SkillRelUser
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="SkillRelUserComment", mappedBy="skillRelUser")
*/
@ -39,15 +49,6 @@ class SkillRelUser
*/
protected $validationStatus;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="achievedSkills", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)

@ -15,6 +15,22 @@ use Doctrine\ORM\Mapping as ORM;
*/
class CItemProperty
{
/**
* @var int
*
* @ORM\Column(name="iid", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $iid;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=true)
*/
protected $id;
/** //, inversedBy="users",
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", cascade={"persist"})
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
@ -44,21 +60,6 @@ class CItemProperty
* @ORM\JoinColumn(name="session_id", referencedColumnName="id")
*/
protected $session;
/**
* @var int
*
* @ORM\Column(name="iid", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $iid;
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=true)
*/
protected $id;
/**
* @var string

@ -21,6 +21,7 @@ use Doctrine\ORM\Mapping as ORM;
class CTool
{
protected $originalImage;
/**
* @var int
*

Loading…
Cancel
Save