Minor - format code

pull/2468/head
jmontoyaa 8 years ago
parent 353d3541d3
commit 56b3b48034
  1. 14
      main/survey/pending.php
  2. 28
      main/survey/surveyUtil.class.php
  3. 31
      plugin/test2pdf/src/test2pdf.lib.php

@ -1,10 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CSurvey;
use Chamilo\CourseBundle\Entity\CSurveyInvitation;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Entity\CSurvey;
use Chamilo\CourseBundle\Entity\CSurveyInvitation;
$cidReset = true;
@ -34,17 +34,15 @@ foreach ($pending as $i => $item) {
/** @var Session $session */
$session = $em->find('ChamiloCoreBundle:Session', $survey->getSessionId());
$course = $course ? ['id' => $course->getId(), 'title' => $course->getTitle(), 'code' => $course->getCode()] : null;
$session = $session ? ['id' => $session->getId(), 'name' => $session->getName()] : null;
$surveysData[$survey->getSurveyId()] = [
'title' => $survey->getTitle(),
'invitation_code' => $invitation->getInvitationCode(),
'avail_from' => $survey->getAvailFrom(),
'avail_till' => $survey->getAvailTill(),
'course' => $course
? ['id' => $course->getId(), 'title' => $course->getTitle(), 'code' => $course->getCode()]
: null,
'session' => $session
? ['id' => $session->getId(), 'name' => $session->getName()]
: null
'course' => $course,
'session' => $session,
];
}

@ -2829,13 +2829,13 @@ class SurveyUtil
* @param int $survey_id the id of the survey
* @param bool $drh
*
* @return string html code that are the actions that can be performed on any survey
*
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
* @throws \Doctrine\ORM\TransactionRequiredException
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*
* @return string html code that are the actions that can be performed on any survey
*
* @version January 2007
*/
public static function modify_filter($survey_id, $drh = false)
@ -2893,14 +2893,13 @@ class SurveyUtil
.http_build_query($params + ['action' => 'copy_survey', 'survey_id' => $survey_id])
);
$warning = addslashes(api_htmlentities(get_lang("EmptySurvey").'?', ENT_QUOTES));
$actions[] = Display::url(
Display::return_icon('clean.png', get_lang('EmptySurvey')),
$codePath.'survey/survey_list.php'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[
'onclick' => "javascript: if (!confirm('"
.addslashes(api_htmlentities(get_lang("EmptySurvey").'?'))
."')) return false;"
'onclick' => "javascript: if (!confirm('".$warning."')) return false;",
]
);
}
@ -2917,14 +2916,13 @@ class SurveyUtil
if (api_is_allowed_to_edit() ||
api_is_element_in_the_session(TOOL_SURVEY, $survey_id)
) {
$warning = addslashes(api_htmlentities(get_lang("DeleteSurvey").'?', ENT_QUOTES));
$actions[] = Display::url(
Display::return_icon('delete.png', get_lang('Delete')),
$codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'delete', 'survey_id' => $survey_id]),
[
'onclick' => "javascript: if(!confirm('"
.addslashes(api_htmlentities(get_lang("DeleteSurvey").'?', ENT_QUOTES))
."')) return false;"
'onclick' => "javascript: if(!confirm('".$warning."')) return false;",
]
);
}
@ -2952,14 +2950,13 @@ class SurveyUtil
Display::return_icon('mail_send.png', get_lang('Publish')),
$codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id])
);
$warning = addslashes(api_htmlentities(get_lang("EmptySurvey").'?', ENT_QUOTES));
$actions[] = Display::url(
Display::return_icon('clean.png', get_lang('EmptySurvey')),
$codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[
'onclick' => "javascript: if(!confirm('"
.addslashes(api_htmlentities(get_lang("EmptySurvey").'?', ENT_QUOTES))
."')) return false;"
'onclick' => "javascript: if(!confirm('".$warning."')) return false;",
]
);
@ -3759,7 +3756,7 @@ class SurveyUtil
}
/**
* Get the pending surveys for a user
* Get the pending surveys for a user.
*
* @param int $userId
*
@ -3773,8 +3770,11 @@ class SurveyUtil
SELECT s, si FROM ChamiloCourseBundle:CSurvey s
INNER JOIN ChamiloCourseBundle:CSurveyInvitation si
WITH (s.code = si.surveyCode AND s.cId = si.cId AND s.sessionId = si.sessionId )
WHERE si.user = :user_id AND s.availFrom <= :now AND s.availTill >= :now
AND si.answered = 0
WHERE
si.user = :user_id AND
s.availFrom <= :now AND
s.availTill >= :now AND
si.answered = 0
ORDER BY s.availTill ASC
";

@ -6,7 +6,34 @@
* @package chamilo.plugin.test2pdf
*/
$letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
$letters = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
];
/**
* List exercises.
@ -16,7 +43,7 @@ $letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'
*
* @throws Exception
*
* @return array Results (list of exercice details)
* @return array Results (list of exercise details)
*/
function showExerciseCourse($courseId, $sessionId = 0)

Loading…
Cancel
Save