[MERGE] from trunk

bzr revid: xmo@openerp.com-20120329110300-z4l730o4y4swmadx
This commit is contained in:
Xavier Morel 2012-03-29 13:03:00 +02:00
commit 1b0c140834
79 changed files with 12690 additions and 503 deletions

View File

@ -1,6 +1,7 @@
.* .*
*.egg-info *.egg-info
*.orig *.orig
*.vim
build/ build/
RE:^bin/ RE:^bin/
RE:^dist/ RE:^dist/

View File

@ -7,7 +7,7 @@
This module provides the core of the OpenERP web client. This module provides the core of the OpenERP web client.
""", """,
"depends" : [], "depends" : [],
'active': True, 'auto_install': True,
'post_load' : 'wsgi_postload', 'post_load' : 'wsgi_postload',
'js' : [ 'js' : [
"static/lib/datejs/globalization/en-US.js", "static/lib/datejs/globalization/en-US.js",

View File

@ -409,13 +409,8 @@ class Database(openerpweb.Controller):
dbs = [i for i in dbs if re.match(r, i)] dbs = [i for i in dbs if re.match(r, i)]
return {"db_list": dbs} return {"db_list": dbs}
@openerpweb.jsonrequest
def progress(self, req, password, id):
return req.session.proxy('db').get_progress(password, id)
@openerpweb.jsonrequest @openerpweb.jsonrequest
def create(self, req, fields): def create(self, req, fields):
params = dict(map(operator.itemgetter('name', 'value'), fields)) params = dict(map(operator.itemgetter('name', 'value'), fields))
create_attrs = ( create_attrs = (
params['super_admin_pwd'], params['super_admin_pwd'],
@ -425,17 +420,7 @@ class Database(openerpweb.Controller):
params['create_admin_pwd'] params['create_admin_pwd']
) )
try: return req.session.proxy("db").create_database(*create_attrs)
return req.session.proxy("db").create(*create_attrs)
except xmlrpclib.Fault, e:
if e.faultCode and isinstance(e.faultCode, str)\
and e.faultCode.split(':')[0] == 'AccessDenied':
return {'error': e.faultCode, 'title': 'Database creation error'}
return {
'error': "Could not create database '%s': %s" % (
params['db_name'], e.faultString),
'title': 'Database creation error'
}
@openerpweb.jsonrequest @openerpweb.jsonrequest
def drop(self, req, fields): def drop(self, req, fields):
@ -487,6 +472,50 @@ class Database(openerpweb.Controller):
return {'error': e.faultCode, 'title': 'Change Password'} return {'error': e.faultCode, 'title': 'Change Password'}
return {'error': 'Error, password not changed !', 'title': 'Change Password'} return {'error': 'Error, password not changed !', 'title': 'Change Password'}
def topological_sort(modules):
""" Return a list of module names sorted so that their dependencies of the
modules are listed before the module itself
modules is a dict of {module_name: dependencies}
:param modules: modules to sort
:type modules: dict
:returns: list(str)
"""
dependencies = set(itertools.chain.from_iterable(modules.itervalues()))
# incoming edge: dependency on other module (if a depends on b, a has an
# incoming edge from b, aka there's an edge from b to a)
# outgoing edge: other module depending on this one
# [Tarjan 1976], http://en.wikipedia.org/wiki/Topological_sorting#Algorithms
#L ← Empty list that will contain the sorted nodes
L = []
#S ← Set of all nodes with no outgoing edges (modules on which no other
# module depends)
S = set(module for module in modules if module not in dependencies)
visited = set()
#function visit(node n)
def visit(n):
#if n has not been visited yet then
if n not in visited:
#mark n as visited
visited.add(n)
#change: n not web module, can not be resolved, ignore
if n not in modules: return
#for each node m with an edge from m to n do (dependencies of n)
for m in modules[n]:
#visit(m)
visit(m)
#add n to L
L.append(n)
#for each node n in S do
for n in S:
#visit(n)
visit(n)
return L
class Session(openerpweb.Controller): class Session(openerpweb.Controller):
_cp_path = "/web/session" _cp_path = "/web/session"
@ -554,20 +583,32 @@ class Session(openerpweb.Controller):
def modules(self, req): def modules(self, req):
# Compute available candidates module # Compute available candidates module
loadable = openerpweb.addons_manifest loadable = openerpweb.addons_manifest
loaded = req.config.server_wide_modules loaded = set(req.config.server_wide_modules)
candidates = [mod for mod in loadable if mod not in loaded] candidates = [mod for mod in loadable if mod not in loaded]
# Compute active true modules that might be on the web side only # already installed modules have no dependencies
active = set(name for name in candidates modules = dict.fromkeys(loaded, [])
if openerpweb.addons_manifest[name].get('active'))
# Compute auto_install modules that might be on the web side only
modules.update((name, openerpweb.addons_manifest[name].get('depends', []))
for name in candidates
if openerpweb.addons_manifest[name].get('auto_install'))
# Retrieve database installed modules # Retrieve database installed modules
Modules = req.session.model('ir.module.module') Modules = req.session.model('ir.module.module')
installed = set(module['name'] for module in Modules.search_read( for module in Modules.search_read(
[('state','=','installed'), ('name','in', candidates)], ['name'])) [('state','=','installed'), ('name','in', candidates)],
['name', 'dependencies_id']):
deps = module.get('dependencies_id')
if deps:
dependencies = map(
operator.itemgetter('name'),
req.session.model('ir.module.module.dependency').read(deps, ['name']))
modules[module['name']] = list(
set(modules.get(module['name'], []) + dependencies))
# Merge both sorted_modules = topological_sort(modules)
return list(active | installed) return [module for module in sorted_modules if module not in loaded]
@openerpweb.jsonrequest @openerpweb.jsonrequest
def eval_domain_and_context(self, req, contexts, domains, def eval_domain_and_context(self, req, contexts, domains,
@ -1304,10 +1345,15 @@ class SearchView(View):
filters = Model.get_filters(model) filters = Model.get_filters(model)
for filter in filters: for filter in filters:
try: try:
filter["context"] = req.session.eval_context( parsed_context = parse_context(filter["context"], req.session)
parse_context(filter["context"], req.session)) filter["context"] = (parsed_context
filter["domain"] = req.session.eval_domain( if not isinstance(parsed_context, common.nonliterals.BaseContext)
parse_domain(filter["domain"], req.session)) else req.session.eval_context(parsed_context))
parsed_domain = parse_domain(filter["domain"], req.session)
filter["domain"] = (parsed_domain
if not isinstance(parsed_domain, common.nonliterals.BaseDomain)
else req.session.eval_domain(parsed_domain))
except Exception: except Exception:
logger.exception("Failed to parse custom filter %s in %s", logger.exception("Failed to parse custom filter %s in %s",
filter['name'], model) filter['name'], model)
@ -1340,6 +1386,7 @@ class SearchView(View):
ctx = common.nonliterals.CompoundContext(context_to_save) ctx = common.nonliterals.CompoundContext(context_to_save)
ctx.session = req.session ctx.session = req.session
ctx = ctx.evaluate() ctx = ctx.evaluate()
ctx['dashboard_merge_domains_contexts'] = False # TODO: replace this 6.1 workaround by attribute on <action/>
domain = common.nonliterals.CompoundDomain(domain) domain = common.nonliterals.CompoundDomain(domain)
domain.session = req.session domain.session = req.session
domain = domain.evaluate() domain = domain.evaluate()
@ -1355,7 +1402,7 @@ class SearchView(View):
if board and 'arch' in board: if board and 'arch' in board:
xml = ElementTree.fromstring(board['arch']) xml = ElementTree.fromstring(board['arch'])
column = xml.find('./board/column') column = xml.find('./board/column')
if column: if column is not None:
new_action = ElementTree.Element('action', { new_action = ElementTree.Element('action', {
'name' : str(action_id), 'name' : str(action_id),
'string' : name, 'string' : name,

1555
addons/web/i18n/cs.po Normal file

File diff suppressed because it is too large Load Diff

1544
addons/web/i18n/nb.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n" "POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-02-16 10:56+0000\n" "PO-Revision-Date: 2012-03-28 12:49+0000\n"
"Last-Translator: Erwin <Unknown>\n" "Last-Translator: Erwin <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n" "Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-02-17 05:13+0000\n" "X-Launchpad-Export-Date: 2012-03-29 04:46+0000\n"
"X-Generator: Launchpad (build 14814)\n" "X-Generator: Launchpad (build 15032)\n"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/chrome.js:172 #: addons/web/static/src/js/chrome.js:172
@ -24,6 +24,8 @@ msgstr ""
#: addons/web/static/src/js/view_form.js:419 #: addons/web/static/src/js/view_form.js:419
#: addons/web/static/src/js/view_form.js:1233 #: addons/web/static/src/js/view_form.js:1233
#: addons/web/static/src/xml/base.xml:1695 #: addons/web/static/src/xml/base.xml:1695
#: addons/web/static/src/js/view_form.js:424
#: addons/web/static/src/js/view_form.js:1239
msgid "Ok" msgid "Ok"
msgstr "Ok" msgstr "Ok"
@ -92,6 +94,8 @@ msgstr "Voorkeuren"
#: addons/web/static/src/xml/base.xml:1496 #: addons/web/static/src/xml/base.xml:1496
#: addons/web/static/src/xml/base.xml:1506 #: addons/web/static/src/xml/base.xml:1506
#: addons/web/static/src/xml/base.xml:1515 #: addons/web/static/src/xml/base.xml:1515
#: addons/web/static/src/js/search.js:293
#: addons/web/static/src/js/view_form.js:1234
msgid "Cancel" msgid "Cancel"
msgstr "Annuleren" msgstr "Annuleren"
@ -103,7 +107,8 @@ msgstr "Wachtwoord wijzigen"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/chrome.js:792 #: addons/web/static/src/js/chrome.js:792
#: addons/web/static/src/js/view_editor.js:73 #: addons/web/static/src/js/view_editor.js:73
#: addons/web/static/src/js/views.js:962 addons/web/static/src/xml/base.xml:737 #: addons/web/static/src/js/views.js:962
#: addons/web/static/src/xml/base.xml:737
#: addons/web/static/src/xml/base.xml:1500 #: addons/web/static/src/xml/base.xml:1500
#: addons/web/static/src/xml/base.xml:1514 #: addons/web/static/src/xml/base.xml:1514
msgid "Save" msgid "Save"
@ -118,11 +123,13 @@ msgstr "Wachtwoord wijzigen"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/chrome.js:1096 #: addons/web/static/src/js/chrome.js:1096
#: addons/web/static/src/js/chrome.js:1100
msgid "OpenERP - Unsupported/Community Version" msgid "OpenERP - Unsupported/Community Version"
msgstr "OpenERP - Unsupported/Community Version" msgstr "OpenERP - Unsupported/Community Version"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/chrome.js:1131 #: addons/web/static/src/js/chrome.js:1131
#: addons/web/static/src/js/chrome.js:1135
msgid "Client Error" msgid "Client Error"
msgstr "Cliënt fout" msgstr "Cliënt fout"
@ -139,6 +146,8 @@ msgstr "Gegevens exporteren"
#: addons/web/static/src/js/view_form.js:692 #: addons/web/static/src/js/view_form.js:692
#: addons/web/static/src/js/view_form.js:3044 #: addons/web/static/src/js/view_form.js:3044
#: addons/web/static/src/js/views.js:963 #: addons/web/static/src/js/views.js:963
#: addons/web/static/src/js/view_form.js:698
#: addons/web/static/src/js/view_form.js:3067
msgid "Close" msgid "Close"
msgstr "Sluiten" msgstr "Sluiten"
@ -180,11 +189,14 @@ msgstr "Externe ID"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/formats.js:300 #: addons/web/static/src/js/formats.js:300
#: addons/web/static/src/js/view_page.js:245 #: addons/web/static/src/js/view_page.js:245
#: addons/web/static/src/js/formats.js:322
#: addons/web/static/src/js/view_page.js:251
msgid "Download" msgid "Download"
msgstr "Downloaden" msgstr "Downloaden"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/formats.js:305 #: addons/web/static/src/js/formats.js:305
#: addons/web/static/src/js/formats.js:327
#, python-format #, python-format
msgid "Download \"%s\"" msgid "Download \"%s\""
msgstr "Download \"%s\"" msgstr "Download \"%s\""
@ -202,59 +214,70 @@ msgstr "Filter regel"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:242 #: addons/web/static/src/js/search.js:242
#: addons/web/static/src/js/search.js:291 #: addons/web/static/src/js/search.js:291
#: addons/web/static/src/js/search.js:296
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:286 #: addons/web/static/src/js/search.js:286
#: addons/web/static/src/xml/base.xml:1292 #: addons/web/static/src/xml/base.xml:1292
#: addons/web/static/src/js/search.js:291
msgid "Add to Dashboard" msgid "Add to Dashboard"
msgstr "Aan dashboard toevoegen" msgstr "Aan dashboard toevoegen"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:415 #: addons/web/static/src/js/search.js:415
#: addons/web/static/src/js/search.js:420
msgid "Invalid Search" msgid "Invalid Search"
msgstr "Ongeldige zoekopdracht" msgstr "Ongeldige zoekopdracht"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:415 #: addons/web/static/src/js/search.js:415
#: addons/web/static/src/js/search.js:420
msgid "triggered from search view" msgid "triggered from search view"
msgstr "geactiveerd door zoek weergave" msgstr "geactiveerd door zoek weergave"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:503 #: addons/web/static/src/js/search.js:503
#: addons/web/static/src/js/search.js:508
#, python-format #, python-format
msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s"
msgstr "Onjuiste waarde bij veld %(fieldname)s: [%(value)s] is %(message)s" msgstr "Onjuiste waarde bij veld %(fieldname)s: [%(value)s] is %(message)s"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:839 #: addons/web/static/src/js/search.js:839
#: addons/web/static/src/js/search.js:844
msgid "not a valid integer" msgid "not a valid integer"
msgstr "geen geldig geheel getal" msgstr "geen geldig geheel getal"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:853 #: addons/web/static/src/js/search.js:853
#: addons/web/static/src/js/search.js:858
msgid "not a valid number" msgid "not a valid number"
msgstr "geen geldig getal" msgstr "geen geldig getal"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:931 #: addons/web/static/src/js/search.js:931
#: addons/web/static/src/xml/base.xml:968 #: addons/web/static/src/xml/base.xml:968
#: addons/web/static/src/js/search.js:936
msgid "Yes" msgid "Yes"
msgstr "Ja" msgstr "Ja"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:932 #: addons/web/static/src/js/search.js:932
#: addons/web/static/src/js/search.js:937
msgid "No" msgid "No"
msgstr "Nr." msgstr "Nee"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1290 #: addons/web/static/src/js/search.js:1290
#: addons/web/static/src/js/search.js:1295
msgid "contains" msgid "contains"
msgstr "bevat" msgstr "bevat"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1291 #: addons/web/static/src/js/search.js:1291
#: addons/web/static/src/js/search.js:1296
msgid "doesn't contain" msgid "doesn't contain"
msgstr "bevat niet" msgstr "bevat niet"
@ -264,6 +287,11 @@ msgstr "bevat niet"
#: addons/web/static/src/js/search.js:1325 #: addons/web/static/src/js/search.js:1325
#: addons/web/static/src/js/search.js:1344 #: addons/web/static/src/js/search.js:1344
#: addons/web/static/src/js/search.js:1365 #: addons/web/static/src/js/search.js:1365
#: addons/web/static/src/js/search.js:1297
#: addons/web/static/src/js/search.js:1311
#: addons/web/static/src/js/search.js:1330
#: addons/web/static/src/js/search.js:1349
#: addons/web/static/src/js/search.js:1370
msgid "is equal to" msgid "is equal to"
msgstr "is gelijk aan" msgstr "is gelijk aan"
@ -273,6 +301,11 @@ msgstr "is gelijk aan"
#: addons/web/static/src/js/search.js:1326 #: addons/web/static/src/js/search.js:1326
#: addons/web/static/src/js/search.js:1345 #: addons/web/static/src/js/search.js:1345
#: addons/web/static/src/js/search.js:1366 #: addons/web/static/src/js/search.js:1366
#: addons/web/static/src/js/search.js:1298
#: addons/web/static/src/js/search.js:1312
#: addons/web/static/src/js/search.js:1331
#: addons/web/static/src/js/search.js:1350
#: addons/web/static/src/js/search.js:1371
msgid "is not equal to" msgid "is not equal to"
msgstr "is niet gelijk aan" msgstr "is niet gelijk aan"
@ -282,6 +315,11 @@ msgstr "is niet gelijk aan"
#: addons/web/static/src/js/search.js:1327 #: addons/web/static/src/js/search.js:1327
#: addons/web/static/src/js/search.js:1346 #: addons/web/static/src/js/search.js:1346
#: addons/web/static/src/js/search.js:1367 #: addons/web/static/src/js/search.js:1367
#: addons/web/static/src/js/search.js:1299
#: addons/web/static/src/js/search.js:1313
#: addons/web/static/src/js/search.js:1332
#: addons/web/static/src/js/search.js:1351
#: addons/web/static/src/js/search.js:1372
msgid "greater than" msgid "greater than"
msgstr "is groter dan" msgstr "is groter dan"
@ -291,6 +329,11 @@ msgstr "is groter dan"
#: addons/web/static/src/js/search.js:1328 #: addons/web/static/src/js/search.js:1328
#: addons/web/static/src/js/search.js:1347 #: addons/web/static/src/js/search.js:1347
#: addons/web/static/src/js/search.js:1368 #: addons/web/static/src/js/search.js:1368
#: addons/web/static/src/js/search.js:1300
#: addons/web/static/src/js/search.js:1314
#: addons/web/static/src/js/search.js:1333
#: addons/web/static/src/js/search.js:1352
#: addons/web/static/src/js/search.js:1373
msgid "less than" msgid "less than"
msgstr "kleiner dan" msgstr "kleiner dan"
@ -300,6 +343,11 @@ msgstr "kleiner dan"
#: addons/web/static/src/js/search.js:1329 #: addons/web/static/src/js/search.js:1329
#: addons/web/static/src/js/search.js:1348 #: addons/web/static/src/js/search.js:1348
#: addons/web/static/src/js/search.js:1369 #: addons/web/static/src/js/search.js:1369
#: addons/web/static/src/js/search.js:1301
#: addons/web/static/src/js/search.js:1315
#: addons/web/static/src/js/search.js:1334
#: addons/web/static/src/js/search.js:1353
#: addons/web/static/src/js/search.js:1374
msgid "greater or equal than" msgid "greater or equal than"
msgstr "is groter of gelijk aan" msgstr "is groter of gelijk aan"
@ -309,27 +357,37 @@ msgstr "is groter of gelijk aan"
#: addons/web/static/src/js/search.js:1330 #: addons/web/static/src/js/search.js:1330
#: addons/web/static/src/js/search.js:1349 #: addons/web/static/src/js/search.js:1349
#: addons/web/static/src/js/search.js:1370 #: addons/web/static/src/js/search.js:1370
#: addons/web/static/src/js/search.js:1302
#: addons/web/static/src/js/search.js:1316
#: addons/web/static/src/js/search.js:1335
#: addons/web/static/src/js/search.js:1354
#: addons/web/static/src/js/search.js:1375
msgid "less or equal than" msgid "less or equal than"
msgstr "is kleiner of gelijk aan" msgstr "is kleiner of gelijk aan"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1360 #: addons/web/static/src/js/search.js:1360
#: addons/web/static/src/js/search.js:1383 #: addons/web/static/src/js/search.js:1383
#: addons/web/static/src/js/search.js:1365
#: addons/web/static/src/js/search.js:1388
msgid "is" msgid "is"
msgstr "is" msgstr "is"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1384 #: addons/web/static/src/js/search.js:1384
#: addons/web/static/src/js/search.js:1389
msgid "is not" msgid "is not"
msgstr "is niet" msgstr "is niet"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1396 #: addons/web/static/src/js/search.js:1396
#: addons/web/static/src/js/search.js:1401
msgid "is true" msgid "is true"
msgstr "is waar" msgstr "is waar"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/search.js:1397 #: addons/web/static/src/js/search.js:1397
#: addons/web/static/src/js/search.js:1402
msgid "is false" msgid "is false"
msgstr "is onwaar" msgstr "is onwaar"
@ -424,51 +482,60 @@ msgstr "Aanpassen"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:123 #: addons/web/static/src/js/view_form.js:123
#: addons/web/static/src/js/view_form.js:686 #: addons/web/static/src/js/view_form.js:686
#: addons/web/static/src/js/view_form.js:692
msgid "Set Default" msgid "Set Default"
msgstr "Gebruik als standaard" msgstr "Gebruik als standaard"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:469 #: addons/web/static/src/js/view_form.js:469
#: addons/web/static/src/js/view_form.js:475
msgid "" msgid ""
"Warning, the record has been modified, your changes will be discarded." "Warning, the record has been modified, your changes will be discarded."
msgstr "Letop: het record is gewijzigd; uw wijzigingen gaan verloren." msgstr "Letop: het record is gewijzigd; uw wijzigingen gaan verloren."
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:693 #: addons/web/static/src/js/view_form.js:693
#: addons/web/static/src/js/view_form.js:699
msgid "Save default" msgid "Save default"
msgstr "Opslaan als standaard" msgstr "Opslaan als standaard"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:754 #: addons/web/static/src/js/view_form.js:754
#: addons/web/static/src/js/view_form.js:760
msgid "Attachments" msgid "Attachments"
msgstr "Bijlages" msgstr "Bijlages"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:792 #: addons/web/static/src/js/view_form.js:792
#: addons/web/static/src/js/view_form.js:798
#, python-format #, python-format
msgid "Do you really want to delete the attachment %s?" msgid "Do you really want to delete the attachment %s?"
msgstr "Weet u zeker dat u deze bijlage %s wilt verwijderen?" msgstr "Weet u zeker dat u deze bijlage %s wilt verwijderen?"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:822 #: addons/web/static/src/js/view_form.js:822
#: addons/web/static/src/js/view_form.js:828
#, python-format #, python-format
msgid "Unknown operator %s in domain %s" msgid "Unknown operator %s in domain %s"
msgstr "Onbekend operator% s in domein% s" msgstr "Onbekend operator% s in domein% s"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:830 #: addons/web/static/src/js/view_form.js:830
#: addons/web/static/src/js/view_form.js:836
#, python-format #, python-format
msgid "Unknown field %s in domain %s" msgid "Unknown field %s in domain %s"
msgstr "Onbekend vel %s in domein %s" msgstr "Onbekend veld %s in domein %s"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:868 #: addons/web/static/src/js/view_form.js:868
#: addons/web/static/src/js/view_form.js:874
#, python-format #, python-format
msgid "Unsupported operator %s in domain %s" msgid "Unsupported operator %s in domain %s"
msgstr "Niet ondersteunde operator %s in domein %s" msgstr "Niet ondersteunde operator %s in domein %s"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:1225 #: addons/web/static/src/js/view_form.js:1225
#: addons/web/static/src/js/view_form.js:1231
msgid "Confirm" msgid "Confirm"
msgstr "Bevestig" msgstr "Bevestig"
@ -476,34 +543,43 @@ msgstr "Bevestig"
#: addons/web/static/src/js/view_form.js:1921 #: addons/web/static/src/js/view_form.js:1921
#: addons/web/static/src/js/view_form.js:2578 #: addons/web/static/src/js/view_form.js:2578
#: addons/web/static/src/js/view_form.js:2741 #: addons/web/static/src/js/view_form.js:2741
#: addons/web/static/src/js/view_form.js:1933
#: addons/web/static/src/js/view_form.js:2590
#: addons/web/static/src/js/view_form.js:2760
msgid "Open: " msgid "Open: "
msgstr "Open: " msgstr "Open: "
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2049 #: addons/web/static/src/js/view_form.js:2049
#: addons/web/static/src/js/view_form.js:2061
msgid "<em>   Search More...</em>" msgid "<em>   Search More...</em>"
msgstr "<em>   Zoek verder...</em>" msgstr "<em>   Zoek verder...</em>"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2062 #: addons/web/static/src/js/view_form.js:2062
#: addons/web/static/src/js/view_form.js:2074
#, python-format #, python-format
msgid "<em>   Create \"<strong>%s</strong>\"</em>" msgid "<em>   Create \"<strong>%s</strong>\"</em>"
msgstr "<em>   Maak \"<strong>%s</strong>\"</em>" msgstr "<em>   Maak \"<strong>%s</strong>\"</em>"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2068 #: addons/web/static/src/js/view_form.js:2068
#: addons/web/static/src/js/view_form.js:2080
msgid "<em>   Create and Edit...</em>" msgid "<em>   Create and Edit...</em>"
msgstr "<em>   Maak en wijzig...</em>" msgstr "<em>   Maak en wijzig...</em>"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2101 #: addons/web/static/src/js/view_form.js:2101
#: addons/web/static/src/js/views.js:675 #: addons/web/static/src/js/views.js:675
#: addons/web/static/src/js/view_form.js:2113
msgid "Search: " msgid "Search: "
msgstr "Zoeken: " msgstr "Zoeken: "
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2101 #: addons/web/static/src/js/view_form.js:2101
#: addons/web/static/src/js/view_form.js:2550 #: addons/web/static/src/js/view_form.js:2550
#: addons/web/static/src/js/view_form.js:2113
#: addons/web/static/src/js/view_form.js:2562
msgid "Create: " msgid "Create: "
msgstr "Maken: " msgstr "Maken: "
@ -512,11 +588,13 @@ msgstr "Maken: "
#: addons/web/static/src/xml/base.xml:750 #: addons/web/static/src/xml/base.xml:750
#: addons/web/static/src/xml/base.xml:772 #: addons/web/static/src/xml/base.xml:772
#: addons/web/static/src/xml/base.xml:1646 #: addons/web/static/src/xml/base.xml:1646
#: addons/web/static/src/js/view_form.js:2680
msgid "Add" msgid "Add"
msgstr "Toevoegen" msgstr "Toevoegen"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_form.js:2721 #: addons/web/static/src/js/view_form.js:2721
#: addons/web/static/src/js/view_form.js:2740
msgid "Add: " msgid "Add: "
msgstr "Toevoegen: " msgstr "Toevoegen: "
@ -532,22 +610,26 @@ msgstr "Onbeperkt"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_list.js:305 #: addons/web/static/src/js/view_list.js:305
#: addons/web/static/src/js/view_list.js:309
#, python-format #, python-format
msgid "[%(first_record)d to %(last_record)d] of %(records_count)d" msgid "[%(first_record)d to %(last_record)d] of %(records_count)d"
msgstr "[%(first_record)d t/m %(last_record)d] van %(records_count)d" msgstr "[%(first_record)d t/m %(last_record)d] van %(records_count)d"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_list.js:524 #: addons/web/static/src/js/view_list.js:524
#: addons/web/static/src/js/view_list.js:528
msgid "Do you really want to remove these records?" msgid "Do you really want to remove these records?"
msgstr "Wilt u deze records werkelijk verwijderen?" msgstr "Wilt u deze records werkelijk verwijderen?"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_list.js:1230 #: addons/web/static/src/js/view_list.js:1230
#: addons/web/static/src/js/view_list.js:1232
msgid "Undefined" msgid "Undefined"
msgstr "Onbepaald" msgstr "Onbepaald"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/view_list.js:1327 #: addons/web/static/src/js/view_list.js:1327
#: addons/web/static/src/js/view_list.js:1331
#, python-format #, python-format
msgid "%(page)d/%(page_count)d" msgid "%(page)d/%(page_count)d"
msgstr "%(page)d/%(page_count)d" msgstr "%(page)d/%(page_count)d"
@ -568,9 +650,10 @@ msgid "Tree"
msgstr "Boomstructuur" msgstr "Boomstructuur"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/views.js:565 addons/web/static/src/xml/base.xml:480 #: addons/web/static/src/js/views.js:565
#: addons/web/static/src/xml/base.xml:480
msgid "Fields View Get" msgid "Fields View Get"
msgstr "" msgstr "Veldweergave 'Get'"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/views.js:573 #: addons/web/static/src/js/views.js:573
@ -585,7 +668,8 @@ msgid "Model %s fields"
msgstr "Model %s velden" msgstr "Model %s velden"
#. openerp-web #. openerp-web
#: addons/web/static/src/js/views.js:610 addons/web/static/src/xml/base.xml:482 #: addons/web/static/src/js/views.js:610
#: addons/web/static/src/xml/base.xml:482
msgid "Manage Views" msgid "Manage Views"
msgstr "Weergaven beheren" msgstr "Weergaven beheren"
@ -652,12 +736,14 @@ msgid "Translations"
msgstr "Vertalingen" msgstr "Vertalingen"
#. openerp-web #. openerp-web
#: addons/web/static/src/xml/base.xml:44 addons/web/static/src/xml/base.xml:315 #: addons/web/static/src/xml/base.xml:44
#: addons/web/static/src/xml/base.xml:315
msgid "Powered by" msgid "Powered by"
msgstr "Powered by" msgstr "Powered by"
#. openerp-web #. openerp-web
#: addons/web/static/src/xml/base.xml:44 addons/web/static/src/xml/base.xml:315 #: addons/web/static/src/xml/base.xml:44
#: addons/web/static/src/xml/base.xml:315
#: addons/web/static/src/xml/base.xml:1813 #: addons/web/static/src/xml/base.xml:1813
msgid "OpenERP" msgid "OpenERP"
msgstr "OpenERP" msgstr "OpenERP"
@ -673,12 +759,14 @@ msgid "CREATE DATABASE"
msgstr "DATABASE MAKEN" msgstr "DATABASE MAKEN"
#. openerp-web #. openerp-web
#: addons/web/static/src/xml/base.xml:68 addons/web/static/src/xml/base.xml:211 #: addons/web/static/src/xml/base.xml:68
#: addons/web/static/src/xml/base.xml:211
msgid "Master password:" msgid "Master password:"
msgstr "Master wachtwoord:" msgstr "Master wachtwoord:"
#. openerp-web #. openerp-web
#: addons/web/static/src/xml/base.xml:72 addons/web/static/src/xml/base.xml:191 #: addons/web/static/src/xml/base.xml:72
#: addons/web/static/src/xml/base.xml:191
msgid "New database name:" msgid "New database name:"
msgstr "Naam nieuwe database:" msgstr "Naam nieuwe database:"

View File

@ -28,121 +28,141 @@ nova = (function() {
lib.internal = {}; lib.internal = {};
/* /*
* (Almost) unmodified John Resig's inheritance * (Almost) unmodified John Resig's inheritance.
*
* Defines The Class object. That object can be used to define and inherit classes using
* the extend() method.
*
* Example:
*
* var Person = nova.Class.extend({
* init: function(isDancing){
* this.dancing = isDancing;
* },
* dance: function(){
* return this.dancing;
* }
* });
*
* The init() method act as a constructor. This class can be instancied this way:
*
* var person = new Person(true);
* person.dance();
*
* The Person class can also be extended again:
*
* var Ninja = Person.extend({
* init: function(){
* this._super( false );
* },
* dance: function(){
* // Call the inherited version of dance()
* return this._super();
* },
* swingSword: function(){
* return true;
* }
* });
*
* When extending a class, each re-defined method can use this._super() to call the previous
* implementation of that method.
*/ */
/* /* Simple JavaScript Inheritance
* Simple JavaScript Inheritance By John Resig http://ejohn.org/ MIT * By John Resig http://ejohn.org/
* Licensed. * MIT Licensed.
*/ */
// Inspired by base2 and Prototype // Inspired by base2 and Prototype
(function() { (function(){
var initializing = false, fnTest = /xyz/.test(function() { var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
xyz; // The base Class implementation (does nothing)
}) ? /\b_super\b/ : /.*/; this.Class = function(){};
// The base Class implementation (does nothing)
this.Class = function() { // Create a new Class that inherits from this class
}; this.Class.extend = function(prop) {
// Create a new Class that inherits from this class
this.Class.extend = function(prop) {
var _super = this.prototype; var _super = this.prototype;
// Instantiate a web class (but only create the instance, // Instantiate a base class (but only create the instance,
// don't run the init constructor) // don't run the init constructor)
initializing = true; initializing = true;
var prototype = new this(); var prototype = new this();
initializing = false; initializing = false;
// Copy the properties over onto the new prototype // Copy the properties over onto the new prototype
for (var name in prop) { for (var name in prop) {
// Check if we're overwriting an existing function // Check if we're overwriting an existing function
prototype[name] = typeof prop[name] == "function" && prototype[name] = typeof prop[name] == "function" &&
typeof _super[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ?
fnTest.test(prop[name]) ? (function(name, fn){
(function(name, fn) { return function() {
return function() { var tmp = this._super;
var tmp = this._super;
// Add a new ._super() method that is the same method
// Add a new ._super() method that is the same // but on the super-class
// method but on the super-class this._super = _super[name];
this._super = _super[name];
// The method only need to be bound temporarily, so we
// The method only need to be bound temporarily, so // remove it when we're done executing
// we remove it when we're done executing var ret = fn.apply(this, arguments);
var ret = fn.apply(this, arguments); this._super = tmp;
this._super = tmp;
return ret;
return ret; };
}; })(name, prop[name]) :
})(name, prop[name]) : prop[name];
prop[name];
} }
// The dummy class constructor // The dummy class constructor
function Class() { function Class() {
// All construction is actually done in the init method // All construction is actually done in the init method
if (!initializing && this.init) { if ( !initializing && this.init )
var ret = this.init.apply(this, arguments); this.init.apply(this, arguments);
if (ret) { return ret; }
}
return this;
} }
Class.include = function (properties) {
for (var name in properties) {
if (typeof properties[name] !== 'function'
|| !fnTest.test(properties[name])) {
prototype[name] = properties[name];
} else if (typeof prototype[name] === 'function'
&& prototype.hasOwnProperty(name)) {
prototype[name] = (function (name, fn, previous) {
return function () {
var tmp = this._super;
this._super = previous;
var ret = fn.apply(this, arguments);
this._super = tmp;
return ret;
}
})(name, properties[name], prototype[name]);
} else if (typeof _super[name] === 'function') {
prototype[name] = (function (name, fn) {
return function () {
var tmp = this._super;
this._super = _super[name];
var ret = fn.apply(this, arguments);
this._super = tmp;
return ret;
}
})(name, properties[name]);
}
}
};
// Populate our constructed prototype object // Populate our constructed prototype object
Class.prototype = prototype; Class.prototype = prototype;
// Enforce the constructor to be what we expect // Enforce the constructor to be what we expect
Class.constructor = Class; Class.prototype.constructor = Class;
// And make this class extendable // And make this class extendable
Class.extend = arguments.callee; for(el in this) {
Class[el] = this[el];
}
return Class; return Class;
}; };
}).call(lib); }).call(lib);
// end of John Resig's code // end of John Resig's code
/**
* Mixin to express the concept of destroying an object.
* When an object is destroyed, it should release any resource
* it could have reserved before.
*/
lib.DestroyableMixin = { lib.DestroyableMixin = {
init: function() { init: function() {
this.__destroyableDestroyed = false; this.__destroyableDestroyed = false;
}, },
/**
* Returns true if destroy() was called on the current object.
*/
isDestroyed : function() { isDestroyed : function() {
return this.__destroyableDestroyed; return this.__destroyableDestroyed;
}, },
/**
* Inform the object it should destroy itself, releasing any
* resource it could have reserved.
*/
destroy : function() { destroy : function() {
this.__destroyableDestroyed = true; this.__destroyableDestroyed = true;
} }
}; };
/**
* Mixin to structure objects' life-cycles folowing a parent-children
* relationship. Each object can a have a parent and multiple children.
* When an object is destroyed, all its children are destroyed too.
*/
lib.ParentedMixin = _.extend({}, lib.DestroyableMixin, { lib.ParentedMixin = _.extend({}, lib.DestroyableMixin, {
__parentedMixin : true, __parentedMixin : true,
init: function() { init: function() {
@ -150,6 +170,14 @@ nova = (function() {
this.__parentedChildren = []; this.__parentedChildren = [];
this.__parentedParent = null; this.__parentedParent = null;
}, },
/**
* Set the parent of the current object. When calling this method, the
* parent will also be informed and will return the current object
* when its getChildren() method is called. If the current object did
* already have a parent, it is unregistered before, which means the
* previous parent will not return the current object anymore when its
* getChildren() method is called.
*/
setParent : function(parent) { setParent : function(parent) {
if (this.getParent()) { if (this.getParent()) {
if (this.getParent().__parentedMixin) { if (this.getParent().__parentedMixin) {
@ -162,9 +190,15 @@ nova = (function() {
parent.__parentedChildren.push(this); parent.__parentedChildren.push(this);
} }
}, },
/**
* Return the current parent of the object (or null).
*/
getParent : function() { getParent : function() {
return this.__parentedParent; return this.__parentedParent;
}, },
/**
* Return a list of the children of the current object.
*/
getChildren : function() { getChildren : function() {
return _.clone(this.__parentedChildren); return _.clone(this.__parentedChildren);
}, },

View File

@ -203,6 +203,20 @@ $colour4: #8a89ba
font-weight: bold font-weight: bold
color: white color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_menu_more_container
position: relative
.oe_menu_more
position: absolute
padding: 0
background-color: #646060
z-index: 1
border: 1px solid black
border-bottom-left-radius: 5px
border-bottom-right-radius: 5px
li
float: none
a
white-space: nowrap
.oe_secondary_menu_section .oe_secondary_menu_section
font-weight: bold font-weight: bold
margin-left: 8px margin-left: 8px
@ -270,6 +284,23 @@ $colour4: #8a89ba
// }}} // }}}
// UserMenu {{{ // UserMenu {{{
.oe_dropdown
position: relative
.oe_dropdown_toggle:after
width: 0
height: 0
display: inline-block
content: "&darr"
text-indent: -99999px
vertical-align: top
margin-top: 8px
margin-left: 4px
border-left: 4px solid transparent
border-right: 4px solid transparent
border-top: 4px solid white
@include opacity(0.5)
.oe_user_menu .oe_user_menu
float: right float: right
padding: 0 padding: 0
@ -277,22 +308,6 @@ $colour4: #8a89ba
li li
list-style-type: none list-style-type: none
float: left float: left
.oe_dropdown
position: relative
.oe_dropdown_toggle:after
width: 0
height: 0
display: inline-block
content: "&darr"
text-indent: -99999px
vertical-align: top
margin-top: 8px
margin-left: 4px
border-left: 4px solid transparent
border-right: 4px solid transparent
border-top: 4px solid white
@include opacity(0.5)
.oe_dropdown_options .oe_dropdown_options
float: left float: left

View File

@ -350,44 +350,6 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
}); });
return result; return result;
}, },
/**
* Waits until the new database is done creating, then unblocks the UI and
* logs the user in as admin
*
* @param {Number} db_creation_id identifier for the db-creation operation, used to fetch the current installation progress
* @param {Object} info info fields for this database creation
* @param {String} info.db name of the database being created
* @param {String} info.password super-admin password for the database
*/
wait_for_newdb: function (db_creation_id, info) {
var self = this;
self.rpc('/web/database/progress', {
id: db_creation_id,
password: info.password
}, function (result) {
var progress = result[0];
// I'd display a progress bar, but turns out the progress status
// the server report kind-of blows goats: it's at 0 for ~75% of
// the installation, then jumps to 75%, then jumps down to either
// 0 or ~40%, then back up to 75%, then terminates. Let's keep that
// mess hidden behind a not-very-useful but not overly weird
// message instead.
if (progress < 1) {
setTimeout(function () {
self.wait_for_newdb(db_creation_id, info);
}, 500);
return;
}
var admin = result[1][0];
setTimeout(function () {
self.getParent().do_login(
info.db, admin.login, admin.password);
self.destroy();
self.unblockUI();
});
});
},
/** /**
* Blocks UI and replaces $.unblockUI by a noop to prevent third parties * Blocks UI and replaces $.unblockUI by a noop to prevent third parties
* from unblocking the UI * from unblocking the UI
@ -427,23 +389,19 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
self.$option_id.find("form[name=create_db_form]").validate({ self.$option_id.find("form[name=create_db_form]").validate({
submitHandler: function (form) { submitHandler: function (form) {
var fields = $(form).serializeArray(); var fields = $(form).serializeArray();
self.blockUI();
self.rpc("/web/database/create", {'fields': fields}, function(result) { self.rpc("/web/database/create", {'fields': fields}, function(result) {
if (result.error) {
self.unblockUI();
self.display_error(result);
return;
}
if (self.db_list) { if (self.db_list) {
self.db_list.push(self.to_object(fields)['db_name']); self.db_list.push(self.to_object(fields)['db_name']);
self.db_list.sort(); self.db_list.sort();
self.getParent().set_db_list(self.db_list); self.getParent().set_db_list(self.db_list);
} }
var form_obj = self.to_object(fields); var form_obj = self.to_object(fields);
self.wait_for_newdb(result, { self.getParent().do_login(
password: form_obj['super_admin_pwd'], form_obj['db_name'],
db: form_obj['db_name'] 'admin',
}); form_obj['create_admin_pwd']);
self.destroy();
}); });
} }
}); });
@ -677,11 +635,13 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
init: function() { init: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.has_been_loaded = $.Deferred(); this.has_been_loaded = $.Deferred();
this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo
}, },
start: function() { start: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container');
this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click);
$('html').bind('click', this.do_hide_more);
}, },
do_reload: function() { do_reload: function() {
var self = this; var self = this;
@ -692,14 +652,40 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
}); });
}, },
on_loaded: function(data) { on_loaded: function(data) {
var self = this;
this.data = data; this.data = data;
this.renderElement(); this.renderElement();
this.limit_entries();
this.$element.on('click', 'a[data-menu]', this.on_menu_click); this.$element.on('click', 'a[data-menu]', this.on_menu_click);
this.$element.on('click', 'a.oe_menu_more_link', function() {
self.$element.find('.oe_menu_more').toggle();
return false;
});
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
// Hide second level submenus // Hide second level submenus
this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide();
this.has_been_loaded.resolve(); this.has_been_loaded.resolve();
}, },
limit_entries: function() {
var maximum_visible_links = this.maximum_visible_links;
if (maximum_visible_links === 'auto') {
maximum_visible_links = this.auto_limit_entries();
}
if (maximum_visible_links < this.data.data.children.length) {
var $more = $(QWeb.render('Menu.more')),
$index = this.$element.find('li').eq(maximum_visible_links - 1);
$index.after($more);
$more.find('.oe_menu_more').append($index.next().nextAll());
}
},
auto_limit_entries: function() {
// TODO: auto detect overflow and bind window on resize
var width = $(window).width();
return Math.floor(width / 125);
},
do_hide_more: function() {
this.$element.find('.oe_menu_more').hide();
},
/** /**
* Opens a given menu by id, as if a user had browsed to that menu by hand * Opens a given menu by id, as if a user had browsed to that menu by hand
* except does not trigger any event on the way * except does not trigger any event on the way
@ -744,6 +730,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
} }
}, },
on_menu_click: function(ev, id) { on_menu_click: function(ev, id) {
this.do_hide_more();
id = id || 0; id = id || 0;
var $clicked_menu, manual = false; var $clicked_menu, manual = false;
@ -856,8 +843,9 @@ openerp.web.UserMenu = openerp.web.Widget.extend(/** @lends openerp.web.UserMen
return; return;
var func = new openerp.web.Model("res.users").get_func("read"); var func = new openerp.web.Model("res.users").get_func("read");
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
// TODO: Only show company if multicompany in use // TODO: Show company if multicompany is in use
self.$element.find('.oe_topbar_name').text(res.name + '/' + res.company_id[1]); var topbar_name = _.str.sprintf("%s (%s)", res.name, openerp.connection.db, res.company_id[1]);
self.$element.find('.oe_topbar_name').text(topbar_name);
return self.shortcut_load(); return self.shortcut_load();
}); });
}; };
@ -950,7 +938,7 @@ openerp.web.UserMenu = openerp.web.Widget.extend(/** @lends openerp.web.UserMen
} }
] ]
}).open(); }).open();
action_manager.appendTo(this.dialog); action_manager.appendTo(this.dialog.$element);
action_manager.render(this.dialog); action_manager.render(this.dialog);
}, },
on_menu_about: function() { on_menu_about: function() {

View File

@ -11,6 +11,91 @@ if (!console.debug) {
openerp.web.core = function(openerp) { openerp.web.core = function(openerp) {
// a function to override the "extend()" method of JR's inheritance, allowing
// the usage of "include()"
oe_override_class = function(claz){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ?
/\b_super\b/ : /.*/;
// Create a new Class that inherits from this class
claz.extend = function(prop) {
var _super = this.prototype;
// Instantiate a base class (but only create the instance, don't run the
// init constructor)
initializing = true; var prototype = new this(); initializing = false;
// Copy the properties over onto the new prototype
for (var name in prop) {
// Check if we're overwriting an existing function
prototype[name] = typeof prop[name] == "function" &&
typeof _super[name] == "function" && fnTest.test(prop[name]) ?
(function(name, fn){
return function() {
var tmp = this._super;
// Add a new ._super() method that is the same method but on the
// super-class
this._super = _super[name];
// The method only need to be bound temporarily, so we remove it
// when we're done executing
var ret = fn.apply(this, arguments); this._super = tmp;
return ret;
};
})(name, prop[name]) : prop[name];
}
// The dummy class constructor
function Class() {
// All construction is actually done in the init method
if (!initializing && this.init) {
var ret = this.init.apply(this, arguments); if (ret) { return ret;}
} return this;
}
Class.include = function (properties) {
for (var name in properties) {
if (typeof properties[name] !== 'function'
|| !fnTest.test(properties[name])) {
prototype[name] = properties[name];
} else if (typeof prototype[name] === 'function'
&& prototype.hasOwnProperty(name)) {
prototype[name] = (function (name, fn, previous) {
return function () {
var tmp = this._super; this._super = previous; var
ret = fn.apply(this, arguments); this._super = tmp;
return ret;
}
})(name, properties[name], prototype[name]);
} else if (typeof _super[name] === 'function') {
prototype[name] = (function (name, fn) {
return function () {
var tmp = this._super; this._super = _super[name];
var ret = fn.apply(this, arguments); this._super =
tmp; return ret;
}
})(name, properties[name]);
}
}
};
// Populate our constructed prototype object
Class.prototype = prototype;
// Enforce the constructor to be what we expect
Class.prototype.constructor = Class;
// And make this class extendable
Class.extend = arguments.callee;
return Class;
};
};
oe_override_class(nova.Class);
oe_override_class(nova.Widget);
openerp.web.Class = nova.Class; openerp.web.Class = nova.Class;
openerp.web.callback = function(obj, method) { openerp.web.callback = function(obj, method) {
@ -892,6 +977,14 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"];
return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) { return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) {
return self.do_load_js(file_list.concat(files)); return self.do_load_js(file_list.concat(files));
}).then(function () {
if (!Date.CultureInfo.pmDesignator) {
// If no am/pm designator is specified but the openerp
// datetime format uses %i, date.js won't be able to
// correctly format a date. See bug#938497.
Date.CultureInfo.amDesignator = 'AM';
Date.CultureInfo.pmDesignator = 'PM';
}
}); });
})) }))
} }

View File

@ -741,18 +741,25 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
: (v1 > v2) ? 1 : (v1 > v2) ? 1
: 0; : 0;
}; };
records.sort(function (a, b) { // Array.sort is not necessarily stable. We must be careful with this because
return _.reduce(sort_fields, function (acc, field) { // sorting an array where all items are considered equal is a worst-case that
if (acc) { return acc; } // will randomize the array with an unstable sort! Therefore we must avoid
// sorting if there are no sort_fields (i.e. all items are considered equal)
var sign = 1; // See also: http://ecma262-5.com/ELS5_Section_15.htm#Section_15.4.4.11
if (field[0] === '-') { // http://code.google.com/p/v8/issues/detail?id=90
sign = -1; if (sort_fields.length) {
field = field.slice(1); records.sort(function (a, b) {
} return _.reduce(sort_fields, function (acc, field) {
return sign * compare(a[field], b[field]); if (acc) { return acc; }
}, 0); var sign = 1;
}); if (field[0] === '-') {
sign = -1;
field = field.slice(1);
}
return sign * compare(a[field], b[field]);
}, 0);
});
}
completion.resolve(records); completion.resolve(records);
}; };
if(to_get.length > 0) { if(to_get.length > 0) {

View File

@ -148,7 +148,7 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
if (typeof(value) == "string") if (typeof(value) == "string")
value = openerp.web.auto_str_to_date(value); value = openerp.web.auto_str_to_date(value);
return value.toString(normalize_format(l10n.time_format)); return value.toString(normalize_format(l10n.time_format));
case 'selection': case 'selection': case 'statusbar':
// Each choice is [value, label] // Each choice is [value, label]
if(_.isArray(value)) { if(_.isArray(value)) {
value = value[0] value = value[0]
@ -336,7 +336,7 @@ openerp.web.format_cell = function (row_data, column, options) {
case 'progressbar': case 'progressbar':
return _.template( return _.template(
'<progress value="<%-value%>" max="100"><%-value%>%</progress>', { '<progress value="<%-value%>" max="100"><%-value%>%</progress>', {
value: _.str.sprintf("%.0f", row_data[column.id].value) value: _.str.sprintf("%.0f", row_data[column.id].value || 0)
}); });
} }

View File

@ -97,6 +97,8 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
this.hidden = !!hidden; this.hidden = !!hidden;
this.headless = this.hidden && !this.has_defaults; this.headless = this.hidden && !this.has_defaults;
this.filter_data = {};
this.ready = $.Deferred(); this.ready = $.Deferred();
}, },
start: function() { start: function() {
@ -507,7 +509,12 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
group_by instanceof Array ? group_by : group_by.split(','), group_by instanceof Array ? group_by : group_by.split(','),
function (el) { return { group_by: el }; }); function (el) { return { group_by: el }; });
} }
this.on_search([filter.domain], [filter.context], groupbys); this.filter_data = {
domains: [filter.domain],
contexts: [filter.context],
groupbys: groupbys
};
this.do_search();
}, this)); }, this));
} else { } else {
select.val(''); select.val('');
@ -1141,8 +1148,8 @@ openerp.web.search.BooleanField = openerp.web.search.SelectionField.extend(/** @
['false', _t("No")] ['false', _t("No")]
]; ];
}, },
get_value: function () { get_value: function (facet) {
switch (this.$element.val()) { switch (this._super(facet)) {
case 'false': return false; case 'false': return false;
case 'true': return true; case 'true': return true;
default: return null; default: return null;

View File

@ -1605,16 +1605,11 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({
init: function (view, node) { init: function (view, node) {
this._super(view, node); this._super(view, node);
if (node.attrs.digits) { if (node.attrs.digits) {
this.parse_digits(node.attrs.digits); this.digits = py.eval(node.attrs.digits);
} else { } else {
this.digits = view.fields_view.fields[node.attrs.name].digits; this.digits = view.fields_view.fields[node.attrs.name].digits;
} }
}, },
parse_digits: function (digits_attr) {
// could use a Python parser instead.
var match = /^\s*[\(\[](\d+),\s*(\d+)/.exec(digits_attr);
return [parseInt(match[1], 10), parseInt(match[2], 10)];
},
set_value: function(value) { set_value: function(value) {
if (value === false || value === undefined) { if (value === false || value === undefined) {
// As in GTK client, floats default to 0 // As in GTK client, floats default to 0
@ -2920,6 +2915,10 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
this.new_object(); this.new_object();
} }
}, },
stop: function () {
this.$element.dialog('close');
this._super();
},
setup_search_view: function(search_defaults) { setup_search_view: function(search_defaults) {
var self = this; var self = this;
if (this.searchview) { if (this.searchview) {

View File

@ -89,6 +89,16 @@ openerp.web.page = function (openerp) {
return show_value; return show_value;
} }
}); });
openerp.web.page.FieldFloatReadonly = openerp.web.page.FieldCharReadonly.extend({
init: function (view, node) {
this._super(view, node);
if (node.attrs.digits) {
this.digits = py.eval(node.attrs.digits);
} else {
this.digits = view.fields_view.fields[node.attrs.name].digits;
}
}
});
openerp.web.page.FieldURIReadonly = openerp.web.page.FieldCharReadonly.extend({ openerp.web.page.FieldURIReadonly = openerp.web.page.FieldCharReadonly.extend({
form_template: 'FieldURI.readonly', form_template: 'FieldURI.readonly',
scheme: null, scheme: null,
@ -96,6 +106,10 @@ openerp.web.page = function (openerp) {
return value; return value;
}, },
set_value: function (value) { set_value: function (value) {
if (!value) {
this.$element.find('a').text('').attr('href', '#');
return;
}
this.$element.find('a') this.$element.find('a')
.attr('href', this.scheme + ':' + value) .attr('href', this.scheme + ':' + value)
.text(this.format_value(value)); .text(this.format_value(value));
@ -106,6 +120,10 @@ openerp.web.page = function (openerp) {
}); });
openerp.web.page.FieldUrlReadonly = openerp.web.page.FieldURIReadonly.extend({ openerp.web.page.FieldUrlReadonly = openerp.web.page.FieldURIReadonly.extend({
set_value: function (value) { set_value: function (value) {
if (!value) {
this.$element.find('a').text('').attr('href', '#');
return;
}
var s = /(\w+):(.+)/.exec(value); var s = /(\w+):(.+)/.exec(value);
if (!s) { if (!s) {
value = "http://" + value; value = "http://" + value;
@ -261,7 +279,7 @@ openerp.web.page = function (openerp) {
'one2many_list' : 'openerp.web.page.FieldOne2ManyReadonly', 'one2many_list' : 'openerp.web.page.FieldOne2ManyReadonly',
'reference': 'openerp.web.page.FieldReferenceReadonly', 'reference': 'openerp.web.page.FieldReferenceReadonly',
'boolean': 'openerp.web.page.FieldBooleanReadonly', 'boolean': 'openerp.web.page.FieldBooleanReadonly',
'float': 'openerp.web.page.FieldCharReadonly', 'float': 'openerp.web.page.FieldFloatReadonly',
'integer': 'openerp.web.page.FieldCharReadonly', 'integer': 'openerp.web.page.FieldCharReadonly',
'float_time': 'openerp.web.page.FieldCharReadonly', 'float_time': 'openerp.web.page.FieldCharReadonly',
'binary': 'openerp.web.page.FieldBinaryFileReadonly', 'binary': 'openerp.web.page.FieldBinaryFileReadonly',

View File

@ -411,6 +411,9 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V
var groupby = results.group_by.length var groupby = results.group_by.length
? results.group_by ? results.group_by
: action_context.group_by; : action_context.group_by;
if (_.isString(groupby)) {
groupby = [groupby];
}
controller.do_search(results.domain, results.context, groupby || []); controller.do_search(results.domain, results.context, groupby || []);
}); });
}, },
@ -760,7 +763,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
_(log_records.reverse()).each(function (record) { _(log_records.reverse()).each(function (record) {
var context = {}; var context = {};
if (record.context) { if (record.context) {
try { context = py.eval(record.context).toJSON(); } try { context = py.eval(record.context); }
catch (e) { /* TODO: what do I do now? */ } catch (e) { /* TODO: what do I do now? */ }
} }
$(_.str.sprintf('<li><a href="#">%s</a></li>', record.name)) $(_.str.sprintf('<li><a href="#">%s</a></li>', record.name))

