diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index 1cff3c7956b..50febe0de90 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -11,6 +11,7 @@ "static/lib/datejs/sugarpak.js", "static/lib/datejs/extras.js", "static/lib/jquery/jquery-1.6.2.js", + "static/lib/jquery.MD5/jquery.md5.js", "static/lib/jquery.form/jquery.form.js", "static/lib/jquery.validate/jquery.validate.js", "static/lib/jquery.ba-bbq/jquery.ba-bbq.js", @@ -43,6 +44,7 @@ "static/src/js/view_list.js", "static/src/js/view_list_editable.js", "static/src/js/view_tree.js", + "static/src/js/view_editor.js" ], 'css' : [ "static/lib/jquery.superfish/css/superfish.css", @@ -52,4 +54,7 @@ "static/src/css/data_export.css", "static/src/css/data_import.css", ], + 'qweb' : [ + "static/src/xml/*.xml", + ], } diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 5cae9ce4636..773ea020d52 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -129,6 +129,18 @@ class XmlRPCConnector(Connector): # TODO should try except and wrap exception into LibException return getattr(service, method)(*args) +class XmlRPCSConnector(XmlRPCConnector): + """ + A type of connector that uses the secured XMLRPC protocol. + """ + PROTOCOL = 'xmlrpcs' + + __logger = _getChildLogger(_logger, 'connector.xmlrpcs') + + def __init__(self, hostname, port=8071): + super(XmlRPCSConnector, self).__init__(hostname, port) + self.url = 'https://%s:%d/xmlrpc' % (self.hostname, self.port) + class NetRPC_Exception(Exception): """ Exception for NetRPC errors. @@ -438,6 +450,7 @@ class Model(object): :return: A list of dictionaries containing all the specified fields. """ record_ids = self.search(domain or [], offset, limit or False, order or False, context or {}) + if not record_ids: return [] records = self.read(record_ids, fields or [], context or {}) return records @@ -450,15 +463,17 @@ def get_connector(hostname=None, protocol="xmlrpc", port="auto"): :param port: The number of the port. Defaults to auto. """ if port == 'auto': - port = 8069 if protocol=="xmlrpc" else 8070 + port = 8069 if protocol=="xmlrpc" else (8070 if protocol == "netrpc" else 8071) if protocol == "xmlrpc": return XmlRPCConnector(hostname, port) + elif protocol == "xmlrpcs": + return XmlRPCSConnector(hostname, port) elif protocol == "netrpc": return NetRPCConnector(hostname, port) elif protocol == "local": return LocalConnector() else: - raise ValueError("You must choose xmlrpc or netrpc or local") + raise ValueError("You must choose xmlrpc(s), netrpc or local") def get_connection(hostname=None, protocol="xmlrpc", port='auto', database=None, login=None, password=None, user_id=None): diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 8120141b4f6..74285b1f444 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -24,19 +24,51 @@ openerpweb = web.common.http # OpenERP Web web Controllers #---------------------------------------------------------- -def concat_files(file_list): - """ Concatenate file content + +def concat_xml(file_list): + """Concatenate xml files return (concat,timestamp) concat: concatenation of file content timestamp: max(os.path.getmtime of file_list) """ + root = None + files_timestamp = 0 + for fname in file_list: + ftime = os.path.getmtime(fname) + if ftime > files_timestamp: + files_timestamp = ftime + + xml = ElementTree.parse(fname).getroot() + + if root is None: + root = ElementTree.Element(xml.tag) + #elif root.tag != xml.tag: + # raise ValueError("Root tags missmatch: %r != %r" % (root.tag, xml.tag)) + + for child in xml.getchildren(): + root.append(child) + return ElementTree.tostring(root, 'utf-8'), files_timestamp + + +def concat_files(file_list, reader=None): + """ Concatenate file content + return (concat,timestamp) + concat: concatenation of file content, read by `reader` + timestamp: max(os.path.getmtime of file_list) + """ + if reader is None: + def reader(f): + with open(f) as fp: + return fp.read() + files_content = [] files_timestamp = 0 for fname in file_list: ftime = os.path.getmtime(fname) if ftime > files_timestamp: files_timestamp = ftime - files_content.append(open(fname).read()) + + files_content.append(reader(fname)) files_concat = "".join(files_content) return files_concat,files_timestamp @@ -98,10 +130,42 @@ class WebClient(openerpweb.Controller): def jslist(self, req, mods=None): return self.manifest_list(req, mods, 'js') + @openerpweb.jsonrequest + def qweblist(self, req, mods=None): + return self.manifest_list(req, mods, 'qweb') + @openerpweb.httprequest def css(self, req, mods=None): - files = [f[0] for f in self.manifest_glob(req, mods, 'css')] - content,timestamp = concat_files(files) + + files = list(self.manifest_glob(req, mods, 'css')) + file_map = dict(files) + + rx_import = re.compile(r"""@import\s+('|")(?!'|"|/|https?://)""", re.U) + rx_url = re.compile(r"""url\s*\(\s*('|"|)(?!'|"|/|https?://)""", re.U) + + + def reader(f): + """read the a css file and absolutify all relative uris""" + with open(f) as fp: + data = fp.read() + + web_path = file_map[f] + web_dir = os.path.dirname(web_path) + + data = re.sub( + rx_import, + r"""@import \1%s/""" % (web_dir,), + data, + ) + + data = re.sub( + rx_url, + r"""url(\1%s/""" % (web_dir,), + data, + ) + return data + + content,timestamp = concat_files((f[0] for f in files), reader) # TODO use timestamp to set Last mofified date and E-tag return req.make_response(content, [('Content-Type', 'text/css')]) @@ -112,6 +176,14 @@ class WebClient(openerpweb.Controller): # TODO use timestamp to set Last mofified date and E-tag return req.make_response(content, [('Content-Type', 'application/javascript')]) + @openerpweb.httprequest + def qweb(self, req, mods=None): + files = [f[0] for f in self.manifest_glob(req, mods, 'qweb')] + content,timestamp = concat_xml(files) + # TODO use timestamp to set Last mofified date and E-tag + return req.make_response(content, [('Content-Type', 'text/xml')]) + + @openerpweb.httprequest def home(self, req, s_action=None, **kw): js = "\n ".join(''%i for i in self.manifest_list(req, None, 'js')) @@ -451,7 +523,7 @@ def clean_action(req, action, do_not_eval=False): # values come from the server, we can just eval them if isinstance(action.get('context'), basestring): action['context'] = eval( action['context'], eval_ctx ) or {} - + if isinstance(action.get('domain'), basestring): action['domain'] = eval( action['domain'], eval_ctx ) or [] else: @@ -1412,7 +1484,7 @@ class Import(View): return fields @openerpweb.httprequest - def detect_data(self, req, csvfile, csvsep, csvdel, csvcode, jsonp): + def detect_data(self, req, csvfile, csvsep=',', csvdel='"', csvcode='utf-8', jsonp='callback'): try: data = list(csv.reader( csvfile, quotechar=str(csvdel), delimiter=str(csvsep))) diff --git a/addons/web/po/ar.po b/addons/web/po/ar.po new file mode 100644 index 00000000000..0aac2c8aed2 --- /dev/null +++ b/addons/web/po/ar.po @@ -0,0 +1,699 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-11-08 05:44+0000\n" +"Last-Translator: Ahmad Khayyat \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-08 06:12+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "تحذير، تم تحرير السجل، تعديلاتك سيتم تجاهلها" + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "    مزيداً من البحث..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   إنشاء \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   إنشاء و تحرير..." + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "عليك إختيار سجل واحد علي الأقل." + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "تحذير" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "ترجمات" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "حفظ" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "إغلاق" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "x" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "#{لقب}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "#{text}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "مدعوم من kifcaliph و" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "openerp.com" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "جاري التحميل..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "إنشاء" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "إزالة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "نسخة إحتياطية" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "استرجاع" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "كلمة المرور" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "العودة للدخول" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "إنشاء قاعدة بيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "كلمة المرور الرئيسية:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "اسم قاعدة البيانات الجديدة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "تحميل البيانات الوهمية:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "اللغة الافتراضية:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "كلمة مرور المشرف العام:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "تأكيد كلمة المرور:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "إسقاط قاعدة البيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "قاعدة البيانات:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "كلمة المرور الرئيسية:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "نسخ إحتياطي لقاعدة البيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "إسترجاع قاعدة بيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "ملف:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "تغيير كلمة المرور الرئيسية" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "كلمة مرور رئيسية جديدة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "تأكيد كلمة المرور الرئيسية الجديدة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "مستخدم:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "كلمة المرور:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "قاعدة بيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "تسجيل الدخول" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "اسم مستخدم او كلمة مرور خاطئة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "نؤمن بأن نشاط العمل اليومي يمكن أن يكون بديهي، فعال، سريع و ممتع" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "رؤي برنامج OpenERP هي:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "كامل الأوصاف" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" +"تتعدد تحديات المنشآت اليوم، و لذلك نوفر العديد من الوحدات البرمجية لكل " +"احتياج." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "مفتوح المصدر" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "لبناء منتج قوي، نحن نعتمد علي معرفة ألاف المساهمين." + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "سهل الإستخدام" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "تتمثل الإنتاجية في حاجة الأفراد إلي إستخدام واجهة سهلة و لائقة." + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "(" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr ")" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "تسجيل الخروج" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "oe_secondary_menu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "oe_secondary_submenu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "إخفاء هذه الملحوظة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "تعطيل جميع الإرشادات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "View#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "حقول" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "عرض التسميات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "روابط الشريط الجانبي" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "حقل" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr ":" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "ترجمة العرض" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "ترجمة الشريط الجانبي" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "حذف" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "الأول" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "<" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr ">" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "الأخير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "♻" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "حفظ و تحرير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "إنشاء و تحرير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "جديد" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "تكرار" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "للقراءة فقط/قابل للتحرير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "0" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "/" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "اضافة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "أداة غير معالجة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "؟" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "تم" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "فتح..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "إنشاء..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "بحث..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "جاري التحميل..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "حدّد" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "حفظ كـ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "إفراغ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "مرشحات متقدمة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "-- مرشحات --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "-- إجراءات --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "حفظ المرشح" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "إدارة المرشحات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "اسم المرشح:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "(لاحظ أن أي مرشح بنفس الاسم سيتم إستبداله)" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "يجب تطابق أي من الشروط التالية" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "يجب تطابق كل الشروط التالية" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "لا يجب تطابق أي من الشروط التالية" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "إضافة شرط" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "و" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "إلغاء" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "حفظ و جديد" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "حفظ و إغلاق" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "تصدير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" +"هذا المعالج سيقوم بتصدير كافة البيانات التي تطابق شروط البحث الحالية لملف " +"CSV.\n" +" يمكنك تصدير كل البيانات أو الحقول التي يمكن إستيرادها بعد " +"التعديل." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "نوع التصدير:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "إستيراد بيانات ملائمة للتصدير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "تصدير جميع البيانات" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "تنسيقات التصدير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "الحقول المتوفرة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "حقول للتصدير" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "حفظ قائمة الحقول" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "إزالة" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "إزالة الكل" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "اسم" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr " " + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "حفظ باسم:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "تم" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "مُصدرة محفوظة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "كلمة المرور القديمة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "كلمة المرور الجديدة:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "تأكيد كلمة المرور:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "استيراد" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "إستيراد ملف .CSV" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" +"اختر ملف .CSV للإستيراد. إذا كنت بحاجة إلى عينة ملف للاستيراد،\n" +" يجب عليك إستخدام أداة تصدير مع الخيار \" Compatible\" option." + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "ملف CSV :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "تأكد من إمتداد الملف" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "خيارات الاستيراد" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "هل لملفك عناوين؟" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "فاصل :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "محدد:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "ترميز:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "UTF-8" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "Latin 1" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "خطوط للتجاهل" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "فشلت عملية الإستيراد للأسباب التالية:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "هذه معاينة لملف لم يتمكن من إستيراده:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "OpenERP عبر الإنترنت" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "الإصدار" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "جميع حقوق النشر محفوظة لـ © 2011-TODAY OpenERP SA." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "OpenERP هي علامة تجارية لـ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "شركة OpenERP SA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "النظام مرخص بشروط" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "GNU Affero General Public License" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "عن OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" +"هو نظام حر يناسب المؤسسات و الشركات و تم تصميمه لتعزيز\n" +" الإنتاجية و الربح من خلال تكامل البيانات. فيمكنك من ربط، و " +"تحسين، و\n" +" إدارة العمليات التجارية في إدارات مثل المبيعات، المحاسبة " +"المالية، المخازن،\n" +" إدارة المشروعات، الإنتاج و العمليات الصناعية، و القطاع الخدمي، , " +"إدارة علاقات العملاء..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" +"يعمل البرنامج مع العديد من الأنظمة مثل Windows، و Mac OS X، و\n" +" معظم أنظمة لينكس بالإضافة إلي اليونكس. فلقد تم تصميمه ليتيح " +"إمكانية\n" +" إضافة وظائف أخري له بسهولة، و برمجته و تعديله بسرعه ليلائم " +"الواقع العملي\n" +" كما أنه يتيح سهولة نقل البيانات من إصدار إلي إصدار." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" +"حسب إحتياجاتك، نظام OpenERP متاح من خلال تطبيق الويب أو البرنامج المحلي." diff --git a/addons/web/po/da.po b/addons/web/po/da.po index cefd844d49a..c0931065d1e 100644 --- a/addons/web/po/da.po +++ b/addons/web/po/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/de.po b/addons/web/po/de.po index 027f34f9866..0a26630321f 100644 --- a/addons/web/po/de.po +++ b/addons/web/po/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/es.po b/addons/web/po/es.po index 508b4e62245..9bd7071871b 100644 --- a/addons/web/po/es.po +++ b/addons/web/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/es_EC.po b/addons/web/po/es_EC.po index eb2283f6fe5..588408ba979 100644 --- a/addons/web/po/es_EC.po +++ b/addons/web/po/es_EC.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/et.po b/addons/web/po/et.po index 75269bf5cda..6b6da84f3a5 100644 --- a/addons/web/po/et.po +++ b/addons/web/po/et.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/fr.po b/addons/web/po/fr.po index a4287a31030..df35344c558 100644 --- a/addons/web/po/fr.po +++ b/addons/web/po/fr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/gl.po b/addons/web/po/gl.po index b43664b9bee..34b2d50085f 100644 --- a/addons/web/po/gl.po +++ b/addons/web/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/it.po b/addons/web/po/it.po index fc53244533b..647030fd4ea 100644 --- a/addons/web/po/it.po +++ b/addons/web/po/it.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/nl_BE.po b/addons/web/po/nl_BE.po index 2a2dccb1712..3d649b59b9d 100644 --- a/addons/web/po/nl_BE.po +++ b/addons/web/po/nl_BE.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/po/pl.po b/addons/web/po/pl.po new file mode 100644 index 00000000000..fde2196a73e --- /dev/null +++ b/addons/web/po/pl.po @@ -0,0 +1,687 @@ +# Polish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-11-04 16:44+0000\n" +"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "Uwaga, rekord został zmodyfikowany, twoje zmiany zostaną odrzucone." + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "   Szukaj dalej..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   Utwórz \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   Utwórz i edytuj..." + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "Musisz wybrac co najmniej jeden rekord." + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "Ostrzeżenie" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "Tłumaczenia" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "Zapisz" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "Zamknij" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "Wczytywanie..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "Utwórz" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "Usuń bazę danych" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "Kopia zapasowa bazy danych" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "Odtwórz bazę danych" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "Hasło" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "Wróć do logowania" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "UTWÓRZ BAZĘ DANYCH" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "Hasło madrzędne:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "Nazwa nowej bazy danych:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "Wczytaj dane demonstracyjne:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "Domyślny język:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "Hasło admina:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "Potwierdź hasło:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "USUŃ BAZĘ DANYCH" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "Baza danych:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "Hasło nadrzędne:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "ZAPISZ BAZĘ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "ODTWÓRZ BAZĘ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "Plik:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "ZMIEŃ HASŁO NADRZĘDNE" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "Nowe hasło nadrzędne:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "Potwierdź nowe hasło nadrzędne:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "Użytkownik:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "Hasło:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "Baza danych" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "Login" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "Niepoprawna nazwa użytkownika lub hasło" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "" +"Sądzimy, że codzienne zadania mogą być bardziej intuicyjne, efektywne, " +"zautomatyzowan, ... a nawet przyjemne." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "" +"Przy budowie wielkiego produktu polegamy na wiedzy tysięcy społeczników." + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "Przyjazne dla użytkownika" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "WYLOGUJ" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "Ukryj tę wskazówkę" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "Wyłącz wszystkie wskazówki" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "Pola" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "Pokaż etykiety" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "Pole" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "Przetłumacz widok" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "Usuń" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "Pierwsze" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "Ostatnie" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "Zapisz i edytuj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "Utwórz i edytuj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "Nowy" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "Duplikuj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "Tylko odczyt/Edytowalne" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "Dodaj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "Wykonano" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "Otwórz..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "Utwórz..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "Wyszukaj..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "Wybierz" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "Zapisz jako" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "Wyczyść" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "Zaawansowany filtr" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "-- Filtry --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "-- Akcje --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "Zapisz filtr" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "Zarządzaj filtrami" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "Nazwa filtra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "(Każdy filtr o tej samej nazwie zostanie zamazany)" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "Jeden z tych warunków musi być spełniony" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "Wszystkie warunki muszą być spełnione" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "Żadeń z tych warunków nie może być spełniony" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "Dodaj warunek" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "i" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "Anuluj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "Zapisz i nowy" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "Zapisz i zamknij" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "Eksportuj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" +"Ten kreator wyeksportuje wszystkie dane, które spełniają bieżące kryteria " +"wyszukiwania, do pliku CSV.\n" +" Możesz eksportować wszystkie dane lub tylko pola, które mają być " +"importowane po zmianie." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "Typ eksportu:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "Eksport kompatybilny z importem" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "Eksportuj wszystkie dane" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "Format eksportu" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "Dostępne pola" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "Pola do eksportu" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "Zapisz listę pól" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "Usuń" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "Usuń wszystko" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "Nazwa" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "Zapisz jako:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "Zapisane eksporty" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "Poprzednie hasło:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "Nowe hasło:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "Potwierdź hasło:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "Importuj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "1. Importuj plik .CSV" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" +"Wybierz plik .CSV do importu. Jeśli chcesz zobaczyć przykład pliku do " +"importu,\n" +" powinieneś wyeksportować dane z opcją \"Kompatybilne z importem\"." + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "Plik CSV:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "2. Sprawdź format pliku" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "Opcje importu" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "Czy plik zawiera nazwy pól?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "Separator:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "Znak dziesiętny:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "Kodowanie:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "Linie do pominięcia" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "Import się nie udał z powodu:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "Oto podgląd pliku, którego nie można zaimportować:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "Wersja" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" diff --git a/addons/web/po/sl.po b/addons/web/po/sl.po index bc63e7ff313..54349249817 100644 --- a/addons/web/po/sl.po +++ b/addons/web/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web/static/src/js/view_form.js:355 msgid "" diff --git a/addons/web/static/lib/jquery.MD5/README.md b/addons/web/static/lib/jquery.MD5/README.md new file mode 100644 index 00000000000..88778a7a3bf --- /dev/null +++ b/addons/web/static/lib/jquery.MD5/README.md @@ -0,0 +1,32 @@ +# jQuery MD5 Plugin + +## Usage +Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value: + + var md5 = $.md5('value'); + +Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key: + + var md5 = $.md5('value', 'key'); + +Create raw [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value: + + var md5 = $.md5('value', null, true); + +Create raw [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key: + + var md5 = $.md5('value', 'key', true); + +## Requirements +None. + +If [jQuery](http://jquery.com/) is not available, the md5 function will be added to the global object: + + var md5 = md5('value'); + +## License +Released under the [MIT license](http://creativecommons.org/licenses/MIT/). + +## Source Code & Download +* Browse and checkout the [source code](https://github.com/blueimp/jQuery-MD5). +* [Download](https://github.com/blueimp/jQuery-MD5/archives/master) the project to add the plugin to your website. diff --git a/addons/web/static/lib/jquery.MD5/README.txt b/addons/web/static/lib/jquery.MD5/README.txt new file mode 100644 index 00000000000..8a8cbf4db2a --- /dev/null +++ b/addons/web/static/lib/jquery.MD5/README.txt @@ -0,0 +1,32 @@ +jQuery MD5 Plugin +================= + +Usage +----- +Create (hex-encoded) MD5 hash of a given string value: + var md5 = $.md5('value'); + +Create (hex-encoded) HMAC-MD5 hash of a given string value and key: + var md5 = $.md5('value', 'key'); + +Create raw MD5 hash of a given string value: + var md5 = $.md5('value', null, true); + +Create raw HMAC-MD5 hash of a given string value and key: + var md5 = $.md5('value', 'key', true); + +Requirements +------------ +None. + +If jQuery is not available, the md5 function will be added to the global object: + var md5 = md5('value'); + +License +------- +Released under the MIT license: +http://creativecommons.org/licenses/MIT/ + +Source Code & Download +---------------------- +https://github.com/blueimp/jQuery-MD5 diff --git a/addons/web/static/lib/jquery.MD5/jquery.md5.js b/addons/web/static/lib/jquery.MD5/jquery.md5.js new file mode 100644 index 00000000000..bf9bbe97b55 --- /dev/null +++ b/addons/web/static/lib/jquery.MD5/jquery.md5.js @@ -0,0 +1,269 @@ +/* + * jQuery MD5 Plugin 1.2.1 + * https://github.com/blueimp/jQuery-MD5 + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://creativecommons.org/licenses/MIT/ + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +/*jslint bitwise: true */ +/*global unescape, jQuery */ + +(function ($) { + 'use strict'; + + /* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF), + msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + /* + * Bitwise rotate a 32-bit number to the left. + */ + function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + /* + * These functions implement the four basic operations the algorithm uses. + */ + function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); + } + function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); + } + function md5_gg(a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); + } + function md5_hh(a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t); + } + function md5_ii(a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); + } + + /* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + function binl_md5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var i, olda, oldb, oldc, oldd, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + + a = md5_ff(a, b, c, d, x[i], 7, -680876936); + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i], 20, -373897302); + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5_hh(d, a, b, c, x[i], 11, -358537222); + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i], 6, -198630844); + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return [a, b, c, d]; + } + + /* + * Convert an array of little-endian words to a string + */ + function binl2rstr(input) { + var i, + output = ''; + for (i = 0; i < input.length * 32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); + } + return output; + } + + /* + * Convert a raw string to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + function rstr2binl(input) { + var i, + output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + for (i = 0; i < input.length * 8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32); + } + return output; + } + + /* + * Calculate the MD5 of a raw string + */ + function rstr_md5(s) { + return binl2rstr(binl_md5(rstr2binl(s), s.length * 8)); + } + + /* + * Calculate the HMAC-MD5, of a key and some data (raw strings) + */ + function rstr_hmac_md5(key, data) { + var i, + bkey = rstr2binl(key), + ipad = [], + opad = [], + hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = binl_md5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8); + return binl2rstr(binl_md5(opad.concat(hash), 512 + 128)); + } + + /* + * Convert a raw string to a hex string + */ + function rstr2hex(input) { + var hex_tab = '0123456789abcdef', + output = '', + x, + i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hex_tab.charAt((x >>> 4) & 0x0F) + + hex_tab.charAt(x & 0x0F); + } + return output; + } + + /* + * Encode a string as utf-8 + */ + function str2rstr_utf8(input) { + return unescape(encodeURIComponent(input)); + } + + /* + * Take string arguments and return either raw or hex encoded strings + */ + function raw_md5(s) { + return rstr_md5(str2rstr_utf8(s)); + } + function hex_md5(s) { + return rstr2hex(raw_md5(s)); + } + function raw_hmac_md5(k, d) { + return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)); + } + function hex_hmac_md5(k, d) { + return rstr2hex(raw_hmac_md5(k, d)); + } + + $.md5 = function (string, key, raw) { + if (!key) { + if (!raw) { + return hex_md5(string); + } else { + return raw_md5(string); + } + } + if (!raw) { + return hex_hmac_md5(key, string); + } else { + return raw_hmac_md5(key, string); + } + }; + +}(typeof jQuery === 'function' ? jQuery : this)); \ No newline at end of file diff --git a/addons/web/static/lib/jquery.MD5/tests/index.html b/addons/web/static/lib/jquery.MD5/tests/index.html new file mode 100644 index 00000000000..27ba8d3607d --- /dev/null +++ b/addons/web/static/lib/jquery.MD5/tests/index.html @@ -0,0 +1,43 @@ + + + + + +jQuery MD5 Plugin Tests + + + +

jQuery MD5 Plugin Tests

+

+
+

