Changeset 1114 for trunk/common
- Timestamp:
- 03/20/10 16:19:40 (2 years ago)
- Location:
- trunk/common
- Files:
-
- 2 edited
-
db/round.php (modified) (2 diffs)
-
security.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/db/round.php
r1110 r1114 104 104 // 105 105 // if user_id is non-null a join is done on $score 106 function round_get_tasks($round_id, $first = 0, $count = null, $user_id = null, $fetch_scores = false, $filter = null) { 106 function round_get_tasks($round_id, $first = 0, $count = null, 107 $user_id = null, $fetch_scores = false, 108 $filter = null, $progress = false) { 107 109 if ($count === null) { 108 110 $count = 666013; … … 141 143 db_escape($first), db_escape($count)); 142 144 } 143 return db_fetch_all($query); 145 146 $res = db_fetch_all($query); 147 148 if ($progress) { 149 $task_ids = array(); 150 foreach ($res as $row) { 151 $task_ids[] = $row['id']; 152 } 153 154 $query_ratings = sprintf( 155 "SELECT task_ratings.task_id AS id, count(*) AS rating_count 156 FROM ia_task_ratings AS task_ratings 157 WHERE task_ratings.task_id IN (%s) 158 GROUP BY id", 159 implode(',', array_map('db_quote', $task_ids)) 160 ); 161 162 $res_ratings = db_fetch_all($query_ratings); 163 164 $rating_count = array(); 165 foreach ($res_ratings as $res_rating) { 166 $rating_count[$res_rating['id']] = $res_rating['rating_count']; 167 } 168 169 foreach ($res as &$row) { 170 $row['progress'] = getattr($rating_count, $row['id']); 171 } 172 } 173 174 return $res; 144 175 } 145 176 -
trunk/common/security.php
r1111 r1114 147 147 case 'task-edit-ratings': 148 148 case 'round-tag': 149 case 'round-view-progress': 149 150 case 'textblock-tag': 150 151 case 'job-reeval':
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)