Ticket #4413: privacy.diff
| File privacy.diff, 8.0 KB (added by Waldemar Kornewald <wkornewald>, 5 years ago) |
|---|
-
trac/ticket/api.py
102 102 field = {'name': 'owner', 'label': 'Owner'} 103 103 if self.restrict_owner: 104 104 field['type'] = 'select' 105 users = [''] # for clearing assignment106 105 perm = PermissionSystem(self.env) 107 for username, name, email in self.env.get_known_users(db): 108 if perm.get_user_permissions(username).get('TICKET_MODIFY'): 109 users.append(username) 110 field['options'] = users 106 def valid_owner(username): 107 return perm.get_user_permissions(username).get('TICKET_MODIFY') 108 field['options'] = [username for username, name, email 109 in self.env.get_known_users(db) 110 if valid_owner(username)] 111 111 field['optional'] = True 112 112 else: 113 113 field['type'] = 'text' -
trac/ticket/report.py
276 276 header_groups.append([]) 277 277 header_group.append(header) 278 278 279 # Get the email addresses of all known users280 email_map = {}281 for username, name, email in self.env.get_known_users():282 if email:283 email_map[username] = email284 285 279 # Structure the rows and cells: 286 280 # - group rows according to __group__ value, if defined 287 281 # - group cells the same way headers are grouped … … 313 307 # Special casing based on column name 314 308 col = col.strip('_') 315 309 if col == 'reporter': 316 if '@' in value: 317 cell['author'] = value 318 elif value in email_map: 319 cell['author'] = email_map[value] 310 cell['author'] = value 320 311 elif col == 'resource': 321 312 resource = value 322 313 cell_group.append(cell) -
trac/ticket/query.py
690 690 query.verbose = True 691 691 db = self.env.get_db_cnx() 692 692 results = query.execute(req, db) 693 for result in results:694 if result['reporter'].find('@') == -1:695 result['reporter'] = ''696 693 query_href = req.abs_href.query(group=query.group, 697 694 groupdesc=query.groupdesc and 1 or None, 698 695 verbose=query.verbose and 1 or None, -
trac/versioncontrol/web_ui/log.py
178 178 revs = [i['rev'] for i in info] 179 179 changes = get_changes(repos, revs) 180 180 extra_changes = {} 181 email_map = {} 182 if format == 'rss': 183 # Get the email addresses of all known users 184 email_map = {} 185 for username,name,email in self.env.get_known_users(): 186 if email: 187 email_map[username] = email 188 elif format == 'changelog': 181 if format == 'changelog': 189 182 for rev in revs: 190 183 changeset = changes[rev] 191 184 cs = {} … … 206 199 'mode': mode, 'verbose': verbose, 207 200 'path_links': path_links, 208 201 'items': info, 'changes': changes, 209 'e mail_map': email_map, 'extra_changes': extra_changes,202 'extra_changes': extra_changes, 210 203 'wiki_format_messages': 211 204 self.config['changeset'].getbool('wiki_format_messages') 212 205 } -
trac/timeline/web_ui.py
137 137 break 138 138 139 139 if format == 'rss': 140 # Get the email addresses of all known users141 email_map = {}142 for username, name, email in self.env.get_known_users():143 if email:144 email_map[username] = email145 data['email_map'] = email_map146 140 return 'timeline.rss', data, 'application/rss+xml' 147 141 148 142 add_stylesheet(req, 'common/css/timeline.css') -
templates/report.rss
17 17 <py:with vars="col = cell.header.col.strip('_')"> 18 18 <py:choose> 19 19 <py:when test="col == 'reporter'"> 20 < author py:if="cell.author">$cell.author</author>20 <dc:creator py:if="cell.author">$cell.author</cd:creator> 21 21 </py:when> 22 22 <py:when test="col in ('time', 'changetime', 'created', 'modified')"> 23 23 <!-- FIXME: we end up with multiple pubDate --> -
templates/revisionlog.rss
13 13 </image> 14 14 15 15 <item py:for="item in items" py:with="change = changes[item.rev]; item_context = context('changeset', change.rev, abs_urls=True)"> 16 < author py:if="change.author" py:with="a = change.author">${a and '@' in a and a or email_map.get(a)}</author>16 <dc:creator py:if="change.author">${change.author}</dc:creator> 17 17 <pubDate>${http_date(change.date)}</pubDate> 18 18 <title>Revision $item.rev: ${shorten_line(change.message)}</title> 19 19 <link>${abs_href.changeset(rev, path)}</link> -
templates/timeline.rss
14 14 15 15 <item py:for="event in events"> 16 16 <title>${plaintext(event.title, keeplinebreaks=False)}</title> 17 <py:with vars="author=event.author; author = author and '@' in author and author or email_map.get(author)"> 18 <author py:if="author">$author</author> 19 </py:with> 17 <dc:creator py:if="event.author">${event.author}</dc:creator> 20 18 <pubDate>${http_date(event.date)}</pubDate> 21 19 <link>${event.abs_href}</link> 22 20 <guid isPermaLink="false">${event.abs_href}/${event.dateuid()}</guid> -
templates/ticket.rss
13 13 <generator>Trac $trac.version</generator> 14 14 15 15 <item py:for="change in changes"> 16 < author py:if="change.author">$change.author</author>16 <dc:creator py:if="change.author">$change.author</dc:creator> 17 17 <pubDate>${http_date(change.date)}</pubDate> 18 18 <title>$change.title</title> 19 19 <link>${abs_href.ticket(ticket.id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></link> -
templates/query.rss
16 16 <guid isPermaLink="false">$href</guid> 17 17 <title>#$result.id: $result.summary</title> 18 18 <pubDate py:if="result.time">${http_date(result.time)}</pubDate> 19 < author py:if="result.reporter">$result.reporter</author>19 <dc:creator py:if="result.reporter">$result.reporter</dc:creator> 20 20 <description>${unicode(context('ticket', result.id, abs_urls=True).wiki_to_html(result.description))}</description> 21 21 <category>Results</category> 22 22 <comments>$href#changelog</comments>