+
    + + + + + + + \ No newline at end of file diff --git a/addons/web/static/lib/jquery.MD5/tests/tests.js b/addons/web/static/lib/jquery.MD5/tests/tests.js new file mode 100644 index 00000000000..ab70f2f991b --- /dev/null +++ b/addons/web/static/lib/jquery.MD5/tests/tests.js @@ -0,0 +1,57 @@ +/* + * jQuery MD5 Plugin Tests 1.1 + * https://github.com/blueimp/jQuery-MD5 + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://creativecommons.org/licenses/MIT/ + */ + +/*global jQuery, module, test, strictEqual */ + +(function ($) { + 'use strict'; + + module('Hex-encoded MD5'); + + test('Creating hex-encoded MD5 hash of an ASCII value', function () { + strictEqual($.md5('value'), '2063c1608d6e0baf80249c42e2be5804'); + }); + + test('Creating hex-encoded MD5 hash of an UTF-8 value', function () { + strictEqual($.md5('日本'), '4dbed2e657457884e67137d3514119b3'); + }); + + module('Hex-encoded HMAC-MD5'); + + test('Creating hex-encoded HMAC-MD5 hash of an ASCII value and key', function () { + strictEqual($.md5('value', 'key'), '01433efd5f16327ea4b31144572c67f6'); + }); + + test('Creating hex-encoded HMAC-MD5 hash of an UTF-8 value and key', function () { + strictEqual($.md5('日本', '日本'), 'c78b8c7357926981cc04740bd3e9d015'); + }); + + module('Raw MD5'); + + test('Creating raw MD5 hash of an ASCII value', function () { + strictEqual($.md5('value', null, true), ' c\xc1`\x8dn\x0b\xaf\x80$\x9cB\xe2\xbeX\x04'); + }); + + test('Creating raw MD5 hash of an UTF-8 value', function () { + strictEqual($.md5('日本', null, true), 'M\xbe\xd2\xe6WEx\x84\xe6q7\xd3QA\x19\xb3'); + }); + + module('Raw HMAC-MD5'); + + test('Creating raw HMAC-MD5 hash of an ASCII value and key', function () { + strictEqual($.md5('value', 'key', true), '\x01C>\xfd_\x162~\xa4\xb3\x11DW,g\xf6'); + }); + + test('Creating raw HMAC-MD5 hash of an UTF-8 value and key', function () { + strictEqual($.md5('日本', '日本', true), '\xc7\x8b\x8csW\x92i\x81\xcc\x04t\x0b\xd3\xe9\xd0\x15'); + }); + +}(typeof jQuery === 'function' ? jQuery : this)); \ No newline at end of file diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 6872b921435..94e36d60419 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -159,7 +159,7 @@ body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp optio } .db_container { - width: 15%; + width: 196px; background: #666666; } @@ -801,13 +801,15 @@ label.error { -moz-border-radius-topright: 7px; border-top-right-radius: 7px; } -.openerp .oe-listview table.oe-listview-content tfoot td:first-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:first-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:first-child, .openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child th:first-child { -webkit-border-bottom-left-radius: 7px; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; } -.openerp .oe-listview table.oe-listview-content tfoot td:last-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:last-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:last-child, .openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 7px; -moz-border-radius-bottomright: 7px; @@ -844,7 +846,7 @@ label.error { .openerp .oe_frame.oe_forms { clear: both; } -.openerp table.oe_frame td { +.openerp table.oe_frame { color: #4c4c4c; } .openerp td.oe_form_frame_cell { @@ -872,7 +874,6 @@ label.error { } .openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help { - text-align: right; margin: 3px 0 0 10px; } .openerp label.oe_label_help span { @@ -883,6 +884,18 @@ label.error { top: -4px; padding: 0 2px; } +.openerp .oe_align_left { + text-align: left; +} +.openerp .oe_align_right { + text-align: right; +} +.openerp .oe_align_center { + text-align: center; +} +.openerp .oe_forms .oe_form_paragraph { + margin: 3px 0 0 0; +} /* Inputs */ .openerp .oe_forms input[type="text"], .openerp .oe_forms input[type="password"], .openerp .oe_forms select, .openerp .oe_forms textarea { @@ -1075,7 +1088,7 @@ label.error { list-style: none; } .openerp .oe-view-manager-logs li:before { - content: '→ '; + content: '\2192 '; } .openerp .oe-view-manager-logs a { text-decoration: none; @@ -1408,3 +1421,31 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { border-color: rgba(0,0,0,0); border-left-color: #B5B9FF; } +.openerp .oe_view_editor { + border-collapse: collapse; + padding: 0; + align: left; + width: 100%; +} +.openerp .oe_view_editor_colum{ + font-size: 90%; + font-weight: normal; + padding: 0; + border-bottom: 1px solid #CFCCCC; +} +.openerp .oe_view_editor_row:hover{ + background-color: #F3F3F3; +} +.openerp .oe_view_editor_tree_grid{ + text-align: left; + white-space: nowrap; + border-collapse: collapse; + width: 100%; +} +.openerp .oe_view_editor_tree_grid a:hover { + color: blue; +} +.openerp .oe_view_editor_tree_grid a { + display: block; +} + diff --git a/addons/web/static/src/css/data_import.css b/addons/web/static/src/css/data_import.css index 1fb3b22aa45..e5d1c9a910c 100644 --- a/addons/web/static/src/css/data_import.css +++ b/addons/web/static/src/css/data_import.css @@ -11,6 +11,22 @@ .openerp .oe_import_grid-row .oe_import_grid-cell { border-bottom: 1px solid #E3E3E3; } + +.openerp .oe-import-no-result .oe-import-result { + display: none; +} +.openerp .oe-import fieldset { + cursor: pointer; +} +.openerp .oe-import fieldset legend:before { + content: '\25BC '; +} +.openerp .oe-import fieldset.oe-closed legend:before { + content: '\25B6 '; +} +.openerp .oe-import fieldset.oe-closed table { + display: none; +} .openerp .separator.horizontal { font-weight: bold; border-bottom-width: 1px; diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index f41185be0c6..5fba5f4d8d4 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -59,7 +59,7 @@ openerp.web = function(instance) { openerp.web.formats(instance); openerp.web.chrome(instance); openerp.web.data(instance); - var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import"]; + var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import","view_editor"]; for(var i=0; i'}); + $.blockUI(); self.rpc("/web/database/create", {'fields': fields}, function(result) { if (result.error) { $.unblockUI(); @@ -392,7 +408,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database .html(QWeb.render("BackupDB", self)) .find("form[name=backup_db_form]").validate({ submitHandler: function (form) { - $.blockUI({message:''}); + $.blockUI(); self.session.get_file({ form: form, error: function (body) { @@ -413,7 +429,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database self.$option_id.find("form[name=restore_db_form]").validate({ submitHandler: function (form) { - $.blockUI({message:''}); + $.blockUI(); $(form).ajaxSubmit({ url: '/web/database/restore', type: 'POST', @@ -943,17 +959,15 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this._super(null, element_id); openerp.webclient = this; - QWeb.add_template("/web/static/src/xml/base.xml"); var params = {}; if(jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { this.$element.addClass("kitten-mode-activated"); } this.$element.html(QWeb.render("Interface", params)); - this.notification = new openerp.web.Notification(); - this.session = new openerp.web.Session(); + this.notification = new openerp.web.Notification(this); this.loading = new openerp.web.Loading(this,"oe_loading"); - this.crashmanager = new openerp.web.CrashManager(this); + this.crashmanager = new openerp.web.CrashManager(); this.header = new openerp.web.Header(this); this.login = new openerp.web.Login(this); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 1b6a6302f72..951e6e2b01f 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -237,8 +237,8 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry * registry was created. * * An object path is simply a dotted name from the openerp root to the - * object pointed to (e.g. ``"openerp.web.Session"`` for an OpenERP - * session object). + * object pointed to (e.g. ``"openerp.web.Connection"`` for an OpenERP + * connection object). * * @constructs openerp.web.Registry * @param {Object} mapping a mapping of keys to object-paths @@ -338,9 +338,9 @@ openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.Ca } }); -openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Session# */{ +openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Connection# */{ /** - * @constructs openerp.web.Session + * @constructs openerp.web.Connection * @extends openerp.web.CallbackEnabled * * @param {String} [server] JSON-RPC endpoint hostname @@ -364,7 +364,9 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web // TODO: session should have an optional name indicating that they'll // be saved to (and revived from) cookies this.name = 'session'; + this.do_load_qweb(['/web/webclient/qweb']); }, + start: function() { this.session_restore(); }, @@ -484,9 +486,11 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web self.user_context = result.context; self.db = result.db; self.session_save(); + self.on_session_valid(); return true; }).then(success_callback); }, + login: function() { this.session_login.apply(this, arguments); }, /** * Reloads uid and session_id from local storage, if they exist */ @@ -574,6 +578,7 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web self.rpc('/web/webclient/jslist', {"mods": modules}, function(files) { self.do_load_js(file_list.concat(files)); }); + self.rpc('/web/webclient/qweblist', {"mods": modules}, self.do_load_qweb); openerp._modules_loaded = true; }); }); @@ -607,6 +612,12 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web this.on_modules_loaded(); } }, + do_load_qweb: function(files) { + var self = this; + _.each(files, function(file) { + openerp.web.qweb.add_template(file); + }); + }, on_modules_loaded: function() { for(var j=0; j"}; + var root_object = this.check_attr(root,tag,0); + obj.child_id = this.xml_node_create(arch, tag, [], this.xml_id-1, [root_object], []) + return [obj]; + }, + get_data: function() { + var self = this; + var view_arch_list = []; + self.main_view_id =((this.view_edit_dialog.$element.find("input[name='radiogroup']:checked").parent()).parent()).attr('data-id'); + var ve_dataset = new openerp.web.DataSet(this, 'ir.ui.view'); + ve_dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type'], function (arch) { + one_object = self.parse_xml(arch[0].arch,self.main_view_id); + self.main_view_type = arch[0].type + view_arch_list.push({"view_id" : self.main_view_id, "arch" : arch[0].arch}); + dataset = new openerp.web.DataSetSearch(self, 'ir.ui.view', null, null); + dataset.read_slice([], {domain : [['inherit_id','=', parseInt(self.main_view_id)]]}, function (result) { + _.each(result, function(res) { + view_arch_list.push({"view_id":res.id,"arch":res.arch}); + self.inherit_view(one_object, res); + }); + return self.edit_view({"main_object": one_object, + "parent_child_id": self.parent_child_list(one_object, []), + "arch": view_arch_list}); + }); + }); + }, + parent_child_list : function(one_object, p_list) { + var self = this; + _.each(one_object , function(element){ + if(element.child_id.length != 0){ + p_list.push({"key":element.id,"value":_.pluck(element.child_id, 'id')}); + self.parent_child_list(element.child_id, p_list); + } + }); + return p_list; + }, + inherit_view : function(one_object, result) { + var self = this; + var root = $(result.arch).filter('*'); + var xml_list = []; + if (root[0].tagName.toLowerCase() == "data") { + xml_list = $(root[0]).children(); + } else { + xml_list.push(root[0]); + } + _.each(xml_list , function(xml){ + var parent_id; + var check_list = []; + var xpath_object = self.parse_xml(xml,result.id); + if (xml.tagName.toLowerCase() == "xpath" ) { + var part_expr = _.without($(xml).attr('expr').split("/"),""); + _.each(part_expr,function(part){ + check_list.push(_.without($.trim(part.replace(/[^a-zA-Z 0-9 _]+/g,'!')).split("!"),"")); + }); + } else { + var temp = []; + _.each(xpath_object[0].child_id[0].att_list, function(list){ + if(!_.include(list, "position")){ + temp.push(list); + } + }); + check_list = [_.flatten(temp)]; + } + self.full_path_search(check_list ,one_object ,xpath_object); + }); + }, + full_path_search: function(check_list ,val ,xpath_object) { + var self = this; + if(xpath_object.length!=0){ + var check = check_list[0]; + var obj; + switch (check.length) { + case 2: + if(parseInt(check[1])){ + var list_1 = _.select(val,function(element){ + var main_list = _.flatten(element.att_list); + return _.include(main_list, check[0]); + }); + obj = val[_.indexOf(val,list_1[parseInt(check[1])-1])]; + } else { + obj = _.detect(val, function(element){ + var main_list = _.flatten(element.att_list); + return _.include(main_list, check[0]); + }); + } + break; + case 3: + obj = _.detect(val,function(element){ + var main_list = _.flatten(element.att_list); + check = _.uniq(check); + var insert = _.intersection(main_list,check); + if(insert.length == check.length ){return element;} + }); + break; + case 1: + var list_1 = _.select(val,function(element){ + var main_list = _.flatten(element.att_list); + return _.include(main_list, check[0]); + }); + if(list_1.length != 0){ + (check_list.length == 1)? obj = list_1[0] : check_list.shift(); + } + break; + } + if(obj) { + check_list.shift(); + if (check_list.length !=0){ + self.full_path_search(check_list ,obj.child_id ,xpath_object); + } else { + var level = obj.level+1; + self.increase_level(xpath_object[0], level) + obj.child_id.push(xpath_object[0]); + xpath_object.pop(); + return; + } + } + else { + _.each(val,function(element){ + self.full_path_search(check_list ,element.child_id ,xpath_object); + }); + } + } + }, + increase_level: function(val, level) { + var self = this; + val.level = level; + _.each(val.child_id, function(val, key) { + self.increase_level(val, level + 1); + }); + }, + edit_view: function(one_object) { + var self = this; + this.edit_xml_dialog = new openerp.web.Dialog(this,{ + modal: true, + title: 'View Editor', + width: 750, + height: 500, + buttons: { + "Inherited View": function(){ + //todo + }, + "Preview": function(){ + var action = { + context:self.session.user_context, + res_model : self.model, + views : [[self.main_view_id, self.main_view_type]], + type: 'ir.actions.act_window', + target: "new", + flags: { + sidebar: false, + views_switcher: false, + action_buttons:false, + search_view:false, + pager:false, + }, + }; + var action_manager = new openerp.web.ActionManager(self); + action_manager.do_action(action); + }, + "Close": function(){ + self.edit_xml_dialog.close(); + } + } + }); + this.edit_xml_dialog.start().open(); + this.edit_xml_dialog.$element.html(QWeb.render('view_editor', { + 'data': one_object['main_object'], + })); + this.edit_xml_dialog.$element.find("tr[id^='viewedit-']").click(function() { + self.edit_xml_dialog.$element.find("tr[id^='viewedit-']").removeClass('ui-selected'); + $(this).addClass('ui-selected'); + }); + this.edit_xml_dialog.$element.find("img[id^='parentimg-']").click(function() { + if ($(this).attr('src') == '/web/static/src/img/collapse.gif') { + $(this).attr('src', '/web/static/src/img/expand.gif'); + self.on_expand(this); + } else { + $(this).attr('src', '/web/static/src/img/collapse.gif'); + var id = this.id.split('-')[1]; + self.on_collapse(this,one_object['parent_child_id'], one_object['main_object']); + } + }); + this.edit_xml_dialog.$element.find("img[id^='side-']").click(function() { + var side = $(this).closest("tr[id^='viewedit-']") + var id_tr = (side.attr('id')).split('-')[1]; + var img = side.find("img[id='parentimg-"+id_tr+"']").attr('src'); ; + var level = parseInt(side.attr('level')); + var list_shift =[]; + var last_tr; + var cur_tr = side; + list_shift.push(side); + var next_tr; + var ls = side; + var view_id; + var view_xml_id; + while(1){ + ls = ls.prev(); + if((self.edit_xml_dialog.$element.find(ls).find('a').text()).search("view_id") != -1 + && parseInt(ls.attr('level')) < level){ + view_id = parseInt(($(ls).find('a').text()).replace(/[^0-9]+/g,'')); + view_xml_id = (ls.attr('id')).split('-')[1]; + break; + } + } + switch (this.id) { + case "side-add": + break; + case "side-remove": + break; + case "side-edit": + break; + case "side-up": + while (1) { + var prev_tr = cur_tr.prev(); + if(level >= parseInt(prev_tr.attr('level')) || prev_tr.length == 0) { + last_tr = prev_tr; + break; + } + cur_tr = prev_tr; + } + if (img) { + while (1) { + next_tr = side.next(); + if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) { + break; + } else { + list_shift.push(next_tr); + side = next_tr; + } + } + } + if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level && + (self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") == -1) { + _.each(list_shift, function(rec) { + $(last_tr).before(rec); + }); + self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "up"); + } + break; + case "side-down": + if (img) { + while (1) { + next_tr = cur_tr.next(); + if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) { + last_tr = next_tr; + break; + } else { + list_shift.push(next_tr); + cur_tr = next_tr; + } + } + } + else { + last_tr = cur_tr.next(); + } + if((self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") != -1){ + return; + } + if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level) { + var last_tr_id = (last_tr.attr('id')).split('-')[1]; + img = last_tr.find("img[id='parentimg-" + last_tr_id + "']").attr('src'); + if (img) { + self.edit_xml_dialog.$element.find("img[id='parentimg-" + last_tr_id + "']"). + attr('src', '/web/static/src/img/expand.gif'); + while (1) { + var next_tr = last_tr.next(); + if (next_tr.attr('level') <= level || next_tr.length == 0) break; + next_tr.hide(); + last_tr = next_tr; + } + } + list_shift.reverse(); + _.each(list_shift, function(rec) { + $(last_tr).after(rec); + }); + self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "down"); + } + break; + } + }); + }, + save_move_arch: function(one_object, view_id, view_xml_id, id_tr, level, move_direct){ + var self = this; + var arch = _.detect(one_object['arch'],function(element){ + return element.view_id == view_id; + }); + var obj = self.get_view_object(view_xml_id, one_object['main_object'], []); + if(($(arch.arch).filter("data")).length != 0 && view_xml_id != 0){ + var check_list = _.flatten(obj[0].child_id[0].att_list); + arch.arch = _.detect($(arch.arch).children(), function(xml_child){ + var temp_obj = self.check_attr(xml_child, xml_child.tagName.toLowerCase()); + var main_list = _.flatten(temp_obj.att_list); + check_list = _.uniq(check_list); + var insert = _.intersection(main_list,check_list); + if(insert.length == check_list.length ){return xml_child;} + }); + } + return self.get_node(arch.arch, obj[0].child_id[0], parseInt(id_tr), [], parseInt(level), + parseInt(view_id), arch, move_direct); + }, + + get_view_object: function(view_xml_id, one_object,result){ + var self = this; + if(result.length==0){ + var check = _.detect(one_object , function(obj){ + return view_xml_id==obj.id; + }); + if(check){result.push(check);}; + _.each(one_object, function(obj){ + self.get_view_object(view_xml_id, obj.child_id, result); + }); + } + return result; + }, + get_node: function(arch1, obj, id, child_list, level, view_id, arch, move_direct){ + var self = this; + var children_list = $(arch1).children(); + var list_obj_xml = _.zip(children_list,obj.child_id); + if (id) { + if (obj.id == id) { + var id; + var parent = $(arch1).parents(); + var index = _.indexOf(child_list, obj) + var re_insert_obj = child_list.splice(index, 1); + if (move_direct == "down") { + var next = $(arch1).next(); + $(next).after(arch1); + child_list.splice(index+1, 0, re_insert_obj[0]); + } else { + var prev = $(arch1).prev(); + $(prev).before(arch1); + child_list.splice(index-1, 0, re_insert_obj[0]); + } + parent = parent[parent.length-1]; + var convert_to_utf = self.xml2Str(parent); + if (convert_to_utf) { + convert_to_utf = convert_to_utf.replace('xmlns="http://www.w3.org/1999/xhtml"', ""); + convert_to_utf = '' + convert_to_utf; + arch.arch = convert_to_utf; + dataset = new openerp.web.DataSet(this, 'ir.ui.view'); + dataset.write(parseInt(view_id),{"arch":convert_to_utf}, function(r) { + }); + } + } + if (obj.level <= level) { + _.each(list_obj_xml, function(child_node) { + self.get_node(child_node[0], child_node[1], id, obj.child_id, level, view_id, arch, move_direct); + }); + } + } + }, + xml2Str: function(xmlNode) { + try { + return (new XMLSerializer()).serializeToString(xmlNode); + } + catch (e) { + try { + return xmlNode.xml; + } + catch (e) { + return false; + } + } + + }, + on_expand: function(expand_img){ + var level = parseInt($(expand_img).closest("tr[id^='viewedit-']").attr('level')); + var cur_tr = $(expand_img).closest("tr[id^='viewedit-']"); + while (1) { + var nxt_tr = cur_tr.next(); + if (parseInt(nxt_tr.attr('level')) > level){ + cur_tr = nxt_tr; + nxt_tr.hide(); + } else return nxt_tr; + } + }, + on_collapse: function(collapse_img, parent_child_id, id, main_object) { + var self = this; + var id = collapse_img.id.split('-')[1]; + var datas = _.detect(parent_child_id,function(res) { + return res.key == id; + }); + _.each(datas.value, function(rec) { + var tr = self.edit_xml_dialog.$element.find("tr[id='viewedit-"+rec+"']"); + tr.find("img[id='parentimg-"+rec+"']").attr('src','/web/static/src/img/expand.gif'); + tr.show(); + }); + } + +}); +}; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 2946df7166c..603e2abb008 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -10,6 +10,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# * view should be displayed (if there is one active). */ searchable: false, + readonly : false, form_template: "FormView", identifier_prefix: 'formview-', /** @@ -37,7 +38,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.dirty_for_user = false; this.default_focus_field = null; this.default_focus_button = null; - this.registry = openerp.web.form.widgets; + this.registry = this.readonly ? openerp.web.form.readonly : openerp.web.form.widgets; this.has_been_loaded = $.Deferred(); this.$form_header = null; this.translatable_fields = []; @@ -89,7 +90,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.fields_view = data; var frame = new (this.registry.get_object('frame'))(this, this.fields_view.arch); - this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'view': this }); + this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'widget': this }); } this.$element.html(this.rendered); _.each(this.widgets, function(w) { @@ -101,21 +102,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# self.on_pager_action(action); }); - this.$form_header.find('button.oe_form_button_save').click(this.do_save); - this.$form_header.find('button.oe_form_button_cancel').click(this.do_cancel); + this.$form_header.find('button.oe_form_button_save').click(this.do_save_then_readonly); this.$form_header.find('button.oe_form_button_new').click(this.on_button_new); this.$form_header.find('button.oe_form_button_duplicate').click(this.on_button_duplicate); - this.$form_header.find('button.oe_form_button_toggle').click(function () { - self.translatable_fields = []; - self.widgets = {}; - self.fields = {}; - self.$form_header.find('button').unbind('click'); - self.registry = self.registry === openerp.web.form.widgets - ? openerp.web.form.readonly - : openerp.web.form.widgets; - self.on_loaded(self.fields_view); - self.reload(); - }); + this.$form_header.find('button.oe_form_button_delete').click(this.on_button_delete); + this.$form_header.find('button.oe_form_button_toggle').click(this.on_toggle_readonly); if (this.options.sidebar && this.options.sidebar_id) { this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id); @@ -127,6 +118,23 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# } this.has_been_loaded.resolve(); }, + on_toggle_readonly: function() { + var self = this; + self.translatable_fields = []; + self.widgets = {}; + self.fields = {}; + self.$form_header.find('button').unbind('click'); + self.readonly = !self.readonly; + self.registry = self.readonly ? openerp.web.form.readonly : openerp.web.form.widgets; + self.on_loaded(self.fields_view); + return self.reload(); + }, + do_set_readonly: function() { + return this.readonly ? $.Deferred().resolve() : this.on_toggle_readonly(); + }, + do_set_editable: function() { + return !this.readonly ? $.Deferred().resolve() : this.on_toggle_readonly(); + }, do_show: function () { var promise; if (this.dataset.index === null) { @@ -162,6 +170,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.$form_header.find('.oe_form_on_update').show(); this.$form_header.find('button.oe_form_button_new').show(); } + this.$form_header.find('.oe_form_on_readonly').toggle(this.readonly); + this.$form_header.find('.oe_form_on_editable').toggle(!this.readonly); this.dirty_for_user = false; this.datarecord = record; for (var f in this.fields) { @@ -342,14 +352,16 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# $.when(this.has_been_loaded).then(function() { if (self.can_be_discarded()) { var keys = _.keys(self.fields_view.fields); - if (keys.length) { - self.dataset.default_get(keys).then(self.on_record_loaded).then(function() { + $.when(self.do_set_editable()).then(function() { + if (keys.length) { + self.dataset.default_get(keys).then(self.on_record_loaded).then(function() { + def.resolve(); + }); + } else { + self.on_record_loaded({}); def.resolve(); - }); - } else { - self.on_record_loaded({}); - def.resolve(); - } + } + }); } }); return def.promise(); @@ -361,7 +373,20 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# if (self.can_be_discarded()) { self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) { return self.on_created({ result : new_id }); - }).then(function() { + }).then(self.do_set_editable).then(function() { + def.resolve(); + }); + } + }); + return def.promise(); + }, + on_button_delete: function() { + var self = this; + var def = $.Deferred(); + $.when(this.has_been_loaded).then(function() { + if (self.can_be_discarded() && self.datarecord.id) { + self.dataset.unlink([self.datarecord.id]).then(function() { + self.on_pager_action('next'); def.resolve(); }); } @@ -379,6 +404,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# * @param {Function} success callback on save success * @param {Boolean} [prepend_on_create=false] if ``do_save`` creates a new record, should that record be inserted at the start of the dataset (by default, records are added at the end) */ + do_save_then_readonly: function(success, prepend_on_create) { + return this.do_save(success, prepend_on_create).then(this.do_set_readonly); + }, do_save: function(success, prepend_on_create) { var self = this; var action = function() { @@ -426,10 +454,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.mutating_lock = this.mutating_lock.pipe(action, action); return this.mutating_lock; }, - switch_readonly: function() { - }, - switch_editable: function() { - }, on_invalid: function() { var msg = "
      "; _.each(this.fields, function(f) { @@ -487,9 +511,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# on_action: function (action) { console.debug('Executing action', action); }, - do_cancel: function () { - console.debug("Cancelling form"); - }, reload: function() { var self = this; var act = function() { @@ -715,6 +736,16 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form. this.invisible = this.modifiers['invisible'] === true; this.classname = 'oe_form_' + this.type; + this.align = parseFloat(this.node.attrs.align); + if (isNaN(this.align) || this.align === 1) { + this.align = 'right'; + } else if (this.align === 0) { + this.align = 'left'; + } else { + this.align = 'center'; + } + + this.width = this.node.attrs.width; }, start: function() { @@ -1044,8 +1075,7 @@ openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({ this._super(view, node); - // TODO fme: support for attrs.align - if (this.node.tag == 'label' && (this.node.attrs.colspan || (this.string && this.string.length > 32))) { + if (this.node.tag == 'label' && (this.align === 'left' || this.node.attrs.colspan || (this.string && this.string.length > 32))) { this.template = "WidgetParagraph"; this.colspan = parseInt(this.node.attrs.colspan || 1, 10); } else { @@ -1170,6 +1200,10 @@ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.f openerp.web.form.FieldChar = openerp.web.form.Field.extend({ template: 'FieldChar', + init: function (view, node) { + this._super(view, node); + this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1'; + }, start: function() { this._super.apply(this, arguments); this.$element.find('input').change(this.on_ui_change); @@ -1419,11 +1453,7 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({ start: function() { var self = this; this._super.apply(this, arguments); - this.$element.find('input').click(function() { - if ($(this).is(':checked') != self.value) { - self.on_ui_change(); - } - }); + this.$element.find('input').click(self.on_ui_change); }, set_value: function(value) { this._super.apply(this, arguments); @@ -1632,6 +1662,11 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ } else { $("#" + self.cm_id + " .oe_m2o_menu_item_mandatory").addClass("oe-m2o-disabled-cm"); } + if (!self.readonly) { + $("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").removeClass("oe-m2o-disabled-cm"); + } else { + $("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").addClass("oe-m2o-disabled-cm"); + } return true; }, menuStyle: {width: "200px"} }); @@ -1651,6 +1686,8 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ } }); this.$drop_down.click(function() { + if (self.readonly) + return; if (self.$input.autocomplete("widget").is(":visible")) { self.$input.autocomplete("close"); } else { @@ -1811,7 +1848,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ self.original_value = undefined; self._change_int_ext_value(rval); }; - if(typeof(value) === "number") { + if (value && !(value instanceof Array)) { var dataset = new openerp.web.DataSetStatic(this, this.field.relation, self.build_context()); dataset.name_get([value], function(data) { real_set_value(data[0]); @@ -1857,6 +1894,10 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ }, focus: function () { this.$input.focus(); + }, + update_dom: function() { + this._super.apply(this, arguments); + this.$input.attr('disabled', this.readonly); } }); @@ -1910,7 +1951,8 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ multi_selection: false, init: function(view, node) { this._super(view, node); - this.is_started = $.Deferred(); + this.is_loaded = $.Deferred(); + this.initial_is_loaded = this.is_loaded; this.is_setted = $.Deferred(); this.form_last_update = $.Deferred(); this.init_form_last_update = this.form_last_update; @@ -1928,8 +1970,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ self.on_ui_change(); }); + this.is_setted.then(function() { + self.load_views(); + }); + }, + is_readonly: function() { + return this.readonly || this.force_readonly; + }, + load_views: function() { + var self = this; + var modes = this.node.attrs.mode; - modes = !!modes ? modes.split(",") : ["tree", "form"]; + modes = !!modes ? modes.split(",") : ["tree"]; var views = []; _.each(modes, function(mode) { var view = { @@ -1942,25 +1994,38 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ } if(view.view_type === "list") { view.options.selectable = self.multi_selection; + if (self.is_readonly()) { + view.options.addable = null; + view.options.deletable = null; + } } else if (view.view_type === "form") { view.options.not_interactible_on_create = true; } views.push(view); }); this.views = views; - + this.viewmanager = new openerp.web.ViewManager(this, this.dataset, views); this.viewmanager.registry = openerp.web.views.clone({ list: 'openerp.web.form.One2ManyListView', - form: 'openerp.web.form.One2ManyFormView' + form: 'openerp.web.FormView' }); var once = $.Deferred().then(function() { self.init_form_last_update.resolve(); }); + var def = $.Deferred().then(function() { + self.initial_is_loaded.resolve(); + }); this.viewmanager.on_controller_inited.add_last(function(view_type, controller) { if (view_type == "list") { controller.o2m = self; + if (self.is_readonly()) + controller.set_editable(false); } else if (view_type == "form") { + if (self.is_readonly()) { + controller.on_toggle_readonly(); + $(controller.$element.find(".oe_form_buttons")[0]).children().remove(); + } controller.on_record_loaded.add_last(function() { once.resolve(); }); @@ -1971,33 +2036,40 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ } else if (view_type == "graph") { self.reload_current_view() } - self.is_started.resolve(); + def.resolve(); }); - this.viewmanager.on_mode_switch.add_first(function() { - self.save_form_view(); + this.viewmanager.on_mode_switch.add_first(function(n_mode, b, c, d, e) { + $.when(self.save_form_view()).then(function() { + if(n_mode === "list") + setTimeout(function() {self.reload_current_view();}, 0); + }); }); this.is_setted.then(function() { setTimeout(function () { self.viewmanager.appendTo(self.$element); }, 0); }); + return def; }, reload_current_view: function() { var self = this; - var view = self.viewmanager.views[self.viewmanager.active_view].controller; - if(self.viewmanager.active_view === "list") { - view.reload_content(); - } else if (self.viewmanager.active_view === "form") { - if (this.dataset.index === null && this.dataset.ids.length >= 1) { - this.dataset.index = 0; + self.is_loaded = self.is_loaded.pipe(function() { + var view = self.viewmanager.views[self.viewmanager.active_view].controller; + if(self.viewmanager.active_view === "list") { + return view.reload_content(); + } else if (self.viewmanager.active_view === "form") { + if (self.dataset.index === null && self.dataset.ids.length >= 1) { + self.dataset.index = 0; + } + var act = function() { + return view.do_show(); + } + self.form_last_update = self.form_last_update.pipe(act, act); + return self.form_last_update; + } else if (self.viewmanager.active_view === "graph") { + return view.do_search(self.build_domain(), self.dataset.get_context(), []); } - var act = function() { - return view.do_show(); - } - this.form_last_update = this.form_last_update.pipe(act, act);; - } else if (self.viewmanager.active_view === "graph") { - view.do_search(this.build_domain(), this.dataset.get_context(), []); - } + }); }, set_value: function(value) { value = value || []; @@ -2054,9 +2126,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ if (this.dataset.index === null && this.dataset.ids.length > 0) { this.dataset.index = 0; } - $.when(this.is_started).then(function() { - self.reload_current_view(); - }); + self.reload_current_view(); this.is_setted.resolve(); }, get_value: function() { @@ -2120,7 +2190,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.toggleClass('disabled', this.readonly); + var self = this; + if (this.previous_readonly !== this.readonly) { + this.previous_readonly = this.readonly; + if (this.viewmanager) { + this.is_loaded = this.is_loaded.pipe(function() { + self.viewmanager.stop(); + return $.when(self.load_views()).then(function() { + self.reload_current_view(); + }); + }); + } + } } }); @@ -2131,9 +2212,6 @@ openerp.web.form.One2ManyDataSet = openerp.web.BufferedDataSet.extend({ } }); -openerp.web.form.One2ManyFormView = openerp.web.FormView.extend({ -}); - openerp.web.form.One2ManyListView = openerp.web.ListView.extend({ do_add_record: function () { if (this.options.editable) { @@ -2172,7 +2250,8 @@ openerp.web.form.One2ManyListView = openerp.web.ListView.extend({ read_function: function() { return self.o2m.dataset.read_ids.apply(self.o2m.dataset, arguments); }, - form_view_options: {'not_interactible_on_create':true} + form_view_options: {'not_interactible_on_create':true}, + readonly: self.o2m.is_readonly() }); pop.on_write.add(function(id, data) { self.o2m.dataset.write(id, data, {}, function(r) { @@ -2188,7 +2267,9 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({ init: function(view, node) { this._super(view, node); this.list_id = _.uniqueId("many2many"); - this.is_started = $.Deferred(); + this.is_loaded = $.Deferred(); + this.initial_is_loaded = this.is_loaded; + this.is_setted = $.Deferred(); }, start: function() { this._super.apply(this, arguments); @@ -2200,18 +2281,10 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({ this.dataset.on_unlink.add_last(function(ids) { self.on_ui_change(); }); - - this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, { - 'addable': 'Add', - 'selectable': self.multi_selection - }); - this.list_view.m2m_field = this; - this.list_view.on_loaded.add_last(function() { - self.is_started.resolve(); + + this.is_setted.then(function() { + self.load_view(); }); - setTimeout(function () { - self.list_view.appendTo($("#" + self.list_id)); - }, 0); }, set_value: function(value) { value = value || []; @@ -2221,16 +2294,56 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({ this._super(value); this.dataset.set_ids(value); var self = this; - $.when(this.is_started).then(function() { - self.list_view.reload_content(); - }); + self.reload_content(); + this.is_setted.resolve(); }, get_value: function() { return [commands.replace_with(this.dataset.ids)]; }, validate: function() { this.invalid = false; - // TODO niv + }, + is_readonly: function() { + return this.readonly || this.force_readonly; + }, + load_view: function() { + var self = this; + this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, { + 'addable': self.is_readonly() ? null : 'Add', + 'deletable': self.is_readonly() ? false : true, + 'selectable': self.multi_selection + }); + this.list_view.m2m_field = this; + var loaded = $.Deferred(); + this.list_view.on_loaded.add_last(function() { + self.initial_is_loaded.resolve(); + loaded.resolve(); + }); + setTimeout(function () { + self.list_view.appendTo($("#" + self.list_id)); + }, 0); + return loaded; + }, + reload_content: function() { + var self = this; + this.is_loaded = this.is_loaded.pipe(function() { + return self.list_view.reload_content(); + }); + }, + update_dom: function() { + this._super.apply(this, arguments); + var self = this; + if (this.previous_readonly !== this.readonly) { + this.previous_readonly = this.readonly; + if (this.list_view) { + this.is_loaded = this.is_loaded.pipe(function() { + self.list_view.stop(); + return $.when(self.load_view()).then(function() { + self.reload_content(); + }); + }); + } + } } }); @@ -2334,10 +2447,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope this.searchview.stop(); } this.searchview = new openerp.web.SearchView(this, - this.dataset, false, { - "selectable": !this.options.disable_multiple_selection, - "deletable": false - }); + this.dataset, false, {}); this.searchview.on_search.add(function(domains, contexts, groupbys) { if (self.initial_ids) { self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]), @@ -2364,7 +2474,9 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope }); self.view_list = new openerp.web.form.SelectCreateListView(self, self.dataset, false, - _.extend({'deletable': false}, self.options.list_view_options || {})); + _.extend({'deletable': false, + 'selectable': !self.options.disable_multiple_selection + }, self.options.list_view_options || {})); self.view_list.popup = self; self.view_list.appendTo($("#" + self.element_id + "_view_list")).pipe(function() { self.view_list.do_show(); @@ -2483,6 +2595,7 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp * - read_function * - parent_view * - form_view_options + * - readonly */ show_element: function(model, row_id, context, options) { this.model = model; @@ -2522,7 +2635,13 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp this.view_form.set_embedded_view(this.options.alternative_form_view); } this.view_form.appendTo(this.$element.find("#" + this.element_id + "_view_form")); + var once = $.Deferred().then(function() { + if (self.options.readonly) { + self.view_form.on_toggle_readonly(); + } + }); this.view_form.on_loaded.add_last(function() { + once.resolve(); var $buttons = self.view_form.$element.find(".oe_form_buttons"); $buttons.html(QWeb.render("FormOpenPopup.form.buttons")); var $nbutton = $buttons.find(".oe_formopenpopup-form-save"); @@ -2535,6 +2654,10 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp $cbutton.click(function() { self.stop(); }); + if (self.options.readonly) { + $nbutton.hide(); + $cbutton.text(_t("Close")); + } self.view_form.do_show(); }); this.dataset.on_write.add(this.on_write); @@ -2817,17 +2940,21 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ } }); -openerp.web.form.WidgetNotebookReadonly = openerp.web.form.WidgetNotebook.extend({ - template: 'WidgetNotebook.readonly' -}); openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({ }); openerp.web.form.FieldCharReadonly = openerp.web.form.FieldReadonly.extend({ template: 'FieldChar.readonly', + init: function(view, node) { + this._super(view, node); + this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1'; + }, set_value: function (value) { this._super.apply(this, arguments); var show_value = openerp.web.format_value(value, this, ''); + if (this.password) { + show_value = new Array(show_value.length + 1).join('*'); + } this.$element.find('div').text(show_value); return show_value; } @@ -2855,7 +2982,7 @@ openerp.web.form.FieldUrlReadonly = openerp.web.form.FieldURIReadonly.extend({ }); openerp.web.form.FieldBooleanReadonly = openerp.web.form.FieldCharReadonly.extend({ set_value: function (value) { - this._super(value ? '\u2714' : '\u2718'); + this._super(value ? '\u2611' : '\u2610'); } }); openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend({ @@ -2890,9 +3017,17 @@ openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.exte self.update_dom(); self.on_value_changed(); var real_set_value = function(rval) { - self.$element.find('div').text(rval ? rval[1] : ''); + self.value = rval; + var div = $(self.$element.find('div')); + div.html(''); + var a = $(div.find("a")); + a.text(rval ? rval[1] : ''); + a.click(function() { + var pop = new openerp.web.form.FormOpenPopup(self.view); + pop.show_element(self.field.relation, self.value[0],self.build_context(), {readonly:true}); + }); }; - if(typeof(value) === "number") { + if (value && !(value instanceof Array)) { var dataset = new openerp.web.DataSetStatic( this, this.field.relation, self.build_context()); dataset.name_get([value], function(data) { @@ -2937,8 +3072,14 @@ openerp.web.form.widgets = new openerp.web.Registry({ 'binary': 'openerp.web.form.FieldBinaryFile', 'statusbar': 'openerp.web.form.FieldStatus' }); + +openerp.web.form.FieldMany2ManyReadonly = openerp.web.form.FieldMany2Many.extend({ + force_readonly: true +}); +openerp.web.form.FieldOne2ManyReadonly = openerp.web.form.FieldOne2Many.extend({ + force_readonly: true +}); openerp.web.form.readonly = openerp.web.form.widgets.clone({ - 'notebook': 'openerp.web.form.WidgetNotebookReadonly', 'char': 'openerp.web.form.FieldCharReadonly', 'email': 'openerp.web.form.FieldEmailReadonly', 'url': 'openerp.web.form.FieldUrlReadonly', @@ -2948,6 +3089,9 @@ openerp.web.form.readonly = openerp.web.form.widgets.clone({ 'datetime': 'openerp.web.form.FieldCharReadonly', 'selection' : 'openerp.web.form.FieldSelectionReadonly', 'many2one': 'openerp.web.form.FieldMany2OneReadonly', + 'many2many' : 'openerp.web.form.FieldMany2ManyReadonly', + 'one2many' : 'openerp.web.form.FieldOne2ManyReadonly', + 'one2many_list' : 'openerp.web.form.FieldOne2ManyReadonly', 'boolean': 'openerp.web.form.FieldBooleanReadonly', 'float': 'openerp.web.form.FieldCharReadonly', 'integer': 'openerp.web.form.FieldCharReadonly', diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index d09ec1d3035..e891a6c7db7 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -11,7 +11,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# // whether the column headers should be displayed 'header': true, // display addition button, with that label - 'addable': _t("New"), + 'addable': _t("Create"), // whether the list view can be sorted, note that once a view has been // sorted it can not be reordered anymore 'sortable': true, @@ -201,8 +201,15 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this.setup_columns(this.fields_view.fields, grouped); this.$element.html(QWeb.render("ListView", this)); - // Head hook + this.$element.find('.all-record-selector').click(function(){ + self.$element.find('.oe-record-selector input').prop('checked', + self.$element.find('.all-record-selector').prop('checked') || false); + var selection = self.groups.get_selection(); + $(self.groups).trigger( + 'selected', [selection.ids, selection.records]); + }); + this.$element.find('.oe-list-add') .click(this.do_add_record) .attr('disabled', grouped && this.options.editable); @@ -424,10 +431,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# }, /** * re-renders the content of the list view + * + * @returns {$.Deferred} promise to content reloading */ reload_content: function () { var self = this; this.records.reset(); + var reloaded = $.Deferred(); this.$element.find('.oe-listview-content').append( this.groups.render(function () { if (self.dataset.index == null) { @@ -438,7 +448,9 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# } } self.compute_aggregates(); + reloaded.resolve(); })); + return reloaded.promise(); }, /** * Handler for the result of eval_domain_and_context, actually perform the @@ -512,6 +524,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# return field.name === name; }); if (!action) { return; } + + var c = new openerp.web.CompoundContext(); + c.set_eval_context(_.extend({ + active_id: id, + active_ids: [id], + active_model: this.dataset.model + }, this.records.get(id).toContext())); + if (action.context) { + c.add(action.context); + } + action.context = c; this.do_execute_action(action, this.dataset, id, callback); }, /** @@ -1201,6 +1224,10 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L var options = { offset: page * limit, limit: limit }; //TODO xmo: investigate why we need to put the setTimeout setTimeout(function() {dataset.read_slice(fields, options , function (records) { + // FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently + if (self.records.length) { + self.records.reset(null, {silent: true}); + } if (!self.datagroup.openable) { view.configure_pager(dataset); } else { @@ -1430,6 +1457,25 @@ var Record = openerp.web.Class.extend(/** @lends Record# */{ } return {data: form_data}; + }, + /** + * Converts the current record to a format expected by context evaluations + * (identical to record.attributes, except m2o fields are their integer + * value rather than a pair) + */ + toContext: function () { + var output = {}, attrs = this.attributes; + for(var k in attrs) { + var val = attrs[k]; + if (typeof val !== 'object') { + output[k] = val; + } else if (val instanceof Array) { + output[k] = val[0]; + } else { + throw new Error("Can't convert value " + val + " to context"); + } + } + return output; } }); Record.include(Events); @@ -1541,7 +1587,8 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{ * @param {Array} [records] * @returns this */ - reset: function (records) { + reset: function (records, options) { + options = options || {}; _(this._proxies).each(function (proxy) { proxy.reset(); }); @@ -1552,7 +1599,9 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{ if (records) { this.add(records); } - this.trigger('reset', this); + if (!options.silent) { + this.trigger('reset', this); + } return this; }, /** diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 4cc081a6266..dba0a1abba4 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -78,6 +78,17 @@ openerp.web.list_editable = function (openerp) { // tree/@editable takes priority on everything else if present. this.options.editable = data.arch.attrs.editable || this.options.editable; return this._super(data, grouped); + }, + /** + * Ensures the editable list is saved (saves any pending edition if + * needed, or tries to) + * + * Returns a deferred to the end of the saving. + * + * @returns {$.Deferred} + */ + ensure_saved: function () { + return this.groups.ensure_saved(); } }); @@ -86,6 +97,18 @@ openerp.web.list_editable = function (openerp) { new_record: function () { // TODO: handle multiple children this.children[null].new_record(); + }, + /** + * Ensures descendant editable List instances are all saved if they have + * pending editions. + * + * @returns {$.Deferred} + */ + ensure_saved: function () { + return $.when.apply(null, + _.invoke( + _.values(this.children), + 'ensure_saved')); } }); @@ -254,9 +277,11 @@ openerp.web.list_editable = function (openerp) { * sibling if asked. * * @param {Boolean} [edit_next=false] should the next row become editable + * @returns {$.Deferred} */ save_row: function (edit_next) { - var self = this; + //noinspection JSPotentiallyInvalidConstructorUsage + var self = this, done = $.Deferred(); this.edition_form.do_save(function (result) { if (result.created && !self.edition_id) { self.records.add({id: result.result}, @@ -267,28 +292,44 @@ openerp.web.list_editable = function (openerp) { next_record = self.records.at( self.records.indexOf(edited_record) + 1); - self.handle_onwrite(self.edition_id); - self.cancel_pending_edition().then(function () { - $(self).trigger('saved', [self.dataset]); - if (!edit_next) { - return; - } - if (result.created) { - self.new_record(); - return; - } - var next_record_id; - if (next_record) { - next_record_id = next_record.get('id'); - self.dataset.index = _(self.dataset.ids) - .indexOf(next_record_id); - } else { - self.dataset.index = 0; - next_record_id = self.records.at(0).get('id'); - } - self.edit_record(next_record_id); - }); - }, this.options.editable === 'top'); + $.when( + self.handle_onwrite(self.edition_id), + self.cancel_pending_edition().then(function () { + $(self).trigger('saved', [self.dataset]); + if (!edit_next) { + return; + } + if (result.created) { + self.new_record(); + return; + } + var next_record_id; + if (next_record) { + next_record_id = next_record.get('id'); + self.dataset.index = _(self.dataset.ids) + .indexOf(next_record_id); + } else { + self.dataset.index = 0; + next_record_id = self.records.at(0).get('id'); + } + self.edit_record(next_record_id); + })).then(function () { + done.resolve(); + }); + }, this.options.editable === 'top').fail(function () { + done.reject(); + }); + return done.promise(); + }, + /** + * If the current list is being edited, ensures it's saved + */ + ensure_saved: function () { + if (this.edition) { + return this.save_row(); + } + //noinspection JSPotentiallyInvalidConstructorUsage + return $.Deferred().resolve().promise(); }, /** * Cancels the edition of the row for the current dataset index diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f402a51bf7e..62928401492 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -2,21 +2,21 @@ * OpenERP web library *---------------------------------------------------------*/ -openerp.web.views = function(db) { +openerp.web.views = function(session) { -var _t = db.web._t; +var _t = session.web._t; /** * Registry for all the client actions key: tag value: widget */ -db.web.client_actions = new db.web.Registry(); +session.web.client_actions = new session.web.Registry(); /** * Registry for all the main views */ -db.web.views = new db.web.Registry(); +session.web.views = new session.web.Registry(); -db.web.ActionManager = db.web.Widget.extend({ +session.web.ActionManager = session.web.Widget.extend({ identifier_prefix: "actionmanager", init: function(parent) { this._super(parent); @@ -93,20 +93,20 @@ db.web.ActionManager = db.web.Widget.extend({ ir_actions_act_window: function (action, on_close) { if (action.target === 'new') { if (this.dialog == null) { - this.dialog = new db.web.Dialog(this, { title: action.name, width: '80%' }); + this.dialog = new session.web.Dialog(this, { title: action.name, width: '80%' }); if(on_close) this.dialog.on_close.add(on_close); this.dialog.start(); } else { this.dialog_viewmanager.stop(); } - this.dialog_viewmanager = new db.web.ViewManagerAction(this, action); + this.dialog_viewmanager = new session.web.ViewManagerAction(this, action); this.dialog_viewmanager.appendTo(this.dialog.$element); this.dialog.open(); } else { this.dialog_stop(); this.content_stop(); - this.inner_viewmanager = new db.web.ViewManagerAction(this, action); + this.inner_viewmanager = new session.web.ViewManagerAction(this, action); this.inner_viewmanager.appendTo(this.$element); this.url_update(action); } @@ -124,7 +124,7 @@ db.web.ActionManager = db.web.Widget.extend({ if (this.dialog && action.context) { var model = action.context.active_model; if (model === 'base.module.upgrade' || model === 'base.setup.installer' || model === 'base.module.upgrade') { - db.webclient.do_reload(); + session.webclient.do_reload(); } } this.dialog_stop(); @@ -140,7 +140,7 @@ db.web.ActionManager = db.web.Widget.extend({ }, ir_actions_client: function (action) { this.content_stop(); - var ClientWidget = db.web.client_actions.get_object(action.tag); + var ClientWidget = session.web.client_actions.get_object(action.tag); (this.client_widget = new ClientWidget(this, action.params)).appendTo(this); }, ir_actions_report_xml: function(action) { @@ -164,12 +164,12 @@ db.web.ActionManager = db.web.Widget.extend({ } }); -db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ +session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.ViewManager# */{ identifier_prefix: "viewmanager", template: "ViewManager", /** - * @constructs db.web.ViewManager - * @extends db.web.Widget + * @constructs session.web.ViewManager + * @extends session.web.Widget * * @param parent * @param dataset @@ -185,10 +185,10 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ this.views_src = _.map(views, function(x) {return x instanceof Array? {view_id: x[0], view_type: x[1]} : x;}); this.views = {}; this.flags = this.flags || {}; - this.registry = db.web.views; + this.registry = session.web.views; }, render: function() { - return db.web.qweb.render(this.template, { + return session.web.qweb.render(this.template, { self: this, prefix: this.element_id, views: this.views_src}); @@ -271,6 +271,10 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ } } } + $.when(view_promise).then(function () { + self.$element.find('.oe_view_title:first').text( + self.display_title()); + }); return view_promise; }, /** @@ -284,7 +288,7 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ if (this.searchview) { this.searchview.stop(); } - this.searchview = new db.web.SearchView( + this.searchview = new session.web.SearchView( this, this.dataset, view_id, search_defaults, this.flags.search_view === false); @@ -331,16 +335,24 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ /** * Called by children view after executing an action */ - on_action_executed: function () {} + on_action_executed: function () {}, + display_title: function () { + var view = this.views[this.active_view]; + if (view) { + // ick + return view.controller.fields_view.arch.attrs.string; + } + return ''; + } }); -db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{ +session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{ template:"ViewManagerAction", /** - * @constructs db.web.ViewManagerAction - * @extends db.web.ViewManager + * @constructs session.web.ViewManagerAction + * @extends session.web.ViewManager * - * @param {db.web.ActionManager} parent parent object/widget + * @param {session.web.ActionManager} parent parent object/widget * @param {Object} action descriptor for the action this viewmanager needs to manage its views. */ init: function(parent, action) { @@ -350,7 +362,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View this._super(parent, null, action.views); this.session = parent.session; this.action = action; - var dataset = new db.web.DataSetSearch(this, action.res_model, action.context, action.domain); + var dataset = new session.web.DataSetSearch(this, action.res_model, action.context, action.domain); if (action.res_id) { dataset.ids.push(action.res_id); dataset.index = 0; @@ -400,12 +412,12 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View this.$element.find('.oe_get_xml_view').click(function () { // TODO: add search view? - $('
      ').text(db.web.json_node_to_xml(
      +            $('
      ').text(session.web.json_node_to_xml(
                       self.views[self.active_view].controller.fields_view.arch, true))
                           .dialog({ width: '95%'});
               });
               if (this.action.help && !this.flags.low_profile) {
      -            var Users = new db.web.DataSet(self, 'res.users'),
      +            var Users = new session.web.DataSet(self, 'res.users'),
                       header = this.$element.find('.oe-view-manager-header');
                   header.delegate('blockquote button', 'click', function() {
                       var $this = $(this);
      @@ -444,6 +456,16 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
                       if (!self.action.name && fvg) {
                           self.$element.find('.oe_view_title').text(fvg.arch.attrs.string || fvg.name);
                       }
      +
      +                var $title = self.$element.find('.oe_view_title'),
      +                    $search_prefix = $title.find('span');
      +                if (controller.searchable !== false) {
      +                    if (!$search_prefix.length) {
      +                        $title.prepend('' + _t("Search:") + '');
      +                    }
      +                } else {
      +                    $search_prefix.remove();
      +                }
               });
           },
           shortcut_check : function(view) {
      @@ -451,7 +473,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
               var grandparent = this.widget_parent && this.widget_parent.widget_parent;
               // display shortcuts if on the first view for the action
               var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
      -        if (!(grandparent instanceof db.web.WebClient) ||
      +        if (!(grandparent instanceof session.web.WebClient) ||
                   !(view.view_type === this.views_src[0].view_type
                       && view.view_id === this.views_src[0].view_id)) {
                   $shortcut_toggle.hide();
      @@ -488,7 +510,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
            * Intercept do_action resolution from children views
            */
           on_action_executed: function () {
      -        return new db.web.DataSet(this, 'res.log')
      +        return new session.web.DataSet(this, 'res.log')
                       .call('get', [], this.do_display_log);
           },
           /**
      @@ -512,10 +534,13 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
                           return false;
                       });
               });
      +    },
      +    display_title: function () {
      +        return this.action.name;
           }
       });
       
      -db.web.Sidebar = db.web.Widget.extend({
      +session.web.Sidebar = session.web.Widget.extend({
           init: function(parent, element_id) {
               this._super(parent, element_id);
               this.items = {};
      @@ -524,7 +549,7 @@ db.web.Sidebar = db.web.Widget.extend({
           start: function() {
               this._super(this);
               var self = this;
      -        this.$element.html(db.web.qweb.render('Sidebar'));
      +        this.$element.html(session.web.qweb.render('Sidebar'));
               this.$element.find(".toggle-sidebar").click(function(e) {
                   self.do_toggle();
               });
      @@ -544,7 +569,7 @@ db.web.Sidebar = db.web.Widget.extend({
                   {
                       label: _t("Manage Views"),
                       callback: this.call_default_on_sidebar,
      -                title: _t("Manage views of the current object"),
      +                title: _t("Manage views of the current object")
                   }, {
                       label: _t("Edit Workflow"),
                       callback: this.call_default_on_sidebar,
      @@ -553,7 +578,7 @@ db.web.Sidebar = db.web.Widget.extend({
                   }, {
                       label: _t("Customize Object"),
                       callback: this.call_default_on_sidebar,
      -                title: _t("Manage views of the current object"),
      +                title: _t("Manage views of the current object")
                   }
               ]);
       
      @@ -561,10 +586,10 @@ db.web.Sidebar = db.web.Widget.extend({
               this.add_items('other', [ 
                   {
                       label: _t("Import"),
      -                callback: this.call_default_on_sidebar,
      +                callback: this.call_default_on_sidebar
                   }, {
                       label: _t("Export"),
      -                callback: this.call_default_on_sidebar,
      +                callback: this.call_default_on_sidebar
                   }, {
                       label: _t("Translate"),
                       callback: this.call_default_on_sidebar,
      @@ -601,10 +626,10 @@ db.web.Sidebar = db.web.Widget.extend({
       
               if(!$section) {
                   section_id = _.uniqueId(this.element_id + '_section_' + code + '_');
      -            var $section = $(db.web.qweb.render("Sidebar.section", {
      +            var $section = $(session.web.qweb.render("Sidebar.section", {
                       section_id: section_id,
                       name: name,
      -                classname: 'oe_sidebar_' + code,
      +                classname: 'oe_sidebar_' + code
                   }));
                   $section.appendTo(this.$element.find('div.sidebar-actions'));
                   this.sections[code] = $section;
      @@ -633,7 +658,7 @@ db.web.Sidebar = db.web.Widget.extend({
                       this.items[items[i].element_id] = items[i];
                   }
       
      -            var $items = $(db.web.qweb.render("Sidebar.section.items", {items: items}));
      +            var $items = $(session.web.qweb.render("Sidebar.section.items", {items: items}));
       
                   $items.find('a.oe_sidebar_action_a').click(function() {
                       var item = self.items[$(this).attr('id')];
      @@ -687,7 +712,7 @@ db.web.Sidebar = db.web.Widget.extend({
           }
       });
       
      -db.web.TranslateDialog = db.web.Dialog.extend({
      +session.web.TranslateDialog = session.web.Dialog.extend({
           dialog_title: _t("Translations"),
           init: function(view) {
               // TODO fme: should add the language to fields_view_get because between the fields view get
      @@ -707,14 +732,14 @@ db.web.TranslateDialog = db.web.Dialog.extend({
               this.translatable_fields_keys = _.map(this.view.translatable_fields || [], function(i) { return i.name });
               this.languages = null;
               this.languages_loaded = $.Deferred();
      -        (new db.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(),
      +        (new session.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(),
                   [['translatable', '=', '1']])).read_slice(['code', 'name'], { sort: 'id' }, this.on_languages_loaded);
           },
           start: function() {
               var self = this;
               this._super();
               $.when(this.languages_loaded).then(function() {
      -            self.$element.html(db.web.qweb.render('TranslateDialog', { widget: self }));
      +            self.$element.html(session.web.qweb.render('TranslateDialog', { widget: self }));
                   self.$element.tabs();
                   if (!(self.view.translatable_fields && self.view.translatable_fields.length)) {
                       self.hide_tabs('fields');
      @@ -819,7 +844,7 @@ db.web.TranslateDialog = db.web.Dialog.extend({
           }
       });
       
      -db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
      +session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
           template: "EmptyComponent",
           set_default_options: function(options) {
               this.options = options || {};
      @@ -833,7 +858,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
           },
           open_translate_dialog: function(field) {
               if (!this.translate_dialog) {
      -            this.translate_dialog = new db.web.TranslateDialog(this).start();
      +            this.translate_dialog = new session.web.TranslateDialog(this).start();
               }
               this.translate_dialog.open(field);
           },
      @@ -845,7 +870,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
            * @param {String} [action_data.special=null] special action handlers (currently: only ``'cancel'``)
            * @param {String} [action_data.type='workflow'] the action type, if present, one of ``'object'``, ``'action'`` or ``'workflow'``
            * @param {Object} [action_data.context=null] additional action context, to add to the current context
      -     * @param {db.web.DataSet} dataset a dataset object used to communicate with the server
      +     * @param {session.web.DataSet} dataset a dataset object used to communicate with the server
            * @param {Object} [record_id] the identifier of the object on which the action is to be applied
            * @param {Function} on_closed callback to execute when dialog is closed or when the action does not generate any result (no new action)
            */
      @@ -857,12 +882,12 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
                       return self.widget_parent.on_action_executed.apply(null, arguments);
                   }
               };
      -        var context = new db.web.CompoundContext(dataset.get_context(), action_data.context || {});
      +        var context = new session.web.CompoundContext(dataset.get_context(), action_data.context || {});
               
               var handler = function (r) {
                   var action = r.result;
                   if (action && action.constructor == Object) {
      -                var ncontext = new db.web.CompoundContext(context);
      +                var ncontext = new session.web.CompoundContext(context);
                       if (record_id) {
                           ncontext.add({
                               active_id: record_id,
      @@ -899,7 +924,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
           /**
            * Directly set a view to use instead of calling fields_view_get. This method must
            * be called before start(). When an embedded view is set, underlying implementations
      -     * of db.web.View must use the provided view instead of any other one.
      +     * of session.web.View must use the provided view instead of any other one.
            *
            * @param embedded_view A view.
            */
      @@ -917,7 +942,8 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
           },
           on_sidebar_manage_views: function() {
               if (this.fields_view && this.fields_view.arch) {
      -            $('' + db.web.json_node_to_xml(this.fields_view.arch, true) + '').dialog({ width: '95%', height: 600});
      +            var view_editor = new session.web.ViewEditor(this, this.$element, this.dataset, this.fields_view.arch);
      +            view_editor.start();
               } else {
                   this.do_warn("Manage Views", "Could not find current view declaration");
               }
      @@ -929,11 +955,11 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
               console.log('Todo');
           },
           on_sidebar_import: function() {
      -        var import_view = new db.web.DataImport(this, this.dataset);
      +        var import_view = new session.web.DataImport(this, this.dataset);
               import_view.start();
           },
           on_sidebar_export: function() {
      -        var export_view = new db.web.DataExport(this, this.dataset);
      +        var export_view = new session.web.DataExport(this, this.dataset);
               export_view.start();
           },
           on_sidebar_translate: function() {
      @@ -943,19 +969,19 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
           }
       });
       
      -db.web.json_node_to_xml = function(node, single_quote, indent) {
      +session.web.json_node_to_xml = function(node, human_readable, indent) {
           // For debugging purpose, this function will convert a json node back to xml
           // Maybe usefull for xml view editor
      +    indent = indent || 0;
      +    var sindent = (human_readable ? (new Array(indent + 1).join('\t')) : ''),
      +        r = sindent + '<' + node.tag,
      +        cr = human_readable ? '\n' : '';
       
           if (typeof(node) === 'string') {
      -        return node;
      -    }
      -    else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
      +        return sindent + node;
      +    } else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
               throw("Node a json node");
           }
      -    indent = indent || 0;
      -    var sindent = new Array(indent + 1).join('\t'),
      -        r = sindent + '<' + node.tag;
           for (var attr in node.attrs) {
               var vattr = node.attrs[attr];
               if (typeof(vattr) !== 'string') {
      @@ -963,19 +989,19 @@ db.web.json_node_to_xml = function(node, single_quote, indent) {
                   vattr = JSON.stringify(vattr);
               }
               vattr = vattr.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
      -        if (single_quote) {
      +        if (human_readable) {
                   vattr = vattr.replace(/"/g, "'");
               }
               r += ' ' + attr + '="' + vattr + '"';
           }
           if (node.children && node.children.length) {
      -        r += '>\n';
      +        r += '>' + cr;
               var childs = [];
               for (var i = 0, ii = node.children.length; i < ii; i++) {
      -            childs.push(db.web.json_node_to_xml(node.children[i], single_quote, indent + 1));
      +            childs.push(session.web.json_node_to_xml(node.children[i], human_readable, indent + 1));
               }
      -        r += childs.join('\n');
      -        r += '\n' + sindent + '';
      +        r += childs.join(cr);
      +        r += cr + sindent + '';
               return r;
           } else {
               return r + '/>';
      diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
      index 7720ae2d38b..1fc98ba34ee 100644
      --- a/addons/web/static/src/xml/base.xml
      +++ b/addons/web/static/src/xml/base.xml
      @@ -415,6 +415,9 @@
           
               
                   
      +

      + +

      -

      - -

        @@ -473,8 +473,6 @@

        - -
      • @@ -551,6 +549,7 @@ + @@ -568,21 +567,7 @@ Delete - +
        - - - - - - - - -
        @@ -593,7 +578,8 @@ - + + @@ -612,8 +598,26 @@ + + + + + + + + + + + + + @@ -628,9 +632,18 @@ - - - + + + + + + + + + + + + +
        -
        - + - - - + + +
        -
        +
        @@ -740,12 +755,6 @@
        - - -

        - - -
        @@ -753,7 +762,7 @@ -

        +

        -
          -
        • Open...
        • -
        • Create...
        • -
        • Search...
        • +
        • Open...
        • +
        • Create...
        • +
        • Search...
        • @@ -1002,6 +1011,7 @@ +
          @@ -1271,6 +1281,55 @@ .unwrap(); + + + +
          +
          + + + + + + + +
          + + + +
          + + + + + + + + + + +
          + + + + + + + + + +
          + + + + + +
          Export @@ -1405,7 +1464,8 @@ Import - +

          1. Import a .CSV file

          Select a .CSV file to import. If you need a sample of file to import, @@ -1415,11 +1475,11 @@

          -

          2. Check your file format

          -
          -
          - Import Options - +

          2. Check your file format

          +
          +
          + Import Options +
          + + + + + +
          + +
          @@ -1449,22 +1509,24 @@ - - - - - - - - - - -
          -
          - -
          -
          + + + + + + + + + + + +
          +
          + + +
          +
          +

          The import failed due to:

          diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index 3c3c6b06e72..8fc5abed42e 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -39,6 +39,8 @@ $(document).ready(function () { '1.000000'); equal(openerp.web.format_value(1, {type: 'float'}), '1.00'); + equal(openerp.web.format_value(-11.25, {type: 'float'}), + "-11.25"); }); test("parse_datetime", function () { var val = openerp.web.str_to_datetime("2009-05-04 12:34:23"); diff --git a/addons/web_calendar/__openerp__.py b/addons/web_calendar/__openerp__.py index 1eba26065f5..5b09e70cba8 100644 --- a/addons/web_calendar/__openerp__.py +++ b/addons/web_calendar/__openerp__.py @@ -11,5 +11,8 @@ "css": ['static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css', 'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css' ], + 'qweb' : [ + "static/src/xml/*.xml", + ], 'active': True } diff --git a/addons/web_calendar/po/ar.po b/addons/web_calendar/po/ar.po new file mode 100644 index 00000000000..33e04220c2c --- /dev/null +++ b/addons/web_calendar/po/ar.po @@ -0,0 +1,22 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-11-03 15:02+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/po/da.po b/addons/web_calendar/po/da.po index a064b4cdc1f..68e2b21a673 100644 --- a/addons/web_calendar/po/da.po +++ b/addons/web_calendar/po/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/de.po b/addons/web_calendar/po/de.po index c0719196cb2..27e0168a44e 100644 --- a/addons/web_calendar/po/de.po +++ b/addons/web_calendar/po/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/es.po b/addons/web_calendar/po/es.po index 25e6c8c24d6..9e0c5f32f98 100644 --- a/addons/web_calendar/po/es.po +++ b/addons/web_calendar/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" -"X-Generator: Launchpad (build 14157)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/es_EC.po b/addons/web_calendar/po/es_EC.po index 2aea3aa063f..6b9cf2145dd 100644 --- a/addons/web_calendar/po/es_EC.po +++ b/addons/web_calendar/po/es_EC.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/et.po b/addons/web_calendar/po/et.po index f9086495da6..b08c52fbfc7 100644 --- a/addons/web_calendar/po/et.po +++ b/addons/web_calendar/po/et.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/fr.po b/addons/web_calendar/po/fr.po index 7679850c593..5f04d2d7182 100644 --- a/addons/web_calendar/po/fr.po +++ b/addons/web_calendar/po/fr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/gl.po b/addons/web_calendar/po/gl.po index 73ecf153937..7705a7cda2f 100644 --- a/addons/web_calendar/po/gl.po +++ b/addons/web_calendar/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/it.po b/addons/web_calendar/po/it.po index 29bbe86b507..5b98572ab45 100644 --- a/addons/web_calendar/po/it.po +++ b/addons/web_calendar/po/it.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/nl_BE.po b/addons/web_calendar/po/nl_BE.po index ecb2d565787..b071632ea47 100644 --- a/addons/web_calendar/po/nl_BE.po +++ b/addons/web_calendar/po/nl_BE.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/sk.po b/addons/web_calendar/po/sk.po index 168ca1d2adf..f879c6b13f1 100644 --- a/addons/web_calendar/po/sk.po +++ b/addons/web_calendar/po/sk.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/sl.po b/addons/web_calendar/po/sl.po index 40f8f43a756..80c32b8728b 100644 --- a/addons/web_calendar/po/sl.po +++ b/addons/web_calendar/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index a5fd8bcac9c..982fc60e1c4 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -5,7 +5,6 @@ openerp.web_calendar = function(openerp) { var _t = openerp.web._t; var QWeb = openerp.web.qweb; -QWeb.add_template('/web_calendar/static/src/xml/web_calendar.xml'); openerp.web.views.add('calendar', 'openerp.web_calendar.CalendarView'); openerp.web_calendar.CalendarView = openerp.web.View.extend({ // Dhtmlx scheduler ? diff --git a/addons/web_dashboard/__openerp__.py b/addons/web_dashboard/__openerp__.py index 7a527511b03..68c73731c71 100644 --- a/addons/web_dashboard/__openerp__.py +++ b/addons/web_dashboard/__openerp__.py @@ -7,5 +7,8 @@ 'static/src/js/dashboard.js' ], "css": ['static/src/css/dashboard.css'], + 'qweb' : [ + "static/src/xml/*.xml", + ], 'active': True } diff --git a/addons/web_dashboard/po/ar.po b/addons/web_dashboard/po/ar.po new file mode 100644 index 00000000000..0e2cf4dfcf2 --- /dev/null +++ b/addons/web_dashboard/po/ar.po @@ -0,0 +1,46 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-03 15:09+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "إستعادة" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "تراجع" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "أضف أداة" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "تغيير المخطط" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "اختر مخطط للعرض" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "التقدم:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "%" diff --git a/addons/web_dashboard/po/da.po b/addons/web_dashboard/po/da.po index 8df0abb1499..312ceaa7327 100644 --- a/addons/web_dashboard/po/da.po +++ b/addons/web_dashboard/po/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/de.po b/addons/web_dashboard/po/de.po index 6e2b8e003a3..1fecf9c9550 100644 --- a/addons/web_dashboard/po/de.po +++ b/addons/web_dashboard/po/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/es.po b/addons/web_dashboard/po/es.po index 8cd91812416..9686bc1b517 100644 --- a/addons/web_dashboard/po/es.po +++ b/addons/web_dashboard/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" -"X-Generator: Launchpad (build 14157)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/es_EC.po b/addons/web_dashboard/po/es_EC.po index 11cf8918d7f..24ae8287a6d 100644 --- a/addons/web_dashboard/po/es_EC.po +++ b/addons/web_dashboard/po/es_EC.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/et.po b/addons/web_dashboard/po/et.po index 381db624021..06fccba4842 100644 --- a/addons/web_dashboard/po/et.po +++ b/addons/web_dashboard/po/et.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/fr.po b/addons/web_dashboard/po/fr.po index b02d061cdd2..a8c0e7ba530 100644 --- a/addons/web_dashboard/po/fr.po +++ b/addons/web_dashboard/po/fr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/gl.po b/addons/web_dashboard/po/gl.po index b7a081aff6f..16edea4823f 100644 --- a/addons/web_dashboard/po/gl.po +++ b/addons/web_dashboard/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/it.po b/addons/web_dashboard/po/it.po index 2986cb8ccd0..90e98cd48bc 100644 --- a/addons/web_dashboard/po/it.po +++ b/addons/web_dashboard/po/it.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/nl_BE.po b/addons/web_dashboard/po/nl_BE.po index 40dcc0438a7..57a9fdadbf5 100644 --- a/addons/web_dashboard/po/nl_BE.po +++ b/addons/web_dashboard/po/nl_BE.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/pl.po b/addons/web_dashboard/po/pl.po new file mode 100644 index 00000000000..256945c9030 --- /dev/null +++ b/addons/web_dashboard/po/pl.po @@ -0,0 +1,46 @@ +# Polish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-04 16:28+0000\n" +"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "Przywróć" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "Cofnij" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "Dodaj kontrolkę" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "Zmień układ" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Wybierz układ konsoli" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "postęp:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "" diff --git a/addons/web_dashboard/po/sk.po b/addons/web_dashboard/po/sk.po index d2c2b2160a0..a9e11093ef1 100644 --- a/addons/web_dashboard/po/sk.po +++ b/addons/web_dashboard/po/sk.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/po/sl.po b/addons/web_dashboard/po/sl.po index 9eee401c427..01a5bf45deb 100644 --- a/addons/web_dashboard/po/sl.po +++ b/addons/web_dashboard/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 923b43ce034..e629a4a6ef5 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -1,6 +1,5 @@ openerp.web_dashboard = function(openerp) { var QWeb = openerp.web.qweb; -QWeb.add_template('/web_dashboard/static/src/xml/web_dashboard.xml'); if (!openerp.web_dashboard) { /** @namespace */ @@ -468,7 +467,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({ [['name', '=', module_name], ['state', '=', 'uninstalled']]); var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade'); - $.blockUI({message:''}); + $.blockUI(); Modules.read_slice(['id'], {}, function (records) { if (!(records.length === 1)) { $.unblockUI(); return; } Modules.call('state_update', diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index 87222baa5fd..77eab4b7e28 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -30,7 +30,7 @@
          -

          +

          &nbsp; diff --git a/addons/web_default_home/po/ar.po b/addons/web_default_home/po/ar.po new file mode 100644 index 00000000000..48260328d70 --- /dev/null +++ b/addons/web_default_home/po/ar.po @@ -0,0 +1,38 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-08 05:50+0000\n" +"Last-Translator: Ahmad Khayyat \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-08 06:12+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "أهلاً و مرحباً بك في OpenERP" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "لا تنس إدراج هذه الصفحة ضمن المفضلات" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "تذكر كلمة المرور" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "اختر أول تطبيق OpenERP تود تثبيته" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "تثبيت" diff --git a/addons/web_default_home/po/da.po b/addons/web_default_home/po/da.po new file mode 100644 index 00000000000..989daa78361 --- /dev/null +++ b/addons/web_default_home/po/da.po @@ -0,0 +1,38 @@ +# Danish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-11 14:02+0000\n" +"Last-Translator: Jonas Mortensen \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Velkommen til din nye OpenERP instans." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Husk at tilføje denne side til dine favoritter." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Husk dit log ind:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Vælg den første OpenERP Applikation som du ønsker at installere." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Installér" diff --git a/addons/web_default_home/po/de.po b/addons/web_default_home/po/de.po new file mode 100644 index 00000000000..2363aea8505 --- /dev/null +++ b/addons/web_default_home/po/de.po @@ -0,0 +1,38 @@ +# German translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-10 12:40+0000\n" +"Last-Translator: Felix Schubert \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Willkommen zu Ihrer neuen OpenERP Instanz." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Denken Sie daran ein Lesezeichen für diese Seite zu setzen." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Anmeldung speichern" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Wählen Sie die erste OpenERP Anwendung die Sie installieren möchten." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Installieren" diff --git a/addons/web_default_home/po/es.po b/addons/web_default_home/po/es.po index 4f35e5b6345..5120f12015d 100644 --- a/addons/web_default_home/po/es.po +++ b/addons/web_default_home/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" -"X-Generator: Launchpad (build 14157)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." diff --git a/addons/web_default_home/po/es_EC.po b/addons/web_default_home/po/es_EC.po new file mode 100644 index 00000000000..077b51cbeee --- /dev/null +++ b/addons/web_default_home/po/es_EC.po @@ -0,0 +1,38 @@ +# Spanish (Ecuador) translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-07 16:00+0000\n" +"Last-Translator: Cristian Salamea (Gnuthink) \n" +"Language-Team: Spanish (Ecuador) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Bienvenido a tu nueva instancia de OpenERP" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Recuerda marcar esta página" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Recordar tu inicio de sesión" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Escoge la primea Aplicación OpenERP que deseas instalar..." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Instalar" diff --git a/addons/web_default_home/po/et.po b/addons/web_default_home/po/et.po new file mode 100644 index 00000000000..a2dedb192d4 --- /dev/null +++ b/addons/web_default_home/po/et.po @@ -0,0 +1,38 @@ +# Estonian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-10 19:29+0000\n" +"Last-Translator: Aare Vesi \n" +"Language-Team: Estonian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Paigalda" diff --git a/addons/web_default_home/po/fr.po b/addons/web_default_home/po/fr.po index ec8855f86cf..e1b15ca7021 100644 --- a/addons/web_default_home/po/fr.po +++ b/addons/web_default_home/po/fr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." diff --git a/addons/web_default_home/po/gl.po b/addons/web_default_home/po/gl.po index 4069197dec9..5783af8a2fb 100644 --- a/addons/web_default_home/po/gl.po +++ b/addons/web_default_home/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." diff --git a/addons/web_default_home/po/it.po b/addons/web_default_home/po/it.po new file mode 100644 index 00000000000..a9f3a86854b --- /dev/null +++ b/addons/web_default_home/po/it.po @@ -0,0 +1,38 @@ +# Italian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-08 13:41+0000\n" +"Last-Translator: Nicola Riolini - Micronaet \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Benvenuto nella nuova istanza di OpenERP" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Ricordarsi di aggiungere ai preferiti questa pagina" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Ricordare il proprio login:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Scegliere la prima applicazione OpenERP che volete installare..." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Installa" diff --git a/addons/web_default_home/po/nl_BE.po b/addons/web_default_home/po/nl_BE.po new file mode 100644 index 00000000000..1f046075120 --- /dev/null +++ b/addons/web_default_home/po/nl_BE.po @@ -0,0 +1,38 @@ +# Dutch (Belgium) translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-07 09:07+0000\n" +"Last-Translator: Niels Huylebroeck \n" +"Language-Team: Dutch (Belgium) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Welkom bij uw nieuwe OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Gelieve een bookmark voor deze pagina te maken." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Vergeet je login niet:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Kies welke OpenERP Applicatie je wilt installeren..." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Installeer" diff --git a/addons/web_default_home/po/pl.po b/addons/web_default_home/po/pl.po new file mode 100644 index 00000000000..3eec2b0ab49 --- /dev/null +++ b/addons/web_default_home/po/pl.po @@ -0,0 +1,38 @@ +# Polish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-04 16:30+0000\n" +"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Witamy w twojej nowej instancji OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Pamiętaj o dodaniu tej strony do zakładek." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Zapamiętaj twój login:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Wybierz pierwszą aplikację OpenERP do instalacji." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Instaluj" diff --git a/addons/web_default_home/po/sk.po b/addons/web_default_home/po/sk.po new file mode 100644 index 00000000000..bf766fb65b0 --- /dev/null +++ b/addons/web_default_home/po/sk.po @@ -0,0 +1,38 @@ +# Slovak translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-01 13:27+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-02 05:05+0000\n" +"X-Generator: Launchpad (build 14214)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "" diff --git a/addons/web_default_home/po/sl.po b/addons/web_default_home/po/sl.po index d9f10a9e92f..2f9d918cb49 100644 --- a/addons/web_default_home/po/sl.po +++ b/addons/web_default_home/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." diff --git a/addons/web_diagram/__openerp__.py b/addons/web_diagram/__openerp__.py index 584c0a16e66..cd9eb719934 100644 --- a/addons/web_diagram/__openerp__.py +++ b/addons/web_diagram/__openerp__.py @@ -13,5 +13,8 @@ 'css' : [ "static/src/css/base_diagram.css", ], + 'qweb' : [ + "static/src/xml/*.xml", + ], 'active': True, } diff --git a/addons/web_diagram/controllers/main.py b/addons/web_diagram/controllers/main.py index 51861c17b5f..55047804725 100644 --- a/addons/web_diagram/controllers/main.py +++ b/addons/web_diagram/controllers/main.py @@ -93,7 +93,6 @@ class DiagramView(View): n.update( id=act['id'], color='white', - shape='ellipse', options={} ) for color, expr in bgcolors.items(): @@ -107,12 +106,5 @@ class DiagramView(View): for i, fld in enumerate(visible_node_fields): n['options'][node_fields_string[i]] = act[fld] - #to relate m2o field of transition to corresponding o2m in activity - in_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', des_node), ('model', '=', node)], 0, 0, 0, req.session.context) - in_transition_field = fields.read(in_transition_field_id[0], ['name'], req.session.context)['name'] - - out_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', src_node), ('model', '=', node)], 0, 0, 0, req.session.context) - out_transition_field = fields.read(out_transition_field_id[0], ['name'], req.session.context)['name'] - id_model = req.session.model(model).read([id],['name'], req.session.context)[0]['name'] - return dict(nodes=nodes, conn=connectors, id_model = id_model) + return dict(nodes=nodes, conn=connectors, id_model=id_model) diff --git a/addons/web_diagram/po/ar.po b/addons/web_diagram/po/ar.po new file mode 100644 index 00000000000..af8c6ab7213 --- /dev/null +++ b/addons/web_diagram/po/ar.po @@ -0,0 +1,54 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-03 15:11+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "طرف جديد" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Edge" +msgstr "حافة جديدة" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Show Grid:" +msgstr "عرض الشبكة" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "الأول" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "<<" +msgstr ">>" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "0" +msgstr "0" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "/" +msgstr "/" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Last" +msgstr "الأخير" diff --git a/addons/web_diagram/po/da.po b/addons/web_diagram/po/da.po index e91754b6da3..b0a68cf641c 100644 --- a/addons/web_diagram/po/da.po +++ b/addons/web_diagram/po/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/de.po b/addons/web_diagram/po/de.po index 2aa5e23eb13..1a511d763ba 100644 --- a/addons/web_diagram/po/de.po +++ b/addons/web_diagram/po/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/es.po b/addons/web_diagram/po/es.po index 192c69b6428..465cc16f401 100644 --- a/addons/web_diagram/po/es.po +++ b/addons/web_diagram/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" -"X-Generator: Launchpad (build 14157)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/es_EC.po b/addons/web_diagram/po/es_EC.po index 0aff9dc73a0..3faa86e9bc5 100644 --- a/addons/web_diagram/po/es_EC.po +++ b/addons/web_diagram/po/es_EC.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/et.po b/addons/web_diagram/po/et.po index f2f3816fafa..5f8e394d816 100644 --- a/addons/web_diagram/po/et.po +++ b/addons/web_diagram/po/et.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/gl.po b/addons/web_diagram/po/gl.po index 0aca25055d3..27f4dc017fa 100644 --- a/addons/web_diagram/po/gl.po +++ b/addons/web_diagram/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/it.po b/addons/web_diagram/po/it.po index f9ab13eaec5..c3ced470ca6 100644 --- a/addons/web_diagram/po/it.po +++ b/addons/web_diagram/po/it.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/nl_BE.po b/addons/web_diagram/po/nl_BE.po index 6f574501bba..4d2999c099d 100644 --- a/addons/web_diagram/po/nl_BE.po +++ b/addons/web_diagram/po/nl_BE.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/po/pl.po b/addons/web_diagram/po/pl.po new file mode 100644 index 00000000000..f36f3853850 --- /dev/null +++ b/addons/web_diagram/po/pl.po @@ -0,0 +1,54 @@ +# Polish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-04 16:24+0000\n" +"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "Nowy węzeł" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Edge" +msgstr "Nowa linia" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Show Grid:" +msgstr "Pokaż siatkę" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "Pierwsze" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "<<" +msgstr "" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "0" +msgstr "" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "/" +msgstr "" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid ">>" +msgstr "" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Last" +msgstr "Ostatnie" diff --git a/addons/web_diagram/po/sl.po b/addons/web_diagram/po/sl.po index 9cce3a3564e..6766b54fb3c 100644 --- a/addons/web_diagram/po/sl.po +++ b/addons/web_diagram/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" diff --git a/addons/web_diagram/static/lib/js/dracula_graffle.js b/addons/web_diagram/static/lib/js/dracula_graffle.js index 9d4fd2099e8..2b03ad16c79 100644 --- a/addons/web_diagram/static/lib/js/dracula_graffle.js +++ b/addons/web_diagram/static/lib/js/dracula_graffle.js @@ -71,7 +71,7 @@ Raphael.fn.connection = function (obj1, obj2, style) { x3 = [0, 0, 0, 0, x4, x4, x4 - dx, x4 + dx][res[1]].toFixed(3), y3 = [0, 0, 0, 0, y1 + dy, y1 - dy, y4, y4][res[1]].toFixed(3); /* assemble path and arrow */ - var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(","); + var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)]; /* arrow */ if(style && style.directed) { /* magnitude, length of the last path vector */ @@ -83,15 +83,16 @@ Raphael.fn.connection = function (obj1, obj2, style) { {x:(norm(x4-x3)+norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)+norm(x4-x3)+y4).toFixed(3)}, {x:(norm(x4-x3)-norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)-norm(x4-x3)+y4).toFixed(3)} ]; - path = path + ",M"+arr[0].x+","+arr[0].y+",L"+x4+","+y4+",L"+arr[1].x+","+arr[1].y; + path.push("M", arr[0].x, arr[0].y, "L", x4, y4, "L", arr[1].x, arr[1].y, "L", arr[0].x, arr[0].y); } + var svgpath = path.join(' '); /* function to be used for moving existent path(s), e.g. animate() or attr() */ var move = "attr"; /* applying path(s) */ - edge.fg && edge.fg[move]({path:path}) - || (edge.fg = selfRef.path(path).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack()); - edge.bg && edge.bg[move]({path:path}) - || style && style.fill && (edge.bg = style.fill.split && selfRef.path(path).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack()); + edge.fg && edge.fg[move]({path:svgpath}) + || (edge.fg = selfRef.path(svgpath).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack()); + edge.bg && edge.bg[move]({path:svgpath}) + || style && style.fill && (edge.bg = style.fill.split && selfRef.path(svgpath).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack()); /* setting label */ style && style.label && (edge.label && edge.label.attr({x:(x1+x4)/2, y:(y1+y4)/2}) diff --git a/addons/web_diagram/static/lib/js/dracula_graph.js b/addons/web_diagram/static/lib/js/dracula_graph.js index df9945882a7..28269986e78 100644 --- a/addons/web_diagram/static/lib/js/dracula_graph.js +++ b/addons/web_diagram/static/lib/js/dracula_graph.js @@ -160,13 +160,11 @@ Graph.Renderer.Raphael = function(element, graph, width, height) { */ this.isDrag = false; this.dragger = function (e) { - if(e.detail < 2) { - this.dx = e.clientX; - this.dy = e.clientY; - selfRef.isDrag = this; - this.set && this.set.animate({"fill-opacity": .1}, 200) && this.set.toFront(); - e.preventDefault && e.preventDefault(); - } + this.dx = e.clientX; + this.dy = e.clientY; + selfRef.isDrag = this; + this.set && this.set.animate({"fill-opacity": .1}, 200); + e.preventDefault && e.preventDefault(); }; var d = document.getElementById(element); @@ -378,6 +376,8 @@ Graph.Layout.Spring.prototype = { }, layoutRepulsive: function(node1, node2) { + if (typeof node1 == 'undefined' || typeof node2 == 'undefined') + return; var dx = node2.layoutPosX - node1.layoutPosX; var dy = node2.layoutPosY - node1.layoutPosY; var d2 = dx * dx + dy * dy; diff --git a/addons/web_diagram/static/lib/js/raphael-min.js b/addons/web_diagram/static/lib/js/raphael-min.js index 8718b5bc749..e69ea16a809 100644 --- a/addons/web_diagram/static/lib/js/raphael-min.js +++ b/addons/web_diagram/static/lib/js/raphael-min.js @@ -1,7 +1,8 @@ -/* - * Raphael 1.3.1 - JavaScript Vector Library - * - * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com) - * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. - */ -Raphael=(function(){var a=/[, ]+/,aO=/^(circle|rect|path|ellipse|text|image)$/,L=document,au=window,l={was:"Raphael" in au,is:au.Raphael},an=function(){if(an.is(arguments[0],"array")){var d=arguments[0],e=w[aW](an,d.splice(0,3+an.is(d[0],al))),S=e.set();for(var R=0,a0=d[m];R

          ";if(ag.childNodes[m]!=2){return null;}}an.svg=!(an.vml=an.type=="VML");aT[aY]=an[aY];an._id=0;an._oid=0;an.fn={};an.is=function(e,d){d=aZ.call(d);return((d=="object"||d=="undefined")&&typeof e==d)||(e==null&&d=="null")||aZ.call(aw.call(e).slice(8,-1))==d;};an.setWindow=function(d){au=d;L=au.document;};var aD=function(e){if(an.vml){var d=/^\s+|\s+$/g;aD=aj(function(R){var S;R=(R+at)[aP](d,at);try{var a0=new ActiveXObject("htmlfile");a0.write("");a0.close();S=a0.body;}catch(a2){S=createPopup().document.body;}var i=S.createTextRange();try{S.style.color=R;var a1=i.queryCommandValue("ForeColor");a1=((a1&255)<<16)|(a1&65280)|((a1&16711680)>>>16);return"#"+("000000"+a1[aA](16)).slice(-6);}catch(a2){return"none";}});}else{var E=L.createElement("i");E.title="Rapha\xebl Colour Picker";E.style.display="none";L.body[aL](E);aD=aj(function(i){E.style.color=i;return L.defaultView.getComputedStyle(E,at).getPropertyValue("color");});}return aD(e);};an.hsb2rgb=aj(function(a3,a1,a7){if(an.is(a3,"object")&&"h" in a3&&"s" in a3&&"b" in a3){a7=a3.b;a1=a3.s;a3=a3.h;}var R,S,a8;if(a7==0){return{r:0,g:0,b:0,hex:"#000"};}if(a3>1||a1>1||a7>1){a3/=255;a1/=255;a7/=255;}var a0=~~(a3*6),a4=(a3*6)-a0,E=a7*(1-a1),e=a7*(1-(a1*a4)),a9=a7*(1-(a1*(1-a4)));R=[a7,e,E,E,a9,a7,a7][a0];S=[a9,a7,a7,e,E,E,a9][a0];a8=[E,E,a9,a7,a7,e,E][a0];R*=255;S*=255;a8*=255;var a5={r:R,g:S,b:a8},d=(~~R)[aA](16),a2=(~~S)[aA](16),a6=(~~a8)[aA](16);d=d[aP](aU,"0");a2=a2[aP](aU,"0");a6=a6[aP](aU,"0");a5.hex="#"+d+a2+a6;return a5;},an);an.rgb2hsb=aj(function(d,e,a1){if(an.is(d,"object")&&"r" in d&&"g" in d&&"b" in d){a1=d.b;e=d.g;d=d.r;}if(an.is(d,"string")){var a3=an.getRGB(d);d=a3.r;e=a3.g;a1=a3.b;}if(d>1||e>1||a1>1){d/=255;e/=255;a1/=255;}var a0=g(d,e,a1),i=aI(d,e,a1),R,E,S=a0;if(i==a0){return{h:0,s:0,b:a0};}else{var a2=(a0-i);E=a2/a0;if(d==a0){R=(e-a1)/a2;}else{if(e==a0){R=2+((a1-d)/a2);}else{R=4+((d-e)/a2);}}R/=6;R<0&&R++;R>1&&R--;}return{h:R,s:E,b:S};},an);var aE=/,?([achlmqrstvxz]),?/gi;an._path2string=function(){return this.join(",")[aP](aE,"$1");};function aj(E,e,d){function i(){var R=Array[aY].slice.call(arguments,0),a0=R[az]("\u25ba"),S=i.cache=i.cache||{},a1=i.count=i.count||[];if(S[Q](a0)){return d?d(S[a0]):S[a0];}a1[m]>=1000&&delete S[a1.shift()];a1[f](a0);S[a0]=E[aW](e,R);return d?d(S[a0]):S[a0];}return i;}an.getRGB=aj(function(d){if(!d||!!((d=d+at).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1};}if(d=="none"){return{r:-1,g:-1,b:-1,hex:"none"};}!(({hs:1,rg:1})[Q](d.substring(0,2))||d.charAt()=="#")&&(d=aD(d));var S,i,E,a2,a3,a0=d.match(x);if(a0){if(a0[2]){a2=G(a0[2].substring(5),16);E=G(a0[2].substring(3,5),16);i=G(a0[2].substring(1,3),16);}if(a0[3]){a2=G((a3=a0[3].charAt(3))+a3,16);E=G((a3=a0[3].charAt(2))+a3,16);i=G((a3=a0[3].charAt(1))+a3,16);}if(a0[4]){a0=a0[4][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);}if(a0[5]){a0=a0[5][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;}if(a0[6]){a0=a0[6][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);return an.hsb2rgb(i,E,a2);}if(a0[7]){a0=a0[7][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;return an.hsb2rgb(i,E,a2);}a0={r:i,g:E,b:a2};var e=(~~i)[aA](16),R=(~~E)[aA](16),a1=(~~a2)[aA](16);e=e[aP](aU,"0");R=R[aP](aU,"0");a1=a1[aP](aU,"0");a0.hex="#"+e+R+a1;return a0;}return{r:-1,g:-1,b:-1,hex:"none",error:1};},an);an.getColor=function(e){var i=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||0.75},d=this.hsb2rgb(i.h,i.s,i.b);i.h+=0.075;if(i.h>1){i.h=0;i.s-=0.2;i.s<=0&&(this.getColor.start={h:0,s:1,b:i.b});}return d.hex;};an.getColor.reset=function(){delete this.start;};an.parsePathString=aj(function(d){if(!d){return null;}var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=[];if(an.is(d,"array")&&an.is(d[0],"array")){e=av(d);}if(!e[m]){(d+at)[aP](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(R,E,a1){var a0=[],S=aZ.call(E);a1[aP](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(a3,a2){a2&&a0[f](+a2);});while(a0[m]>=i[S]){e[f]([E][aS](a0.splice(0,i[S])));if(!i[S]){break;}}});}e[aA]=an._path2string;return e;});an.findDotsAtSegment=function(e,d,be,bc,a0,R,a2,a1,a8){var a6=1-a8,a5=aM(a6,3)*e+aM(a6,2)*3*a8*be+a6*3*a8*a8*a0+aM(a8,3)*a2,a3=aM(a6,3)*d+aM(a6,2)*3*a8*bc+a6*3*a8*a8*R+aM(a8,3)*a1,ba=e+2*a8*(be-e)+a8*a8*(a0-2*be+e),a9=d+2*a8*(bc-d)+a8*a8*(R-2*bc+d),bd=be+2*a8*(a0-be)+a8*a8*(a2-2*a0+be),bb=bc+2*a8*(R-bc)+a8*a8*(a1-2*R+bc),a7=(1-a8)*e+a8*be,a4=(1-a8)*d+a8*bc,E=(1-a8)*a0+a8*a2,i=(1-a8)*R+a8*a1,S=(90-ab.atan((ba-bd)/(a9-bb))*180/ab.PI);(ba>bd||a91){bi=ab.sqrt(by)*bi;bg=ab.sqrt(by)*bg;}var E=bi*bi,br=bg*bg,bt=(a4==S?-1:1)*ab.sqrt(ab.abs((E*br-E*bn*bn-br*bo*bo)/(E*bn*bn+br*bo*bo))),bd=bt*bi*bn/bg+(a9+a8)/2,bc=bt*-bg*bo/bi+(bE+bD)/2,a3=ab.asin(((bE-bc)/bg).toFixed(7)),a2=ab.asin(((bD-bc)/bg).toFixed(7));a3=a9a2){a3=a3-R*2;}if(!S&&a2>a3){a2=a2-R*2;}}else{a3=bb[0];a2=bb[1];bd=bb[2];bc=bb[3];}var a7=a2-a3;if(ab.abs(a7)>bf){var be=a2,bh=a8,a5=bD;a2=a3+bf*(S&&a2>a3?1:-1);a8=bd+bi*ab.cos(a2);bD=bc+bg*ab.sin(a2);bm=K(a8,bD,bi,bg,ba,0,S,bh,a5,[a2,be,bd,bc]);}a7=a2-a3;var a1=ab.cos(a3),bC=ab.sin(a3),a0=ab.cos(a2),bB=ab.sin(a2),bp=ab.tan(a7/4),bs=4/3*bi*bp,bq=4/3*bg*bp,bz=[a9,bE],bx=[a9+bs*bC,bE-bq*a1],bw=[a8+bs*bB,bD-bq*a0],bu=[a8,bD];bx[0]=2*bz[0]-bx[0];bx[1]=2*bz[1]-bx[1];if(bb){return[bx,bw,bu][aS](bm);}else{bm=[bx,bw,bu][aS](bm)[az]()[z](",");var bk=[];for(var bv=0,bl=bm[m];bv1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}a7=(a8-2*E+d)-(a2-2*a8+E);a4=2*(E-d)-2*(a8-E);a1=d-E;a0=(-a4+ab.sqrt(a4*a4-4*a7*a1))/2/a7;S=(-a4-ab.sqrt(a4*a4-4*a7*a1))/2/a7;ab.abs(a0)>1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}return{min:{x:aI[aW](0,a6),y:aI[aW](0,a3)},max:{x:g[aW](0,a6),y:g[aW](0,a3)}};}),H=aj(function(a9,a4){var R=r(a9),a5=a4&&r(a4),a6={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a0=function(ba,bb){var i,bc;if(!ba){return["C",bb.x,bb.y,bb.x,bb.y,bb.x,bb.y];}!(ba[0] in {T:1,Q:1})&&(bb.qx=bb.qy=null);switch(ba[0]){case"M":bb.X=ba[1];bb.Y=ba[2];break;case"A":ba=["C"][aS](K[aW](0,[bb.x,bb.y][aS](ba.slice(1))));break;case"S":i=bb.x+(bb.x-(bb.bx||bb.x));bc=bb.y+(bb.y-(bb.by||bb.y));ba=["C",i,bc][aS](ba.slice(1));break;case"T":bb.qx=bb.x+(bb.x-(bb.qx||bb.x));bb.qy=bb.y+(bb.y-(bb.qy||bb.y));ba=["C"][aS](aK(bb.x,bb.y,bb.qx,bb.qy,ba[1],ba[2]));break;case"Q":bb.qx=ba[1];bb.qy=ba[2];ba=["C"][aS](aK(bb.x,bb.y,ba[1],ba[2],ba[3],ba[4]));break;case"L":ba=["C"][aS](aX(bb.x,bb.y,ba[1],ba[2]));break;case"H":ba=["C"][aS](aX(bb.x,bb.y,ba[1],bb.y));break;case"V":ba=["C"][aS](aX(bb.x,bb.y,bb.x,ba[1]));break;case"Z":ba=["C"][aS](aX(bb.x,bb.y,bb.X,bb.Y));break;}return ba;},e=function(ba,bb){if(ba[bb][m]>7){ba[bb].shift();var bc=ba[bb];while(bc[m]){ba.splice(bb++,0,["C"][aS](bc.splice(0,6)));}ba.splice(bb,1);a7=g(R[m],a5&&a5[m]||0);}},E=function(be,bd,bb,ba,bc){if(be&&bd&&be[bc][0]=="M"&&bd[bc][0]!="M"){bd.splice(bc,0,["M",ba.x,ba.y]);bb.bx=0;bb.by=0;bb.x=be[bc][1];bb.y=be[bc][2];a7=g(R[m],a5&&a5[m]||0);}};for(var a2=0,a7=g(R[m],a5&&a5[m]||0);a23){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]};}}},aG=function(d,i){var e=this;for(var E in i){if(i[Q](E)&&!(E in d)){switch(typeof i[E]){case"function":(function(R){d[E]=d===e?R:function(){return R[aW](e,arguments);};})(i[E]);break;case"object":d[E]=d[E]||{};aG.call(this,d[E],i[E]);break;default:d[E]=i[E];break;}}}},ak=function(d,e){d==e.top&&(e.top=d.prev);d==e.bottom&&(e.bottom=d.next);d.next&&(d.next.prev=d.prev);d.prev&&(d.prev.next=d.next);},Y=function(d,e){if(e.top===d){return;}ak(d,e);d.next=null;d.prev=e.top;e.top.next=d;e.top=d;},k=function(d,e){if(e.bottom===d){return;}ak(d,e);d.next=e.bottom;d.prev=null;e.bottom.prev=d;e.bottom=d;},A=function(e,d,i){ak(e,i);d==i.top&&(i.top=e);d.next&&(d.next.prev=e);e.next=d.next;e.prev=d;d.next=e;},aq=function(e,d,i){ak(e,i);d==i.bottom&&(i.bottom=e);d.prev&&(d.prev.next=e);e.prev=d.prev;d.prev=e;e.next=d;},s=function(d){return function(){throw new Error("Rapha\xebl: you are calling to method \u201c"+d+"\u201d of removed object");};},ar=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(an.svg){aT[aY].svgns="http://www.w3.org/2000/svg";aT[aY].xlink="http://www.w3.org/1999/xlink";var O=function(d){return +d+(~~d===d)*0.5;},V=function(S){for(var e=0,E=S[m];e0.5)*2-1);aM(a1-0.5,2)+aM(S-0.5,2)>0.25&&(S=ab.sqrt(0.25-aM(a1-0.5,2))*ba+0.5)&&S!=0.5&&(S=S.toFixed(5)-0.00001*ba);}return at;});a7=a7[z](/\s*\-\s*/);if(a4=="linear"){var a0=a7.shift();a0=-W(a0);if(isNaN(a0)){return null;}var R=[0,0,ab.cos(a0*ab.PI/180),ab.sin(a0*ab.PI/180)],a6=1/(g(ab.abs(R[2]),ab.abs(R[3]))||1);R[2]*=a6;R[3]*=a6;if(R[2]<0){R[0]=-R[2];R[2]=0;}if(R[3]<0){R[1]=-R[3];R[3]=0;}}var a3=p(a7);if(!a3){return null;}var e=aJ(a4+"Gradient");e.id="r"+(an._id++)[aA](36);aJ(e,a4=="radial"?{fx:a1,fy:S}:{x1:R[0],y1:R[1],x2:R[2],y2:R[3]});d.defs[aL](e);for(var a2=0,a8=a3[m];a2a1.height)&&(a1.height=a0.y+a0.height-a1.y);(a0.x+a0.width-a1.x>a1.width)&&(a1.width=a0.x+a0.width-a1.x);}}E&&this.hide();return a1;};ax[aY].attr=function(){if(this.removed){return this;}if(arguments[m]==0){var R={};for(var E in this.attrs){if(this.attrs[Q](E)){R[E]=this.attrs[E];}}this._.rt.deg&&(R.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(R.scale=this.scale());R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient;return R;}if(arguments[m]==1&&an.is(arguments[0],"string")){if(arguments[0]=="translation"){return t.call(this);}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}if(arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient;}return this.attrs[arguments[0]];}if(arguments[m]==1&&an.is(arguments[0],"array")){var d={};for(var e in arguments[0]){if(arguments[0][Q](e)){d[arguments[0][e]]=this.attrs[arguments[0][e]];}}return d;}if(arguments[m]==2){var S={};S[arguments[0]]=arguments[1];aa(this,S);}else{if(arguments[m]==1&&an.is(arguments[0],"object")){aa(this,arguments[0]);}}return this;};ax[aY].toFront=function(){if(this.removed){return this;}this.node.parentNode[aL](this.node);var d=this.paper;d.top!=this&&Y(this,d);return this;};ax[aY].toBack=function(){if(this.removed){return this;}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);k(this,this.paper);var d=this.paper;}return this;};ax[aY].insertAfter=function(d){if(this.removed){return this;}var e=d.node;if(e.nextSibling){e.parentNode.insertBefore(this.node,e.nextSibling);}else{e.parentNode[aL](this.node);}A(this,d,this.paper);return this;};ax[aY].insertBefore=function(d){if(this.removed){return this;}var e=d.node;e.parentNode.insertBefore(this.node,e);aq(this,d,this.paper);return this;};var P=function(e,d,S,R){d=O(d);S=O(S);var E=aJ("circle");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:S,r:R,fill:"none",stroke:"#000"};i.type="circle";aJ(E,i.attrs);return i;};var aF=function(i,d,a1,e,S,a0){d=O(d);a1=O(a1);var R=aJ("rect");i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,r:a0||0,rx:a0||0,ry:a0||0,fill:"none",stroke:"#000"};E.type="rect";aJ(R,E.attrs);return E;};var ai=function(e,d,a0,S,R){d=O(d);a0=O(a0);var E=aJ("ellipse");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:a0,rx:S,ry:R,fill:"none",stroke:"#000"};i.type="ellipse";aJ(E,i.attrs);return i;};var o=function(i,a0,d,a1,e,S){var R=aJ("image");aJ(R,{x:d,y:a1,width:e,height:S,preserveAspectRatio:"none"});R.setAttributeNS(i.xlink,"href",a0);i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,src:a0};E.type="image";return E;};var X=function(e,d,S,R){var E=aJ("text");aJ(E,{x:d,y:S,"text-anchor":"middle"});e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={x:d,y:S,"text-anchor":"middle",text:R,font:j.font,stroke:"none",fill:"#000"};i.type="text";aa(i,i.attrs);return i;};var aV=function(e,d){this.width=e||this.width;this.height=d||this.height;this.canvas[v]("width",this.width);this.canvas[v]("height",this.height);return this;};var w=function(){var E=ao[aW](null,arguments),i=E&&E.container,e=E.x,a0=E.y,R=E.width,d=E.height;if(!i){throw new Error("SVG container not found.");}var S=aJ("svg");R=R||512;d=d||342;aJ(S,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:R,height:d});if(i==1){S.style.cssText="position:absolute;left:"+e+"px;top:"+a0+"px";L.body[aL](S);}else{if(i.firstChild){i.insertBefore(S,i.firstChild);}else{i[aL](S);}}i=new aT;i.width=R;i.height=d;i.canvas=S;aG.call(i,i,an.fn);i.clear();return i;};aT[aY].clear=function(){var d=this.canvas;while(d.firstChild){d.removeChild(d.firstChild);}this.bottom=this.top=null;(this.desc=aJ("desc"))[aL](L.createTextNode("Created with Rapha\xebl"));d[aL](this.desc);d[aL](this.defs=aJ("defs"));};aT[aY].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if(an.vml){var aH=function(a8){var a5=/[ahqstv]/ig,a0=r;(a8+at).match(a5)&&(a0=H);a5=/[clmz]/g;if(a0==r&&!(a8+at).match(a5)){var e={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},R=/([clmz]),?([^clmz]*)/gi,S=/-?[^,\s-]+/g;var a4=(a8+at)[aP](R,function(a9,bb,i){var ba=[];i[aP](S,function(bc){ba[f](O(bc));});return e[bb]+ba;});return a4;}var a6=a0(a8),E,a4=[],d;for(var a2=0,a7=a6[m];a21&&(e=1);a7.opacity=e;}a8.fill&&(a7.on=true);if(a7.on==null||a8.fill=="none"){a7.on=false;}if(a7.on&&a8.fill){var i=a8.fill.match(c);if(i){a7.src=i[1];a7.type="tile";}else{a7.color=an.getRGB(a8.fill).hex;a7.src=at;a7.type="solid";if(an.getRGB(a8.fill).error&&(bd.type in {circle:1,ellipse:1}||(a8.fill+at).charAt()!="r")&&b(bd,a8.fill)){a9.fill="none";a9.gradient=a8.fill;}}}ba&&a6[aL](a7);var R=(a6.getElementsByTagName("stroke")&&a6.getElementsByTagName("stroke")[0]),bb=false;!R&&(bb=R=ah("stroke"));if((a8.stroke&&a8.stroke!="none")||a8["stroke-width"]||a8["stroke-opacity"]!=null||a8["stroke-dasharray"]||a8["stroke-miterlimit"]||a8["stroke-linejoin"]||a8["stroke-linecap"]){R.on=true;}(a8.stroke=="none"||R.on==null||a8.stroke==0||a8["stroke-width"]==0)&&(R.on=false);R.on&&a8.stroke&&(R.color=an.getRGB(a8.stroke).hex);var e=((+a9["stroke-opacity"]+1||2)-1)*((+a9.opacity+1||2)-1),a4=(W(a8["stroke-width"])||1)*0.75;e<0&&(e=0);e>1&&(e=1);a8["stroke-width"]==null&&(a4=a9["stroke-width"]);a8["stroke-width"]&&(R.weight=a4);a4&&a4<1&&(e*=a4)&&(R.weight=1);R.opacity=e;a8["stroke-linejoin"]&&(R.joinstyle=a8["stroke-linejoin"]||"miter");R.miterlimit=a8["stroke-miterlimit"]||8;a8["stroke-linecap"]&&(R.endcap=a8["stroke-linecap"]=="butt"?"flat":a8["stroke-linecap"]=="square"?"square":"round");if(a8["stroke-dasharray"]){var a5={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};R.dashstyle=a5[Q](a8["stroke-dasharray"])?a5[a8["stroke-dasharray"]]:at;}bb&&a6[aL](R);}if(bd.type=="text"){var a0=bd.paper.span.style;a9.font&&(a0.font=a9.font);a9["font-family"]&&(a0.fontFamily=a9["font-family"]);a9["font-size"]&&(a0.fontSize=a9["font-size"]);a9["font-weight"]&&(a0.fontWeight=a9["font-weight"]);a9["font-style"]&&(a0.fontStyle=a9["font-style"]);bd.node.string&&(bd.paper.span.innerHTML=(bd.node.string+at)[aP](/"));bd.W=a9.w=bd.paper.span.offsetWidth;bd.H=a9.h=bd.paper.span.offsetHeight;bd.X=a9.x;bd.Y=a9.y+O(bd.H/2);switch(a9["text-anchor"]){case"start":bd.node.style["v-text-align"]="left";bd.bbx=O(bd.W/2);break;case"end":bd.node.style["v-text-align"]="right";bd.bbx=-O(bd.W/2);break;default:bd.node.style["v-text-align"]="center";break;}}};var b=function(d,a1){d.attrs=d.attrs||{};var a2=d.attrs,a4=d.node.getElementsByTagName("fill"),S="linear",a0=".5 .5";d.attrs.gradient=a1;a1=(a1+at)[aP](ar,function(a6,a7,i){S="radial";if(a7&&i){a7=W(a7);i=W(i);aM(a7-0.5,2)+aM(i-0.5,2)>0.25&&(i=ab.sqrt(0.25-aM(a7-0.5,2))*((i>0.5)*2-1)+0.5);a0=a7+am+i;}return at;});a1=a1[z](/\s*\-\s*/);if(S=="linear"){var e=a1.shift();e=-W(e);if(isNaN(e)){return null;}}var R=p(a1);if(!R){return null;}d=d.shape||d.node;a4=a4[0]||ah("fill");if(R[m]){a4.on=true;a4.method="none";a4.type=(S=="radial")?"gradientradial":"gradient";a4.color=R[0].color;a4.color2=R[R[m]-1].color;var a5=[];for(var E=0,a3=R[m];E');};}catch(af){ah=function(d){return L.createElement("<"+d+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');};}var w=function(){var i=ao[aW](null,arguments),d=i.container,a2=i.height,a3,e=i.width,a1=i.x,a0=i.y;if(!d){throw new Error("VML container not found.");}var R=new aT,S=R.canvas=L.createElement("div"),E=S.style;e=e||512;a2=a2||342;e==+e&&(e+="px");a2==+a2&&(a2+="px");R.width=1000;R.height=1000;R.coordsize="1000 1000";R.coordorigin="0 0";R.span=L.createElement("span");R.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";S[aL](R.span);E.cssText=an.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",e,a2);if(d==1){L.body[aL](S);E.left=a1+"px";E.top=a0+"px";}else{d.style.width=e;d.style.height=a2;if(d.firstChild){d.insertBefore(S,d.firstChild);}else{d[aL](S);}}aG.call(R,R,an.fn);return R;};aT[aY].clear=function(){this.canvas.innerHTML=at;this.span=L.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[aL](this.span);this.bottom=this.top=null;};aT[aY].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if((/^Apple|^Google/).test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)){aT[aY].safari=function(){var d=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){d.remove();});};}else{aT[aY].safari=function(){};}var ae=(function(){if(L.addEventListener){return function(R,i,e,d){var E=function(S){return e.call(d,S);};R.addEventListener(i,E,false);return function(){R.removeEventListener(i,E,false);return true;};};}else{if(L.attachEvent){return function(S,E,i,e){var R=function(a0){return i.call(e,a0||au.event);};S.attachEvent("on"+E,R);var d=function(){S.detachEvent("on"+E,R);return true;};return d;};}}})();for(var ac=F[m];ac--;){(function(d){ax[aY][d]=function(e){if(an.is(e,"function")){this.events=this.events||[];this.events.push({name:d,f:e,unbind:ae(this.shape||this.node,d,e,this)});}return this;};ax[aY]["un"+d]=function(E){var i=this.events,e=i[m];while(e--){if(i[e].name==d&&i[e].f==E){i[e].unbind();i.splice(e,1);!i.length&&delete this.events;return this;}}return this;};})(F[ac]);}ax[aY].hover=function(e,d){return this.mouseover(e).mouseout(d);};ax[aY].unhover=function(e,d){return this.unmouseover(e).unmouseout(d);};aT[aY].circle=function(d,i,e){return P(this,d||0,i||0,e||0);};aT[aY].rect=function(d,R,e,i,E){return aF(this,d||0,R||0,e||0,i||0,E||0);};aT[aY].ellipse=function(d,E,i,e){return ai(this,d||0,E||0,i||0,e||0);};aT[aY].path=function(d){d&&!an.is(d,"string")&&!an.is(d[0],"array")&&(d+=at);return q(an.format[aW](an,arguments),this);};aT[aY].image=function(E,d,R,e,i){return o(this,E||"about:blank",d||0,R||0,e||0,i||0);};aT[aY].text=function(d,i,e){return X(this,d||0,i||0,e||at);};aT[aY].set=function(d){arguments[m]>1&&(d=Array[aY].splice.call(arguments,0,arguments[m]));return new T(d);};aT[aY].setSize=aV;aT[aY].top=aT[aY].bottom=null;aT[aY].raphael=an;function u(){return this.x+am+this.y;}ax[aY].scale=function(a6,a5,E,e){if(a6==null&&a5==null){return{x:this._.sx,y:this._.sy,toString:u};}a5=a5||a6;!+a5&&(a5=a6);var ba,a8,a9,a7,bm=this.attrs;if(a6!=0){var a4=this.getBBox(),a1=a4.x+a4.width/2,R=a4.y+a4.height/2,bl=a6/this._.sx,bk=a5/this._.sy;E=(+E||E==0)?E:a1;e=(+e||e==0)?e:R;var a3=~~(a6/ab.abs(a6)),a0=~~(a5/ab.abs(a5)),be=this.node.style,bo=E+(a1-E)*bl,bn=e+(R-e)*bk;switch(this.type){case"rect":case"image":var a2=bm.width*a3*bl,bd=bm.height*a0*bk;this.attr({height:bd,r:bm.r*aI(a3*bl,a0*bk),width:a2,x:bo-a2/2,y:bn-bd/2});break;case"circle":case"ellipse":this.attr({rx:bm.rx*a3*bl,ry:bm.ry*a0*bk,r:bm.r*aI(a3*bl,a0*bk),cx:bo,cy:bn});break;case"path":var bg=ad(bm.path),bh=true;for(var bj=0,bc=bg[m];bjS){if(e&&!a8.start){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);R+=["C",a6.start.x,a6.start.y,a6.m.x,a6.m.y,a6.x,a6.y];if(a0){return R;}a8.start=R;R=["M",a6.x,a6.y+"C",a6.n.x,a6.n.y,a6.end.x,a6.end.y,E[5],E[6]][az]();a3+=a1;a5=+E[5];a4=+E[6];continue;}if(!d&&!e){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);return{x:a6.x,y:a6.y,alpha:a6.alpha};}}a3+=a1;a5=+E[5];a4=+E[6];}R+=E;}a8.end=R;a6=d?a3:e?a8:an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],1);a6.alpha&&(a6={x:a6.x,y:a6.y,alpha:a6.alpha});return a6;};},n=aj(function(E,d,a0,S,a6,a5,a4,a3){var R={x:0,y:0},a2=0;for(var a1=0;a1<1.01;a1+=0.01){var e=M(E,d,a0,S,a6,a5,a4,a3,a1);a1&&(a2+=ab.sqrt(aM(R.x-e.x,2)+aM(R.y-e.y,2)));R=e;}return a2;});var ap=aB(1),C=aB(),J=aB(0,1);ax[aY].getTotalLength=function(){if(this.type!="path"){return;}return ap(this.attrs.path);};ax[aY].getPointAtLength=function(d){if(this.type!="path"){return;}return C(this.attrs.path,d);};ax[aY].getSubpath=function(i,e){if(this.type!="path"){return;}if(ab.abs(this.getTotalLength()-e)<0.000001){return J(this.attrs.path,i).end;}var d=J(this.attrs.path,e,1);return i?J(d,i).end:d;};an.easing_formulas={linear:function(d){return d;},"<":function(d){return aM(d,3);},">":function(d){return aM(d-1,3)+1;},"<>":function(d){d=d*2;if(d<1){return aM(d,3)/2;}d-=2;return(aM(d,3)+2)/2;},backIn:function(e){var d=1.70158;return e*e*((d+1)*e-d);},backOut:function(e){e=e-1;var d=1.70158;return e*e*((d+1)*e+d)+1;},elastic:function(i){if(i==0||i==1){return i;}var e=0.3,d=e/4;return aM(2,-10*i)*ab.sin((i-d)*(2*ab.PI)/e)+1;},bounce:function(E){var e=7.5625,i=2.75,d;if(E<(1/i)){d=e*E*E;}else{if(E<(2/i)){E-=(1.5/i);d=e*E*E+0.75;}else{if(E<(2.5/i)){E-=(2.25/i);d=e*E*E+0.9375;}else{E-=(2.625/i);d=e*E*E+0.984375;}}}return d;}};var I={length:0},aR=function(){var a2=+new Date;for(var be in I){if(be!="length"&&I[Q](be)){var bj=I[be];if(bj.stop){delete I[be];I[m]--;continue;}var a0=a2-bj.start,bb=bj.ms,ba=bj.easing,bf=bj.from,a7=bj.diff,E=bj.to,a6=bj.t,a9=bj.prev||0,a1=bj.el,R=bj.callback,a8={},d;if(a0255?255:(d<0?0:d);},t=function(d,i){if(d==null){return{x:this._.tx,y:this._.ty,toString:u};}this._.tx+=+d;this._.ty+=+i;switch(this.type){case"circle":case"ellipse":this.attr({cx:+d+this.attrs.cx,cy:+i+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+d+this.attrs.x,y:+i+this.attrs.y});break;case"path":var e=ad(this.attrs.path);e[0][1]+=+d;e[0][2]+=+i;this.attr({path:e});break;}return this;};ax[aY].animateWith=function(e,i,d,R,E){I[e.id]&&(i.start=I[e.id].start);return this.animate(i,d,R,E);};ax[aY].animateAlong=ay();ax[aY].animateAlongBack=ay(1);function ay(d){return function(E,i,e,S){var R={back:d};an.is(e,"function")?(S=e):(R.rot=e);E&&E.constructor==ax&&(E=E.attrs.path);E&&(R.along=E);return this.animate(R,i,S);};}ax[aY].onAnimation=function(d){this._run=d||0;return this;};ax[aY].animate=function(be,a5,a4,E){if(an.is(a4,"function")||!a4){E=a4||null;}var a9={},e={},a2={};for(var a6 in be){if(be[Q](a6)){if(Z[Q](a6)){a9[a6]=this.attr(a6);(a9[a6]==null)&&(a9[a6]=j[a6]);e[a6]=be[a6];switch(Z[a6]){case"along":var bc=ap(be[a6]),a7=C(be[a6],bc*!!be.back),R=this.getBBox();a2[a6]=bc/a5;a2.tx=R.x;a2.ty=R.y;a2.sx=a7.x;a2.sy=a7.y;e.rot=be.rot;e.back=be.back;e.len=bc;be.rot&&(a2.r=W(this.rotate())||0);break;case"number":a2[a6]=(e[a6]-a9[a6])/a5;break;case"colour":a9[a6]=an.getRGB(a9[a6]);var a8=an.getRGB(e[a6]);a2[a6]={r:(a8.r-a9[a6].r)/a5,g:(a8.g-a9[a6].g)/a5,b:(a8.b-a9[a6].b)/a5};break;case"path":var S=H(a9[a6],e[a6]);a9[a6]=S[0];var a3=S[1];a2[a6]=[];for(var bb=0,a1=a9[a6][m];bbf*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(attr in j)if(j[g](attr))if(U[g](attr)||d.paper.customAttributes[g](attr)){u[attr]=d.attr(attr),u[attr]==null&&(u[attr]=T[attr]),v[attr]=j[attr];switch(U[attr]){case C:w[attr]=(v[attr]-u[attr])/t;break;case"colour":u[attr]=a.getRGB(u[attr]);var A=a.getRGB(v[attr]);w[attr]={r:(A.r-u[attr].r)/t,g:(A.g-u[attr].g)/t,b:(A.b-u[attr].b)/t};break;case"path":var B=bG(u[attr],v[attr]),D=B[1];u[attr]=B[0],w[attr]=[];for(y=0,z=u[attr].length;yd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cd(){return this.x+q+this.y+q+this.width+" × "+this.height}function cc(){return this.x+q+this.y}function bR(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bw(a){var b=[];for(var c=0,d=a.length;d-2>c;c+=2){var e=[{x:+a[c],y:+a[c+1]},{x:+a[c],y:+a[c+1]},{x:+a[c+2],y:+a[c+3]},{x:+a[c+4],y:+a[c+5]}];d-4==c?(e[0]={x:+a[c-2],y:+a[c-1]},e[3]=e[2]):c&&(e[0]={x:+a[c-2],y:+a[c-1]}),b.push(["C",(-e[0].x+6*e[1].x+e[2].x)/6,(-e[0].y+6*e[1].y+e[2].y)/6,(e[1].x+6*e[2].x-e[3].x)/6,(e[1].y+6*e[2].y-e[3].y)/6,e[2].x,e[2].y])}return b}function bv(){return this.hex}function bt(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bs(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bs(a,b){for(var c=0,d=a.length;c',bk=bj.firstChild,bk.style.behavior="url(#default#VML)";if(!bk||typeof bk.adj!="object")return a.type=p;bj=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bl=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,initWin&&initWin(h.win)};var bm=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bm=bt(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bm=bt(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bm(b)},bn=function(){return"hsb("+[this.h,this.s,this.b]+")"},bo=function(){return"hsl("+[this.h,this.s,this.l]+")"},bp=function(){return this.hex},bq=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},br=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:bp};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},crl.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=bp;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bn}},a.rgb2hsl=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bo}},a._path2string=function(){return this.join(",").replace(X,"$1")};var bu=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bt(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bv};!W[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bm(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bv},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv}},a),a.hsb=bt(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bt(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bt(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bt(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Y,function(a,b,e){var f=[],g=b.toLowerCase();e.replace($,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(d.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")d.push([b][n](f));else while(f.length>=c[g]){d.push([b][n](f.splice(0,c[g])));if(!c[g])break}}),d.toString=a._path2string;return d}),a.parseTransformString=bt(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Z,function(a,b,c){var e=[],f=v.call(b);c.replace($,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=aF&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bD(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bG=a._path2curve=bt(function(a,b){var c=bA(a),d=b&&bA(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bD[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bC(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bC(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bB(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bB(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bB(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bB(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b].length>7){a[b].shift();var e=a[b];while(e.length)a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=x(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=x(c.length,d&&d.length||0))};for(var j=0,k=x(c.length,d&&d.length||0);j=j)return p;o=p}if(j==null)return k},cg=function(b,c){return function(d,e,f){d=bG(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},ch=cg(1),ci=cg(),cj=cg(0,1);a.getTotalLength=ch,a.getPointAtLength=ci,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cj(a,b).end;var d=cj(a,c,1);return b?cj(d,b).end:d},b_.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return ch(this.attrs.path)}},b_.getPointAtLength=function(a){if(this.type=="path")return ci(this.attrs.path,a)},b_.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var ck=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};ck.easeIn=ck["ease-in"]=ck["<"],ck.easeOut=ck["ease-out"]=ck[">"],ck.easeInOut=ck["ease-in-out"]=ck["<>"],ck["back-in"]=ck.backIn,ck["back-out"]=ck.backOut;var cl=[],cm=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cn=function(){var b=+(new Date),c=0;for(;c1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cr(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cr(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cl.length&&cm(cn)},co=function(a){return a>255?255:a<0?0:a};b_.animateWith=function(b,c,d,e,f,g){var h=d?a.animation(d,e,f,g):c;status=b.status(c);return this.animate(h).status(h,status*c.ms/h.ms)},b_.onAnimation=function(a){a?eve.on("anim.frame."+this.id,a):eve.unbind("anim.frame."+this.id);return this},cq.prototype.delay=function(a){var b=new cq(this.anim,this.ms);b.times=this.times,b.del=+a||0;return b},cq.prototype.repeat=function(a){var b=new cq(this.anim,this.ms);b.del=this.del,b.times=w.floor(x(a,0))||1;return b},a.animation=function(b,c,d,e){if(b instanceof cq)return b;if(a.is(d,"function")||!d)e=e||d||null,d=null;b=Object(b),c=+c||0;var f={},h,i;for(i in b)b[g](i)&&Q(i)!=i&&Q(i)+"%"!=i&&(h=!0,f[i]=b[i]);if(!h)return new cq(b,c);d&&(f.easing=d),e&&(f.callback=e);return new cq({100:f},c)},b_.animate=function(b,c,d,e){var f=this;if(f.removed){e&&e.call(f);return f}var g=b instanceof cq?b:a.animation(b,c,d,e);cr(g,f,g.percents[0],null,f.attr());return f},b_.setTime=function(a,b){a&&b!=null&&this.status(a,y(b,a.ms)/a.ms);return this},b_.status=function(a,b){var c=[],d=0,e,f;if(b!=null){cr(a,this,-1,y(b,1));return this}e=cl.length;for(;d.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;b.gradient&&(p.defs.removeChild(b.gradient),delete b.gradient),k=k.replace(/[\(\)\s,\xb0#]/g,"-"),s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x1?E.opacity/100:E.opacity});case"stroke":E=a.getRGB(p),i.setAttribute(o,E.hex),o=="stroke"&&E[b]("opacity")&&q(i,{"stroke-opacity":E.opacity>1?E.opacity/100:E.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&w(d,d._.arrows.startString),"endString"in d._.arrows&&w(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&u(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){F=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),F&&(G=F.getElementsByTagName("stop"),q(G[G.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var H=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[H]=p,d._.dirty=1,i.setAttribute(o,p)}}B(d,f),i.style.visibility=m},A=1.2,B=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n"));var Y=V.getBoundingClientRect();t.W=m.w=(Y.right-Y.left)/W,t.H=m.h=(Y.bottom-Y.top)/W,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var Z=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var $=0,_=Z.length;$<_;$++)if(Z[$]in i){t._.dirty=1;break}switch(m["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}},addGradientFill=function(b,f,g){b.attrs=b.attrs||{};var h=b.attrs,i=Math.pow,j,k,l="linear",m=".5 .5";b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){l="radial",b&&c&&(b=d(b),c=d(c),i(b-.5,2)+i(c-.5,2)>.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s')}}catch(c){B=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};C(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=removed(b);return!0};var D=a.st;for(var E in A)A[b](E)&&!D[b](E)&&(D[E]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(E))}(window.Raphael) \ No newline at end of file diff --git a/addons/web_diagram/static/src/css/base_diagram.css b/addons/web_diagram/static/src/css/base_diagram.css index 9ba2f6b0c83..0dd8483fdc4 100644 --- a/addons/web_diagram/static/src/css/base_diagram.css +++ b/addons/web_diagram/static/src/css/base_diagram.css @@ -1,13 +1,3 @@ -.openerp .diagram { - border: 1px solid #999; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; -} - -.openerp .show_grid { - background: url("/web_diagram/static/src/img/grid.jpg") repeat; -} - .openerp .oe_diagram_pager { text-align: right; white-space: nowrap; diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index b4aa62fd8f0..e4fb3ef5b75 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -4,7 +4,6 @@ openerp.web_diagram = function (openerp) { var QWeb = openerp.web.qweb; -QWeb.add_template('/web_diagram/static/src/xml/base_diagram.xml'); openerp.web.views.add('diagram', 'openerp.web.DiagramView'); openerp.web.DiagramView = openerp.web.View.extend({ searchable: false, @@ -54,11 +53,6 @@ openerp.web.DiagramView = openerp.web.View.extend({ // New Node,Edge this.$element.find('#new_node.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.node);}); - this.$element.find('#new_edge.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.connector);}); - - this.$element.find('#toggle_grid').click(function() { - self.$element.find('.diagram').toggleClass('show_grid'); - }); if(this.id) { self.get_diagram_info(); @@ -113,8 +107,25 @@ openerp.web.DiagramView = openerp.web.View.extend({ this.get_diagram_info(); } }, - + select_node: function (node, element) { + if (!this.selected_node) { + this.selected_node = node; + element.attr('stroke', 'red'); + return; + } + // Re-click selected node, deselect it + if (node.id === this.selected_node.id) { + this.selected_node = null; + element.attr('stroke', 'black'); + return; + } + this.add_edit_node(null, this.connector, { + act_from: this.selected_node.id, + act_to: node.id + }); + }, draw_diagram: function(result) { + this.selected_node = null; var diagram = new Graph(); this.active_model = result['id_model']; @@ -125,34 +136,33 @@ openerp.web.DiagramView = openerp.web.View.extend({ //Custom logic var self = this; var renderer = function(r, n) { - var node; - var set; - var shape = n.node.shape; - if(shape == 'rectangle') - shape = 'rect'; - node = r[shape](n.node.x, n.node.y).attr({ - "fill": n.node.color - }).dblclick(function() { - self.add_edit_node(n.node.id, self.node); - }); - set = r.set() - .push(node) - .push( - r.text(n.node.x, n.node.y, (n.label || n.id)) - .attr({"cursor":"pointer"}) - .dblclick(function() { - self.add_edit_node(n.node.id, self.node); - }) - ); - node.attr({cursor: "pointer"}); + var shape = (n.node.shape === 'rectangle') ? 'rect' : 'ellipse'; - if(shape == "ellipse") - node.attr({rx: "40", ry: "20"}); - else if(shape == 'rect') { + var node = r[shape](n.node.x, n.node.y).attr({ + "fill": n.node.color + }); + + var nodes = r.set(node, r.text(n.node.x, n.node.y, (n.label || n.id))) + .attr("cursor", "pointer") + .dblclick(function() { + self.add_edit_node(n.node.id, self.node); + }) + .mousedown(function () { node.moved = false; }) + .mousemove(function () { node.moved = true; }) + .click(function () { + // Ignore click from move event + if (node.moved) { return; } + self.select_node(n.node, node); + }); + + if (shape === 'rect') { node.attr({width: "60", height: "44"}); node.next.attr({"text-anchor": "middle", x: n.node.x + 20, y: n.node.y + 20}); + } else { + node.attr({rx: "40", ry: "20"}); } - return set; + + return nodes; }; _.each(res_nodes, function(res_node) { @@ -167,10 +177,7 @@ openerp.web.DiagramView = openerp.web.View.extend({ diagram.addEdge(connector['source'], connector['destination'], {directed : true, label: connector['signal']}); }); - - if ($('div#dia-canvas').children().length > 0) { - $('div#dia-canvas').children().remove(); - } + self.$element.find('.diagram').empty(); var layouter = new Graph.Layout.Ordered(diagram); var render_diagram = new Graph.Renderer.Raphael('dia-canvas', diagram, $('div#dia-canvas').width(), $('div#dia-canvas').height()); @@ -184,7 +191,8 @@ openerp.web.DiagramView = openerp.web.View.extend({ }); }, - add_edit_node: function(id, model) { + add_edit_node: function(id, model, defaults) { + defaults = defaults || {}; var self = this; if(!model) @@ -253,6 +261,15 @@ openerp.web.DiagramView = openerp.web.View.extend({ }); }); } + if (!_.isEmpty(defaults)) { + form_controller.on_record_loaded.add_last(function () { + _(form_fields).each(function (field) { + if (!defaults[field]) { return; } + form_controller.fields[field].set_value(defaults[field]); + form_controller.fields[field].dirty = true; + }); + }); + } }, on_pager_action: function(action) { diff --git a/addons/web_diagram/static/src/xml/base_diagram.xml b/addons/web_diagram/static/src/xml/base_diagram.xml index 7867befa957..20613c7b079 100644 --- a/addons/web_diagram/static/src/xml/base_diagram.xml +++ b/addons/web_diagram/static/src/xml/base_diagram.xml @@ -3,8 +3,6 @@
          - -
          @@ -16,6 +14,6 @@
          -
          +
          diff --git a/addons/web_gantt/__openerp__.py b/addons/web_gantt/__openerp__.py index d2b24f96d08..cd24a8f7314 100644 --- a/addons/web_gantt/__openerp__.py +++ b/addons/web_gantt/__openerp__.py @@ -9,5 +9,8 @@ 'static/src/js/gantt.js' ], "css": ['static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css'], + 'qweb' : [ + "static/src/xml/*.xml", + ], 'active': True } diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 73e244edad7..d2eb3aed899 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -3,7 +3,6 @@ *---------------------------------------------------------*/ openerp.web_gantt = function (openerp) { var QWeb = openerp.web.qweb; -QWeb.add_template('/web_gantt/static/src/xml/web_gantt.xml'); openerp.web.views.add('gantt', 'openerp.web_gantt.GanttView'); openerp.web_gantt.GanttView = openerp.web.View.extend({ @@ -43,7 +42,7 @@ init: function(parent, dataset, view_id) { this.name = this.fields_view.arch.attrs.string; this.view_id = this.fields_view.view_id; - + this.date_start = this.fields_view.arch.attrs.date_start; this.date_delay = this.fields_view.arch.attrs.date_delay; this.date_stop = this.fields_view.arch.attrs.date_stop; @@ -71,7 +70,7 @@ init: function(parent, dataset, view_id) { ganttChartControl.setImagePath("/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/"); ganttChartControl.setEditable(true); ganttChartControl.showTreePanel(true); - ganttChartControl.showContextMenu(true); + ganttChartControl.showContextMenu(false); ganttChartControl.showDescTask(true,'d,s-f'); ganttChartControl.showDescProject(true,'n,d'); @@ -228,7 +227,7 @@ init: function(parent, dataset, view_id) { var evt_date = ""; var evt_duration = ""; var evt_end_date = ""; - + var project_tree_field = []; for (var i in final_events){ evt_id = final_events[i]; evt_date = all_events[evt_id]['evt'][2]; @@ -254,7 +253,7 @@ init: function(parent, dataset, view_id) { self.render_events(all_events, 0); } - for (var i in final_events){ + for (var i in final_events) { evt_id = final_events[i]; res = all_events[evt_id]; task=new GanttTaskInfo(res['evt'][0], res['evt'][1], res['evt'][2], res['evt'][3], res['evt'][4], "",res['evt'][6]); @@ -278,8 +277,9 @@ init: function(parent, dataset, view_id) { ganttChartControl.attachEvent("onTaskStartDrag", function(task) {self.on_drag_start(task);}); ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_resize_drag_end(task, "resize");}); ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_resize_drag_end(task, "drag");}); + ganttChartControl.attachEvent("onTaskDblClick", function(task) {self.open_popup(task);}); - + var taskdiv = jQuery("div.taskPanel").parent(); taskdiv.addClass('ganttTaskPanel'); taskdiv.prev().addClass('ganttDayPanel'); @@ -293,7 +293,7 @@ init: function(parent, dataset, view_id) { self.set_width(); }); - jQuery(window).bind('resize',function(){ + jQuery(window).bind('resize',function() { window.clearTimeout(ganttChartControl._resize_timer); ganttChartControl._resize_timer = window.setTimeout(function(){ self.reload_gantt(); @@ -385,53 +385,46 @@ init: function(parent, dataset, view_id) { }, open_popup : function(task) { + var self = this; var event_id = task.getId(); if(event_id.toString().search("_") != -1) return; if(event_id) event_id = parseInt(event_id, 10); + + var action_manager = new openerp.web.ActionManager(this); + + var dialog = new openerp.web.Dialog(this, { + width: 800, + height: 600, + buttons : { + Cancel : function() { + $(this).dialog('destroy'); + }, + Save : function() { + var form_view = action_manager.inner_viewmanager.views.form.controller; - var action = { - "res_model": this.dataset.model, - "res_id": event_id, - "views":[[false,"form"]], - "type":"ir.actions.act_window", - "view_type":"form", - "view_mode":"form" - }; - - action.flags = { - search_view: false, - sidebar : false, - views_switcher : false, - pager: false - }; - var element_id = _.uniqueId("act_window_dialog"); - var dialog = jQuery('
          ', { - 'id': element_id - }).dialog({ - modal: true, - width: 'auto', - height: 'auto', - buttons: { - Cancel: function() { - $(this).dialog("destroy"); - }, - Save: function() { - var view_manager = action_manager.viewmanager; - var _dialog = this; - view_manager.views[view_manager.active_view].controller.do_save(function(r) { - $(_dialog).dialog("destroy"); - self.reload_gantt(); - }) - } + form_view.do_save(function() { + self.get_events(); + }); + $(this).dialog('destroy'); } + } + }).start().open(); + action_manager.appendTo(dialog.$element); + action_manager.do_action({ + res_model : this.dataset.model, + res_id: event_id, + views : [[false, 'form']], + type : 'ir.actions.act_window', + auto_search : false, + flags : { + search_view: false, + sidebar : false, + views_switcher : false, + action_buttons : false, + pager: false + } }); - var action_manager = new openerp.web.ActionManager(this, element_id); - action_manager.start(); - action_manager.do_action(action); - - //Default_get - if(!event_id) action_manager.viewmanager.dataset.index = null; }, on_drag_start : function(task){ diff --git a/addons/web_graph/__openerp__.py b/addons/web_graph/__openerp__.py index 68775b7c0e3..d7c37acb180 100644 --- a/addons/web_graph/__openerp__.py +++ b/addons/web_graph/__openerp__.py @@ -7,5 +7,8 @@ "static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.js", "static/src/js/graph.js"], "css": ["static/lib/dhtmlxGraph/codebase/dhtmlxchart.css"], + 'qweb' : [ + "static/src/xml/*.xml", + ], "active": True } diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index bac147b1a91..04e9d77f5d0 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -13,7 +13,6 @@ var COLOR_PALETTE = [ '#cc0000', '#d400a8']; var QWeb = openerp.web.qweb; -QWeb.add_template('/web_graph/static/src/xml/web_graph.xml'); openerp.web.views.add('graph', 'openerp.web_graph.GraphView'); openerp.web_graph.GraphView = openerp.web.View.extend({ @@ -29,6 +28,14 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.columns = []; this.group_field = null; this.is_loaded = $.Deferred(); + + this.renderer = null; + }, + stop: function () { + if (this.renderer) { + clearTimeout(this.renderer); + } + this._super(); }, do_show: function () { this.$element.show(); @@ -256,90 +263,113 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ x_axis = abscissa_description; y_axis = ordinate_description; } - - var bar_chart = new dhtmlXChart({ - view: view_chart, - container: this.element_id+"-barchart", - value:"#"+group_list[0].group+"#", - gradient: "3d", - border: false, - width: 1024, - tooltip:{ - template: _.sprintf("#%s#, %s=#%s#", - this.abscissa, group_list[0].text, group_list[0].group) - }, - radius: 0, - color:group_list[0].color, - origin:0, - xAxis: x_axis, - yAxis: y_axis, - padding: { - left: 75 - }, - legend: { - values: group_list, - align:"left", - valign:"top", - layout: "x", - marker: { - type:"round", - width:12 - } + + var renderer = function () { + if (self.$element.is(':hidden')) { + self.renderer = setTimeout(renderer, 100); + return; } - }); - for (var m = 1; m 0) { - drag_handel = ".oe_kanban_draghandle"; - } - if (!this.group_by.length) { - drag_handel = true; - } - this.$element.find(".oe_column").sortable({ - connectWith: ".oe_column", - handle : drag_handel, - start: function(event, ui) { - self.source_index['index'] = ui.item.index(); - self.source_index['column'] = ui.item.parent().attr('id'); - }, - stop: self.on_receive_record, - scroll: false - }); - this.$element.find(".oe_column").disableSelection() - this.$element.find('button.oe_kanban_button_new').click(this.do_add_record); - this.$element.find(".fold-columns-icon").click(function(event) { - self.do_fold_unfold_columns(event, this.id); - }); - }, - do_fold_unfold_columns: function(event, element_id) { - var column_id = "column_" + element_id; - var column_element = this.$element.find("#" + column_id + " .oe_fold_column"); - if (column_element.is(":hidden")) { - this.$element.find("#" + column_id).find("img.fold-columns-icon").attr('src', '/web_kanban/static/src/img/minus-icon.png'); - column_element.show(); - this.$element.find("#" + column_id + ".oe_table_column").css("width",Math.round(99 / this.all_display_data.length) + "%"); - this.$element.find("#" + column_id + ".oe_vertical_text").hide(); - } - else{ - this.$element.find("#" + column_id).find("img.fold-columns-icon").attr('src', '/web_kanban/static/src/img/plus-icon.png'); - column_element.hide(); - this.$element.find("#" + column_id + ".oe_table_column").css("width","0.5%"); - this.$element.find("#" + column_id + ".oe_vertical_text").show(); - } - - }, - do_record_group: function() { - if (this.NO_OF_COLUMNS && this.all_display_data.length > 0) { - var records = this.all_display_data[0].records; - var record_per_group = Math.round((records).length / this.NO_OF_COLUMNS); - this.all_display_data = []; - for (var i=0, ii=this.NO_OF_COLUMNS; i < ii; i++) { - this.all_display_data.push({'records': records.slice(0,record_per_group), 'value':i, 'header' : false, 'ids':[]}); - records.splice(0,record_per_group); - } - } - }, - on_button_click: function (button_attrs, record_id) { - this.on_execute_button_click(this.dataset, button_attrs, record_id); - }, do_add_record: function() { this.dataset.index = null; this.do_switch_view('form'); }, - do_edit_record: function(record_id) { + do_search: function(domain, context, group_by) { var self = this; - this.form_dialog.select_id(record_id).then(function() { - self.form_dialog.open(); + this.search_domain = domain; + this.search_context = context; + this.search_group_by = group_by; + $.when(this.has_been_loaded).then(function() { + self.group_by = group_by.length ? group_by[0] : self.fields_view.arch.attrs.default_group_by; + self.datagroup = new openerp.web.DataGroup(self, self.dataset.model, domain, context, self.group_by ? [self.group_by] : []); + self.datagroup.list(self.fields_keys, self.do_process_groups, self.do_process_dataset); }); }, - on_record_saved: function(r) { - var id = this.form_dialog.form.datarecord.id; - this.on_reload_record(id); - }, - do_change_color: function(record_id, $e) { + do_process_groups: function(groups) { + this.do_clear_groups(); + this.dataset.ids = []; var self = this, - id = record_id, - colors = '#FFC7C7,#FFF1C7,#E3FFC7,#C7FFD5,#C7FFFF,#C7D5FF,#E3C7FF,#FFC7F1'.split(','), - $cpicker = $(QWeb.render('KanbanColorPicker', { colors : colors, columns: 2 })); - $e.after($cpicker); - $cpicker.mouseenter(function() { - clearTimeout($cpicker.data('timeoutId')); - }).mouseleave(function(evt) { - var timeoutId = setTimeout(function() { $cpicker.remove() }, 500); - $cpicker.data('timeoutId', timeoutId); - }); - $cpicker.find('a').click(function(evt) { - var data = {}; - data[$e.data('name')] = $(this).data('color'); - self.dataset.write(id, data, {}, function() { - self.on_reload_record(id); - }); - $cpicker.remove(); - return false; - }); - }, - /** - Reload one record in view. - record_id : reload record id. - */ - on_reload_record: function (record_id){ - var self = this; - this.dataset.read_ids([record_id], _.keys(self.fields_view.fields), function (records) { - if (records.length > 0) { - for (var i=0, ii=self.all_display_data.length; i < ii; i++) { - for(j=0, jj=self.all_display_data[i].records.length; j < jj; j++) { - if (self.all_display_data[i].records[j].id == record_id) { - _.extend(self.all_display_data[i].records[j], records[0]); - self.$element.find("#main_" + record_id).children().remove(); - self.$element.find("#main_" + record_id).append(self.qweb.render('kanban-box', { - record: self.do_transform_record(self.all_display_data[i].records[j]), - kanban_color: self.kanban_color, - kanban_gravatar: self.kanban_gravatar - })); - break; - } - } - } - self.$element.find("#main_" + record_id + " .oe_kanban_action").click(self.on_action_clicked); - self.$element.find("#main_" + record_id + " .oe_kanban_box_show_onclick_trigger").click(function() { - $(this).parent("#main_" + record_id + " .oe_kanban_box").find(".oe_kanban_box_show_onclick").toggle(); - }); - } - }); - - }, - do_delete: function (id) { - var self = this; - return $.when(this.dataset.unlink([id])).then(function () { - self.drop_records(id); - }); - }, - drop_records: function (id) { - var self = this; - _.each(self.all_display_data, function(data, index) { - _.each(data.records, function(record, index_row) { - if (parseInt(record.id) == id) { - self.all_display_data[index]['records'].splice(index_row, 1); - self.all_display_data[index]['ids'].splice(index_row, 1); - return false; - } - }); - }); - self.$element.find("#main_" + id).remove(); - }, - on_execute_button_click: function (dataset, button_attrs, record_id) { - var self = this; - this.do_execute_action( - button_attrs, dataset, - record_id, function () { - self.on_reload_record(record_id); - } - ); - }, - on_receive_record: function (event, ui) { - var self = this; - var from = ui.item.index(); - var search_action = false; - var to = ui.item.prev().index() || 0; - if (!ui.item.attr("id")) { - return false; - } - if (self.fields_view.fields.sequence != undefined && ((self.source_index.index >= 0 && self.source_index.index != from) || - (self.source_index.column && self.source_index.column != ui.item.parent().attr('id')))) { - var child_record = ui.item.parent().children(); - var data, sequence = 1, index = to; - child_record.splice(0, to); - var flag = false; - if (to >= 0 && child_record) { - var record_id = parseInt($(child_record).attr("id").split("_")[1]); - if (record_id) { - _.each(self.all_display_data, function(data, index) { - _.each(data.records, function(record, index_row) { - if(record_id == record.id && record.sequence) { - sequence = record.sequence; - flag = true; - return false; - } - }); - if(flag) {return false;} - }); - } - } - _.each(child_record, function (child) { - var child_id = parseInt($(child).attr("id").split("_")[1]); - if (child_id) { - flag = false; - _.each(self.all_display_data, function(data, index) { - _.each(data.records, function(record, index_row) { - if(parseInt(record.id) == child_id) { - self.all_display_data[index]['records'][index_row]['sequence'] = sequence; - flag = true; - return false; - } - }); - if (flag) {return false;} - }); - self.dataset.write(child_id, {sequence: sequence}); - sequence++; - search_action = true; - } - }); - } - if (self.group_by.length > 0 && self.source_index.column && self.source_index.column != ui.item.parent().attr('id')) { - var value = ui.item.closest("td").attr("id"); - if (value) { - var data_val = {}; - var wirte_id = parseInt(ui.item.attr("id").split("_")[1]); - value = value.split("_")[1]; - if (value == 'false') { - value = false; - } - var update_record = false; - _.each(self.all_display_data, function(data, index) { - _.each(data.records, function(record, index_row) { - if(parseInt(record.id) == wirte_id) { - self.all_display_data[index]['records'][index_row][self.group_by[0]] = value; - update_record = self.all_display_data[index]['records'].splice(index_row,1) - return false; - } - }); - if (update_record) {return false;} - }); - _.each(self.all_display_data, function(data, index) { - if (data.value == value || (data.value == 'false' && value == false)) { - self.all_display_data[index]['records'].push(update_record[0]); - } - }); - data_val[self.group_by[0]] = value; - self.dataset.write(wirte_id, data_val); - search_action = true; - } - } - if (search_action) { - self.on_reload_kanban(); - } - this.source_index = {}; - }, - on_reload_kanban: function (){ - var self = this; - _.each(self.all_display_data, function(data, index) { - if (data.records.length > 0){ - _.each(data.records, function(record) { - self.$element.find("#main_" + record.id).children().remove(); - self.$element.find("#main_" + record.id).append(self.qweb.render('kanban-box', { - record: self.do_transform_record(record), - kanban_color: self.kanban_color, - kanban_gravatar: self.kanban_gravatar - })); - }); - } - }); - this.$element.find('.oe_kanban_action').click(this.on_action_clicked); - this.$element.find('.oe_kanban_box_show_onclick_trigger').click(function() { - $(this).parent('.oe_kanban_box').find('.oe_kanban_box_show_onclick').toggle(); - }); - }, - on_action_clicked: function(evt) { - evt.preventDefault(); - var $action = $(evt.currentTarget), - record_id = parseInt($action.closest(".oe_kanban_record").attr("id").split('_')[1]), - type = $action.data('type'); - if (type == 'delete') { - this.do_delete(record_id); - } else if (type == 'edit') { - this.do_edit_record(record_id); - } else if (type == 'color') { - this.do_change_color(record_id, $action); - } else { - var button_attrs = $action.data(); - this.on_button_click(button_attrs, record_id); - } - }, - do_transform_record: function(record) { - var self = this, - new_record = {}; - _.each(record, function(value, name) { - var r = _.clone(self.fields_view.fields[name]); - r.raw_value = value; - r.value = openerp.web.format_value(value, r); - new_record[name] = r; - }); - return new_record; - }, - do_search: function (domain, context, group_by) { - var self = this; - self.group_by = group_by; - var self = this, - group_by = self.group_by; - if (!group_by.length && this.fields_view.arch.attrs.default_group_by) { - group_by = [this.fields_view.arch.attrs.default_group_by]; - self.group_by = group_by; - } - self.datagroup = new openerp.web.DataGroup(self, self.model, domain, context, group_by); - self.datagroup.list( - _.keys(self.fields_view.fields), - function (groups) { - self.groups = groups; - if (groups.length) { - self.do_render_group(groups); - } else { - self.all_display_data = []; - self.on_show_data(); - } - }, - function (dataset) { - self.groups = []; - self.dataset.read_slice(_.keys(self.fields_view.fields), {}, function(records) { - if (records.length) { - self.all_display_data = [{'records': records, 'value':false, 'header' : false, 'ids': self.dataset.ids}]; - } else { - self.all_display_data = []; - } - self.$element.find(".oe_kanban_view").remove(); - self.on_show_data(); - }); - } - ); - }, - do_render_group : function (datagroups) { - this.all_display_data = []; - var self = this; - _.each(datagroups, function (group) { - var group_name = group.value; - var group_value = group.value; - if (!group.value) { - group_name = "Undefined"; - group_value = 'false'; - } else if (group.value instanceof Array) { + remaining = groups.length - 1, + groups_array = []; + _.each(groups, function (group, index) { + var group_name = group.value, + group_value = group.value, + group_aggregates = {}; + if (group.value instanceof Array) { group_name = group.value[1]; group_value = group.value[0]; } - var group_aggregates = {}; _.each(self.aggregates, function(value, key) { group_aggregates[value] = group.aggregates[key]; }); var dataset = new openerp.web.DataSetSearch(self, self.dataset.model, group.context, group.domain); - dataset.read_slice(_.keys(self.fields_view.fields), {'domain': group.domain, 'context': group.context}, function(records) { - self.all_display_data.push({"value" : group_value, "records": records, 'header':group_name, 'ids': dataset.ids, 'aggregates': group_aggregates}); - if (datagroups.length == self.all_display_data.length) { - self.$element.find(".oe_kanban_view").remove(); - self.on_show_data(); + dataset.read_slice(self.fields_keys, {'domain': group.domain, 'context': group.context}, function(records) { + self.dataset.ids.push.apply(self.dataset.ids, dataset.ids); + groups_array[index] = new openerp.web_kanban.KanbanGroup(self, records, group_value, group_name, group_aggregates); + if (!remaining--) { + self.dataset.index = self.dataset.ids.length ? 0 : null; + self.do_add_groups(groups_array); } }); }); }, + do_process_dataset: function(dataset) { + var self = this; + this.do_clear_groups(); + this.dataset.read_slice(this.fields_keys, {}, function(records) { + var groups = []; + while (records.length) { + for (var i = 0; i < self.default_nr_columns; i++) { + if (!groups[i]) { + groups[i] = []; + } + groups[i].push(records.shift()); + } + } + for (var i = 0; i < groups.length; i++) { + groups[i] = new openerp.web_kanban.KanbanGroup(self, _.compact(groups[i])); + } + self.do_add_groups(groups); + }); + }, + do_reload: function() { + this.do_search(this.search_domain, this.search_context, this.search_group_by); + }, + do_clear_groups: function() { + _.each(this.groups, function(group) { + group.stop(); + }); + this.groups = []; + this.$element.find('.oe_kanban_groups_headers, .oe_kanban_groups_records').empty(); + }, + do_add_groups: function(groups) { + var self = this; + _.each(groups, function(group) { + self.groups[group.undefined_title ? 'unshift' : 'push'](group); + }); + _.each(this.groups, function(group) { + group.appendTo(self.$element.find('.oe_kanban_groups_headers')); + }); + this.on_groups_started(); + }, + on_groups_started: function() { + var self = this; + this.compute_groups_width(); + if (this.group_by) { + this.$element.find('.oe_kanban_column').sortable({ + connectWith: '.oe_kanban_column', + handle : '.oe_kanban_draghandle', + start: function(event, ui) { + self.currently_dragging.index = ui.item.index(); + self.currently_dragging.group = ui.item.parents('.oe_kanban_column:first').data('widget'); + }, + stop: function(event, ui) { + var record = ui.item.data('widget'), + old_index = self.currently_dragging.index, + new_index = ui.item.index(), + old_group = self.currently_dragging.group, + new_group = ui.item.parents('.oe_kanban_column:first').data('widget'); + if (!(old_group.title === new_group.title && old_group.value === new_group.value && old_index == new_index)) { + self.on_record_moved(record, old_group, old_index, new_group, new_index); + } + }, + scroll: false + }); + } else { + this.$element.find('.oe_kanban_draghandle').removeClass('oe_kanban_draghandle'); + } + }, + on_record_moved : function(record, old_group, old_index, new_group, new_index) { + if (old_group === new_group) { + new_group.records.splice(old_index, 1); + new_group.records.splice(new_index, 0, record); + new_group.do_save_sequences(); + } else { + old_group.records.splice(old_index, 1); + new_group.records.splice(new_index, 0, record); + record.group = new_group; + var data = {}; + data[this.group_by] = new_group.value; + this.dataset.write(record.id, data, {}, function() { + record.do_reload(); + new_group.do_save_sequences(); + }); + } + }, do_show: function () { this.$element.show(); }, do_hide: function () { this.$element.hide(); + }, + compute_groups_width: function() { + var unfolded = 0; + _.each(this.groups, function(group) { + unfolded += group.state.folded ? 0 : 1; + group.$element.css('width', ''); + }); + _.each(this.groups, function(group) { + if (!group.state.folded) { + group.$element.css('width', Math.round(100/unfolded) + '%'); + } + }); + } +}); + +openerp.web_kanban.KanbanGroup = openerp.web.Widget.extend({ + template: 'KanbanView.group_header', + init: function (parent, records, value, title, aggregates) { + var self = this; + this._super(parent); + this.view = parent; + this.value = value; + this.title = title; + if (title === false) { + this.title = _t('Undefined'); + this.undefined_title = true; + } + this.aggregates = aggregates || {}; + var key = this.view.group_by + '-' + value; + if (!this.view.state.groups[key]) { + this.view.state.groups[key] = { + folded: false + } + } + this.state = this.view.state.groups[key]; + this.$records = null; + this.records = _.map(records, function(record) { + return new openerp.web_kanban.KanbanRecord(self, record); + }); + }, + start: function() { + var self = this, + def = this._super(); + this.$records = $(QWeb.render('KanbanView.group_records_container', { widget : this})); + this.$records.appendTo(this.view.$element.find('.oe_kanban_groups_records')); + _.each(this.records, function(record) { + record.appendTo(self.$records); + }); + this.$element.find(".oe_kanban_fold_icon").click(function() { + self.do_toggle_fold(); + self.view.compute_groups_width(); + return false; + }); + if (this.state.folded) { + this.do_toggle_fold(); + } + this.$element.data('widget', this); + this.$records.data('widget', this); + return def; + }, + stop: function() { + this._super(); + if (this.$records) { + this.$records.remove(); + } + }, + remove_record: function(id, remove_from_dataset) { + for (var i = 0, ii = this.records.length; i < ii; i++) { + if (this.records[i]['id'] === id) { + this.records.splice(i, 1); + } + } + }, + do_toggle_fold: function(compute_width) { + this.$element.toggleClass('oe_kanban_group_folded'); + this.$records.find('.oe_kanban_record').toggle(); + this.state.folded = this.$element.is('.oe_kanban_group_folded'); + }, + do_save_sequences: function() { + var self = this; + if (_.indexOf(this.view.fields_keys, 'sequence') > -1) { + _.each(this.records, function(record, index) { + self.view.dataset.write(record.id, { sequence : index }); + }); + } + } +}); + +openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({ + template: 'KanbanView.record', + init: function (parent, record) { + this._super(parent); + this.group = parent; + this.view = parent.view; + this.id = null; + this.set_record(record); + if (!this.view.state.records[this.id]) { + this.view.state.records[this.id] = { + folded: false + }; + } + this.state = this.view.state.records[this.id]; + }, + set_record: function(record) { + this.id = record.id; + this.record = this.transform_record(record); + }, + start: function() { + this._super(); + this.$element.data('widget', this); + this.bind_events(); + }, + transform_record: function(record) { + var self = this, + new_record = {}; + _.each(record, function(value, name) { + var r = _.clone(self.view.fields_view.fields[name]); + r.raw_value = value; + r.value = openerp.web.format_value(value, r); + new_record[name] = r; + }); + return new_record; + }, + render: function() { + var ctx = { + record: this.record, + widget: this + } + for (var p in this) { + if (_.startsWith(p, 'kanban_')) { + ctx[p] = _.bind(this[p], this); + } + } + return this._super({ + 'content': this.view.qweb.render('kanban-box', ctx) + }); + }, + bind_events: function() { + var self = this, + $show_on_click = self.$element.find('.oe_kanban_box_show_onclick'); + $show_on_click.toggle(this.state.folded); + this.$element.find('.oe_kanban_box_show_onclick_trigger').click(function() { + $show_on_click.toggle(); + self.state.folded = !self.state.folded; + }); + this.$element.find('.oe_kanban_action').click(function() { + var $action = $(this), + type = $action.data('type') || 'button', + method = 'do_action_' + type; + if (typeof self[method] === 'function') { + self[method]($action); + } else { + self.do_warn("Kanban: no action for type : " + type); + } + return false; + }); + }, + do_action_delete: function($action) { + var self = this; + if (confirm(_t("Are you sure you want to delete this record ?"))) { + return $.when(this.view.dataset.unlink([this.id])).then(function() { + self.group.remove_record(self.id) + self.stop(); + }); + } + }, + do_action_edit: function($action) { + var self = this; + if ($action.attr('target') === 'dialog') { + this.view.form_dialog.select_id(this.id).then(function() { + self.view.form_dialog.open(); + }); + } else { + if (self.view.dataset.select_id(this.id)) { + this.view.do_switch_view('form'); + } else { + this.do_warn("Kanban: could not find id#" + id); + } + } + }, + do_action_color: function($action) { + var self = this, + colors = '#FFFFFF,#CCCCCC,#FFC7C7,#FFF1C7,#E3FFC7,#C7FFD5,#C7FFFF,#C7D5FF,#E3C7FF,#FFC7F1'.split(','), + $cpicker = $(QWeb.render('KanbanColorPicker', { colors : colors, columns: 2 })); + $action.after($cpicker); + $cpicker.mouseenter(function() { + clearTimeout($cpicker.data('timeoutId')); + }).mouseleave(function(evt) { + var timeoutId = setTimeout(function() { $cpicker.remove() }, 500); + $cpicker.data('timeoutId', timeoutId); + }); + $cpicker.find('a').click(function() { + var data = {}; + data[$action.data('name')] = $(this).data('color'); + self.view.dataset.write(self.id, data, {}, function() { + self.record[$action.data('name')] = $(this).data('color'); + self.do_reload(); + }); + $cpicker.remove(); + return false; + }); + }, + do_action_object: function ($action) { + var button_attrs = $action.data(); + this.view.do_execute_action(button_attrs, this.view.dataset, this.id, this.do_reload); + }, + do_reload: function() { + var self = this; + this.view.dataset.read_ids([this.id], this.view.fields_keys, function(records) { + if (records.length) { + self.set_record(records[0]); + self.do_render(); + } else { + self.stop(); + } + }); + }, + do_render: function() { + this.$element.html(this.render()); + this.bind_events(); + }, + kanban_color: function(variable) { + var number_of_color_schemes = 10, + index = 0; + switch (typeof(variable)) { + case 'string': + for (var i=0, ii=variable.length; i - - - - - - - - - - -
          -
          - -
          -
          - -
          -
          - -
          -
          - : +
          + +
          +
          + + + + + +
          +
          + + +
          + +
          +
          +
          +
          +
            +
          • + : +
          • +
          -
          -

          -
          -
          +

          +
          +

          +
          </tr><tr> diff --git a/addons/web_mobile/po/ar.po b/addons/web_mobile/po/ar.po new file mode 100644 index 00000000000..28e21aa44bf --- /dev/null +++ b/addons/web_mobile/po/ar.po @@ -0,0 +1,66 @@ +# Arabic translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-03 15:13+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "قاعدة البيانات:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "الدخول:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "كلمة المرور:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "تسجيل الدخول" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "اسم مستخدم او كلمة مرور خاطئة" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "مفضّلة" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "التفضيلات" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "تطبيقات" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "خيارات" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "تسجيل الخروج" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" diff --git a/addons/web_mobile/po/da.po b/addons/web_mobile/po/da.po index e0dbdc552d1..d61a3cba5b8 100644 --- a/addons/web_mobile/po/da.po +++ b/addons/web_mobile/po/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/de.po b/addons/web_mobile/po/de.po index 701026b9331..ab74249a7ba 100644 --- a/addons/web_mobile/po/de.po +++ b/addons/web_mobile/po/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/es.po b/addons/web_mobile/po/es.po index 9a9e02c4893..0995630c08e 100644 --- a/addons/web_mobile/po/es.po +++ b/addons/web_mobile/po/es.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" -"X-Generator: Launchpad (build 14157)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/es_EC.po b/addons/web_mobile/po/es_EC.po index 5cff1023c4f..73dbcaea7e7 100644 --- a/addons/web_mobile/po/es_EC.po +++ b/addons/web_mobile/po/es_EC.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/et.po b/addons/web_mobile/po/et.po index 5b8d74c0c5b..c3e3994a9d9 100644 --- a/addons/web_mobile/po/et.po +++ b/addons/web_mobile/po/et.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n" -"X-Generator: Launchpad (build 14123)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/fr.po b/addons/web_mobile/po/fr.po index b64bcecfb1e..aead113ca02 100644 --- a/addons/web_mobile/po/fr.po +++ b/addons/web_mobile/po/fr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/gl.po b/addons/web_mobile/po/gl.po index 4049dfb8d1f..482a3e05f58 100644 --- a/addons/web_mobile/po/gl.po +++ b/addons/web_mobile/po/gl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/it.po b/addons/web_mobile/po/it.po index 8d155374c0a..fdfce4385f5 100644 --- a/addons/web_mobile/po/it.po +++ b/addons/web_mobile/po/it.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/nl_BE.po b/addons/web_mobile/po/nl_BE.po index f483032890b..0a1171f1fe9 100644 --- a/addons/web_mobile/po/nl_BE.po +++ b/addons/web_mobile/po/nl_BE.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/pl.po b/addons/web_mobile/po/pl.po new file mode 100644 index 00000000000..d5e04f22e00 --- /dev/null +++ b/addons/web_mobile/po/pl.po @@ -0,0 +1,66 @@ +# Polish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-11-04 16:26+0000\n" +"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n" +"X-Generator: Launchpad (build 14231)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "Baza danych:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "Login:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "Hasło:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "Login" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "Niepoprawna nazwa użytkownika lub hasło" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "Ulubione" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "Preferencje" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "Aplikacje" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "Opcje" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "Wyloguj" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr "" diff --git a/addons/web_mobile/po/sk.po b/addons/web_mobile/po/sk.po index 5e10f135cf9..d550414317a 100644 --- a/addons/web_mobile/po/sk.po +++ b/addons/web_mobile/po/sk.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" -"X-Generator: Launchpad (build 14185)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/addons/web_mobile/po/sl.po b/addons/web_mobile/po/sl.po index 041141d4824..8141108f9a9 100644 --- a/addons/web_mobile/po/sl.po +++ b/addons/web_mobile/po/sl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" -"X-Generator: Launchpad (build 14165)\n" +"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n" +"X-Generator: Launchpad (build 14197)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" diff --git a/openerp-web.py b/openerp-web similarity index 72% rename from openerp-web.py rename to openerp-web index fe33585a233..a3b3d2fa1d5 100755 --- a/openerp-web.py +++ b/openerp-web @@ -1,34 +1,29 @@ #!/usr/bin/env python +import json +import logging +import logging.config import optparse import os import sys -import json import tempfile -import logging -import logging.config import werkzeug.serving import werkzeug.contrib.fixers -path_root = os.path.dirname(os.path.abspath(__file__)) -path_addons = os.path.join(path_root, 'addons') -if path_addons not in sys.path: - sys.path.insert(0, path_addons) - optparser = optparse.OptionParser() optparser.add_option("-s", "--session-path", dest="session_storage", default=os.path.join(tempfile.gettempdir(), "oe-sessions"), - help="directory used for session storage", metavar="DIR") + help="Directory used for session storage", metavar="DIR") optparser.add_option("--server-host", dest="server_host", default='127.0.0.1', help="OpenERP server hostname", metavar="HOST") optparser.add_option("--server-port", dest="server_port", default=8069, help="OpenERP server port", type="int", metavar="NUMBER") optparser.add_option("--db-filter", dest="dbfilter", default='.*', - help="Filter listed database", metavar="REGEXP") -optparser.add_option('--addons-path', dest='addons_path', default=[path_addons], action='append', - help="Path do addons directory", metavar="PATH") + help="Filter listed databases", metavar="REGEXP") +optparser.add_option('--addons-path', dest='addons_path', default=[], action='append', + help="Path to addons directory", metavar="PATH") optparser.add_option('--load', dest='server_wide_modules', default=['web'], action='append', - help="Load a additional module before login (by default only 'web' is loaded)", metavar="MODULE") + help="Load an additional module before login (by default only 'web' is loaded)", metavar="MODULE") server_options = optparse.OptionGroup(optparser, "Server configuration") server_options.add_option("-p", "--port", dest="socket_port", default=8002, @@ -55,19 +50,39 @@ logging_opts.add_option("--log-config", dest="log_config", default=os.path.join( help="Logging configuration file", metavar="FILE") optparser.add_option_group(logging_opts) -import web.common.http if __name__ == "__main__": (options, args) = optparser.parse_args(sys.argv[1:]) - options.backend = 'xmlrpc' + if not options.addons_path: + path_root = os.path.dirname(os.path.abspath(__file__)) + path_addons = os.path.join(path_root, 'addons') + if os.path.exists(path_addons): + options.addons_path.append(path_addons) + + options.addons_path = [ + path[:-1] if path[-1] in r'\/' else path + for path in options.addons_path + if os.path.exists(path) + ] + + for path_addons in options.addons_path: + if path_addons not in sys.path: + sys.path.insert(0, path_addons) + + try: + import web.common.http + except ImportError: + optparser.error('Error Importing base web module. Check correctness of --addons-path.') + + options.backend = 'xmlrpc' os.environ["TZ"] = "UTC" - if sys.version_info >= (2, 7): + if sys.version_info >= (2, 7) and os.path.exists(options.log_config): with open(options.log_config) as file: dct = json.load(file) logging.config.dictConfig(dct) - logging.getLogger("").setLevel(getattr(logging, options.log_level.upper())) + logging.getLogger().setLevel(getattr(logging, options.log_level.upper())) else: logging.basicConfig(level=getattr(logging, options.log_level.upper())) diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 374f7308ca8..3f108685f94 --- a/setup.py +++ b/setup.py @@ -1,113 +1,73 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -import glob, os, re, setuptools, sys -from os.path import join, isfile +import os +import re +import sys +from setuptools import setup, find_packages -# List all data files -def data(): - files = [] - for root, dirnames, filenames in os.walk('openerp'): - for filename in filenames: - if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename): - files.append(os.path.join(root, filename)) - d = {} - for v in files: - k=os.path.dirname(v) - if k in d: - d[k].append(v) - else: - d[k]=[v] - r = d.items() - return r +execfile('addons/web/common/release.py') -def gen_manifest(): - file_list="\n".join(data()) - open('MANIFEST','w').write(file_list) +version_dash_incompatible = False +if 'bdist_rpm' in sys.argv: + version_dash_incompatible = True +try: + import py2exe + from py2exe_utils import opts + version_dash_incompatible = True +except ImportError: + opts = {} +if version_dash_incompatible: + version = version.split('-')[0] -def py2exe_options(): - if os.name == 'nt': - import py2exe - return { - "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("pixmaps","openerp-icon.ico"))], }], - 'options' : { - "py2exe": { - "skip_archive": 1, - "optimize": 2, - "dist_dir": 'dist', - "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber" "vobject", "xml", "xml", "xml.dom", "xml.xpath", "yaml", ], - "excludes" : ["Tkconstants","Tkinter","tcl"], - } - } - } - else: - return {} +FILE_PATTERNS = \ + r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$' +def find_data_files(source, patterns=FILE_PATTERNS): + file_matcher = re.compile(patterns, re.I) + out = [] + for base, _, files in os.walk(source): + cur_files = [] + for f in files: + if file_matcher.match(f): + cur_files.append(os.path.join(base, f)) + if cur_files: + out.append( + (base, cur_files)) -execfile(join(os.path.dirname(__file__), 'openerp', 'release.py')) + return out -setuptools.setup( - name = 'openerp', - version = version, - description = description, - long_description = long_desc, - url = url, - author = author, - author_email = author_email, - classifiers = filter(None, classifiers.split("\n")), - license = license, - scripts = ['openerp-server'], - data_files = data(), - packages = setuptools.find_packages(), - #include_package_data = True, - install_requires = [ - # TODO the pychart package we include in openerp corresponds to PyChart 1.37. - # It seems there is a single difference, which is a spurious print in generate_docs.py. - # It is probably safe to move to PyChart 1.39 (the latest one). - # (Let setup.py choose the latest one, and we should check we can remove pychart from - # our tree.) http://download.gna.org/pychart/ - # TODO 'pychart', - 'babel', - 'feedparser', - 'gdata', - 'lxml', - 'mako', - 'psycopg2', - 'pydot', - 'python-dateutil', - 'python-ldap', - 'python-openid', - 'pytz', - 'pywebdav', - 'pyyaml', - 'reportlab', - 'simplejson', - 'vatnumber', - 'vobject', - 'werkzeug', - 'zsi', - ], - extras_require = { - 'SSL' : ['pyopenssl'], - }, - **py2exe_options() +setup( + name=name, + version=version, + description=description, + long_description=long_description, + author=author, + author_email=author_email, + url=url, + download_url=download_url, + license=license, + install_requires=[ + "Babel >= 0.9.6", + "simplejson >= 2.0.9", + "python-dateutil >= 1.4.1", + "pytz", + "werkzeug == 0.7", + ], + tests_require=[ + 'unittest2', + 'mock', + ], + test_suite = 'unittest2.collector', + zip_safe=False, + packages=find_packages(), + classifiers=[ + 'Development Status :: 6 - Production/Stable', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Environment :: Web Environment', + 'Topic :: Office/Business :: Financial', + ], + scripts=['openerp-web'], + data_files=(find_data_files('addons') + + opts.pop('data_files', []) + ), + **opts ) -
          - +