View File

@ -332,6 +332,12 @@
</li> </li>
</ul> </ul>
</t> </t>
<t t-name="Menu.more">
<li class="oe_menu_more_container">
<a href="#" class="oe_menu_more_link oe_dropdown_toggle">More</a>
<ul class="oe_menu_more" style="display: none;"/>
</li>
</t>
<t t-name="Menu.secondary"> <t t-name="Menu.secondary">
<div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id"> <div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id">
<t t-foreach="menu.children" t-as="menu"> <t t-foreach="menu.children" t-as="menu">
@ -1106,7 +1112,7 @@
</div> </div>
</t> </t>
<t t-name="FieldBinaryImage"> <t t-name="FieldBinaryImage">
<table cellpadding="0" cellspacing="0" border="0"> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr> <tr>
<td align="center"> <td align="center">
<img t-att-src='_s + "/web/static/src/img/placeholder.png"' class="oe-binary-image" <img t-att-src='_s + "/web/static/src/img/placeholder.png"' class="oe-binary-image"

View File

@ -10,6 +10,7 @@ class TestDataSetController(unittest2.TestCase):
self.read = self.request.session.model().read self.read = self.request.session.model().read
self.search = self.request.session.model().search self.search = self.request.session.model().search
@unittest2.skip
def test_empty_find(self): def test_empty_find(self):
self.search.return_value = [] self.search.return_value = []
self.read.return_value = [] self.read.return_value = []
@ -17,6 +18,7 @@ class TestDataSetController(unittest2.TestCase):
self.assertFalse(self.dataset.do_search_read(self.request, 'fake.model')) self.assertFalse(self.dataset.do_search_read(self.request, 'fake.model'))
self.read.assert_called_once_with([], False, self.request.context) self.read.assert_called_once_with([], False, self.request.context)
@unittest2.skip
def test_regular_find(self): def test_regular_find(self):
self.search.return_value = [1, 2, 3] self.search.return_value = [1, 2, 3]
@ -24,6 +26,7 @@ class TestDataSetController(unittest2.TestCase):
self.read.assert_called_once_with([1, 2, 3], False, self.read.assert_called_once_with([1, 2, 3], False,
self.request.context) self.request.context)
@unittest2.skip
def test_ids_shortcut(self): def test_ids_shortcut(self):
self.search.return_value = [1, 2, 3] self.search.return_value = [1, 2, 3]
self.read.return_value = [ self.read.return_value = [
@ -37,6 +40,7 @@ class TestDataSetController(unittest2.TestCase):
[{'id': 1}, {'id': 2}, {'id': 3}]) [{'id': 1}, {'id': 2}, {'id': 3}])
self.assertFalse(self.read.called) self.assertFalse(self.read.called)
@unittest2.skip
def test_get(self): def test_get(self):
self.read.return_value = [ self.read.return_value = [
{'id': 1, 'name': 'baz'}, {'id': 1, 'name': 'baz'},

View File

@ -1,8 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import mock import mock
import unittest2 import unittest2
import web.controllers.main
import openerpweb.openerpweb from ..controllers import main
from ..common.session import OpenERPSession
class Placeholder(object): class Placeholder(object):
def __init__(self, **kwargs): def __init__(self, **kwargs):
@ -11,17 +12,16 @@ class Placeholder(object):
class LoadTest(unittest2.TestCase): class LoadTest(unittest2.TestCase):
def setUp(self): def setUp(self):
self.menu = web.controllers.main.Menu() self.menu = main.Menu()
self.menus_mock = mock.Mock() self.menus_mock = mock.Mock()
self.request = Placeholder( self.request = Placeholder(session=OpenERPSession())
session=openerpweb.openerpweb.OpenERPSession(
model_factory=lambda _session, _name: self.menus_mock))
def tearDown(self): def tearDown(self):
del self.request del self.request
del self.menus_mock del self.menus_mock
del self.menu del self.menu
@unittest2.skip
def test_empty(self): def test_empty(self):
self.menus_mock.search = mock.Mock(return_value=[]) self.menus_mock.search = mock.Mock(return_value=[])
self.menus_mock.read = mock.Mock(return_value=[]) self.menus_mock.read = mock.Mock(return_value=[])
@ -36,6 +36,7 @@ class LoadTest(unittest2.TestCase):
root['children'], root['children'],
[]) [])
@unittest2.skip
def test_applications_sort(self): def test_applications_sort(self):
self.menus_mock.search = mock.Mock(return_value=[1, 2, 3]) self.menus_mock.search = mock.Mock(return_value=[1, 2, 3])
self.menus_mock.read = mock.Mock(return_value=[ self.menus_mock.read = mock.Mock(return_value=[
@ -62,6 +63,7 @@ class LoadTest(unittest2.TestCase):
'parent_id': False, 'children': [] 'parent_id': False, 'children': []
}]) }])
@unittest2.skip
def test_deep(self): def test_deep(self):
self.menus_mock.search = mock.Mock(return_value=[1, 2, 3, 4]) self.menus_mock.search = mock.Mock(return_value=[1, 2, 3, 4])
self.menus_mock.read = mock.Mock(return_value=[ self.menus_mock.read = mock.Mock(return_value=[
@ -100,7 +102,7 @@ class LoadTest(unittest2.TestCase):
class ActionMungerTest(unittest2.TestCase): class ActionMungerTest(unittest2.TestCase):
def setUp(self): def setUp(self):
self.menu = web.controllers.main.Menu() self.menu = main.Menu()
def test_actual_treeview(self): def test_actual_treeview(self):
action = { action = {
"views": [[False, "tree"], [False, "form"], "views": [[False, "tree"], [False, "form"],
@ -111,10 +113,11 @@ class ActionMungerTest(unittest2.TestCase):
} }
changed = action.copy() changed = action.copy()
del action['view_type'] del action['view_type']
web.controllers.main.fix_view_modes(changed) main.fix_view_modes(changed)
self.assertEqual(changed, action) self.assertEqual(changed, action)
@unittest2.skip
def test_list_view(self): def test_list_view(self):
action = { action = {
"views": [[False, "tree"], [False, "form"], "views": [[False, "tree"], [False, "form"],
@ -123,7 +126,7 @@ class ActionMungerTest(unittest2.TestCase):
"view_id": False, "view_id": False,
"view_mode": "tree,form,calendar" "view_mode": "tree,form,calendar"
} }
web.controllers.main.fix_view_modes(action) main.fix_view_modes(action)
self.assertEqual(action, { self.assertEqual(action, {
"views": [[False, "list"], [False, "form"], "views": [[False, "list"], [False, "form"],
@ -132,6 +135,7 @@ class ActionMungerTest(unittest2.TestCase):
"view_mode": "list,form,calendar" "view_mode": "list,form,calendar"
}) })
@unittest2.skip
def test_redundant_views(self): def test_redundant_views(self):
action = { action = {
@ -141,7 +145,7 @@ class ActionMungerTest(unittest2.TestCase):
"view_id": False, "view_id": False,
"view_mode": "tree,form,calendar" "view_mode": "tree,form,calendar"
} }
web.controllers.main.fix_view_modes(action) main.fix_view_modes(action)
self.assertEqual(action, { self.assertEqual(action, {
"views": [[False, "list"], [False, "form"], "views": [[False, "list"], [False, "form"],

View File

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
import random
import unittest2
from ..controllers.main import topological_sort
def sample(population):
return random.sample(
population,
random.randint(0, min(len(population), 5)))
class TestModulesLoading(unittest2.TestCase):
def setUp(self):
self.mods = map(str, range(1000))
def test_topological_sort(self):
random.shuffle(self.mods)
modules = [
(k, sample(self.mods[:i]))
for i, k in enumerate(self.mods)]
random.shuffle(modules)
ms = dict(modules)
seen = set()
sorted_modules = topological_sort(ms)
for module in sorted_modules:
deps = ms[module]
self.assertGreaterEqual(
seen, set(deps),
'Module %s (index %d), ' \
'missing dependencies %s from loaded modules %s' % (
module, sorted_modules.index(module), deps, seen
))
seen.add(module)

View File

@ -6,8 +6,7 @@ import unittest2
import simplejson import simplejson
import web.controllers.main import web.controllers.main
import openerpweb.nonliterals from ..common import nonliterals, session as s
import openerpweb.openerpweb
def field_attrs(fields_view_get, fieldname): def field_attrs(fields_view_get, fieldname):
(field,) = filter(lambda f: f['attrs'].get('name') == fieldname, (field,) = filter(lambda f: f['attrs'].get('name') == fieldname,
@ -47,7 +46,7 @@ class DomainsAndContextsTest(unittest2.TestCase):
) )
def test_retrieve_nonliteral_domain(self): def test_retrieve_nonliteral_domain(self):
session = mock.Mock(spec=openerpweb.openerpweb.OpenERPSession) session = mock.Mock(spec=s.OpenERPSession)
session.domains_store = {} session.domains_store = {}
domain_string = ("[('month','=',(datetime.date.today() - " domain_string = ("[('month','=',(datetime.date.today() - "
"datetime.timedelta(365/12)).strftime('%%m'))]") "datetime.timedelta(365/12)).strftime('%%m'))]")
@ -56,9 +55,9 @@ class DomainsAndContextsTest(unittest2.TestCase):
self.view.parse_domains_and_contexts(e, session) self.view.parse_domains_and_contexts(e, session)
self.assertIsInstance(e.get('domain'), openerpweb.nonliterals.Domain) self.assertIsInstance(e.get('domain'), nonliterals.Domain)
self.assertEqual( self.assertEqual(
openerpweb.nonliterals.Domain( nonliterals.Domain(
session, key=e.get('domain').key).get_domain_string(), session, key=e.get('domain').key).get_domain_string(),
domain_string) domain_string)
@ -90,7 +89,7 @@ class DomainsAndContextsTest(unittest2.TestCase):
) )
def test_retrieve_nonliteral_context(self): def test_retrieve_nonliteral_context(self):
session = mock.Mock(spec=openerpweb.openerpweb.OpenERPSession) session = mock.Mock(spec=s.OpenERPSession)
session.contexts_store = {} session.contexts_store = {}
context_string = ("{'month': (datetime.date.today() - " context_string = ("{'month': (datetime.date.today() - "
"datetime.timedelta(365/12)).strftime('%%m')}") "datetime.timedelta(365/12)).strftime('%%m')}")
@ -99,9 +98,9 @@ class DomainsAndContextsTest(unittest2.TestCase):
self.view.parse_domains_and_contexts(e, session) self.view.parse_domains_and_contexts(e, session)
self.assertIsInstance(e.get('context'), openerpweb.nonliterals.Context) self.assertIsInstance(e.get('context'), nonliterals.Context)
self.assertEqual( self.assertEqual(
openerpweb.nonliterals.Context( nonliterals.Context(
session, key=e.get('context').key).get_context_string(), session, key=e.get('context').key).get_context_string(),
context_string) context_string)
@ -127,6 +126,8 @@ class AttrsNormalizationTest(unittest2.TestCase):
xml.etree.ElementTree.tostring(transformed), xml.etree.ElementTree.tostring(transformed),
xml.etree.ElementTree.tostring(pristine) xml.etree.ElementTree.tostring(pristine)
) )
@unittest2.skip
def test_transform_states(self): def test_transform_states(self):
element = xml.etree.ElementTree.Element( element = xml.etree.ElementTree.Element(
'field', states="open,closed") 'field', states="open,closed")
@ -137,6 +138,7 @@ class AttrsNormalizationTest(unittest2.TestCase):
simplejson.loads(element.get('attrs')), simplejson.loads(element.get('attrs')),
{'invisible': [['state', 'not in', ['open', 'closed']]]}) {'invisible': [['state', 'not in', ['open', 'closed']]]})
@unittest2.skip
def test_transform_invisible(self): def test_transform_invisible(self):
element = xml.etree.ElementTree.Element( element = xml.etree.ElementTree.Element(
'field', invisible="context.get('invisible_country', False)") 'field', invisible="context.get('invisible_country', False)")
@ -149,12 +151,13 @@ class AttrsNormalizationTest(unittest2.TestCase):
self.view.normalize_attrs(full_context, {'invisible_country': True}) self.view.normalize_attrs(full_context, {'invisible_country': True})
self.assertEqual(full_context.get('invisible'), '1') self.assertEqual(full_context.get('invisible'), '1')
@unittest2.skip
def test_transform_invisible_list_column(self): def test_transform_invisible_list_column(self):
req = mock.Mock() req = mock.Mock()
req.context = {'set_editable':True, 'set_visible':True, req.context = {'set_editable':True, 'set_visible':True,
'gtd_visible':True, 'user_invisible':True} 'gtd_visible':True, 'user_invisible':True}
req.session.evaluation_context = \ req.session.evaluation_context = \
openerpweb.openerpweb.OpenERPSession().evaluation_context s.OpenERPSession().evaluation_context
req.session.model('project.task').fields_view_get.return_value = { req.session.model('project.task').fields_view_get.return_value = {
'arch': ''' 'arch': '''
<tree colors="grey:state in ('cancelled','done');blue:state == 'pending';red:date_deadline and (date_deadline&lt;current_date) and (state in ('draft','pending','open'))" string="Tasks"> <tree colors="grey:state in ('cancelled','done');blue:state == 'pending';red:date_deadline and (date_deadline&lt;current_date) and (state in ('draft','pending','open'))" string="Tasks">
@ -183,13 +186,17 @@ class ListViewTest(unittest2.TestCase):
self.view = web.controllers.main.ListView() self.view = web.controllers.main.ListView()
self.request = mock.Mock() self.request = mock.Mock()
self.request.context = {'set_editable': True} self.request.context = {'set_editable': True}
@unittest2.skip
def test_no_editable_editable_context(self): def test_no_editable_editable_context(self):
self.request.session.model('fake').fields_view_get.return_value = \ self.request.session.model('fake').fields_view_get.return_value = \
{'arch': '<tree><field name="foo"/></tree>'} {'arch': '<tree><field name="foo"/></tree>'}
view = self.view.fields_view_get(self.request, 'fake', False) view = self.view.fields_view_get(self.request, 'fake', False, False)
self.assertEqual(view['arch']['attrs']['editable'], self.assertEqual(view['arch']['attrs']['editable'],
'bottom') 'bottom')
@unittest2.skip
def test_editable_top_editable_context(self): def test_editable_top_editable_context(self):
self.request.session.model('fake').fields_view_get.return_value = \ self.request.session.model('fake').fields_view_get.return_value = \
{'arch': '<tree editable="top"><field name="foo"/></tree>'} {'arch': '<tree editable="top"><field name="foo"/></tree>'}
@ -198,6 +205,7 @@ class ListViewTest(unittest2.TestCase):
self.assertEqual(view['arch']['attrs']['editable'], self.assertEqual(view['arch']['attrs']['editable'],
'top') 'top')
@unittest2.skip
def test_editable_bottom_editable_context(self): def test_editable_bottom_editable_context(self):
self.request.session.model('fake').fields_view_get.return_value = \ self.request.session.model('fake').fields_view_get.return_value = \
{'arch': '<tree editable="bottom"><field name="foo"/></tree>'} {'arch': '<tree editable="bottom"><field name="foo"/></tree>'}

View File

@ -19,5 +19,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
'active': True 'auto_install': True
} }

View File

@ -8,32 +8,35 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n" "POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-04 12:08+0000\n" "PO-Revision-Date: 2012-03-22 09:45+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Zdeněk Havlík <linuzh@gmail.com>\n"
"Language-Team: Czech <cs@li.org>\n" "Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n" "X-Launchpad-Export-Date: 2012-03-23 05:00+0000\n"
"X-Generator: Launchpad (build 14900)\n" "X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web #. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:11 #: addons/web_calendar/static/src/js/calendar.js:11
msgid "Calendar" msgid "Calendar"
msgstr "" msgstr "Kalendář"
#. openerp-web #. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:466 #: addons/web_calendar/static/src/js/calendar.js:466
#: addons/web_calendar/static/src/js/calendar.js:467
msgid "Responsible" msgid "Responsible"
msgstr "" msgstr "Zodpovědný"
#. openerp-web #. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:504 #: addons/web_calendar/static/src/js/calendar.js:504
#: addons/web_calendar/static/src/js/calendar.js:505
msgid "Navigator" msgid "Navigator"
msgstr "" msgstr "Navigátor"
#. openerp-web #. openerp-web
#: addons/web_calendar/static/src/xml/web_calendar.xml:5 #: addons/web_calendar/static/src/xml/web_calendar.xml:5
#: addons/web_calendar/static/src/xml/web_calendar.xml:6 #: addons/web_calendar/static/src/xml/web_calendar.xml:6
msgid "&nbsp;" msgid "&nbsp;"
msgstr "" msgstr "&nbsp;"

View File

@ -0,0 +1,41 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 12:03+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:11
msgid "Calendar"
msgstr "kalenteri"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:466
#: addons/web_calendar/static/src/js/calendar.js:467
msgid "Responsible"
msgstr "Vastuuhenkilö"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:504
#: addons/web_calendar/static/src/js/calendar.js:505
msgid "Navigator"
msgstr "Navigaattori"
#. openerp-web
#: addons/web_calendar/static/src/xml/web_calendar.xml:5
#: addons/web_calendar/static/src/xml/web_calendar.xml:6
msgid "&nbsp;"
msgstr "&nbsp;"

View File

@ -0,0 +1,41 @@
# Norwegian Bokmal translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-28 13:05+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-29 04:46+0000\n"
"X-Generator: Launchpad (build 15032)\n"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:11
msgid "Calendar"
msgstr "Kalender"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:466
#: addons/web_calendar/static/src/js/calendar.js:467
msgid "Responsible"
msgstr "Ansvarlig"
#. openerp-web
#: addons/web_calendar/static/src/js/calendar.js:504
#: addons/web_calendar/static/src/js/calendar.js:505
msgid "Navigator"
msgstr "Navigator"
#. openerp-web
#: addons/web_calendar/static/src/xml/web_calendar.xml:5
#: addons/web_calendar/static/src/xml/web_calendar.xml:6
msgid "&nbsp;"
msgstr "&nbsp;"

View File

@ -66,6 +66,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({
this.day_length = this.fields_view.arch.attrs.day_length || 8; this.day_length = this.fields_view.arch.attrs.day_length || 8;
this.color_field = this.fields_view.arch.attrs.color; this.color_field = this.fields_view.arch.attrs.color;
this.color_string = this.fields_view.fields[this.color_field] ?
this.fields_view.fields[this.color_field].string : _t("Filter");
if (this.color_field && this.selected_filters.length === 0) { if (this.color_field && this.selected_filters.length === 0) {
var default_filter; var default_filter;
@ -463,8 +465,9 @@ openerp.web_calendar.CalendarFormDialog = openerp.web.Dialog.extend({
}); });
openerp.web_calendar.SidebarResponsible = openerp.web.OldWidget.extend({ openerp.web_calendar.SidebarResponsible = openerp.web.OldWidget.extend({
// TODO: fme: in trunk, rename this class to SidebarFilter
init: function(parent, view) { init: function(parent, view) {
var $section = parent.add_section(_t('Responsible'), 'responsible'); var $section = parent.add_section(view.color_string, 'responsible');
this.$div = $('<div></div>'); this.$div = $('<div></div>');
$section.append(this.$div); $section.append(this.$div);
this._super(parent, $section.attr('id')); this._super(parent, $section.attr('id'));

View File

@ -14,5 +14,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
'active': True 'auto_install': True
} }

View File

@ -8,80 +8,81 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n" "POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-04 12:09+0000\n" "PO-Revision-Date: 2012-03-22 11:16+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: Czech <cs@li.org>\n" "Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n" "X-Launchpad-Export-Date: 2012-03-23 05:00+0000\n"
"X-Generator: Launchpad (build 14900)\n" "X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63 #: addons/web_dashboard/static/src/js/dashboard.js:63
msgid "Edit Layout" msgid "Edit Layout"
msgstr "" msgstr "Upravit rozvržení"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:109 #: addons/web_dashboard/static/src/js/dashboard.js:109
msgid "Are you sure you want to remove this item ?" msgid "Are you sure you want to remove this item ?"
msgstr "" msgstr "Jste si jistit, že chcete odstranit tuto položku?"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:316 #: addons/web_dashboard/static/src/js/dashboard.js:316
msgid "Uncategorized" msgid "Uncategorized"
msgstr "" msgstr "Bez kategorie"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:324 #: addons/web_dashboard/static/src/js/dashboard.js:324
#, python-format #, python-format
msgid "Execute task \"%s\"" msgid "Execute task \"%s\""
msgstr "" msgstr "Vykonat úlohu \"%s\""
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:325 #: addons/web_dashboard/static/src/js/dashboard.js:325
msgid "Mark this task as done" msgid "Mark this task as done"
msgstr "" msgstr "Označit úlohu jako dokončenou"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:4 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:4
msgid "Reset Layout.." msgid "Reset Layout.."
msgstr "" msgstr "Vynulovat rozvržení..."
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:6 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:6
msgid "Reset" msgid "Reset"
msgstr "" msgstr "Vynulovat"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:8 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:8
msgid "Change Layout.." msgid "Change Layout.."
msgstr "" msgstr "Změnit rozvržení..."
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:10 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:10
msgid "Change Layout" msgid "Change Layout"
msgstr "" msgstr "Změnit rozvržení"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:27 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:27
msgid "&nbsp;" msgid "&nbsp;"
msgstr "" msgstr "&nbsp;"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
msgid "Create" msgid "Create"
msgstr "" msgstr "Vytvořit"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
msgid "Choose dashboard layout" msgid "Choose dashboard layout"
msgstr "" msgstr "Vybrat rozvržení nástěnky"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
msgid "progress:" msgid "progress:"
msgstr "" msgstr "průběh:"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
@ -89,23 +90,25 @@ msgid ""
"Click on the functionalites listed below to launch them and configure your " "Click on the functionalites listed below to launch them and configure your "
"system" "system"
msgstr "" msgstr ""
"Klikněte na seznam funkčností vypsaných níže k jejich spuštění a nastavení "
"systému"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
msgid "Welcome to OpenERP" msgid "Welcome to OpenERP"
msgstr "" msgstr "Vítejte v OpenERP"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark" msgid "Remember to bookmark"
msgstr "" msgstr "Pamatovat do záložek"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
msgid "This url" msgid "This url"
msgstr "" msgstr "Toto url"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
msgid "Your login:" msgid "Your login:"
msgstr "" msgstr "Vaše přihlášení:"

View File

@ -0,0 +1,113 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-19 12:00+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63
msgid "Edit Layout"
msgstr "Muokkaa näkymää"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:109
msgid "Are you sure you want to remove this item ?"
msgstr "Oletko varma että haluat poistaa tämän osan ?"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:316
msgid "Uncategorized"
msgstr "Luokittelemattomat"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:324
#, python-format
msgid "Execute task \"%s\""
msgstr "Suorita tehtävä \"%s\""
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:325
msgid "Mark this task as done"
msgstr "Merkitse tämä tehtävä valmiiksi"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:4
msgid "Reset Layout.."
msgstr "Palauta asettelu.."
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:6
msgid "Reset"
msgstr "Palauta"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:8
msgid "Change Layout.."
msgstr "Muuta asettelu.."
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:10
msgid "Change Layout"
msgstr "Muuta asettelu"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:27
msgid "&nbsp;"
msgstr "&nbsp;"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
msgid "Create"
msgstr "Luo"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
msgid "Choose dashboard layout"
msgstr "Valitse työpöydän asetttelu"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
msgid "progress:"
msgstr "edistyminen:"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
msgid ""
"Click on the functionalites listed below to launch them and configure your "
"system"
msgstr ""
"Klikkaa allalistattuja toimintoja käynnistääksesi ne ja määritelläksesi "
"järjestelmäsi"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
msgid "Welcome to OpenERP"
msgstr "Tervetuloa OpenERP järjestelmään"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark"
msgstr "Muista luoda kirjainmerkki"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
msgid "This url"
msgstr "Tämä osoite"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
msgid "Your login:"
msgstr "Käyttäjätunnuksesi:"

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n" "POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-06 06:40+0000\n" "PO-Revision-Date: 2012-03-26 22:14+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n" "Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@li.org>\n" "Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-07 05:38+0000\n" "X-Launchpad-Export-Date: 2012-03-27 04:58+0000\n"
"X-Generator: Launchpad (build 14907)\n" "X-Generator: Launchpad (build 15011)\n"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63 #: addons/web_dashboard/static/src/js/dashboard.js:63
@ -71,41 +71,41 @@ msgstr "&nbsp;"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
msgid "Create" msgid "Create"
msgstr "" msgstr "作成"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
msgid "Choose dashboard layout" msgid "Choose dashboard layout"
msgstr "" msgstr "ダッシュボードのレイアウトを選択"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
msgid "progress:" msgid "progress:"
msgstr "" msgstr "プロセス"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
msgid "" msgid ""
"Click on the functionalites listed below to launch them and configure your " "Click on the functionalites listed below to launch them and configure your "
"system" "system"
msgstr "" msgstr "あなたのシステムを設定するために下記に示した機能をクリックしてください。"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
msgid "Welcome to OpenERP" msgid "Welcome to OpenERP"
msgstr "" msgstr "OpenERPへようこそ"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark" msgid "Remember to bookmark"
msgstr "" msgstr "ブックマークをお忘れなく"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
msgid "This url" msgid "This url"
msgstr "" msgstr "このURL"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
msgid "Your login:" msgid "Your login:"
msgstr "" msgstr "あなたのログイン:"

View File

@ -0,0 +1,111 @@
# Norwegian Bokmal translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-28 13:07+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-29 04:46+0000\n"
"X-Generator: Launchpad (build 15032)\n"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63
msgid "Edit Layout"
msgstr "Rediger layout"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:109
msgid "Are you sure you want to remove this item ?"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:316
msgid "Uncategorized"
msgstr "Ikke kategorisert"
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:324
#, python-format
msgid "Execute task \"%s\""
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:325
msgid "Mark this task as done"
msgstr "Merk denne oppgaven som ferdig"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:4
msgid "Reset Layout.."
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:6
msgid "Reset"
msgstr "Tilbakestill"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:8
msgid "Change Layout.."
msgstr "Endre layout.."
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:10
msgid "Change Layout"
msgstr "Endre layout"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:27
msgid "&nbsp;"
msgstr "&nbsp;"
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
msgid "Create"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
msgid "Choose dashboard layout"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
msgid "progress:"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
msgid ""
"Click on the functionalites listed below to launch them and configure your "
"system"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
msgid "Welcome to OpenERP"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
msgid "This url"
msgstr ""
#. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
msgid "Your login:"
msgstr ""

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n" "POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-01 11:47+0000\n" "PO-Revision-Date: 2012-03-19 08:25+0000\n"
"Last-Translator: Erwin <Unknown>\n" "Last-Translator: Erwin <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n" "Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-02 04:52+0000\n" "X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14886)\n" "X-Generator: Launchpad (build 14969)\n"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/js/dashboard.js:63 #: addons/web_dashboard/static/src/js/dashboard.js:63
@ -100,7 +100,7 @@ msgstr "Welkom bij OpenERP"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
msgid "Remember to bookmark" msgid "Remember to bookmark"
msgstr "Vergeet niet een bladwijzer aan te maken" msgstr "Vergeet niet een bladwijzer aan te maken van"
#. openerp-web #. openerp-web
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119 #: addons/web_dashboard/static/src/xml/web_dashboard.xml:119

View File

@ -31,18 +31,16 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
this.$element.delegate('.oe-dashboard-column .oe-dashboard-fold', 'click', this.on_fold_action); this.$element.delegate('.oe-dashboard-column .oe-dashboard-fold', 'click', this.on_fold_action);
this.$element.delegate('.oe-dashboard-column .ui-icon-closethick', 'click', this.on_close_action); this.$element.delegate('.oe-dashboard-column .ui-icon-closethick', 'click', this.on_close_action);
this.actions_attrs = {};
// Init actions // Init actions
_.each(this.node.children, function(column, column_index) { _.each(this.node.children, function(column, column_index) {
_.each(column.children, function(action, action_index) { _.each(column.children, function(action, action_index) {
delete(action.attrs.width); delete(action.attrs.width);
delete(action.attrs.height); delete(action.attrs.height);
delete(action.attrs.colspan); delete(action.attrs.colspan);
self.actions_attrs[action.attrs.name] = action.attrs;
self.rpc('/web/action/load', { self.rpc('/web/action/load', {
action_id: parseInt(action.attrs.name, 10) action_id: parseInt(action.attrs.name, 10)
}, function(result) { }, function(result) {
self.on_load_action(result, column_index + '_' + action_index); self.on_load_action(result, column_index + '_' + action_index, action.attrs);
}); });
}); });
}); });
@ -97,9 +95,9 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
$action = $e.parents('.oe-dashboard-action:first'), $action = $e.parents('.oe-dashboard-action:first'),
id = parseInt($action.attr('data-id'), 10); id = parseInt($action.attr('data-id'), 10);
if ($e.is('.ui-icon-minusthick')) { if ($e.is('.ui-icon-minusthick')) {
this.actions_attrs[id].fold = '1'; $action.data('action_attrs').fold = '1';
} else { } else {
delete(this.actions_attrs[id].fold); delete($action.data('action_attrs').fold);
} }
$e.toggleClass('ui-icon-minusthick ui-icon-plusthick'); $e.toggleClass('ui-icon-minusthick ui-icon-plusthick');
$action.find('.oe-dashboard-action-content').toggle(); $action.find('.oe-dashboard-action-content').toggle();
@ -122,7 +120,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
var actions = []; var actions = [];
$(this).find('.oe-dashboard-action').each(function() { $(this).find('.oe-dashboard-action').each(function() {
var action_id = $(this).attr('data-id'), var action_id = $(this).attr('data-id'),
new_attrs = _.clone(self.actions_attrs[action_id]); new_attrs = _.clone($(this).data('action_attrs'));
if (new_attrs.domain) { if (new_attrs.domain) {
new_attrs.domain = new_attrs.domain_string; new_attrs.domain = new_attrs.domain_string;
delete(new_attrs.domain_string); delete(new_attrs.domain_string);
@ -143,19 +141,25 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
self.$element.find('.oe-dashboard-link-reset').show(); self.$element.find('.oe-dashboard-link-reset').show();
}); });
}, },
on_load_action: function(result, index) { on_load_action: function(result, index, action_attrs) {
var self = this, var self = this,
action = result.result, action = result.result,
action_attrs = this.actions_attrs[action.id],
view_mode = action_attrs.view_mode; view_mode = action_attrs.view_mode;
if (action_attrs.context) { if (action_attrs.context && action_attrs.context['dashboard_merge_domains_contexts'] === false) {
action.context = _.extend((action.context || {}), action_attrs.context); // TODO: replace this 6.1 workaround by attribute on <action/>
} action.context = action_attrs.context || {};
if (action_attrs.domain) { action.domain = action_attrs.domain || [];
action.domain = action.domain || []; } else {
action.domain.unshift.apply(action.domain, action_attrs.domain); if (action_attrs.context) {
action.context = _.extend((action.context || {}), action_attrs.context);
}
if (action_attrs.domain) {
action.domain = action.domain || [];
action.domain.unshift.apply(action.domain, action_attrs.domain);
}
} }
var action_orig = _.extend({ flags : {} }, action); var action_orig = _.extend({ flags : {} }, action);
if (view_mode && view_mode != action.view_mode) { if (view_mode && view_mode != action.view_mode) {
@ -187,6 +191,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
var am = new openerp.web.ActionManager(this), var am = new openerp.web.ActionManager(this),
// FIXME: ideally the dashboard view shall be refactored like kanban. // FIXME: ideally the dashboard view shall be refactored like kanban.
$action = $('#' + this.view.element_id + '_action_' + index); $action = $('#' + this.view.element_id + '_action_' + index);
$action.parent().data('action_attrs', action_attrs);
this.action_managers.push(am); this.action_managers.push(am);
am.appendTo($action); am.appendTo($action);
am.do_action(action); am.do_action(action);

View File

@ -5,11 +5,11 @@
"version" : "2.0", "version" : "2.0",
"depends" : ["web"], "depends" : ["web"],
"js": [ "js": [
'static/lib/js/raphael-min.js', 'static/lib/js/raphael.js',
'static/lib/js/dracula_graffle.js', 'static/lib/js/jquery.mousewheel.js',
'static/lib/js/dracula_graph.js', 'static/src/js/vec2.js',
'static/lib/js/dracula_algorithms.js', 'static/src/js/graph.js',
'static/src/js/diagram.js' 'static/src/js/diagram.js',
], ],
'css' : [ 'css' : [
"static/src/css/base_diagram.css", "static/src/css/base_diagram.css",
@ -17,5 +17,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
'active': True, 'auto_install': True,
} }

View File

@ -115,8 +115,8 @@ class DiagramView(View):
for i, fld in enumerate(visible_node_fields): for i, fld in enumerate(visible_node_fields):
n['options'][node_fields_string[i]] = act[fld] n['options'][node_fields_string[i]] = act[fld]
id_model = req.session.model(model).read([id],['name'], req.session.context)[0]['name'] _id, name = req.session.model(model).name_get([id], req.session.context)[0]
return dict(nodes=nodes, return dict(nodes=nodes,
conn=connectors, conn=connectors,
id_model=id_model, name=name,
parent_field=graphs['node_parent_field']) parent_field=graphs['node_parent_field'])

View File

@ -0,0 +1,58 @@
# Czech translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-22 09:44+0000\n"
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr "Diagram"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:224
#: addons/web_diagram/static/src/js/diagram.js:257
msgid "Activity"
msgstr "Činnosti"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:289
#: addons/web_diagram/static/src/js/diagram.js:308
msgid "Transition"
msgstr "Přechod"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
#: addons/web_diagram/static/src/js/diagram.js:262
#: addons/web_diagram/static/src/js/diagram.js:314
msgid "Create:"
msgstr "Vytvořit:"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
#: addons/web_diagram/static/src/js/diagram.js:232
#: addons/web_diagram/static/src/js/diagram.js:296
msgid "Open: "
msgstr "Otevřít: "
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
#: addons/web_diagram/static/src/xml/base_diagram.xml:6
msgid "New Node"
msgstr "Nový uzel"

View File

@ -0,0 +1,57 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 11:59+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr "Kaavio"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:224
#: addons/web_diagram/static/src/js/diagram.js:257
msgid "Activity"
msgstr "Aktiviteetti"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:289
#: addons/web_diagram/static/src/js/diagram.js:308
msgid "Transition"
msgstr "Siirtyminen"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
#: addons/web_diagram/static/src/js/diagram.js:262
#: addons/web_diagram/static/src/js/diagram.js:314
msgid "Create:"
msgstr "Luo:"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
#: addons/web_diagram/static/src/js/diagram.js:232
#: addons/web_diagram/static/src/js/diagram.js:296
msgid "Open: "
msgstr "Avaa: "
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
#: addons/web_diagram/static/src/xml/base_diagram.xml:6
msgid "New Node"
msgstr "Uusi Noodi"

View File

@ -0,0 +1,57 @@
# Japanese translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-26 22:02+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-27 04:58+0000\n"
"X-Generator: Launchpad (build 15011)\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr "ダイアグラム"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:224
#: addons/web_diagram/static/src/js/diagram.js:257
msgid "Activity"
msgstr "アクティビティ"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:289
#: addons/web_diagram/static/src/js/diagram.js:308
msgid "Transition"
msgstr "変遷"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
#: addons/web_diagram/static/src/js/diagram.js:262
#: addons/web_diagram/static/src/js/diagram.js:314
msgid "Create:"
msgstr "作成:"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
#: addons/web_diagram/static/src/js/diagram.js:232
#: addons/web_diagram/static/src/js/diagram.js:296
msgid "Open: "
msgstr "開く: "
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
#: addons/web_diagram/static/src/xml/base_diagram.xml:6
msgid "New Node"
msgstr "新しいノード"

View File

@ -0,0 +1,57 @@
# Romanian translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 23:14+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Romanian <ro@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-21 05:21+0000\n"
"X-Generator: Launchpad (build 14981)\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr "Diagramă"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:224
#: addons/web_diagram/static/src/js/diagram.js:257
msgid "Activity"
msgstr "Activitate"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:289
#: addons/web_diagram/static/src/js/diagram.js:308
msgid "Transition"
msgstr "Tranziție"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
#: addons/web_diagram/static/src/js/diagram.js:262
#: addons/web_diagram/static/src/js/diagram.js:314
msgid "Create:"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
#: addons/web_diagram/static/src/js/diagram.js:232
#: addons/web_diagram/static/src/js/diagram.js:296
msgid "Open: "
msgstr "Deschide: "
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
#: addons/web_diagram/static/src/xml/base_diagram.xml:6
msgid "New Node"
msgstr "Nod Nou"

View File

@ -0,0 +1,84 @@
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
for ( var i=types.length; i; ) {
this.addEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
this.removeEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,53 @@
.openerp .oe_diagram_header h3.oe_diagram_title {
font-weight: normal;
color: #252424;
margin: 0 0 0 2px;
}
.openerp .oe_diagram_pager { .openerp .oe_diagram_pager {
text-align: right; float:right;
/*text-align: right;*/
white-space: nowrap; white-space: nowrap;
} }
.openerp .oe_diagram_buttons { .openerp .oe_diagram_buttons {
float: left; float: left;
} }
.openerp .clear{
/*.openerp .dhx_canvas_text { clear:both;
padding:30px 0 0 10px; }
-webkit-transform: rotate(60deg); /* We use a resizable diagram-container. The problem with a
-moz-transform: rotate(60deg); * resizable diagram is that the diagram catches the mouse events
-o-transform: rotate(60deg); * and the diagram is then impossible to resize. That's why the
-ms-transform: rotate(60deg); * diagram has a height of 98.5%, so that the bottom part of the
transform: rotate(60deg); * diagram can be used for resize
*/
.openerp .diagram-container{
margin:0;
padding:0;
width:100%;
height:500px;
resize:vertical;
background-color:#FFF;
border:1px solid #DCDCDC;
overflow:hidden;
}
.openerp .oe_diagram_diagram{
margin:0;
padding:0;
background-color:#FFF;
width:100%;
height:98.5%;
} }
.openerp .dhx_canvas_text.dhx_axis_item_y, .openerp .dhx_canvas_text.dhx_axis_title_x { /* prevent accidental selection of the text in the svg nodes */
padding: 0px; .openerp .oe_diagram_diagram *{
-webkit-transform: rotate(0deg); -webkit-touch-callout: none;
-moz-transform: rotate(0deg); -webkit-user-select: none;
-o-transform: rotate(0deg); -khtml-user-select: none;
-ms-transform: rotate(0deg); -moz-user-select: none;
transform: rotate(0deg); -ms-user-select: none;
} -o-user-select: none;
user-select: none;
};
.openerp .dhx_canvas_text.dhx_axis_title_y {
padding: 0;
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-o-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
} */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -55,7 +55,7 @@ openerp.web.DiagramView = openerp.web.View.extend({
this.do_update_pager(); this.do_update_pager();
// New Node,Edge // 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_node.oe_diagram_button_new').click(function(){self.add_node();});
if(this.id) { if(this.id) {
self.get_diagram_info(); self.get_diagram_info();
@ -111,175 +111,233 @@ openerp.web.DiagramView = openerp.web.View.extend({
this.get_diagram_info(); this.get_diagram_info();
} }
}, },
select_node: function (node, element) {
if (!this.selected_node) { // Set-up the drawing elements of the diagram
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) { draw_diagram: function(result) {
this.selected_node = null;
var diagram = new Graph();
this.active_model = result['id_model'];
var res_nodes = result['nodes'];
var res_connectors = result['conn'];
this.parent_field = result.parent_field;
//Custom logic
var self = this; var self = this;
var renderer = function(r, n) { var res_nodes = result['nodes'];
var shape = (n.node.shape === 'rectangle') ? 'rect' : 'ellipse'; var res_edges = result['conn'];
this.parent_field = result.parent_field;
this.$element.find('h3.oe_diagram_title').text(result.name);
var node = r[shape](n.node.x, n.node.y).attr({ var id_to_node = {};
"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') { var style = {
node.attr({width: "60", height: "44"}); edge_color: "#A0A0A0",
node.next.attr({"text-anchor": "middle", x: n.node.x + 20, y: n.node.y + 20}); edge_label_color: "#555",
} else { edge_label_font_size: 10,
node.attr({rx: "40", ry: "20"}); edge_width: 2,
} edge_spacing: 100,
edge_loop_radius: 100,
return nodes; node_label_color: "#333",
node_label_font_size: 12,
node_outline_color: "#333",
node_outline_width: 1,
node_selected_color: "#0097BE",
node_selected_width: 2,
node_size_x: 110,
node_size_y: 80,
connector_active_color: "#FFF",
connector_radius: 4,
close_button_radius: 8,
close_button_color: "#333",
close_button_x_color: "#FFF",
gray: "#DCDCDC",
white: "#FFF",
viewport_margin: 50
}; };
_.each(res_nodes, function(res_node) { // remove previous diagram
diagram.addNode(res_node['name'],{node: res_node,render: renderer}); var canvas = self.$element.find('div.oe_diagram_diagram')
.empty().get(0);
var r = new Raphael(canvas, '100%','100%');
var graph = new CuteGraph(r,style,canvas.parentNode);
var confirm_dialog = $('#dialog').dialog({
autoOpen: false,
title: _t("Are you sure?") });
_.each(res_nodes, function(node) {
var n = new CuteNode(
graph,
node.x + 50, //FIXME the +50 should be in the layout algorithm
node.y + 50,
CuteGraph.wordwrap(node.name, 14),
node.shape === 'rectangle' ? 'rect' : 'circle',
node.color === 'white' ? style.white : style.gray);
n.id = node.id;
id_to_node[node.id] = n;
}); });
// Id for Path(Edges) _.each(res_edges, function(edge) {
var edge_ids = []; var e = new CuteEdge(
graph,
_.each(res_connectors, function(connector, index) { CuteGraph.wordwrap(edge.signal, 32),
edge_ids.push(index); id_to_node[edge.s_id],
diagram.addEdge(connector['source'], connector['destination'], {directed : true, label: connector['signal']}); id_to_node[edge.d_id] || id_to_node[edge.s_id] ); //WORKAROUND
e.id = edge.id;
}); });
self.$element.find('.diagram').empty(); CuteNode.double_click_callback = function(cutenode){
self.edit_node(cutenode.id);
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()); var i = 0;
CuteNode.destruction_callback = function(cutenode){
_.each(diagram.edges, function(edge, index) { if(!confirm(_t("Deleting this node cannot be undone.\nIt will also delete all connected transitions.\n\nAre you sure ?"))){
if(edge.connection) { return $.Deferred().reject().promise();
edge.connection.fg.attr({cursor: "pointer"}).dblclick(function() {
self.add_edit_node(edge_ids[index], self.connector);
});
} }
}); return new openerp.web.DataSet(self,self.node).unlink([cutenode.id]);
};
CuteEdge.double_click_callback = function(cuteedge){
self.edit_connector(cuteedge.id);
};
CuteEdge.creation_callback = function(node_start, node_end){
return {label:_t("")};
};
CuteEdge.new_edge_callback = function(cuteedge){
self.add_connector(cuteedge.get_start().id,
cuteedge.get_end().id,
cuteedge);
};
CuteEdge.destruction_callback = function(cuteedge){
if(!confirm(_t("Deleting this transition cannot be undone.\n\nAre you sure ?"))){
return $.Deferred().reject().promise();
}
return new openerp.web.DataSet(self,self.connector).unlink([cuteedge.id]);
};
}, },
add_edit_node: function(id, model, defaults) { // Creates a popup to edit the content of the node with id node_id
defaults = defaults || {}; edit_node: function(node_id){
var self = this; var self = this;
var title = _t('Activity');
var pop = new openerp.web.form.FormOpenPopup(self);
if(!model) pop.show_element(
model = self.node; self.node,
if(id) node_id,
id = parseInt(id, 10); self.context || self.dataset.context,
var pop,
title = model == self.node ? _t('Activity') : _t('Transition');
if(!id) {
pop = new openerp.web.form.SelectCreatePopup(this);
pop.select_element(
model,
{
title: _t("Create:") + title,
initial_view: 'form',
disable_multiple_selection: true
},
this.dataset.domain,
this.context || this.dataset.context
);
pop.on_select_elements.add_last(function(element_ids) {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
});
} else {
pop = new openerp.web.form.FormOpenPopup(this);
pop.show_element(
model,
id,
this.context || this.dataset.context,
{ {
title: _t("Open: ") + title title: _t("Open: ") + title
} }
); );
pop.on_write.add(function() {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); pop.on_write.add(function() {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
}); });
}
var form_fields = [self.parent_field];
var form_controller = pop.view_form;
form_controller.on_record_loaded.add_first(function() {
_.each(form_fields, function(fld) {
if (!(fld in form_controller.fields)) { return; }
var field = form_controller.fields[fld];
field.$input.prop('disabled', true);
field.$drop_down.unbind();
field.$menu_btn.unbind();
});
});
},
// Creates a popup to add a node to the diagram
add_node: function(){
var self = this;
var title = _t('Activity');
var pop = new openerp.web.form.SelectCreatePopup(self);
pop.select_element(
self.node,
{
title: _t("Create:") + title,
initial_view: 'form',
disable_multiple_selection: true
},
self.dataset.domain,
self.context || self.dataset.context
);
pop.on_select_elements.add_last(function(element_ids) {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
});
var form_controller = pop.view_form;
var form_fields = [this.parent_field];
form_controller.on_record_loaded.add_last(function() {
_.each(form_fields, function(fld) {
if (!(fld in form_controller.fields)) { return; }
var field = form_controller.fields[fld];
field.set_value(self.id);
field.dirty = true;
});
});
},
// Creates a popup to edit the connector of id connector_id
edit_connector: function(connector_id){
var self = this;
var title = _t('Transition');
var pop = new openerp.web.form.FormOpenPopup(self);
pop.show_element(
self.connector,
parseInt(connector_id,10), //FIXME Isn't connector_id supposed to be an int ?
self.context || self.dataset.context,
{
title: _t("Open: ") + title
}
);
pop.on_write.add(function() {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
});
},
// Creates a popup to add a connector from node_source_id to node_dest_id.
// dummy_cuteedge if not null, will be removed form the graph after the popup is closed.
add_connector: function(node_source_id, node_dest_id, dummy_cuteedge){
var self = this;
var title = _t('Transition');
var pop = new openerp.web.form.SelectCreatePopup(self);
pop.select_element(
self.connector,
{
title: _t("Create:") + title,
initial_view: 'form',
disable_multiple_selection: true
},
this.dataset.domain,
this.context || this.dataset.context
);
pop.on_select_elements.add_last(function(element_ids) {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
});
// We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes.
// This is not a problem since the diagram is completely redrawn on saved changes.
pop.$element.bind("dialogbeforeclose",function(){
if(dummy_cuteedge){
dummy_cuteedge.remove();
}
});
var form_controller = pop.view_form; var form_controller = pop.view_form;
var form_fields; form_controller.on_record_loaded.add_last(function () {
form_controller.fields[self.connectors.attrs.source].set_value(node_source_id);
if (model === self.node) { form_controller.fields[self.connectors.attrs.source].dirty = true;
form_fields = [this.parent_field]; form_controller.fields[self.connectors.attrs.destination].set_value(node_dest_id);
if (!id) { form_controller.fields[self.connectors.attrs.destination].dirty = true;
form_controller.on_record_loaded.add_last(function() { });
_.each(form_fields, function(fld) {
if (!(fld in form_controller.fields)) { return; }
var field = form_controller.fields[fld];
field.set_value([self.id,self.active_model]);
field.dirty = true;
});
});
} else {
form_controller.on_record_loaded.add_first(function() {
_.each(form_fields, function(fld) {
if (!(fld in form_controller.fields)) { return; }
var field = form_controller.fields[fld];
field.$input.prop('disabled', true);
field.$drop_down.unbind();
field.$menu_btn.unbind();
});
});
}
} else {
form_fields = [
this.connectors.attrs.source,
this.connectors.attrs.destination];
}
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) { on_pager_action: function(action) {
@ -297,8 +355,10 @@ openerp.web.DiagramView = openerp.web.View.extend({
this.dataset.index = this.dataset.ids.length - 1; this.dataset.index = this.dataset.ids.length - 1;
break; break;
} }
this.dataset.read_index(_.keys(this.fields_view.fields)).pipe(this.on_diagram_loaded); var loaded = this.dataset.read_index(_.keys(this.fields_view.fields))
.pipe(this.on_diagram_loaded);
this.do_update_pager(); this.do_update_pager();
return loaded;
}, },
do_update_pager: function(hide_index) { do_update_pager: function(hide_index) {
@ -313,7 +373,7 @@ openerp.web.DiagramView = openerp.web.View.extend({
do_show: function() { do_show: function() {
this.do_push_state({}); this.do_push_state({});
return this._super(); return $.when(this._super(), this.on_pager_action('reload'));
} }
}); });
}; };

View File

@ -0,0 +1,996 @@
(function(window){
// this serves as the end of an edge when creating a link
function EdgeEnd(pos_x,pos_y){
this.x = pos_x;
this.y = pos_y;
this.get_pos = function(){
return new Vec2(this.x,this.y);
}
}
// A close button,
// if entity_type == "node":
// GraphNode.destruction_callback(entity) is called where entity is a node.
// If it returns true the node and all connected edges are destroyed.
// if entity_type == "edge":
// GraphEdge.destruction_callback(entity) is called where entity is an edge
// If it returns true the edge is destroyed
// pos_x,pos_y is the relative position of the close button to the entity position (entity.get_pos())
function CloseButton(graph, entity, entity_type, pos_x,pos_y){
var self = this;
var visible = false;
var close_button_radius = graph.style.close_button_radius || 8;
var close_circle = graph.r.circle( entity.get_pos().x + pos_x,
entity.get_pos().y + pos_y,
close_button_radius );
//the outer gray circle
close_circle.attr({ 'opacity': 0,
'fill': graph.style.close_button_color || "black",
'cursor': 'pointer',
'stroke': 'none' });
close_circle.transform(graph.get_transform());
graph.set_scrolling(close_circle);
//the 'x' inside the circle
var close_label = graph.r.text( entity.get_pos().x + pos_x, entity.get_pos().y + pos_y,"x");
close_label.attr({ 'fill': graph.style.close_button_x_color || "white",
'font-size': close_button_radius,
'cursor': 'pointer' });
close_label.transform(graph.get_transform());
graph.set_scrolling(close_label);
// the dummy_circle is used to catch events, and avoid hover in/out madness
// between the 'x' and the button
var dummy_circle = graph.r.circle( entity.get_pos().x + pos_x,
entity.get_pos().y + pos_y,
close_button_radius );
dummy_circle.attr({'opacity':1, 'fill': 'transparent', 'stroke':'none', 'cursor':'pointer'});
dummy_circle.transform(graph.get_transform());
graph.set_scrolling(dummy_circle);
this.get_pos = function(){
return entity.get_pos().add_xy(pos_x,pos_y);
};
this.update_pos = function(){
var pos = self.get_pos();
close_circle.attr({'cx':pos.x, 'cy':pos.y});
dummy_circle.attr({'cx':pos.x, 'cy':pos.y});
close_label.attr({'x':pos.x, 'y':pos.y});
};
function hover_in(){
if(!visible){ return; }
close_circle.animate({'r': close_button_radius * 1.5}, 300, 'elastic');
dummy_circle.animate({'r': close_button_radius * 1.5}, 300, 'elastic');
}
function hover_out(){
if(!visible){ return; }
close_circle.animate({'r': close_button_radius},400,'linear');
dummy_circle.animate({'r': close_button_radius},400,'linear');
}
dummy_circle.hover(hover_in,hover_out);
function click_action(){
if(!visible){ return; }
close_circle.attr({'r': close_button_radius * 2 });
dummy_circle.attr({'r': close_button_radius * 2 });
close_circle.animate({'r': close_button_radius }, 400, 'linear');
dummy_circle.animate({'r': close_button_radius }, 400, 'linear');
if(entity_type == "node"){
$.when(GraphNode.destruction_callback(entity)).then(function () {
//console.log("remove node",entity);
entity.remove();
});
}else if(entity_type == "edge"){
$.when(GraphEdge.destruction_callback(entity)).then(function () {
//console.log("remove edge",entity);
entity.remove();
});
}
}
dummy_circle.click(click_action);
this.show = function(){
if(!visible){
close_circle.animate({'opacity':1}, 100, 'linear');
close_label.animate({'opacity':1}, 100, 'linear');
visible = true;
}
}
this.hide = function(){
if(visible){
close_circle.animate({'opacity':0}, 100, 'linear');
close_label.animate({'opacity':0}, 100, 'linear');
visible = false;
}
}
//destroy this object and remove it from the graph
this.remove = function(){
if(visible){
visible = false;
close_circle.animate({'opacity':0}, 100, 'linear');
close_label.animate({'opacity':0}, 100, 'linear',self.remove);
}else{
close_circle.remove();
close_label.remove();
dummy_circle.remove();
}
}
}
// connectors are start and end point of edge creation drags.
function Connector(graph,node,pos_x,pos_y){
var visible = false;
var conn_circle = graph.r.circle(node.get_pos().x + pos_x, node.get_pos().y + pos_y,4);
conn_circle.attr({ 'opacity': 0,
'fill': graph.style.node_outline_color,
'stroke': 'none' });
conn_circle.transform(graph.get_transform());
graph.set_scrolling(conn_circle);
var self = this;
this.update_pos = function(){
conn_circle.attr({'cx':node.get_pos().x + pos_x, 'cy':node.get_pos().y + pos_y});
};
this.get_pos = function(){
return new node.get_pos().add_xy(pos_x,pos_y);
};
this.remove = function(){
conn_circle.remove();
}
function hover_in(){
if(!visible){ return;}
conn_circle.animate({'r':8},300,'elastic');
if(graph.creating_edge){
graph.target_node = node;
conn_circle.animate({ 'fill': graph.style.connector_active_color,
'stroke': graph.style.node_outline_color,
'stroke-width': graph.style.node_selected_width,
},100,'linear');
}
}
function hover_out(){
if(!visible){ return;}
conn_circle.animate({ 'r':graph.style.connector_radius,
'fill':graph.style.node_outline_color,
'stroke':'none'},400,'linear');
graph.target_node = null;
}
conn_circle.hover(hover_in,hover_out);
var drag_down = function(){
if(!visible){ return; }
self.ox = conn_circle.attr("cx");
self.oy = conn_circle.attr("cy");
self.edge_start = new EdgeEnd(self.ox,self.oy);
self.edge_end = new EdgeEnd(self.ox, self.oy);
self.edge_tmp = new GraphEdge(graph,'',self.edge_start,self.edge_end,true);
graph.creating_edge = true;
};
var drag_move = function(dx,dy){
if(!visible){ return; }
self.edge_end.x = self.ox + dx;
self.edge_end.y = self.oy + dy;
self.edge_tmp.update();
};
var drag_up = function(){
if(!visible){ return; }
graph.creating_edge = false;
self.edge_tmp.remove();
if(graph.target_node){
var edge_prop = GraphEdge.creation_callback(node,graph.target_node);
if(edge_prop){
var new_edge = new GraphEdge(graph,edge_prop.label, node,graph.target_node);
GraphEdge.new_edge_callback(new_edge);
}
}
};
conn_circle.drag(drag_move,drag_down,drag_up);
function show(){
if(!visible){
conn_circle.animate({'opacity':1}, 100, 'linear');
visible = true;
}
}
function hide(){
if(visible){
conn_circle.animate({'opacity':0}, 100, 'linear');
visible = false;
}
}
this.show = show;
this.hide = hide;
}
//Creates a new graph on raphael document r.
//style is a dictionary containing the style definitions
//viewport (optional) is the dom element representing the viewport of the graph. It is used
//to prevent scrolling to scroll the graph outside the viewport.
function Graph(r,style,viewport){
var self = this;
var nodes = []; // list of all nodes in the graph
var edges = []; // list of all edges in the graph
var graph = {}; // graph[n1.uid][n2.uid] -> list of all edges from n1 to n2
var links = {}; // links[n.uid] -> list of all edges from or to n
var uid = 1; // all nodes and edges have an uid used to order their display when they are curved
var selected_entity = null; //the selected entity (node or edge)
self.creating_edge = false; // true if we are dragging a new edge onto a node
self.target_node = null; // this holds the target node when creating an edge and hovering a connector
self.r = r; // the raphael instance
self.style = style; // definition of the colors, spacing, fonts, ... used by the elements
var tr_x = 0, tr_y = 0; // global translation coordinate
var background = r.rect(0,0,'100%','100%').attr({'fill':'white', 'stroke':'none', 'opacity':0, 'cursor':'move'});
// return the global transform of the scene
this.get_transform = function(){
return "T"+tr_x+","+tr_y
};
// translate every element of the graph except the background.
// elements inserted in the graph after a translate_all() must manually apply transformation
// via get_transform()
var translate_all = function(dx,dy){
tr_x += dx;
tr_y += dy;
var tstr = self.get_transform();
r.forEach(function(el){
if(el != background){
el.transform(tstr);
}
});
};
//returns {minx, miny, maxx, maxy}, the translated bounds containing all nodes
var get_bounds = function(){
var minx = Number.MAX_VALUE;
var miny = Number.MAX_VALUE;
var maxx = Number.MIN_VALUE;
var maxy = Number.MIN_VALUE;
for(var i = 0; i < nodes.length; i++){
var pos = nodes[i].get_pos();
minx = Math.min(minx,pos.x);
miny = Math.min(miny,pos.y);
maxx = Math.max(maxx,pos.x);
maxy = Math.max(maxy,pos.y);
}
minx = minx - style.node_size_x / 2 + tr_x;
miny = miny - style.node_size_y / 2 + tr_y;
maxx = maxx + style.node_size_x / 2 + tr_x;
maxy = maxy + style.node_size_y / 2 + tr_y;
return { minx:minx, miny:miny, maxx:maxx, maxy:maxy };
};
// returns false if the translation dx,dy of the viewport
// hides the graph (with optional margin)
var translation_respects_viewport = function(dx,dy,margin){
if(!viewport){
return true;
}
margin = margin || 0;
var b = get_bounds();
var width = viewport.offsetWidth;
var height = viewport.offsetHeight;
if( ( dy < 0 && b.maxy + dy < margin ) ||
( dy > 0 && b.miny + dy > height - margin ) ||
( dx < 0 && b.maxx + dx < margin ) ||
( dx > 0 && b.minx + dx > width - margin ) ){
return false;
}
return true;
}
//Adds a mousewheel event callback to raph_element that scrolls the viewport
this.set_scrolling = function(raph_element){
$(raph_element.node).bind('mousewheel',function(event,delta){
var dy = delta * 20;
if( translation_respects_viewport(0,dy, style.viewport_margin) ){
translate_all(0,dy);
}
});
};
var px, py;
// Graph translation when background is dragged
var bg_drag_down = function(){
px = py = 0;
};
var bg_drag_move = function(x,y){
var dx = x - px;
var dy = y - py;
px = x;
py = y;
if( translation_respects_viewport(dx,dy, style.viewport_margin) ){
translate_all(dx,dy);
}
};
var bg_drag_up = function(){};
background.drag( bg_drag_move, bg_drag_down, bg_drag_up);
this.set_scrolling(background);
//adds a node to the graph and sets its uid.
this.add_node = function (n){
nodes.push(n);
n.uid = uid++;
};
//return the list of all nodes in the graph
this.get_node_list = function(){
return nodes;
};
//adds an edge to the graph and sets its uid
this.add_edge = function (n1,n2,e){
edges.push(e);
e.uid = uid++;
if(!graph[n1.uid]) graph[n1.uid] = {};
if(!graph[n1.uid][n2.uid]) graph[n1.uid][n2.uid] = [];
if(!links[n1.uid]) links[n1.uid] = [];
if(!links[n2.uid]) links[n2.uid] = [];
graph[n1.uid][n2.uid].push(e);
links[n1.uid].push(e);
if(n1 != n2){
links[n2.uid].push(e);
}
};
//removes an edge from the graph
this.remove_edge = function(edge){
edges = _.without(edges,edge);
var n1 = edge.get_start();
var n2 = edge.get_end();
links[n1.uid] = _.without(links[n1.uid],edge);
links[n2.uid] = _.without(links[n2.uid],edge);
graph[n1.uid][n2.uid] = _.without(graph[n1.uid][n2.uid],edge);
if ( selected_entity == edge ){
selected_entity = null;
}
};
//removes a node and all connected edges from the graph
this.remove_node = function(node){
var linked_edges = self.get_linked_edge_list(node);
for(var i = 0; i < linked_edges.length; i++){
linked_edges[i].remove();
}
nodes = _.without(nodes,node);
if ( selected_entity == node ){
selected_entity = null;
}
}
//return the list of edges from n1 to n2
this.get_edge_list = function(n1,n2){
var list = [];
if(!graph[n1.uid]) return list;
if(!graph[n1.uid][n2.uid]) return list;
return graph[n1.uid][n2.uid];
};
//returns the list of all edge connected to n
this.get_linked_edge_list = function(n){
if(!links[n.uid]) return [];
return links[n.uid];
};
//return a curvature index so that all edges connecting n1,n2 have different curvatures
this.get_edge_curvature = function(n1,n2,e){
var el_12 = this.get_edge_list(n1,n2);
var c12 = el_12.length;
var el_21 = this.get_edge_list(n2,n1);
var c21 = el_21.length;
if(c12 + c21 == 1){ // only one edge
return 0;
}else{
var index = 0;
for(var i = 0; i < c12; i++){
if (el_12[i].uid < e.uid){
index++;
}
}
if(c21 == 0){ // all edges in the same direction
return index - (c12-1)/2.0;
}else{
return index + 0.5;
}
}
};
// Returns the angle in degrees of the edge loop. We do not support more than 8 loops on one node
this.get_loop_angle = function(n,e){
var loop_list = this.get_edge_list(n,n);
var slots = []; // the 8 angles where we can put the loops
for(var angle = 0; angle < 360; angle += 45){
slots.push(Vec2.new_polar_deg(1,angle));
}
//we assign to each slot a score. The higher the score, the closer it is to other edges.
var links = this.get_linked_edge_list(n);
for(var i = 0; i < links.length; i++){
var edge = links[i];
if(!edge.is_loop || edge.is_loop()){
continue;
}
var end = edge.get_end();
if (end == n){
end = edge.get_start();
}
var dir = end.get_pos().sub(n.get_pos()).normalize();
for(var s = 0; s < slots.length; s++){
var score = slots[s].dot(dir);
if(score < 0){
score = -0.2*Math.pow(score,2);
}else{
score = Math.pow(score,2);
}
if(!slots[s].score){
slots[s].score = score;
}else{
slots[s].score += score;
}
}
}
//we want the loops with lower uid to get the slots with the lower score
slots.sort(function(a,b){ return a.score < b.score ? -1: 1; });
var index = 0;
for(var i = 0; i < links.length; i++){
var edge = links[i];
if(!edge.is_loop || !edge.is_loop()){
continue;
}
if(edge.uid < e.uid){
index++;
}
}
index %= slots.length;
return slots[index].angle_deg();
}
//selects a node or an edge and deselects everything else
this.select = function(entity){
if(selected_entity){
if(selected_entity == entity){
return;
}else{
if(selected_entity.set_not_selected){
selected_entity.set_not_selected();
}
selected_entity = null;
}
}
selected_entity = entity;
if(entity && entity.set_selected){
entity.set_selected();
}
};
}
// creates a new Graph Node on Raphael document r, centered on [pos_x,pos_y], with label 'label',
// and of type 'circle' or 'rect', and of color 'color'
function GraphNode(graph,pos_x, pos_y,label,type,color){
var self = this;
var r = graph.r;
var sy = graph.style.node_size_y;
var sx = graph.style.node_size_x;
var node_fig = null;
var selected = false;
this.connectors = [];
this.close_button = null;
this.uid = 0;
graph.add_node(this);
if(type == 'circle'){
node_fig = r.ellipse(pos_x,pos_y,sx/2,sy/2);
}else{
node_fig = r.rect(pos_x-sx/2,pos_y-sy/2,sx,sy);
}
node_fig.attr({ 'fill': color,
'stroke': graph.style.node_outline_color,
'stroke-width': graph.style.node_outline_width,
'cursor':'pointer' });
node_fig.transform(graph.get_transform());
graph.set_scrolling(node_fig);
var node_label = r.text(pos_x,pos_y,label);
node_label.attr({ 'fill': graph.style.node_label_color,
'font-size': graph.style.node_label_font_size,
'cursor': 'pointer' });
node_label.transform(graph.get_transform());
graph.set_scrolling(node_label);
// redraws all edges linked to this node
var update_linked_edges = function(){
var edges = graph.get_linked_edge_list(self);
for(var i = 0; i < edges.length; i++){
edges[i].update();
}
};
// sets the center position of the node
var set_pos = function(pos){
if(type == 'circle'){
node_fig.attr({'cx':pos.x,'cy':pos.y});
}else{
node_fig.attr({'x':pos.x-sx/2,'y':pos.y-sy/2});
}
node_label.attr({'x':pos.x,'y':pos.y});
for(var i = 0; i < self.connectors.length; i++){
self.connectors[i].update_pos();
}
if(self.close_button){
self.close_button.update_pos();
}
update_linked_edges();
};
// returns the figure used to draw the node
var get_fig = function(){
return node_fig;
};
// returns the center coordinates
var get_pos = function(){
if(type == 'circle'){
return new Vec2(node_fig.attr('cx'), node_fig.attr('cy'));
}else{
return new Vec2(node_fig.attr('x') + sx/2, node_fig.attr('y') + sy/2);
}
};
// return the label string
var get_label = function(){
return node_label.attr("text");
};
// sets the label string
var set_label = function(text){
node_label.attr({'text':text});
};
var get_bound = function(){
if(type == 'circle'){
return new BEllipse(get_pos().x,get_pos().y,sx/2,sy/2);
}else{
return BRect.new_centered(get_pos().x,get_pos().y,sx,sy);
}
};
// selects this node and deselects all other nodes
var set_selected = function(){
if(!selected){
selected = true;
node_fig.attr({ 'stroke': graph.style.node_selected_color,
'stroke-width': graph.style.node_selected_width });
if(!self.close_button){
self.close_button = new CloseButton(graph,self, "node" ,sx/2 , - sy/2);
self.close_button.show();
}
for(var i = 0; i < self.connectors.length; i++){
self.connectors[i].show();
}
}
};
// deselect this node
var set_not_selected = function(){
if(selected){
node_fig.animate({ 'stroke': graph.style.node_outline_color,
'stroke-width': graph.style.node_outline_width },
100,'linear');
if(self.close_button){
self.close_button.remove();
self.close_button = null;
}
selected = false;
}
for(var i = 0; i < self.connectors.length; i++){
self.connectors[i].hide();
}
};
var remove = function(){
if(self.close_button){
self.close_button.remove();
}
for(var i = 0; i < self.connectors.length; i++){
self.connectors[i].remove();
}
graph.remove_node(self);
node_fig.remove();
node_label.remove();
}
this.set_pos = set_pos;
this.get_pos = get_pos;
this.set_label = set_label;
this.get_label = get_label;
this.get_bound = get_bound;
this.get_fig = get_fig;
this.set_selected = set_selected;
this.set_not_selected = set_not_selected;
this.update_linked_edges = update_linked_edges;
this.remove = remove;
//select the node and play an animation when clicked
var click_action = function(){
if(type == 'circle'){
node_fig.attr({'rx':sx/2 + 3, 'ry':sy/2+ 3});
node_fig.animate({'rx':sx/2, 'ry':sy/2},500,'elastic');
}else{
var cx = get_pos().x;
var cy = get_pos().y;
node_fig.attr({'x':cx - (sx/2) - 3, 'y':cy - (sy/2) - 3, 'ẃidth':sx+6, 'height':sy+6});
node_fig.animate({'x':cx - sx/2, 'y':cy - sy/2, 'ẃidth':sx, 'height':sy},500,'elastic');
}
graph.select(self);
};
node_fig.click(click_action);
node_label.click(click_action);
//move the node when dragged
var drag_down = function(){
this.opos = get_pos();
};
var drag_move = function(dx,dy){
// we disable labels when moving for performance reasons,
// updating the label position is quite expensive
// we put this here because drag_down is also called on simple clicks ... and this causes unwanted flicker
var edges = graph.get_linked_edge_list(self);
for(var i = 0; i < edges.length; i++){
edges[i].label_disable();
}
if(self.close_button){
self.close_button.hide();
}
set_pos(this.opos.add_xy(dx,dy));
};
var drag_up = function(){
//we re-enable the
var edges = graph.get_linked_edge_list(self);
for(var i = 0; i < edges.length; i++){
edges[i].label_enable();
}
if(self.close_button){
self.close_button.show();
}
};
node_fig.drag(drag_move,drag_down,drag_up);
node_label.drag(drag_move,drag_down,drag_up);
//allow the user to create edges by dragging onto the node
function hover_in(){
if(graph.creating_edge){
graph.target_node = self;
}
}
function hover_out(){
graph.target_node = null;
}
node_fig.hover(hover_in,hover_out);
node_label.hover(hover_in,hover_out);
function double_click(){
GraphNode.double_click_callback(self);
}
node_fig.dblclick(double_click);
node_label.dblclick(double_click);
this.connectors.push(new Connector(graph,this,-sx/2,0));
this.connectors.push(new Connector(graph,this,sx/2,0));
this.connectors.push(new Connector(graph,this,0,-sy/2));
this.connectors.push(new Connector(graph,this,0,sy/2));
this.close_button = new CloseButton(graph,this,"node",sx/2 , - sy/2 );
}
GraphNode.double_click_callback = function(node){
console.log("double click from node:",node);
};
// this is the default node destruction callback. It is called before the node is removed from the graph
// and before the connected edges are destroyed
GraphNode.destruction_callback = function(node){ return true; };
// creates a new edge with label 'label' from start to end. start and end must implement get_pos_*,
// if tmp is true, the edge is not added to the graph, used for drag edges.
// replace tmp == false by graph == null
function GraphEdge(graph,label,start,end,tmp){
var self = this;
var r = graph.r;
var curvature = 0; // 0 = straight, != 0 curved
var s,e; // positions of the start and end point of the line between start and end
var mc; // position of the middle of the curve (bezier control point)
var mc1,mc2; // control points of the cubic bezier for the loop edges
var elfs = graph.style.edge_label_font_size || 10 ;
var label_enabled = true;
this.uid = 0; // unique id used to order the curved edges
var edge_path = ""; // svg definition of the edge vector path
var selected = false;
if(!tmp){
graph.add_edge(start,end,this);
}
//Return the position of the label
function get_label_pos(path){
var cpos = path.getTotalLength() * 0.5;
var cindex = Math.abs(Math.floor(curvature));
var mod = ((cindex % 3)) * (elfs * 3.1) - (elfs * 0.5);
var verticality = Math.abs(end.get_pos().sub(start.get_pos()).normalize().dot_xy(0,1));
verticality = Math.max(verticality-0.5,0)*2;
var lpos = path.getPointAtLength(cpos + mod * verticality);
return new Vec2(lpos.x,lpos.y - elfs *(1-verticality));
}
//used by close_button
this.get_pos = function(){
if(!edge){
return start.get_pos().lerp(end.get_pos(),0.5);
}
return get_label_pos(edge);
/*
var bbox = edge_label.getBBox(); Does not work... :(
return new Vec2(bbox.x + bbox.width, bbox.y);*/
}
//Straight line from s to e
function make_line(){
return "M" + s.x + "," + s.y + "L" + e.x + "," + e.y ;
}
//Curved line from s to e by mc
function make_curve(){
return "M" + s.x + "," + s.y + "Q" + mc.x + "," + mc.y + " " + e.x + "," + e.y;
}
//Curved line from s to e by mc1 mc2
function make_loop(){
return "M" + s.x + " " + s.y +
"C" + mc1.x + " " + mc1.y + " " + mc2.x + " " + mc2.y + " " + e.x + " " + e.y;
}
//computes new start and end line coordinates
function update_curve(){
if(start != end){
if(!tmp){
curvature = graph.get_edge_curvature(start,end,self);
}else{
curvature = 0;
}
s = start.get_pos();
e = end.get_pos();
mc = s.lerp(e,0.5); //middle of the line s->e
var se = e.sub(s);
se = se.normalize();
se = se.rotate_deg(-90);
se = se.scale(curvature * graph.style.edge_spacing);
mc = mc.add(se);
if(start.get_bound){
var col = start.get_bound().collide_segment(s,mc);
if(col.length > 0){
s = col[0];
}
}
if(end.get_bound){
var col = end.get_bound().collide_segment(mc,e);
if(col.length > 0){
e = col[0];
}
}
if(curvature != 0){
edge_path = make_curve();
}else{
edge_path = make_line();
}
}else{ // start == end
var rad = graph.style.edge_loop_radius || 100;
s = start.get_pos();
e = end.get_pos();
var r = Vec2.new_polar_deg(rad,graph.get_loop_angle(start,self));
mc = s.add(r);
var p = r.rotate_deg(90);
mc1 = mc.add(p.set_len(rad*0.5));
mc2 = mc.add(p.set_len(-rad*0.5));
if(start.get_bound){
var col = start.get_bound().collide_segment(s,mc1);
if(col.length > 0){
s = col[0];
}
var col = start.get_bound().collide_segment(e,mc2);
if(col.length > 0){
e = col[0];
}
}
edge_path = make_loop();
}
}
update_curve();
var edge = r.path(edge_path).attr({ 'stroke': graph.style.edge_color,
'stroke-width': graph.style.edge_width,
'arrow-end': 'block-wide-long',
'cursor':'pointer' }).insertBefore(graph.get_node_list()[0].get_fig());
var labelpos = get_label_pos(edge);
var edge_label = r.text(labelpos.x, labelpos.y - elfs, label).attr({
'fill': graph.style.edge_label_color,
'cursor': 'pointer',
'font-size': elfs });
edge.transform(graph.get_transform());
graph.set_scrolling(edge);
edge_label.transform(graph.get_transform());
graph.set_scrolling(edge_label);
//since we create an edge we need to recompute the edges that have the same start and end positions as this one
if(!tmp){
var edges_start = graph.get_linked_edge_list(start);
var edges_end = graph.get_linked_edge_list(end);
var edges = edges_start.length < edges_end.length ? edges_start : edges_end;
for(var i = 0; i < edges.length; i ++){
if(edges[i] != self){
edges[i].update();
}
}
}
function label_enable(){
if(!label_enabled){
label_enabled = true;
edge_label.animate({'opacity':1},100,'linear');
if(self.close_button){
self.close_button.show();
}
self.update();
}
}
function label_disable(){
if(label_enabled){
label_enabled = false;
edge_label.animate({'opacity':0},100,'linear');
if(self.close_button){
self.close_button.hide();
}
}
}
//update the positions
function update(){
update_curve();
edge.attr({'path':edge_path});
if(label_enabled){
var labelpos = get_label_pos(edge);
edge_label.attr({'x':labelpos.x, 'y':labelpos.y - 14});
}
}
// removes the edge from the scene, disconnects it from linked
// nodes, destroy its drawable elements.
function remove(){
edge.remove();
edge_label.remove();
if(!tmp){
graph.remove_edge(self);
}
if(start.update_linked_edges){
start.update_linked_edges();
}
if(start != end && end.update_linked_edges){
end.update_linked_edges();
}
if(self.close_button){
self.close_button.remove();
}
}
this.set_selected = function(){
if(!selected){
selected = true;
edge.attr({ 'stroke': graph.style.node_selected_color,
'stroke-width': graph.style.node_selected_width });
edge_label.attr({ 'fill': graph.style.node_selected_color });
if(!self.close_button){
self.close_button = new CloseButton(graph,self,"edge",0,30);
self.close_button.show();
}
}
};
this.set_not_selected = function(){
if(selected){
selected = false;
edge.animate({ 'stroke': graph.style.edge_color,
'stroke-width': graph.style.edge_width }, 100,'linear');
edge_label.animate({ 'fill': graph.style.edge_label_color}, 100, 'linear');
if(self.close_button){
self.close_button.remove();
self.close_button = null;
}
}
};
function click_action(){
graph.select(self);
}
edge.click(click_action);
edge_label.click(click_action);
function double_click_action(){
GraphEdge.double_click_callback(self);
}
edge.dblclick(double_click_action);
edge_label.dblclick(double_click_action);
this.label_enable = label_enable;
this.label_disable = label_disable;
this.update = update;
this.remove = remove;
this.is_loop = function(){ return start == end; };
this.get_start = function(){ return start; };
this.get_end = function(){ return end; };
}
GraphEdge.double_click_callback = function(edge){
console.log("double click from edge:",edge);
};
// this is the default edge creation callback. It is called before an edge is created
// It returns an object containing the properties of the edge.
// If it returns null, the edge is not created.
GraphEdge.creation_callback = function(start,end){
var edge_prop = {};
edge_prop.label = 'new edge!';
return edge_prop;
};
// This is is called after a new edge is created, with the new edge
// as parameter
GraphEdge.new_edge_callback = function(new_edge){};
// this is the default edge destruction callback. It is called before
// an edge is removed from the graph.
GraphEdge.destruction_callback = function(edge){ return true; };
// returns a new string with the same content as str, but with lines of maximum 'width' characters.
// lines are broken on words, or into words if a word is longer than 'width'
function wordwrap( str, width) {
// http://james.padolsey.com/javascript/wordwrap-for-javascript/
width = width || 32;
var cut = true;
var brk = '\n';
if (!str) { return str; }
var regex = '.{1,' +width+ '}(\\s|$)' + (cut ? '|.{' +width+ '}|.+$' : '|\\S+?(\\s|$)');
return str.match(new RegExp(regex, 'g') ).join( brk );
}
window.CuteGraph = Graph;
window.CuteNode = GraphNode;
window.CuteEdge = GraphEdge;
window.CuteGraph.wordwrap = wordwrap;
})(window);

View File

@ -0,0 +1,358 @@
(function(window){
// A Javascript 2D vector library
// conventions :
// method that returns a float value do not modify the vector
// method that implement operators return a new vector with the modifications without
// modifying the calling vector or the parameters.
//
// v3 = v1.add(v2); // v3 is set to v1 + v2, v1, v2 are not modified
//
// methods that take a single vector as a parameter are usually also available with
// q '_xy' suffix. Those method takes two floats representing the x,y coordinates of
// the vector parameter and allow you to avoid to needlessly create a vector object :
//
// v2 = v1.add(new Vec2(3,4));
// v2 = v1.add_xy(3,4); //equivalent to previous line
//
// angles are in radians by default but method that takes angle as parameters
// or return angle values usually have a variant with a '_deg' suffix that works in degrees
//
// The 2D vector object
function Vec2(x,y){
this.x = x;
this.y = y;
}
window.Vec2 = Vec2;
// Multiply a number expressed in radiant by rad2deg to convert it in degrees
var rad2deg = 57.29577951308232;
// Multiply a number expressed in degrees by deg2rad to convert it to radiant
var deg2rad = 0.017453292519943295;
// The numerical precision used to compare vector equality
var epsilon = 0.0000001;
// This static method creates a new vector from polar coordinates with the angle expressed
// in degrees
Vec2.new_polar_deg = function(len,angle){
var v = new Vec2(len,0);
return v.rotate_deg(angle);
};
// This static method creates a new vector from polar coordinates with the angle expressed in
// radians
Vec2.new_polar = function(len,angle){
var v = new Vec2(len,0);
v.rotate(angle);
return v;
};
// returns the length or modulus or magnitude of the vector
Vec2.prototype.len = function(){
return Math.sqrt(this.x*this.x + this.y*this.y);
};
// returns the squared length of the vector, this method is much faster than len()
Vec2.prototype.len_sq = function(){
return this.x*this.x + this.y*this.y;
};
// return the distance between this vector and the vector v
Vec2.prototype.dist = function(v){
var dx = this.x - v.x;
var dy = this.y - v.y;
return Math.sqrt(dx*dx + dy*dy);
};
// return the distance between this vector and the vector of coordinates (x,y)
Vec2.prototype.dist_xy = function(x,y){
var dx = this.x - x;
var dy = this.y - y;
return Math.sqrt(dx*dx + dy*dy);
};
// return the squared distance between this vector and the vector and the vector v
Vec2.prototype.dist_sq = function(v){
var dx = this.x - v.x;
var dy = this.y - v.y;
return dx*dx + dy*dy;
};
// return the squared distance between this vector and the vector of coordinates (x,y)
Vec2.prototype.dist_sq_xy = function(x,y){
var dx = this.x - x;
var dy = this.y - y;
return dx*dx + dy*dy;
};
// return the dot product between this vector and the vector v
Vec2.prototype.dot = function(v){
return this.x*v.x + this.y*v.y;
};
// return the dot product between this vector and the vector of coordinate (x,y)
Vec2.prototype.dot_xy = function(x,y){
return this.x*x + this.y*y;
};
// return a new vector with the same coordinates as this
Vec2.prototype.clone = function(){
return new Vec2(this.x,this.y);
};
// return the sum of this and vector v as a new vector
Vec2.prototype.add = function(v){
return new Vec2(this.x+v.x,this.y+v.y);
};
// return the sum of this and vector (x,y) as a new vector
Vec2.prototype.add_xy = function(x,y){
return new Vec2(this.x+x,this.y+y);
};
// returns (this - v) as a new vector where v is a vector and - is the vector subtraction
Vec2.prototype.sub = function(v){
return new Vec2(this.x-v.x,this.y-v.y);
};
// returns (this - (x,y)) as a new vector where - is vector subtraction
Vec2.prototype.sub_xy = function(x,y){
return new Vec2(this.x-x,this.y-y);
};
// return (this * v) as a new vector where v is a vector and * is the by component product
Vec2.prototype.mult = function(v){
return new Vec2(this.x*v.x,this.y*v.y);
};
// return (this * (x,y)) as a new vector where * is the by component product
Vec2.prototype.mult_xy = function(x,y){
return new Vec2(this.x*x,this.y*y);
};
// return this scaled by float f as a new fector
Vec2.prototype.scale = function(f){
return new Vec2(this.x*f, this.y*f);
};
// return the negation of this vector
Vec2.prototype.neg = function(f){
return new Vec2(-this.x,-this.y);
};
// return this vector normalized as a new vector
Vec2.prototype.normalize = function(){
var len = this.len();
if(len == 0){
return new Vec2(0,1);
}else if(len != 1){
return this.scale(1.0/len);
}
return new Vec2(this.x,this.y);
};
// return a new vector with the same direction as this vector of length float l. (negative values of l will invert direction)
Vec2.prototype.set_len = function(l){
return this.normalize().scale(l);
};
// return the projection of this onto the vector v as a new vector
Vec2.prototype.project = function(v){
return v.set_len(this.dot(v));
};
// return a string representation of this vector
Vec2.prototype.toString = function(){
var str = "";
str += "[";
str += this.x;
str += ",";
str += this.y;
str += "]";
return str;
};
//return this vector counterclockwise rotated by rad radians as a new vector
Vec2.prototype.rotate = function(rad){
var c = Math.cos(rad);
var s = Math.sin(rad);
var px = this.x * c - this.y *s;
var py = this.x * s + this.y *c;
return new Vec2(px,py);
};
//return this vector counterclockwise rotated by deg degrees as a new vector
Vec2.prototype.rotate_deg = function(deg){
return this.rotate(deg * deg2rad);
};
//linearly interpolate this vector towards the vector v by float factor alpha.
// alpha == 0 : does nothing
// alpha == 1 : sets this to v
Vec2.prototype.lerp = function(v,alpha){
var inv_alpha = 1 - alpha;
return new Vec2( this.x * inv_alpha + v.x * alpha,
this.y * inv_alpha + v.y * alpha );
};
// returns the angle between this vector and the vector (1,0) in radians
Vec2.prototype.angle = function(){
return Math.atan2(this.y,this.x);
};
// returns the angle between this vector and the vector (1,0) in degrees
Vec2.prototype.angle_deg = function(){
return Math.atan2(this.y,this.x) * rad2deg;
};
// returns true if this vector is equal to the vector v, with a tolerance defined by the epsilon module constant
Vec2.prototype.equals = function(v){
if(Math.abs(this.x-v.x) > epsilon){
return false;
}else if(Math.abs(this.y-v.y) > epsilon){
return false;
}
return true;
};
// returns true if this vector is equal to the vector (x,y) with a tolerance defined by the epsilon module constant
Vec2.prototype.equals_xy = function(x,y){
if(Math.abs(this.x-x) > epsilon){
return false;
}else if(Math.abs(this.y-y) > epsilon){
return false;
}
return true;
};
})(window);
(function(window){
// A Bounding Shapes Library
// A Bounding Ellipse
// cx,cy : center of the ellipse
// rx,ry : radius of the ellipse
function BEllipse(cx,cy,rx,ry){
this.type = 'ellipse';
this.x = cx-rx; // minimum x coordinate contained in the ellipse
this.y = cy-ry; // minimum y coordinate contained in the ellipse
this.sx = 2*rx; // width of the ellipse on the x axis
this.sy = 2*ry; // width of the ellipse on the y axis
this.hx = rx; // half of the ellipse width on the x axis
this.hy = ry; // half of the ellipse width on the y axis
this.cx = cx; // x coordinate of the ellipse center
this.cy = cy; // y coordinate of the ellipse center
this.mx = cx + rx; // maximum x coordinate contained in the ellipse
this.my = cy + ry; // maximum x coordinate contained in the ellipse
}
window.BEllipse = BEllipse;
// returns an unordered list of vector defining the positions of the intersections between the ellipse's
// boundary and a line segment defined by the start and end vectors a,b
BEllipse.prototype.collide_segment = function(a,b){
// http://paulbourke.net/geometry/sphereline/
var collisions = [];
if(a.equals(b)){ //we do not compute the intersection in this case. TODO ?
return collisions;
}
// make all computations in a space where the ellipse is a circle
// centered on zero
var c = new Vec2(this.cx,this.cy);
a = a.sub(c).mult_xy(1/this.hx,1/this.hy);
b = b.sub(c).mult_xy(1/this.hx,1/this.hy);
if(a.len_sq() < 1 && b.len_sq() < 1){ //both points inside the ellipse
return collisions;
}
// compute the roots of the intersection
var ab = b.sub(a);
var A = (ab.x*ab.x + ab.y*ab.y);
var B = 2*( ab.x*a.x + ab.y*a.y);
var C = a.x*a.x + a.y*a.y - 1;
var u = B * B - 4*A*C;
if(u < 0){
return collisions;
}
u = Math.sqrt(u);
var u1 = (-B + u) / (2*A);
var u2 = (-B - u) / (2*A);
if(u1 >= 0 && u1 <= 1){
var pos = a.add(ab.scale(u1));
collisions.push(pos);
}
if(u1 != u2 && u2 >= 0 && u2 <= 1){
var pos = a.add(ab.scale(u2));
collisions.push(pos);
}
for(var i = 0; i < collisions.length; i++){
collisions[i] = collisions[i].mult_xy(this.hx,this.hy);
collisions[i] = collisions[i].add_xy(this.cx,this.cy);
}
return collisions;
};
// A bounding rectangle
// x,y the minimum coordinate contained in the rectangle
// sx,sy the size of the rectangle along the x,y axis
function BRect(x,y,sx,sy){
this.type = 'rect';
this.x = x; // minimum x coordinate contained in the rectangle
this.y = y; // minimum y coordinate contained in the rectangle
this.sx = sx; // width of the rectangle on the x axis
this.sy = sy; // width of the rectangle on the y axis
this.hx = sx/2; // half of the rectangle width on the x axis
this.hy = sy/2; // half of the rectangle width on the y axis
this.cx = x + this.hx; // x coordinate of the rectangle center
this.cy = y + this.hy; // y coordinate of the rectangle center
this.mx = x + sx; // maximum x coordinate contained in the rectangle
this.my = y + sy; // maximum x coordinate contained in the rectangle
}
window.BRect = BRect;
// Static method creating a new bounding rectangle of size (sx,sy) centered on (cx,cy)
BRect.new_centered = function(cx,cy,sx,sy){
return new BRect(cx-sx/2,cy-sy/2,sx,sy);
};
//intersect line a,b with line c,d, returns null if no intersection
function line_intersect(a,b,c,d){
// http://paulbourke.net/geometry/lineline2d/
var f = ((d.y - c.y)*(b.x - a.x) - (d.x - c.x)*(b.y - a.y));
if(f == 0){
return null;
}
f = 1 / f;
var fab = ((d.x - c.x)*(a.y - c.y) - (d.y - c.y)*(a.x - c.x)) * f ;
if(fab < 0 || fab > 1){
return null;
}
var fcd = ((b.x - a.x)*(a.y - c.y) - (b.y - a.y)*(a.x - c.x)) * f ;
if(fcd < 0 || fcd > 1){
return null;
}
return new Vec2(a.x + fab * (b.x-a.x), a.y + fab * (b.y - a.y) );
}
// returns an unordered list of vector defining the positions of the intersections between the ellipse's
// boundary and a line segment defined by the start and end vectors a,b
BRect.prototype.collide_segment = function(a,b){
var collisions = [];
var corners = [ new Vec2(this.x,this.y), new Vec2(this.x,this.my),
new Vec2(this.mx,this.my), new Vec2(this.mx,this.y) ];
var pos = line_intersect(a,b,corners[0],corners[1]);
if(pos) collisions.push(pos);
pos = line_intersect(a,b,corners[1],corners[2]);
if(pos) collisions.push(pos);
pos = line_intersect(a,b,corners[2],corners[3]);
if(pos) collisions.push(pos);
pos = line_intersect(a,b,corners[3],corners[0]);
if(pos) collisions.push(pos);
return collisions;
};
// returns true if the rectangle contains the position defined by the vector 'vec'
BRect.prototype.contains_vec = function(vec){
return ( vec.x >= this.x && vec.x <= this.mx &&
vec.y >= this.y && vec.y <= this.my );
};
// returns true if the rectangle contains the position (x,y)
BRect.prototype.contains_xy = function(x,y){
return ( x >= this.x && x <= this.mx &&
y >= this.y && y <= this.my );
};
// returns true if the ellipse contains the position defined by the vector 'vec'
BEllipse.prototype.contains_vec = function(v){
v = v.mult_xy(this.hx,this.hy);
return v.len_sq() <= 1;
};
// returns true if the ellipse contains the position (x,y)
BEllipse.prototype.contains_xy = function(x,y){
return this.contains(new Vec2(x,y));
};
})(window);

View File

@ -1,6 +1,7 @@
<template> <template>
<t t-name="DiagramView"> <t t-name="DiagramView">
<div class="oe_diagram_header" t-att-id="element_id + '_header'"> <div class="oe_diagram_header" t-att-id="element_id + '_header'">
<h3 class="oe_diagram_title"/>
<div class="oe_diagram_buttons"> <div class="oe_diagram_buttons">
<button type="button" id="new_node" class="oe_button oe_diagram_button_new">New Node</button> <button type="button" id="new_node" class="oe_button oe_diagram_button_new">New Node</button>
</div> </div>
@ -9,7 +10,11 @@
<span class="oe_pager_index">0</span> / <span class="oe_pager_count">0</span> <span class="oe_pager_index">0</span> / <span class="oe_pager_count">0</span>
</t> </t>
</div> </div>
<div class="clear"></div>
</div>
<div class="diagram-container">
<div class="oe_diagram_diagram"/>
</div> </div>
<div id="dia-canvas" class="diagram" style="overflow: auto;"></div>
</t> </t>
</template> </template>

View File

@ -16,5 +16,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
'active': True 'auto_install': True
} }

View File

@ -0,0 +1,29 @@
# Czech translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-22 09:44+0000\n"
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr "Gantt"
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "Vytvořit"

View File

@ -0,0 +1,28 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-23 21:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish (Ecuador) <es_EC@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-24 05:07+0000\n"
"X-Generator: Launchpad (build 14981)\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr "Gantt"
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "Crear"

View File

@ -0,0 +1,28 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 11:57+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr "Gantt-kaavio"
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "Luo"

View File

@ -0,0 +1,28 @@
# Japanese translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-26 21:57+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-27 04:58+0000\n"
"X-Generator: Launchpad (build 15011)\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr "ガント"
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "作成する"

View File

@ -0,0 +1,28 @@
# Romanian translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 23:43+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Romanian <ro@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-21 05:21+0000\n"
"X-Generator: Launchpad (build 14981)\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr "Gantt"
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "Crează"

View File

@ -12,5 +12,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
"active": True "auto_install": True
} }

View File

@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: openerp-web\n" "Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n" "POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-04 11:19+0000\n" "PO-Revision-Date: 2012-03-22 12:40+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Zdeněk Havlík <linuzh@gmail.com>\n"
"Language-Team: Czech <cs@li.org>\n" "Language-Team: Czech <cs@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n" "X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14900)\n" "X-Generator: Launchpad (build 14996)\n"
#. openerp-web #. openerp-web
#: addons/web_graph/static/src/js/graph.js:19 #: addons/web_graph/static/src/js/graph.js:19
msgid "Graph" msgid "Graph"
msgstr "" msgstr "Graf"

View File

@ -0,0 +1,23 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-23 21:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish (Ecuador) <es_EC@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-24 05:07+0000\n"
"X-Generator: Launchpad (build 14981)\n"
#. openerp-web
#: addons/web_graph/static/src/js/graph.js:19
msgid "Graph"
msgstr "Gráfico"

View File

@ -0,0 +1,23 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-19 11:57+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_graph/static/src/js/graph.js:19
msgid "Graph"
msgstr "Kuvaaja"

View File

@ -0,0 +1,23 @@
# Romanian translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-03-28 19:17+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Romanian <ro@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-29 04:46+0000\n"
"X-Generator: Launchpad (build 15032)\n"
#. openerp-web
#: addons/web_graph/static/src/js/graph.js:19
msgid "Graph"
msgstr "Grafic"

View File

@ -9,6 +9,6 @@
"depends": [], "depends": [],
"js": ["static/*/*.js", "static/*/js/*.js"], "js": ["static/*/*.js", "static/*/js/*.js"],
"css": [], "css": [],
'active': False, 'auto_install': False,
'web_preload': False, 'web_preload': False,
} }

View File

@ -16,5 +16,5 @@
'qweb' : [ 'qweb' : [
"static/src/xml/*.xml", "static/src/xml/*.xml",
], ],
'active': True 'auto_install': True
} }

View File

@ -0,0 +1,56 @@
# Czech translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-22 09:44+0000\n"
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:10
msgid "Kanban"
msgstr "Kanban"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:294
#: addons/web_kanban/static/src/js/kanban.js:295
msgid "Undefined"
msgstr "Neurčeno"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:469
#: addons/web_kanban/static/src/js/kanban.js:470
msgid "Are you sure you want to delete this record ?"
msgstr "Opravdu jste si jisti, že chcete smazat tento záznam ?"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:5
msgid "Create"
msgstr "Vytvořit"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "Show more... ("
msgstr "Ukázat více... ("
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "remaining)"
msgstr "zbývajících)"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:59
msgid "</tr><tr>"
msgstr "</tr><tr>"

View File

@ -0,0 +1,55 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-23 21:57+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish (Ecuador) <es_EC@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-24 05:07+0000\n"
"X-Generator: Launchpad (build 14981)\n"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:10
msgid "Kanban"
msgstr "Kanban"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:294
#: addons/web_kanban/static/src/js/kanban.js:295
msgid "Undefined"
msgstr "Indefinido"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:469
#: addons/web_kanban/static/src/js/kanban.js:470
msgid "Are you sure you want to delete this record ?"
msgstr "¿Está seguro que quiere eliminar este registro?"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:5
msgid "Create"
msgstr "Crear"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "Show more... ("
msgstr "Mostrar más... ("
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "remaining)"
msgstr "restante)"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:59
msgid "</tr><tr>"
msgstr "</tr><tr>"

View File

@ -0,0 +1,55 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-03-19 11:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:10
msgid "Kanban"
msgstr "Kanban"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:294
#: addons/web_kanban/static/src/js/kanban.js:295
msgid "Undefined"
msgstr "Määrittämätön"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:469
#: addons/web_kanban/static/src/js/kanban.js:470
msgid "Are you sure you want to delete this record ?"
msgstr "Oletko varma että haluat poistaa tämän tietueen ?"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:5
msgid "Create"
msgstr "Luo"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "Show more... ("
msgstr "Näytä lisää... ("
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "remaining)"
msgstr "jäljellä)"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:59
msgid "</tr><tr>"
msgstr "</tr><tr>"

View File

@ -7,5 +7,5 @@
""", """,
"version" : "2.0", "version" : "2.0",
"depends" : [], "depends" : [],
'active': True, 'auto_install': True,
} }

View File

@ -0,0 +1,107 @@
# Czech translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 10:13+0100\n"
"PO-Revision-Date: 2012-03-22 09:44+0000\n"
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: openerp-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:17
msgid "OpenERP"
msgstr "OpenERP"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:22
msgid "Database:"
msgstr "Databáze:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:30
msgid "Login:"
msgstr "Přihlášovací jméno:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:32
msgid "Password:"
msgstr "Heslo:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:34
msgid "Login"
msgstr "Přihlášovací jméno"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:36
msgid "Bad username or password"
msgstr "Chybné jméno nebo heslo"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:42
msgid "Powered by openerp.com"
msgstr "Založeno na openerp.com"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:49
msgid "Home"
msgstr "Domov"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:57
msgid "Favourite"
msgstr "Oblíbené"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:58
msgid "Preference"
msgstr "Předvolby"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:123
msgid "Logout"
msgstr "Odhlásit"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:132
msgid "There are no records to show."
msgstr "Žádný záznam ke zobrazení."
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:183
msgid "Open this resource"
msgstr "Otevřít tento zdroj"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:223
#: addons/web_mobile/static/src/xml/web_mobile.xml:226
msgid "Percent of tasks closed according to total of tasks to do..."
msgstr "Procento uzavřených úloh ze všech úloh k vykonání..."
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:264
#: addons/web_mobile/static/src/xml/web_mobile.xml:268
msgid "On"
msgstr "Zapnuto"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:265
#: addons/web_mobile/static/src/xml/web_mobile.xml:269
msgid "Off"
msgstr "Vypnuto"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:294
msgid "Form View"
msgstr "Formulářový pohled"

View File

@ -0,0 +1,106 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 10:13+0100\n"
"PO-Revision-Date: 2012-03-19 11:54+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:17
msgid "OpenERP"
msgstr "OpenERP"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:22
msgid "Database:"
msgstr "Tietokanta:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:30
msgid "Login:"
msgstr "Käyttäjätunnus:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:32
msgid "Password:"
msgstr "Salasana:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:34
msgid "Login"
msgstr "Kirjaudu"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:36
msgid "Bad username or password"
msgstr "Virheellinen käyttäjätunnus tai salasana"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:42
msgid "Powered by openerp.com"
msgstr "openerp.com mahdollistaa"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:49
msgid "Home"
msgstr "Alkuun"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:57
msgid "Favourite"
msgstr "Suosikki"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:58
msgid "Preference"
msgstr "Preferenssi"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:123
msgid "Logout"
msgstr "Kirjaudu ulos"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:132
msgid "There are no records to show."
msgstr "Ei näytettäviä tietueita"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:183
msgid "Open this resource"
msgstr "Avaa tämä resurssi"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:223
#: addons/web_mobile/static/src/xml/web_mobile.xml:226
msgid "Percent of tasks closed according to total of tasks to do..."
msgstr "Suljettujen tehtävien prosenttiosuus tehtävien kokonaismäärästä..."
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:264
#: addons/web_mobile/static/src/xml/web_mobile.xml:268
msgid "On"
msgstr "Päällä"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:265
#: addons/web_mobile/static/src/xml/web_mobile.xml:269
msgid "Off"
msgstr "Pois päältä"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:294
msgid "Form View"
msgstr "Lomakenäkymä"

View File

@ -0,0 +1,106 @@
# Romanian translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 10:13+0100\n"
"PO-Revision-Date: 2012-03-19 23:11+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Romanian <ro@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:17
msgid "OpenERP"
msgstr "OpenERP"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:22
msgid "Database:"
msgstr "Bază de date:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:30
msgid "Login:"
msgstr "Logare:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:32
msgid "Password:"
msgstr "Parolă:"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:34
msgid "Login"
msgstr "Logare"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:36
msgid "Bad username or password"
msgstr "Utilizatorul sau parola incorecte"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:42
msgid "Powered by openerp.com"
msgstr ""
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:49
msgid "Home"
msgstr "Acasă"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:57
msgid "Favourite"
msgstr "Preferat"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:58
msgid "Preference"
msgstr "Preferințe"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:123
msgid "Logout"
msgstr ""
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:132
msgid "There are no records to show."
msgstr ""
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:183
msgid "Open this resource"
msgstr ""
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:223
#: addons/web_mobile/static/src/xml/web_mobile.xml:226
msgid "Percent of tasks closed according to total of tasks to do..."
msgstr ""
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:264
#: addons/web_mobile/static/src/xml/web_mobile.xml:268
msgid "On"
msgstr "Pornit"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:265
#: addons/web_mobile/static/src/xml/web_mobile.xml:269
msgid "Off"
msgstr "Oprit"
#. openerp-web
#: addons/web_mobile/static/src/xml/web_mobile.xml:294
msgid "Form View"
msgstr "Forma afișare"

View File

@ -5,8 +5,9 @@
""" """
OpenERP Web process view. OpenERP Web process view.
""", """,
"depends" : ["web"], "depends" : ["web_diagram"],
"js": [ "js": [
'static/lib/dracula/*.js',
"static/src/js/process.js" "static/src/js/process.js"
], ],
"css": [ "css": [
@ -15,5 +16,5 @@
'qweb': [ 'qweb': [
"static/src/xml/*.xml" "static/src/xml/*.xml"
], ],
'active': True 'auto_install': True
} }

View File

@ -0,0 +1,119 @@
# Czech translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 19:19+0100\n"
"PO-Revision-Date: 2012-03-22 09:43+0000\n"
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
"Language-Team: opener-i18n-czech <openerp-i18n-czech@lists.launchpad.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
"X-Poedit-Language: Czech\n"
#. openerp-web
#: addons/web_process/static/src/js/process.js:261
msgid "Cancel"
msgstr "Zrušit"
#. openerp-web
#: addons/web_process/static/src/js/process.js:262
msgid "Save"
msgstr "Uložit"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:6
msgid "Process View"
msgstr "Pohled procesu"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Documentation"
msgstr "Dokumentace"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Read Documentation Online"
msgstr "Číst dokumentaci online"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Forum"
msgstr "Fórum"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Community Discussion"
msgstr "Komunitní diskuse"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Books"
msgstr "Knihy"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Get the books"
msgstr "Získat knihy"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "OpenERP Enterprise"
msgstr "OpenERP Enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "Purchase OpenERP Enterprise"
msgstr "Zakoupit OpenERP Enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:52
msgid "Process"
msgstr "Proces"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:56
msgid "Notes:"
msgstr "Poznámky:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "Last modified by:"
msgstr "Naposledy změněno:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "N/A"
msgstr "N/A"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:62
msgid "Subflows:"
msgstr "Podtoky:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:75
msgid "Related:"
msgstr "Vztažené:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:88
msgid "Select Process"
msgstr "Vybrat proces"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:98
msgid "Select"
msgstr "Vybrat"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:109
msgid "Edit Process"
msgstr "Upravit proces"

View File

@ -0,0 +1,118 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 19:19+0100\n"
"PO-Revision-Date: 2012-03-22 20:19+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish (Ecuador) <es_EC@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-23 05:01+0000\n"
"X-Generator: Launchpad (build 14996)\n"
#. openerp-web
#: addons/web_process/static/src/js/process.js:261
msgid "Cancel"
msgstr "Cancelar"
#. openerp-web
#: addons/web_process/static/src/js/process.js:262
msgid "Save"
msgstr "Guardar"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:6
msgid "Process View"
msgstr "Vista del proceso"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Documentation"
msgstr "Documentación"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Read Documentation Online"
msgstr "Leer Documentación Online"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Forum"
msgstr "Foro"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Community Discussion"
msgstr "Debate de la comunidad"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Books"
msgstr "Libros"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Get the books"
msgstr "Obtener los libros"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "OpenERP Enterprise"
msgstr "OpenERP Enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "Purchase OpenERP Enterprise"
msgstr "Comprar OpenERP Enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:52
msgid "Process"
msgstr "Proceso"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:56
msgid "Notes:"
msgstr "Observaciones:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "Last modified by:"
msgstr "Última modificación por:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "N/A"
msgstr "N/D"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:62
msgid "Subflows:"
msgstr "Subflujos:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:75
msgid "Related:"
msgstr "Relacionado:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:88
msgid "Select Process"
msgstr "Seleccionar Proceso"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:98
msgid "Select"
msgstr "Seleccionar"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:109
msgid "Edit Process"
msgstr "Editar Proceso"

View File

@ -0,0 +1,118 @@
# Finnish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 19:19+0100\n"
"PO-Revision-Date: 2012-03-19 11:50+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-20 05:13+0000\n"
"X-Generator: Launchpad (build 14969)\n"
#. openerp-web
#: addons/web_process/static/src/js/process.js:261
msgid "Cancel"
msgstr "Peruuta"
#. openerp-web
#: addons/web_process/static/src/js/process.js:262
msgid "Save"
msgstr "Talleta"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:6
msgid "Process View"
msgstr "Prosessinäkymä"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Documentation"
msgstr "Dokumentointi"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Read Documentation Online"
msgstr "Lue dokumentaatio verkosta"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Forum"
msgstr "Foorumi"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Community Discussion"
msgstr "Yhteisön keskustelut"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Books"
msgstr "Kirjat"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Get the books"
msgstr "Hanki kirjat"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "OpenERP Enterprise"
msgstr "OpenERP enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "Purchase OpenERP Enterprise"
msgstr "Osta OpenERP enterprise"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:52
msgid "Process"
msgstr "Prosessi"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:56
msgid "Notes:"
msgstr "Muistiinpanot:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "Last modified by:"
msgstr "Viimeksi muokkasi:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "N/A"
msgstr "Ei saatavilla"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:62
msgid "Subflows:"
msgstr "Työnkulku (alataso):"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:75
msgid "Related:"
msgstr "Liittyy:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:88
msgid "Select Process"
msgstr "Valitse Prosessi"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:98
msgid "Select"
msgstr "Valitse"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:109
msgid "Edit Process"
msgstr "Muokkaa prosessia"

View File

@ -0,0 +1,118 @@
# Japanese translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 19:19+0100\n"
"PO-Revision-Date: 2012-03-26 22:04+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-03-27 04:58+0000\n"
"X-Generator: Launchpad (build 15011)\n"
#. openerp-web
#: addons/web_process/static/src/js/process.js:261
msgid "Cancel"
msgstr "キャンセル"
#. openerp-web
#: addons/web_process/static/src/js/process.js:262
msgid "Save"
msgstr "保存"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:6
msgid "Process View"
msgstr "プロセス一覧"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Documentation"
msgstr "ドキュメンテーション"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Read Documentation Online"
msgstr "オンラインのドキュメンテーションを読んでください。"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Forum"
msgstr "フォーラム"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Community Discussion"
msgstr "コミュニティの議論"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Books"
msgstr "帳簿"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Get the books"
msgstr "帳簿を取る"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "OpenERP Enterprise"
msgstr "OpenERPエンタープライズ"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "Purchase OpenERP Enterprise"
msgstr "OpenERPエンタープライズを購入"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:52
msgid "Process"
msgstr "プロセス"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:56
msgid "Notes:"
msgstr "注記"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "Last modified by:"
msgstr "最後に変更:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "N/A"
msgstr "該当なし"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:62
msgid "Subflows:"
msgstr "サブフロー:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:75
msgid "Related:"
msgstr "関係:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:88
msgid "Select Process"
msgstr "プロセスを選んでください"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:98
msgid "Select"
msgstr "選択する"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:109
msgid "Edit Process"
msgstr "プロセスを編集"

View File

@ -5,7 +5,7 @@
"version" : "2.0", "version" : "2.0",
"depends" : [], "depends" : [],
"installable" : False, "installable" : False,
'active': False, 'auto_install': False,
'js' : [ 'js' : [
"../web/static/lib/datejs/date-en-US.js", "../web/static/lib/datejs/date-en-US.js",
"../web/static/lib/jquery/jquery-1.6.4.js", "../web/static/lib/jquery/jquery-1.6.4.js",

View File

@ -9,5 +9,5 @@
"depends": [], "depends": [],
"js": ["static/src/js/*.js"], "js": ["static/src/js/*.js"],
"css": ['static/src/css/*.css'], "css": ['static/src/css/*.css'],
'active': True, 'auto_install': True,
} }