@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // Create the directory |
53 | 53 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
54 | 54 | ///learning_path/ppt_dirname directory |
55 | - $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
|
55 | + $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) - 1); |
|
56 | 56 | $this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']); |
57 | 57 | |
58 | 58 | //var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir); |
@@ -89,18 +89,18 @@ discard block |
||
89 | 89 | $perm = api_get_setting('permissions_for_new_files'); |
90 | 90 | |
91 | 91 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
92 | - $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
93 | - $class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar'; |
|
92 | + $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
93 | + $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar'; |
|
94 | 94 | //$cmd = 'java -cp "'.$class_path.'" DokeosConverter'; |
95 | - $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter'; |
|
95 | + $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter'; |
|
96 | 96 | } else { |
97 | - $converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
97 | + $converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
98 | 98 | //$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar'; |
99 | 99 | $class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar'; |
100 | - $cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter'; |
|
100 | + $cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter'; |
|
101 | 101 | } |
102 | 102 | |
103 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
103 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
104 | 104 | // Call to the function implemented by child. |
105 | 105 | $cmd .= $this->add_command_parameters(); |
106 | 106 | // To allow openoffice to manipulate docs. |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | @chmod($this->base_work_dir.$this->file_path, 0777); |
110 | 110 | |
111 | 111 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
112 | - putenv('LC_ALL=' . $locale); |
|
112 | + putenv('LC_ALL='.$locale); |
|
113 | 113 | |
114 | 114 | $files = array(); |
115 | 115 | $return = 0; |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | if (!empty($result['images'])) { |
140 | 140 | foreach ($result['images'] as $image => $img_data) { |
141 | 141 | $image_path = $this->base_work_dir.$this->created_dir; |
142 | - @file_put_contents($image_path . '/' . $image, base64_decode($img_data)); |
|
143 | - @chmod($image_path . '/' . $image, 0777); |
|
142 | + @file_put_contents($image_path.'/'.$image, base64_decode($img_data)); |
|
143 | + @chmod($image_path.'/'.$image, 0777); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -233,38 +233,38 @@ discard block |
||
233 | 233 | $ppt2lpHost = api_get_setting('service_ppt2lp', 'host'); |
234 | 234 | $permissionFile = api_get_permissions_for_new_files(); |
235 | 235 | $permissionFolder = api_get_permissions_for_new_directories(); |
236 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
236 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
237 | 237 | |
238 | 238 | return $ids; |
239 | 239 | } |
240 | 240 | |
241 | 241 | if ($ppt2lpHost == 'localhost') { |
242 | 242 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
243 | - $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
244 | - $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar'; |
|
245 | - $cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"'; |
|
243 | + $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
244 | + $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
|
245 | + $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"'; |
|
246 | 246 | } else { |
247 | - $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
247 | + $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
248 | 248 | $classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar'; |
249 | - $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' '; |
|
249 | + $cmd = 'cd '.$converterPath.' && java '.$classPath.' '; |
|
250 | 250 | } |
251 | 251 | |
252 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
252 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
253 | 253 | // Call to the function implemented by child. |
254 | - $cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '" "' . $this->base_work_dir . '/' . $this->created_dir . '"'; |
|
254 | + $cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'" "'.$this->base_work_dir.'/'.$this->created_dir.'"'; |
|
255 | 255 | // To allow openoffice to manipulate docs. |
256 | 256 | @chmod($this->base_work_dir, $permissionFolder); |
257 | - @chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile); |
|
257 | + @chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile); |
|
258 | 258 | |
259 | 259 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
260 | - putenv('LC_ALL=' . $locale); |
|
260 | + putenv('LC_ALL='.$locale); |
|
261 | 261 | |
262 | 262 | $files = array(); |
263 | 263 | $return = 0; |
264 | 264 | $shell = exec($cmd, $files, $return); |
265 | 265 | // TODO: Chown is not working, root keep user privileges, should be www-data |
266 | - @chown($this->base_work_dir . '/' . $this->created_dir, 'www-data'); |
|
267 | - @chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile); |
|
266 | + @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data'); |
|
267 | + @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile); |
|
268 | 268 | |
269 | 269 | if ($return != 0) { // If the java application returns an error code. |
270 | 270 | switch ($return) { |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | */ |
304 | 304 | } |
305 | 305 | |
306 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
306 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
307 | 307 | |
308 | 308 | // Register Files to Document tool |
309 | 309 | $ids[] = add_document( |
310 | 310 | $_course, |
311 | - '/' . $this->created_dir, |
|
311 | + '/'.$this->created_dir, |
|
312 | 312 | 'file', |
313 | - filesize($this->base_work_dir . '/' . $this->created_dir), |
|
313 | + filesize($this->base_work_dir.'/'.$this->created_dir), |
|
314 | 314 | $convertedTitle, |
315 | 315 | sprintf( |
316 | 316 | get_lang('FileConvertedFromXToY'), |
@@ -28,10 +28,10 @@ |
||
28 | 28 | error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0); |
29 | 29 | } |
30 | 30 | $mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id); |
31 | - $mylpi =& $mylp->items[$item_id]; |
|
32 | - if (is_array($objectives) && count($objectives)>0){ |
|
33 | - foreach ($objectives as $index=>$objective){ |
|
34 | - $mylpi->add_objective($index,$objectives[$index]); |
|
31 | + $mylpi = & $mylp->items[$item_id]; |
|
32 | + if (is_array($objectives) && count($objectives) > 0) { |
|
33 | + foreach ($objectives as $index=>$objective) { |
|
34 | + $mylpi->add_objective($index, $objectives[$index]); |
|
35 | 35 | } |
36 | 36 | $mylpi->write_objectives_to_db(); |
37 | 37 | } |
@@ -309,9 +309,9 @@ discard block |
||
309 | 309 | $myname = $oOrganization->get_name(); |
310 | 310 | $myname = api_utf8_decode($myname); |
311 | 311 | |
312 | - $sql = "INSERT INTO $new_lp (c_id, lp_type, name, ref, description, path, force_commit, default_view_mod, default_encoding, js_lib,display_order, session_id, use_max_score)" . |
|
312 | + $sql = "INSERT INTO $new_lp (c_id, lp_type, name, ref, description, path, force_commit, default_view_mod, default_encoding, js_lib,display_order, session_id, use_max_score)". |
|
313 | 313 | "VALUES ($courseId , 2,'".$myname."', '".$oOrganization->get_ref()."','','".$this->subdir."', 0, 'embedded', '".$this->manifest_encoding."', 'scorm_api.php', $dsp, $sessionId, $userMaxScore)"; |
314 | - if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting path: '. $sql, 0); } |
|
314 | + if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting path: '.$sql, 0); } |
|
315 | 315 | |
316 | 316 | Database::query($sql); |
317 | 317 | $lp_id = Database::insert_id(); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $path = ''; |
366 | 366 | $type = 'dir'; |
367 | 367 | if (isset($this->resources[$item['identifierref']])) { |
368 | - $oRes =& $this->resources[$item['identifierref']]; |
|
368 | + $oRes = & $this->resources[$item['identifierref']]; |
|
369 | 369 | $path = @$oRes->get_path(); |
370 | 370 | if (!empty($path)) { |
371 | 371 | $temptype = $oRes->get_scorm_type(); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $item['parameters'] = Database::escape_string($item['parameters']); |
417 | 417 | |
418 | 418 | $sql = "INSERT INTO $new_lp_item (c_id, lp_id,item_type,ref,title, path,min_score,max_score, $field_add parent_item_id,previous_item_id,next_item_id, prerequisite,display_order,launch_data, parameters) |
419 | - VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'] .", '".$item['datafromlms']."', '".$item['parameters']."' )"; |
|
419 | + VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'].", '".$item['datafromlms']."', '".$item['parameters']."' )"; |
|
420 | 420 | |
421 | 421 | Database::query($sql); |
422 | 422 | if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting item : '.$sql, 0); } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | foreach ($specific_fields as $specific_field) { |
451 | 451 | if (isset($_REQUEST[$specific_field['code']])) { |
452 | 452 | $sterms = trim($_REQUEST[$specific_field['code']]); |
453 | - $all_specific_terms .= ' '. $sterms; |
|
453 | + $all_specific_terms .= ' '.$sterms; |
|
454 | 454 | if (!empty($sterms)) { |
455 | 455 | $sterms = explode(',', $sterms); |
456 | 456 | foreach ($sterms as $sterm) { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | } |
461 | 461 | } |
462 | - $body_to_index = $all_specific_terms .' '. $title; |
|
462 | + $body_to_index = $all_specific_terms.' '.$title; |
|
463 | 463 | $ic_slide->addValue("content", $body_to_index); |
464 | 464 | // TODO: Add a comment to say terms separated by commas. |
465 | 465 | $courseid = api_get_course_id(); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | SE_COURSE_ID => $courseid, |
470 | 470 | SE_TOOL_ID => TOOL_LEARNPATH, |
471 | 471 | SE_DATA => array('lp_id' => $lp_id, 'lp_item'=> $previous, 'document_id' => ''), // TODO: Unify with other lp types. |
472 | - SE_USER => (int)api_get_user_id(), |
|
472 | + SE_USER => (int) api_get_user_id(), |
|
473 | 473 | ); |
474 | 474 | $ic_slide->xapian_data = serialize($xapian_data); |
475 | 475 | $di->addChunk($ic_slide); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | public function import_package($zip_file_info, $current_dir = '', $courseInfo = array()) |
516 | 516 | { |
517 | 517 | if ($this->debug > 0) { |
518 | - error_log('In scorm::import_package('.print_r($zip_file_info,true).',"'.$current_dir.'") method', 0); |
|
518 | + error_log('In scorm::import_package('.print_r($zip_file_info, true).',"'.$current_dir.'") method', 0); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | $courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $zip_file_name = $zip_file_info['name']; |
527 | 527 | |
528 | 528 | if ($this->debug > 1) { |
529 | - error_log('New LP - import_package() - zip file path = ' . $zip_file_path . ', zip file name = ' . $zip_file_name, 0); |
|
529 | + error_log('New LP - import_package() - zip file path = '.$zip_file_path.', zip file name = '.$zip_file_name, 0); |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | $course_rel_dir = api_get_course_path($courseInfo['code']).'/scorm'; // scorm dir web path starting from /courses |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | $current_dir = api_replace_dangerous_char(trim($current_dir)); // Current dir we are in, inside scorm/ |
535 | 535 | |
536 | 536 | if ($this->debug > 1) { |
537 | - error_log( 'New LP - import_package() - current_dir = ' . $current_dir, 0); |
|
537 | + error_log('New LP - import_package() - current_dir = '.$current_dir, 0); |
|
538 | 538 | } |
539 | 539 | |
540 | 540 | // Get name of the zip file without the extension. |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $file_info = pathinfo($zip_file_name); |
543 | 543 | $filename = $file_info['basename']; |
544 | 544 | $extension = $file_info['extension']; |
545 | - $file_base_name = str_replace('.'.$extension,'',$filename); // Filename without its extension. |
|
545 | + $file_base_name = str_replace('.'.$extension, '', $filename); // Filename without its extension. |
|
546 | 546 | $this->zipname = $file_base_name; // Save for later in case we don't have a title. |
547 | 547 | |
548 | 548 | if ($this->debug > 1) { error_log("New LP - base file name is : ".$file_base_name, 0); } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $slash_count = substr_count($shortest_path, '/'); |
589 | 589 | foreach ($manifest_list as $manifest_path) { |
590 | 590 | $tmp_slash_count = substr_count($manifest_path, '/'); |
591 | - if ($tmp_slash_count<$slash_count) { |
|
591 | + if ($tmp_slash_count < $slash_count) { |
|
592 | 592 | $shortest_path = $manifest_path; |
593 | 593 | $slash_count = $tmp_slash_count; |
594 | 594 | } |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | $this->subdir .= '/'.dirname($shortest_path); // Do not concatenate because already done above. |
598 | 598 | $manifest = $shortest_path; |
599 | 599 | if ($this->debug > 1) { error_log('New LP - Package type is now '.$package_type, 0); } |
600 | - if ($package_type== '') { |
|
600 | + if ($package_type == '') { |
|
601 | 601 | // && defined('CHECK_FOR_SCORM') && CHECK_FOR_SCORM) |
602 | 602 | if ($this->debug > 1) { error_log('New LP - Package type is empty', 0); } |
603 | 603 | return api_failure::set_failure('not_scorm_content'); |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | $new_dir = '/'.$new_dir; |
614 | 614 | } |
615 | 615 | |
616 | - if ($new_dir[strlen($new_dir)-1] == '/') { |
|
617 | - $new_dir = substr($new_dir,0,-1); |
|
616 | + if ($new_dir[strlen($new_dir) - 1] == '/') { |
|
617 | + $new_dir = substr($new_dir, 0, -1); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | /* Uncompressing phase */ |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | if ($file != '.' && $file != '..') { |
656 | 656 | $filetype = 'file'; |
657 | 657 | |
658 | - if (is_dir($course_sys_dir . $new_dir . $file)) { |
|
658 | + if (is_dir($course_sys_dir.$new_dir.$file)) { |
|
659 | 659 | $filetype = 'folder'; |
660 | 660 | } |
661 | 661 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | } |
685 | 685 | } |
686 | 686 | } |
687 | - @rename($course_sys_dir.$new_dir.$file,$course_sys_dir.$new_dir.$safe_file); |
|
687 | + @rename($course_sys_dir.$new_dir.$file, $course_sys_dir.$new_dir.$safe_file); |
|
688 | 688 | if ($this->debug >= 1) { error_log('New LP - Renaming '.$course_sys_dir.$new_dir.$file.' to '.$course_sys_dir.$new_dir.$safe_file, 0); } |
689 | 689 | } |
690 | 690 | } |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | if ($this->debug > 0) { error_log('In scorm::get_res_path('.$id.') method', 0); } |
874 | 874 | $path = ''; |
875 | 875 | if (isset($this->resources[$id])) { |
876 | - $oRes =& $this->resources[$id]; |
|
876 | + $oRes = & $this->resources[$id]; |
|
877 | 877 | $path = @$oRes->get_path(); |
878 | 878 | } |
879 | 879 | return $path; |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | if ($this->debug > 0) { error_log('In scorm::get_res_type('.$id.') method', 0); } |
890 | 890 | $type = ''; |
891 | 891 | if (isset($this->resources[$id])) { |
892 | - $oRes =& $this->resources[$id]; |
|
892 | + $oRes = & $this->resources[$id]; |
|
893 | 893 | $temptype = $oRes->get_scorm_type(); |
894 | 894 | if (!empty($temptype)) { |
895 | 895 | $type = $temptype; |
@@ -908,9 +908,9 @@ discard block |
||
908 | 908 | $title = ''; |
909 | 909 | if (isset($this->manifest['organizations']['default'])) { |
910 | 910 | $title = $this->organizations[$this->manifest['organizations']['default']]->get_name(); |
911 | - } elseif (count($this->organizations)==1) { |
|
911 | + } elseif (count($this->organizations) == 1) { |
|
912 | 912 | // This will only get one title but so we don't need to know the index. |
913 | - foreach($this->organizations as $id => $value) { |
|
913 | + foreach ($this->organizations as $id => $value) { |
|
914 | 914 | $title = $this->organizations[$id]->get_name(); |
915 | 915 | break; |
916 | 916 | } |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $a_dir = realpath($dir.'/../../archive/'); |
16 | 16 | $list = scandir($a_dir); |
17 | 17 | // calculate 7 days |
18 | -$t = time()-(86400*7); |
|
18 | +$t = time() - (86400 * 7); |
|
19 | 19 | foreach ($list as $item) { |
20 | - if (substr($item,0,1) == '.') { |
|
20 | + if (substr($item, 0, 1) == '.') { |
|
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | $stat = @stat($a_dir.'/'.$item); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * Delete a file or recursively delete a directory |
35 | 35 | * @param string $str Path to file or directory |
36 | 36 | */ |
37 | -function recursive_delete($str){ |
|
37 | +function recursive_delete($str) { |
|
38 | 38 | if (is_file($str)) { |
39 | 39 | return @unlink($str); |
40 | 40 | } elseif (is_dir($str)) { |
41 | - $scan = glob(rtrim($str,'/').'/*'); |
|
41 | + $scan = glob(rtrim($str, '/').'/*'); |
|
42 | 42 | foreach ($scan as $index=>$path) { |
43 | 43 | recursive_delete($path); |
44 | 44 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package chamilo.cron |
6 | 6 | * @author Imanol Losada <[email protected]> |
7 | 7 | */ |
8 | -require_once __DIR__ . '/../inc/global.inc.php'; |
|
8 | +require_once __DIR__.'/../inc/global.inc.php'; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Initialization |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | foreach ($sessions as $sessionId => $userIds) { |
66 | 66 | $userId = 0; |
67 | - $userIds = $userIds ? " AND sessionUser.user_id NOT IN (" . implode(", ", $userIds) . ")" : null; |
|
67 | + $userIds = $userIds ? " AND sessionUser.user_id NOT IN (".implode(", ", $userIds).")" : null; |
|
68 | 68 | $query = " |
69 | 69 | SELECT sessionUser.session_id, sessionUser.user_id, session.name, session.access_end_date |
70 | 70 | FROM $sessionUserTable AS sessionUser |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | $administrator['completeName'], |
157 | 157 | $administrator['email'] |
158 | 158 | ); |
159 | - echo "Email sent to $userCompleteName (" . $user['email'] . ")\n"; |
|
160 | - echo "Session: " . $session['name'] . "\n"; |
|
161 | - echo "Date end: " . $session['access_end_date'] . "\n"; |
|
162 | - echo "Days remaining: " . $daysRemaining->format("%d") . "\n\n"; |
|
159 | + echo "Email sent to $userCompleteName (".$user['email'].")\n"; |
|
160 | + echo "Session: ".$session['name']."\n"; |
|
161 | + echo "Date end: ".$session['access_end_date']."\n"; |
|
162 | + echo "Days remaining: ".$daysRemaining->format("%d")."\n\n"; |
|
163 | 163 | } |
164 | 164 | echo "======================================================================\n\n"; |
165 | 165 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @author Angel Fernando Quiroz Campos <[email protected]> |
7 | 7 | * @package chamilo.cron |
8 | 8 | */ |
9 | -require_once __DIR__ . '/../inc/global.inc.php'; |
|
9 | +require_once __DIR__.'/../inc/global.inc.php'; |
|
10 | 10 | |
11 | 11 | if (php_sapi_name() != 'cli') { |
12 | 12 | exit; //do not run from browser |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ->getResult(); |
33 | 33 | |
34 | 34 | if (empty($sessions)) { |
35 | - echo "No sessions finishing today $endDate" . PHP_EOL; |
|
35 | + echo "No sessions finishing today $endDate".PHP_EOL; |
|
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $sessionUsers = $session->getUsers(); |
51 | 51 | |
52 | 52 | if (empty($sessionUsers)) { |
53 | - echo 'No users to send mail' . PHP_EOL; |
|
53 | + echo 'No users to send mail'.PHP_EOL; |
|
54 | 54 | exit; |
55 | 55 | } |
56 | 56 | |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | $administrator['email'] |
82 | 82 | ); |
83 | 83 | |
84 | - echo '============' . PHP_EOL; |
|
85 | - echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})" . PHP_EOL; |
|
86 | - echo "Session: {$session->getName()}" . PHP_EOL; |
|
87 | - echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}" . PHP_EOL; |
|
84 | + echo '============'.PHP_EOL; |
|
85 | + echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})".PHP_EOL; |
|
86 | + echo "Session: {$session->getName()}".PHP_EOL; |
|
87 | + echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}".PHP_EOL; |
|
88 | 88 | } |
89 | 89 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $totalSize = $row['total']; |
98 | 98 | |
99 | 99 | if ($debug) { |
100 | - echo "Total size in table $table " . (round($totalSize / 1024)) . " MB \n"; |
|
100 | + echo "Total size in table $table ".(round($totalSize / 1024))." MB \n"; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $table = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $subTotal = $row['total']; |
108 | 108 | $totalSize += $subTotal; |
109 | 109 | if ($debug) { |
110 | - echo "Total size in table $table " . (round($subTotal / 1024)) . " MB \n"; |
|
110 | + echo "Total size in table $table ".(round($subTotal / 1024))." MB \n"; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $totalSize = $totalSize / 1024; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Initialization |
9 | 9 | */ |
10 | -if (PHP_SAPI!='cli') { |
|
10 | +if (PHP_SAPI != 'cli') { |
|
11 | 11 | die('Run this script through the command line or comment this line in the code'); |
12 | 12 | } |
13 | 13 |
@@ -12,13 +12,13 @@ |
||
12 | 12 | } else { |
13 | 13 | echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />"; |
14 | 14 | } |
15 | -$courses_list = CourseManager::get_courses_list(); |
|
15 | +$courses_list = CourseManager::get_courses_list(); |
|
16 | 16 | foreach ($courses_list as $course) { |
17 | 17 | $title = Database::escape_string($_GET['doc']); |
18 | 18 | $td = Database::get_course_table(TABLE_DOCUMENT); |
19 | 19 | $sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'"; |
20 | 20 | $res = Database::query($sql); |
21 | - if (Database::num_rows($res)>0) { |
|
21 | + if (Database::num_rows($res) > 0) { |
|
22 | 22 | while ($row = Database::fetch_array($res)) { |
23 | 23 | echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />"; |
24 | 24 | } |