Commit 78be1cd6 authored by Jérome Perrin's avatar Jérome Perrin

ReportSection:

remove preferences= argument, it has been deprecated for long enough, and has no effect anyway.
deprecate translated_title=, simply pass a translated string or a message instance as title=



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17009 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8a5eac9b
...@@ -34,6 +34,7 @@ from Products.Formulator.Form import ZMIForm ...@@ -34,6 +34,7 @@ from Products.Formulator.Form import ZMIForm
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
from urllib import quote from urllib import quote
from warnings import warn
from Products.ERP5Type import PropertySheet from Products.ERP5Type import PropertySheet
from Form import ERP5Form from Form import ERP5Form
...@@ -195,8 +196,7 @@ class ReportSection: ...@@ -195,8 +196,7 @@ class ReportSection:
selection_name=None, selection_params=None, selection_name=None, selection_params=None,
listbox_display_mode=None, selection_columns=None, listbox_display_mode=None, selection_columns=None,
selection_sort_order=None, selection_sort_order=None,
selection_report_path=None, selection_report_list=None, selection_report_path=None, selection_report_list=None):
preferences = None ) :
""" """
Initialize the line and set the default values Initialize the line and set the default values
Selected columns must be defined in parameter of listbox.render... Selected columns must be defined in parameter of listbox.render...
...@@ -209,6 +209,8 @@ class ReportSection: ...@@ -209,6 +209,8 @@ class ReportSection:
self.path = path self.path = path
self.form_id = form_id self.form_id = form_id
self.title = title self.title = title
if translated_title is not None:
warn("Don't use translated_title, but title directly", DeprecationWarning)
self.translated_title = translated_title self.translated_title = translated_title
self.level = level self.level = level
self.saved_request = {} self.saved_request = {}
...@@ -221,9 +223,6 @@ class ReportSection: ...@@ -221,9 +223,6 @@ class ReportSection:
self.selection_report_path = selection_report_path self.selection_report_path = selection_report_path
self.selection_report_list = selection_report_list self.selection_report_list = selection_report_list
self.saved_request_form = {} self.saved_request_form = {}
if preferences is not None :
LOG('ERP5Report', WARNING,
'using preferences in report is deprecated, please use selection only')
security.declarePublic('getTitle') security.declarePublic('getTitle')
def getTitle(self): def getTitle(self):
...@@ -231,6 +230,7 @@ class ReportSection: ...@@ -231,6 +230,7 @@ class ReportSection:
security.declarePublic('getTranslatedTitle') security.declarePublic('getTranslatedTitle')
def getTranslatedTitle(self): def getTranslatedTitle(self):
# deprecated: use title instead (with a translated string)
return self.translated_title return self.translated_title
security.declarePublic('getLevel') security.declarePublic('getLevel')
......
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