Minor - Format code

pull/2487/head
jmontoyaa 8 years ago
parent 08da1c793b
commit eae736c491
  1. 19
      main/dropbox/dropbox_class.inc.php
  2. 17
      main/survey/surveyUtil.class.php

@ -103,8 +103,11 @@ class Dropbox_Work
// Check if object exists already. If it does, the old object is used
// with updated information (authors, description, upload_date)
$this->isOldWork = false;
$sql = "SELECT id, upload_date FROM ".Database::get_course_table(TABLE_DROPBOX_FILE)."
WHERE c_id = $course_id AND filename = '".Database::escape_string($this->filename)."'";
$sql = "SELECT id, upload_date
FROM ".Database::get_course_table(TABLE_DROPBOX_FILE)."
WHERE
c_id = $course_id AND
filename = '".Database::escape_string($this->filename)."'";
$result = Database::query($sql);
$res = Database::fetch_array($result);
if ($res) {
@ -158,7 +161,6 @@ class Dropbox_Work
$result = Database::query($sql);
$row = Database::fetch_array($result);
if ($row['count'] == 0) {
// Insert entries into person table
$sql = "INSERT INTO ".Database::get_course_table(TABLE_DROPBOX_PERSON)." (c_id, file_id, user_id)
VALUES ($course_id, ".intval($this->id)." , ".intval($this->uploader_id).")";
@ -174,7 +176,6 @@ class Dropbox_Work
public function _createExistingWork($id)
{
$course_id = api_get_course_int_id();
$action = isset($_GET['action']) ? $_GET['action'] : null;
// Do some sanity checks
@ -209,7 +210,7 @@ class Dropbox_Work
$this->category = $res['cat_id'];
// Getting the feedback on the work.
if ($action == 'viewfeedback' AND $this->id == $_GET['id']) {
if ($action == 'viewfeedback' && $this->id == $_GET['id']) {
$feedback2 = array();
$sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_FEEDBACK)."
WHERE c_id = $course_id AND file_id='".$id."'
@ -507,6 +508,7 @@ class Dropbox_Person
/**
* Deletes all the received categories and work of this person
* @param integer $id
* @return bool
*/
public function deleteReceivedWorkFolder($id)
{
@ -565,7 +567,10 @@ class Dropbox_Person
//delete entries in person table concerning sent works
foreach ($this->sentWork as $w) {
$sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)."
WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$w->id."'";
WHERE
c_id = $course_id AND
user_id='".$this->userId."' AND
file_id='".$w->id."'";
Database::query($sql);
removeMoreIfMailing($w->id);
}
@ -610,6 +615,7 @@ class Dropbox_Person
*
* @param string $id
* @param string $text
* @return bool
*/
public function updateFeedback($id, $text)
{
@ -669,7 +675,6 @@ class Dropbox_Person
null,
$ownerid
);
}
/**

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This class offers a series of general utility functions for survey querying and display
* @package chamilo.survey
@ -80,7 +81,7 @@ class SurveyUtil
* @param integer Question id
* @param integer Option id
* @param string Option value
* @param array Survey data settings
* @param array $survey_data Survey data settings
* @return bool False if insufficient data, true otherwise
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
@ -187,7 +188,13 @@ class SurveyUtil
if ($error) {
$tool_name = get_lang('Reporting');
Display::addFlash(Display::return_message(get_lang('Error').': '.$error, 'error', false));
Display::addFlash(
Display::return_message(
get_lang('Error').': '.$error,
'error',
false
)
);
Display::display_header($tool_name);
Display::display_footer();
exit;
@ -663,7 +670,6 @@ class SurveyUtil
}
if (isset($_GET['viewoption'])) {
echo '<div class="answered-people">';
echo '<h4>'.get_lang('PeopleWhoAnswered').': '.strip_tags($options[Security::remove_XSS($_GET['viewoption'])]['option_text']).'</h4>';
if (is_numeric($_GET['value'])) {
@ -2861,7 +2867,7 @@ class SurveyUtil
$last_version_surveys = $survey_tree->surveylist;
$list = array();
foreach ($last_version_surveys as & $survey) {
$list[]=$survey['id'];
$list[] = $survey['id'];
}
if (count($list) > 0) {
$list_condition = " AND survey.survey_id IN (".implode(',',$list).") ";
@ -2879,7 +2885,6 @@ class SurveyUtil
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();
$sql = "SELECT
@ -3333,7 +3338,7 @@ class SurveyUtil
{
$tableSurveyAnswer = Database::get_course_table(TABLE_SURVEY_ANSWER);
$courseId = api_get_course_int_id();
$surveyId = (int)$surveyId;
$surveyId = (int) $surveyId;
if (empty($courseId) || empty($surveyId)) {
return false;

Loading…
Cancel
Save