@@ -169,7 +169,8 @@ |
||
169 | 169 | my_delete($document_sys_path.$uploadPath.'/'.$fld.'/'.$filename); |
170 | 170 | DocumentManager::updateDbInfo('delete', $uploadPath.'/'.$fld.'/'.$filename); |
171 | 171 | } |
172 | - if ($imgcount == 0) { // all image uploaded |
|
172 | + if ($imgcount == 0) { |
|
173 | +// all image uploaded |
|
173 | 174 | $finish = 1; |
174 | 175 | } |
175 | 176 | } else { |
@@ -11,7 +11,8 @@ discard block |
||
11 | 11 | </span> |
12 | 12 | '); |
13 | 13 | |
14 | -function reports_template_CourseArticulate_getSQL() { |
|
14 | +function reports_template_CourseArticulate_getSQL() |
|
15 | +{ |
|
15 | 16 | // settings |
16 | 17 | |
17 | 18 | |
@@ -23,7 +24,8 @@ discard block |
||
23 | 24 | $queries[0] = $query; |
24 | 25 | $extraFieldType = \Chamilo\CoreBundle\Entity\ExtraField::USER_FIELD_TYPE; |
25 | 26 | // Custom Field |
26 | - foreach (array("tags" => "tags") as $k => $v) { // FIXME |
|
27 | + foreach (array("tags" => "tags") as $k => $v) { |
|
28 | +// FIXME |
|
27 | 29 | $query = 'select ufv.value as "'.$v.'" '; |
28 | 30 | $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
29 | 31 | $query .= 'left join'.Database::get_main_table(TABLE_EXTRA_FIELD).' uf '; |
@@ -39,8 +41,9 @@ discard block |
||
39 | 41 | // Stored Value |
40 | 42 | $sv = array(); |
41 | 43 | foreach ($sv as $k => $v) { |
42 | - if (!isset($v['sql'])) |
|
43 | - $v['sql'] = 'FIELD'; |
|
44 | + if (!isset($v['sql'])) { |
|
45 | + $v['sql'] = 'FIELD'; |
|
46 | + } |
|
44 | 47 | $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']); |
45 | 48 | $query = 'select '.$sqlField.' as "'.$v['title'].'" '; |
46 | 49 | // $query = 'select sec_to_time(sv.sv_value) as "'.$v.'" '; |
@@ -110,8 +113,9 @@ discard block |
||
110 | 113 | $query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid']; |
111 | 114 | $query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv '; |
112 | 115 | $query .= ' on lv.id = liv.lp_view_id '; |
113 | - if ($v['target_view_count']) |
|
114 | - $query .= ' and liv.view_count = '.$v['target_view_count']; |
|
116 | + if ($v['target_view_count']) { |
|
117 | + $query .= ' and liv.view_count = '.$v['target_view_count']; |
|
118 | + } |
|
115 | 119 | $query .= ' and liv.lp_item_id = '.$v['liid'].' '; |
116 | 120 | $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; |
117 | 121 | $query .= ' group by u.user_id '; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | api_protect_admin_script(); |
10 | 10 | |
11 | -switch ($action) { |
|
11 | +switch ($action) { |
|
12 | 12 | case 'getEventTypes': |
13 | 13 | $events = Event::get_all_event_types(); |
14 | 14 | print json_encode($events); |
@@ -76,7 +76,8 @@ |
||
76 | 76 | &$array, |
77 | 77 | $function, |
78 | 78 | $apply_to_keys_also = false |
79 | -) { |
|
79 | +) |
|
80 | +{ |
|
80 | 81 | static $recursive_counter = 0; |
81 | 82 | if (++$recursive_counter > 1000) { |
82 | 83 | die('possible deep recursion attack'); |
@@ -63,7 +63,8 @@ |
||
63 | 63 | ); |
64 | 64 | if ($course_visible_for_user) { |
65 | 65 | $result = $result_tmp; |
66 | - } else { // course not visible for user |
|
66 | + } else { |
|
67 | +// course not visible for user |
|
67 | 68 | if ($search_show_unlinked_results) { |
68 | 69 | $result_tmp['url'] = ''; |
69 | 70 | $result = $result_tmp; |
@@ -81,7 +81,8 @@ |
||
81 | 81 | ); |
82 | 82 | if ($course_visible_for_user) { |
83 | 83 | $results[] = $result; |
84 | - } else { // course not visible for user |
|
84 | + } else { |
|
85 | +// course not visible for user |
|
85 | 86 | if ($search_show_unlinked_results) { |
86 | 87 | $result['url'] = ''; |
87 | 88 | $results[] = $result; |
@@ -42,7 +42,8 @@ |
||
42 | 42 | ); |
43 | 43 | if ($course_visible_for_user) { |
44 | 44 | $results[] = $result; |
45 | - } else { // course not visible for user |
|
45 | + } else { |
|
46 | +// course not visible for user |
|
46 | 47 | if ($search_show_unlinked_results) { |
47 | 48 | $result['url'] = ''; |
48 | 49 | $results[] = $result; |
@@ -59,7 +59,8 @@ discard block |
||
59 | 59 | * @param string Value |
60 | 60 | * @return void |
61 | 61 | */ |
62 | - function addValue($key, $value) { |
|
62 | + function addValue($key, $value) |
|
63 | + { |
|
63 | 64 | $this->data[$key] = $value; |
64 | 65 | } |
65 | 66 | |
@@ -68,7 +69,8 @@ discard block |
||
68 | 69 | * @param string Term |
69 | 70 | * @param string Flag (one character) |
70 | 71 | */ |
71 | - public function addTerm($term, $flag) { |
|
72 | + public function addTerm($term, $flag) |
|
73 | + { |
|
72 | 74 | global $charset; |
73 | 75 | if (strlen($flag) == 1) { |
74 | 76 | $this->terms[] = array('name' => api_convert_encoding(stripslashes($term), 'UTF-8', $charset), 'flag' => $flag); |
@@ -78,14 +80,16 @@ discard block |
||
78 | 80 | /** |
79 | 81 | * Class constructor. Just generates an empty 'data' array attribute |
80 | 82 | */ |
81 | - function __construct() { |
|
83 | + function __construct() |
|
84 | + { |
|
82 | 85 | $this->data = array(); |
83 | 86 | } |
84 | 87 | |
85 | 88 | /** |
86 | 89 | * Class desctructor. Unsets attributes. |
87 | 90 | */ |
88 | - function __destruct() { |
|
91 | + function __destruct() |
|
92 | + { |
|
89 | 93 | unset($this->data); |
90 | 94 | unset($this->terms); |
91 | 95 | } |
@@ -1947,8 +1947,9 @@ |
||
1947 | 1947 | $new_relation_type[] = "'$rel'"; |
1948 | 1948 | } |
1949 | 1949 | $relation_type = implode(',', $new_relation_type); |
1950 | - if (!empty($relation_type)) |
|
1951 | - $where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
1950 | + if (!empty($relation_type)) { |
|
1951 | + $where_relation_condition = "AND gu.relation_type IN ($relation_type) "; |
|
1952 | + } |
|
1952 | 1953 | } |
1953 | 1954 | |
1954 | 1955 | $sql = "SELECT picture_uri as image, u.id, CONCAT (u.firstname,' ', u.lastname) as fullname, relation_type |