Mercurial > hg > MPIWGWeb
comparison MPIWGRoot.py @ 162:47392bf3fcba
clean ups and fixes
author | casties |
---|---|
date | Thu, 06 Jun 2013 19:13:07 +0200 |
parents | ee79f6ba8d01 |
children | a6739bb6a575 |
comparison
equal
deleted
inserted
replaced
161:2b5adc7f5445 | 162:47392bf3fcba |
---|---|
7 from OFS.Folder import Folder | 7 from OFS.Folder import Folder |
8 import sys | 8 import sys |
9 | 9 |
10 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder | 10 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder |
11 | 11 |
12 from MPIWGHelper import * | 12 import MPIWGHelper |
13 import updatePersonalWWW | 13 import updatePersonalWWW |
14 import MPIWGStaff | 14 import MPIWGStaff |
15 from SrvTxtUtils import getInt, getAt, utf8ify, refreshingImageFileIndexHtml, getDateString | 15 from SrvTxtUtils import getInt, unicodify, refreshingImageFileIndexHtml, getDateString |
16 | 16 |
17 | 17 |
18 class MPIWGRoot(ZSQLExtendFolder): | 18 class MPIWGRoot(ZSQLExtendFolder): |
19 """Stammordner fuer den Web-Server""" | 19 """Stammordner fuer den Web-Server""" |
20 | 20 |
150 items = self.objectValues(spec='MPIWGFolder') | 150 items = self.objectValues(spec='MPIWGFolder') |
151 items.sort(key=lambda x:getInt(getattr(x, 'weight', '0'))) | 151 items.sort(key=lambda x:getInt(getattr(x, 'weight', '0'))) |
152 return items | 152 return items |
153 | 153 |
154 | 154 |
155 def getPathStyle(self, path, selected, style=""): | 155 getPathStyle = MPIWGHelper.getPathStyle |
156 """returns a string with the given style + 'sel' if path == selected.""" | 156 |
157 if path == selected: | 157 |
158 return style + 'sel' | |
159 else: | |
160 return style | |
161 | |
162 | |
163 def getFeatures(self, num=None): | 158 def getFeatures(self, num=None): |
164 """returns a list of the last num Features""" | 159 """returns a list of the last num Features""" |
165 dir = getattr(self, 'features', None) | 160 dir = getattr(self, 'features', None) |
166 if dir is None: | 161 if dir is None: |
167 return [] | 162 return [] |
367 | 362 |
368 #ignoreEntries.append('current_work') # TODO:updatecurrent work | 363 #ignoreEntries.append('current_work') # TODO:updatecurrent work |
369 logging.debug("updatePersonEntry: data=%s ignoreEntries=%s"%(repr(data),repr(ignoreEntries))) | 364 logging.debug("updatePersonEntry: data=%s ignoreEntries=%s"%(repr(data),repr(ignoreEntries))) |
370 | 365 |
371 if data['date_to']=="": # wenn date_to leer | 366 if data['date_to']=="": # wenn date_to leer |
372 data['date_to']="date_none" | 367 data['date_to']="date_none" |
373 | 368 |
374 if data['date_from']=="": # wenn date_fromleer | 369 if data['date_from']=="": # wenn date_fromleer |
375 data['date_from']="date_none" | 370 data['date_from']="date_none" |
376 msg="" | 371 msg="" |
377 | 372 |
378 | 373 |
379 #eintragen | 374 #eintragen |
380 | 375 |
459 ret+="<tr><td>%s</td><td>%s</td><td>%s</td>"%(iE[0].encode('utf-8'),iE[1].encode('utf-8'),iE[2].encode('utf-8')) | 454 ret+="<tr><td>%s</td><td>%s</td><td>%s</td>"%(iE[0].encode('utf-8'),iE[1].encode('utf-8'),iE[2].encode('utf-8')) |
460 ret+="</table>" | 455 ret+="</table>" |
461 | 456 |
462 self.updatePersonEntry(resultSet[conflict],ignoreEntries=ignoreEntries) | 457 self.updatePersonEntry(resultSet[conflict],ignoreEntries=ignoreEntries) |
463 | 458 |
464 # rest | 459 # rest |
465 cl=list(conflicts.keys()) | 460 cl=list(conflicts.keys()) |
466 | 461 |
467 for key in resultSet.keys(): | 462 for key in resultSet.keys(): |
468 if key not in cl: | 463 if key not in cl: |
469 self.updatePersonEntry(resultSet[key]) | 464 self.updatePersonEntry(resultSet[key]) |
470 return ret+"</body></html>" | 465 return ret+"</body></html>" |
471 | 466 |
472 | 467 |
473 def updatePersonalwww_html(self): | 468 def updatePersonalwww_html(self): |
474 """update form for the homepages web form""" | 469 """update form for the homepages web form""" |