From eaafaa2fa700a63c0e96d337c8d1135c98c962a7 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 13 Apr 2020 08:24:30 +0200 Subject: [PATCH] Minor - Flint fixes --- main/dropbox/dropbox_download.php | 3 -- main/inc/lib/api.lib.php | 7 +++-- main/inc/lib/usergroup.lib.php | 8 +++-- main/inc/lib/usermanager.lib.php | 4 ++- main/inc/lib/webservices/Rest.php | 3 +- plugin/grading_electronic/generate.php | 30 ++----------------- .../CourseBundle/Entity/CItemProperty.php | 6 ++-- src/Chamilo/FaqBundle/Entity/Question.php | 1 - 8 files changed, 21 insertions(+), 41 deletions(-) diff --git a/main/dropbox/dropbox_download.php b/main/dropbox/dropbox_download.php index cb10f4cf61..9e5c2cf798 100755 --- a/main/dropbox/dropbox_download.php +++ b/main/dropbox/dropbox_download.php @@ -19,9 +19,6 @@ if (isset($_GET['cat_id']) && isset($_GET['sent_received']) ) { /** step 1: constructing the sql statement. - Due to the nature off the classes of the dropbox the categories for sent files are stored in the table - dropbox_file while the categories for the received files are stored in dropbox_post. - It would have been more elegant if these could be stored in dropbox_person (which stores the link file-person) Therefore we have to create to separate sql statements to find which files are in the category (depending if we zip-download a sent category or a received category)*/ if ($_GET['sent_received'] == 'sent') { diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 911bac4d51..30646936f8 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -6476,10 +6476,11 @@ function api_request_uri() return $uri; } -/** Gets the current access_url id of the Chamilo Platform - * @author Julio Montoya - * +/** + * Gets the current access_url id of the Chamilo Platform. * @return int access_url_id of the current Chamilo Installation + *@author Julio Montoya + * */ function api_get_current_access_url_id() { diff --git a/main/inc/lib/usergroup.lib.php b/main/inc/lib/usergroup.lib.php index ff26430907..9fc9179d45 100755 --- a/main/inc/lib/usergroup.lib.php +++ b/main/inc/lib/usergroup.lib.php @@ -2237,7 +2237,9 @@ class UserGroup extends Model return $array; } - /** Gets the inner join of users and group table + /** + * Gets the inner join of users and group table. + * * @param int quantity of records * @param bool show groups with image or not * @@ -2301,7 +2303,9 @@ class UserGroup extends Model return $array; } - /** Gets the last groups created + /** + * Gets the last groups created. + * * @param int $num quantity of records * @param bool $withImage show groups with image or not * diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index 24a7038cd6..c425e2d81f 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -3043,7 +3043,9 @@ class UserManager return $extra_data; } - /** Get extra user data by field + /** + * Get extra user data by field. + * * @param int user ID * @param string the internal variable name of the field * diff --git a/main/inc/lib/webservices/Rest.php b/main/inc/lib/webservices/Rest.php index 4c02536c64..47ea3969e3 100644 --- a/main/inc/lib/webservices/Rest.php +++ b/main/inc/lib/webservices/Rest.php @@ -162,7 +162,8 @@ class Rest extends WebService $this->course = $course; } - /** Set the current session + /** + * Set the current session. * * @param int $id * diff --git a/plugin/grading_electronic/generate.php b/plugin/grading_electronic/generate.php index 5b724d7a2b..1322ec762e 100644 --- a/plugin/grading_electronic/generate.php +++ b/plugin/grading_electronic/generate.php @@ -98,9 +98,7 @@ try { /** @var \Category $gradebook */ $gradebook = $cats[0]; /** @var \ExerciseLink $exerciseLink */ - /** commented until we get clear understanding of how to use the dates refs BT#12404 - $exerciseLink = $gradebook->get_links()[0]; - $exerciseId = $exerciseLink->get_ref_id(); + /** commented until we get clear understanding of how to use the dates refs BT#12404. $exerciseInfo = ExerciseLib::get_exercise_by_id($exerciseId, $course->getId()); */ $dateStart = new DateTime($values['range_start'].' 00:00:00', new DateTimeZone('UTC')); @@ -124,24 +122,7 @@ try { if (!$userFinishedCourse) { continue; } - /** commented until we get clear understanding of how to use the dates refs BT#12404 - $exerciseResult = Event::get_best_exercise_results_by_user( - $exerciseId, - $course->getId(), - $session ? $session->getId() : 0, - $student->getId() - ); - $exerciseResult = current($exerciseResult); - - if (!$exerciseResult) { - continue; - } - - $attemptDate = new DateTime($exerciseResult['exe_date'], new DateTimeZone('UTC')); - $dateIsRange = $attemptDate >= $dateStart && $attemptDate <= $dateEnd; - - if (!$dateEnd) { - continue; + /** commented until we get clear understanding of how to use the dates refs BT#12404. } */ $fieldStudent = $uFieldValue->get_values_by_handler_and_field_variable( @@ -155,12 +136,7 @@ try { SCORE_SIMPLE ); - /** old method to get the score - - $score = Category::getCurrentScore( - $student->getId(), - $gradebook, - true + /** old method to get the score. ); */ $fileData[] = sprintf( diff --git a/src/Chamilo/CourseBundle/Entity/CItemProperty.php b/src/Chamilo/CourseBundle/Entity/CItemProperty.php index e3eb1ab735..f66ddf81ea 100644 --- a/src/Chamilo/CourseBundle/Entity/CItemProperty.php +++ b/src/Chamilo/CourseBundle/Entity/CItemProperty.php @@ -31,13 +31,13 @@ class CItemProperty */ protected $id; - /** //, inversedBy="users", + /** //, inversedBy="users",. * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", cascade={"persist"}) * @ORM\JoinColumn(name="c_id", referencedColumnName="id") */ protected $course; - /** //, inversedBy="users", + /** //, inversedBy="users",. * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroupInfo", cascade={"persist"}) * @ORM\JoinColumn(name="to_group_id", referencedColumnName="iid") */ @@ -55,7 +55,7 @@ class CItemProperty */ protected $insertUser; - /** //, inversedBy="users", + /** //, inversedBy="users",. * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", cascade={"persist"}) * @ORM\JoinColumn(name="session_id", referencedColumnName="id") */ diff --git a/src/Chamilo/FaqBundle/Entity/Question.php b/src/Chamilo/FaqBundle/Entity/Question.php index 7611e7ad46..560488630b 100644 --- a/src/Chamilo/FaqBundle/Entity/Question.php +++ b/src/Chamilo/FaqBundle/Entity/Question.php @@ -12,7 +12,6 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors; * * @ORM\Entity(repositoryClass="Chamilo\FaqBundle\Entity\QuestionRepository") * @ORM\Table(name="faq_question") - * * * * @package Chamilo\FaqBundle\Entity */