Commit b3e4727a authored by Fabien Morin's avatar Fabien Morin

- remove existing group to just keep the custom group 'page_'+numpage.

This fix permit to display many pages and not just the first with all fields on
it like it was before this revision.
The first group is renamed because the first element can't be removed
- remove a code part wich was in the if and else block, and put it just after,
  that permit to not have a duplicate code bloc


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18949 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 763e3aaf
...@@ -211,15 +211,27 @@ class ManageModule: ...@@ -211,15 +211,27 @@ class ManageModule:
else: else:
# using special page positioning convention for # using special page positioning convention for
# pdf-like rendering # pdf-like rendering
del default_groups[0:]
for page_iterator in range(global_properties['page']): for page_iterator in range(global_properties['page']):
page_number = 'page_%s' % str(page_iterator) page_number = 'page_%s' % str(page_iterator)
default_groups.append(page_number) default_groups.append(page_number)
# default_groups list completed, need to update the form_groups # default_groups list completed, need to update the form_groups
# renaming form default group with list's first item # rename the first group because it can't be removed
form.rename_group(form.group_list[0], default_groups[0])
# add other groups
if len(default_groups) > 1:
for group in default_groups[1:]:
form.add_group(group)
form_view_id_object.rename_group('Default', default_groups[0]) form_view_id_object.rename_group('Default', default_groups[0])
# remove all other groups:
for existing_group in list(form.get_groups(include_empty=1)):
if existing_group not in default_groups:
form.remove_group(existing_group)
# adding all other items # adding all other items
for group in default_groups[0:]: for group in default_groups:
form_view_id_object.add_group(group) form_view_id_object.add_group(group)
# updating form settings # updating form settings
# building dict containing (property, value) # building dict containing (property, value)
...@@ -810,25 +822,21 @@ class ManageCSS: ...@@ -810,25 +822,21 @@ class ManageCSS:
if page_iterator == 0: if page_iterator == 0:
# margin-top = 0 (first page) # margin-top = 0 (first page)
properties_css_page['margin-top'] = "0px" properties_css_page['margin-top'] = "0px"
properties_css_background['height'] = \
str(page_height) + 'px'
properties_css_background['width']= \
str (page_width) + 'px'
properties_page['actual_width'] = width_groups[page_iterator]
properties_page['actual_height'] = height_groups[page_iterator]
#properties_css_background['margin-top'] = \ #properties_css_background['margin-top'] = \
# str((y_pos -10))+ 'px' # str((y_pos -10))+ 'px'
#properties_css_background['margin-left']= \ #properties_css_background['margin-left']= \
# str((x_pos- 5))+ 'px' # str((x_pos- 5))+ 'px'
else: else:
# margin-top = page height properties_css_page['margin-top'] = "%spx" %(40)
properties_css_page['margin-top'] = "%spx" %(page_height + 20)
# set width and height on page block
properties_css_page['width'] = str (page_width) + 'px'
properties_css_page['height'] = str (page_height) + 'px'
properties_page['actual_width'] = width_groups[page_iterator] properties_page['actual_width'] = width_groups[page_iterator]
properties_page['actual_height'] = height_groups[page_iterator] properties_page['actual_height'] = height_groups[page_iterator]
properties_css_background['height'] = \ properties_css_background['height'] = str(page_height) + 'px'
str(page_height) + 'px' properties_css_background['width'] = str (page_width) + 'px'
properties_css_background['width']= \
str (page_width) + 'px'
# adding properties dict to global dicts # adding properties dict to global dicts
properties_css_dict['head'][page_id] = properties_css_page properties_css_dict['head'][page_id] = properties_css_page
properties_css_dict['head'][background_id] = properties_css_background properties_css_dict['head'][background_id] = properties_css_background
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment