Commit 200c751b authored by Fabien Morin's avatar Fabien Morin

* add date_separator and time_separator wich are required for non editable

DateTimeField
* add css selector used for non editable DateTimeField


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20413 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bf418397
...@@ -1059,8 +1059,20 @@ class ManageCSS: ...@@ -1059,8 +1059,20 @@ class ManageCSS:
' input_order=%s' % properties_field['input_order']) ' input_order=%s' % properties_field['input_order'])
# defining global field rendering (for Date), ignoring for the moment # defining global field rendering (for Date), ignoring for the moment
# the whole part about the time # the whole part about the time
# this following field refere to no existing field, it's use only
# when editable property is unchecked (there is only one field
# without _class_N but just _class, so, the 3 existing CSS selector
# can't be applied, that the reason for this new one)
field_dict[0] = {}
field_dict[0]['width'] = \
str(scaling_factor1*float(width_part*(field_nb+1))) + 'px'
field_dict[0]['margin-left'] = \
str(scaling_factor1 *float(properties_field['position_x'])) + 'px'
if properties_field['input_order'] in \ if properties_field['input_order'] in \
['day/month/year', 'dmy', 'month/day/year', 'mdy']: ['day/month/year', 'dmy', 'month/day/year', 'mdy']:
# specified input order. must be dd/mm/yyyy or mm/dd/yyyy (year is # specified input order. must be dd/mm/yyyy or mm/dd/yyyy (year is
# the last field). # the last field).
# processing first field # processing first field
...@@ -1137,12 +1149,15 @@ class ManageCSS: ...@@ -1137,12 +1149,15 @@ class ManageCSS:
field_nb_range = field_nb + 1 field_nb_range = field_nb + 1
field_range = range(field_nb_range) field_range = range(field_nb_range)
field_range = field_range[1:] field_range = field_range
for iterator in field_range: for iterator in field_range:
# iterator take the field_id according to the field_nb # iterator take the field_id according to the field_nb
# ie (0..field_nb) # ie (0..field_nb)
#iterator = it + 1 #iterator = it + 1
LOG('ManageCSS', INFO, ' sub_field_id=%s' % iterator) LOG('ManageCSS', INFO, ' sub_field_id=%s' % iterator)
if iterator == 0:
class_name = field_name + '_class'
else:
class_name = field_name + '_class_' + str(iterator) class_name = field_name + '_class_' + str(iterator)
LOG('ManageCSS', INFO, ' class_name=%s' % class_name) LOG('ManageCSS', INFO, ' class_name=%s' % class_name)
...@@ -1169,6 +1184,9 @@ class ManageCSS: ...@@ -1169,6 +1184,9 @@ class ManageCSS:
# final printing for testing # final printing for testing
LOG('ManageCSS', INFO, '\n\n final printing') LOG('ManageCSS', INFO, '\n\n final printing')
for iterator in field_range: for iterator in field_range:
if iterator == 0:
class_name = field_name + '_class'
else:
class_name = field_name + '_class_' + str(iterator) class_name = field_name + '_class_' + str(iterator)
LOG('ManageCSS', INFO, ' class=%s' % class_name) LOG('ManageCSS', INFO, ' class=%s' % class_name)
for prop_id in properties_css_dict['standard'][class_name].keys(): for prop_id in properties_css_dict['standard'][class_name].keys():
...@@ -1862,12 +1880,12 @@ class ScribusParser: ...@@ -1862,12 +1880,12 @@ class ScribusParser:
# when creating the fdf file to fill the PDF form. # when creating the fdf file to fill the PDF form.
object_properties['date_separator'] = \ object_properties['date_separator'] = \
sp.getObjectTooltipProperty('date_separator', sp.getObjectTooltipProperty('date_separator',
' ', '/',
object_name, object_name,
tooltipfield_properties_dict) tooltipfield_properties_dict)
object_properties['time_separator'] = \ object_properties['time_separator'] = \
sp.getObjectTooltipProperty('time_separator', sp.getObjectTooltipProperty('time_separator',
' ', ':',
object_name, object_name,
tooltipfield_properties_dict) tooltipfield_properties_dict)
...@@ -2071,13 +2089,7 @@ class ScribusParser: ...@@ -2071,13 +2089,7 @@ class ScribusParser:
# checking if date only or date + time # checking if date only or date + time
object_dict['attributes']['date_only'] = \ object_dict['attributes']['date_only'] = \
int(properties_field['date_only']) int(properties_field['date_only'])
if option_html == 1:
# defining default separators to '' to prevent bug when rendering in
# graphic mode
object_dict['attributes']['date_separator'] = ''
object_dict['attributes']['time_separator'] = ''
else:
# rendering is ERP5 type, can keep the final date and time separators
object_dict['attributes']['date_separator'] = \ object_dict['attributes']['date_separator'] = \
properties_field['date_separator'] properties_field['date_separator']
object_dict['attributes']['time_separator'] = \ object_dict['attributes']['time_separator'] = \
......
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