# HG changeset patch # User Julien Cristau # Date 1392642653 -3600 # Node ID 1358f8ef1b5b0307bc9083029c3a0b1bc2063e00 # Parent cbc46f94081d69ed473f9e8d919d397aa7f6bed1 [web/basecomponents] remove EtypeRestrictionComponent Closes #3119951 diff -r cbc46f94081d -r 1358f8ef1b5b doc/3.19.rst --- a/doc/3.19.rst Fri Feb 14 12:03:20 2014 +0100 +++ b/doc/3.19.rst Mon Feb 17 14:10:53 2014 +0100 @@ -148,3 +148,7 @@ ---------------------- * session.hijack_user mechanism has been dropped. + +* EtypeRestrictionComponent has been removed, its functionality has been + replaced by facets a while ago. + diff -r cbc46f94081d -r 1358f8ef1b5b web/views/basecomponents.py --- a/web/views/basecomponents.py Fri Feb 14 12:03:20 2014 +0100 +++ b/web/views/basecomponents.py Mon Feb 17 14:10:53 2014 +0100 @@ -200,57 +200,6 @@ self.w(u'') -class EtypeRestrictionComponent(component.Component): - """displays the list of entity types contained in the resultset - to be able to filter accordingly. - """ - __regid__ = 'etypenavigation' - __select__ = multi_etypes_rset() | match_form_params( - '__restrtype', '__restrtypes', '__restrrql') - cw_property_defs = VISIBLE_PROP_DEF - # don't want user to hide this component using an cwproperty - site_wide = True - visible = False # disabled by default - - def call(self): - _ = self._cw._ - self.w(u'
') - restrtype = self._cw.form.get('__restrtype') - restrtypes = self._cw.form.get('__restrtypes', '').split(',') - restrrql = self._cw.form.get('__restrrql') - if not restrrql: - rqlst = self.cw_rset.syntax_tree() - restrrql = rqlst.as_string(self._cw.encoding, self.cw_rset.args) - restrtypes = self.cw_rset.column_types(0) - else: - rqlst = parse(restrrql) - html = [] - on_etype = False - etypes = sorted((display_name(self._cw, etype).capitalize(), etype) - for etype in restrtypes) - for elabel, etype in etypes: - if etype == restrtype: - html.append(u'%s' % elabel) - on_etype = True - else: - rqlst.save_state() - for select in rqlst.children: - select.add_type_restriction(select.selection[0].variable, etype) - newrql = rqlst.as_string(self._cw.encoding, self.cw_rset.args) - url = self._cw.build_url(rql=newrql, __restrrql=restrrql, - __restrtype=etype, __restrtypes=','.join(restrtypes)) - html.append(u'%s' % ( - xml_escape(url), elabel)) - rqlst.recover() - if on_etype: - url = self._cw.build_url(rql=restrrql) - html.insert(0, u'%s' % ( - url, _('Any'))) - else: - html.insert(0, u'%s' % _('Any')) - self.w(u' | '.join(html)) - self.w(u'
') - # contextual components ########################################################