@@ -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> |
@@ -15,6 +15,9 @@ discard block |
||
15 | 15 | // Set this option to true to enforce strict purification for usenames. |
16 | 16 | $purification_option_for_usernames = false; |
17 | 17 | |
18 | +/** |
|
19 | + * @param Ddeboer\DataImport\Reader\CsvReader $users |
|
20 | + */ |
|
18 | 21 | function validate_data($users) |
19 | 22 | { |
20 | 23 | global $defined_auth_sources; |
@@ -228,7 +231,7 @@ discard block |
||
228 | 231 | /** |
229 | 232 | * Read the CSV-file |
230 | 233 | * @param string $file Path to the CSV-file |
231 | - * @return array All userinformation read from the file |
|
234 | + * @return Ddeboer\DataImport\Reader\CsvReader All userinformation read from the file |
|
232 | 235 | */ |
233 | 236 | function parse_csv_data($file) |
234 | 237 | { |
@@ -464,7 +464,10 @@ |
||
464 | 464 | <blockquote> |
465 | 465 | <pre> |
466 | 466 | <b>UserName</b>;LastName;FirstName;Email;NewUserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;Active;Language;Courses;ClassId; |
467 | - xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;YYYY-MM-DD 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
467 | + xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;YYYY-MM-DD 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
468 | + echo implode(';', $list_reponse).';'; |
|
469 | +} |
|
470 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
468 | 471 | </pre> |
469 | 472 | </blockquote> |
470 | 473 | <p><?php |
@@ -9,6 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Validates imported data. |
12 | + * @param Ddeboer\DataImport\Reader\CsvReader $classes |
|
12 | 13 | */ |
13 | 14 | function validate_data($classes) { |
14 | 15 | $errors = array(); |
@@ -36,7 +37,7 @@ discard block |
||
36 | 37 | /** |
37 | 38 | * Save imported class data to database |
38 | 39 | * |
39 | - * @param $classes |
|
40 | + * @param Ddeboer\DataImport\Reader\CsvReader $classes |
|
40 | 41 | * |
41 | 42 | * @return int |
42 | 43 | */ |
@@ -10,7 +10,8 @@ |
||
10 | 10 | /** |
11 | 11 | * Validates imported data. |
12 | 12 | */ |
13 | -function validate_data($classes) { |
|
13 | +function validate_data($classes) |
|
14 | +{ |
|
14 | 15 | $errors = array(); |
15 | 16 | $usergroup = new UserGroup(); |
16 | 17 | foreach ($classes as $index => $class) { |
@@ -11,6 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Validates imported data. |
14 | + * @param Ddeboer\DataImport\Reader\CsvReader $user_classes |
|
14 | 15 | */ |
15 | 16 | function validate_data($user_classes) { |
16 | 17 | global $purification_option_for_usernames; |
@@ -66,6 +67,7 @@ discard block |
||
66 | 67 | |
67 | 68 | /** |
68 | 69 | * Saves imported data. |
70 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_classes |
|
69 | 71 | */ |
70 | 72 | function save_data($users_classes, $deleteUsersNotInList = false) { |
71 | 73 | |
@@ -115,7 +117,7 @@ discard block |
||
115 | 117 | /** |
116 | 118 | * Reads a CSV-file. |
117 | 119 | * @param string $file Path to the CSV-file |
118 | - * @return array All course-information read from the file |
|
120 | + * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file |
|
119 | 121 | */ |
120 | 122 | function parse_csv_data($file) { |
121 | 123 | $courses = Import::csvToArray($file); |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * Validates imported data. |
14 | 14 | */ |
15 | -function validate_data($user_classes) { |
|
15 | +function validate_data($user_classes) |
|
16 | +{ |
|
16 | 17 | global $purification_option_for_usernames; |
17 | 18 | $errors = array(); |
18 | 19 | $classcodes = array(); |
@@ -67,7 +68,8 @@ discard block |
||
67 | 68 | /** |
68 | 69 | * Saves imported data. |
69 | 70 | */ |
70 | -function save_data($users_classes, $deleteUsersNotInList = false) { |
|
71 | +function save_data($users_classes, $deleteUsersNotInList = false) |
|
72 | +{ |
|
71 | 73 | |
72 | 74 | global $purification_option_for_usernames; |
73 | 75 | |
@@ -117,7 +119,8 @@ discard block |
||
117 | 119 | * @param string $file Path to the CSV-file |
118 | 120 | * @return array All course-information read from the file |
119 | 121 | */ |
120 | -function parse_csv_data($file) { |
|
122 | +function parse_csv_data($file) |
|
123 | +{ |
|
121 | 124 | $courses = Import::csvToArray($file); |
122 | 125 | return $courses; |
123 | 126 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param array $data |
39 | 39 | * @param string $filename |
40 | 40 | * |
41 | - * @return mixed csv file | false if no data to export |
|
41 | + * @return false|null csv file | false if no data to export |
|
42 | 42 | */ |
43 | 43 | public static function arrayToCsv($data, $filename = 'export') |
44 | 44 | { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param string Name of common tag to place each line in |
161 | 161 | * @param string Name of the root element. A root element should always be given. |
162 | 162 | * @param string Encoding in which the data is provided |
163 | - * @return void Prompts the user for a file download |
|
163 | + * @return boolean Prompts the user for a file download |
|
164 | 164 | */ |
165 | 165 | public static function export_complex_table_xml( |
166 | 166 | $data, |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * @param string $name |
287 | 287 | * @param string $format |
288 | 288 | * |
289 | - * @return bool |
|
289 | + * @return false|null |
|
290 | 290 | */ |
291 | 291 | public static function htmlToOdt($html, $name, $format = 'odt') |
292 | 292 | { |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
118 | - * Export tabular data to XML-file |
|
119 | - * @param array Simple array of data to put in XML |
|
120 | - * @param string Name of file to be given to the user |
|
121 | - * @param string Name of common tag to place each line in |
|
122 | - * @param string Name of the root element. A root element should always be given. |
|
123 | - * @param string Encoding in which the data is provided |
|
124 | - */ |
|
118 | + * Export tabular data to XML-file |
|
119 | + * @param array Simple array of data to put in XML |
|
120 | + * @param string Name of file to be given to the user |
|
121 | + * @param string Name of common tag to place each line in |
|
122 | + * @param string Name of the root element. A root element should always be given. |
|
123 | + * @param string Encoding in which the data is provided |
|
124 | + */ |
|
125 | 125 | public static function arrayToXml( |
126 | 126 | $data, |
127 | 127 | $filename = 'export', |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | foreach ($data as $row) { |
201 | 201 | $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>'; |
202 | 202 | if (is_array($row['value'])) { |
203 | - $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
203 | + $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
204 | 204 | $string .= str_repeat("\t", $level).'</'.$row['name'].'>'; |
205 | 205 | } else { |
206 | 206 | $string .= $row['value']; |