move folders into their own metatype

This commit is contained in:
Frédéric Péters 2014-03-05 10:45:35 +01:00
parent d8898a1355
commit b27c7161e8
2 changed files with 30 additions and 1 deletions

View File

@ -217,6 +217,28 @@ class ContactsTasksTable(ResultsTable):
return []
class ResultsFoldersTable(ResultsTable):
def updateBatch(self):
self.batchProvider = ResultsBatchProvider(self.context, self.request, self)
self.batchProvider.update()
def setUpColumns(self):
columns = super(ResultsTable, self).setUpColumns()
extra_column_names = self.request.get('table-extra-columns', '').split(':')
columns = [x for x in columns if not x.__name__.startswith('extra.') or
x.__name__ in extra_column_names]
blacklist = ['dms.state', 'pfwbged.folder.unfile']
columns = [x for x in columns if not x.__name__ in blacklist]
return columns
def getExtraColumns(self):
return self.request.get('table-extra-columns', '')
def getPotentialExtraColumns(self):
return []
class ResultsInformationsTable(InformationsTable):
def updateBatch(self):
@ -343,6 +365,9 @@ def get_appropriate_table_class(context, query):
if portal_types is not None and not (set(portal_types) - set(['person', 'organization'])):
# nothing but "contacts", use a more appropriate table
table_class = ContactsTasksTable
if portal_types is not None and not (set(portal_types) - set(['pfwbgedfolder'])):
# nothing but "folders", use a more appropriate table
table_class = ResultsFoldersTable
return table_class
BATCH_SIZE = 10

View File

@ -8,7 +8,8 @@
<div id="pfwbged-criterias">
<div class="metatypes">
Que cherchez-vous :
<label><input value="docs" name="type-filter" type="radio">Documents et dossiers</label>
<label><input value="docs" name="type-filter" type="radio">Documents</label>
<label><input value="dossiers" name="type-filter" type="radio">Dossiers</label>
<label><input value="tasks" name="type-filter" type="radio">Tâches</label>
<label><input value="contacts" name="type-filter" type="radio">Contacts</label>
</div>
@ -26,6 +27,9 @@
<label><input data-portaltype="pfwb.noteforboard" type="checkbox">Note au bureau</label>
<label><input data-portaltype="pfwb.boardminutes" type="checkbox">PV de réunion de bureau</label>
</div>
<div class="subtype dossiers" style="display: none;">
<label><input data-portaltype="pfwbgedfolder" type="checkbox">Dossiers de classement</label>
</div>
<div class="subtype tasks" style="display: none;">
<label><input data-portaltype="opinion" type="checkbox">Demande d'avis</label>
<label><input data-portaltype="validation" type="checkbox">Demande de validation</label>