@@ -239,6 +239,7 @@ |
||
| 239 | 239 | /** |
| 240 | 240 | * @author Isaac flores paz <[email protected]> |
| 241 | 241 | * @param String The xapian error message |
| 242 | + * @param string $xapian_error_message |
|
| 242 | 243 | * @return String The chamilo error message |
| 243 | 244 | */ |
| 244 | 245 | function display_xapian_error($xapian_error_message) { |
@@ -30,7 +30,8 @@ discard block |
||
| 30 | 30 | * @param int $count_type Number of items to retrieve |
| 31 | 31 | * @return array An array of nids corresponding to the results. |
| 32 | 32 | */ |
| 33 | -function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) { |
|
| 33 | +function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) |
|
| 34 | +{ |
|
| 34 | 35 | |
| 35 | 36 | try { |
| 36 | 37 | if (!is_object($db)) { |
@@ -129,7 +130,8 @@ discard block |
||
| 129 | 130 | /** |
| 130 | 131 | * build a boolean query |
| 131 | 132 | */ |
| 132 | -function xapian_get_boolean_query($term) { |
|
| 133 | +function xapian_get_boolean_query($term) |
|
| 134 | +{ |
|
| 133 | 135 | return new XapianQuery($term); |
| 134 | 136 | } |
| 135 | 137 | |
@@ -141,7 +143,8 @@ discard block |
||
| 141 | 143 | * @param XapianDatabase $db Xapian database to connect |
| 142 | 144 | * @return array |
| 143 | 145 | */ |
| 144 | -function xapian_get_all_terms($count = 0, $prefix, $db = NULL) { |
|
| 146 | +function xapian_get_all_terms($count = 0, $prefix, $db = NULL) |
|
| 147 | +{ |
|
| 145 | 148 | try { |
| 146 | 149 | if (!is_object($db)) { |
| 147 | 150 | $db = new XapianDatabase(XAPIAN_DB); |
@@ -175,7 +178,8 @@ discard block |
||
| 175 | 178 | * @param XapianDocument document searched |
| 176 | 179 | * @return array |
| 177 | 180 | */ |
| 178 | -function xapian_get_doc_terms($doc = NULL, $prefix) { |
|
| 181 | +function xapian_get_doc_terms($doc = NULL, $prefix) |
|
| 182 | +{ |
|
| 179 | 183 | try { |
| 180 | 184 | if (!is_a($doc, 'XapianDocument')) { |
| 181 | 185 | return; |
@@ -210,7 +214,8 @@ discard block |
||
| 210 | 214 | * @param string $op |
| 211 | 215 | * @return XapianQuery query joined |
| 212 | 216 | */ |
| 213 | -function xapian_join_queries($query1, $query2 = NULL, $op = 'or') { |
|
| 217 | +function xapian_join_queries($query1, $query2 = NULL, $op = 'or') |
|
| 218 | +{ |
|
| 214 | 219 | // let decide how to join, avoiding include xapian.php outside |
| 215 | 220 | switch ($op) { |
| 216 | 221 | case 'or': |
@@ -244,7 +249,8 @@ discard block |
||
| 244 | 249 | * @param String The xapian error message |
| 245 | 250 | * @return String The chamilo error message |
| 246 | 251 | */ |
| 247 | -function display_xapian_error($xapian_error_message) { |
|
| 252 | +function display_xapian_error($xapian_error_message) |
|
| 253 | +{ |
|
| 248 | 254 | $message = explode(':', $xapian_error_message); |
| 249 | 255 | $type_error_message = $message[0]; |
| 250 | 256 | if ($type_error_message == 'DatabaseOpeningError') { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param int $count_type Number of items to retrieve |
| 31 | 31 | * @return array An array of nids corresponding to the results. |
| 32 | 32 | */ |
| 33 | -function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) { |
|
| 33 | +function xapian_query($query_string, $db = null, $start = 0, $length = 10, $extra = array(), $count_type = 0) { |
|
| 34 | 34 | |
| 35 | 35 | try { |
| 36 | 36 | if (!is_object($db)) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | - $query = NULL; |
|
| 49 | + $query = null; |
|
| 50 | 50 | $enquire = new XapianEnquire($db); |
| 51 | 51 | |
| 52 | 52 | if (!empty($query_string)) { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return array($count, $results); |
| 123 | 123 | } catch (Exception $e) { |
| 124 | 124 | display_xapian_error($e->getMessage()); |
| 125 | - return NULL; |
|
| 125 | + return null; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param XapianDatabase $db Xapian database to connect |
| 142 | 142 | * @return array |
| 143 | 143 | */ |
| 144 | -function xapian_get_all_terms($count = 0, $prefix, $db = NULL) { |
|
| 144 | +function xapian_get_all_terms($count = 0, $prefix, $db = null) { |
|
| 145 | 145 | try { |
| 146 | 146 | if (!is_object($db)) { |
| 147 | 147 | $db = new XapianDatabase(XAPIAN_DB); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | return $terms; |
| 166 | 166 | } catch (Exception $e) { |
| 167 | 167 | display_xapian_error($e->getMessage()); |
| 168 | - return NULL; |
|
| 168 | + return null; |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param XapianDocument document searched |
| 176 | 176 | * @return array |
| 177 | 177 | */ |
| 178 | -function xapian_get_doc_terms($doc = NULL, $prefix) { |
|
| 178 | +function xapian_get_doc_terms($doc = null, $prefix) { |
|
| 179 | 179 | try { |
| 180 | 180 | if (!is_a($doc, 'XapianDocument')) { |
| 181 | 181 | return; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | return $terms; |
| 199 | 199 | } catch (Exception $e) { |
| 200 | 200 | display_xapian_error($e->getMessage()); |
| 201 | - return NULL; |
|
| 201 | + return null; |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * @param string $op |
| 211 | 211 | * @return XapianQuery query joined |
| 212 | 212 | */ |
| 213 | -function xapian_join_queries($query1, $query2 = NULL, $op = 'or') { |
|
| 213 | +function xapian_join_queries($query1, $query2 = null, $op = 'or') { |
|
| 214 | 214 | // let decide how to join, avoiding include xapian.php outside |
| 215 | 215 | switch ($op) { |
| 216 | 216 | case 'or': |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * @param array $additionalParameters |
| 23 | 23 | * |
| 24 | - * @return mixed |
|
| 24 | + * @return void |
|
| 25 | 25 | */ |
| 26 | 26 | public function send($additionalParameters); |
| 27 | 27 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | * Set accessUrlId |
| 41 | 41 | * |
| 42 | 42 | * @param integer $accessUrlId |
| 43 | - * @return AccessUrlRelSession |
|
| 43 | + * @return AccessUrlRelCourseCategory |
|
| 44 | 44 | */ |
| 45 | 45 | public function setAccessUrlId($accessUrlId) |
| 46 | 46 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * Set code |
| 40 | 40 | * |
| 41 | 41 | * @param string $code |
| 42 | - * @return Class |
|
| 42 | + * @return ClassItem |
|
| 43 | 43 | */ |
| 44 | 44 | public function setCode($code) |
| 45 | 45 | { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * Set name |
| 63 | 63 | * |
| 64 | 64 | * @param string $name |
| 65 | - * @return Class |
|
| 65 | + * @return ClassItem |
|
| 66 | 66 | */ |
| 67 | 67 | public function setName($name) |
| 68 | 68 | { |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | * Set relationType |
| 118 | 118 | * |
| 119 | 119 | * @param integer $relationType |
| 120 | - * @return GroupRelUser |
|
| 120 | + * @return UsergroupRelUser |
|
| 121 | 121 | */ |
| 122 | 122 | public function setRelationType($relationType) |
| 123 | 123 | { |
@@ -9,6 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Validates the imported data. |
| 12 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_courses |
|
| 12 | 13 | */ |
| 13 | 14 | function validate_data($users_courses) |
| 14 | 15 | { |
@@ -65,6 +66,7 @@ discard block |
||
| 65 | 66 | |
| 66 | 67 | /** |
| 67 | 68 | * Saves imported data. |
| 69 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_courses |
|
| 68 | 70 | */ |
| 69 | 71 | function save_data($users_courses) |
| 70 | 72 | { |
@@ -133,7 +135,7 @@ discard block |
||
| 133 | 135 | /** |
| 134 | 136 | * Reads CSV-file. |
| 135 | 137 | * @param string $file Path to the CSV-file |
| 136 | - * @return array All course-information read from the file |
|
| 138 | + * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file |
|
| 137 | 139 | */ |
| 138 | 140 | function parse_csv_data($file) |
| 139 | 141 | { |
@@ -8,6 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | /** |
| 10 | 10 | * Validates the imported data. |
| 11 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_courses |
|
| 11 | 12 | */ |
| 12 | 13 | function validate_data($users_courses) |
| 13 | 14 | { |
@@ -66,6 +67,7 @@ discard block |
||
| 66 | 67 | |
| 67 | 68 | /** |
| 68 | 69 | * Saves imported data. |
| 70 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_courses |
|
| 69 | 71 | */ |
| 70 | 72 | function save_data($users_courses) |
| 71 | 73 | { |
@@ -134,7 +136,7 @@ discard block |
||
| 134 | 136 | /** |
| 135 | 137 | * Reads CSV-file. |
| 136 | 138 | * @param string $file Path to the CSV-file |
| 137 | - * @return array All course-information read from the file |
|
| 139 | + * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file |
|
| 138 | 140 | */ |
| 139 | 141 | function parse_csv_data($file) |
| 140 | 142 | { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Validate the imported data. |
| 15 | - * @param $skills |
|
| 15 | + * @param Ddeboer\DataImport\Reader\CsvReader $skills |
|
| 16 | 16 | * @return array |
| 17 | 17 | */ |
| 18 | 18 | function validate_data($skills) |
@@ -50,6 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Save the imported data |
| 52 | 52 | * @param array List of users |
| 53 | + * @param Ddeboer\DataImport\Reader\CsvReader $skills |
|
| 53 | 54 | * @return void |
| 54 | 55 | * @uses global variable $inserted_in_course, |
| 55 | 56 | * which returns the list of courses the user was inserted in |
@@ -77,7 +78,7 @@ discard block |
||
| 77 | 78 | /** |
| 78 | 79 | * Read the CSV-file |
| 79 | 80 | * @param string $file Path to the CSV-file |
| 80 | - * @return array All userinformation read from the file |
|
| 81 | + * @return Ddeboer\DataImport\Reader\CsvReader All userinformation read from the file |
|
| 81 | 82 | */ |
| 82 | 83 | function parse_csv_data($file) |
| 83 | 84 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $oskill = new Skill(); |
| 71 | 71 | $skill_id = $oskill->add($skill); |
| 72 | 72 | $parents[$saved_id] = $skill_id; |
| 73 | - } |
|
| 73 | + } |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | function parse_csv_data($file) |
| 83 | 83 | { |
| 84 | - $skills = Import :: csvToArray($file); |
|
| 85 | - foreach ($skills as $index => $skill) { |
|
| 86 | - $skills[$index] = $skill; |
|
| 87 | - } |
|
| 84 | + $skills = Import :: csvToArray($file); |
|
| 85 | + foreach ($skills as $index => $skill) { |
|
| 86 | + $skills[$index] = $skill; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - return $skills; |
|
| 89 | + return $skills; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | function element_start($parser, $data) |
| 96 | 96 | { |
| 97 | - $data = api_utf8_decode($data); |
|
| 97 | + $data = api_utf8_decode($data); |
|
| 98 | 98 | global $skill; |
| 99 | 99 | global $current_tag; |
| 100 | 100 | switch ($data) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | function element_end($parser, $data) |
| 113 | 113 | { |
| 114 | - $data = api_utf8_decode($data); |
|
| 114 | + $data = api_utf8_decode($data); |
|
| 115 | 115 | global $skill; |
| 116 | 116 | global $skills; |
| 117 | 117 | global $current_value; |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | function character_data($parser, $data) |
| 132 | 132 | { |
| 133 | - $data = trim(api_utf8_decode($data)); |
|
| 134 | - global $current_value; |
|
| 135 | - $current_value = $data; |
|
| 133 | + $data = trim(api_utf8_decode($data)); |
|
| 134 | + global $current_value; |
|
| 135 | + $current_value = $data; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | xml_parse($parser, api_utf8_encode_xml(file_get_contents($file))); |
| 155 | 155 | xml_parser_free($parser); |
| 156 | 156 | |
| 157 | - return $skills; |
|
| 157 | + return $skills; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -227,7 +227,7 @@ |
||
| 227 | 227 | /** |
| 228 | 228 | * Read the CSV-file |
| 229 | 229 | * @param string $file Path to the CSV-file |
| 230 | - * @return array All userinformation read from the file |
|
| 230 | + * @return Ddeboer\DataImport\Reader\CsvReader All userinformation read from the file |
|
| 231 | 231 | */ |
| 232 | 232 | function parse_csv_data($file) |
| 233 | 233 | { |
@@ -364,7 +364,7 @@ |
||
| 364 | 364 | $user_id_error = array(); |
| 365 | 365 | $error_message = ''; |
| 366 | 366 | |
| 367 | -if (isset($_POST['formSent']) && $_POST['formSent'] AND |
|
| 367 | +if (isset($_POST['formSent']) && $_POST['formSent'] and |
|
| 368 | 368 | $_FILES['import_file']['size'] !== 0 |
| 369 | 369 | ) { |
| 370 | 370 | $file_type = $_POST['file_type']; |
@@ -535,8 +535,14 @@ |
||
| 535 | 535 | <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
| 536 | 536 | <blockquote> |
| 537 | 537 | <pre> |
| 538 | -<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId; |
|
| 539 | -<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
| 538 | +<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) { |
|
| 539 | + echo implode(';', $list).';'; |
|
| 540 | +} |
|
| 541 | +?></span>Courses;ClassId; |
|
| 542 | +<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
| 543 | + echo implode(';', $list_reponse).';'; |
|
| 544 | +} |
|
| 545 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
| 540 | 546 | </pre> |
| 541 | 547 | </blockquote> |
| 542 | 548 | <p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |