[IMP] rename button and remove icons.

bzr revid: tta@openerp.com-20120702070937-sqojhitg3nfzdeca
This commit is contained in:
Tejas Tank 2012-07-02 12:39:37 +05:30
commit 154ec16cf3
1 changed files with 13 additions and 12 deletions

View File

@ -147,33 +147,34 @@ class survey_question_wiz(osv.osv_memory):
if flag:
pag_rec = page_obj.browse(cr, uid, p_id, context=context)
xml_form = etree.Element('form', {'string': tools.ustr(pag_rec.title)})
xml_header = etree.SubElement(xml_form, 'header', {'col': '5', 'colspan': '4'})
xml_header_group = etree.SubElement(xml_header, 'group', {'col': '6', 'colspan': '6'})
xml_group = etree.SubElement(xml_form, 'group', {'col': '8', 'colspan': '4'})
xml_header = etree.SubElement(xml_form, 'header', {'col': '6', 'colspan': '4'})
xml_header_title = etree.SubElement(xml_header, 'group', {'col': '6', 'colspan': '6'})
############# PAGE HEADER : START ###################
#etree.SubElement(xml_group, 'field', {'name': 'progress_bar_' + tools.ustr(page_number) , 'widget':'progressbar'})
#fields['progress_bar_' + tools.ustr(page_number)] = {'type':'float', 'string':"Progress", 'views':{}}
# etree.SubElement(xml_group, 'label', {'string': tools.ustr(tools.ustr(pag_rec.note)), 'align':"0.0"})
etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' })
etree.SubElement(xml_header_title, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' })
xml_header_group = etree.SubElement(xml_header_title, 'group', {'col': '4', 'colspan': '2'})
xml_group = etree.SubElement(xml_form, 'group', {'col': '8', 'colspan': '4'})
etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'icon': "gtk-cancel", 'special': "cancel",'string':"Cancel", 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'special': "cancel",'string':"Exit", 'class':"oe_right"})
if pre_button:
etree.SubElement(xml_header_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'colspan':"1",'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"})
but_string = "Next"
if int(page_number) + 1 == total_pages:
but_string = "Done"
if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)):
etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_right"})
elif context.has_key('active') and context.get('active', False) and int(page_number) + 1 == total_pages and context.has_key('response_id'):
etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'name':"action_forward_next",'string': tools.ustr("Next Answer") ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'name':"action_forward_next",'string': tools.ustr("Next Answer") ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"})
elif context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages:
etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"})
else:
etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"})
etree.SubElement(xml_header_group, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"})
############# PAGE HEADER : END ###################