@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Save TestCategory in the database if name doesn't exists |
| 54 | 54 | * @param int $courseId |
| 55 | - * @return bool |
|
| 55 | + * @return false|string |
|
| 56 | 56 | */ |
| 57 | 57 | public function save($courseId = 0) |
| 58 | 58 | { |
@@ -503,10 +503,10 @@ discard block |
||
| 503 | 503 | * @param int exercise |
| 504 | 504 | * @param array $check_in_question_list |
| 505 | 505 | * @param array $categoriesAddedInExercise |
| 506 | - * |
|
| 507 | - * @param int $exerciseId |
|
| 508 | - * @return array |
|
| 509 | - */ |
|
| 506 | + * |
|
| 507 | + * @param int $exerciseId |
|
| 508 | + * @return array |
|
| 509 | + */ |
|
| 510 | 510 | public static function getQuestionsByCat( |
| 511 | 511 | $exerciseId, |
| 512 | 512 | $check_in_question_list = array(), |
@@ -636,9 +636,9 @@ discard block |
||
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | /** |
| 639 | - * Display signs [+] and/or (>0) after question title if question has options |
|
| 640 | - * scoreAlwaysPositive and/or uncheckedMayScore |
|
| 641 | - */ |
|
| 639 | + * Display signs [+] and/or (>0) after question title if question has options |
|
| 640 | + * scoreAlwaysPositive and/or uncheckedMayScore |
|
| 641 | + */ |
|
| 642 | 642 | public function displayQuestionOption($in_objQuestion) |
| 643 | 643 | { |
| 644 | 644 | if ($in_objQuestion->type == MULTIPLE_ANSWER && $in_objQuestion->scoreAlwaysPositive) { |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | * key of $tabCategoryQuestions are the category id (0 for not in a category) |
| 655 | 655 | * value is the array of question id of this category |
| 656 | 656 | * Sort question by Category |
| 657 | - */ |
|
| 657 | + */ |
|
| 658 | 658 | public static function sortTabByBracketLabel($in_tab) |
| 659 | 659 | { |
| 660 | 660 | $tabResult = array(); |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | * @param int $exerciseId |
| 716 | 716 | * @author - hubert borderiou |
| 717 | 717 | * @return int |
| 718 | - */ |
|
| 718 | + */ |
|
| 719 | 719 | public static function getNumberMaxQuestionByCat($exerciseId) |
| 720 | 720 | { |
| 721 | 721 | $res_num_max = 0; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $newId = Database::insert($table, $params); |
| 81 | 81 | |
| 82 | 82 | if ($newId) { |
| 83 | - $sql = "UPDATE $table SET id = iid WHERE iid = $newId"; |
|
| 83 | + $sql = "update $table SET id = iid WHERE iid = $newId"; |
|
| 84 | 84 | Database::query($sql); |
| 85 | 85 | |
| 86 | 86 | api_item_property_update( |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if ($cat) { |
| 157 | - $sql = "UPDATE $table SET |
|
| 157 | + $sql = "update $table SET |
|
| 158 | 158 | title = '$name', |
| 159 | 159 | description = '$description' |
| 160 | 160 | WHERE id = $id AND c_id = ".$courseId; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $categories[] = $category->getCategory($row['id']); |
| 218 | 218 | } |
| 219 | 219 | } else { |
| 220 | - $sql = "SELECT $field FROM $table |
|
| 220 | + $sql = "select $field FROM $table |
|
| 221 | 221 | WHERE c_id = $courseId |
| 222 | 222 | ORDER BY $field ASC"; |
| 223 | 223 | $res = Database::query($sql); |
@@ -29,19 +29,19 @@ |
||
| 29 | 29 | require_once __DIR__.'/chamilo_pens.php'; |
| 30 | 30 | |
| 31 | 31 | class ChamiloPackageHandler extends PENSPackageHandler { |
| 32 | - public function processPackage($request, $path_to_package) { |
|
| 33 | - $server = PENSServer::singleton(); |
|
| 34 | - // Moves the package to archive/pens |
|
| 35 | - $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
|
| 36 | - if (!is_dir($path_to_archives)) { |
|
| 37 | - mkdir($path_to_archives, 0777, true); |
|
| 38 | - } |
|
| 39 | - rename($path_to_package, $path_to_archives.'/'.$request->getFilename()); |
|
| 40 | - // Insert the request in the database |
|
| 41 | - $chamilo_pens = new ChamiloPens($request); |
|
| 42 | - $chamilo_pens->save(); |
|
| 43 | - $server->sendAlert($request, new PENSResponse(0, 'Package successfully processed')); |
|
| 44 | - } |
|
| 32 | + public function processPackage($request, $path_to_package) { |
|
| 33 | + $server = PENSServer::singleton(); |
|
| 34 | + // Moves the package to archive/pens |
|
| 35 | + $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
|
| 36 | + if (!is_dir($path_to_archives)) { |
|
| 37 | + mkdir($path_to_archives, 0777, true); |
|
| 38 | + } |
|
| 39 | + rename($path_to_package, $path_to_archives.'/'.$request->getFilename()); |
|
| 40 | + // Insert the request in the database |
|
| 41 | + $chamilo_pens = new ChamiloPens($request); |
|
| 42 | + $chamilo_pens->save(); |
|
| 43 | + $server->sendAlert($request, new PENSResponse(0, 'Package successfully processed')); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $handler = new ChamiloPackageHandler(); |
@@ -28,8 +28,10 @@ |
||
| 28 | 28 | require_once __DIR__.'/lib/pens.php'; |
| 29 | 29 | require_once __DIR__.'/chamilo_pens.php'; |
| 30 | 30 | |
| 31 | -class ChamiloPackageHandler extends PENSPackageHandler { |
|
| 32 | - public function processPackage($request, $path_to_package) { |
|
| 31 | +class ChamiloPackageHandler extends PENSPackageHandler |
|
| 32 | +{ |
|
| 33 | + public function processPackage($request, $path_to_package) |
|
| 34 | + { |
|
| 33 | 35 | $server = PENSServer::singleton(); |
| 34 | 36 | // Moves the package to archive/pens |
| 35 | 37 | $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
@@ -72,48 +72,48 @@ |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | switch ($action) { |
| 75 | - case 'alert': |
|
| 76 | - if (!$isAdmin && isset($_GET['ticket_id'])) { |
|
| 77 | - TicketManager::send_alert($_GET['ticket_id'], $user_id); |
|
| 78 | - } |
|
| 79 | - break; |
|
| 80 | - case 'export': |
|
| 81 | - $data = array( |
|
| 82 | - array( |
|
| 83 | - '#', |
|
| 84 | - get_lang('Date'), |
|
| 85 | - get_lang('LastUpdate'), |
|
| 86 | - get_lang('Category'), |
|
| 87 | - get_lang('User'), |
|
| 88 | - get_lang('Program'), |
|
| 89 | - get_lang('AssignedTo'), |
|
| 90 | - get_lang('Status'), |
|
| 91 | - get_lang('Description') |
|
| 92 | - ) |
|
| 93 | - ); |
|
| 94 | - $datos = $table->get_clean_html(); |
|
| 95 | - foreach ($datos as $ticket) { |
|
| 96 | - $ticket[0] = substr(strip_tags($ticket[0]), 0, 12); |
|
| 97 | - $ticket_rem = array( |
|
| 98 | - utf8_decode(strip_tags($ticket[0])), |
|
| 99 | - utf8_decode(api_html_entity_decode($ticket[1])), |
|
| 100 | - utf8_decode(strip_tags($ticket[2])), |
|
| 101 | - utf8_decode(strip_tags($ticket[3])), |
|
| 102 | - utf8_decode(strip_tags($ticket[4])), |
|
| 103 | - utf8_decode(strip_tags($ticket[5])), |
|
| 104 | - utf8_decode(strip_tags($ticket[6])), |
|
| 105 | - utf8_decode(strip_tags($ticket[7])) |
|
| 75 | + case 'alert': |
|
| 76 | + if (!$isAdmin && isset($_GET['ticket_id'])) { |
|
| 77 | + TicketManager::send_alert($_GET['ticket_id'], $user_id); |
|
| 78 | + } |
|
| 79 | + break; |
|
| 80 | + case 'export': |
|
| 81 | + $data = array( |
|
| 82 | + array( |
|
| 83 | + '#', |
|
| 84 | + get_lang('Date'), |
|
| 85 | + get_lang('LastUpdate'), |
|
| 86 | + get_lang('Category'), |
|
| 87 | + get_lang('User'), |
|
| 88 | + get_lang('Program'), |
|
| 89 | + get_lang('AssignedTo'), |
|
| 90 | + get_lang('Status'), |
|
| 91 | + get_lang('Description') |
|
| 92 | + ) |
|
| 106 | 93 | ); |
| 107 | - $data[] = $ticket_rem; |
|
| 108 | - } |
|
| 109 | - Export::arrayToXls($data, get_lang('Tickets')); |
|
| 110 | - exit; |
|
| 111 | - break; |
|
| 112 | - case 'close_tickets': |
|
| 113 | - TicketManager::close_old_tickets(); |
|
| 114 | - break; |
|
| 115 | - default: |
|
| 116 | - break; |
|
| 94 | + $datos = $table->get_clean_html(); |
|
| 95 | + foreach ($datos as $ticket) { |
|
| 96 | + $ticket[0] = substr(strip_tags($ticket[0]), 0, 12); |
|
| 97 | + $ticket_rem = array( |
|
| 98 | + utf8_decode(strip_tags($ticket[0])), |
|
| 99 | + utf8_decode(api_html_entity_decode($ticket[1])), |
|
| 100 | + utf8_decode(strip_tags($ticket[2])), |
|
| 101 | + utf8_decode(strip_tags($ticket[3])), |
|
| 102 | + utf8_decode(strip_tags($ticket[4])), |
|
| 103 | + utf8_decode(strip_tags($ticket[5])), |
|
| 104 | + utf8_decode(strip_tags($ticket[6])), |
|
| 105 | + utf8_decode(strip_tags($ticket[7])) |
|
| 106 | + ); |
|
| 107 | + $data[] = $ticket_rem; |
|
| 108 | + } |
|
| 109 | + Export::arrayToXls($data, get_lang('Tickets')); |
|
| 110 | + exit; |
|
| 111 | + break; |
|
| 112 | + case 'close_tickets': |
|
| 113 | + TicketManager::close_old_tickets(); |
|
| 114 | + break; |
|
| 115 | + default: |
|
| 116 | + break; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (empty($projectId)) { |
@@ -343,7 +343,7 @@ |
||
| 343 | 343 | echo '<div class="actions">'; |
| 344 | 344 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId.'">'. |
| 345 | 345 | Display::return_icon('add.png', get_lang('Add'), '', '32'). |
| 346 | - '</a>'; |
|
| 346 | + '</a>'; |
|
| 347 | 347 | echo '</div>'; |
| 348 | 348 | } |
| 349 | 349 | } |
@@ -326,9 +326,9 @@ |
||
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
| 329 | - * Serialize the course with the best serializer available |
|
| 330 | - * @return string |
|
| 331 | - */ |
|
| 329 | + * Serialize the course with the best serializer available |
|
| 330 | + * @return string |
|
| 331 | + */ |
|
| 332 | 332 | public static function serialize($course) |
| 333 | 333 | { |
| 334 | 334 | if (extension_loaded('igbinary')) { |
@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * Displays the title + grid |
| 53 | 53 | */ |
| 54 | - public function display() |
|
| 54 | + public function display() |
|
| 55 | 55 | { |
| 56 | - // action links |
|
| 57 | - echo '<div class="actions" style="margin-bottom:20px">'; |
|
| 56 | + // action links |
|
| 57 | + echo '<div class="actions" style="margin-bottom:20px">'; |
|
| 58 | 58 | echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 59 | - echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 60 | - echo '</div>'; |
|
| 59 | + echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 60 | + echo '</div>'; |
|
| 61 | 61 | echo Display::grid_html('grade_model'); |
| 62 | - } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Returns a Form validator Obj |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function delete($id) |
| 256 | 256 | { |
| 257 | - parent::delete($id); |
|
| 257 | + parent::delete($id); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | /** |
| 309 | 309 | * GradeModelComponents constructor. |
| 310 | 310 | */ |
| 311 | - public function __construct() |
|
| 311 | + public function __construct() |
|
| 312 | 312 | { |
| 313 | 313 | parent::__construct(); |
| 314 | 314 | $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
| 315 | - } |
|
| 315 | + } |
|
| 316 | 316 | |
| 317 | 317 | /** |
| 318 | 318 | * @param array $params |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function save($params, $show_query = false) |
| 323 | 323 | { |
| 324 | - $id = parent::save($params, $show_query); |
|
| 324 | + $id = parent::save($params, $show_query); |
|
| 325 | 325 | |
| 326 | 326 | return $id; |
| 327 | 327 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * Displays the title + grid |
| 53 | 53 | */ |
| 54 | 54 | public function display() |
| 55 | - { |
|
| 55 | + { |
|
| 56 | 56 | // action links |
| 57 | 57 | echo '<div class="actions" style="margin-bottom:20px">'; |
| 58 | 58 | echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * GradeModelComponents constructor. |
| 310 | 310 | */ |
| 311 | 311 | public function __construct() |
| 312 | - { |
|
| 312 | + { |
|
| 313 | 313 | parent::__construct(); |
| 314 | 314 | $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
| 315 | 315 | } |
@@ -258,10 +258,10 @@ |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | - * @param $form |
|
| 261 | + * @param CatForm $form |
|
| 262 | 262 | * @param string $name |
| 263 | - * @param null $default_value |
|
| 264 | - * @return bool |
|
| 263 | + * @param null|integer $default_value |
|
| 264 | + * @return false|null |
|
| 265 | 265 | */ |
| 266 | 266 | public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null) |
| 267 | 267 | { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | <div class="form-group"> |
| 105 | 105 | <div class="col-sm-offset-2 col-sm-10">{requiredNote}</div> |
| 106 | 106 | </div> |
| 107 | -EOT; |
|
| 107 | +eot; |
|
| 108 | 108 | $renderer->setRequiredNoteTemplate($noteTemplate); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -1698,7 +1698,7 @@ discard block |
||
| 1698 | 1698 | $elementName = $groupObj->getElementName($elementName); |
| 1699 | 1699 | |
| 1700 | 1700 | if ($elementName === false) { |
| 1701 | - throw new Exception("The $groupName doesn't have the element $elementName"); |
|
| 1701 | + throw new Exception("the $groupName doesn't have the element $elementName"); |
|
| 1702 | 1702 | } |
| 1703 | 1703 | |
| 1704 | 1704 | $this->_rules[$elementName][] = array( |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | * Initialization |
| 10 | 10 | */ |
| 11 | 11 | require_once __DIR__.'/config.php'; |
| 12 | -if (!api_is_platform_admin()) {
|
|
| 12 | +if (!api_is_platform_admin()) { |
|
| 13 | 13 | die ('You must have admin permissions to install plugins');
|
| 14 | 14 | } |
| 15 | 15 | BuyCoursesPlugin::create()->install(); |
@@ -288,8 +288,9 @@ |
||
| 288 | 288 | |
| 289 | 289 | if ($start_date != '' || $end_date != '') { |
| 290 | 290 | $sql .= " HAVING "; |
| 291 | - if ($start_date != '') |
|
| 292 | - $sql .= " access_date >= '$start_date' "; |
|
| 291 | + if ($start_date != '') { |
|
| 292 | + $sql .= " access_date >= '$start_date' "; |
|
| 293 | + } |
|
| 293 | 294 | if ($end_date != '') { |
| 294 | 295 | $sql = ($start_date == '') ? $sql : ($sql." AND "); |
| 295 | 296 | $sql .= " access_date <= '$end_date' "; |
@@ -304,7 +304,7 @@ |
||
| 304 | 304 | |
| 305 | 305 | // Object initialisation |
| 306 | 306 | $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); |
| 307 | - // note: are the $is_courseAdmin and $is_courseTutor parameters needed???? |
|
| 307 | + // note: are the $is_courseAdmin and $is_courseTutor parameters needed???? |
|
| 308 | 308 | |
| 309 | 309 | // Constructing the array that contains the total number of feedback messages per document. |
| 310 | 310 | $number_feedback = get_total_number_feedback(); |