Changeset 427


Ignore:
Timestamp:
09/05/08 10:43:00 (5 years ago)
Author:
aculapov
Message:
  • added save & new functionality
Location:
trunk/plugins/tickettypedsystem/ticketsystem
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/tickettypedsystem/ticketsystem/templates/defect.html

    r426 r427  
    226226                        <textarea py:when="'TICKET_EDIT_DESCRIPTION' in perm(ticket.resource) or not ticket.exists"  
    227227                            name="field_description"  
    228                             id="description">${ticket.description} 
    229                         </textarea> 
     228                            id="description">${ticket.description}</textarea> 
    230229                        <div py:otherwise="">${ticket.description}</div> 
    231230                    </li> 
     
    393392                    <input type="submit" value="Preview" name="preview" id="preview" />&nbsp; 
    394393                    <input type="button" value="Cancel" id="cancel" />&nbsp; 
    395                     <input type="button" value="Save &amp; New" id="save_new" />&nbsp; 
     394                    <input type="submit" value="Save &amp; New" name="submit" id="save_new" />&nbsp; 
    396395                    <input type="submit" value="Save &amp; Close" name="submit" id="submit" /> 
    397396                </span> 
  • trunk/plugins/tickettypedsystem/ticketsystem/tickettypes/checklist.py

    r424 r427  
    7878             
    7979            if ticket : 
    80                 # add the values to the ticekt object to survive the redirect 
     80                # add the values to the ticket object to survive the redirect 
    8181                setattr(ticket, self.get_ticket_type(), tck_list) 
    8282            else : 
  • trunk/plugins/tickettypedsystem/ticketsystem/tickettypes/defect.py

    r424 r427  
    2020        return False 
    2121 
     22    def process_changes(self, req, ticket): 
     23        # add in the session the redirect to new 
     24        if req and 'submit' in req.args and req.args['submit'] == 'Save & New' : 
     25            req.session['redirect_to_new'] = True 
     26             
     27        super(DefectTicket, self).process_changes(req, ticket) 
    2228     
    2329    def handle_request(self, req, data, content_type): 
     30         
     31        if req.session.get('redirect_to_new', False) : 
     32            del(req.session['redirect_to_new']) 
     33            # create the get parameter 
     34            new_data = {'type': self.get_ticket_type(),} 
     35            # redirect to new 
     36            req.redirect(req.href.newticket(**new_data)) 
     37         
    2438        add_stylesheet(req, 'ticketsystem/css/oforge_003.css') 
    2539        add_stylesheet(req, 'ticketsystem/css/tickets.css') 
Note: See TracChangeset for help on using the changeset viewer.