web/views/management.py
changeset 4164 119a374c5eb4
parent 4045 f4a52abb6f4f
child 4252 6c4f109c2b03
equal deleted inserted replaced
4163:b2747ed057e6 4164:119a374c5eb4
   166         form = self._cw.vreg['forms'].select('base', self._cw, entity=newperm,
   166         form = self._cw.vreg['forms'].select('base', self._cw, entity=newperm,
   167                                          form_buttons=[wdgs.SubmitButton()],
   167                                          form_buttons=[wdgs.SubmitButton()],
   168                                          domid='reqperm%s' % entity.eid,
   168                                          domid='reqperm%s' % entity.eid,
   169                                          __redirectvid='security',
   169                                          __redirectvid='security',
   170                                          __redirectpath=entity.rest_path())
   170                                          __redirectpath=entity.rest_path())
   171         form.form_add_hidden('require_permission', entity.eid, role='object',
   171         form.add_hidden('require_permission', entity.eid, role='object',
   172                              eidparam=True)
   172                         eidparam=True)
   173         permnames = getattr(entity, '__permissions__', None)
   173         permnames = getattr(entity, '__permissions__', None)
   174         cwpermschema = newperm.e_schema
   174         cwpermschema = newperm.e_schema
   175         if permnames is not None:
   175         if permnames is not None:
   176             field = guess_field(cwpermschema, self._cw.vreg.schema.rschema('name'),
   176             field = guess_field(cwpermschema, self._cw.vreg.schema.rschema('name'),
   177                                 widget=wdgs.Select({'size': 1}),
   177                                 widget=wdgs.Select({'size': 1}),
   240         # creates a bug submission link if submit-mail is set
   240         # creates a bug submission link if submit-mail is set
   241         if self._cw.vreg.config['submit-mail']:
   241         if self._cw.vreg.config['submit-mail']:
   242             form = self._cw.vreg['forms'].select('base', self._cw, rset=None,
   242             form = self._cw.vreg['forms'].select('base', self._cw, rset=None,
   243                                              mainform=False)
   243                                              mainform=False)
   244             binfo = text_error_description(ex, excinfo, req, eversion, cversions)
   244             binfo = text_error_description(ex, excinfo, req, eversion, cversions)
   245             form.form_add_hidden('description', binfo,
   245             form.add_hidden('description', binfo,
   246                                  # we must use a text area to keep line breaks
   246                             # we must use a text area to keep line breaks
   247                                  widget=wdgs.TextArea({'class': 'hidden'}))
   247                             widget=wdgs.TextArea({'class': 'hidden'}))
   248             form.form_add_hidden('__bugreporting', '1')
   248             form.add_hidden('__bugreporting', '1')
   249             form.form_buttons = [wdgs.SubmitButton(MAIL_SUBMIT_MSGID)]
   249             form.form_buttons = [wdgs.SubmitButton(MAIL_SUBMIT_MSGID)]
   250             form.action = req.build_url('reportbug')
   250             form.action = req.build_url('reportbug')
   251             w(form.render())
   251             w(form.render())
   252 
   252 
   253 
   253