1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
112 def redirectpath(self, entity): |
112 def redirectpath(self, entity): |
113 return entity.rest_path() |
113 return entity.rest_path() |
114 |
114 |
115 def get_form(self, entity, transition, **kwargs): |
115 def get_form(self, entity, transition, **kwargs): |
116 # XXX used to specify both rset/row/col and entity in case implements |
116 # XXX used to specify both rset/row/col and entity in case implements |
117 # selector (and not implements) is used on custom form |
117 # selector (and not is_instance) is used on custom form |
118 form = self._cw.vreg['forms'].select( |
118 form = self._cw.vreg['forms'].select( |
119 'changestate', self._cw, entity=entity, transition=transition, |
119 'changestate', self._cw, entity=entity, transition=transition, |
120 redirect_path=self.redirectpath(entity), **kwargs) |
120 redirect_path=self.redirectpath(entity), **kwargs) |
121 trinfo = self._cw.vreg['etypes'].etype_class('TrInfo')(self._cw) |
121 trinfo = self._cw.vreg['etypes'].etype_class('TrInfo')(self._cw) |
122 trinfo.eid = self._cw.varmaker.next() |
122 trinfo.eid = self._cw.varmaker.next() |