@@ -81,7 +81,7 @@ |
||
81 | 81 | //just showing the src in a iframe ... |
82 | 82 | $html .= '<h2>'.$toc['title'].'</h2>'; |
83 | 83 | $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>'; |
84 | - }else{ |
|
84 | + } else{ |
|
85 | 85 | $html .= "<div class='impress-title'>"; |
86 | 86 | $html .= '<h1>'.$toc['title'].'</h1>'; |
87 | 87 | $html .= "</div>"; |
@@ -119,8 +119,9 @@ |
||
119 | 119 | |
120 | 120 | for ($i = 0; $i<count($matches[0]); $i++) { |
121 | 121 | |
122 | - if (empty($matches[1][$i])) |
|
123 | - continue; |
|
122 | + if (empty($matches[1][$i])) { |
|
123 | + continue; |
|
124 | + } |
|
124 | 125 | |
125 | 126 | $content = api_strstr($content, $matches[0][$i]); |
126 | 127 | if ($i + 1 !== count($matches[0])) { |
@@ -337,9 +337,14 @@ discard block |
||
337 | 337 | |
338 | 338 | $length = ((($builder == 'builder') && ($icon == 'nolink')) ? 65 : 32); |
339 | 339 | |
340 | - if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
340 | + if ($builder != 'builder') { |
|
341 | + $origin = 'learnpath'; |
|
342 | + } |
|
343 | + //origin = learnpath in student view |
|
341 | 344 | $linktype = $type; |
342 | - if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link'; |
|
345 | + if (($type == 'Link _self') or ($type == 'Link _blank')) { |
|
346 | + $type = 'Link'; |
|
347 | + } |
|
343 | 348 | |
344 | 349 | // YW switched litteral tool names to use of constants declared in main_api.lib.php |
345 | 350 | switch ($type) { |
@@ -1371,11 +1376,12 @@ discard block |
||
1371 | 1376 | WHERE c_id = $course_id AND source_type='$type' and source_id='$id'"; |
1372 | 1377 | $result = Database::query($sql); |
1373 | 1378 | $number_added = Database::num_rows($result); |
1374 | - if ($number_added != 0) |
|
1375 | - return true; |
|
1376 | - else |
|
1377 | - return false; |
|
1378 | -} |
|
1379 | + if ($number_added != 0) { |
|
1380 | + return true; |
|
1381 | + } else { |
|
1382 | + return false; |
|
1383 | + } |
|
1384 | + } |
|
1379 | 1385 | |
1380 | 1386 | /** |
1381 | 1387 | * This function is to load the resources that were added to a specific item |
@@ -1496,8 +1502,7 @@ discard block |
||
1496 | 1502 | next($addedresource); |
1497 | 1503 | } |
1498 | 1504 | echo '</table>'; |
1499 | - } |
|
1500 | - else { // it is a string |
|
1505 | + } else { // it is a string |
|
1501 | 1506 | echo ''; |
1502 | 1507 | } |
1503 | 1508 | } // end of the display_resources function |
@@ -1533,8 +1538,7 @@ discard block |
||
1533 | 1538 | echo "<a href='".api_get_self()."?content=".$type."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&lp_id=$learningPathId&parent_item_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
1534 | 1539 | } |
1535 | 1540 | } |
1536 | - } |
|
1537 | - else { // if it is not an array, it is a string |
|
1541 | + } else { // if it is not an array, it is a string |
|
1538 | 1542 | if ($_SESSION['addedresource'] !== $type || $_SESSION['addedresourceid'] !== $id) { |
1539 | 1543 | if ($from_learnpath) { $lang_add_it_or_resource = get_lang('AddIt'); } else { $lang_add_it_or_resource = get_lang('AddResource'); } |
1540 | 1544 | echo "<a href='".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&lp_id=$learningPathId&parent_item_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
@@ -1561,7 +1565,9 @@ discard block |
||
1561 | 1565 | $course_id = api_get_course_int_id(); |
1562 | 1566 | |
1563 | 1567 | // Styling the link of the added resource |
1564 | - if ($style != '') $styling = ' class="'.$style.'"'; |
|
1568 | + if ($style != '') { |
|
1569 | + $styling = ' class="'.$style.'"'; |
|
1570 | + } |
|
1565 | 1571 | if ($new_window) { $target = ' target = "_blank" '; } else { $target = ' target = "_self" '; } |
1566 | 1572 | |
1567 | 1573 | $output = ''; |
@@ -207,7 +207,10 @@ discard block |
||
207 | 207 | |
208 | 208 | unset($Courses); |
209 | 209 | ?> |
210 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
210 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) { |
|
211 | + echo '&add=true' ; |
|
212 | +} |
|
213 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
211 | 214 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
212 | 215 | <input type="hidden" name="formSent" value="1" /> |
213 | 216 | |
@@ -230,7 +233,10 @@ discard block |
||
230 | 233 | <div id="ajax_list_courses_multiple"> |
231 | 234 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
232 | 235 | <?php foreach ($nosessionCourses as $enreg) { ?> |
233 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>> |
|
236 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
237 | + echo 'selected="selected"'; |
|
238 | +} |
|
239 | +?>> |
|
234 | 240 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
235 | 241 | </option> |
236 | 242 | <?php } ?> |
@@ -3342,7 +3342,7 @@ discard block |
||
3342 | 3342 | $html .= '<a class="thumbnail" href="'.$params['link'].'">'; |
3343 | 3343 | $html .= $params['icon']; |
3344 | 3344 | $html .= '</a>'; |
3345 | - }else{ |
|
3345 | + } else{ |
|
3346 | 3346 | $html .= $params['icon']; |
3347 | 3347 | } |
3348 | 3348 | $html .= '</div>'; |
@@ -3423,7 +3423,7 @@ discard block |
||
3423 | 3423 | . Display::returnFontAwesomeIcon('folder-open') . '</a>'; |
3424 | 3424 | $params['document'] .= Display::div('', ['id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container']); |
3425 | 3425 | } |
3426 | - }else{ |
|
3426 | + } else{ |
|
3427 | 3427 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED && $load_dirs) { |
3428 | 3428 | $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">' |
3429 | 3429 | . Display::returnFontAwesomeIcon('folder-open') . '</a>'; |
@@ -3598,7 +3598,7 @@ discard block |
||
3598 | 3598 | if ($showCustomIcon === 'true' && $iconName != 'course.png') { |
3599 | 3599 | $thumbnails = $course_info['course_image']; |
3600 | 3600 | $image = $course_info['course_image_large']; |
3601 | - }else{ |
|
3601 | + } else{ |
|
3602 | 3602 | $image = Display::return_icon('session_default.png', null, null, null,null, true); |
3603 | 3603 | } |
3604 | 3604 | |
@@ -3736,7 +3736,7 @@ discard block |
||
3736 | 3736 | if ($showCustomIcon === 'true' && $iconName != 'course.png') { |
3737 | 3737 | $thumbnails = $course_info['course_image']; |
3738 | 3738 | $image = $course_info['course_image_large']; |
3739 | - }else{ |
|
3739 | + } else{ |
|
3740 | 3740 | $image = Display::return_icon('session_default.png', null, null, null,null, true); |
3741 | 3741 | } |
3742 | 3742 | |
@@ -3998,7 +3998,7 @@ discard block |
||
3998 | 3998 | if ($showCustomIcon === 'true' && $iconName != 'course.png') { |
3999 | 3999 | $thumbnails = $course_info['course_image']; |
4000 | 4000 | $image = $course_info['course_image_large']; |
4001 | - }else{ |
|
4001 | + } else{ |
|
4002 | 4002 | $image = Display::return_icon('session_default.png', null, null, null,null, true); |
4003 | 4003 | } |
4004 | 4004 | $params['thumbnails'] = $thumbnails; |
@@ -9,9 +9,10 @@ |
||
9 | 9 | |
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | -if (!empty($thematic_plan_data)) |
|
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
12 | +if (!empty($thematic_plan_data)) { |
|
13 | + foreach($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | +} |
|
15 | 16 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 17 | } |
17 | 18 |
@@ -287,7 +287,10 @@ discard block |
||
287 | 287 | <td width="40%" align="center"> |
288 | 288 | <select name="UserList[]" multiple="multiple" size="20" style="width:300px;"> |
289 | 289 | <?php foreach ($db_users as $user) { ?> |
290 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>> |
|
290 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) { |
|
291 | + echo 'selected="selected"'; |
|
292 | +} |
|
293 | +?>> |
|
291 | 294 | <?php |
292 | 295 | $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; |
293 | 296 | if ($showOfficialCode) { |
@@ -308,7 +311,10 @@ discard block |
||
308 | 311 | <td width="40%" align="center"> |
309 | 312 | <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;"> |
310 | 313 | <?php foreach ($db_courses as $course) { ?> |
311 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>> |
|
314 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
315 | + echo 'selected="selected"'; |
|
316 | +} |
|
317 | +?>> |
|
312 | 318 | <?php echo '('.$course['visual_code'].') '.$course['title']; ?> |
313 | 319 | </option> |
314 | 320 | <?php } ?> |
@@ -3944,8 +3944,9 @@ discard block |
||
3944 | 3944 | WHERE c_id = ".$course_id." |
3945 | 3945 | ORDER BY display_order"; |
3946 | 3946 | $res = Database::query($sql); |
3947 | - if ($res === false) |
|
3948 | - return false; |
|
3947 | + if ($res === false) { |
|
3948 | + return false; |
|
3949 | + } |
|
3949 | 3950 | $lps = array (); |
3950 | 3951 | $lp_order = array (); |
3951 | 3952 | $num = Database :: num_rows($res); |
@@ -4545,8 +4546,9 @@ discard block |
||
4545 | 4546 | if ($this->debug > 0) { |
4546 | 4547 | error_log('New LP - In learnpath::set_maker()', 0); |
4547 | 4548 | } |
4548 | - if (empty ($name)) |
|
4549 | - return false; |
|
4549 | + if (empty ($name)) { |
|
4550 | + return false; |
|
4551 | + } |
|
4550 | 4552 | $this->maker = $name; |
4551 | 4553 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4552 | 4554 | $course_id = api_get_course_int_id(); |
@@ -4611,8 +4613,9 @@ discard block |
||
4611 | 4613 | public function set_terms_by_prefix($terms_string, $prefix) |
4612 | 4614 | { |
4613 | 4615 | $course_id = api_get_course_int_id(); |
4614 | - if (api_get_setting('search_enabled') !== 'true') |
|
4615 | - return false; |
|
4616 | + if (api_get_setting('search_enabled') !== 'true') { |
|
4617 | + return false; |
|
4618 | + } |
|
4616 | 4619 | |
4617 | 4620 | if (!extension_loaded('xapian')) { |
4618 | 4621 | return false; |
@@ -4625,8 +4628,9 @@ discard block |
||
4625 | 4628 | $stored_terms = $this->get_common_index_terms_by_prefix($prefix); |
4626 | 4629 | |
4627 | 4630 | // Don't do anything if no change, verify only at DB, not the search engine. |
4628 | - if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
|
4629 | - return false; |
|
4631 | + if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) { |
|
4632 | + return false; |
|
4633 | + } |
|
4630 | 4634 | |
4631 | 4635 | require_once 'xapian.php'; // TODO: Try catch every xapian use or make wrappers on API. |
4632 | 4636 | require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
@@ -4818,8 +4822,9 @@ discard block |
||
4818 | 4822 | if ($this->debug > 0) { |
4819 | 4823 | error_log('New LP - In learnpath::set_proximity()', 0); |
4820 | 4824 | } |
4821 | - if (empty ($name)) |
|
4822 | - return false; |
|
4825 | + if (empty ($name)) { |
|
4826 | + return false; |
|
4827 | + } |
|
4823 | 4828 | |
4824 | 4829 | $this->proximity = $name; |
4825 | 4830 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
@@ -5163,8 +5168,9 @@ discard block |
||
5163 | 5168 | |
5164 | 5169 | $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." ORDER BY display_order"; |
5165 | 5170 | $res = Database::query($sql); |
5166 | - if ($res === false) |
|
5167 | - return false; |
|
5171 | + if ($res === false) { |
|
5172 | + return false; |
|
5173 | + } |
|
5168 | 5174 | |
5169 | 5175 | $num = Database :: num_rows($res); |
5170 | 5176 | // First check the order is correct, globally (might be wrong because |
@@ -5475,8 +5481,9 @@ discard block |
||
5475 | 5481 | $position[$key] = $row['display_order']; |
5476 | 5482 | } |
5477 | 5483 | |
5478 | - if (count($array) > 0) |
|
5479 | - array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array); |
|
5484 | + if (count($array) > 0) { |
|
5485 | + array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array); |
|
5486 | + } |
|
5480 | 5487 | |
5481 | 5488 | return $array; |
5482 | 5489 | } |
@@ -6190,10 +6197,12 @@ discard block |
||
6190 | 6197 | if ($new_comment || $new_title) { |
6191 | 6198 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6192 | 6199 | $ct = ''; |
6193 | - if ($new_comment) |
|
6194 | - $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6195 | - if ($new_title) |
|
6196 | - $ct .= ", title='" . Database::escape_string($new_title)."' "; |
|
6200 | + if ($new_comment) { |
|
6201 | + $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6202 | + } |
|
6203 | + if ($new_title) { |
|
6204 | + $ct .= ", title='" . Database::escape_string($new_title)."' "; |
|
6205 | + } |
|
6197 | 6206 | |
6198 | 6207 | $sql = "UPDATE " . $tbl_doc ." SET " . substr($ct, 1)." |
6199 | 6208 | WHERE c_id = ".$course_id." AND id = " . $document_id; |
@@ -6217,17 +6226,21 @@ discard block |
||
6217 | 6226 | // Please, do not modify this dirname formatting. |
6218 | 6227 | $dir = isset($_GET['dir']) ? $_GET['dir'] : $_POST['dir']; |
6219 | 6228 | |
6220 | - if (strstr($dir, '..')) |
|
6221 | - $dir = '/'; |
|
6229 | + if (strstr($dir, '..')) { |
|
6230 | + $dir = '/'; |
|
6231 | + } |
|
6222 | 6232 | |
6223 | - if ($dir[0] == '.') |
|
6224 | - $dir = substr($dir, 1); |
|
6233 | + if ($dir[0] == '.') { |
|
6234 | + $dir = substr($dir, 1); |
|
6235 | + } |
|
6225 | 6236 | |
6226 | - if ($dir[0] != '/') |
|
6227 | - $dir = '/' . $dir; |
|
6237 | + if ($dir[0] != '/') { |
|
6238 | + $dir = '/' . $dir; |
|
6239 | + } |
|
6228 | 6240 | |
6229 | - if ($dir[strlen($dir) - 1] != '/') |
|
6230 | - $dir .= '/'; |
|
6241 | + if ($dir[strlen($dir) - 1] != '/') { |
|
6242 | + $dir .= '/'; |
|
6243 | + } |
|
6231 | 6244 | |
6232 | 6245 | $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir; |
6233 | 6246 | |
@@ -6292,8 +6305,9 @@ discard block |
||
6292 | 6305 | } |
6293 | 6306 | $return .= '<div style="padding:10px;">'; |
6294 | 6307 | |
6295 | - if ($msg != '') |
|
6296 | - $return .= $msg; |
|
6308 | + if ($msg != '') { |
|
6309 | + $return .= $msg; |
|
6310 | + } |
|
6297 | 6311 | |
6298 | 6312 | $return .= '<h3>'.$row['title'].'</h3>'; |
6299 | 6313 | switch ($row['item_type']) { |
@@ -6554,10 +6568,11 @@ discard block |
||
6554 | 6568 | $item_title = Security::remove_XSS($item_title); |
6555 | 6569 | $item_description = Security::remove_XSS($item_description); |
6556 | 6570 | |
6557 | - if ($id != 0 && is_array($extra_info)) |
|
6558 | - $parent = $extra_info['parent_item_id']; |
|
6559 | - else |
|
6560 | - $parent = 0; |
|
6571 | + if ($id != 0 && is_array($extra_info)) { |
|
6572 | + $parent = $extra_info['parent_item_id']; |
|
6573 | + } else { |
|
6574 | + $parent = 0; |
|
6575 | + } |
|
6561 | 6576 | |
6562 | 6577 | $sql = "SELECT * FROM " . $tbl_lp_item . " |
6563 | 6578 | WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
@@ -6822,11 +6837,13 @@ discard block |
||
6822 | 6837 | } |
6823 | 6838 | |
6824 | 6839 | $legend = '<legend>'; |
6825 | - if ($action == 'add') |
|
6826 | - $legend .= get_lang('CreateTheExercise'); |
|
6827 | - elseif ($action == 'move') $legend .= get_lang('MoveTheCurrentExercise'); |
|
6828 | - else |
|
6829 | - $legend .= get_lang('EditCurrentExecice'); |
|
6840 | + if ($action == 'add') { |
|
6841 | + $legend .= get_lang('CreateTheExercise'); |
|
6842 | + } elseif ($action == 'move') { |
|
6843 | + $legend .= get_lang('MoveTheCurrentExercise'); |
|
6844 | + } else { |
|
6845 | + $legend .= get_lang('EditCurrentExecice'); |
|
6846 | + } |
|
6830 | 6847 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6831 | 6848 | $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
6832 | 6849 | } |
@@ -6853,8 +6870,9 @@ discard block |
||
6853 | 6870 | $arrHide[] = $arrLP[$i]['id']; |
6854 | 6871 | } |
6855 | 6872 | } else { |
6856 | - if ($arrLP[$i]['item_type'] == 'dir') |
|
6857 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6873 | + if ($arrLP[$i]['item_type'] == 'dir') { |
|
6874 | + $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6875 | + } |
|
6858 | 6876 | } |
6859 | 6877 | } |
6860 | 6878 | |
@@ -6872,11 +6890,13 @@ discard block |
||
6872 | 6890 | |
6873 | 6891 | for ($i = 0; $i < count($arrLP); $i++) { |
6874 | 6892 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
6875 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6893 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6894 | + $selected = 'selected="selected" '; |
|
6895 | + } elseif ($action == 'add') { |
|
6876 | 6896 | $selected = 'selected="selected" '; |
6877 | - elseif ($action == 'add') $selected = 'selected="selected" '; |
|
6878 | - else |
|
6879 | - $selected = ''; |
|
6897 | + } else { |
|
6898 | + $selected = ''; |
|
6899 | + } |
|
6880 | 6900 | |
6881 | 6901 | $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
6882 | 6902 | } |
@@ -6903,9 +6923,11 @@ discard block |
||
6903 | 6923 | $arrHide = array (); |
6904 | 6924 | for ($i = 0; $i < count($arrLP); $i++) { |
6905 | 6925 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
6906 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6907 | - $s_selected_position = $arrLP[$i]['id']; |
|
6908 | - elseif ($action == 'add') $s_selected_position = 0; |
|
6926 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6927 | + $s_selected_position = $arrLP[$i]['id']; |
|
6928 | + } elseif ($action == 'add') { |
|
6929 | + $s_selected_position = 0; |
|
6930 | + } |
|
6909 | 6931 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
6910 | 6932 | |
6911 | 6933 | } |
@@ -7098,9 +7120,11 @@ discard block |
||
7098 | 7120 | $arrHide = array(); |
7099 | 7121 | for ($i = 0; $i < count($arrLP); $i++) { |
7100 | 7122 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
7101 | - if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7102 | - $s_selected_position = $arrLP[$i]['id']; |
|
7103 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7123 | + if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7124 | + $s_selected_position = $arrLP[$i]['id']; |
|
7125 | + } elseif ($action == 'add') { |
|
7126 | + $s_selected_position = 0; |
|
7127 | + } |
|
7104 | 7128 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7105 | 7129 | } |
7106 | 7130 | } |
@@ -7295,9 +7319,11 @@ discard block |
||
7295 | 7319 | |
7296 | 7320 | for ($i = 0; $i < count($arrLP); $i++) { |
7297 | 7321 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
7298 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7299 | - $s_selected_position = $arrLP[$i]['id']; |
|
7300 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7322 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7323 | + $s_selected_position = $arrLP[$i]['id']; |
|
7324 | + } elseif ($action == 'add') { |
|
7325 | + $s_selected_position = 0; |
|
7326 | + } |
|
7301 | 7327 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7302 | 7328 | |
7303 | 7329 | } |
@@ -7331,8 +7357,7 @@ discard block |
||
7331 | 7357 | |
7332 | 7358 | if (is_numeric($extra_info)) { |
7333 | 7359 | $form->addHidden('path', $extra_info); |
7334 | - } |
|
7335 | - elseif (is_array($extra_info)) { |
|
7360 | + } elseif (is_array($extra_info)) { |
|
7336 | 7361 | $form->addHidden('path', $extra_info['path']); |
7337 | 7362 | } |
7338 | 7363 | |
@@ -7385,8 +7410,9 @@ discard block |
||
7385 | 7410 | lp_id = " . $this->lp_id . " AND |
7386 | 7411 | id != $id"; |
7387 | 7412 | |
7388 | - if ($item_type == 'dir') |
|
7389 | - $sql .= " AND parent_item_id = 0"; |
|
7413 | + if ($item_type == 'dir') { |
|
7414 | + $sql .= " AND parent_item_id = 0"; |
|
7415 | + } |
|
7390 | 7416 | |
7391 | 7417 | $result = Database::query($sql); |
7392 | 7418 | $arrLP = array (); |
@@ -7787,9 +7813,11 @@ discard block |
||
7787 | 7813 | $arrHide = array(); |
7788 | 7814 | for ($i = 0; $i < count($arrLP); $i++) { |
7789 | 7815 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir' && $arrLP[$i]['item_type'] !== TOOL_LP_FINAL_ITEM) { |
7790 | - if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7816 | + if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7817 | + $s_selected_position = $arrLP[$i]['id']; |
|
7818 | + } elseif ($action == 'add') { |
|
7791 | 7819 | $s_selected_position = $arrLP[$i]['id']; |
7792 | - elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id']; |
|
7820 | + } |
|
7793 | 7821 | |
7794 | 7822 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7795 | 7823 | |
@@ -7800,17 +7828,18 @@ discard block |
||
7800 | 7828 | $item_type = isset($extra_info['item_type']) ? $extra_info['item_type'] : null; |
7801 | 7829 | $edit = isset($_GET['edit']) ? $_GET['edit'] : null; |
7802 | 7830 | if (($extra_info == 'new' || $item_type == TOOL_DOCUMENT || $item_type == TOOL_LP_FINAL_ITEM || $edit == 'true')) { |
7803 | - if (isset ($_POST['content'])) |
|
7804 | - $content = stripslashes($_POST['content']); |
|
7805 | - elseif (is_array($extra_info)) { |
|
7831 | + if (isset ($_POST['content'])) { |
|
7832 | + $content = stripslashes($_POST['content']); |
|
7833 | + } elseif (is_array($extra_info)) { |
|
7806 | 7834 | //If it's an html document or a text file |
7807 | 7835 | if (!$no_display_edit_textarea) { |
7808 | 7836 | $content = $this->display_document($extra_info['path'], false, false); |
7809 | 7837 | } |
7810 | - } elseif (is_numeric($extra_info)) |
|
7811 | - $content = $this->display_document($extra_info, false, false); |
|
7812 | - else |
|
7813 | - $content = ''; |
|
7838 | + } elseif (is_numeric($extra_info)) { |
|
7839 | + $content = $this->display_document($extra_info, false, false); |
|
7840 | + } else { |
|
7841 | + $content = ''; |
|
7842 | + } |
|
7814 | 7843 | |
7815 | 7844 | if (!$no_display_edit_textarea) { |
7816 | 7845 | // We need to calculate here some specific settings for the online editor. |
@@ -8074,9 +8103,11 @@ discard block |
||
8074 | 8103 | $arrHide = array(); |
8075 | 8104 | for ($i = 0; $i < count($arrLP); $i++) { |
8076 | 8105 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
8077 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8078 | - $s_selected_position = $arrLP[$i]['id']; |
|
8079 | - elseif ($action == 'add') $s_selected_position = 0; |
|
8106 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
8107 | + $s_selected_position = $arrLP[$i]['id']; |
|
8108 | + } elseif ($action == 'add') { |
|
8109 | + $s_selected_position = 0; |
|
8110 | + } |
|
8080 | 8111 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
8081 | 8112 | |
8082 | 8113 | } |
@@ -8272,9 +8303,11 @@ discard block |
||
8272 | 8303 | $arrHide = array (); |
8273 | 8304 | for ($i = 0; $i < count($arrLP); $i++) { |
8274 | 8305 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
8275 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8276 | - $s_selected_position = $arrLP[$i]['id']; |
|
8277 | - elseif ($action == 'add') $s_selected_position = 0; |
|
8306 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
8307 | + $s_selected_position = $arrLP[$i]['id']; |
|
8308 | + } elseif ($action == 'add') { |
|
8309 | + $s_selected_position = 0; |
|
8310 | + } |
|
8278 | 8311 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
8279 | 8312 | |
8280 | 8313 | } |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | $isAdmin = api_is_platform_admin(); |
139 | 139 | |
140 | 140 | Display::display_header(get_lang('MyTickets')); |
141 | -if (!empty($projectId)) |
|
142 | -if ($isAdmin ) { |
|
141 | +if (!empty($projectId)) { |
|
142 | + if ($isAdmin ) { |
|
143 | 143 | $getParameters = [ |
144 | 144 | 'keyword', |
145 | 145 | 'keyword_status', |
@@ -151,6 +151,7 @@ discard block |
||
151 | 151 | 'Tickets_per_page', |
152 | 152 | 'Tickets_column' |
153 | 153 | ]; |
154 | +} |
|
154 | 155 | $get_parameter = ''; |
155 | 156 | foreach ($getParameters as $getParameter) { |
156 | 157 | if (isset($_GET[$getParameter])) { |