diff options
| author | Martin Trigaux <mat@openerp.com> | 2013-05-15 13:17:55 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2013-05-15 13:17:55 +0200 |
| commit | 23b50c8da1a5eb9fdbe4f90cbd7e1b545efcb3c1 (patch) | |
| tree | 7c081137d430fcd82b7f890038c39e3334d17f17 | |
| parent | 5aeaef4c3286a83fb8638ee6b507c0381e24e7cc (diff) | |
| parent | b5b6dfbbf0e3defc9a823ddb7ecc8aaeb9f07c0b (diff) | |
[MERGE] sync with latest trunk
bzr revid: mat@openerp.com-20130515111755-af33z1frq6jc6hpo
176 files changed, 28231 insertions, 1282 deletions
diff --git a/addons/account/account.py b/addons/account/account.py index d262a5e273c..3959799f1bb 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1001,8 +1001,7 @@ class account_period(osv.osv): def find(self, cr, uid, dt=None, context=None): if context is None: context = {} if not dt: - dt = fields.date.context_today(self,cr,uid,context=context) -#CHECKME: shouldn't we check the state of the period? + dt = fields.date.context_today(self, cr, uid, context=context) args = [('date_start', '<=' ,dt), ('date_stop', '>=', dt)] if context.get('company_id', False): args.append(('company_id', '=', context['company_id'])) @@ -1010,7 +1009,7 @@ class account_period(osv.osv): company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id args.append(('company_id', '=', company_id)) result = [] - if context.get('account_period_prefer_normal'): + if context.get('account_period_prefer_normal', True): # look for non-special periods first, and fallback to all if no result is found result = self.search(cr, uid, args + [('special', '=', False)], context=context) if not result: @@ -1214,7 +1213,7 @@ class account_move(osv.osv): return res def _get_period(self, cr, uid, context=None): - ctx = dict(context or {}, account_period_prefer_normal=True) + ctx = dict(context or {}) period_ids = self.pool.get('account.period').find(cr, uid, context=ctx) return period_ids[0] @@ -1786,7 +1785,7 @@ class account_tax_code(osv.osv): if context.get('period_id', False): period_id = context['period_id'] else: - period_id = self.pool.get('account.period').find(cr, uid) + period_id = self.pool.get('account.period').find(cr, uid, context=context) if not period_id: return dict.fromkeys(ids, 0.0) period_id = period_id[0] diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 56e061a707b..023765d73f0 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -61,7 +61,7 @@ class account_bank_statement(osv.osv): return res def _get_period(self, cr, uid, context=None): - periods = self.pool.get('account.period').find(cr, uid,context=context) + periods = self.pool.get('account.period').find(cr, uid, context=context) if periods: return periods[0] return False diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index e0a64a002a8..c47cf70b673 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -286,7 +286,10 @@ class account_invoice(osv.osv): 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True, track_visibility='onchange', states={'draft':[('readonly',False)]}), - 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) + 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}), + 'commercial_partner_id': fields.related('partner_id', 'commercial_partner_id', string='Commercial Entity', type='many2one', + relation='res.partner', store=True, readonly=True, + help="The commercial entity that will be used on Journal Entries for this invoice") } _defaults = { 'type': _get_type, @@ -985,8 +988,7 @@ class account_invoice(osv.osv): 'narration':inv.comment } period_id = inv.period_id and inv.period_id.id or False - ctx.update(company_id=inv.company_id.id, - account_period_prefer_normal=True) + ctx.update(company_id=inv.company_id.id) if not period_id: period_ids = period_obj.find(cr, uid, inv.date_invoice, context=ctx) period_id = period_ids and period_ids[0] or False @@ -1262,9 +1264,7 @@ class account_invoice(osv.osv): ref = invoice.reference else: ref = self._convert_ref(cr, uid, invoice.number) - partner = invoice.partner_id - if partner.parent_id and not partner.is_company: - partner = partner.parent_id + partner = self.pool['res.partner']._find_accounting_partner(invoice.partner_id) # Pay attention to the sign for both debit/credit AND amount_currency l1 = { 'debit': direction * pay_amount>0 and direction * pay_amount, @@ -1734,15 +1734,11 @@ class res_partner(osv.osv): 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), } - def _find_accounting_partner(self, part): + def _find_accounting_partner(self, partner): ''' Find the partner for which the accounting entries will be created ''' - #if the chosen partner is not a company and has a parent company, use the parent for the journal entries - #because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait' - if part.parent_id and not part.is_company: - part = part.parent_id - return part + return partner.commercial_partner_id def copy(self, cr, uid, id, default=None, context=None): default = default or {} diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index c2f21c0d8bc..7469c38decb 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -117,6 +117,7 @@ <field name="arch" type="xml"> <tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice"> <field name="partner_id" groups="base.group_user"/> + <field name="commercial_partner_id" invisible="1"/> <field name="date_invoice"/> <field name="number"/> <field name="reference" invisible="1"/> @@ -320,7 +321,8 @@ <field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}" - options='{"always_reload": True}'/> + options='{"always_reload": True}' + domain="[('customer', '=', True)]"/> <field name="fiscal_position" widget="selection" /> </group> <group> @@ -447,19 +449,20 @@ <field name="model">account.invoice</field> <field name="arch" type="xml"> <search string="Search Invoice"> - <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'ilike', self)]"/> + <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'child_of', self)]"/> <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/> <filter name="proforma" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/> <filter name="invoices" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/> <filter name="unpaid" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/> <separator/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="user_id" string="Salesperson"/> <field name="period_id" string="Period"/> <separator/> <filter domain="[('user_id','=',uid)]" help="My Invoices"/> <group expand="0" string="Group By..."> - <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> + <filter name="partner_id" string="Partner" domain="[]" context="{'group_by':'partner_id'}"/> + <filter name="commercial_partner_id" string="Commercial Partner" domain="[]" context="{'group_by':'commercial_partner_id'}"/> <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/> <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/> @@ -622,8 +625,6 @@ </record> <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/> - <act_window context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/> - <act_window id="act_account_journal_2_account_invoice_opened" name="Unpaid Invoices" diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b0b7815ad3c..006e2c55f5f 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -559,10 +559,11 @@ class account_move_line(osv.osv): ] def _auto_init(self, cr, context=None): - super(account_move_line, self)._auto_init(cr, context=context) + res = super(account_move_line, self)._auto_init(cr, context=context) cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') if not cr.fetchone(): cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') + return res def _check_no_view(self, cr, uid, ids, context=None): lines = self.browse(cr, uid, ids, context=context) @@ -654,13 +655,7 @@ class account_move_line(osv.osv): } return result - def onchange_account_id(self, cr, uid, ids, account_id, context=None): - res = {'value': {}} - if account_id: - res['value']['account_tax_id'] = [x.id for x in self.pool.get('account.account').browse(cr, uid, account_id, context=context).tax_ids] - return res - - def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False): + def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False, context=None): partner_obj = self.pool.get('res.partner') payment_term_obj = self.pool.get('account.payment.term') journal_obj = self.pool.get('account.journal') @@ -674,8 +669,8 @@ class account_move_line(osv.osv): date = datetime.now().strftime('%Y-%m-%d') jt = False if journal: - jt = journal_obj.browse(cr, uid, journal).type - part = partner_obj.browse(cr, uid, partner_id) + jt = journal_obj.browse(cr, uid, journal, context=context).type + part = partner_obj.browse(cr, uid, partner_id, context=context) payment_term_id = False if jt and jt in ('purchase', 'purchase_refund') and part.property_supplier_payment_term: @@ -700,20 +695,20 @@ class account_move_line(osv.osv): elif part.supplier: val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1) if val.get('account_id', False): - d = self.onchange_account_id(cr, uid, ids, val['account_id']) + d = self.onchange_account_id(cr, uid, ids, account_id=val['account_id'], partner_id=part.id, context=context) val.update(d['value']) return {'value':val} - def onchange_account_id(self, cr, uid, ids, account_id=False, partner_id=False): + def onchange_account_id(self, cr, uid, ids, account_id=False, partner_id=False, context=None): account_obj = self.pool.get('account.account') partner_obj = self.pool.get('res.partner') fiscal_pos_obj = self.pool.get('account.fiscal.position') val = {} if account_id: - res = account_obj.browse(cr, uid, account_id) + res = account_obj.browse(cr, uid, account_id, context=context) tax_ids = res.tax_ids if tax_ids and partner_id: - part = partner_obj.browse(cr, uid, partner_id) + part = partner_obj.browse(cr, uid, partner_id, context=context) tax_id = fiscal_pos_obj.map_tax(cr, uid, part and part.property_account_position or False, tax_ids)[0] else: tax_id = tax_ids and tax_ids[0].id or False @@ -985,8 +980,7 @@ class account_move_line(osv.osv): if context is None: context = {} period_pool = self.pool.get('account.period') - ctx = dict(context, account_period_prefer_normal=True) - pids = period_pool.find(cr, user, date, context=ctx) + pids = period_pool.find(cr, user, date, context=context) if pids: res.update({ 'period_id':pids[0] diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b8dcefdd3a4..13bc694a1cc 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1112,7 +1112,7 @@ <field name="ref"/> <field name="statement_id" invisible="1"/> <field name="partner_id" on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"/> - <field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]" on_change="onchange_account_id(account_id)"/> + <field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]" on_change="onchange_account_id(account_id, partner_id, context)"/> <field name="account_tax_id" options='{"no_open":True}' invisible="context.get('journal_type', False) not in ['sale','sale_refund','purchase','purchase_refund','general']"/> <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type','not in',['view','template'])]" invisible="not context.get('analytic_journal_id',False)"/> <field name="move_id" required="0"/> @@ -1194,7 +1194,12 @@ sequence="1" groups="group_account_user" /> - + <record id="action_account_moves_all_tree" model="ir.actions.act_window"> + <field name="name">Journal Items</field> + <field name="res_model">account.move.line</field> + <field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field> + <field name="view_id" ref="view_move_line_tree"/> + </record> <record id="view_move_line_tree_reconcile" model="ir.ui.view"> <field name="model">account.move.line</field> <field eval="24" name="priority"/> @@ -1288,7 +1293,7 @@ <group col="6" colspan="4"> <field name="name"/> <field name="ref"/> - <field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/> + <field name="partner_id" on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, date, journal_id, context)"/> <field name="journal_id"/> <field name="period_id"/> @@ -1352,7 +1357,7 @@ <tree colors="blue:state == 'draft';black:state == 'posted'" editable="top" string="Journal Items"> <field name="invoice"/> <field name="name"/> - <field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/> + <field name="partner_id" on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, parent.date, parent.journal_id, context)"/> <field name="account_id" domain="[('journal_id','=',parent.journal_id),('company_id', '=', parent.company_id)]"/> <field name="date_maturity"/> <field name="debit" sum="Total Debit"/> @@ -1771,23 +1776,6 @@ </field> </record> - <!-- res.partner links --> - <act_window - context="{'search_default_unreconciled':True, 'search_default_partner_id':[active_id], 'default_partner_id': active_id}" - domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" - id="act_account_partner_account_move_all" - name="Receivables & Payables" - res_model="account.move.line" - src_model="res.partner"/> - - <act_window - context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" - id="act_account_partner_account_move" - name="Journal Items" - res_model="account.move.line" - src_model="res.partner" - groups="account.group_account_user"/> - <!-- Account Templates --> <menuitem id="account_template_folder" diff --git a/addons/account/i18n/pt_BR.po b/addons/account/i18n/pt_BR.po index ba985c5e0a8..d1816589139 100644 --- a/addons/account/i18n/pt_BR.po +++ b/addons/account/i18n/pt_BR.po @@ -7,15 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-12-22 23:17+0000\n" -"Last-Translator: Fábio Martinelli - http://zupy.com.br " -"<webmaster@guaru.net>\n" +"PO-Revision-Date: 2013-04-18 17:44+0000\n" +"Last-Translator: Thiago Tognoli <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:19+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-19 05:24+0000\n" +"X-Generator: Launchpad (build 16567)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -431,7 +430,7 @@ msgstr "Data de criação" #. module: account #: selection:account.journal,type:0 msgid "Purchase Refund" -msgstr "Devolução da Venda" +msgstr "Devolução de Compra" #. module: account #: selection:account.journal,type:0 @@ -12678,13 +12677,6 @@ msgstr "" #~ msgid "This period is already closed !" #~ msgstr "Este período já está fechado" -#, python-format -#~ msgid "" -#~ "Selected Move lines does not have any account move enties in draft state" -#~ msgstr "" -#~ "As linhas do movimento selecionado nao tem nenhuma conta a ser movida para o " -#~ "estado de esboço" - #~ msgid "Unpaid Customer Refunds" #~ msgstr "Reembolsos a clientes não pagos" @@ -13233,6 +13225,13 @@ msgstr "" #~ msgstr "Não pode %s provisório/proforma/cancelar fatura." #, python-format +#~ msgid "" +#~ "Selected Move lines does not have any account move enties in draft state" +#~ msgstr "" +#~ "As linhas de movimento selecionadas não tem nenhum movimento nesta conta no " +#~ "modo provisório" + +#, python-format #~ msgid "Can not pay draft/proforma/cancel invoice." #~ msgstr "Não se pode pagar uma fatura provisória/proforma/cancelada" diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index ff84dd866e8..0e216ddb68f 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2013-01-30 03:58+0000\n" -"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n" +"PO-Revision-Date: 2013-04-25 09:04+0000\n" +"Last-Translator: Oliver Yuan <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:20+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-26 05:34+0000\n" +"X-Generator: Launchpad (build 16580)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -10748,7 +10748,7 @@ msgstr "手动的发票税(非主营业务纳税)" #: code:addons/account/account_invoice.py:550 #, python-format msgid "The payment term of supplier does not have a payment term line." -msgstr "" +msgstr "供应商付款条件没有包含付款条件行" #. module: account #: field:account.account,parent_right:0 diff --git a/addons/account/installer.py b/addons/account/installer.py index 4e2c2b2e024..537371d0f64 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -23,10 +23,16 @@ import datetime from dateutil.relativedelta import relativedelta import logging from operator import itemgetter -from os.path import join as opj import time +import urllib2 +import urlparse -from openerp import tools +try: + import simplejson as json +except ImportError: + import json # noqa + +from openerp.release import serie from openerp.tools.translate import _ from openerp.osv import fields, osv @@ -38,13 +44,28 @@ class account_installer(osv.osv_memory): def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') + + # try get the list on apps server + try: + apps_server = self.pool.get('ir.config_parameter').get_param(cr, uid, 'apps.server', 'https://apps.openerp.com') + + up = urlparse.urlparse(apps_server) + url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) + + j = urllib2.urlopen(url, timeout=3).read() + apps_charts = json.loads(j) + + charts = dict(apps_charts) + except Exception: + charts = dict() + # Looking for the module with the 'Account Charts' category category_name, category_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'module_category_localization_account_charts') ids = modules.search(cr, uid, [('category_id', '=', category_id)], context=context) - charts = list( - sorted(((m.name, m.shortdesc) - for m in modules.browse(cr, uid, ids, context=context)), - key=itemgetter(1))) + if ids: + charts.update((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids, context=context)) + + charts = sorted(charts.items(), key=itemgetter(1)) charts.insert(0, ('configurable', _('Custom'))) return charts @@ -57,9 +78,9 @@ class account_installer(osv.osv_memory): "country."), 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), - 'period': fields.selection([('month', 'Monthly'), ('3months','3 Monthly')], 'Periods', required=True), + 'period': fields.selection([('month', 'Monthly'), ('3months', '3 Monthly')], 'Periods', required=True), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'has_default_company' : fields.boolean('Has Default Company', readonly=True), + 'has_default_company': fields.boolean('Has Default Company', readonly=True), } def _default_company(self, cr, uid, context=None): @@ -78,30 +99,29 @@ class account_installer(osv.osv_memory): 'has_default_company': _default_has_default_company, 'charts': 'configurable' } - + def get_unconfigured_cmp(self, cr, uid, context=None): """ get the list of companies that have not been configured yet but don't care about the demo chart of accounts """ - cmp_select = [] company_ids = self.pool.get('res.company').search(cr, uid, [], context=context) cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",)) configured_cmp = [r[0] for r in cr.fetchall()] return list(set(company_ids)-set(configured_cmp)) - + def check_unconfigured_cmp(self, cr, uid, context=None): """ check if there are still unconfigured companies """ if not self.get_unconfigured_cmp(cr, uid, context=context): raise osv.except_osv(_('No unconfigured company !'), _("There is currently no company without chart of account. The wizard will therefore not be executed.")) - + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - if context is None:context = {} - res = super(account_installer, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) + if context is None: context = {} + res = super(account_installer, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) cmp_select = [] # display in the widget selection only the companies that haven't been configured yet unconfigured_cmp = self.get_unconfigured_cmp(cr, uid, context=context) for field in res['fields']: if field == 'company_id': - res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)] + res['fields'][field]['domain'] = [('id', 'in', unconfigured_cmp)] res['fields'][field]['selection'] = [('', '')] if unconfigured_cmp: cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)] @@ -117,7 +137,7 @@ class account_installer(osv.osv_memory): def execute(self, cr, uid, ids, context=None): self.execute_simple(cr, uid, ids, context) - super(account_installer, self).execute(cr, uid, ids, context=context) + return super(account_installer, self).execute(cr, uid, ids, context=context) def execute_simple(self, cr, uid, ids, context=None): if context is None: @@ -129,8 +149,8 @@ class account_installer(osv.osv_memory): if not f_ids: name = code = res['date_start'][:4] if int(name) != int(res['date_stop'][:4]): - name = res['date_start'][:4] +'-'+ res['date_stop'][:4] - code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4] + name = res['date_start'][:4] + '-' + res['date_stop'][:4] + code = res['date_start'][2:4] + '-' + res['date_stop'][2:4] vals = { 'name': name, 'code': code, @@ -150,7 +170,7 @@ class account_installer(osv.osv_memory): chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] _logger.debug('Installing chart of accounts %s', chart) - return modules | set([chart]) + return (modules | set([chart])) - set(['has_default_company', 'configurable']) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/partner.py b/addons/account/partner.py index 50addd88942..f582da6b765 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -233,5 +233,10 @@ class res_partner(osv.osv): 'last_reconciliation_date': fields.datetime('Latest Full Reconciliation Date', help='Date on which the partner accounting entries were fully reconciled last time. It differs from the last date where a reconciliation has been made for this partner, as here we depict the fact that nothing more was to be reconciled at this date. This can be achieved in 2 different ways: either the last unreconciled debit/credit entry of this partner was reconciled, either the user pressed the button "Nothing more to reconcile" during the manual reconciliation process.') } + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \ + ['debit_limit', 'property_account_payable', 'property_account_receivable', 'property_account_position', + 'property_payment_term', 'property_supplier_payment_term', 'last_reconciliation_date'] + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 1267e20165b..b6fae3140b5 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -50,6 +50,29 @@ </field> </record> + <record id="action_account_analytic_account_form" model="ir.actions.act_window"> + <field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field> + <field name="name">Contracts/Analytic Accounts</field> + <field name="res_model">account.analytic.account</field> + <field name="view_mode">tree,form</field> + </record> + <record model="ir.ui.view" id="partner_view_buttons"> + <field name="name">partner.view.buttons</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="base.view_partner_form" /> + <field name="priority" eval="10"/> + <field name="arch" type="xml"> + <xpath expr="//div[@name='buttons']" position="inside"> + <button type="action" string="Invoices" + name="%(account.action_invoice_tree)d" + context="{'search_default_partner_id': active_id,'default_partner_id': active_id}" groups="account.group_account_invoice"/> + <button type="action" string="Journal Items" name="%(account.action_account_moves_all_tree)d" groups="account.group_account_user"/> + <button type="action" string="Contracts/Analytic Accounts" name="%(account.action_account_analytic_account_form)d" + groups="analytic.group_analytic_accounting"/> + </xpath> + </field> + </record> + <record id="action_account_fiscal_position_form" model="ir.actions.act_window"> <field name="name">Fiscal Positions</field> <field name="res_model">account.fiscal.position</field> @@ -73,7 +96,7 @@ <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <page string="History" position="before" version="7.0"> - <page string="Accounting" col="4"> + <page string="Accounting" col="4" name="accounting" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> <group> <group> <field name="property_account_position" widget="selection"/> @@ -103,20 +126,13 @@ </tree> </field> </page> + <page string="Accounting" name="accounting_disabled" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}"> + <div> + <p>Accounting-related settings are managed on <button name="open_commercial_entity" type="object" string="the parent company" class="oe_link"/></p> + </div> + </page> </page> </field> </record> - - <!-- Partners info tab view--> - - <act_window - id="action_analytic_open" - name="Contracts/Analytic Accounts" - res_model="account.analytic.account" - context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" - src_model="res.partner" - view_type="form" - view_mode="tree,form"/> - </data> </openerp> diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index aa567d2fc79..79a1e76c7e7 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -31,7 +31,7 @@ <search string="Analytic Account"> <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Account"/> <field name="date"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="manager_id"/> <field name="parent_id"/> <field name="user_id"/> diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py index 907da56535a..6060d97c182 100644 --- a/addons/account/report/account_entries_report.py +++ b/addons/account/report/account_entries_report.py @@ -81,7 +81,7 @@ class account_entries_report(osv.osv): period_obj = self.pool.get('account.period') for arg in args: if arg[0] == 'period_id' and arg[2] == 'current_period': - current_period = period_obj.find(cr, uid)[0] + current_period = period_obj.find(cr, uid, context=context)[0] args.append(['period_id','in',[current_period]]) break elif arg[0] == 'period_id' and arg[2] == 'current_year': @@ -100,7 +100,7 @@ class account_entries_report(osv.osv): fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') if context.get('period', False) == 'current_period': - current_period = period_obj.find(cr, uid)[0] + current_period = period_obj.find(cr, uid, context=context)[0] domain.append(['period_id','in',[current_period]]) elif context.get('year', False) == 'current_year': current_year = fiscalyear_obj.find(cr, uid) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 5395d79af03..799b9b1c9fb 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -70,6 +70,7 @@ class account_invoice_report(osv.osv): 'categ_id': fields.many2one('product.category','Category of Product', readonly=True), 'journal_id': fields.many2one('account.journal', 'Journal', readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), + 'commercial_partner_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"), 'company_id': fields.many2one('res.company', 'Company', readonly=True), 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True), 'price_total': fields.float('Total Without Tax', readonly=True), @@ -108,7 +109,7 @@ class account_invoice_report(osv.osv): sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state, sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id, sub.product_qty, sub.price_total / cr.rate as price_total, sub.price_average /cr.rate as price_average, - cr.rate as currency_rate, sub.residual / cr.rate as residual + cr.rate as currency_rate, sub.residual / cr.rate as residual, sub.commercial_partner_id as commercial_partner_id """ return select_str @@ -170,7 +171,8 @@ class account_invoice_report(osv.osv): LEFT JOIN account_invoice a ON a.id = l.invoice_id WHERE a.id = ai.id) ELSE 1::bigint - END::numeric AS residual + END::numeric AS residual, + ai.commercial_partner_id as commercial_partner_id """ return select_str @@ -193,7 +195,7 @@ class account_invoice_report(osv.osv): ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id, ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual, - ai.amount_total, u.uom_type, u.category_id + ai.amount_total, u.uom_type, u.category_id, ai.commercial_partner_id """ return group_by_str diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index dad70f695dc..96dc948b09a 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -14,6 +14,7 @@ <field name="type" invisible="1"/> <field name="company_id" invisible="1"/> <field name="partner_id" invisible="1"/> + <field name="commercial_partner_id" invisible="1"/> <field name="product_id" invisible="1"/> <field name="uom_name" invisible="not context.get('set_visible',False)"/> <field name="categ_id" invisible="1"/> @@ -65,7 +66,8 @@ <field name="user_id" /> <field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/> <group expand="1" string="Group By..."> - <filter string="Partner" name="partner" icon="terp-partner" context="{'group_by':'partner_id','residual_visible':True}"/> + <filter string="Partner" name="partner_id" context="{'group_by':'partner_id','residual_visible':True}"/> + <filter string="Commercial Partner" name="commercial_partner_id" context="{'group_by':'commercial_partner_id','residual_visible':True}"/> <filter string="Salesperson" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/> <filter string="Due Date" icon="terp-go-today" context="{'group_by':'date_due'}"/> <filter string="Period" icon="terp-go-month" context="{'group_by':'period_id'}" name="period"/> diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index dbbfe3cc069..cbc0abc4f4d 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -26,7 +26,7 @@ openerp.account = function (instance) { if (this.partners) { this.$el.prepend(QWeb.render("AccountReconciliation", {widget: this})); this.$(".oe_account_recon_previous").click(function() { - self.current_partner = (self.current_partner - 1) % self.partners.length; + self.current_partner = (((self.current_partner - 1) % self.partners.length) + self.partners.length) % self.partners.length; self.search_by_partner(); }); this.$(".oe_account_recon_next").click(function() { diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index aaf0ae4acf7..0d5a3525af4 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -148,7 +148,6 @@ class account_move_line_reconcile_writeoff(osv.osv_memory): context['analytic_id'] = data['analytic_id'][0] if context['date_p']: date = context['date_p'] - ids = period_obj.find(cr, uid, dt=date, context=context) if ids: period_id = ids[0] diff --git a/addons/account/wizard/account_tax_chart.py b/addons/account/wizard/account_tax_chart.py index 49492a04604..3283d2ba6d1 100644 --- a/addons/account/wizard/account_tax_chart.py +++ b/addons/account/wizard/account_tax_chart.py @@ -38,7 +38,7 @@ class account_tax_chart(osv.osv_memory): def _get_period(self, cr, uid, context=None): """Return default period value""" - period_ids = self.pool.get('account.period').find(cr, uid) + period_ids = self.pool.get('account.period').find(cr, uid, context=context) return period_ids and period_ids[0] or False def account_tax_chart_open_window(self, cr, uid, ids, context=None): diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index 97a4bb8fac2..d31746e7e70 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -213,7 +213,7 @@ <search string="Contracts"> <field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/> <field name="date"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="manager_id"/> <field name="parent_id"/> <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="Contracts in progress (open, draft)"/> diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 3a1bb083762..5c019155fdc 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -82,7 +82,7 @@ class account_asset_asset(osv.osv): return super(account_asset_asset, self).unlink(cr, uid, ids, context=context) def _get_period(self, cr, uid, context=None): - periods = self.pool.get('account.period').find(cr, uid) + periods = self.pool.get('account.period').find(cr, uid, context=context) if periods: return periods[0] else: diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index c4cb17bded3..fe1fcf473ba 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -223,7 +223,7 @@ <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Assets in draft and open states"/> <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Assets in closed state"/> <field name="category_id"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> </search> </field> </record> diff --git a/addons/account_asset/report/account_asset_report_view.xml b/addons/account_asset/report/account_asset_report_view.xml index 4865196c4a8..c772c6e4103 100644 --- a/addons/account_asset/report/account_asset_report_view.xml +++ b/addons/account_asset/report/account_asset_report_view.xml @@ -49,7 +49,7 @@ <field name="asset_id"/> <field name="asset_category_id"/> <group expand="0" string="Extended Filters..."> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="company_id" groups="base.group_multi_company"/> </group> <group expand="1" string="Group By..."> diff --git a/addons/account_asset/wizard/wizard_asset_compute.py b/addons/account_asset/wizard/wizard_asset_compute.py index ee18a832e7b..f7cc6cf89c0 100755 --- a/addons/account_asset/wizard/wizard_asset_compute.py +++ b/addons/account_asset/wizard/wizard_asset_compute.py @@ -30,7 +30,7 @@ class asset_depreciation_confirmation_wizard(osv.osv_memory): } def _get_period(self, cr, uid, context=None): - periods = self.pool.get('account.period').find(cr, uid) + periods = self.pool.get('account.period').find(cr, uid, context=context) if periods: return periods[0] return False diff --git a/addons/account_bank_statement_extensions/i18n/hu.po b/addons/account_bank_statement_extensions/i18n/hu.po new file mode 100644 index 00000000000..a631c43ade0 --- /dev/null +++ b/addons/account_bank_statement_extensions/i18n/hu.po @@ -0,0 +1,362 @@ +# Hungarian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-05-05 23:08+0000\n" +"Last-Translator: krnkris <Unknown>\n" +"Language-Team: Hungarian <hu@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: 2013-05-06 05:40+0000\n" +"X-Generator: Launchpad (build 16598)\n" + +#. module: account_bank_statement_extensions +#: help:account.bank.statement.line.global,name:0 +msgid "Originator to Beneficiary Information" +msgstr "Kezdeményezőtől a kedvezményezetthez intézett információ" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +#: selection:account.bank.statement.line,state:0 +msgid "Confirmed" +msgstr "Jóváhagyott" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement:0 +#: view:account.bank.statement.line:0 +msgid "Glob. Id" +msgstr "Globális ID azonosító" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "CODA" +msgstr "CODA" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,parent_id:0 +msgid "Parent Code" +msgstr "Szülő kód" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit" +msgstr "Tartozik" + +#. module: account_bank_statement_extensions +#: view:cancel.statement.line:0 +#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_cancel_statement_line +#: model:ir.model,name:account_bank_statement_extensions.model_cancel_statement_line +msgid "Cancel selected statement lines" +msgstr "Kiválasztott számlakivonat sorok visszavonása" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,val_date:0 +msgid "Value Date" +msgstr "Értéknap" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Group By..." +msgstr "Csoportosítás ezzel..." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +#: selection:account.bank.statement.line,state:0 +msgid "Draft" +msgstr "Tervezet" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement" +msgstr "Kivonat" + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_confirm_statement_line +#: model:ir.model,name:account_bank_statement_extensions.model_confirm_statement_line +msgid "Confirm selected statement lines" +msgstr "Kiválasztott bankszámla kivonat sorok jóváhagyása" + +#. module: account_bank_statement_extensions +#: report:bank.statement.balance.report:0 +#: model:ir.actions.report.xml,name:account_bank_statement_extensions.bank_statement_balance_report +msgid "Bank Statement Balances Report" +msgstr "Bank kivonat egyenleg kimutatás" + +#. module: account_bank_statement_extensions +#: view:cancel.statement.line:0 +msgid "Cancel Lines" +msgstr "Sorok elvetése" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line.global:0 +#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line_global +msgid "Batch Payment Info" +msgstr "Köptegelt fizetés információ" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,state:0 +msgid "Status" +msgstr "Állapot" + +#. module: account_bank_statement_extensions +#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129 +#, python-format +msgid "" +"Delete operation not allowed. Please go to the associated bank " +"statement in order to delete and/or modify bank statement line." +msgstr "" +"A törlés végrehajtás nem engedélyezett. Kérem menjen az ide vonatkozó banki " +"kivonathoz, hogy azt törölhesse és/vagy módosíthassa." + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +msgid "or" +msgstr "vagy" + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +msgid "Confirm Lines" +msgstr "Jóváhagyott sorok5" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line.global:0 +msgid "Transactions" +msgstr "Tranzakciók" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,type:0 +msgid "Type" +msgstr "Típus" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +#: report:bank.statement.balance.report:0 +msgid "Journal" +msgstr "Napló" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Confirmed Statement Lines." +msgstr "Jóváhagyott kivonat sorok" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit Transactions." +msgstr "Jóváírási tranzakció" + +#. module: account_bank_statement_extensions +#: model:ir.actions.act_window,help:account_bank_statement_extensions.action_cancel_statement_line +msgid "cancel selected statement lines." +msgstr "kiválasztott kivonat sorok visszavonása" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_number:0 +msgid "Counterparty Number" +msgstr "Ellanoldali szám" + +#. module: account_bank_statement_extensions +#: report:bank.statement.balance.report:0 +msgid "Closing Balance" +msgstr "Záró egyenleg" + +#. module: account_bank_statement_extensions +#: report:bank.statement.balance.report:0 +msgid "Date" +msgstr "Dátum" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +#: field:account.bank.statement.line,globalisation_amount:0 +msgid "Glob. Amount" +msgstr "Globális összeg" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Debit Transactions." +msgstr "Terhelés tranzakciók" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Extended Filters..." +msgstr "Kiterjesztett szűrők…" + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +msgid "Confirmed lines cannot be changed anymore." +msgstr "Jóváhagyott sorokat enm lehet többé megváltoztatni." + +#. module: account_bank_statement_extensions +#: view:cancel.statement.line:0 +msgid "Are you sure you want to cancel the selected Bank Statement lines ?" +msgstr "" +"Biztos benne, hogy vissza akarja vonni a kijelölt banki kivonat sorokat?" + +#. module: account_bank_statement_extensions +#: report:bank.statement.balance.report:0 +msgid "Name" +msgstr "Név" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,name:0 +msgid "OBI" +msgstr "OBI" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "ISO 20022" +msgstr "ISO 20022" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Notes" +msgstr "Jegyzetek" + +#. module: account_bank_statement_extensions +#: selection:account.bank.statement.line.global,type:0 +msgid "Manual" +msgstr "Kézi" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Bank Transaction" +msgstr "Banki tranzakciók" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Credit" +msgstr "Jóváírás" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,amount:0 +msgid "Amount" +msgstr "Összeg" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Fin.Account" +msgstr "Főkönyvi számla" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_currency:0 +msgid "Counterparty Currency" +msgstr "Ellenoldal pénzneme" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_bic:0 +msgid "Counterparty BIC" +msgstr "Ellenoldali BIC" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,child_ids:0 +msgid "Child Codes" +msgstr "Alárendelt kódok" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Search Bank Transactions" +msgstr "Banki tranzakciók keresése" + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +msgid "Are you sure you want to confirm the selected Bank Statement lines ?" +msgstr "Biztos, hogy jóvá akarja hagyni a kiválasztott banki kivonat sorait?" + +#. module: account_bank_statement_extensions +#: help:account.bank.statement.line,globalisation_id:0 +msgid "" +"Code to identify transactions belonging to the same globalisation level " +"within a batch payment" +msgstr "" +"Ugynahhoz, a kötegelt utaláson belüli, globalizált szinthez tartozó " +"tranzakció azonosító kód" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Draft Statement Lines." +msgstr "Tervezet kivonat sorok." + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Glob. Am." +msgstr "" + +#. module: account_bank_statement_extensions +#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Bankkivonat sor" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,code:0 +msgid "Code" +msgstr "Kód" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,counterparty_name:0 +msgid "Counterparty Name" +msgstr "Ellenoldal megnevezése" + +#. module: account_bank_statement_extensions +#: model:ir.model,name:account_bank_statement_extensions.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Bankszámlák" + +#. module: account_bank_statement_extensions +#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement +msgid "Bank Statement" +msgstr "Bankszámlakivonat" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Line" +msgstr "Kivonat sor" + +#. module: account_bank_statement_extensions +#: sql_constraint:account.bank.statement.line.global:0 +msgid "The code must be unique !" +msgstr "A kódnak egyedinek kell lennie !" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line.global,bank_statement_line_ids:0 +#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_bank_statement_line +#: model:ir.ui.menu,name:account_bank_statement_extensions.bank_statement_line +msgid "Bank Statement Lines" +msgstr "Bankkivonat sorai" + +#. module: account_bank_statement_extensions +#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129 +#, python-format +msgid "Warning!" +msgstr "Figyelem!" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line.global:0 +msgid "Child Batch Payments" +msgstr "Alárendelt kötegelt utalások" + +#. module: account_bank_statement_extensions +#: view:confirm.statement.line:0 +msgid "Cancel" +msgstr "Mégse" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Statement Lines" +msgstr "Kivonat sorai" + +#. module: account_bank_statement_extensions +#: view:account.bank.statement.line:0 +msgid "Total Amount" +msgstr "Teljes érték" + +#. module: account_bank_statement_extensions +#: field:account.bank.statement.line,globalisation_id:0 +msgid "Globalisation ID" +msgstr "Globalizált ID azonosító" diff --git a/addons/account_followup/account_followup_customers.xml b/addons/account_followup/account_followup_customers.xml index 6be11399b68..6893abe012e 100644 --- a/addons/account_followup/account_followup_customers.xml +++ b/addons/account_followup/account_followup_customers.xml @@ -10,7 +10,7 @@ <field name="priority" eval="20"/> <field name="arch" type="xml"> <tree string="Customer Followup"> - <field name="name"/> + <field name="display_name"/> <field name="payment_next_action_date"/> <field name="payment_next_action"/> <field name="user_id" invisible="1"/> @@ -29,7 +29,7 @@ <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_tree"/> <field name="arch" type="xml"> - <field name="name" position="after"> + <field name="display_name" position="after"> <field name="payment_responsible_id" invisible="1"/> </field> </field> diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 15664696bd5..b176c3b8fd9 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -84,7 +84,7 @@ class account_voucher(osv.osv): if context is None: context = {} if context.get('period_id', False): return context.get('period_id') - periods = self.pool.get('account.period').find(cr, uid) + periods = self.pool.get('account.period').find(cr, uid, context=context) return periods and periods[0] or False def _make_journal_search(self, cr, uid, ttype, context=None): diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index f429480f656..4674d62b6a0 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -129,7 +129,7 @@ <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> <separator/> <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" /> <field name="period_id"/> <group expand="0" string="Group By..."> diff --git a/addons/account_voucher/i18n/nl_BE.po b/addons/account_voucher/i18n/nl_BE.po index 0cdc8cd8399..a58e655aec6 100644 --- a/addons/account_voucher/i18n/nl_BE.po +++ b/addons/account_voucher/i18n/nl_BE.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-12-19 18:04+0000\n" +"PO-Revision-Date: 2013-04-26 16:01+0000\n" "Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n" "Language-Team: Els Van Vossel\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:33+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-27 05:44+0000\n" +"X-Generator: Launchpad (build 16580)\n" "Language: nl\n" #. module: account_voucher @@ -138,6 +138,8 @@ msgid "" "You can not change the journal as you already reconciled some statement " "lines!" msgstr "" +"U kunt het journaal niet veranderen, omdat er al uittreksellijnen zijn " +"afgepunt." #. module: account_voucher #: view:account.voucher:0 @@ -148,7 +150,7 @@ msgstr "Goedkeuren" #: model:ir.actions.act_window,name:account_voucher.action_vendor_payment #: model:ir.ui.menu,name:account_voucher.menu_action_vendor_payment msgid "Supplier Payments" -msgstr "" +msgstr "Leveranciersbetalingen" #. module: account_voucher #: model:ir.actions.act_window,help:account_voucher.action_purchase_receipt @@ -223,7 +225,7 @@ msgstr "Berichten" #: model:ir.actions.act_window,name:account_voucher.action_purchase_receipt #: model:ir.ui.menu,name:account_voucher.menu_action_purchase_receipt msgid "Purchase Receipts" -msgstr "" +msgstr "Aankoopbewijzen" #. module: account_voucher #: field:account.voucher.line,move_line_id:0 @@ -431,7 +433,7 @@ msgstr "Debet" #: code:addons/account_voucher/account_voucher.py:1547 #, python-format msgid "Unable to change journal !" -msgstr "" +msgstr "Het dagboek kan niet worden gewijzigd" #. module: account_voucher #: view:sale.receipt.report:0 @@ -745,7 +747,7 @@ msgstr "Augustus" #. module: account_voucher #: view:account.voucher:0 msgid "Validate Payment" -msgstr "" +msgstr "Betaling bevestigen" #. module: account_voucher #: help:account.voucher,audit:0 @@ -786,7 +788,7 @@ msgstr "Betaald" #: model:ir.actions.act_window,name:account_voucher.action_sale_receipt #: model:ir.ui.menu,name:account_voucher.menu_action_sale_receipt msgid "Sales Receipts" -msgstr "" +msgstr "Verkoopbewijzen" #. module: account_voucher #: field:account.voucher,message_is_follower:0 @@ -834,7 +836,7 @@ msgstr "Onmiddellijk betalen" #. module: account_voucher #: field:account.voucher.line,type:0 msgid "Dr/Cr" -msgstr "" +msgstr "Db/Cr" #. module: account_voucher #: field:account.voucher,pre_line:0 @@ -845,7 +847,7 @@ msgstr "Vorige betalingen?" #: code:addons/account_voucher/account_voucher.py:1112 #, python-format msgid "The invoice you are willing to pay is not valid anymore." -msgstr "" +msgstr "De factuur die u wilt betalen, is niet meer geldig." #. module: account_voucher #: selection:sale.receipt.report,month:0 @@ -884,7 +886,7 @@ msgstr "Gelieve een reeks in te stellen voor het journaal." #: model:ir.actions.act_window,name:account_voucher.action_vendor_receipt #: model:ir.ui.menu,name:account_voucher.menu_action_vendor_receipt msgid "Customer Payments" -msgstr "" +msgstr "Klantenbetalingen" #. module: account_voucher #: model:ir.actions.act_window,name:account_voucher.action_sale_receipt_report_all @@ -938,7 +940,7 @@ msgstr "Nummer" #. module: account_voucher #: selection:account.voucher.line,type:0 msgid "Credit" -msgstr "" +msgstr "Credit" #. module: account_voucher #: model:ir.model,name:account_voucher.model_account_bank_statement @@ -1279,7 +1281,7 @@ msgstr "Openstaand saldo" #. module: account_voucher #: model:mail.message.subtype,description:account_voucher.mt_voucher_state_change msgid "Status <b>changed</b>" -msgstr "" +msgstr "Status <b>vgewijzigd</b>" #. module: account_voucher #: code:addons/account_voucher/account_voucher.py:1014 diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index de873c9195c..109c2f9aec9 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -11,7 +11,7 @@ <field name="date"/> <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> - <field name="partner_id" string="Customer"/> + <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/> <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> <field name="period_id"/> <group expand="0" string="Group By..."> @@ -34,7 +34,7 @@ <field name="date"/> <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> - <field name="partner_id" string="Supplier"/> + <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/> <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> <field name="period_id"/> <group expand="0" string="Group By..."> diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 05b783dd339..6a84a09d5e6 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -10,7 +10,7 @@ <field name="date"/> <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> - <field name="partner_id" string="Supplier"/> + <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/> <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/> <field name="period_id"/> <group expand="0" string="Group By..."> @@ -32,7 +32,7 @@ <field name="date"/> <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> - <field name="partner_id" string="Customer"/> + <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/> <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/> <field name="period_id"/> <group expand="0" string="Group By..."> diff --git a/addons/analytic/i18n/lt.po b/addons/analytic/i18n/lt.po new file mode 100644 index 00000000000..d9073313307 --- /dev/null +++ b/addons/analytic/i18n/lt.po @@ -0,0 +1,388 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:10+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: analytic +#: field:account.analytic.account,child_ids:0 +msgid "Child Accounts" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "In Progress" +msgstr "" + +#. module: analytic +#: code:addons/analytic/analytic.py:229 +#, python-format +msgid "Contract: " +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Template" +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +msgid "End Date" +msgstr "" + +#. module: analytic +#: help:account.analytic.line,unit_amount:0 +msgid "Specifies the amount of quantity to count." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,debit:0 +msgid "Debit" +msgstr "" + +#. module: analytic +#: help:account.analytic.account,type:0 +msgid "" +"If you select the View Type, it means you won't allow to create journal " +"entries using that account.\n" +"The type 'Analytic account' stands for usual accounts that you only want to " +"use in accounting.\n" +"If you select Contract or Project, it offers you the possibility to manage " +"the validity and the invoicing options for this account.\n" +"The special type 'Template of Contract' allows you to define a template with " +"default data that you can reuse easily." +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +msgid "" +"Once the end date of the contract is\n" +" passed or the maximum number of " +"service\n" +" units (e.g. support contract) is\n" +" reached, the account manager is " +"notified \n" +" by email to renew the contract with " +"the\n" +" customer." +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "Contract or Project" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,name:0 +msgid "Account/Contract Name" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,manager_id:0 +msgid "Account Manager" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Closed" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,name:analytic.mt_account_pending +msgid "Contract to Renew" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "New" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,user_id:0 +msgid "Project Manager" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,state:0 +msgid "Status" +msgstr "" + +#. module: analytic +#: code:addons/analytic/analytic.py:271 +#, python-format +msgid "%s (copy)" +msgstr "" + +#. module: analytic +#: model:ir.model,name:analytic.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,description:0 +#: field:account.analytic.line,name:0 +msgid "Description" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: analytic +#: constraint:account.analytic.account:0 +msgid "Error! You cannot create recursive analytic accounts." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,company_id:0 +#: field:account.analytic.line,company_id:0 +msgid "Company" +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +msgid "Renewal" +msgstr "" + +#. module: analytic +#: help:account.analytic.account,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,description:analytic.mt_account_opened +msgid "Stage <b>opened</b>" +msgstr "" + +#. module: analytic +#: help:account.analytic.account,quantity_max:0 +msgid "" +"Sets the higher limit of time to work on the contract, based on the " +"timesheet. (for instance, number of hours in a limited support contract.)" +msgstr "" + +#. module: analytic +#: code:addons/analytic/analytic.py:160 +#, python-format +msgid "" +"If you set a company, the currency selected has to be the same as it's " +"currency. \n" +"You can remove the company belonging, and thus change the currency, only on " +"analytic account of type 'view'. This can be really usefull for " +"consolidation purposes of several companies charts with different " +"currencies, for example." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: analytic +#: field:account.analytic.line,user_id:0 +msgid "User" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,description:analytic.mt_account_pending +msgid "Contract <b>pending</b>" +msgstr "" + +#. module: analytic +#: field:account.analytic.line,date:0 +msgid "Date" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,name:analytic.mt_account_closed +msgid "Contract Finished" +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +msgid "Terms and Conditions" +msgstr "" + +#. module: analytic +#: help:account.analytic.line,amount:0 +msgid "" +"Calculated by multiplying the quantity and the price given in the Product's " +"cost price. Always expressed in the company main currency." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,partner_id:0 +msgid "Customer" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,child_complete_ids:0 +msgid "Account Hierarchy" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,parent_id:0 +msgid "Parent Analytic Account" +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +msgid "Contract Information" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,template_id:0 +#: selection:account.analytic.account,type:0 +msgid "Template of Contract" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,quantity_max:0 +msgid "Prepaid Service Units" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,credit:0 +msgid "Credit" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,name:analytic.mt_account_opened +msgid "Contract Opened" +msgstr "" + +#. module: analytic +#: model:mail.message.subtype,description:analytic.mt_account_closed +msgid "Contract <b>closed</b>" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Cancelled" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "Analytic View" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,balance:0 +msgid "Balance" +msgstr "" + +#. module: analytic +#: help:account.analytic.account,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "To Renew" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,quantity:0 +#: field:account.analytic.line,unit_amount:0 +msgid "Quantity" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,date:0 +msgid "Date End" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,code:0 +msgid "Reference" +msgstr "" + +#. module: analytic +#: code:addons/analytic/analytic.py:160 +#, python-format +msgid "Error!" +msgstr "" + +#. module: analytic +#: model:res.groups,name:analytic.group_analytic_accounting +msgid "Analytic Accounting" +msgstr "" + +#. module: analytic +#: field:account.analytic.line,amount:0 +msgid "Amount" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,complete_name:0 +msgid "Full Account Name" +msgstr "" + +#. module: analytic +#: view:account.analytic.account:0 +#: selection:account.analytic.account,type:0 +#: field:account.analytic.line,account_id:0 +#: model:ir.model,name:analytic.model_account_analytic_account +msgid "Analytic Account" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,currency_id:0 +msgid "Currency" +msgstr "" + +#. module: analytic +#: help:account.analytic.account,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,type:0 +msgid "Type of Account" +msgstr "" + +#. module: analytic +#: field:account.analytic.account,date_start:0 +msgid "Start Date" +msgstr "" + +#. module: analytic +#: constraint:account.analytic.line:0 +msgid "You cannot create analytic line on view account." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,line_ids:0 +msgid "Analytic Entries" +msgstr "" diff --git a/addons/auth_crypt/i18n/lt.po b/addons/auth_crypt/i18n/lt.po new file mode 100644 index 00000000000..03f0bd5249f --- /dev/null +++ b/addons/auth_crypt/i18n/lt.po @@ -0,0 +1,28 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:24+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: auth_crypt +#: field:res.users,password_crypt:0 +msgid "Encrypted Password" +msgstr "Užšifruotas slaptažodis" + +#. module: auth_crypt +#: model:ir.model,name:auth_crypt.model_res_users +msgid "Users" +msgstr "Naudotojai" diff --git a/addons/auth_oauth_signup/i18n/lt.po b/addons/auth_oauth_signup/i18n/lt.po new file mode 100644 index 00000000000..27fb83e6a4f --- /dev/null +++ b/addons/auth_oauth_signup/i18n/lt.po @@ -0,0 +1,23 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:21+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: auth_oauth_signup +#: model:ir.model,name:auth_oauth_signup.model_res_users +msgid "Users" +msgstr "Naudotojai" diff --git a/addons/auth_signup/i18n/lt.po b/addons/auth_signup/i18n/lt.po new file mode 100644 index 00000000000..7ae419856e6 --- /dev/null +++ b/addons/auth_signup/i18n/lt.po @@ -0,0 +1,279 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:13+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: auth_signup +#: field:res.partner,signup_type:0 +msgid "Signup Token Type" +msgstr "" + +#. module: auth_signup +#: field:base.config.settings,auth_signup_uninvited:0 +msgid "Allow external users to sign up" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:16 +#, python-format +msgid "Confirm Password" +msgstr "" + +#. module: auth_signup +#: help:base.config.settings,auth_signup_uninvited:0 +msgid "If unchecked, only invited users may sign up." +msgstr "" + +#. module: auth_signup +#: model:ir.model,name:auth_signup.model_base_config_settings +msgid "base.config.settings" +msgstr "" + +#. module: auth_signup +#: code:addons/auth_signup/res_users.py:265 +#, python-format +msgid "Cannot send email: user has no email address." +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:24 +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:28 +#, python-format +msgid "Reset password" +msgstr "" + +#. module: auth_signup +#: field:base.config.settings,auth_signup_template_user_id:0 +msgid "Template user for new users created through signup" +msgstr "" + +#. module: auth_signup +#: model:email.template,subject:auth_signup.reset_password_email +msgid "Password reset" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:117 +#, python-format +msgid "Please enter a password and confirm it." +msgstr "" + +#. module: auth_signup +#: view:res.users:0 +msgid "Send an email to the user to (re)set their password." +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:23 +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:26 +#, python-format +msgid "Sign Up" +msgstr "" + +#. module: auth_signup +#: selection:res.users,state:0 +msgid "New" +msgstr "" + +#. module: auth_signup +#: code:addons/auth_signup/res_users.py:258 +#, python-format +msgid "Mail sent to:" +msgstr "" + +#. module: auth_signup +#: field:res.users,state:0 +msgid "Status" +msgstr "" + +#. module: auth_signup +#: model:email.template,body_html:auth_signup.reset_password_email +msgid "" +"\n" +"<p>A password reset was requested for the OpenERP account linked to this " +"email.</p>\n" +"\n" +"<p>You may change your password by following <a " +"href=\"${object.signup_url}\">this link</a>.</p>\n" +"\n" +"<p>Note: If you do not expect this, you can safely ignore this email.</p>" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:111 +#, python-format +msgid "Please enter a name." +msgstr "" + +#. module: auth_signup +#: model:ir.model,name:auth_signup.model_res_users +msgid "Users" +msgstr "" + +#. module: auth_signup +#: field:res.partner,signup_url:0 +msgid "Signup URL" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:114 +#, python-format +msgid "Please enter a username." +msgstr "" + +#. module: auth_signup +#: selection:res.users,state:0 +msgid "Active" +msgstr "" + +#. module: auth_signup +#: code:addons/auth_signup/res_users.py:269 +#, python-format +msgid "" +"Cannot send email: no outgoing email server configured.\n" +"You can configure it under Settings/General Settings." +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:12 +#, python-format +msgid "Username" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:8 +#, python-format +msgid "Name" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:170 +#, python-format +msgid "Please enter a username or email address." +msgstr "" + +#. module: auth_signup +#: selection:res.users,state:0 +msgid "Resetting Password" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:13 +#, python-format +msgid "Username (Email)" +msgstr "" + +#. module: auth_signup +#: field:res.partner,signup_expiration:0 +msgid "Signup Expiration" +msgstr "" + +#. module: auth_signup +#: help:base.config.settings,auth_signup_reset_password:0 +msgid "This allows users to trigger a password reset from the Login page." +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:22 +#, python-format +msgid "Log in" +msgstr "" + +#. module: auth_signup +#: field:res.partner,signup_valid:0 +msgid "Signup Token is Valid" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:108 +#: code:addons/auth_signup/static/src/js/auth_signup.js:111 +#: code:addons/auth_signup/static/src/js/auth_signup.js:114 +#: code:addons/auth_signup/static/src/js/auth_signup.js:117 +#: code:addons/auth_signup/static/src/js/auth_signup.js:120 +#: code:addons/auth_signup/static/src/js/auth_signup.js:167 +#: code:addons/auth_signup/static/src/js/auth_signup.js:170 +#, python-format +msgid "Login" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:94 +#, python-format +msgid "Invalid signup token" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:120 +#, python-format +msgid "Passwords do not match; please retype them." +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/js/auth_signup.js:108 +#: code:addons/auth_signup/static/src/js/auth_signup.js:167 +#, python-format +msgid "No database selected !" +msgstr "" + +#. module: auth_signup +#: view:res.users:0 +msgid "Reset Password" +msgstr "" + +#. module: auth_signup +#: field:base.config.settings,auth_signup_reset_password:0 +msgid "Enable password reset from Login page" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:27 +#, python-format +msgid "Back to Login" +msgstr "" + +#. module: auth_signup +#. openerp-web +#: code:addons/auth_signup/static/src/xml/auth_signup.xml:22 +#, python-format +msgid "Sign up" +msgstr "" + +#. module: auth_signup +#: model:ir.model,name:auth_signup.model_res_partner +msgid "Partner" +msgstr "" + +#. module: auth_signup +#: field:res.partner,signup_token:0 +msgid "Signup Token" +msgstr "" diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index b5383e41775..f4a985280ac 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -200,6 +200,9 @@ class res_users(osv.Model): 'partner_id': partner.id, 'email': values.get('email') or values.get('login'), }) + if partner.company_id: + values['company_id'] = partner.company_id.id + values['company_ids'] = [(6,0,[partner.company_id.id])] self._signup_create_user(cr, uid, values, context=context) else: # no token, sign up an external user diff --git a/addons/base_calendar/i18n/es_MX.po b/addons/base_calendar/i18n/es_MX.po index fcb00c6d478..9a2fe449d37 100644 --- a/addons/base_calendar/i18n/es_MX.po +++ b/addons/base_calendar/i18n/es_MX.po @@ -1,929 +1,879 @@ -# Spanish translation for openobject-addons -# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# Spanish (Mexico) translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 # This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. # msgid "" msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" -"POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-01-18 01:17+0000\n" -"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " -"<jesteve@zikzakmedia.com>\n" -"Language-Team: Spanish <es@li.org>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 15:25+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Spanish (Mexico) <es_MX@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: 2011-09-05 05:52+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" #. module: base_calendar #: selection:calendar.alarm,trigger_related:0 #: selection:res.alarm,trigger_related:0 msgid "The event starts" -msgstr "El evento comienza" - -#. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -msgid "Hourly" -msgstr "Cada hora" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Required to Join" -msgstr "Requerido para unirse" +#: view:calendar.event:0 +msgid "My Events" +msgstr "" #. module: base_calendar #: help:calendar.event,exdate:0 #: help:calendar.todo,exdate:0 +#: help:crm.meeting,exdate:0 msgid "" "This property defines the list of date/time exceptions for a recurring " "calendar component." msgstr "" -"Esta propiedad define la lista de excepciones de fecha/hora para un evento " -"de calendario recurrente." - -#. module: base_calendar -#: constraint:res.users:0 -msgid "The chosen company is not in the allowed companies for this user" -msgstr "" -"La compañía seleccionada no está en las compañías permitidas para este " -"usuario" - -#. module: base_calendar -#: field:calendar.event.edit.all,name:0 -msgid "Title" -msgstr "Título" #. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 #: selection:calendar.event,rrule_type:0 #: selection:calendar.todo,rrule_type:0 -msgid "Monthly" -msgstr "Mensual" +#: selection:crm.meeting,rrule_type:0 +msgid "Week(s)" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Invited User" -msgstr "Usuario invitado" +#: field:calendar.event,we:0 +#: field:calendar.todo,we:0 +#: field:crm.meeting,we:0 +msgid "Wed" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Invitation" -msgstr "Invitación" +#: selection:calendar.attendee,cutype:0 +msgid "Unknown" +msgstr "" #. module: base_calendar #: help:calendar.event,recurrency:0 #: help:calendar.todo,recurrency:0 +#: help:crm.meeting,recurrency:0 msgid "Recurrent Meeting" -msgstr "Reunión periódica" +msgstr "" + +#. module: base_calendar +#: model:crm.meeting.type,name:base_calendar.categ_meet5 +msgid "Feedback Meeting" +msgstr "" #. module: base_calendar #: model:ir.actions.act_window,name:base_calendar.action_res_alarm_view #: model:ir.ui.menu,name:base_calendar.menu_crm_meeting_avail_alarm msgid "Alarms" -msgstr "Alarmas" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Sunday" -msgstr "Domingo" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: field:calendar.attendee,role:0 msgid "Role" -msgstr "Rol" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 +#: view:crm.meeting:0 msgid "Invitation details" -msgstr "Detalles de la invitación" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 #: selection:calendar.event,byday:0 #: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 msgid "Fourth" -msgstr "Cuarto" +msgstr "" #. module: base_calendar -#: field:calendar.event,show_as:0 -#: field:calendar.todo,show_as:0 -msgid "Show as" -msgstr "Mostrar como" +#: model:ir.model,name:base_calendar.model_res_users +msgid "Users" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,day:0 -#: selection:base.calendar.set.exrule,select1:0 #: field:calendar.event,day:0 #: selection:calendar.event,select1:0 #: field:calendar.todo,day:0 #: selection:calendar.todo,select1:0 +#: field:crm.meeting,day:0 +#: selection:crm.meeting,select1:0 msgid "Date of month" -msgstr "Día del mes" +msgstr "" #. module: base_calendar #: selection:calendar.event,class:0 #: selection:calendar.todo,class:0 +#: selection:crm.meeting,class:0 msgid "Public" -msgstr "Público" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 -msgid " " -msgstr " " +#: selection:calendar.alarm,trigger_interval:0 +#: selection:res.alarm,trigger_interval:0 +msgid "Hours" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "March" -msgstr "Marzo" +msgstr "" #. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:414 -#: code:addons/base_calendar/wizard/base_calendar_set_exrule.py:90 -#, python-format -msgid "Warning !" -msgstr "¡Aviso!" +#: help:calendar.attendee,cutype:0 +msgid "Specify the type of Invitation" +msgstr "" + +#. module: base_calendar +#: view:crm.meeting:0 +#: field:crm.meeting,message_unread:0 +msgid "Unread Messages" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Friday" -msgstr "Viernes" +msgstr "" #. module: base_calendar #: field:calendar.event,allday:0 #: field:calendar.todo,allday:0 +#: field:crm.meeting,allday:0 msgid "All Day" -msgstr "Todo el día" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,select1:0 -#: field:calendar.event,select1:0 -#: field:calendar.todo,select1:0 -msgid "Option" -msgstr "Opción" +#: field:calendar.event,vtimezone:0 +#: field:calendar.todo,vtimezone:0 +#: field:crm.meeting,vtimezone:0 +msgid "Timezone" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,availability:0 #: selection:calendar.event,show_as:0 #: selection:calendar.todo,show_as:0 -#: selection:res.users,availability:0 +#: selection:crm.meeting,show_as:0 msgid "Free" -msgstr "Libre" +msgstr "" + +#. module: base_calendar +#: help:crm.meeting,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" #. module: base_calendar #: help:calendar.attendee,rsvp:0 msgid "Indicats whether the favor of a reply is requested" -msgstr "Indica si es requerida la confirmación de una respuesta." +msgstr "" #. module: base_calendar -#: model:ir.model,name:base_calendar.model_ir_attachment -msgid "ir.attachment" -msgstr "ir.adjunto" +#: field:calendar.alarm,alarm_id:0 +msgid "Basic Alarm" +msgstr "" #. module: base_calendar #: help:calendar.attendee,delegated_to:0 msgid "The users that the original request was delegated to" -msgstr "Los usuarios a los que les fue delegado la petición original" +msgstr "" #. module: base_calendar #: field:calendar.attendee,ref:0 msgid "Event Ref" -msgstr "Ref. evento" - -#. module: base_calendar -#: field:base.calendar.set.exrule,we:0 -#: field:calendar.event,we:0 -#: field:calendar.todo,we:0 -msgid "Wed" -msgstr "Mié" - -#. module: base_calendar -#: view:calendar.event:0 -msgid "Show Time as" -msgstr "Mostrar hora como" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,tu:0 #: field:calendar.event,tu:0 #: field:calendar.todo,tu:0 +#: field:crm.meeting,tu:0 msgid "Tue" -msgstr "Mar" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -#: selection:calendar.event,rrule_type:0 -#: selection:calendar.todo,rrule_type:0 -msgid "Yearly" -msgstr "Anualmente" +#: selection:calendar.event,byday:0 +#: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 +msgid "Third" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,trigger_related:0 #: selection:res.alarm,trigger_related:0 msgid "The event ends" -msgstr "El evento finaliza" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 #: selection:calendar.event,byday:0 #: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 msgid "Last" -msgstr "Última" +msgstr "" #. module: base_calendar -#: help:calendar.attendee,state:0 -msgid "Status of the attendee's participation" -msgstr "Estado de la participación de los asistentes" +#: help:crm.meeting,message_ids:0 +msgid "Messages and communication history" +msgstr "" #. module: base_calendar -#: selection:calendar.attendee,cutype:0 -msgid "Room" -msgstr "Sala" +#: field:crm.meeting,message_ids:0 +msgid "Messages" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,trigger_interval:0 -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 #: selection:res.alarm,trigger_interval:0 msgid "Days" -msgstr "Días" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 -msgid "Invitation Detail" -msgstr "Detalle de la invitación" +msgid "To" +msgstr "" #. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:1355 -#: code:addons/base_calendar/wizard/base_calendar_invite_attendee.py:96 -#: code:addons/base_calendar/wizard/base_calendar_invite_attendee.py:143 -#: code:addons/base_calendar/wizard/base_calendar_set_exrule.py:128 -#: code:addons/base_calendar/wizard/base_calendar_set_exrule.py:136 +#: code:addons/base_calendar/base_calendar.py:1260 #, python-format msgid "Error!" -msgstr "¡Error!" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,role:0 msgid "Chair Person" -msgstr "Presidente" +msgstr "" + +#. module: base_calendar +#: view:crm.meeting:0 +msgid "My Meetings" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,action:0 msgid "Procedure" -msgstr "Procedimiento" +msgstr "" + +#. module: base_calendar +#: field:calendar.event,recurrent_id:0 +#: field:calendar.todo,recurrent_id:0 +#: field:crm.meeting,recurrent_id:0 +msgid "Recurrent ID" +msgstr "" #. module: base_calendar #: selection:calendar.event,state:0 #: selection:calendar.todo,state:0 msgid "Cancelled" -msgstr "Cancelada" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,trigger_interval:0 #: selection:res.alarm,trigger_interval:0 msgid "Minutes" -msgstr "Minutos" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,action:0 msgid "Display" -msgstr "Mostrar" +msgstr "" #. module: base_calendar -#: view:calendar.event.edit.all:0 -msgid "Edit all Occurrences" -msgstr "Editar todas las ocurrencias" +#: help:calendar.attendee,state:0 +msgid "Status of the attendee's participation" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Invitation type" -msgstr "Tipo de invitación" +#: view:crm.meeting:0 +msgid "Mail To" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -msgid "Secondly" -msgstr "En segundo lugar" +#: field:crm.meeting,name:0 +msgid "Meeting Subject" +msgstr "" #. module: base_calendar -#: field:calendar.alarm,event_date:0 -#: field:calendar.attendee,event_date:0 #: view:calendar.event:0 -msgid "Event Date" -msgstr "Fecha evento" +msgid "End of Recurrence" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 msgid "Group By..." -msgstr "Agrupar por..." +msgstr "" #. module: base_calendar -#: help:base_calendar.invite.attendee,email:0 -msgid "Provide external email address who will receive this invitation." +#: view:calendar.event:0 +msgid "Recurrency Option" msgstr "" -"Proporcione las direcciones de correo externas de quienes recibiran esta " -"invitacion." #. module: base_calendar -#: model:ir.module.module,description:base_calendar.module_meta_information -msgid "" -"Full featured calendar system that supports:\n" -" - Calendar of events\n" -" - Alerts (create requests)\n" -" - Recurring events\n" -" - Invitations to people" +#: view:calendar.event:0 +msgid "Choose day where repeat the meeting" msgstr "" -"Completo sistema de calendario que soporta:\n" -" - Calendario de eventos\n" -" - Alertas (crea peticiones)\n" -" - Eventos recursivos\n" -" - Invitación de personas" #. module: base_calendar -#: help:calendar.attendee,cutype:0 -msgid "Specify the type of Invitation" -msgstr "Especifique el tipo de invitación" +#: view:crm.meeting:0 +#: model:ir.actions.act_window,name:base_calendar.action_crm_meeting +msgid "Meetings" +msgstr "" #. module: base_calendar -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 -msgid "Years" -msgstr "Años" +#: field:calendar.event,recurrent_id_date:0 +#: field:calendar.todo,recurrent_id_date:0 +#: field:crm.meeting,recurrent_id_date:0 +msgid "Recurrent ID date" +msgstr "" #. module: base_calendar #: field:calendar.alarm,event_end_date:0 #: field:calendar.attendee,event_end_date:0 msgid "Event End Date" -msgstr "Fecha del final del evento" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,role:0 msgid "Optional Participation" -msgstr "Participación opcional" +msgstr "" #. module: base_calendar -#: field:calendar.event,date_deadline:0 -#: field:calendar.todo,date_deadline:0 -msgid "Deadline" -msgstr "Fecha límite" +#: help:crm.meeting,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" #. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:385 -#: code:addons/base_calendar/base_calendar.py:1088 -#: code:addons/base_calendar/base_calendar.py:1090 +#: code:addons/base_calendar/base_calendar.py:399 +#: code:addons/base_calendar/base_calendar.py:441 +#: code:addons/base_calendar/base_calendar.py:1013 +#: code:addons/base_calendar/base_calendar.py:1015 +#: code:addons/base_calendar/base_calendar.py:1460 #, python-format msgid "Warning!" -msgstr "¡Aviso!" +msgstr "" #. module: base_calendar #: help:calendar.event,active:0 #: help:calendar.todo,active:0 +#: help:crm.meeting,active:0 msgid "" "If the active field is set to true, it will allow you to hide the " "event alarm information without removing it." msgstr "" -"Si el campo activo se establece a verdadero, se omitirá la alarma del " -"evento, sin embargo no se eliminará." #. module: base_calendar -#: model:ir.module.module,shortdesc:base_calendar.module_meta_information -msgid "Basic Calendar Functionality" -msgstr "Funcionalidad básica del calendario" +#: field:calendar.alarm,repeat:0 +#: field:calendar.event,count:0 +#: field:calendar.todo,count:0 +#: field:crm.meeting,count:0 +#: field:res.alarm,repeat:0 +msgid "Repeat" +msgstr "" #. module: base_calendar #: field:calendar.event,organizer:0 #: field:calendar.event,organizer_id:0 #: field:calendar.todo,organizer:0 #: field:calendar.todo,organizer_id:0 +#: field:crm.meeting,organizer:0 +#: field:crm.meeting,organizer_id:0 msgid "Organizer" -msgstr "Organizador" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 #: field:calendar.event,user_id:0 #: field:calendar.todo,user_id:0 +#: field:crm.meeting,user_id:0 msgid "Responsible" -msgstr "Responsable" +msgstr "" #. module: base_calendar #: view:calendar.event:0 -#: model:res.request.link,name:base_calendar.request_link_meeting +#: model:res.request.link,name:base_calendar.request_link_event msgid "Event" -msgstr "Evento" - -#. module: base_calendar -#: help:calendar.event,edit_all:0 -#: help:calendar.todo,edit_all:0 -msgid "Edit all Occurrences of recurrent Meeting." -msgstr "Editar todas las ocurrencias de la reunión recurrente." +msgstr "" #. module: base_calendar #: selection:calendar.alarm,trigger_occurs:0 #: selection:res.alarm,trigger_occurs:0 msgid "Before" -msgstr "Antes de" +msgstr "" #. module: base_calendar #: view:calendar.event:0 #: selection:calendar.event,state:0 #: selection:calendar.todo,state:0 +#: field:crm.meeting,date_open:0 +#: selection:crm.meeting,state:0 msgid "Confirmed" -msgstr "Confirmada" - -#. module: base_calendar -#: model:ir.actions.act_window,name:base_calendar.action_calendar_event_edit_all -msgid "Edit all events" -msgstr "Editar todos los eventos" +msgstr "" #. module: base_calendar #: field:calendar.alarm,attendee_ids:0 #: field:calendar.event,attendee_ids:0 +#: field:calendar.event,partner_ids:0 #: field:calendar.todo,attendee_ids:0 +#: field:calendar.todo,partner_ids:0 +#: field:crm.meeting,attendee_ids:0 +#: field:crm.meeting,partner_ids:0 msgid "Attendees" -msgstr "Asistentes" +msgstr "" #. module: base_calendar #: view:calendar.event:0 msgid "Confirm" -msgstr "Confirmar" +msgstr "" #. module: base_calendar #: model:ir.model,name:base_calendar.model_calendar_todo msgid "Calendar Task" -msgstr "Calendario de tareas" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,su:0 #: field:calendar.event,su:0 #: field:calendar.todo,su:0 +#: field:crm.meeting,su:0 msgid "Sun" -msgstr "Dom" +msgstr "" #. module: base_calendar #: field:calendar.attendee,cutype:0 msgid "Invite Type" -msgstr "Tipo de invitación" - -#. module: base_calendar -#: help:calendar.attendee,partner_id:0 -msgid "Partner related to contact" -msgstr "Partner relacionado con el contacto" +msgstr "" #. module: base_calendar #: view:res.alarm:0 msgid "Reminder details" -msgstr "Detalles del recordatorio" +msgstr "" #. module: base_calendar #: field:calendar.attendee,parent_ids:0 msgid "Delegrated From" -msgstr "Delegado desde" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,select1:0 #: selection:calendar.event,select1:0 #: selection:calendar.todo,select1:0 +#: selection:crm.meeting,select1:0 msgid "Day of month" -msgstr "Día del mes" +msgstr "" + +#. module: base_calendar +#: field:crm.meeting,message_follower_ids:0 +msgid "Followers" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 #: field:calendar.event,location:0 -#: field:calendar.event.edit.all,location:0 #: field:calendar.todo,location:0 +#: field:crm.meeting,location:0 msgid "Location" -msgstr "Lugar" +msgstr "" #. module: base_calendar -#: field:base_calendar.invite.attendee,send_mail:0 -msgid "Send mail?" -msgstr "¿Enviar email?" +#: selection:calendar.attendee,role:0 +msgid "Participation required" +msgstr "" + +#. module: base_calendar +#: view:calendar.event:0 +#: field:calendar.event,show_as:0 +#: field:calendar.todo,show_as:0 +#: field:crm.meeting,show_as:0 +msgid "Show Time as" +msgstr "" #. module: base_calendar -#: field:base_calendar.invite.attendee,email:0 #: selection:calendar.alarm,action:0 #: field:calendar.attendee,email:0 msgid "Email" -msgstr "Correo electrónico" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Event Detail" -msgstr "Detalles del evento" +#: selection:calendar.attendee,cutype:0 +msgid "Room" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,state:0 msgid "Run" -msgstr "Ejecutar" +msgstr "" #. module: base_calendar -#: field:calendar.event,exdate:0 -#: field:calendar.todo,exdate:0 -msgid "Exception Date/Times" -msgstr "Fecha/horas excepción" +#: model:ir.model,name:base_calendar.model_calendar_alarm +msgid "Event alarm information" +msgstr "" #. module: base_calendar -#: selection:calendar.event,class:0 -#: selection:calendar.todo,class:0 -msgid "Confidential" -msgstr "Confidencial" +#: code:addons/base_calendar/base_calendar.py:1015 +#, python-format +msgid "Count cannot be negative or 0." +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,end_date:0 -#: field:calendar.event,end_date:0 -#: field:calendar.todo,end_date:0 -msgid "Repeat Until" -msgstr "Repetir hasta" +#: field:crm.meeting,create_date:0 +msgid "Creation Date" +msgstr "" #. module: base_calendar -#: model:ir.actions.act_window,help:base_calendar.action_res_alarm_view -msgid "" -"Create specific calendar alarms that may be assigned to calendar events or " -"meetings." +#: view:crm.meeting:0 +#: model:ir.model,name:base_calendar.model_crm_meeting +#: model:res.request.link,name:base_calendar.request_link_meeting +msgid "Meeting" +msgstr "" + +#. module: base_calendar +#: selection:calendar.event,rrule_type:0 +#: selection:calendar.todo,rrule_type:0 +#: selection:crm.meeting,rrule_type:0 +msgid "Month(s)" msgstr "" -"Crear alarmas específicas que puedan ser asignadas a eventos de calendario o " -"reuniones." #. module: base_calendar #: view:calendar.event:0 msgid "Visibility" -msgstr "Visibilidad" +msgstr "" #. module: base_calendar #: field:calendar.attendee,rsvp:0 msgid "Required Reply?" -msgstr "¿Respuesta requerida?" +msgstr "" #. module: base_calendar #: field:calendar.event,base_calendar_url:0 #: field:calendar.todo,base_calendar_url:0 +#: field:crm.meeting,base_calendar_url:0 msgid "Caldav URL" -msgstr "URL de caldav" - -#. module: base_calendar -#: view:base.calendar.set.exrule:0 -msgid "Select range to Exclude" -msgstr "Elija el rango a excluir" +msgstr "" #. module: base_calendar -#: field:calendar.event,recurrent_uid:0 -#: field:calendar.todo,recurrent_uid:0 -msgid "Recurrent ID" -msgstr "ID recurrente" +#: model:ir.model,name:base_calendar.model_mail_wizard_invite +msgid "Invite wizard" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "July" -msgstr "Julio" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: selection:calendar.attendee,state:0 msgid "Accepted" -msgstr "Aceptada" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,th:0 #: field:calendar.event,th:0 #: field:calendar.todo,th:0 +#: field:crm.meeting,th:0 msgid "Thu" -msgstr "Jue" +msgstr "" #. module: base_calendar -#: field:calendar.attendee,child_ids:0 -msgid "Delegrated To" -msgstr "Delegada en" +#: view:crm.meeting:0 +msgid "Meeting Details" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Required Reply" -msgstr "Respuesta requerida" +#: field:calendar.attendee,child_ids:0 +msgid "Delegrated To" +msgstr "" #. module: base_calendar -#: selection:calendar.event,end_type:0 -#: selection:calendar.todo,end_type:0 -msgid "Forever" -msgstr "Siempre" +#: code:addons/base_calendar/crm_meeting.py:102 +#, python-format +msgid "The following contacts have no email address :" +msgstr "" #. module: base_calendar -#: selection:calendar.attendee,role:0 -msgid "Participation required" -msgstr "Participación requerida" +#: selection:calendar.event,rrule_type:0 +#: selection:calendar.todo,rrule_type:0 +#: selection:crm.meeting,rrule_type:0 +msgid "Year(s)" +msgstr "" #. module: base_calendar -#: view:base.calendar.set.exrule:0 -msgid "_Cancel" -msgstr "_Cancelar" +#: view:crm.meeting.type:0 +#: model:ir.actions.act_window,name:base_calendar.action_crm_meeting_type +#: model:ir.ui.menu,name:base_calendar.menu_crm_meeting_type +msgid "Meeting Types" +msgstr "" #. module: base_calendar #: field:calendar.event,create_date:0 #: field:calendar.todo,create_date:0 msgid "Created" -msgstr "Creada" +msgstr "" #. module: base_calendar #: selection:calendar.event,class:0 #: selection:calendar.todo,class:0 -msgid "Private" -msgstr "Privada" - -#. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -#: selection:calendar.event,rrule_type:0 -#: selection:calendar.todo,rrule_type:0 -msgid "Daily" -msgstr "Diariamente" - -#. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:385 -#, python-format -msgid "Can not Duplicate" -msgstr "No se puede duplicar" +#: selection:crm.meeting,class:0 +msgid "Public for Employees" +msgstr "" #. module: base_calendar -#: field:calendar.event,class:0 -#: field:calendar.todo,class:0 -msgid "Mark as" -msgstr "Marcar como" +#: view:crm.meeting:0 +msgid "hours" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -#: field:calendar.attendee,partner_address_id:0 +#: field:calendar.attendee,partner_id:0 msgid "Contact" -msgstr "Contacto" - -#. module: base_calendar -#: help:calendar.event,rrule_type:0 -#: help:calendar.todo,rrule_type:0 -msgid "Let the event automatically repeat at that interval" -msgstr "Permite que el evento se repita automáticamente en ese intervalo" - -#. module: base_calendar -#: view:calendar.attendee:0 -#: view:calendar.event:0 -msgid "Delegate" -msgstr "Delegar" +msgstr "" #. module: base_calendar -#: field:base_calendar.invite.attendee,partner_id:0 -#: view:calendar.attendee:0 -#: field:calendar.attendee,partner_id:0 -msgid "Partner" -msgstr "Empresa" +#: field:calendar.attendee,language:0 +msgid "Language" +msgstr "" #. module: base_calendar -#: view:base_calendar.invite.attendee:0 -#: selection:base_calendar.invite.attendee,type:0 -msgid "Partner Contacts" -msgstr "Contactos de la empresa" +#: field:calendar.event,end_date:0 +#: field:calendar.todo,end_date:0 +#: field:crm.meeting,end_date:0 +msgid "Repeat Until" +msgstr "" #. module: base_calendar -#: view:base.calendar.set.exrule:0 -msgid "_Ok" -msgstr "_Aceptar" +#: view:crm.meeting:0 +msgid "Options" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 #: selection:calendar.event,byday:0 #: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 msgid "First" -msgstr "Primera" - -#. module: base_calendar -#: view:calendar.event:0 -msgid "Privacy" -msgstr "Privacidad" - -#. module: base_calendar -#: field:calendar.event,vtimezone:0 -#: field:calendar.todo,vtimezone:0 -msgid "Timezone" -msgstr "Zona horaria" +msgstr "" #. module: base_calendar #: view:calendar.event:0 +#: view:crm.meeting:0 msgid "Subject" -msgstr "Asunto" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "September" -msgstr "Septiembre" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "December" -msgstr "Diciembre" +msgstr "" #. module: base_calendar -#: help:base_calendar.invite.attendee,send_mail:0 -msgid "Check this if you want to send an Email to Invited Person" -msgstr "Marque aquí si quiere enviar un correo a la persona invitada" +#: selection:calendar.event,week_list:0 +#: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 +msgid "Tuesday" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 -msgid "Availability" -msgstr "Disponibilidad" +#: field:crm.meeting,categ_ids:0 +msgid "Tags" +msgstr "" #. module: base_calendar -#: view:calendar.event.edit.all:0 -msgid "_Save" -msgstr "_Guardar" +#: view:calendar.event:0 +msgid "Availability" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,cutype:0 msgid "Individual" -msgstr "Individual" +msgstr "" #. module: base_calendar #: help:calendar.event,count:0 #: help:calendar.todo,count:0 +#: help:crm.meeting,count:0 msgid "Repeat x times" -msgstr "Repetir x veces" +msgstr "" #. module: base_calendar #: field:calendar.alarm,user_id:0 msgid "Owner" -msgstr "Dueño" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Delegation Info" -msgstr "Información delegación" +#: help:calendar.event,rrule_type:0 +#: help:calendar.todo,rrule_type:0 +#: help:crm.meeting,rrule_type:0 +msgid "Let the event automatically repeat at that interval" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 -#: field:calendar.event.edit.all,date:0 -msgid "Start Date" -msgstr "Fecha inicio" +#: model:ir.ui.menu,name:base_calendar.mail_menu_calendar +msgid "Calendar" +msgstr "" #. module: base_calendar #: field:calendar.attendee,cn:0 msgid "Common name" -msgstr "Nombre común" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: selection:calendar.attendee,state:0 msgid "Declined" -msgstr "Rechazada" - -#. module: base_calendar -#: view:calendar.attendee:0 -msgid "My Role" -msgstr "Mi rol" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 -msgid "My Events" -msgstr "Mis eventos" +#: code:addons/base_calendar/base_calendar.py:1460 +#, python-format +msgid "Group by date is not supported, use the calendar view instead." +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 +#: view:crm.meeting:0 msgid "Decline" -msgstr "Rechazar" - -#. module: base_calendar -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 -msgid "Weeks" -msgstr "Semanas" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,cutype:0 msgid "Group" -msgstr "Grupo" +msgstr "" #. module: base_calendar -#: field:calendar.event,edit_all:0 -#: field:calendar.todo,edit_all:0 -msgid "Edit All" -msgstr "Editar todo" +#: selection:calendar.event,class:0 +#: selection:calendar.todo,class:0 +#: selection:crm.meeting,class:0 +msgid "Private" +msgstr "" #. module: base_calendar -#: field:base_calendar.invite.attendee,contact_ids:0 -msgid "Contacts" -msgstr "Contactos" +#: view:calendar.event:0 +#: field:calendar.event,class:0 +#: field:calendar.todo,class:0 +#: field:crm.meeting,class:0 +msgid "Privacy" +msgstr "" #. module: base_calendar #: model:ir.model,name:base_calendar.model_res_alarm msgid "Basic Alarm Information" -msgstr "Información sobre la alarma básica" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,fr:0 #: field:calendar.event,fr:0 #: field:calendar.todo,fr:0 +#: field:crm.meeting,fr:0 msgid "Fri" -msgstr "Vie" - -#. module: base_calendar -#: selection:calendar.alarm,trigger_interval:0 -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 -#: selection:res.alarm,trigger_interval:0 -msgid "Hours" -msgstr "Horas" +msgstr "" #. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:1090 -#, python-format -msgid "Count can not be Negative" -msgstr "La cuenta no puede ser negativa" +#: view:calendar.event:0 +msgid "Invitation Detail" +msgstr "" #. module: base_calendar #: field:calendar.attendee,member:0 msgid "Member" -msgstr "Miembro" +msgstr "" #. module: base_calendar #: help:calendar.event,location:0 #: help:calendar.todo,location:0 +#: help:crm.meeting,location:0 msgid "Location of Event" -msgstr "Ubicación del evento" +msgstr "" #. module: base_calendar #: field:calendar.event,rrule:0 #: field:calendar.todo,rrule:0 +#: field:crm.meeting,rrule:0 msgid "Recurrent Rule" -msgstr "Regla recurrente" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,state:0 msgid "Draft" -msgstr "Borrador" +msgstr "" #. module: base_calendar #: field:calendar.alarm,attach:0 msgid "Attachment" -msgstr "Adjunto" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Invitation From" -msgstr "Invitación desde" +#: field:crm.meeting,date_closed:0 +msgid "Closed" +msgstr "" #. module: base_calendar #: view:calendar.event:0 -msgid "End of Recurrency" -msgstr "Fin de recurrencia" +msgid "From" +msgstr "" #. module: base_calendar #: view:calendar.event:0 -#: field:calendar.event.edit.all,alarm_id:0 +#: field:calendar.event,alarm_id:0 +#: field:calendar.todo,alarm_id:0 +#: field:crm.meeting,alarm_id:0 msgid "Reminder" -msgstr "Recordatorio" +msgstr "" #. module: base_calendar -#: view:base.calendar.set.exrule:0 -#: model:ir.model,name:base_calendar.model_base_calendar_set_exrule -msgid "Set Exrule" -msgstr "Establecer Exregla" +#: selection:calendar.event,end_type:0 +#: selection:calendar.todo,end_type:0 +#: selection:crm.meeting,end_type:0 +msgid "Number of repetitions" +msgstr "" + +#. module: base_calendar +#: model:crm.meeting.type,name:base_calendar.categ_meet2 +msgid "Internal Meeting" +msgstr "" #. module: base_calendar #: view:calendar.event:0 #: model:ir.actions.act_window,name:base_calendar.action_view_event #: model:ir.ui.menu,name:base_calendar.menu_events msgid "Events" -msgstr "Eventos" +msgstr "" #. module: base_calendar -#: model:ir.actions.act_window,name:base_calendar.action_view_calendar_invite_attendee_wizard -#: model:ir.model,name:base_calendar.model_base_calendar_invite_attendee -msgid "Invite Attendees" -msgstr "Invitar asistentes" +#: field:calendar.alarm,state:0 +#: field:calendar.attendee,state:0 +#: view:calendar.event:0 +#: field:calendar.event,state:0 +#: field:calendar.todo,state:0 +#: field:crm.meeting,state:0 +msgid "Status" +msgstr "" #. module: base_calendar #: help:calendar.attendee,email:0 msgid "Email of Invited Person" -msgstr "Email del invitado" +msgstr "" #. module: base_calendar -#: field:calendar.alarm,repeat:0 -#: field:calendar.event,count:0 -#: field:calendar.todo,count:0 -#: field:res.alarm,repeat:0 -msgid "Repeat" -msgstr "Repetir" +#: model:crm.meeting.type,name:base_calendar.categ_meet1 +msgid "Customer Meeting" +msgstr "" #. module: base_calendar #: help:calendar.attendee,dir:0 @@ -931,186 +881,193 @@ msgid "" "Reference to the URIthat points to the directory information corresponding " "to the attendee." msgstr "" -"La referencia a la URI que apunta a la información del directorio " -"correspondiente al participante." #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "August" -msgstr "Agosto" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Monday" -msgstr "Lunes" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 -#: selection:calendar.event,byday:0 -#: selection:calendar.todo,byday:0 -msgid "Third" -msgstr "Tercero" +#: model:crm.meeting.type,name:base_calendar.categ_meet4 +msgid "Open Discussion" +msgstr "" + +#. module: base_calendar +#: model:ir.model,name:base_calendar.model_ir_model +msgid "Models" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "June" -msgstr "Junio" +msgstr "" #. module: base_calendar -#: field:calendar.alarm,alarm_id:0 -msgid "Basic Alarm" -msgstr "Alarma básica" +#: field:calendar.alarm,event_date:0 +#: field:calendar.attendee,event_date:0 +#: view:calendar.event:0 +msgid "Event Date" +msgstr "" + +#. module: base_calendar +#: view:crm.meeting:0 +msgid "Invitations" +msgstr "" #. module: base_calendar -#: view:base.calendar.set.exrule:0 #: view:calendar.event:0 +#: view:crm.meeting:0 msgid "The" -msgstr "El" +msgstr "" + +#. module: base_calendar +#: field:crm.meeting,write_date:0 +msgid "Write Date" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: field:calendar.attendee,delegated_from:0 msgid "Delegated From" -msgstr "Delegado desde" +msgstr "" + +#. module: base_calendar +#: field:crm.meeting,message_is_follower:0 +msgid "Is a Follower" +msgstr "" #. module: base_calendar #: field:calendar.attendee,user_id:0 msgid "User" -msgstr "Usuario" +msgstr "" #. module: base_calendar #: view:calendar.event:0 #: field:calendar.event,date:0 +#: field:crm.meeting,date:0 msgid "Date" -msgstr "Fecha" +msgstr "" + +#. module: base_calendar +#: view:calendar.event:0 +msgid "Start Date" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "November" -msgstr "Noviembre" +msgstr "" #. module: base_calendar #: help:calendar.attendee,member:0 msgid "Indicate the groups that the attendee belongs to" -msgstr "Indicar los grupos a los que pertenece el asistente" - -#. module: base_calendar -#: view:base_calendar.invite.attendee:0 -msgid "Data" -msgstr "Datos" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,mo:0 #: field:calendar.event,mo:0 #: field:calendar.todo,mo:0 +#: field:crm.meeting,mo:0 msgid "Mon" -msgstr "Lun" - -#. module: base_calendar -#: field:base.calendar.set.exrule,count:0 -msgid "Count" -msgstr "Total" - -#. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 -msgid "No Repeat" -msgstr "No repetir" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "October" -msgstr "Octubre" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 +#: selection:calendar.attendee,state:0 #: view:calendar.event:0 +#: selection:calendar.event,state:0 +#: selection:calendar.todo,state:0 +#: view:crm.meeting:0 msgid "Uncertain" -msgstr "Incierto" +msgstr "" #. module: base_calendar -#: field:calendar.attendee,language:0 -msgid "Language" -msgstr "Idioma" +#: constraint:calendar.event:0 +#: constraint:calendar.todo:0 +#: constraint:crm.meeting:0 +msgid "Error ! End date cannot be set before start date." +msgstr "" #. module: base_calendar #: field:calendar.alarm,trigger_occurs:0 #: field:res.alarm,trigger_occurs:0 msgid "Triggers" -msgstr "Disparadores" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "January" -msgstr "Enero" +msgstr "" #. module: base_calendar #: field:calendar.alarm,trigger_related:0 #: field:res.alarm,trigger_related:0 msgid "Related to" -msgstr "Relacionado con" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,interval:0 #: field:calendar.alarm,trigger_interval:0 #: field:res.alarm,trigger_interval:0 msgid "Interval" -msgstr "Intervalo" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Wednesday" -msgstr "Miércoles" - -#. module: base_calendar -#: code:addons/base_calendar/base_calendar.py:1088 -#, python-format -msgid "Interval can not be Negative" -msgstr "El intervalo no puede ser negativo" +msgstr "" #. module: base_calendar #: field:calendar.alarm,name:0 #: view:calendar.event:0 +#: field:crm.meeting,message_summary:0 msgid "Summary" -msgstr "Resumen" +msgstr "" #. module: base_calendar #: field:calendar.alarm,active:0 #: field:calendar.event,active:0 #: field:calendar.todo,active:0 +#: field:crm.meeting,active:0 #: field:res.alarm,active:0 msgid "Active" -msgstr "Activo" +msgstr "" + +#. module: base_calendar +#: code:addons/base_calendar/base_calendar.py:399 +#, python-format +msgid "You cannot duplicate a calendar attendee." +msgstr "" #. module: base_calendar #: view:calendar.event:0 msgid "Choose day in the month where repeat the meeting" -msgstr "Elija el día del mes en que se repetirá la reunión" +msgstr "" #. module: base_calendar #: field:calendar.alarm,action:0 msgid "Action" -msgstr "Acción" - -#. module: base_calendar -#: help:base_calendar.invite.attendee,type:0 -msgid "Select whom you want to Invite" -msgstr "Seleccione a quien quiere invitar" +msgstr "" #. module: base_calendar #: help:calendar.alarm,duration:0 @@ -1119,52 +1076,38 @@ msgid "" "Duration' and 'Repeat' are both optional, but if one occurs, so MUST the " "other" msgstr "" -"Duración' y 'Repetir' son ambos opcionales, pero si uno está activo también " -"debe estarlo el otro" - -#. module: base_calendar -#: model:ir.model,name:base_calendar.model_calendar_event_edit_all -msgid "Calendar Edit all event" -msgstr "Editar todos los eventos del calendario" #. module: base_calendar #: help:calendar.attendee,role:0 msgid "Participation role for the calendar user" -msgstr "Rol de participación para el usuario del calendario." +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: field:calendar.attendee,delegated_to:0 msgid "Delegated To" -msgstr "Delegado a" +msgstr "" #. module: base_calendar #: help:calendar.alarm,action:0 msgid "Defines the action to be invoked when an alarm is triggered" -msgstr "Define la acción a invocar cuando salte la alarma" +msgstr "" + +#. module: base_calendar +#: view:crm.meeting:0 +msgid "Starting at" +msgstr "" #. module: base_calendar #: selection:calendar.event,end_type:0 #: selection:calendar.todo,end_type:0 +#: selection:crm.meeting,end_type:0 msgid "End date" -msgstr "Fecha de fin" +msgstr "" #. module: base_calendar #: view:calendar.event:0 msgid "Search Events" -msgstr "Buscar eventos" - -#. module: base_calendar -#: view:calendar.event:0 -msgid "Recurrency Option" -msgstr "Opción de recurrencia" - -#. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -#: selection:calendar.event,rrule_type:0 -#: selection:calendar.todo,rrule_type:0 -msgid "Weekly" -msgstr "Semanal" +msgstr "" #. module: base_calendar #: help:calendar.alarm,active:0 @@ -1173,87 +1116,70 @@ msgid "" "If the active field is set to true, it will allow you to hide the event " "alarm information without removing it." msgstr "" -"Si el campo activo es verdadero, le permitirá ocultar la notificación de " -"aviso del evento sin eliminarlo." #. module: base_calendar -#: field:calendar.event,recurrent_id:0 -#: field:calendar.todo,recurrent_id:0 -msgid "Recurrent ID date" -msgstr "ID fecha recurrente" - -#. module: base_calendar -#: sql_constraint:res.users:0 -msgid "You can not have two users with the same login !" -msgstr "¡No puede tener dos usuarios con el mismo identificador de usuario!" +#: field:calendar.event,end_type:0 +#: field:calendar.todo,end_type:0 +#: field:crm.meeting,end_type:0 +msgid "Recurrence Termination" +msgstr "" #. module: base_calendar -#: field:calendar.alarm,state:0 -#: view:calendar.attendee:0 -#: field:calendar.attendee,state:0 -#: view:calendar.event:0 -#: field:calendar.event,state:0 -#: field:calendar.todo,state:0 -msgid "State" -msgstr "Estado" +#: view:crm.meeting:0 +msgid "Until" +msgstr "" #. module: base_calendar #: view:res.alarm:0 msgid "Reminder Details" -msgstr "Detalles del recordatorio" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "To Review" -msgstr "A revisar" +#: model:crm.meeting.type,name:base_calendar.categ_meet3 +msgid "Off-site Meeting" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,freq:0 -#: field:calendar.event,freq:0 -#: field:calendar.todo,freq:0 -msgid "Frequency" -msgstr "Frecuencia" +#: view:crm.meeting:0 +msgid "Day of Month" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,state:0 msgid "Done" -msgstr "Hecho" +msgstr "" #. module: base_calendar #: help:calendar.event,interval:0 #: help:calendar.todo,interval:0 +#: help:crm.meeting,interval:0 msgid "Repeat every (Days/Week/Month/Year)" -msgstr "Repetir cada (días/semana/mes/año)" - -#. module: base_calendar -#: view:base_calendar.invite.attendee:0 -#: field:base_calendar.invite.attendee,user_ids:0 -msgid "Users" -msgstr "Usuarios" +msgstr "" #. module: base_calendar -#: view:base.calendar.set.exrule:0 -msgid "of" -msgstr "de" +#: view:crm.meeting:0 +msgid "All Day?" +msgstr "" #. module: base_calendar -#: view:base_calendar.invite.attendee:0 #: view:calendar.event:0 -#: view:calendar.event.edit.all:0 msgid "Cancel" -msgstr "Cancelar" - -#. module: base_calendar -#: model:ir.model,name:base_calendar.model_res_users -msgid "res.users" -msgstr "res.usuarios" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 -#: selection:calendar.event,week_list:0 -#: selection:calendar.todo,week_list:0 -msgid "Tuesday" -msgstr "Martes" +#: model:ir.actions.act_window,help:base_calendar.action_crm_meeting +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to schedule a new meeting.\n" +" </p><p>\n" +" The calendar is shared between employees and fully integrated " +"with\n" +" other applications such as the employee holidays or the " +"business\n" +" opportunities.\n" +" </p>\n" +" " +msgstr "" #. module: base_calendar #: help:calendar.alarm,description:0 @@ -1262,129 +1188,103 @@ msgid "" "calendar component, than that provided by the " "\"SUMMARY\" property" msgstr "" -"Facilita una descripción más completa del componente del calendario que la " -"facilitada por la propiedad \"RESUMEN\"" #. module: base_calendar #: view:calendar.event:0 msgid "Responsible User" -msgstr "Usuario responsable" +msgstr "" #. module: base_calendar +#: view:crm.meeting:0 +msgid "Select Weekdays" +msgstr "" + +#. module: base_calendar +#: code:addons/base_calendar/base_calendar.py:1519 #: selection:calendar.attendee,availability:0 #: selection:calendar.event,show_as:0 #: selection:calendar.todo,show_as:0 -#: selection:res.users,availability:0 +#: selection:crm.meeting,show_as:0 +#, python-format msgid "Busy" -msgstr "Ocupado" +msgstr "" #. module: base_calendar #: model:ir.model,name:base_calendar.model_calendar_event msgid "Calendar Event" -msgstr "Evento de calendario" - -#. module: base_calendar -#: selection:calendar.attendee,state:0 -#: selection:calendar.event,state:0 -#: selection:calendar.todo,state:0 -msgid "Tentative" -msgstr "Provisional" - -#. module: base_calendar -#: field:calendar.event,interval:0 -#: field:calendar.todo,interval:0 -msgid "Repeat every" -msgstr "Repetir cada" - -#. module: base_calendar -#: selection:calendar.event,end_type:0 -#: selection:calendar.todo,end_type:0 -msgid "Fix amout of times" -msgstr "Cantidad fija de veces" +msgstr "" #. module: base_calendar #: field:calendar.event,recurrency:0 #: field:calendar.todo,recurrency:0 +#: field:crm.meeting,recurrency:0 msgid "Recurrent" -msgstr "Recurrente" +msgstr "" #. module: base_calendar #: field:calendar.event,rrule_type:0 #: field:calendar.todo,rrule_type:0 +#: field:crm.meeting,rrule_type:0 msgid "Recurrency" -msgstr "Recurrencia" - -#. module: base_calendar -#: model:ir.actions.act_window,name:base_calendar.action_view_attendee_form -#: model:ir.ui.menu,name:base_calendar.menu_attendee_invitations -msgid "Event Invitations" -msgstr "Invitaciones al evento" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Thursday" -msgstr "Jueves" +msgstr "" #. module: base_calendar #: field:calendar.event,exrule:0 #: field:calendar.todo,exrule:0 +#: field:crm.meeting,exrule:0 msgid "Exception Rule" -msgstr "Regla de excepción" +msgstr "" #. module: base_calendar #: help:calendar.attendee,language:0 msgid "" "To specify the language for text values in aproperty or property parameter." msgstr "" -"Para indicar el idioma de los valores de texto en una propiedad o parámetro " -"de propiedad." #. module: base_calendar #: view:calendar.event:0 msgid "Details" -msgstr "Detalles" +msgstr "" #. module: base_calendar #: help:calendar.event,exrule:0 #: help:calendar.todo,exrule:0 +#: help:crm.meeting,exrule:0 msgid "" "Defines a rule or repeating pattern of time to exclude from the recurring " "rule." msgstr "" -"Define una regla o patrón de repetición de tiempo a excluir de la regla " -"recurrente." #. module: base_calendar -#: field:base.calendar.set.exrule,month_list:0 #: field:calendar.event,month_list:0 #: field:calendar.todo,month_list:0 +#: field:crm.meeting,month_list:0 msgid "Month" -msgstr "Mes" +msgstr "" #. module: base_calendar -#: view:base_calendar.invite.attendee:0 -#: view:calendar.event:0 -msgid "Invite People" -msgstr "Invitar personas" +#: selection:calendar.event,rrule_type:0 +#: selection:calendar.todo,rrule_type:0 +#: selection:crm.meeting,rrule_type:0 +msgid "Day(s)" +msgstr "" #. module: base_calendar -#: help:calendar.event,rrule:0 -#: help:calendar.todo,rrule:0 -msgid "" -"Defines a rule or repeating pattern for recurring events\n" -"e.g.: Every other month on the last Sunday of the month for 10 occurrences: " -" FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU" +#: view:calendar.event:0 +msgid "Confirmed Events" msgstr "" -"Define una regla o patrón repetitivo para eventos recurrentes.\n" -"Por ejemplo: Para 10 ocurrencias cada último domingo de cada dos meses : " -"FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU" #. module: base_calendar #: field:calendar.attendee,dir:0 msgid "URI Reference" -msgstr "Referencia URI" +msgstr "" #. module: base_calendar #: field:calendar.alarm,description:0 @@ -1393,110 +1293,115 @@ msgstr "Referencia URI" #: field:calendar.event,name:0 #: field:calendar.todo,description:0 #: field:calendar.todo,name:0 +#: field:crm.meeting,description:0 msgid "Description" -msgstr "Descripción" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "May" -msgstr "Mayo" - -#. module: base_calendar -#: field:base_calendar.invite.attendee,type:0 -#: view:calendar.attendee:0 -msgid "Type" -msgstr "Tipo" - -#. module: base_calendar -#: view:calendar.attendee:0 -msgid "Search Invitations" -msgstr "Buscar invitaciones" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,trigger_occurs:0 #: selection:res.alarm,trigger_occurs:0 msgid "After" -msgstr "Después de" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,state:0 msgid "Stop" -msgstr "Parar" +msgstr "" #. module: base_calendar #: model:ir.model,name:base_calendar.model_ir_values msgid "ir.values" -msgstr "ir.valores" +msgstr "" #. module: base_calendar -#: model:ir.model,name:base_calendar.model_ir_model -msgid "Objects" -msgstr "Objetos" +#: view:crm.meeting:0 +msgid "Search Meetings" +msgstr "" + +#. module: base_calendar +#: model:ir.model,name:base_calendar.model_ir_attachment +msgid "ir.attachment" +msgstr "" + +#. module: base_calendar +#: model:ir.model,name:base_calendar.model_crm_meeting_type +msgid "Meeting Type" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: selection:calendar.attendee,state:0 msgid "Delegated" -msgstr "Delegada" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,sa:0 #: field:calendar.event,sa:0 #: field:calendar.todo,sa:0 +#: field:crm.meeting,sa:0 msgid "Sat" -msgstr "Sáb" +msgstr "" #. module: base_calendar -#: view:calendar.event:0 -msgid "Choose day where repeat the meeting" -msgstr "Eligir día en el que repetir la cita" +#: model:ir.actions.act_window,help:base_calendar.action_res_alarm_view +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to setup a new alarm type.\n" +" </p><p>\n" +" You can define a customized type of calendar alarm that may " +"be\n" +" assigned to calendar events or meetings.\n" +" </p>\n" +" " +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,freq:0 -msgid "Minutely" -msgstr "Cada minuto" +#: selection:crm.meeting,state:0 +msgid "Unconfirmed" +msgstr "" #. module: base_calendar #: help:calendar.attendee,sent_by:0 msgid "Specify the user that is acting on behalf of the calendar user" msgstr "" -"Indique el usuario que está actuando en nombre del usuario del calendario." #. module: base_calendar #: view:calendar.event:0 -#: field:calendar.event.edit.all,date_deadline:0 +#: field:calendar.event,date_deadline:0 +#: field:calendar.todo,date_deadline:0 +#: field:crm.meeting,date_deadline:0 msgid "End Date" -msgstr "Fecha final" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "February" -msgstr "Febrero" - -#. module: base_calendar -#: selection:calendar.event,freq:0 -#: selection:calendar.todo,freq:0 -msgid "Months" -msgstr "Meses" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,cutype:0 msgid "Resource" -msgstr "Recurso" +msgstr "" #. module: base_calendar +#: field:crm.meeting.type,name:0 #: field:res.alarm,name:0 msgid "Name" -msgstr "Nombre" +msgstr "" #. module: base_calendar -#: model:ir.model,name:base_calendar.model_calendar_alarm -msgid "Event alarm information" -msgstr "Información del aviso del evento" +#: field:calendar.event,exdate:0 +#: field:calendar.todo,exdate:0 +#: field:crm.meeting,exdate:0 +msgid "Exception Date/Times" +msgstr "" #. module: base_calendar #: help:calendar.alarm,name:0 @@ -1504,154 +1409,162 @@ msgid "" "Contains the text to be used as the message subject for " "email or contains the text to be used for display" msgstr "" -"Contiene el texto a usar como asunto del mensaje para correos electrónicos, " -"o contiene el texto a mostrar" #. module: base_calendar -#: field:calendar.event,alarm_id:0 +#: model:ir.model,name:base_calendar.model_mail_message +msgid "Message" +msgstr "" + +#. module: base_calendar #: field:calendar.event,base_calendar_alarm_id:0 -#: field:calendar.todo,alarm_id:0 #: field:calendar.todo,base_calendar_alarm_id:0 +#: field:crm.meeting,base_calendar_alarm_id:0 msgid "Alarm" -msgstr "Alarma" - -#. module: base_calendar -#: code:addons/base_calendar/wizard/base_calendar_set_exrule.py:90 -#, python-format -msgid "Please Apply Recurrency before applying Exception Rule." msgstr "" -"Por favor, aplique la repetición antes de aplicar la excepción de la regla" #. module: base_calendar #: field:calendar.attendee,sent_by_uid:0 msgid "Sent By User" -msgstr "Enviado por usuario" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,month_list:0 #: selection:calendar.event,month_list:0 #: selection:calendar.todo,month_list:0 +#: selection:crm.meeting,month_list:0 msgid "April" -msgstr "Abril" +msgstr "" + +#. module: base_calendar +#: code:addons/base_calendar/crm_meeting.py:106 +#, python-format +msgid "Email addresses not found" +msgstr "" #. module: base_calendar #: view:calendar.event:0 msgid "Recurrency period" -msgstr "Periodo de recurrencia" +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,week_list:0 #: field:calendar.event,week_list:0 #: field:calendar.todo,week_list:0 +#: field:crm.meeting,week_list:0 msgid "Weekday" -msgstr "Día de la semana" +msgstr "" + +#. module: base_calendar +#: code:addons/base_calendar/base_calendar.py:1013 +#, python-format +msgid "Interval cannot be negative." +msgstr "" #. module: base_calendar -#: field:base.calendar.set.exrule,byday:0 #: field:calendar.event,byday:0 #: field:calendar.todo,byday:0 +#: field:crm.meeting,byday:0 msgid "By day" -msgstr "Por día" +msgstr "" + +#. module: base_calendar +#: code:addons/base_calendar/base_calendar.py:441 +#, python-format +msgid "First you have to specify the date of the invitation." +msgstr "" #. module: base_calendar #: field:calendar.alarm,model_id:0 msgid "Model" -msgstr "Modelo" +msgstr "" #. module: base_calendar #: selection:calendar.alarm,action:0 msgid "Audio" -msgstr "Audio" +msgstr "" #. module: base_calendar #: field:calendar.event,id:0 #: field:calendar.todo,id:0 +#: field:crm.meeting,id:0 msgid "ID" -msgstr "ID" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,role:0 msgid "For information Purpose" -msgstr "Con propósito informativo" +msgstr "" #. module: base_calendar -#: view:base_calendar.invite.attendee:0 -msgid "Invite" -msgstr "Invitar" +#: field:calendar.event,select1:0 +#: field:calendar.todo,select1:0 +#: field:crm.meeting,select1:0 +msgid "Option" +msgstr "" #. module: base_calendar #: model:ir.model,name:base_calendar.model_calendar_attendee msgid "Attendee information" -msgstr "Información asistentes" +msgstr "" #. module: base_calendar #: field:calendar.alarm,res_id:0 msgid "Resource ID" -msgstr "ID del registro" +msgstr "" #. module: base_calendar #: selection:calendar.attendee,state:0 msgid "Needs Action" -msgstr "Necesita acción" +msgstr "" #. module: base_calendar #: field:calendar.attendee,sent_by:0 msgid "Sent By" -msgstr "Enviado por" +msgstr "" #. module: base_calendar #: field:calendar.event,sequence:0 #: field:calendar.todo,sequence:0 +#: field:crm.meeting,sequence:0 msgid "Sequence" -msgstr "Secuencia" +msgstr "" #. module: base_calendar #: help:calendar.event,alarm_id:0 #: help:calendar.todo,alarm_id:0 +#: help:crm.meeting,alarm_id:0 msgid "Set an alarm at this time, before the event occurs" -msgstr "Configure una alarma en este momento, antes de que ocurra el evento" - -#. module: base_calendar -#: selection:base_calendar.invite.attendee,type:0 -msgid "Internal User" -msgstr "Usuario interno" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 #: view:calendar.event:0 +#: view:crm.meeting:0 msgid "Accept" -msgstr "Aceptar" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,week_list:0 #: selection:calendar.event,week_list:0 #: selection:calendar.todo,week_list:0 +#: selection:crm.meeting,week_list:0 msgid "Saturday" -msgstr "Sábado" +msgstr "" #. module: base_calendar -#: view:calendar.attendee:0 -msgid "Invitation To" -msgstr "Invitación a" +#: field:calendar.event,interval:0 +#: field:calendar.todo,interval:0 +#: field:crm.meeting,interval:0 +msgid "Repeat Every" +msgstr "" #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 #: selection:calendar.event,byday:0 #: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 msgid "Second" -msgstr "Segundo" +msgstr "" #. module: base_calendar #: field:calendar.attendee,availability:0 -#: field:res.users,availability:0 msgid "Free/Busy" -msgstr "Libre/Ocupado" - -#. module: base_calendar -#: field:calendar.event,end_type:0 -#: field:calendar.todo,end_type:0 -msgid "Way to end reccurency" -msgstr "Forma de terminar recurrencia" +msgstr "" #. module: base_calendar #: field:calendar.alarm,duration:0 @@ -1659,20 +1572,16 @@ msgstr "Forma de terminar recurrencia" #: field:calendar.event,duration:0 #: field:calendar.todo,date:0 #: field:calendar.todo,duration:0 +#: field:crm.meeting,duration:0 #: field:res.alarm,duration:0 #: field:res.alarm,trigger_duration:0 msgid "Duration" -msgstr "Duración" - -#. module: base_calendar -#: selection:base_calendar.invite.attendee,type:0 -msgid "External Email" -msgstr "Email externo" +msgstr "" #. module: base_calendar #: field:calendar.alarm,trigger_date:0 msgid "Trigger Date" -msgstr "Fecha activación" +msgstr "" #. module: base_calendar #: help:calendar.alarm,attach:0 @@ -1684,19 +1593,10 @@ msgid "" " * Points to a procedure resource, which is invoked when " " the alarm is triggered for procedure." msgstr "" -"* Apunta a un recurso de sonido, que se escucha cuando la alarma se activa " -"por audio.\n" -"* El archivo que está intentando ser enviado como adjunto en el correo " -"electrónico.\n" -"* Apunta a un recurso de procedimiento, que se invoca cuando la alarma se " -"activa por procedimiento." #. module: base_calendar -#: selection:base.calendar.set.exrule,byday:0 #: selection:calendar.event,byday:0 #: selection:calendar.todo,byday:0 +#: selection:crm.meeting,byday:0 msgid "Fifth" -msgstr "Quinto" - -#~ msgid "Set Exclude range" -#~ msgstr "Fijar el rango de exclusión" +msgstr "" diff --git a/addons/base_report_designer/base_report_designer_installer.xml b/addons/base_report_designer/base_report_designer_installer.xml index 657eae8fd63..99898f5a703 100644 --- a/addons/base_report_designer/base_report_designer_installer.xml +++ b/addons/base_report_designer/base_report_designer_installer.xml @@ -20,7 +20,7 @@ <xpath expr="//separator[@string='title']" position="after"> <group colspan="8" height="450" width="750"> <field name="name" invisible="1"/> - <field name="plugin_file" filename="name"/> + <field name="plugin_file" filename="name" widget="url"/> <separator string="Installation and Configuration Steps" colspan="4"/> <field name="description" nolabel="1" colspan="8"/> </group> diff --git a/addons/base_report_designer/installer.py b/addons/base_report_designer/installer.py index a21b6655af7..7fddc27f037 100644 --- a/addons/base_report_designer/installer.py +++ b/addons/base_report_designer/installer.py @@ -23,7 +23,6 @@ from openerp.osv import fields from openerp.osv import osv import base64 from openerp.tools.translate import _ -from openerp.modules.module import get_module_resource class base_report_designer_installer(osv.osv_memory): _name = 'base_report_designer.installer' @@ -31,13 +30,13 @@ class base_report_designer_installer(osv.osv_memory): def default_get(self, cr, uid, fields, context=None): data = super(base_report_designer_installer, self).default_get(cr, uid, fields, context=context) - plugin_file = open(get_module_resource('base_report_designer','plugin', 'openerp_report_designer.zip'),'rb') - data['plugin_file'] = base64.encodestring(plugin_file.read()) + base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + data['plugin_file'] = base_url + '/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip' return data _columns = { 'name':fields.char('File name', size=34), - 'plugin_file':fields.binary('OpenObject Report Designer Plug-in', readonly=True, help="OpenObject Report Designer plug-in file. Save as this file and install this plug-in in OpenOffice."), + 'plugin_file':fields.char('OpenObject Report Designer Plug-in', size=256, readonly=True, help="OpenObject Report Designer plug-in file. Save as this file and install this plug-in in OpenOffice."), 'description':fields.text('Description', readonly=True) } diff --git a/addons/base_report_designer/plugin/openerp_report_designer.zip b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip Binary files differindex 7d03f45dbb4..7d03f45dbb4 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer.zip +++ b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip diff --git a/addons/base_setup/i18n/nl_BE.po b/addons/base_setup/i18n/nl_BE.po index f22fd2c8adc..518ada07a5c 100644 --- a/addons/base_setup/i18n/nl_BE.po +++ b/addons/base_setup/i18n/nl_BE.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:05+0000\n" -"PO-Revision-Date: 2012-10-01 11:22+0000\n" +"PO-Revision-Date: 2013-04-26 16:24+0000\n" "Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:12+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-27 05:44+0000\n" +"X-Generator: Launchpad (build 16580)\n" #. module: base_setup #: view:sale.config.settings:0 msgid "Emails Integration" -msgstr "" +msgstr "E-mailintegratie" #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -29,18 +29,19 @@ msgstr "Gast" #. module: base_setup #: view:sale.config.settings:0 msgid "Contacts" -msgstr "" +msgstr "Contactpersonen" #. module: base_setup #: model:ir.model,name:base_setup.model_base_config_settings msgid "base.config.settings" -msgstr "" +msgstr "base.config.settings" #. module: base_setup #: field:base.config.settings,module_auth_oauth:0 msgid "" "Use external authentication providers, sign in with google, facebook, ..." msgstr "" +"Gebruik externe verificatieproviders. Meld aan met Google, Facebook, ..." #. module: base_setup #: view:sale.config.settings:0 @@ -54,11 +55,19 @@ msgid "" "OpenERP using specific\n" " plugins for your preferred email application." msgstr "" +"OpenERP maakt het mogelijk om automatisch leads (of andere documenten)\n" +" aan te maken op basis van inkomende e-mails. U " +"kunt automatisch e-mails synchroniseren met OpenERP\n" +" met behulp van reguliere POP / IMAP-accounts, " +"via een direct e-mailintegratiescript voor uw\n" +" e-mailserver, of door zelf uw e-mails naar " +"OpenERP te sturen met behulp van specifieke\n" +" plug-ins voor uw favoriete e-mailprogramma." #. module: base_setup #: field:sale.config.settings,module_sale:0 msgid "SALE" -msgstr "" +msgstr "VERKOOP" #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -68,24 +77,24 @@ msgstr "Lid" #. module: base_setup #: view:base.config.settings:0 msgid "Portal access" -msgstr "" +msgstr "Portaaltoegang" #. module: base_setup #: view:base.config.settings:0 msgid "Authentication" -msgstr "" +msgstr "Verificatie" #. module: base_setup #: view:sale.config.settings:0 msgid "Quotations and Sales Orders" -msgstr "" +msgstr "Offertes en verkooporders" #. module: base_setup #: view:base.config.settings:0 #: model:ir.actions.act_window,name:base_setup.action_general_configuration #: model:ir.ui.menu,name:base_setup.menu_general_configuration msgid "General Settings" -msgstr "" +msgstr "Algemeen" #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -95,12 +104,12 @@ msgstr "Donor" #. module: base_setup #: view:base.config.settings:0 msgid "Email" -msgstr "" +msgstr "E-mail" #. module: base_setup #: field:sale.config.settings,module_crm:0 msgid "CRM" -msgstr "" +msgstr "Relatiebeheer" #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -110,32 +119,32 @@ msgstr "Patiënt" #. module: base_setup #: field:base.config.settings,module_base_import:0 msgid "Allow users to import data from CSV files" -msgstr "" +msgstr "Gebruikers mogen gegevens importeren uit csv-bestanden" #. module: base_setup #: field:base.config.settings,module_multi_company:0 msgid "Manage multiple companies" -msgstr "" +msgstr "Meerdere bedrijven beheren" #. module: base_setup #: view:sale.config.settings:0 msgid "On Mail Client" -msgstr "" +msgstr "Op e-mailclient" #. module: base_setup #: view:base.config.settings:0 msgid "--db-filter=YOUR_DATABAE" -msgstr "" +msgstr "--db-filter=UW_DATABASE" #. module: base_setup #: field:sale.config.settings,module_web_linkedin:0 msgid "Get contacts automatically from linkedIn" -msgstr "" +msgstr "Haal contactpersonen op uit LinkedIn" #. module: base_setup #: field:sale.config.settings,module_plugin_thunderbird:0 msgid "Enable Thunderbird plug-in" -msgstr "" +msgstr "Activeer de Thunderbirdplug-in" #. module: base_setup #: view:base.setup.terminology:0 @@ -145,22 +154,22 @@ msgstr "res_config_contents" #. module: base_setup #: view:sale.config.settings:0 msgid "Customer Features" -msgstr "" +msgstr "Klantenopties" #. module: base_setup #: view:base.config.settings:0 msgid "Import / Export" -msgstr "" +msgstr "Import / Export" #. module: base_setup #: view:sale.config.settings:0 msgid "Sale Features" -msgstr "" +msgstr "Verkoopopties" #. module: base_setup #: field:sale.config.settings,module_plugin_outlook:0 msgid "Enable Outlook plug-in" -msgstr "" +msgstr "Activeer de Outlookplug-in" #. module: base_setup #: view:base.setup.terminology:0 @@ -179,7 +188,7 @@ msgstr "Huurder" #. module: base_setup #: help:base.config.settings,module_share:0 msgid "Share or embbed any screen of openerp." -msgstr "" +msgstr "Gelijk welk scherm van OpenERP delen of insluiten" #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -192,6 +201,8 @@ msgid "" "When you create a new contact (person or company), you will be able to load " "all the data from LinkedIn (photos, address, etc)." msgstr "" +"Als u een nieuwe contactpersoon maakt (persoon of bedrijf), kunt u alle " +"gegevens van LinkedIn laden (foto, adres, enz.)" #. module: base_setup #: help:base.config.settings,module_multi_company:0 @@ -200,6 +211,9 @@ msgid "" "companies.\n" " This installs the module multi_company." msgstr "" +"Werken in omgevingen met meerdere bedrijven, met de nodige " +"toegangsbeveiliging tussen de bedrijven.\n" +" Hiermee installeert u de module multi_company." #. module: base_setup #: view:base.config.settings:0 @@ -208,6 +222,9 @@ msgid "" "You can\n" " launch the OpenERP Server with the option" msgstr "" +"Het openbare portaal is alleen toegankelijk als u zich in een enkele " +"databasemodus bevindt. U kunt\n" +" de OpenERP-server starten met de optie" #. module: base_setup #: view:base.config.settings:0 @@ -215,11 +232,13 @@ msgid "" "You will find more options in your company details: address for the header " "and footer, overdue payments texts, etc." msgstr "" +"U vindt meer opties bij de bedrijfsgegevens: adres voor de kop- en " +"voettekst, teksten voor achterstallige betalingen, enz." #. module: base_setup #: model:ir.model,name:base_setup.model_sale_config_settings msgid "sale.config.settings" -msgstr "" +msgstr "sale.config.settings" #. module: base_setup #: field:base.setup.terminology,partner:0 @@ -238,6 +257,12 @@ msgid "" "projects,\n" " etc." msgstr "" +"Wanneer u een document naar een klant stuurt,\n" +" (offerte, factuur), kan uw klant\n" +" aanmelden en zijn documenten bekijken,\n" +" uw bedrijfsnieuws lezen, zijn projecten " +"controleren,\n" +" enz." #. module: base_setup #: model:ir.model,name:base_setup.model_base_setup_terminology @@ -253,6 +278,8 @@ msgstr "Cliënt" #: help:base.config.settings,module_portal_anonymous:0 msgid "Enable the public part of openerp, openerp becomes a public website." msgstr "" +"Activeer het openbare deel van OpenERP; OpenERP wordt hiermee een openbare " +"website." #. module: base_setup #: help:sale.config.settings,module_plugin_thunderbird:0 @@ -265,6 +292,13 @@ msgid "" " Partner from the selected emails.\n" " This installs the module plugin_thunderbird." msgstr "" +"Met de plug-in kunt u e-mails met bijlagen koppelen aan de geselecteerde\n" +" OpenERP-objecten. U kunt een relatie of een lead kiezen en\n" +" de gekozen e-mail koppelen als een .eml-bestand als bijlage\n" +" aan het geselecteerde record. U kunt documenten aanmaken " +"voor CRM-lead\n" +" en relaties vanuit de geselecteerde e-mails. Hiermee " +"installeert u de module plugin_thunderbird." #. module: base_setup #: selection:base.setup.terminology,partner:0 @@ -280,7 +314,7 @@ msgstr "Gebruik een andere benaming voor Klant" #: model:ir.actions.act_window,name:base_setup.action_sale_config #: view:sale.config.settings:0 msgid "Configure Sales" -msgstr "" +msgstr "Verkoop instellen" #. module: base_setup #: help:sale.config.settings,module_plugin_outlook:0 @@ -293,16 +327,23 @@ msgid "" " email into an OpenERP mail message with attachments.\n" " This installs the module plugin_outlook." msgstr "" +"Met de Outlookplug-in kunt u een object selecteren dat u wilt toevoegen\n" +" aan uw e-mail en de bijlagen van MS Outlook. U kunt een " +"relatie \n" +" of een lead kiezen en de geselecteerde e-mail archiveren in " +"een\n" +" OpenERP-mailbericht met bijlagen.\n" +" Hiermee installeert u de module plugin_outlook." #. module: base_setup #: view:base.config.settings:0 msgid "Options" -msgstr "" +msgstr "Opties" #. module: base_setup #: field:base.config.settings,module_portal:0 msgid "Activate the customer portal" -msgstr "" +msgstr "Klantenportaal activeren" #. module: base_setup #: view:base.config.settings:0 @@ -311,36 +352,37 @@ msgid "" " Once activated, the login page will be " "replaced by the public website." msgstr "" +"Na activering zal de aanmeldpagina worden vervangen door de openbare website." #. module: base_setup #: field:base.config.settings,module_share:0 msgid "Allow documents sharing" -msgstr "" +msgstr "Sta het delen van documenten toe" #. module: base_setup #: view:base.config.settings:0 msgid "(company news, jobs, contact form, etc.)" -msgstr "" +msgstr "(bedrijfsnieuws, vacatures, contactformulier, enz.)" #. module: base_setup #: field:base.config.settings,module_portal_anonymous:0 msgid "Activate the public portal" -msgstr "" +msgstr "Openbare portaal activeren" #. module: base_setup #: view:base.config.settings:0 msgid "Configure outgoing email servers" -msgstr "" +msgstr "Uitgaande e-mailservers instellen" #. module: base_setup #: view:sale.config.settings:0 msgid "Social Network Integration" -msgstr "" +msgstr "Integratie sociale netwerken" #. module: base_setup #: help:base.config.settings,module_portal:0 msgid "Give your customers access to their documents." -msgstr "" +msgstr "Geef uw klanten toegang tot hun documenten." #. module: base_setup #: view:base.config.settings:0 @@ -352,7 +394,7 @@ msgstr "Afbreken" #: view:base.config.settings:0 #: view:sale.config.settings:0 msgid "Apply" -msgstr "" +msgstr "Toepassen" #. module: base_setup #: view:base.setup.terminology:0 @@ -363,12 +405,12 @@ msgstr "Kies uw terminologie" #: view:base.config.settings:0 #: view:sale.config.settings:0 msgid "or" -msgstr "" +msgstr "of" #. module: base_setup #: view:base.config.settings:0 msgid "Configure your company data" -msgstr "" +msgstr "Uw bedrijfsgegevens instellen" #~ msgid "Logo" #~ msgstr "Logo" diff --git a/addons/base_status/i18n/lt.po b/addons/base_status/i18n/lt.po new file mode 100644 index 00000000000..cdaf9b0db37 --- /dev/null +++ b/addons/base_status/i18n/lt.po @@ -0,0 +1,76 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:17+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: base_status +#: code:addons/base_status/base_state.py:107 +#, python-format +msgid "Error !" +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:166 +#, python-format +msgid "%s has been <b>opened</b>." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:199 +#, python-format +msgid "%s has been <b>renewed</b>." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_stage.py:210 +#, python-format +msgid "Error!" +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:107 +#, python-format +msgid "" +"You can not escalate, you are already at the top level regarding your sales-" +"team category." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:193 +#, python-format +msgid "%s is now <b>pending</b>." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:187 +#, python-format +msgid "%s has been <b>canceled</b>." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_stage.py:210 +#, python-format +msgid "" +"You are already at the top level of your sales-team category.\n" +"Therefore you cannot escalate furthermore." +msgstr "" + +#. module: base_status +#: code:addons/base_status/base_state.py:181 +#, python-format +msgid "%s has been <b>closed</b>." +msgstr "" diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py index cfb2dbd04d0..e7501334997 100644 --- a/addons/base_vat/base_vat.py +++ b/addons/base_vat/base_vat.py @@ -134,6 +134,9 @@ class res_partner(osv.osv): 'vat_subjected': fields.boolean('VAT Legal Statement', help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.") } + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['vat_subjected'] + def _construct_constraint_msg(self, cr, uid, ids, context=None): def default_vat_check(cn, vn): # by default, a VAT number is valid if: diff --git a/addons/contacts/i18n/lt.po b/addons/contacts/i18n/lt.po new file mode 100644 index 00000000000..f785a308009 --- /dev/null +++ b/addons/contacts/i18n/lt.po @@ -0,0 +1,45 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:20+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: contacts +#: model:ir.actions.act_window,help:contacts.action_contacts +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to add a contact in your address book.\n" +" </p><p>\n" +" OpenERP helps you easily track all activities related to\n" +" a customer; discussions, history of business opportunities,\n" +" documents, etc.\n" +" </p>\n" +" " +msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +"Spauskite, kad sukurtumėte kontaktą adresų knygoje.\n" +"</p><p>\n" +"OpenERP pagalba galima stebėti visus veiksmus susijusius su\n" +"kontaktu; bendravimas, pardavimų galimybių istorija,\n" +"dokumentai, ir t.t.\n" +"</p>\n" +" " + +#. module: contacts +#: model:ir.actions.act_window,name:contacts.action_contacts +#: model:ir.ui.menu,name:contacts.menu_contacts +msgid "Contacts" +msgstr "Kontaktai" diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py index d78fb09eae7..4e3a704d5f3 100644 --- a/addons/crm/__init__.py +++ b/addons/crm/__init__.py @@ -28,6 +28,7 @@ import report import wizard import res_partner import res_config +import base_partner_merge # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 072624a7d98..8e17a882076 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -97,6 +97,7 @@ Dashboard for CRM will include: 'board_crm_view.xml', 'res_config_view.xml', + 'base_partner_merge_view.xml', ], 'demo': [ 'crm_demo.xml', diff --git a/addons/crm/base_partner_merge.py b/addons/crm/base_partner_merge.py new file mode 100644 index 00000000000..b2645e7fb79 --- /dev/null +++ b/addons/crm/base_partner_merge.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python +from __future__ import absolute_import +from email.utils import parseaddr +import functools +import htmlentitydefs +import itertools +import logging +import operator +import re +from ast import literal_eval +from openerp.tools import mute_logger + +# Validation Library https://pypi.python.org/pypi/validate_email/1.1 +from .validate_email import validate_email + +from openerp.osv import osv, orm +from openerp.osv import fields +from openerp.osv.orm import browse_record +from openerp.tools.translate import _ + +pattern = re.compile("&(\w+?);") + +_logger = logging.getLogger('base.partner.merge') + + +# http://www.php2python.com/wiki/function.html-entity-decode/ +def html_entity_decode_char(m, defs=htmlentitydefs.entitydefs): + try: + return defs[m.group(1)] + except KeyError: + return m.group(0) + + +def html_entity_decode(string): + return pattern.sub(html_entity_decode_char, string) + + +def sanitize_email(email): + assert isinstance(email, basestring) and email + + result = re.subn(r';|/|:', ',', + html_entity_decode(email or ''))[0].split(',') + + emails = [parseaddr(email)[1] + for item in result + for email in item.split()] + + return [email.lower() + for email in emails + if validate_email(email)] + + +def is_integer_list(ids): + return all(isinstance(i, (int, long)) for i in ids) + + +class ResPartner(osv.Model): + _inherit = 'res.partner' + + _columns = { + 'id': fields.integer('Id', readonly=True), + 'create_date': fields.datetime('Create Date', readonly=True), + } + +class MergePartnerLine(osv.TransientModel): + _name = 'base.partner.merge.line' + + _columns = { + 'wizard_id': fields.many2one('base.partner.merge.automatic.wizard', + 'Wizard'), + 'min_id': fields.integer('MinID'), + 'aggr_ids': fields.char('Ids', required=True), + } + + _order = 'min_id asc' + + +class MergePartnerAutomatic(osv.TransientModel): + """ + The idea behind this wizard is to create a list of potential partners to + merge. We use two objects, the first one is the wizard for the end-user. + And the second will contain the partner list to merge. + """ + _name = 'base.partner.merge.automatic.wizard' + + _columns = { + # Group by + 'group_by_email': fields.boolean('Email'), + 'group_by_name': fields.boolean('Name'), + 'group_by_is_company': fields.boolean('Is Company'), + 'group_by_vat': fields.boolean('VAT'), + 'group_by_parent_id': fields.boolean('Parent Company'), + + 'state': fields.selection([('option', 'Option'), + ('selection', 'Selection'), + ('finished', 'Finished')], + 'State', + readonly=True, + required=True), + 'number_group': fields.integer("Group of Contacts", readonly=True), + 'current_line_id': fields.many2one('base.partner.merge.line', 'Current Line'), + 'line_ids': fields.one2many('base.partner.merge.line', 'wizard_id', 'Lines'), + 'partner_ids': fields.many2many('res.partner', string='Contacts'), + + 'exclude_contact': fields.boolean('A user associated to the contact'), + 'exclude_journal_item': fields.boolean('Journal Items associated to the contact'), + 'maximum_group': fields.integer("Maximum of Group of Contacts"), + } + + _defaults = { + 'state': 'option', + } + + def get_fk_on(self, cr, table): + q = """ SELECT cl1.relname as table, + att1.attname as column + FROM pg_constraint as con, pg_class as cl1, pg_class as cl2, + pg_attribute as att1, pg_attribute as att2 + WHERE con.conrelid = cl1.oid + AND con.confrelid = cl2.oid + AND array_lower(con.conkey, 1) = 1 + AND con.conkey[1] = att1.attnum + AND att1.attrelid = cl1.oid + AND cl2.relname = %s + AND att2.attname = 'id' + AND array_lower(con.confkey, 1) = 1 + AND con.confkey[1] = att2.attnum + AND att2.attrelid = cl2.oid + AND con.contype = 'f' + """ + return cr.execute(q, (table,)) + + def _update_foreign_keys(self, cr, uid, src_partners, dst_partner, context=None): + _logger.debug('_update_foreign_keys for dst_partner: %s for src_partners: %r', dst_partner.id, list(map(operator.attrgetter('id'), src_partners))) + + # find the many2one relation to a partner + proxy = self.pool.get('res.partner') + self.get_fk_on(cr, 'res_partner') + + # ignore two tables + + for table, column in cr.fetchall(): + if 'base_partner_merge_' in table: + continue + partner_ids = tuple(map(int, src_partners)) + + query = "SELECT column_name FROM information_schema.columns WHERE table_name LIKE '%s'" % (table) + cr.execute(query, ()) + columns = [] + for data in cr.fetchall(): + if data[0] != column: + columns.append(data[0]) + + query_dic = { + 'table': table, + 'column': column, + 'value': columns[0], + } + if len(columns) <= 1: + # unique key treated + query = """ + UPDATE "%(table)s" as ___tu + SET %(column)s = %%s + WHERE + %(column)s = %%s AND + NOT EXISTS ( + SELECT 1 + FROM "%(table)s" as ___tw + WHERE + %(column)s = %%s AND + ___tu.%(value)s = ___tw.%(value)s + )""" % query_dic + for partner_id in partner_ids: + cr.execute(query, (dst_partner.id, partner_id, dst_partner.id)) + else: + cr.execute("SAVEPOINT recursive_partner_savepoint") + try: + query = 'UPDATE "%(table)s" SET %(column)s = %%s WHERE %(column)s IN %%s' % query_dic + cr.execute(query, (dst_partner.id, partner_ids,)) + + if column == proxy._parent_name and table == 'res_partner': + query = """ + WITH RECURSIVE cycle(id, parent_id) AS ( + SELECT id, parent_id FROM res_partner + UNION + SELECT cycle.id, res_partner.parent_id + FROM res_partner, cycle + WHERE res_partner.id = cycle.parent_id AND + cycle.id != cycle.parent_id + ) + SELECT id FROM cycle WHERE id = parent_id AND id = %s + """ + cr.execute(query, (dst_partner.id,)) + if cr.fetchall(): + cr.execute("ROLLBACK TO SAVEPOINT recursive_partner_savepoint") + finally: + cr.execute("RELEASE SAVEPOINT recursive_partner_savepoint") + + def _update_reference_fields(self, cr, uid, src_partners, dst_partner, context=None): + _logger.debug('_update_reference_fields for dst_partner: %s for src_partners: %r', dst_partner.id, list(map(operator.attrgetter('id'), src_partners))) + + def update_records(model, src, field_model='model', field_id='res_id', context=None): + proxy = self.pool.get(model) + if proxy is None: + return + domain = [(field_model, '=', 'res.partner'), (field_id, '=', src.id)] + ids = proxy.search(cr, uid, domain, context=context) + return proxy.write(cr, uid, ids, {field_id: dst_partner.id}, context=context) + + update_records = functools.partial(update_records, context=context) + + for partner in src_partners: + update_records('base.calendar', src=partner, field_model='model_id.model') + update_records('ir.attachment', src=partner, field_model='res_model') + update_records('mail.followers', src=partner, field_model='res_model') + update_records('mail.message', src=partner) + update_records('marketing.campaign.workitem', src=partner, field_model='object_id.model') + update_records('ir.model.data', src=partner) + + proxy = self.pool['ir.model.fields'] + domain = [('ttype', '=', 'reference')] + record_ids = proxy.search(cr, uid, domain, context=context) + + for record in proxy.browse(cr, uid, record_ids, context=context): + proxy_model = self.pool[record.model] + + field_type = proxy_model._columns.get(record.name).__class__._type + + if field_type == 'function': + continue + + for partner in src_partners: + domain = [ + (record.name, '=', 'res.partner,%d' % partner.id) + ] + model_ids = proxy_model.search(cr, uid, domain, context=context) + values = { + record.name: 'res.partner,%d' % dst_partner.id, + } + proxy_model.write(cr, uid, model_ids, values, context=context) + + def _update_values(self, cr, uid, src_partners, dst_partner, context=None): + _logger.debug('_update_values for dst_partner: %s for src_partners: %r', dst_partner.id, list(map(operator.attrgetter('id'), src_partners))) + + columns = dst_partner._columns + def write_serializer(column, item): + if isinstance(item, browse_record): + return item.id + else: + return item + + values = dict() + for column, field in columns.iteritems(): + if field._type not in ('many2many', 'one2many', 'function'): + for item in itertools.chain(src_partners, [dst_partner]): + if item[column]: + values[column] = write_serializer(column, item[column]) + + values.pop('id', None) + parent_id = values.pop('parent_id', None) + dst_partner.write(values) + if parent_id and parent_id != dst_partner.id: + try: + dst_partner.write({'parent_id': parent_id}) + except (osv.except_osv, orm.except_orm): + _logger.info('Skip recursive partner hierarchies for parent_id %s of partner: %s', parent_id, dst_partner.id) + + @mute_logger('openerp.osv.expression', 'openerp.osv.orm') + def _merge(self, cr, uid, partner_ids, context=None): + proxy = self.pool.get('res.partner') + + partner_ids = proxy.exists(cr, uid, list(partner_ids), context=context) + if len(partner_ids) < 2: + return + + partners = proxy.browse(cr, uid, list(partner_ids), context=context) + ordered_partners = sorted(sorted(partners, + key=operator.attrgetter('create_date'), reverse=True), + key=operator.attrgetter('active'), reverse=True) + + dst_partner = ordered_partners[-1] + src_partners = ordered_partners[:-1] + _logger.info("dst_partner: %s", dst_partner.id) + + call_it = lambda function: function(cr, uid, src_partners, dst_partner, + context=context) + + call_it(self._update_foreign_keys) + call_it(self._update_reference_fields) + call_it(self._update_values) + + _logger.info("---merged---") + + for partner in src_partners: + partner.unlink() + + + def clean_emails(self, cr, uid, context=None): + """ + Clean the email address of the partner, if there is an email field with + a mimum of two addresses, the system will create a new partner, with the + information of the previous one and will copy the new cleaned email into + the email field. + """ + if context is None: + context = {} + + proxy_model = self.pool['ir.model.fields'] + field_ids = proxy_model.search(cr, uid, [('model', '=', 'res.partner'), + ('ttype', 'like', '%2many')], + context=context) + fields = proxy_model.read(cr, uid, field_ids, context=context) + reset_fields = dict((field['name'], []) for field in fields) + + proxy_partner = self.pool['res.partner'] + context['active_test'] = False + ids = proxy_partner.search(cr, uid, [], context=context) + + fields = ['name', 'var' 'partner_id' 'is_company', 'email'] + partners = proxy_partner.read(cr, uid, ids, fields, context=context) + + partners.sort(key=operator.itemgetter('id')) + partners_len = len(partners) + + _logger.info('partner_len: %r', partners_len) + + for idx, partner in enumerate(partners): + if not partner['email']: + continue + + percent = (idx / float(partners_len)) * 100.0 + _logger.info('idx: %r', idx) + _logger.info('percent: %r', percent) + try: + emails = sanitize_email(partner['email']) + head, tail = emails[:1], emails[1:] + email = head[0] if head else False + + proxy_partner.write(cr, uid, [partner['id']], + {'email': email}, context=context) + + for email in tail: + values = dict(reset_fields, email=email) + proxy_partner.copy(cr, uid, partner['id'], values, + context=context) + + except Exception: + _logger.exception("There is a problem with this partner: %r", partner) + raise + return True + + def close_cb(self, cr, uid, ids, context=None): + return {'type': 'ir.actions.act_window_close'} + + def _generate_query(self, fields, maximum_group=100): + group_fields = ', '.join(fields) + + filters = [] + for field in fields: + if field in ['email', 'name']: + filters.append((field, 'IS NOT', 'NULL')) + + criteria = ' AND '.join('%s %s %s' % (field, operator, value) + for field, operator, value in filters) + + text = [ + "SELECT min(id), array_agg(id)", + "FROM res_partner", + ] + + if criteria: + text.append('WHERE %s' % criteria) + + text.extend([ + "GROUP BY %s" % group_fields, + "HAVING COUNT(*) >= 2", + "ORDER BY min(id)", + ]) + + if maximum_group: + text.extend([ + "LIMIT %s" % maximum_group, + ]) + + return ' '.join(text) + + def _compute_selected_groupby(self, this): + group_by_str = 'group_by_' + group_by_len = len(group_by_str) + + fields = [ + key[group_by_len:] + for key in self._columns.keys() + if key.startswith(group_by_str) + ] + + groups = [ + field + for field in fields + if getattr(this, '%s%s' % (group_by_str, field), False) + ] + + if not groups: + raise osv.except_osv(_('Error'), + _("You have to specify a filter for your selection")) + + return groups + + def next_cb(self, cr, uid, ids, context=None): + """ + Don't compute any thing + """ + context = dict(context or {}, active_test=False) + this = self.browse(cr, uid, ids[0], context=context) + if this.current_line_id: + this.current_line_id.unlink() + return self._next_screen(this) + + def _next_screen(self, this): + this.refresh() + values = {} + if this.line_ids: + # in this case, we try to find the next record. + current_line = this.line_ids[0] + current_partner_ids = literal_eval(current_line.aggr_ids) + values.update({ + 'current_line_id': current_line.id, + 'partner_ids': [(6, 0, current_partner_ids)], + 'state': 'selection', + }) + else: + values.update({ + 'current_line_id': False, + 'partner_ids': [], + 'state': 'finished', + }) + + this.write(values) + + return { + 'type': 'ir.actions.act_window', + 'res_model': this._name, + 'res_id': this.id, + 'view_mode': 'form', + 'target': 'new', + } + + def _model_is_installed(self, cr, uid, model, context=None): + proxy = self.pool.get('ir.model') + domain = [('model', '=', model)] + return proxy.search_count(cr, uid, domain, context=context) > 0 + + def _partner_use_in(self, cr, uid, aggr_ids, models, context=None): + """ + Check if there is no occurence of this group of partner in the selected + model + """ + for model, field in models.iteritems(): + proxy = self.pool.get(model) + domain = [(field, 'in', aggr_ids)] + if proxy.search_count(cr, uid, domain, context=context): + return True + return False + + def compute_models(self, cr, uid, ids, context=None): + """ + Compute the different models needed by the system if you want to exclude + some partners. + """ + assert is_integer_list(ids) + + this = self.browse(cr, uid, ids[0], context=context) + + models = {} + if this.exclude_contact: + models['res.users'] = 'partner_id' + + if self._model_is_installed(cr, uid, 'account.move.line', context=context) and this.exclude_journal_item: + models['account.move.line'] = 'partner_id' + + return models + + def _process_query(self, cr, uid, ids, query, context=None): + """ + Execute the select request and write the result in this wizard + """ + proxy = self.pool.get('base.partner.merge.line') + this = self.browse(cr, uid, ids[0], context=context) + models = self.compute_models(cr, uid, ids, context=context) + cr.execute(query) + + counter = 0 + for min_id, aggr_ids in cr.fetchall(): + if models and self._partner_use_in(cr, uid, aggr_ids, models, context=context): + continue + values = { + 'wizard_id': this.id, + 'min_id': min_id, + 'aggr_ids': aggr_ids, + } + + proxy.create(cr, uid, values, context=context) + counter += 1 + + values = { + 'state': 'selection', + 'number_group': counter, + } + + this.write(values) + + _logger.info("counter: %s", counter) + + def start_process_cb(self, cr, uid, ids, context=None): + """ + Start the process. + * Compute the selected groups (with duplication) + * If the user has selected the 'exclude_XXX' fields, avoid the partners. + """ + assert is_integer_list(ids) + + context = dict(context or {}, active_test=False) + this = self.browse(cr, uid, ids[0], context=context) + groups = self._compute_selected_groupby(this) + query = self._generate_query(groups, this.maximum_group) + self._process_query(cr, uid, ids, query, context=context) + + return self._next_screen(this) + + def automatic_process_cb(self, cr, uid, ids, context=None): + assert is_integer_list(ids) + this = self.browse(cr, uid, ids[0], context=context) + this.start_process_cb() + this.refresh() + + for line in this.line_ids: + partner_ids = literal_eval(line.aggr_ids) + self._merge(cr, uid, partner_ids, context=context) + line.unlink() + cr.commit() + + this.write({'state': 'finished'}) + return { + 'type': 'ir.actions.act_window', + 'res_model': this._name, + 'res_id': this.id, + 'view_mode': 'form', + 'target': 'new', + } + + def parent_migration_process_cb(self, cr, uid, ids, context=None): + assert is_integer_list(ids) + + context = dict(context or {}, active_test=False) + this = self.browse(cr, uid, ids[0], context=context) + + query = """ + SELECT + min(p1.id), + array_agg(DISTINCT p1.id) + FROM + res_partner as p1 + INNER join + res_partner as p2 + ON + p1.email = p2.email AND + p1.name = p2.name AND + (p1.parent_id = p2.id OR p1.id = p2.parent_id) + WHERE + p2.id IS NOT NULL + GROUP BY + p1.email, + p1.name, + CASE WHEN p1.parent_id = p2.id THEN p2.id + ELSE p1.id + END + HAVING COUNT(*) >= 2 + ORDER BY + min(p1.id) + """ + + self._process_query(cr, uid, ids, query, context=context) + + for line in this.line_ids: + partner_ids = literal_eval(line.aggr_ids) + self._merge(cr, uid, partner_ids, context=context) + line.unlink() + cr.commit() + + this.write({'state': 'finished'}) + + cr.execute(""" + UPDATE + res_partner + SET + is_company = NULL, + parent_id = NULL + WHERE + parent_id = id + """) + + return { + 'type': 'ir.actions.act_window', + 'res_model': this._name, + 'res_id': this.id, + 'view_mode': 'form', + 'target': 'new', + } + + def update_all_process_cb(self, cr, uid, ids, context=None): + assert is_integer_list(ids) + + # WITH RECURSIVE cycle(id, parent_id) AS ( + # SELECT id, parent_id FROM res_partner + # UNION + # SELECT cycle.id, res_partner.parent_id + # FROM res_partner, cycle + # WHERE res_partner.id = cycle.parent_id AND + # cycle.id != cycle.parent_id + # ) + # UPDATE res_partner + # SET parent_id = NULL + # WHERE id in (SELECT id FROM cycle WHERE id = parent_id); + + this = self.browse(cr, uid, ids[0], context=context) + + self.parent_migration_process_cb(cr, uid, ids, context=None) + + list_merge = [ + {'group_by_vat': True, 'group_by_email': True, 'group_by_name': True}, + # {'group_by_name': True, 'group_by_is_company': True, 'group_by_parent_id': True}, + # {'group_by_email': True, 'group_by_is_company': True, 'group_by_parent_id': True}, + # {'group_by_name': True, 'group_by_vat': True, 'group_by_is_company': True, 'exclude_journal_item': True}, + # {'group_by_email': True, 'group_by_vat': True, 'group_by_is_company': True, 'exclude_journal_item': True}, + # {'group_by_email': True, 'group_by_is_company': True, 'exclude_contact': True, 'exclude_journal_item': True}, + # {'group_by_name': True, 'group_by_is_company': True, 'exclude_contact': True, 'exclude_journal_item': True} + ] + + for merge_value in list_merge: + id = self.create(cr, uid, merge_value, context=context) + self.automatic_process_cb(cr, uid, [id], context=context) + + cr.execute(""" + UPDATE + res_partner + SET + is_company = NULL + WHERE + parent_id IS NOT NULL AND + is_company IS NOT NULL + """) + + # cr.execute(""" + # UPDATE + # res_partner as p1 + # SET + # is_company = NULL, + # parent_id = ( + # SELECT p2.id + # FROM res_partner as p2 + # WHERE p2.email = p1.email AND + # p2.parent_id != p2.id + # LIMIT 1 + # ) + # WHERE + # p1.parent_id = p1.id + # """) + + return self._next_screen(this) + + def merge_cb(self, cr, uid, ids, context=None): + assert is_integer_list(ids) + + context = dict(context or {}, active_test=False) + this = self.browse(cr, uid, ids[0], context=context) + + partner_ids = set(map(int, this.partner_ids)) + if not partner_ids: + this.write({'state': 'finished'}) + return { + 'type': 'ir.actions.act_window', + 'res_model': this._name, + 'res_id': this.id, + 'view_mode': 'form', + 'target': 'new', + } + + self._merge(cr, uid, partner_ids, context=context) + + this.current_line_id.unlink() + + return self._next_screen(this) + + def merge_multi(self, cr, uid, ids, context=None): + + active_model = context.get('active_model') + if active_model != 'res.partner': + raise osv.except_osv( + _('Error'), + _('This wizard can only used with the Partners') + ) + + partner_ids = context.get('active_ids', []) + + MINIMAL_NUMBER = 2 + if len(partner_ids) < MINIMAL_NUMBER: + raise osv.except_osv( + _('Error'), + _("You can't use this wizard with only one Partner") + ) + + self._merge(cr, uid, partner_ids, context=context) + + return True + + def auto_set_parent_id(self, cr, uid, ids, context=None): + assert is_integer_list(ids) + + # select partner who have one least invoice + partner_treated = ['@gmail.com'] + cr.execute(""" SELECT p.id, p.email + FROM res_partner as p + LEFT JOIN account_invoice as a + ON p.id = a.partner_id AND a.state in ('open','paid') + WHERE p.grade_id is NOT NULL + GROUP BY p.id + ORDER BY COUNT(a.id) DESC + """) + re_email = re.compile(r".*@") + for id, email in cr.fetchall(): + # check email domain + email = re_email.sub("@", email or "") + if not email or email in partner_treated: + continue + partner_treated.append(email) + + # don't update the partners if they are more of one who have invoice + cr.execute(""" SELECT * + FROM res_partner as p + WHERE p.id != %s AND p.email LIKE '%%%s' AND + EXISTS (SELECT * FROM account_invoice as a WHERE p.id = a.partner_id AND a.state in ('open','paid')) + """ % (id, email)) + + if len(cr.fetchall()) > 1: + _logger.info("%s MORE OF ONE COMPANY", email) + continue + + # to display changed values + cr.execute(""" SELECT id,email + FROM res_partner + WHERE parent_id != %s AND id != %s AND email LIKE '%%%s' + """ % (id, id, email)) + _logger.info("%r", cr.fetchall()) + + # upgrade + cr.execute(""" UPDATE res_partner + SET parent_id = %s + WHERE id != %s AND email LIKE '%%%s' + """ % (id, id, email)) + return False diff --git a/addons/crm/base_partner_merge_view.xml b/addons/crm/base_partner_merge_view.xml new file mode 100644 index 00000000000..74e7a72d7a8 --- /dev/null +++ b/addons/crm/base_partner_merge_view.xml @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + <!-- the sequence of the configuration sub menu is 30 --> + <menuitem id='root_menu' name='Tools' parent='base.menu_base_partner' sequence="25"/> + + <record model="ir.actions.act_window" id="base_partner_merge_automatic_act"> + <field name="name">Deduplicate Contacts</field> + <field name="res_model">base.partner.merge.automatic.wizard</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + <field name="context">{'active_test': False}</field> + </record> + + <menuitem id='partner_merge_automatic_menu' + action='base_partner_merge_automatic_act' + groups='base.group_system' + parent='root_menu' /> + + <record model='ir.ui.view' id='base_partner_merge_automatic_wizard_form'> + <field name='name'>base.partner.merge.automatic.wizard.form</field> + <field name='model'>base.partner.merge.automatic.wizard</field> + <field name='arch' type='xml'> + <form string='Automatic Merge Wizard' version='7.0'> + <header> + <button name='merge_cb' string='Merge Selection' + class='oe_highlight' + type='object' + attrs="{'invisible': [('state', 'in', ('option', 'finished' ))]}" + /> + <button name='next_cb' string='Skip these contacts' + type='object' class='oe_link' + attrs="{'invisible': [('state', '!=', 'selection')]}" /> + <button name='start_process_cb' + string='Merge with Manual Check' + type='object' class='oe_highlight' + attrs="{'invisible': [('state', '!=', 'option')]}" /> + <button name='automatic_process_cb' + string='Merge Automatically' + type='object' class='oe_highlight' + confirm="Are you sure to execute the automatic merge of your contacts ?" + attrs="{'invisible': [('state', '!=', 'option')]}" /> + <button name='update_all_process_cb' + string='Merge Automatically all process' + type='object' + confirm="Are you sure to execute the list of automatic merges of your contacts ?" + attrs="{'invisible': [('state', '!=', 'option')]}" /> + <span class="or_cancel" attrs="{'invisible': [('state', '=', 'finished')]} ">or + <button name="close_cb" special="nosave" string="Cancel" type="object" class="oe_link oe_inline"/> + </span> + <span class="or_cancel" attrs="{'invisible': [('state', '!=', 'finished')]} "> + <button name="close_cb" special="nosave" + string="Close" + type="object" + class="oe_link oe_inline"/> + </span> + </header> + <sheet> + <group attrs="{'invisible': [('state', '!=', 'finished')]}" col="1"> + <h2>There is no more contacts to merge for this request...</h2> + <button name="%(base_partner_merge_automatic_act)d" string="Deduplicate the other Contacts" class="oe_highlight" + type="action"/> + </group> + <p class="oe_grey" attrs="{'invisible': [('state', '!=', ('option'))]}"> + Select the list of fields used to search for + duplicated records. If you select several fields, + OpenERP will propose you to merge only those having + all these fields in common. (not one of the fields). + </p> + <group attrs="{'invisible': [('state', 'not in', ('selection', 'finished'))]}"> + <field name="state" invisible="1" /> + <field name="number_group" invisible="0" /> + </group> + <group string="Search duplicates based on duplicated data in" + attrs="{'invisible': [('state', 'not in', ('option',))]}"> + <field name='group_by_email' /> + <field name='group_by_name' /> + <field name='group_by_is_company' /> + <field name='group_by_vat' /> + <field name='group_by_parent_id' /> + </group> + <group string="Exclude contacts having" + attrs="{'invisible': [('state', 'not in', ('option',))]}"> + <field name='exclude_contact' /> + <field name='exclude_journal_item' /> + </group> + <separator string="Options" attrs="{'invisible': [('state', 'not in', ('option',))]}"/> + <group attrs="{'invisible': [('state', 'not in', ('option','finished'))]}"> + <field name='maximum_group' attrs="{'readonly': [('state', 'in', ('finished'))]}"/> + </group> + <separator string="Merge the following contacts" + attrs="{'invisible': [('state', 'in', ('option', 'finished'))]}"/> + <group attrs="{'invisible': [('state', 'in', ('option', 'finished'))]}" col="1"> + <p class="oe_grey"> + The selected contacts will be merged together. All + documents linking to one of these contacts will be + redirected to the aggregated contact. You can remove + contacts from this list to avoid merging them. + </p> + <field name="partner_ids" nolabel="1"> + <tree string="Partners"> + <field name="id" /> + <field name="name" /> + <field name="email" /> + <field name="is_company" /> + <field name="vat" /> + <field name="country_id" /> + <field name="parent_id" /> + </tree> + </field> + </group> + </sheet> + </form> + </field> + </record> + + <record model="ir.actions.server" + id="ir_actions_server_merge_automatic"> + <field name="code">pool.get('base.partner.merge.automatic.wizard').merge_multi(cr, uid, None, context)</field> + <field name="condition">True</field> + <field name="model_id" ref="base.model_res_partner" /> + <field name="name">Automatic Merge</field> + <field name="sequence" eval="5" /> + <field name="state">code</field> + <field name="type">ir.actions.server</field> + </record> + + <record model="ir.values" id="ir_open_merge_automatic"> + <field name="key2" eval="'client_action_multi'" /> + <field name="model">res.partner</field> + <field name="name">Automatic Merge</field> + <field name="value" eval="'ir.actions.server,%d' % ir_actions_server_merge_automatic" /> + </record> + + </data> + +</openerp> diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 2361f12d61b..61e8c75cea8 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -1053,6 +1053,14 @@ class crm_lead(base_stage, format_address, osv.osv): message = _("%s a call for %s.%s") % (prefix, phonecall.date, suffix) return self.message_post(cr, uid, ids, body=message, context=context) + def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): + if not duration: + duration = _('unknown') + else: + duration = str(duration) + message = _("Meeting scheduled at '%s'<br> Subject: %s <br> Duration: %s hour(s)") % (meeting_date, meeting_subject, duration) + return self.message_post(cr, uid, ids, body=message, context=context) + def onchange_state(self, cr, uid, ids, state_id, context=None): if state_id: country_id=self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index d94683f895f..8c22a0a2e1c 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -330,7 +330,7 @@ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/> <field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/> <field name="user_id"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="create_date"/> <field name="country_id" context="{'invisible_country': False}"/> <separator/> @@ -548,7 +548,7 @@ <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/> <field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/> <field name="user_id"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <separator/> <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/> <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/> diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 14b69ed0e11..c31907bebe2 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -34,6 +34,13 @@ class crm_meeting(osv.Model): 'opportunity_id': fields.many2one ('crm.lead', 'Opportunity', domain="[('type', '=', 'opportunity')]"), } + def create(self, cr, uid, vals, context=None): + res = super(crm_meeting, self).create(cr, uid, vals, context=context) + obj = self.browse(cr, uid, res, context=context) + if obj.opportunity_id: + self.pool.get('crm.lead').log_meeting(cr, uid, [obj.opportunity_id.id], obj.name, obj.date, obj.duration, context=context) + return res + class calendar_attendee(osv.osv): """ Calendar Attendee """ diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index 3efb54f98b8..6c1b31180be 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -186,7 +186,7 @@ <separator/> <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]" help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="user_id"/> <field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/> diff --git a/addons/crm/i18n/nl_BE.po b/addons/crm/i18n/nl_BE.po index 697c7c4f083..a22d1f605a6 100644 --- a/addons/crm/i18n/nl_BE.po +++ b/addons/crm/i18n/nl_BE.po @@ -1,20 +1,20 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: # * crm -# Els Van Vossel <evv@agaplan.eu>, 2012. +# Els Van Vossel <evv@agaplan.eu>, 2012, 2013. msgid "" msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-10-02 07:29+0000\n" +"PO-Revision-Date: 2013-04-26 23:39+0000\n" "Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n" "Language-Team: Els Van Vossel\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:09+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-27 05:44+0000\n" +"X-Generator: Launchpad (build 16580)\n" "Language: nl\n" #. module: crm @@ -28,6 +28,8 @@ msgid "" "Allows you to configure your incoming mail server, and create leads from " "incoming emails." msgstr "" +"Hiermee kunt u de inkomende mailserver instellen en leads laten maken van " +"binnenkomende e-mails." #. module: crm #: code:addons/crm/crm_lead.py:881 @@ -76,7 +78,7 @@ msgstr "Opportuniteiten kiezen" #: model:res.groups,name:crm.group_fund_raising #: field:sale.config.settings,group_fund_raising:0 msgid "Manage Fund Raising" -msgstr "" +msgstr "Fondsenwerving" #. module: crm #: view:crm.lead.report:0 @@ -96,7 +98,7 @@ msgstr "Fasenaam" #: view:crm.lead.report:0 #: view:crm.phonecall.report:0 msgid "Salesperson" -msgstr "" +msgstr "Verkoper" #. module: crm #: model:ir.model,name:crm.model_crm_lead_report @@ -113,18 +115,18 @@ msgstr "Dag" #. module: crm #: view:crm.lead:0 msgid "Company Name" -msgstr "" +msgstr "Bedrijfsnaam" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor6 msgid "Training" -msgstr "" +msgstr "Training" #. module: crm #: model:ir.actions.act_window,name:crm.crm_lead_categ_action #: model:ir.ui.menu,name:crm.menu_crm_lead_categ msgid "Sales Tags" -msgstr "" +msgstr "Verkooplabels" #. module: crm #: view:crm.lead.report:0 @@ -137,6 +139,7 @@ msgstr "Verw. sluiting" #: help:crm.phonecall,message_unread:0 msgid "If checked new messages require your attention." msgstr "" +"Als dit is ingeschakeld, zijn er nieuwe berichten die uw aandacht vragen." #. module: crm #: help:crm.lead.report,creation_day:0 @@ -182,6 +185,8 @@ msgid "" "Holds the Chatter summary (number of messages, ...). This summary is " "directly in html format in order to be inserted in kanban views." msgstr "" +"Bevat de Chatsamenvatting (aantal berichten, ...). Deze samenvatting is in " +"html-formaat, zodat ze in de kanbanweergave kan worden gebruikt." #. module: crm #: code:addons/crm/crm_lead.py:624 @@ -189,7 +194,7 @@ msgstr "" #: code:addons/crm/crm_phonecall.py:280 #, python-format msgid "Warning!" -msgstr "" +msgstr "Waarschuwing" #. module: crm #: view:crm.lead:0 @@ -238,7 +243,7 @@ msgstr "" #. module: crm #: model:ir.actions.server,name:crm.action_email_reminder_lead msgid "Reminder to User" -msgstr "" +msgstr "Herinnering voor gebruiker" #. module: crm #: field:crm.segmentation,segmentation_line:0 @@ -266,7 +271,7 @@ msgstr "Leadanalyse" #: code:addons/crm/crm_lead.py:1010 #, python-format msgid "<b>%s a call</b> for the <em>%s</em>." -msgstr "" +msgstr "<b>%s een gesprek</b> voor <em>%s</em>." #. module: crm #: model:ir.actions.act_window,name:crm.crm_case_resource_type_act @@ -328,6 +333,16 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" Klik als u een nieuwe klantensegmentering wilt instellen.\n" +" </p><p>\n" +" Maak specifiieke categorieën en ken deze toe aan uw\n" +" contactpersonen voor een betere interactie. Via\n" +" segmentering kunt u categorieën toekennen aan " +"contactpersonen\n" +" volgens de door u ingestelde criteria.\n" +" </p>\n" +" " #. module: crm #: field:crm.opportunity2phonecall,contact_name:0 @@ -341,6 +356,7 @@ msgstr "Contactpersoon" msgid "" "When escalating to this team override the salesman with the team leader." msgstr "" +"Bij escaleren naar dit team, wordt de verkoper vervangen door de teamleider." #. module: crm #: model:process.transition,name:crm.process_transition_opportunitymeeting0 @@ -380,12 +396,25 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" Klik om een opportuniteit voor deze klant te maken.\n" +" </p><p>\n" +" Met opportuniteiten kunt u uw verkooppijplijn en uw " +"mogelijke verkopen opvolgen,\n" +" voor een beter zicht op te verwachten inkomsten.\n" +" </p><p>\n" +" U kunt vergaderingen en telefoongesprekken plannen\n" +" voor opportuniteiten. U kunt van een opportuniteit een " +"offerte maken, documenten\n" +" toevoegen, discussies volgen, en nog veel meer.\n" +" </p>\n" +" " #. module: crm #: model:crm.case.stage,name:crm.stage_lead7 #: view:crm.lead:0 msgid "Dead" -msgstr "" +msgstr "Dood" #. module: crm #: field:crm.case.section,message_unread:0 @@ -393,7 +422,7 @@ msgstr "" #: field:crm.lead,message_unread:0 #: field:crm.phonecall,message_unread:0 msgid "Unread Messages" -msgstr "" +msgstr "Ongelezen berichten" #. module: crm #: view:crm.segmentation:0 @@ -407,7 +436,7 @@ msgstr "Segmentering" #: selection:crm.lead2opportunity.partner.mass,action:0 #: selection:crm.partner.binding,action:0 msgid "Link to an existing customer" -msgstr "" +msgstr "Koppelen aan een bestaande relatie" #. module: crm #: field:crm.lead,write_date:0 @@ -425,8 +454,8 @@ msgid "" "This percentage depicts the default/average probability of the Case for this " "stage to be a success" msgstr "" -"Dit percentage drukt de standaard/gemiddelde slaagkans uit voor de zaak in " -"deze fase." +"Dit percentage drukt de standaard/gemiddelde slagingskans uit voor de zaak " +"in deze fase." #. module: crm #: view:crm.lead:0 @@ -454,6 +483,7 @@ msgstr "" #: view:crm.lead:0 msgid "Leads that are assigned to one of the sale teams I manage, or to me" msgstr "" +"Leads toegewezen aan een van de verkoopteams onder mijn beheer, of aan mij" #. module: crm #: field:crm.lead,partner_address_email:0 @@ -472,6 +502,15 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" Klik als u een nieuw verkoopteam wilt maken.\n" +" </p><p>\n" +" Met verkoopteams organiseert u meerdere verkopers of " +"afdelingen in\n" +" aparte teams. Elk team werkt op zijn eigen\n" +" opportuniteitenlijst.\n" +" </p>\n" +" " #. module: crm #: model:process.transition,note:crm.process_transition_opportunitymeeting0 @@ -485,7 +524,7 @@ msgstr "Gewone of telefonische vergadering over opportuniteit" #: view:crm.phonecall.report:0 #: field:crm.phonecall.report,state:0 msgid "Status" -msgstr "" +msgstr "Status" #. module: crm #: view:crm.lead2opportunity.partner:0 @@ -495,7 +534,7 @@ msgstr "Opportuniteit maken" #. module: crm #: view:sale.config.settings:0 msgid "Configure" -msgstr "" +msgstr "Instellen" #. module: crm #: view:crm.lead:0 @@ -555,18 +594,26 @@ msgid "" " If the call needs to be done then the status is set " "to 'Not Held'." msgstr "" +"De status wordt op 'Uit te voeren' gezet als er een zaak wordt gemaakt. " +" \n" +"Als de zaak lopende is, wordt de status op 'Open' gezet. " +" \n" +"Als het gesprek is gevoerd, wordt de status op 'Uitgevoerd' gezet. " +" \n" +"Als het gesprek nog moet worden uitgevoerd, gaat de status naar 'Niet " +"uitgevoerd'." #. module: crm #: field:crm.case.section,message_summary:0 #: field:crm.lead,message_summary:0 #: field:crm.phonecall,message_summary:0 msgid "Summary" -msgstr "Samenvatting" +msgstr "Overzicht" #. module: crm #: view:crm.merge.opportunity:0 msgid "Merge" -msgstr "" +msgstr "Samenvoegen" #. module: crm #: model:email.template,subject:crm.email_template_opportunity_mail @@ -589,6 +636,8 @@ msgid "" "Reminder on Lead: [[object.id ]] [[object.partner_id and 'of ' " "+object.partner_id.name or '']]" msgstr "" +"Herinnering voor Lead: [[object.id ]] [[object.partner_id and 'van ' " +"+object.partner_id.name or '']]" #. module: crm #: view:crm.segmentation:0 @@ -608,7 +657,7 @@ msgstr "De code van het verkoopteam moet uniek zijn" #. module: crm #: help:crm.lead,email_from:0 msgid "Email address of the contact" -msgstr "" +msgstr "E-mailadres van de contactpersoon" #. module: crm #: selection:crm.case.stage,state:0 @@ -629,6 +678,13 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" Klik als u een nieuwe categorie wilt maken.\n" +" </p><p>\n" +" Maak specifieke telefooncategorieën om beter de gesprekstypen\n" +" op te volgen in het systeem.\n" +" </p>\n" +" " #. module: crm #: help:crm.case.section,reply_to:0 @@ -734,12 +790,12 @@ msgstr "Televisie" #. module: crm #: model:ir.actions.act_window,name:crm.action_crm_send_mass_convert msgid "Convert to opportunities" -msgstr "" +msgstr "Omzetten naar opportuniteit" #. module: crm #: model:ir.model,name:crm.model_sale_config_settings msgid "sale.config.settings" -msgstr "" +msgstr "sale.config.settings" #. module: crm #: view:crm.segmentation:0 @@ -749,7 +805,7 @@ msgstr "Verwerking stoppen" #. module: crm #: field:crm.case.section,alias_id:0 msgid "Alias" -msgstr "" +msgstr "Alias" #. module: crm #: view:crm.phonecall:0 @@ -761,6 +817,8 @@ msgstr "Telefoongesprekken zoeken" msgid "" "Leads/Opportunities that are assigned to one of the sale teams I manage" msgstr "" +"Leads/Opportuniteiten die zijn toegewezen aan een van de verkoopteams onder " +"mijn beheer" #. module: crm #: field:calendar.attendee,categ_id:0 @@ -781,7 +839,7 @@ msgstr "Van %s : %s" #. module: crm #: view:crm.lead2opportunity.partner.mass:0 msgid "Convert to Opportunities" -msgstr "" +msgstr "Omzetten naar opportuniteit" #. module: crm #: view:crm.lead2opportunity.partner:0 @@ -790,7 +848,7 @@ msgstr "" #: view:crm.opportunity2phonecall:0 #: view:crm.phonecall2phonecall:0 msgid "or" -msgstr "" +msgstr "of" #. module: crm #: field:crm.lead.report,create_date:0 @@ -809,6 +867,8 @@ msgid "" "Link between stages and sales teams. When set, this limitate the current " "stage to the selected sales teams." msgstr "" +"Koppeling tussen fasen en verkoopteams. Deze maken de huidige fase enkel " +"toegankelijk voor de gekozen verkoopteams." #. module: crm #: view:crm.case.stage:0 @@ -847,7 +907,7 @@ msgstr "Relatiecategorie" #. module: crm #: field:crm.lead,probability:0 msgid "Success Rate (%)" -msgstr "" +msgstr "Slagingskans (%)" #. module: crm #: field:crm.segmentation,sales_purchase_active:0 @@ -889,7 +949,7 @@ msgstr "Maart" #. module: crm #: view:crm.lead:0 msgid "Send Email" -msgstr "" +msgstr "E-mail verzenden" #. module: crm #: code:addons/crm/wizard/crm_lead_to_opportunity.py:89 @@ -919,6 +979,8 @@ msgid "" "Opportunities that are assigned to either me or one of the sale teams I " "manage" msgstr "" +"Opportuniteiten die zijn toegewezen aan een van de verkoopteams onder mijn " +"beheer of aan mij" #. module: crm #: help:crm.case.section,resource_calendar_id:0 @@ -984,6 +1046,9 @@ msgid "" "Allows you to track your customers/suppliers claims and grievances.\n" " This installs the module crm_claim." msgstr "" +"Hiermee kunt u klachten en problemen van klanten/ aan leveranciers " +"opvolgen.\n" +" Hiermee installeert u de module crm_claim." #. module: crm #: model:crm.case.stage,name:crm.stage_lead6 @@ -1058,7 +1123,7 @@ msgstr "Fase" #. module: crm #: view:crm.phonecall.report:0 msgid "Phone Calls that are assigned to me" -msgstr "" +msgstr "Aan mij toegewezen telefoongesprekken" #. module: crm #: field:crm.lead,user_login:0 @@ -1086,11 +1151,13 @@ msgid "" "Allows you to communicate with Customer, process Customer query, and " "provide better help and support. This installs the module crm_helpdesk." msgstr "" +"Hiermee kunt u met de klant communiceren, vragen beantwoorden en betere " +"ondersteuning verlenen. Hiermee installeert u de module crm_helpdesk." #. module: crm #: view:crm.lead:0 msgid "Delete" -msgstr "" +msgstr "Verwijderen" #. module: crm #: model:mail.message.subtype,description:crm.mt_lead_create @@ -1100,7 +1167,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "í" -msgstr "" +msgstr "í" #. module: crm #: selection:crm.lead.report,creation_month:0 @@ -1141,12 +1208,12 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "oe_kanban_text_red" -msgstr "" +msgstr "oe_kanban_text_red" #. module: crm #: model:ir.ui.menu,name:crm.menu_crm_payment_mode_act msgid "Payment Modes" -msgstr "" +msgstr "Betalingswijzen" #. module: crm #: field:crm.lead.report,opening_date:0 @@ -1193,6 +1260,9 @@ msgid "" "This field is used to distinguish stages related to Leads from stages " "related to Opportunities, or to specify stages available for both types." msgstr "" +"Dit veld dient om een onderscheid te maken tussen de fasen voor leads en die " +"voor opportuniteiten, of om fasen in te stellen die voor beide typen van " +"toepassing zijn." #. module: crm #: model:mail.message.subtype,name:crm.mt_lead_create @@ -1234,7 +1304,7 @@ msgstr "onbekend" #: field:crm.lead,message_is_follower:0 #: field:crm.phonecall,message_is_follower:0 msgid "Is a Follower" -msgstr "" +msgstr "Is een volger" #. module: crm #: field:crm.opportunity2phonecall,date:0 @@ -1247,7 +1317,7 @@ msgstr "Datum" #. module: crm #: model:crm.case.section,name:crm.crm_case_section_4 msgid "Online Support" -msgstr "" +msgstr "Onlineondersteuning" #. module: crm #: view:crm.lead.report:0 @@ -1273,6 +1343,10 @@ msgid "" "set to 'Done'. If the case needs to be reviewed then the Status is set to " "'Pending'." msgstr "" +"De status wordt op 'Voorlopig' gezet als de zaak wordt gemaakt. Als de zaak " +"lopende is, wordt de status op 'Open' gezet. Als de zaak is behandeld, wordt " +"de status op 'Gereed' gezet. Als de zaak moet worden bekeken, wordt de " +"status op 'Wachtend' gezet." #. module: crm #: model:crm.case.section,name:crm.crm_case_section_1 @@ -1306,7 +1380,7 @@ msgstr "Segmenteringsomschrijving" #. module: crm #: view:crm.lead:0 msgid "Lead Description" -msgstr "" +msgstr "Leadomschrijving" #. module: crm #: code:addons/crm/crm_lead.py:565 @@ -1317,7 +1391,7 @@ msgstr "Samengevoegde opportuniteiten" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor7 msgid "Consulting" -msgstr "" +msgstr "Consulting" #. module: crm #: field:crm.case.section,code:0 @@ -1327,7 +1401,7 @@ msgstr "Code" #. module: crm #: view:sale.config.settings:0 msgid "Features" -msgstr "" +msgstr "Opties" #. module: crm #: field:crm.case.section,child_ids:0 @@ -1342,7 +1416,7 @@ msgstr "Telefoongesprekken in status Uit te voeren en Open." #. module: crm #: field:crm.lead2opportunity.partner.mass,user_ids:0 msgid "Salesmen" -msgstr "" +msgstr "Verkopers" #. module: crm #: view:crm.lead:0 @@ -1362,12 +1436,12 @@ msgstr "Annuleren" #. module: crm #: view:crm.lead:0 msgid "Opportunities Assigned to Me or My Team(s)" -msgstr "" +msgstr "Opportuniteiten voor mij of mijn team(s)" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor4 msgid "Information" -msgstr "" +msgstr "Informatie" #. module: crm #: view:crm.lead.report:0 @@ -1389,7 +1463,7 @@ msgstr "" #: field:crm.lead2opportunity.partner.mass,action:0 #: field:crm.partner.binding,action:0 msgid "Related Customer" -msgstr "" +msgstr "Gekoppelde klant" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor8 @@ -1406,12 +1480,12 @@ msgstr "Lead/opportuniteit" #: model:ir.actions.act_window,name:crm.action_merge_opportunities #: model:ir.actions.act_window,name:crm.merge_opportunity_act msgid "Merge leads/opportunities" -msgstr "" +msgstr "Leads/opportuniteiten samenvoegen" #. module: crm #: help:crm.case.stage,sequence:0 msgid "Used to order stages. Lower is better." -msgstr "" +msgstr "WOrdt gebruikt om fasen te rangschikken. Lager is beter." #. module: crm #: model:ir.actions.act_window,name:crm.crm_phonecall_categ_action @@ -1426,7 +1500,7 @@ msgstr "Leads/opportuniteiten in status Open." #. module: crm #: model:ir.model,name:crm.model_res_users msgid "Users" -msgstr "" +msgstr "Gebruikers" #. module: crm #: model:mail.message.subtype,name:crm.mt_lead_stage @@ -1484,7 +1558,7 @@ msgstr "Naam" #. module: crm #: view:crm.lead.report:0 msgid "Leads/Opportunities that are assigned to me" -msgstr "" +msgstr "Leads/opportuniteiten die aan mij zijn toegekend" #. module: crm #: field:crm.lead.report,date_closed:0 @@ -1502,12 +1576,12 @@ msgstr "Mijn zaken" #: help:crm.lead,message_ids:0 #: help:crm.phonecall,message_ids:0 msgid "Messages and communication history" -msgstr "" +msgstr "Berichten en communicatiehistoriek" #. module: crm #: view:crm.lead:0 msgid "Show Countries" -msgstr "" +msgstr "Landen tonen" #. module: crm #: view:crm.lead:0 @@ -1531,7 +1605,7 @@ msgstr "Prospect omzetten naar relatie" #. module: crm #: model:ir.model,name:crm.model_crm_payment_mode msgid "CRM Payment Mode" -msgstr "" +msgstr "CRM betalingswijze" #. module: crm #: view:crm.lead.report:0 @@ -1554,7 +1628,7 @@ msgstr "Groeperen op..." #. module: crm #: view:crm.merge.opportunity:0 msgid "Merge Leads/Opportunities" -msgstr "" +msgstr "Leads/opportuniteiten samenvoegen" #. module: crm #: field:crm.case.section,parent_id:0 @@ -1566,7 +1640,7 @@ msgstr "Hoofdteam" #: selection:crm.lead2opportunity.partner.mass,action:0 #: selection:crm.partner.binding,action:0 msgid "Do not link to a customer" -msgstr "" +msgstr "Geen relatie koppelen" #. module: crm #: field:crm.lead,date_action:0 @@ -1580,11 +1654,14 @@ msgid "" "stage. For example, if a stage is related to the status 'Close', when your " "document reaches this stage, it is automatically closed." msgstr "" +"De status van uw document wordt automatisch gewijzigd in de functie van de " +"gekozen fase. Als een fase gekoppeld is aan de status 'Gesloten', dan wordt " +"het document automatisch gesloten als het in deze status komt." #. module: crm #: view:crm.lead2opportunity.partner.mass:0 msgid "Assign opportunities to" -msgstr "" +msgstr "Opportuniteiten toewijzen aan" #. module: crm #: model:crm.case.categ,name:crm.categ_phone1 @@ -1600,12 +1677,12 @@ msgstr "Maand van gesprek" #: code:addons/crm/crm_phonecall.py:290 #, python-format msgid "Partner has been <b>created</b>." -msgstr "" +msgstr "Relatie is <b>gemaakt</b>." #. module: crm #: field:sale.config.settings,module_crm_claim:0 msgid "Manage Customer Claims" -msgstr "" +msgstr "Klachten van klanten opvolgen" #. module: crm #: model:ir.actions.act_window,help:crm.action_report_crm_lead @@ -1618,7 +1695,7 @@ msgstr "" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor3 msgid "Services" -msgstr "" +msgstr "Diensten" #. module: crm #: selection:crm.lead,priority:0 @@ -1657,7 +1734,7 @@ msgstr "Antwoord aan" #. module: crm #: view:crm.lead:0 msgid "Display" -msgstr "" +msgstr "Weergeven" #. module: crm #: view:board.board:0 @@ -1693,12 +1770,12 @@ msgstr "Extra informatie" #. module: crm #: view:crm.lead:0 msgid "Fund Raising" -msgstr "" +msgstr "Fondsenwerving" #. module: crm #: view:crm.lead:0 msgid "Edit..." -msgstr "" +msgstr "Bewerken…" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead5 @@ -1730,13 +1807,15 @@ msgstr "Lead naar opportuniteit / relatie" #: help:crm.lead,partner_id:0 msgid "Linked partner (optional). Usually created when converting the lead." msgstr "" +"Gekoppelde relatie (optioneel). Doorgaans gemaakt bij het omzetten van de " +"lead." #. module: crm #: field:crm.lead,payment_mode:0 #: view:crm.payment.mode:0 #: model:ir.actions.act_window,name:crm.action_crm_payment_mode msgid "Payment Mode" -msgstr "" +msgstr "Betalingswijze" #. module: crm #: model:ir.model,name:crm.model_crm_lead2opportunity_partner_mass @@ -1746,19 +1825,19 @@ msgstr "Vele leads naar opportuniteit / relatie" #. module: crm #: view:sale.config.settings:0 msgid "On Mail Server" -msgstr "" +msgstr "Op mailserver" #. module: crm #: model:ir.actions.act_window,name:crm.open_board_statistical_dash #: model:ir.ui.menu,name:crm.menu_board_statistics_dash msgid "CRM" -msgstr "" +msgstr "CRM" #. module: crm #: model:ir.actions.act_window,name:crm.crm_segmentation_tree-act #: model:ir.ui.menu,name:crm.menu_crm_segmentation-act msgid "Contacts Segmentation" -msgstr "" +msgstr "Contactpersoonsegmentering" #. module: crm #: model:process.node,note:crm.process_node_meeting0 @@ -1773,7 +1852,7 @@ msgstr "Televerkoop" #. module: crm #: view:crm.lead:0 msgid "Leads Assigned to Me or My Team(s)" -msgstr "" +msgstr "Leads voor mij of mijn team(s)" #. module: crm #: model:ir.model,name:crm.model_crm_segmentation_line @@ -1817,7 +1896,7 @@ msgstr "Lead / klant" #. module: crm #: model:crm.case.section,name:crm.crm_case_section_2 msgid "Support Department" -msgstr "" +msgstr "Supportafdeling" #. module: crm #: view:crm.lead.report:0 @@ -1881,13 +1960,13 @@ msgstr "" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor5 msgid "Design" -msgstr "" +msgstr "Ontwerp" #. module: crm #: selection:crm.lead2opportunity.partner,name:0 #: selection:crm.lead2opportunity.partner.mass,name:0 msgid "Merge with existing opportunities" -msgstr "" +msgstr "Samenvoegen met bestaande opportuniteiten" #. module: crm #: view:crm.phonecall.report:0 @@ -1912,6 +1991,8 @@ msgid "" "The name of the future partner company that will be created while converting " "the lead into opportunity" msgstr "" +"De naam van de toekomstige relatie die zal worden gemaakt als van de lead " +"een opportuniteit wordt gemaakt." #. module: crm #: field:crm.opportunity2phonecall,note:0 @@ -1945,7 +2026,7 @@ msgstr "Openstaande opportuniteiten" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead2 msgid "Email Campaign - Services" -msgstr "" +msgstr "E-mailcampagne - Diensten" #. module: crm #: selection:crm.case.stage,state:0 @@ -2018,7 +2099,7 @@ msgstr "" #: selection:crm.lead2opportunity.partner.mass,action:0 #: selection:crm.partner.binding,action:0 msgid "Create a new customer" -msgstr "" +msgstr "Een nieuwe klant maken" #. module: crm #: field:crm.lead.report,deadline_day:0 @@ -2028,7 +2109,7 @@ msgstr "Verw. sluiting" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor2 msgid "Software" -msgstr "" +msgstr "Software" #. module: crm #: field:crm.case.section,change_responsible:0 @@ -2063,12 +2144,12 @@ msgstr "Plaats" #. module: crm #: selection:crm.case.stage,type:0 msgid "Both" -msgstr "" +msgstr "Beide" #. module: crm #: view:crm.phonecall:0 msgid "Call Done" -msgstr "" +msgstr "Gesprek uitgevoerd" #. module: crm #: view:crm.phonecall:0 @@ -2079,12 +2160,12 @@ msgstr "Verantwoordelijke" #. module: crm #: model:crm.case.section,name:crm.crm_case_section_3 msgid "Direct Marketing" -msgstr "" +msgstr "Direct Marketing" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor1 msgid "Product" -msgstr "" +msgstr "Product" #. module: crm #: field:crm.lead.report,creation_year:0 @@ -2094,7 +2175,7 @@ msgstr "Creatiejaar" #. module: crm #: view:crm.lead2opportunity.partner.mass:0 msgid "Conversion Options" -msgstr "" +msgstr "Conversieopties" #. module: crm #: view:crm.case.section:0 @@ -2106,7 +2187,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Address" -msgstr "" +msgstr "Adres" #. module: crm #: help:crm.case.section,alias_id:0 @@ -2114,6 +2195,8 @@ msgid "" "The email address associated with this team. New emails received will " "automatically create new leads assigned to the team." msgstr "" +"Het e-mailadres van het team. Nieuwe e-mails worden automatisch als lead " +"gemaakt en toegekend aan dit team." #. module: crm #: view:crm.lead:0 @@ -2172,7 +2255,7 @@ msgstr "Verder verwerken" #: selection:crm.lead2opportunity.partner.mass,name:0 #: model:ir.actions.act_window,name:crm.action_crm_lead2opportunity_partner msgid "Convert to opportunity" -msgstr "" +msgstr "Omzetten naar opportuniteit" #. module: crm #: field:crm.opportunity2phonecall,user_id:0 @@ -2214,6 +2297,8 @@ msgid "" "This stage is not visible, for example in status bar or kanban view, when " "there are no records in that stage to display." msgstr "" +"Deze fase is niet zichtbaar, vb. in statusbalk of kanbanweergave, als er " +"zich geen records in deze fase bevinden." #. module: crm #: field:crm.lead.report,nbr:0 @@ -2229,12 +2314,12 @@ msgstr "Verkoopteam aan wie de zaak toebehoort" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead6 msgid "Banner Ads" -msgstr "" +msgstr "Kopadvertenties" #. module: crm #: field:crm.merge.opportunity,opportunity_ids:0 msgid "Leads/Opportunities" -msgstr "" +msgstr "Leads/opportuniteiten" #. module: crm #: field:crm.lead,fax:0 @@ -2279,17 +2364,17 @@ msgstr "Objectnaam" #. module: crm #: view:crm.phonecall:0 msgid "Phone Calls Assigned to Me or My Team(s)" -msgstr "" +msgstr "Telefoongesprekken voor mij of mijn team(s)" #. module: crm #: view:crm.lead:0 msgid "Reset" -msgstr "" +msgstr "Herstellen" #. module: crm #: view:sale.config.settings:0 msgid "After-Sale Services" -msgstr "" +msgstr "Klantenservice" #. module: crm #: field:crm.case.section,message_ids:0 @@ -2344,7 +2429,7 @@ msgstr "" #. module: crm #: field:crm.case.stage,state:0 msgid "Related Status" -msgstr "" +msgstr "Gekoppelde status" #. module: crm #: field:crm.phonecall,name:0 @@ -2365,7 +2450,7 @@ msgstr "Een gesprek plannen/noteren" #. module: crm #: view:crm.merge.opportunity:0 msgid "Select Leads/Opportunities" -msgstr "" +msgstr "Leads/opportuniteiten kiezen" #. module: crm #: selection:crm.phonecall,state:0 @@ -2390,7 +2475,7 @@ msgstr "Bevestigen" #. module: crm #: view:crm.lead:0 msgid "Unread messages" -msgstr "" +msgstr "Ongelezen berichten" #. module: crm #: field:crm.phonecall.report,section_id:0 @@ -2407,7 +2492,7 @@ msgstr "Optionele expressie" #: field:crm.lead,message_follower_ids:0 #: field:crm.phonecall,message_follower_ids:0 msgid "Followers" -msgstr "" +msgstr "Volgers" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_category_act_leads_all @@ -2430,7 +2515,7 @@ msgstr "" #. module: crm #: field:sale.config.settings,fetchmail_lead:0 msgid "Create leads from incoming mails" -msgstr "" +msgstr "Leads maken van binnenkomende mails" #. module: crm #: view:crm.lead:0 @@ -2481,7 +2566,7 @@ msgstr "Opportuniteiten maken van leads" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead3 msgid "Email Campaign - Products" -msgstr "" +msgstr "E-mailcampagne - Producten" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_categ_phone_incoming0 @@ -2509,7 +2594,7 @@ msgstr "Allereerste contact met een nieuwe prospect" #. module: crm #: view:res.partner:0 msgid "Calls" -msgstr "" +msgstr "Gesprekken" #. module: crm #: field:crm.case.stage,on_change:0 @@ -2519,7 +2604,7 @@ msgstr "Kans automatisch wijzigen" #. module: crm #: view:crm.phonecall.report:0 msgid "My Phone Calls" -msgstr "" +msgstr "Mijn telefoongesprekken" #. module: crm #: model:crm.case.stage,name:crm.stage_lead3 @@ -2530,7 +2615,7 @@ msgstr "Kwalificatie" #: field:crm.lead2opportunity.partner,name:0 #: field:crm.lead2opportunity.partner.mass,name:0 msgid "Conversion Action" -msgstr "" +msgstr "Conversieactie" #. module: crm #: model:ir.actions.act_window,help:crm.crm_lead_categ_action @@ -2606,7 +2691,7 @@ msgstr "Verw. sluitingsjaar" #. module: crm #: model:ir.actions.client,name:crm.action_client_crm_menu msgid "Open Sale Menu" -msgstr "" +msgstr "Het verkoopmenu openen" #. module: crm #: field:crm.lead,date_open:0 @@ -2629,12 +2714,12 @@ msgstr "Een gesprek plannen/noteren" #. module: crm #: field:crm.lead,planned_cost:0 msgid "Planned Costs" -msgstr "" +msgstr "Geplande kosten" #. module: crm #: help:crm.lead,date_deadline:0 msgid "Estimate of the date on which the opportunity will be won." -msgstr "" +msgstr "Verwachte datum waarop de opportuniteit kan worden gerealiseerd." #. module: crm #: help:crm.lead,email_cc:0 @@ -2698,7 +2783,7 @@ msgstr "Straat 2" #. module: crm #: field:sale.config.settings,module_crm_helpdesk:0 msgid "Manage Helpdesk and Support" -msgstr "" +msgstr "Helpdesk en ondersteuning" #. module: crm #: field:crm.lead.report,delay_open:0 @@ -2785,7 +2870,7 @@ msgstr "Gesprek noteren" #. module: crm #: help:sale.config.settings,group_fund_raising:0 msgid "Allows you to trace and manage your activities for fund raising." -msgstr "" +msgstr "Hiermee kunt u activiteiten voor fondsenwerving beheren" #. module: crm #: field:crm.meeting,phonecall_id:0 @@ -2797,6 +2882,8 @@ msgstr "Telefoongesprek" #: view:crm.phonecall.report:0 msgid "Phone calls that are assigned to one of the sale teams I manage" msgstr "" +"Telefoongesprekken die zijn toegewezen aan een van de verkoopteams onder " +"mijn beheer" #. module: crm #: view:crm.lead:0 @@ -2806,7 +2893,7 @@ msgstr "Creatiedatum" #. module: crm #: view:crm.lead:0 msgid "at" -msgstr "" +msgstr "bij" #. module: crm #: model:crm.case.stage,name:crm.stage_lead1 @@ -2875,7 +2962,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Internal Notes" -msgstr "" +msgstr "Interne notities" #. module: crm #: view:crm.lead:0 @@ -2895,7 +2982,7 @@ msgstr "Straat" #. module: crm #: field:crm.lead,referred:0 msgid "Referred By" -msgstr "" +msgstr "Doorverwezen via" #. module: crm #: view:crm.phonecall:0 @@ -2940,6 +3027,7 @@ msgstr "Verloren" #, python-format msgid "Closed/Cancelled leads cannot be converted into opportunities." msgstr "" +"Gesloten/geannuleerde leads kunnen niet in een opportuniteit worden omgezet" #. module: crm #: view:crm.lead:0 @@ -4199,3 +4287,6 @@ msgstr "" #~ msgid "Recurrent" #~ msgstr "Recurrent" + +#~ msgid "Conditions on Case Fields" +#~ msgstr "Voorwaardevelden" diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index 1009e1c376d..759063b3c1d 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -82,7 +82,7 @@ groups="base.group_multi_salesteams"/> <field name="user_id" string="Salesperson"/> <group expand="0" string="Extended Filters..."> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="stage_id" domain="[('section_ids', '=', 'section_id')]" /> <field name="type_id"/> <field name="channel_id"/> diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml index c27d876ddd7..070d574e0cd 100644 --- a/addons/crm/report/crm_phonecall_report_view.xml +++ b/addons/crm/report/crm_phonecall_report_view.xml @@ -64,7 +64,7 @@ groups="base.group_multi_salesteams"/> <field name="user_id" string="Salesperson"/> <group expand="0" string="Extended Filters..."> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="company_id" groups="base.group_multi_company"/> <field name="creation_date"/> <field name="opening_date"/> diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 52648c8e347..b09c201df2b 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -35,3 +35,5 @@ access_crm_lead_partner_manager,crm.lead.partner.manager,model_crm_lead,base.gro access_crm_phonecall_partner_manager,crm.phonecall.partner.manager,model_crm_phonecall,base.group_partner_manager,1,1,1,1
access_crm_payment_mode_user,crm.payment.mode,model_crm_payment_mode,base.group_sale_salesman,1,0,0,0
access_crm_payment_mode,crm.payment.mode,model_crm_payment_mode,base.group_sale_manager,1,1,1,1
+access_base_partner_merge_line_manager,base_partner_merge_line.manager,model_base_partner_merge_line,base.group_system,1,1,1,1
+access_base_partner_merge_manager,base_partner_merge.manager,model_base_partner_merge_automatic_wizard,base.group_system,1,1,1,1
diff --git a/addons/crm/validate_email.py b/addons/crm/validate_email.py new file mode 100644 index 00000000000..38de5743fca --- /dev/null +++ b/addons/crm/validate_email.py @@ -0,0 +1,123 @@ +# RFC 2822 - style email validation for Python +# (c) 2012 Syrus Akbary <me@syrusakbary.com> +# Extended from (c) 2011 Noel Bush <noel@aitools.org> +# for support of mx and user check +# This code is made available to you under the GNU LGPL v3. +# +# This module provides a single method, valid_email_address(), +# which returns True or False to indicate whether a given address +# is valid according to the 'addr-spec' part of the specification +# given in RFC 2822. Ideally, we would like to find this +# in some other library, already thoroughly tested and well- +# maintained. The standard Python library email.utils +# contains a parse_addr() function, but it is not sufficient +# to detect many malformed addresses. +# +# This implementation aims to be faithful to the RFC, with the +# exception of a circular definition (see comments below), and +# with the omission of the pattern components marked as "obsolete". + +import re +import smtplib +import socket + +try: + import DNS + ServerError = DNS.ServerError +except: + DNS = None + class ServerError(Exception): pass +# All we are really doing is comparing the input string to one +# gigantic regular expression. But building that regexp, and +# ensuring its correctness, is made much easier by assembling it +# from the "tokens" defined by the RFC. Each of these tokens is +# tested in the accompanying unit test file. +# +# The section of RFC 2822 from which each pattern component is +# derived is given in an accompanying comment. +# +# (To make things simple, every string below is given as 'raw', +# even when it's not strictly necessary. This way we don't forget +# when it is necessary.) +# +WSP = r'[ \t]' # see 2.2.2. Structured Header Field Bodies +CRLF = r'(?:\r\n)' # see 2.2.3. Long Header Fields +NO_WS_CTL = r'\x01-\x08\x0b\x0c\x0f-\x1f\x7f' # see 3.2.1. Primitive Tokens +QUOTED_PAIR = r'(?:\\.)' # see 3.2.2. Quoted characters +FWS = r'(?:(?:' + WSP + r'*' + CRLF + r')?' + \ + WSP + r'+)' # see 3.2.3. Folding white space and comments +CTEXT = r'[' + NO_WS_CTL + \ + r'\x21-\x27\x2a-\x5b\x5d-\x7e]' # see 3.2.3 +CCONTENT = r'(?:' + CTEXT + r'|' + \ + QUOTED_PAIR + r')' # see 3.2.3 (NB: The RFC includes COMMENT here + # as well, but that would be circular.) +COMMENT = r'\((?:' + FWS + r'?' + CCONTENT + \ + r')*' + FWS + r'?\)' # see 3.2.3 +CFWS = r'(?:' + FWS + r'?' + COMMENT + ')*(?:' + \ + FWS + '?' + COMMENT + '|' + FWS + ')' # see 3.2.3 +ATEXT = r'[\w!#$%&\'\*\+\-/=\?\^`\{\|\}~]' # see 3.2.4. Atom +ATOM = CFWS + r'?' + ATEXT + r'+' + CFWS + r'?' # see 3.2.4 +DOT_ATOM_TEXT = ATEXT + r'+(?:\.' + ATEXT + r'+)*' # see 3.2.4 +DOT_ATOM = CFWS + r'?' + DOT_ATOM_TEXT + CFWS + r'?' # see 3.2.4 +QTEXT = r'[' + NO_WS_CTL + \ + r'\x21\x23-\x5b\x5d-\x7e]' # see 3.2.5. Quoted strings +QCONTENT = r'(?:' + QTEXT + r'|' + \ + QUOTED_PAIR + r')' # see 3.2.5 +QUOTED_STRING = CFWS + r'?' + r'"(?:' + FWS + \ + r'?' + QCONTENT + r')*' + FWS + \ + r'?' + r'"' + CFWS + r'?' +LOCAL_PART = r'(?:' + DOT_ATOM + r'|' + \ + QUOTED_STRING + r')' # see 3.4.1. Addr-spec specification +DTEXT = r'[' + NO_WS_CTL + r'\x21-\x5a\x5e-\x7e]' # see 3.4.1 +DCONTENT = r'(?:' + DTEXT + r'|' + \ + QUOTED_PAIR + r')' # see 3.4.1 +DOMAIN_LITERAL = CFWS + r'?' + r'\[' + \ + r'(?:' + FWS + r'?' + DCONTENT + \ + r')*' + FWS + r'?\]' + CFWS + r'?' # see 3.4.1 +DOMAIN = r'(?:' + DOT_ATOM + r'|' + \ + DOMAIN_LITERAL + r')' # see 3.4.1 +ADDR_SPEC = LOCAL_PART + r'@' + DOMAIN # see 3.4.1 + +# A valid address will match exactly the 3.4.1 addr-spec. +VALID_ADDRESS_REGEXP = '^' + ADDR_SPEC + '$' + +def validate_email(email, check_mx=False,verify=False): + + """Indicate whether the given string is a valid email address + according to the 'addr-spec' portion of RFC 2822 (see section + 3.4.1). Parts of the spec that are marked obsolete are *not* + included in this test, and certain arcane constructions that + depend on circular definitions in the spec may not pass, but in + general this should correctly identify any email address likely + to be in use as of 2011.""" + try: + assert re.match(VALID_ADDRESS_REGEXP, email) is not None + check_mx |= verify + if check_mx: + if not DNS: raise Exception('For check the mx records or check if the email exists you must have installed pyDNS python package') + DNS.DiscoverNameServers() + hostname = email[email.find('@')+1:] + mx_hosts = DNS.mxlookup(hostname) + for mx in mx_hosts: + try: + smtp = smtplib.SMTP() + smtp.connect(mx[1]) + if not verify: return True + status, _ = smtp.helo() + if status != 250: continue + smtp.mail('') + status, _ = smtp.rcpt(email) + if status != 250: return False + break + except smtplib.SMTPServerDisconnected: #Server not permits verify user + break + except smtplib.SMTPConnectError: + continue + except (AssertionError, ServerError): + return False + return True + +# import sys + +# sys.modules[__name__],sys.modules['validate_email_module'] = validate_email,sys.modules[__name__] +# from validate_email_module import * diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml index 78e467a7ba8..e295bfdd250 100644 --- a/addons/crm_claim/crm_claim_view.xml +++ b/addons/crm_claim/crm_claim_view.xml @@ -201,7 +201,7 @@ <filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]"/> <separator/> <filter string="Unassigned Claims" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Claims" /> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="user_id"/> <group expand="0" string="Group By..."> <filter string="Partner" icon="terp-partner" domain="[]" help="Partner" context="{'group_by':'partner_id'}"/> diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml index febf9cafd73..530eb6061a3 100644 --- a/addons/crm_claim/report/crm_claim_report_view.xml +++ b/addons/crm_claim/report/crm_claim_report_view.xml @@ -65,7 +65,7 @@ <field name="section_id" string="Sales Team" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/> <group expand="0" string="Extended Filters..."> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="stage_id" domain="[('section_ids', '=', 'section_id')]"/> <field name="categ_id" domain="[('object_id.model', '=', 'crm.claim')]"/> <field name="priority"/> diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml index 6769b42a7f8..6e3521be6f2 100644 --- a/addons/crm_helpdesk/crm_helpdesk_view.xml +++ b/addons/crm_helpdesk/crm_helpdesk_view.xml @@ -152,7 +152,7 @@ <separator/> <filter string="Assigned to Me or My Sales Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" help="Helpdesk requests that are assigned to me or to one of the sale teams I manage" /> - <field name="partner_id" /> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="user_id"/> <field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/> <group expand="0" string="Group By..."> diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml index 795ae210d8d..6ce2c60093f 100644 --- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml +++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml @@ -62,6 +62,7 @@ <field name="user_id" string="Salesperson"/> <field name="section_id" string="Sales Team" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/> <field name="company_id" groups="base.group_multi_company"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <group expand="0" string="Extended Filters..." groups="base.group_no_one"> <field name="priority" string="Priority"/> <field name="categ_id"/> diff --git a/addons/crm_helpdesk/test/process/help-desk.yml b/addons/crm_helpdesk/test/process/help-desk.yml index e2be4a64ca3..95536b1c8dd 100644 --- a/addons/crm_helpdesk/test/process/help-desk.yml +++ b/addons/crm_helpdesk/test/process/help-desk.yml @@ -4,8 +4,7 @@ Mail script will be fetched him request from mail server. so I process that mail after read EML file - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'crm.helpdesk', request_message) - diff --git a/addons/edi/i18n/lt.po b/addons/edi/i18n/lt.po new file mode 100644 index 00000000000..4c00a1dc6d6 --- /dev/null +++ b/addons/edi/i18n/lt.po @@ -0,0 +1,87 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:19+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: edi +#. openerp-web +#: code:addons/edi/static/src/js/edi.js:67 +#, python-format +msgid "Reason:" +msgstr "" + +#. module: edi +#. openerp-web +#: code:addons/edi/static/src/js/edi.js:60 +#, python-format +msgid "The document has been successfully imported!" +msgstr "" + +#. module: edi +#. openerp-web +#: code:addons/edi/static/src/js/edi.js:65 +#, python-format +msgid "Sorry, the document could not be imported." +msgstr "" + +#. module: edi +#: model:ir.model,name:edi.model_res_company +msgid "Companies" +msgstr "" + +#. module: edi +#: model:ir.model,name:edi.model_res_currency +msgid "Currency" +msgstr "" + +#. module: edi +#. openerp-web +#: code:addons/edi/static/src/js/edi.js:71 +#, python-format +msgid "Document Import Notification" +msgstr "" + +#. module: edi +#: code:addons/edi/models/edi.py:130 +#, python-format +msgid "Missing application." +msgstr "" + +#. module: edi +#: code:addons/edi/models/edi.py:131 +#, python-format +msgid "" +"The document you are trying to import requires the OpenERP `%s` application. " +"You can install it by connecting as the administrator and opening the " +"configuration assistant." +msgstr "" + +#. module: edi +#: code:addons/edi/models/edi.py:47 +#, python-format +msgid "'%s' is an invalid external ID" +msgstr "" + +#. module: edi +#: model:ir.model,name:edi.model_res_partner +msgid "Partner" +msgstr "" + +#. module: edi +#: model:ir.model,name:edi.model_edi_edi +msgid "EDI Subsystem" +msgstr "" diff --git a/addons/email_template/i18n/lt.po b/addons/email_template/i18n/lt.po new file mode 100644 index 00000000000..20c2c5e0e5d --- /dev/null +++ b/addons/email_template/i18n/lt.po @@ -0,0 +1,488 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:19+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: email_template +#: field:email.template,email_from:0 +#: field:email_template.preview,email_from:0 +msgid "From" +msgstr "" + +#. module: email_template +#: field:mail.compose.message,template_id:0 +msgid "Template" +msgstr "" + +#. module: email_template +#: help:email.template,ref_ir_value:0 +#: help:email_template.preview,ref_ir_value:0 +msgid "Sidebar button to open the sidebar action" +msgstr "" + +#. module: email_template +#: field:res.partner,opt_out:0 +msgid "Opt-Out" +msgstr "" + +#. module: email_template +#: field:email.template,email_to:0 +#: field:email_template.preview,email_to:0 +msgid "To (Emails)" +msgstr "" + +#. module: email_template +#: field:email.template,mail_server_id:0 +#: field:email_template.preview,mail_server_id:0 +msgid "Outgoing Mail Server" +msgstr "" + +#. module: email_template +#: help:email.template,ref_ir_act_window:0 +#: help:email_template.preview,ref_ir_act_window:0 +msgid "" +"Sidebar action to make this template available on records of the related " +"document model" +msgstr "" + +#. module: email_template +#: field:email.template,model_object_field:0 +#: field:email_template.preview,model_object_field:0 +msgid "Field" +msgstr "" + +#. module: email_template +#: help:email.template,email_from:0 +#: help:email_template.preview,email_from:0 +msgid "Sender address (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Remove context action" +msgstr "" + +#. module: email_template +#: help:email.template,mail_server_id:0 +#: help:email_template.preview,mail_server_id:0 +msgid "" +"Optional preferred server for outgoing mails. If not set, the highest " +"priority one will be used." +msgstr "" + +#. module: email_template +#: field:email.template,report_name:0 +#: field:email_template.preview,report_name:0 +msgid "Report Filename" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Preview" +msgstr "" + +#. module: email_template +#: field:email.template,reply_to:0 +#: field:email_template.preview,reply_to:0 +msgid "Reply-To" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Use template" +msgstr "" + +#. module: email_template +#: field:email.template,body_html:0 +#: field:email_template.preview,body_html:0 +msgid "Body" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:244 +#, python-format +msgid "%s (copy)" +msgstr "" + +#. module: email_template +#: help:email.template,user_signature:0 +#: help:email_template.preview,user_signature:0 +msgid "" +"If checked, the user's signature will be appended to the text version of the " +"message" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "SMTP Server" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Save as new template" +msgstr "" + +#. module: email_template +#: help:email.template,sub_object:0 +#: help:email_template.preview,sub_object:0 +msgid "" +"When a relationship field is selected as first field, this field shows the " +"document model the relationship goes to." +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_email_template +msgid "Email Templates" +msgstr "" + +#. module: email_template +#: help:email.template,report_name:0 +#: help:email_template.preview,report_name:0 +msgid "" +"Name to use for the generated report file (may contain placeholders)\n" +"The extension can be omitted and will then come from the report type." +msgstr "" + +#. module: email_template +#: field:email.template,ref_ir_act_window:0 +#: field:email_template.preview,ref_ir_act_window:0 +msgid "Sidebar action" +msgstr "" + +#. module: email_template +#: help:email.template,lang:0 +#: help:email_template.preview,lang:0 +msgid "" +"Optional translation language (ISO code) to select when sending out an " +"email. If not set, the english version will be used. This should usually be " +"a placeholder expression that provides the appropriate language code, e.g. " +"${object.partner_id.lang.code}." +msgstr "" + +#. module: email_template +#: field:email_template.preview,res_id:0 +msgid "Sample Document" +msgstr "" + +#. module: email_template +#: help:email.template,model_object_field:0 +#: help:email_template.preview,model_object_field:0 +msgid "" +"Select target field from the related document model.\n" +"If it is a relationship field you will be able to select a target field at " +"the destination of the relationship." +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Dynamic Value Builder" +msgstr "" + +#. module: email_template +#: model:ir.actions.act_window,name:email_template.wizard_email_template_preview +msgid "Template Preview" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Save as a new template" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "" +"Display an option on related documents to open a composition wizard with " +"this template" +msgstr "" + +#. module: email_template +#: help:email.template,email_cc:0 +#: help:email_template.preview,email_cc:0 +msgid "Carbon copy recipients (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: help:email.template,email_to:0 +#: help:email_template.preview,email_to:0 +msgid "Comma-separated recipient addresses (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Advanced" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Preview of" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Using sample document" +msgstr "" + +#. module: email_template +#: view:email.template:0 +#: model:ir.actions.act_window,name:email_template.action_email_template_tree_all +#: model:ir.ui.menu,name:email_template.menu_email_templates +msgid "Templates" +msgstr "" + +#. module: email_template +#: field:email.template,name:0 +#: field:email_template.preview,name:0 +msgid "Name" +msgstr "" + +#. module: email_template +#: field:email.template,lang:0 +#: field:email_template.preview,lang:0 +msgid "Language" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_email_template_preview +msgid "Email Template Preview" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Email Preview" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "" +"Remove the contextual action to use this template on related documents" +msgstr "" + +#. module: email_template +#: field:email.template,copyvalue:0 +#: field:email_template.preview,copyvalue:0 +msgid "Placeholder Expression" +msgstr "" + +#. module: email_template +#: field:email.template,sub_object:0 +#: field:email_template.preview,sub_object:0 +msgid "Sub-model" +msgstr "" + +#. module: email_template +#: help:email.template,subject:0 +#: help:email_template.preview,subject:0 +msgid "Subject (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: help:email.template,reply_to:0 +#: help:email_template.preview,reply_to:0 +msgid "Preferred response address (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: field:email.template,ref_ir_value:0 +#: field:email_template.preview,ref_ir_value:0 +msgid "Sidebar Button" +msgstr "" + +#. module: email_template +#: field:email.template,report_template:0 +#: field:email_template.preview,report_template:0 +msgid "Optional report to print and attach" +msgstr "" + +#. module: email_template +#: help:email.template,null_value:0 +#: help:email_template.preview,null_value:0 +msgid "Optional value to use if the target field is empty" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Model" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Add context action" +msgstr "" + +#. module: email_template +#: help:email.template,model_id:0 +#: help:email_template.preview,model_id:0 +msgid "The kind of document with with this template can be used" +msgstr "" + +#. module: email_template +#: field:email.template,email_recipients:0 +#: field:email_template.preview,email_recipients:0 +msgid "To (Partners)" +msgstr "" + +#. module: email_template +#: field:email.template,auto_delete:0 +#: field:email_template.preview,auto_delete:0 +msgid "Auto Delete" +msgstr "" + +#. module: email_template +#: help:email.template,copyvalue:0 +#: help:email_template.preview,copyvalue:0 +msgid "" +"Final placeholder expression, to be copy-pasted in the desired template " +"field." +msgstr "" + +#. module: email_template +#: field:email.template,model:0 +#: field:email_template.preview,model:0 +msgid "Related Document Model" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Addressing" +msgstr "" + +#. module: email_template +#: help:email.template,email_recipients:0 +#: help:email_template.preview,email_recipients:0 +msgid "" +"Comma-separated ids of recipient partners (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: field:email.template,attachment_ids:0 +#: field:email_template.preview,attachment_ids:0 +msgid "Attachments" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:231 +#, python-format +msgid "Deletion of the action record failed." +msgstr "" + +#. module: email_template +#: field:email.template,email_cc:0 +#: field:email_template.preview,email_cc:0 +msgid "Cc" +msgstr "" + +#. module: email_template +#: field:email.template,model_id:0 +#: field:email_template.preview,model_id:0 +msgid "Applies to" +msgstr "" + +#. module: email_template +#: field:email.template,sub_model_object_field:0 +#: field:email_template.preview,sub_model_object_field:0 +msgid "Sub-field" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Email Details" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:196 +#, python-format +msgid "Send Mail (%s)" +msgstr "" + +#. module: email_template +#: help:res.partner,opt_out:0 +msgid "" +"If checked, this partner will not receive any automated email notifications, " +"such as the availability of invoices." +msgstr "" + +#. module: email_template +#: help:email.template,auto_delete:0 +#: help:email_template.preview,auto_delete:0 +msgid "Permanently delete this email after sending it, to save space" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Group by..." +msgstr "" + +#. module: email_template +#: help:email.template,sub_model_object_field:0 +#: help:email_template.preview,sub_model_object_field:0 +msgid "" +"When a relationship field is selected as first field, this field lets you " +"select the target field within the destination document model (sub-model)." +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:231 +#, python-format +msgid "Warning" +msgstr "" + +#. module: email_template +#: field:email.template,user_signature:0 +#: field:email_template.preview,user_signature:0 +msgid "Add Signature" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_res_partner +msgid "Partner" +msgstr "" + +#. module: email_template +#: field:email.template,null_value:0 +#: field:email_template.preview,null_value:0 +msgid "Default Value" +msgstr "" + +#. module: email_template +#: help:email.template,attachment_ids:0 +#: help:email_template.preview,attachment_ids:0 +msgid "" +"You may attach files to this template, to be added to all emails created " +"from this template" +msgstr "" + +#. module: email_template +#: help:email.template,body_html:0 +#: help:email_template.preview,body_html:0 +msgid "Rich-text/HTML version of the message (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Contents" +msgstr "" + +#. module: email_template +#: field:email.template,subject:0 +#: field:email_template.preview,subject:0 +msgid "Subject" +msgstr "" diff --git a/addons/email_template/i18n/nl_BE.po b/addons/email_template/i18n/nl_BE.po new file mode 100644 index 00000000000..5e7ddeec587 --- /dev/null +++ b/addons/email_template/i18n/nl_BE.po @@ -0,0 +1,489 @@ +# Dutch (Belgium) translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-26 16:28+0000\n" +"Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n" +"Language-Team: Dutch (Belgium) <nl_BE@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: 2013-04-27 05:44+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: email_template +#: field:email.template,email_from:0 +#: field:email_template.preview,email_from:0 +msgid "From" +msgstr "Van" + +#. module: email_template +#: field:mail.compose.message,template_id:0 +msgid "Template" +msgstr "Sjabloon" + +#. module: email_template +#: help:email.template,ref_ir_value:0 +#: help:email_template.preview,ref_ir_value:0 +msgid "Sidebar button to open the sidebar action" +msgstr "" + +#. module: email_template +#: field:res.partner,opt_out:0 +msgid "Opt-Out" +msgstr "Uitschrijven" + +#. module: email_template +#: field:email.template,email_to:0 +#: field:email_template.preview,email_to:0 +msgid "To (Emails)" +msgstr "Naar (E-mails)" + +#. module: email_template +#: field:email.template,mail_server_id:0 +#: field:email_template.preview,mail_server_id:0 +msgid "Outgoing Mail Server" +msgstr "Uitgaande mailserver" + +#. module: email_template +#: help:email.template,ref_ir_act_window:0 +#: help:email_template.preview,ref_ir_act_window:0 +msgid "" +"Sidebar action to make this template available on records of the related " +"document model" +msgstr "" + +#. module: email_template +#: field:email.template,model_object_field:0 +#: field:email_template.preview,model_object_field:0 +msgid "Field" +msgstr "Veld" + +#. module: email_template +#: help:email.template,email_from:0 +#: help:email_template.preview,email_from:0 +msgid "Sender address (placeholders may be used here)" +msgstr "" +"Adres van de afzender (variabele aanduidingen kunnen hier worden gebruikt)" + +#. module: email_template +#: view:email.template:0 +msgid "Remove context action" +msgstr "Contextactie verwijderen" + +#. module: email_template +#: help:email.template,mail_server_id:0 +#: help:email_template.preview,mail_server_id:0 +msgid "" +"Optional preferred server for outgoing mails. If not set, the highest " +"priority one will be used." +msgstr "" + +#. module: email_template +#: field:email.template,report_name:0 +#: field:email_template.preview,report_name:0 +msgid "Report Filename" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Preview" +msgstr "" + +#. module: email_template +#: field:email.template,reply_to:0 +#: field:email_template.preview,reply_to:0 +msgid "Reply-To" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Use template" +msgstr "" + +#. module: email_template +#: field:email.template,body_html:0 +#: field:email_template.preview,body_html:0 +msgid "Body" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:244 +#, python-format +msgid "%s (copy)" +msgstr "" + +#. module: email_template +#: help:email.template,user_signature:0 +#: help:email_template.preview,user_signature:0 +msgid "" +"If checked, the user's signature will be appended to the text version of the " +"message" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "SMTP Server" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Save as new template" +msgstr "" + +#. module: email_template +#: help:email.template,sub_object:0 +#: help:email_template.preview,sub_object:0 +msgid "" +"When a relationship field is selected as first field, this field shows the " +"document model the relationship goes to." +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_email_template +msgid "Email Templates" +msgstr "" + +#. module: email_template +#: help:email.template,report_name:0 +#: help:email_template.preview,report_name:0 +msgid "" +"Name to use for the generated report file (may contain placeholders)\n" +"The extension can be omitted and will then come from the report type." +msgstr "" + +#. module: email_template +#: field:email.template,ref_ir_act_window:0 +#: field:email_template.preview,ref_ir_act_window:0 +msgid "Sidebar action" +msgstr "" + +#. module: email_template +#: help:email.template,lang:0 +#: help:email_template.preview,lang:0 +msgid "" +"Optional translation language (ISO code) to select when sending out an " +"email. If not set, the english version will be used. This should usually be " +"a placeholder expression that provides the appropriate language code, e.g. " +"${object.partner_id.lang.code}." +msgstr "" + +#. module: email_template +#: field:email_template.preview,res_id:0 +msgid "Sample Document" +msgstr "" + +#. module: email_template +#: help:email.template,model_object_field:0 +#: help:email_template.preview,model_object_field:0 +msgid "" +"Select target field from the related document model.\n" +"If it is a relationship field you will be able to select a target field at " +"the destination of the relationship." +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Dynamic Value Builder" +msgstr "" + +#. module: email_template +#: model:ir.actions.act_window,name:email_template.wizard_email_template_preview +msgid "Template Preview" +msgstr "" + +#. module: email_template +#: view:mail.compose.message:0 +msgid "Save as a new template" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "" +"Display an option on related documents to open a composition wizard with " +"this template" +msgstr "" + +#. module: email_template +#: help:email.template,email_cc:0 +#: help:email_template.preview,email_cc:0 +msgid "Carbon copy recipients (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: help:email.template,email_to:0 +#: help:email_template.preview,email_to:0 +msgid "Comma-separated recipient addresses (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Advanced" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Preview of" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Using sample document" +msgstr "" + +#. module: email_template +#: view:email.template:0 +#: model:ir.actions.act_window,name:email_template.action_email_template_tree_all +#: model:ir.ui.menu,name:email_template.menu_email_templates +msgid "Templates" +msgstr "" + +#. module: email_template +#: field:email.template,name:0 +#: field:email_template.preview,name:0 +msgid "Name" +msgstr "" + +#. module: email_template +#: field:email.template,lang:0 +#: field:email_template.preview,lang:0 +msgid "Language" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_email_template_preview +msgid "Email Template Preview" +msgstr "" + +#. module: email_template +#: view:email_template.preview:0 +msgid "Email Preview" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "" +"Remove the contextual action to use this template on related documents" +msgstr "" + +#. module: email_template +#: field:email.template,copyvalue:0 +#: field:email_template.preview,copyvalue:0 +msgid "Placeholder Expression" +msgstr "" + +#. module: email_template +#: field:email.template,sub_object:0 +#: field:email_template.preview,sub_object:0 +msgid "Sub-model" +msgstr "" + +#. module: email_template +#: help:email.template,subject:0 +#: help:email_template.preview,subject:0 +msgid "Subject (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: help:email.template,reply_to:0 +#: help:email_template.preview,reply_to:0 +msgid "Preferred response address (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: field:email.template,ref_ir_value:0 +#: field:email_template.preview,ref_ir_value:0 +msgid "Sidebar Button" +msgstr "" + +#. module: email_template +#: field:email.template,report_template:0 +#: field:email_template.preview,report_template:0 +msgid "Optional report to print and attach" +msgstr "" + +#. module: email_template +#: help:email.template,null_value:0 +#: help:email_template.preview,null_value:0 +msgid "Optional value to use if the target field is empty" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Model" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Add context action" +msgstr "" + +#. module: email_template +#: help:email.template,model_id:0 +#: help:email_template.preview,model_id:0 +msgid "The kind of document with with this template can be used" +msgstr "" + +#. module: email_template +#: field:email.template,email_recipients:0 +#: field:email_template.preview,email_recipients:0 +msgid "To (Partners)" +msgstr "" + +#. module: email_template +#: field:email.template,auto_delete:0 +#: field:email_template.preview,auto_delete:0 +msgid "Auto Delete" +msgstr "" + +#. module: email_template +#: help:email.template,copyvalue:0 +#: help:email_template.preview,copyvalue:0 +msgid "" +"Final placeholder expression, to be copy-pasted in the desired template " +"field." +msgstr "" + +#. module: email_template +#: field:email.template,model:0 +#: field:email_template.preview,model:0 +msgid "Related Document Model" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Addressing" +msgstr "" + +#. module: email_template +#: help:email.template,email_recipients:0 +#: help:email_template.preview,email_recipients:0 +msgid "" +"Comma-separated ids of recipient partners (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: field:email.template,attachment_ids:0 +#: field:email_template.preview,attachment_ids:0 +msgid "Attachments" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:231 +#, python-format +msgid "Deletion of the action record failed." +msgstr "" + +#. module: email_template +#: field:email.template,email_cc:0 +#: field:email_template.preview,email_cc:0 +msgid "Cc" +msgstr "" + +#. module: email_template +#: field:email.template,model_id:0 +#: field:email_template.preview,model_id:0 +msgid "Applies to" +msgstr "" + +#. module: email_template +#: field:email.template,sub_model_object_field:0 +#: field:email_template.preview,sub_model_object_field:0 +msgid "Sub-field" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Email Details" +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:196 +#, python-format +msgid "Send Mail (%s)" +msgstr "" + +#. module: email_template +#: help:res.partner,opt_out:0 +msgid "" +"If checked, this partner will not receive any automated email notifications, " +"such as the availability of invoices." +msgstr "" + +#. module: email_template +#: help:email.template,auto_delete:0 +#: help:email_template.preview,auto_delete:0 +msgid "Permanently delete this email after sending it, to save space" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Group by..." +msgstr "" + +#. module: email_template +#: help:email.template,sub_model_object_field:0 +#: help:email_template.preview,sub_model_object_field:0 +msgid "" +"When a relationship field is selected as first field, this field lets you " +"select the target field within the destination document model (sub-model)." +msgstr "" + +#. module: email_template +#: code:addons/email_template/email_template.py:231 +#, python-format +msgid "Warning" +msgstr "" + +#. module: email_template +#: field:email.template,user_signature:0 +#: field:email_template.preview,user_signature:0 +msgid "Add Signature" +msgstr "" + +#. module: email_template +#: model:ir.model,name:email_template.model_res_partner +msgid "Partner" +msgstr "" + +#. module: email_template +#: field:email.template,null_value:0 +#: field:email_template.preview,null_value:0 +msgid "Default Value" +msgstr "" + +#. module: email_template +#: help:email.template,attachment_ids:0 +#: help:email_template.preview,attachment_ids:0 +msgid "" +"You may attach files to this template, to be added to all emails created " +"from this template" +msgstr "" + +#. module: email_template +#: help:email.template,body_html:0 +#: help:email_template.preview,body_html:0 +msgid "Rich-text/HTML version of the message (placeholders may be used here)" +msgstr "" + +#. module: email_template +#: view:email.template:0 +msgid "Contents" +msgstr "" + +#. module: email_template +#: field:email.template,subject:0 +#: field:email_template.preview,subject:0 +msgid "Subject" +msgstr "" diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index c422a2d4948..73daa64f841 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -52,6 +52,9 @@ class hr_expense_expense(osv.osv): res[expense.id] = total return res + def _get_expense_from_line(self, cr, uid, ids, context=None): + return [line.expense_id.id for line in self.pool.get('hr.expense.line').browse(cr, uid, ids, context=context)] + def _get_currency(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, [uid], context=context)[0] if user.company_id: @@ -84,7 +87,10 @@ class hr_expense_expense(osv.osv): 'account_move_id': fields.many2one('account.move', 'Ledger Posting'), 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ), 'note': fields.text('Note'), - 'amount': fields.function(_amount, string='Total Amount', digits_compute=dp.get_precision('Account')), + 'amount': fields.function(_amount, string='Total Amount', digits_compute=dp.get_precision('Account'), + store={ + 'hr.expense.line': (_get_expense_from_line, ['unit_amount','unit_quantity'], 10) + }), 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'department_id':fields.many2one('hr.department','Department', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True), diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index eab24b06717..10abe95d892 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -32,7 +32,7 @@ <field name="user_id" invisible="1"/> <field name="name"/> <field name="currency_id" groups="base.group_multi_currency"/> - <field name="amount"/> + <field name="amount" sum="Total Amount"/> <field name="state"/> </tree> </field> diff --git a/addons/hr_payroll_account/i18n/lt.po b/addons/hr_payroll_account/i18n/lt.po new file mode 100644 index 00000000000..c29df14b44e --- /dev/null +++ b/addons/hr_payroll_account/i18n/lt.po @@ -0,0 +1,126 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:21+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: hr_payroll_account +#: field:hr.salary.rule,account_credit:0 +msgid "Credit Account" +msgstr "" + +#. module: hr_payroll_account +#: code:addons/hr_payroll_account/hr_payroll_account.py:103 +#, python-format +msgid "Payslip of %s" +msgstr "" + +#. module: hr_payroll_account +#: code:addons/hr_payroll_account/hr_payroll_account.py:156 +#, python-format +msgid "" +"The Expense Journal \"%s\" has not properly configured the Credit Account!" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.payslip,move_id:0 +msgid "Accounting Entry" +msgstr "" + +#. module: hr_payroll_account +#: code:addons/hr_payroll_account/hr_payroll_account.py:172 +#, python-format +msgid "" +"The Expense Journal \"%s\" has not properly configured the Debit Account!" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.salary.rule,account_tax_id:0 +msgid "Tax Code" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.payslip,period_id:0 +msgid "Force Period" +msgstr "" + +#. module: hr_payroll_account +#: help:hr.payslip,period_id:0 +msgid "Keep empty to use the period of the validation(Payslip) date." +msgstr "" + +#. module: hr_payroll_account +#: model:ir.model,name:hr_payroll_account.model_hr_contract +msgid "Contract" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.contract,analytic_account_id:0 +#: field:hr.salary.rule,analytic_account_id:0 +msgid "Analytic Account" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.salary.rule,account_debit:0 +msgid "Debit Account" +msgstr "" + +#. module: hr_payroll_account +#: model:ir.model,name:hr_payroll_account.model_hr_payslip_run +msgid "Payslip Batches" +msgstr "" + +#. module: hr_payroll_account +#: model:ir.model,name:hr_payroll_account.model_hr_payslip_employees +msgid "Generate payslips for all selected employees" +msgstr "" + +#. module: hr_payroll_account +#: code:addons/hr_payroll_account/hr_payroll_account.py:156 +#: code:addons/hr_payroll_account/hr_payroll_account.py:172 +#, python-format +msgid "Configuration Error!" +msgstr "" + +#. module: hr_payroll_account +#: model:ir.model,name:hr_payroll_account.model_hr_salary_rule +msgid "hr.salary.rule" +msgstr "" + +#. module: hr_payroll_account +#: view:hr.contract:0 +#: view:hr.salary.rule:0 +msgid "Accounting" +msgstr "" + +#. module: hr_payroll_account +#: model:ir.model,name:hr_payroll_account.model_hr_payslip +msgid "Pay Slip" +msgstr "" + +#. module: hr_payroll_account +#: code:addons/hr_payroll_account/hr_payroll_account.py:158 +#: code:addons/hr_payroll_account/hr_payroll_account.py:174 +#, python-format +msgid "Adjustment Entry" +msgstr "" + +#. module: hr_payroll_account +#: field:hr.contract,journal_id:0 +#: field:hr.payslip,journal_id:0 +#: field:hr.payslip.run,journal_id:0 +msgid "Salary Journal" +msgstr "" diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index b0b60db6bd5..e41d80fb348 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -510,8 +510,9 @@ class hr_job(osv.osv): def _auto_init(self, cr, context=None): """Installation hook to create aliases for all jobs and avoid constraint errors.""" - self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(hr_job,self)._auto_init, + res = self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(hr_job,self)._auto_init, self._columns['alias_id'], 'name', alias_prefix='job+', alias_defaults={'job_id': 'id'}, context=context) + return res def create(self, cr, uid, vals, context=None): mail_alias = self.pool.get('mail.alias') diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index f2d4e4736fa..335edc71892 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -4,8 +4,7 @@ An applicant is interested in the job position. So he sends a resume by email. - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'hr.applicant', request_message) - diff --git a/addons/im/__init__.py b/addons/im/__init__.py new file mode 100644 index 00000000000..23c6ad13350 --- /dev/null +++ b/addons/im/__init__.py @@ -0,0 +1,2 @@ + +import im diff --git a/addons/im/__openerp__.py b/addons/im/__openerp__.py new file mode 100644 index 00000000000..a76dd7c8cc2 --- /dev/null +++ b/addons/im/__openerp__.py @@ -0,0 +1,27 @@ +{ + 'name' : 'Instant Messaging', + 'version': '1.0', + 'summary': 'Live Chat, Talks with Others', + 'sequence': '18', + 'category': 'Tools', + 'complexity': 'easy', + 'description': + """ +Instant Messaging +================= + +Allows users to chat with each other in real time. Find other users easily and +chat in real time. It support several chats in parallel. + """, + 'data': [ + 'security/ir.model.access.csv', + 'security/im_security.xml', + ], + 'depends' : ['base'], + 'js': ['static/src/js/*.js'], + 'css': ['static/src/css/*.css'], + 'qweb': ['static/src/xml/*.xml'], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/addons/im/im.py b/addons/im/im.py new file mode 100644 index 00000000000..0de9ea8c79b --- /dev/null +++ b/addons/im/im.py @@ -0,0 +1,351 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import openerp +import openerp.tools.config +import openerp.modules.registry +from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT +import datetime +from openerp.osv import osv, fields +import time +import logging +import json +import select + +_logger = logging.getLogger(__name__) + +def listen_channel(cr, channel_name, handle_message, check_stop=(lambda: False), check_stop_timer=60.): + """ + Begin a loop, listening on a PostgreSQL channel. This method does never terminate by default, you need to provide a check_stop + callback to do so. This method also assume that all notifications will include a message formated using JSON (see the + corresponding notify_channel() method). + + :param db_name: database name + :param channel_name: the name of the PostgreSQL channel to listen + :param handle_message: function that will be called when a message is received. It takes one argument, the message + attached to the notification. + :type handle_message: function (one argument) + :param check_stop: function that will be called periodically (see the check_stop_timer argument). If it returns True + this function will stop to watch the channel. + :type check_stop: function (no arguments) + :param check_stop_timer: The maximum amount of time between calls to check_stop_timer (can be shorter if messages + are received). + """ + try: + conn = cr._cnx + cr.execute("listen " + channel_name + ";") + cr.commit(); + stopping = False + while not stopping: + if check_stop(): + stopping = True + break + if select.select([conn], [], [], check_stop_timer) == ([],[],[]): + pass + else: + conn.poll() + while conn.notifies: + message = json.loads(conn.notifies.pop().payload) + handle_message(message) + finally: + try: + cr.execute("unlisten " + channel_name + ";") + cr.commit() + except: + pass # can't do anything if that fails + +def notify_channel(cr, channel_name, message): + """ + Send a message through a PostgreSQL channel. The message will be formatted using JSON. This method will + commit the given transaction because the notify command in Postgresql seems to work correctly when executed in + a separate transaction (despite what is written in the documentation). + + :param cr: The cursor. + :param channel_name: The name of the PostgreSQL channel. + :param message: The message, must be JSON-compatible data. + """ + cr.commit() + cr.execute("notify " + channel_name + ", %s", [json.dumps(message)]) + cr.commit() + +POLL_TIMER = 30 +DISCONNECTION_TIMER = POLL_TIMER + 5 +WATCHER_ERROR_DELAY = 10 + +if openerp.evented: + import gevent + import gevent.event + + class ImWatcher(object): + watchers = {} + + @staticmethod + def get_watcher(db_name): + if not ImWatcher.watchers.get(db_name): + ImWatcher(db_name) + return ImWatcher.watchers[db_name] + + def __init__(self, db_name): + self.db_name = db_name + ImWatcher.watchers[db_name] = self + self.waiting = 0 + self.wait_id = 0 + self.users = {} + self.users_watch = {} + gevent.spawn(self.loop) + + def loop(self): + _logger.info("Begin watching on channel im_channel for database " + self.db_name) + stop = False + while not stop: + try: + registry = openerp.modules.registry.RegistryManager.get(self.db_name) + with registry.cursor() as cr: + listen_channel(cr, "im_channel", self.handle_message, self.check_stop) + stop = True + except: + # if something crash, we wait some time then try again + _logger.exception("Exception during watcher activity") + time.sleep(WATCHER_ERROR_DELAY) + _logger.info("End watching on channel im_channel for database " + self.db_name) + del ImWatcher.watchers[self.db_name] + + def handle_message(self, message): + if message["type"] == "message": + for waiter in self.users.get(message["receiver"], {}).values(): + waiter.set() + else: #type status + for waiter in self.users_watch.get(message["user"], {}).values(): + waiter.set() + + def check_stop(self): + return self.waiting == 0 + + def _get_wait_id(self): + self.wait_id += 1 + return self.wait_id + + def stop(self, user_id, watch_users, timeout=None): + wait_id = self._get_wait_id() + event = gevent.event.Event() + self.waiting += 1 + self.users.setdefault(user_id, {})[wait_id] = event + for watch in watch_users: + self.users_watch.setdefault(watch, {})[wait_id] = event + try: + event.wait(timeout) + finally: + for watch in watch_users: + del self.users_watch[watch][wait_id] + if len(self.users_watch[watch]) == 0: + del self.users_watch[watch] + del self.users[user_id][wait_id] + if len(self.users[user_id]) == 0: + del self.users[user_id] + self.waiting -= 1 + + +class LongPollingController(openerp.addons.web.http.Controller): + _cp_path = '/longpolling/im' + + @openerp.addons.web.http.jsonrequest + def poll(self, req, last=None, users_watch=None, db=None, uid=None, password=None, uuid=None): + assert_uuid(uuid) + if not openerp.evented: + raise Exception("Not usable in a server not running gevent") + if db is not None: + req.session._db = db + req.session._uid = uid + req.session._password = password + req.session.model('im.user').im_connect(uuid=uuid, context=req.context) + my_id = req.session.model('im.user').get_by_user_id(uuid or req.session._uid, req.context)["id"] + num = 0 + while True: + res = req.session.model('im.message').get_messages(last, users_watch, uuid=uuid, context=req.context) + if num >= 1 or len(res["res"]) > 0: + return res + last = res["last"] + num += 1 + ImWatcher.get_watcher(res["dbname"]).stop(my_id, users_watch or [], POLL_TIMER) + + @openerp.addons.web.http.jsonrequest + def activated(self, req): + return not not openerp.evented + + @openerp.addons.web.http.jsonrequest + def gen_uuid(self, req): + import uuid + return "%s" % uuid.uuid1() + +def assert_uuid(uuid): + if not isinstance(uuid, (str, unicode, type(None))): + raise Exception("%s is not a uuid" % uuid) + + +class im_message(osv.osv): + _name = 'im.message' + + _order = "date desc" + + _columns = { + 'message': fields.char(string="Message", size=200, required=True), + 'from_id': fields.many2one("im.user", "From", required= True, ondelete='cascade'), + 'to_id': fields.many2one("im.user", "To", required=True, select=True, ondelete='cascade'), + 'date': fields.datetime("Date", required=True, select=True), + } + + _defaults = { + 'date': lambda *args: datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT), + } + + def get_messages(self, cr, uid, last=None, users_watch=None, uuid=None, context=None): + assert_uuid(uuid) + users_watch = users_watch or [] + + # complex stuff to determine the last message to show + users = self.pool.get("im.user") + my_id = users.get_by_user_id(cr, uid, uuid or uid, context=context)["id"] + c_user = users.browse(cr, openerp.SUPERUSER_ID, my_id, context=context) + if last: + if c_user.im_last_received < last: + users.write(cr, openerp.SUPERUSER_ID, my_id, {'im_last_received': last}, context=context) + else: + last = c_user.im_last_received or -1 + + # how fun it is to always need to reorder results from read + mess_ids = self.search(cr, openerp.SUPERUSER_ID, [['id', '>', last], ['to_id', '=', my_id]], order="id", context=context) + mess = self.read(cr, openerp.SUPERUSER_ID, mess_ids, ["id", "message", "from_id", "date"], context=context) + index = {} + for i in xrange(len(mess)): + index[mess[i]["id"]] = mess[i] + mess = [] + for i in mess_ids: + mess.append(index[i]) + + if len(mess) > 0: + last = mess[-1]["id"] + users_status = users.read(cr, openerp.SUPERUSER_ID, users_watch, ["im_status"], context=context) + return {"res": mess, "last": last, "dbname": cr.dbname, "users_status": users_status} + + def post(self, cr, uid, message, to_user_id, uuid=None, context=None): + assert_uuid(uuid) + my_id = self.pool.get('im.user').get_by_user_id(cr, uid, uuid or uid)["id"] + self.create(cr, openerp.SUPERUSER_ID, {"message": message, 'from_id': my_id, 'to_id': to_user_id}, context=context) + notify_channel(cr, "im_channel", {'type': 'message', 'receiver': to_user_id}) + return False + +class im_user(osv.osv): + _name = "im.user" + + def _im_status(self, cr, uid, ids, something, something_else, context=None): + res = {} + current = datetime.datetime.now() + delta = datetime.timedelta(0, DISCONNECTION_TIMER) + data = self.read(cr, openerp.SUPERUSER_ID, ids, ["im_last_status_update", "im_last_status"], context=context) + for obj in data: + last_update = datetime.datetime.strptime(obj["im_last_status_update"], DEFAULT_SERVER_DATETIME_FORMAT) + res[obj["id"]] = obj["im_last_status"] and (last_update + delta) > current + return res + + def search_users(self, cr, uid, domain, fields, limit, context=None): + # do not user openerp.SUPERUSER_ID, reserved to normal users + found = self.pool.get('res.users').search(cr, uid, domain, limit=limit, context=context) + found = self.get_by_user_ids(cr, uid, found, context=context) + return self.read(cr, uid, found, fields, context=context) + + def im_connect(self, cr, uid, uuid=None, context=None): + assert_uuid(uuid) + return self._im_change_status(cr, uid, True, uuid, context) + + def im_disconnect(self, cr, uid, uuid=None, context=None): + assert_uuid(uuid) + return self._im_change_status(cr, uid, False, uuid, context) + + def _im_change_status(self, cr, uid, new_one, uuid=None, context=None): + assert_uuid(uuid) + id = self.get_by_user_id(cr, uid, uuid or uid, context=context)["id"] + current_status = self.read(cr, openerp.SUPERUSER_ID, id, ["im_status"], context=None)["im_status"] + self.write(cr, openerp.SUPERUSER_ID, id, {"im_last_status": new_one, + "im_last_status_update": datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context) + if current_status != new_one: + notify_channel(cr, "im_channel", {'type': 'status', 'user': id}) + return True + + def get_by_user_id(self, cr, uid, id, context=None): + ids = self.get_by_user_ids(cr, uid, [id], context=context) + return ids[0] + + def get_by_user_ids(self, cr, uid, ids, context=None): + user_ids = [x for x in ids if isinstance(x, int)] + uuids = [x for x in ids if isinstance(x, (str, unicode))] + users = self.search(cr, openerp.SUPERUSER_ID, ["|", ["user", "in", user_ids], ["uuid", "in", uuids]], context=None) + records = self.read(cr, openerp.SUPERUSER_ID, users, ["user", "uuid"], context=None) + inside = {} + for i in records: + if i["user"]: + inside[i["user"][0]] = True + elif ["uuid"]: + inside[i["uuid"]] = True + not_inside = {} + for i in ids: + if not (i in inside): + not_inside[i] = True + for to_create in not_inside.keys(): + if isinstance(to_create, int): + created = self.create(cr, openerp.SUPERUSER_ID, {"user": to_create}, context=context) + records.append({"id": created, "user": [to_create, ""]}) + else: + created = self.create(cr, openerp.SUPERUSER_ID, {"uuid": to_create}, context=context) + records.append({"id": created, "uuid": to_create}) + return records + + def assign_name(self, cr, uid, uuid, name, context=None): + assert_uuid(uuid) + id = self.get_by_user_id(cr, uid, uuid or uid, context=context)["id"] + self.write(cr, openerp.SUPERUSER_ID, id, {"assigned_name": name}, context=context) + return True + + def _get_name(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = record.assigned_name + if record.user: + res[record.id] = record.user.name + continue + return res + + _columns = { + 'name': fields.function(_get_name, type='char', size=200, string="Name", store=True, readonly=True), + 'assigned_name': fields.char(string="Assigned Name", size=200, required=False), + 'image': fields.related('user', 'image_small', type='binary', string="Image", readonly=True), + 'user': fields.many2one("res.users", string="User", select=True, ondelete='cascade'), + 'uuid': fields.char(string="UUID", size=50, select=True), + 'im_last_received': fields.integer(string="Instant Messaging Last Received Message"), + 'im_last_status': fields.boolean(strint="Instant Messaging Last Status"), + 'im_last_status_update': fields.datetime(string="Instant Messaging Last Status Update"), + 'im_status': fields.function(_im_status, string="Instant Messaging Status", type='boolean'), + } + + _defaults = { + 'im_last_received': -1, + 'im_last_status': False, + 'im_last_status_update': lambda *args: datetime.datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT), + } diff --git a/addons/im/security/im_security.xml b/addons/im/security/im_security.xml new file mode 100644 index 00000000000..10297ac0669 --- /dev/null +++ b/addons/im/security/im_security.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<openerp> + <data> + <record id="message_rule_1" model="ir.rule"> + <field name="name">Can only read messages that you sent or messages sent to you</field> + <field name="model_id" ref="model_im_message"/> + <field name="groups" eval="[(6,0,[ref('base.group_user')])]"/> + <field name="domain_force">["|", ('to_id.user', '=', user.id), ('from_id.user', '=', user.id)]</field> + <field name="perm_unlink" eval="0"/> + <field name="perm_write" eval="0"/> + <field name="perm_read" eval="1"/> + <field name="perm_create" eval="0"/> + </record> + + <record id="users_rule_1" model="ir.rule"> + <field name="name">Can only modify your user</field> + <field name="model_id" ref="model_im_user"/> + <field name="groups" eval="[(6,0,[ref('base.group_user')])]"/> + <field name="domain_force">[('user', '=', user.id)]</field> + <field name="perm_unlink" eval="0"/> + <field name="perm_write" eval="1"/> + <field name="perm_read" eval="0"/> + <field name="perm_create" eval="0"/> + </record> + </data> +</openerp> diff --git a/addons/im/security/ir.model.access.csv b/addons/im/security/ir.model.access.csv new file mode 100644 index 00000000000..ed639353e21 --- /dev/null +++ b/addons/im/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_im_message,im.message,model_im_message,base.group_user,1,0,1,0 +access_im_user,im.user,model_im_user,base.group_user,1,1,1,0
\ No newline at end of file diff --git a/addons/im/static/src/audio/Ting.mp3 b/addons/im/static/src/audio/Ting.mp3 Binary files differnew file mode 100644 index 00000000000..6fd090a89ce --- /dev/null +++ b/addons/im/static/src/audio/Ting.mp3 diff --git a/addons/im/static/src/audio/Ting.ogg b/addons/im/static/src/audio/Ting.ogg Binary files differnew file mode 100644 index 00000000000..8d17ea85bd3 --- /dev/null +++ b/addons/im/static/src/audio/Ting.ogg diff --git a/addons/im/static/src/audio/purr.mp3 b/addons/im/static/src/audio/purr.mp3 Binary files differnew file mode 100644 index 00000000000..849d303c3b1 --- /dev/null +++ b/addons/im/static/src/audio/purr.mp3 diff --git a/addons/im/static/src/audio/purr.ogg b/addons/im/static/src/audio/purr.ogg Binary files differnew file mode 100644 index 00000000000..2ddc77537f1 --- /dev/null +++ b/addons/im/static/src/audio/purr.ogg diff --git a/addons/im/static/src/css/im.css b/addons/im/static/src/css/im.css new file mode 100644 index 00000000000..2f3e7dd58bb --- /dev/null +++ b/addons/im/static/src/css/im.css @@ -0,0 +1,258 @@ + +.openerp .oe_im { + position: fixed; + background-color: #E8EBEF; + width: 220px; + border-left: 1px solid #AEB9BD; +} + +/* button */ + +.openerp .oe_topbar_imbutton { + cursor: pointer; +} + +/* search stuff */ +.openerp .oe_im_frame_header { + position: relative; + background: #dedede; + background: -moz-linear-gradient(#fcfcfc, #dedede); + background: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); + border-bottom: 1px solid border-color !important; + padding: 5px; +} +.openerp .oe_im_frame_header .oe_im_searchbox { + width: 168px; + padding: 1px 21px 1px 19px; + font-size: 13px; + -moz-border-radius: 13px; + -webkit-border-radius: 13px; + border-radius: 13px; +} +.openerp .oe_im_frame_header .oe_im_search_icon { + position: absolute; + color: #888; + top: 2px; + left: 9px; + font-size: 28px; + font-family: "entypoRegular" !important; + font-weight: 300 !important; +} +.openerp .oe_im_frame_header .oe_im_search_clear { + display: none; + position: absolute; + right: 11px; + top: 4px; + font-size: 26px; + color: #b6b6b6; + cursor: pointer; +} +.openerp .oe_im_frame_header .oe_im_search_clear:hover { + color: #888; +} + +/* users */ + +.openerp .oe_im_users { + padding-bottom: 38px; +} +.openerp .oe_im_user { + position: relative; + padding: 2px 6px; + cursor: pointer; + font-size: 13px; + margin-bottom: 3px; +} +.openerp .oe_im_user:hover { + background: lightGrey; +} +.openerp .oe_im_user_clip { + display: inline-block; + width: 26px; + height: 26px; + margin-right: 4px; + -moz-box-shadow: 0 0 2px 1px rgba(0,0,0,0.25); + -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); +} +.openerp .oe_im_user_avatar { + width: 26px; + height: auto; +} +.openerp .oe_im_user_name { + width: 162px; + line-height: 26px; + padding-right: 15px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + position: relative; +} + +.openerp .oe_im_user_online { + display: none; + position: absolute; + top: 9.5px; + right: 11px; + width: 11px; + height: 11px; + vertical-align: middle; + border: 0; +} + +/* conversations */ + +.openerp .oe_im_chatview { + position: fixed; + overflow: hidden; + bottom: 6px; + margin-right: 6px; + background: rgba(60, 60, 60, 0.8); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 0 3px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3); + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); + width: 240px; +} +.openerp .oe_im_chatview .oe_im_chatview_disconnected { + display:none; + z-index: 100; + width: 100%; + background: #E8EBEF; + padding: 5px; + font-size: 11px; + color: #999; + line-height: 14px; + height: 28px; + overflow: hidden; +} +.openerp .oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_disconnected { + display: block; +} +.openerp .oe_im_chatview .oe_im_chatview_header { + padding: 3px 6px 2px; + background: #DEDEDE; + background: -moz-linear-gradient(#FCFCFC, #DEDEDE); + background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE)); + -moz-border-radius: 3px 3px 0 0; + -webkit-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + border-bottom: 1px solid #AEB9BD; + cursor: pointer; +} +.openerp .oe_im_chatview .oe_im_chatview_close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; + font-size: 18px; + line-height: 16px; + float: right; + font-weight: bold; + color: black; + text-shadow: 0 1px 0 white; + opacity: 0.2; +} +.openerp .oe_im_chatview .oe_im_chatview_content { + overflow: auto; + height: 287px; +} +.openerp .oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_content { + height: 249px; +} +.openerp .oe_im_chatview .oe_im_chatview_footer { + position: relative; + padding: 3px; + border-top: 1px solid #AEB9BD; + background: #DEDEDE; + background: -moz-linear-gradient(#FCFCFC, #DEDEDE); + background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE)); + -moz-border-radius: 0 0 3px 3px; + -webkit-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; +} +.openerp .oe_im_chatview .oe_im_chatview_input { + width: 222px; + font-family: Lato, Helvetica, sans-serif; + font-size: 13px; + color: #333; + padding: 1px 5px; + border: 1px solid #AEB9BD; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: inset 0 1px 4px rgba(0,0,0,0.2); + -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2); +} +.openerp .oe_im_chatview .oe_im_chatview_bubble { + background: white; + position: relative; + padding: 3px; + margin: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.openerp .oe_im_chatview .oe_im_chatview_clip { + position: relative; + float: left; + width: 26px; + height: 26px; + margin-right: 4px; + -moz-box-shadow: 0 0 2px 1px rgba(0,0,0,0.25); + -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); +} +.openerp .oe_im_chatview .oe_im_chatview_avatar { + float: left; + width: 26px; + height: auto; + clip: rect(0, 26px, 26px, 0); + max-width: 100%; + width: auto 9; + height: auto; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} +.openerp .oe_im_chatview .oe_im_chatview_time { + position: absolute; + right: 0px; + top: 0px; + margin: 3px; + text-align: right; + line-height: 13px; + font-size: 11px; + color: #999; + width: 60px; + overflow: hidden; +} +.openerp .oe_im_chatview .oe_im_chatview_from { + margin: 0 0 2px 0; + line-height: 14px; + font-weight: bold; + font-size: 12px; + width: 140px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + color: #3A87AD; +} +.openerp .oe_im_chatview .oe_im_chatview_bubble_list { +} +.openerp .oe_im_chatview .oe_im_chatview_bubble_item { + margin: 0 0 2px 30px; + line-height: 14px; + word-wrap: break-word; +} + +.openerp .oe_im_chatview_online { + display: none; + margin-top: -4px; + width: 11px; + height: 11px; +} diff --git a/addons/im/static/src/img/avatar/avatar.jpeg b/addons/im/static/src/img/avatar/avatar.jpeg Binary files differnew file mode 100644 index 00000000000..7168794022e --- /dev/null +++ b/addons/im/static/src/img/avatar/avatar.jpeg diff --git a/addons/im/static/src/img/button-gloss.png b/addons/im/static/src/img/button-gloss.png Binary files differnew file mode 100755 index 00000000000..6f3957702fe --- /dev/null +++ b/addons/im/static/src/img/button-gloss.png diff --git a/addons/im/static/src/img/glyphicons-halflings-white.png b/addons/im/static/src/img/glyphicons-halflings-white.png Binary files differnew file mode 100755 index 00000000000..3bf6484a29d --- /dev/null +++ b/addons/im/static/src/img/glyphicons-halflings-white.png diff --git a/addons/im/static/src/img/glyphicons-halflings.png b/addons/im/static/src/img/glyphicons-halflings.png Binary files differnew file mode 100755 index 00000000000..a9969993201 --- /dev/null +++ b/addons/im/static/src/img/glyphicons-halflings.png diff --git a/addons/im/static/src/img/green.png b/addons/im/static/src/img/green.png Binary files differnew file mode 100644 index 00000000000..01fb373c251 --- /dev/null +++ b/addons/im/static/src/img/green.png diff --git a/addons/im/static/src/img/icon.png b/addons/im/static/src/img/icon.png Binary files differnew file mode 100644 index 00000000000..07d2503ce4e --- /dev/null +++ b/addons/im/static/src/img/icon.png diff --git a/addons/im/static/src/img/logo.png b/addons/im/static/src/img/logo.png Binary files differnew file mode 100644 index 00000000000..aca5f4c60d8 --- /dev/null +++ b/addons/im/static/src/img/logo.png diff --git a/addons/im/static/src/img/wood.png b/addons/im/static/src/img/wood.png Binary files differnew file mode 100644 index 00000000000..22f2450d3ad --- /dev/null +++ b/addons/im/static/src/img/wood.png diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js new file mode 100644 index 00000000000..b21a339cb84 --- /dev/null +++ b/addons/im/static/src/js/im.js @@ -0,0 +1,463 @@ + +openerp.im = function(instance) { + + var USERS_LIMIT = 20; + var ERROR_DELAY = 5000; + + var _t = instance.web._t, + _lt = instance.web._lt; + var QWeb = instance.web.qweb; + + instance.web.UserMenu.include({ + do_update: function(){ + var self = this; + this.update_promise.then(function() { + var im = new instance.im.InstantMessaging(self); + im.appendTo(instance.client.$el); + var button = new instance.im.ImTopButton(this); + button.on("clicked", im, im.switch_display); + button.appendTo(instance.webclient.$el.find('.oe_systray')); + }); + return this._super.apply(this, arguments); + }, + }); + + instance.im.ImTopButton = instance.web.Widget.extend({ + template:'ImTopButton', + events: { + "click": "clicked", + }, + clicked: function() { + this.trigger("clicked"); + }, + }); + + instance.im.InstantMessaging = instance.web.Widget.extend({ + template: "InstantMessaging", + events: { + "keydown .oe_im_searchbox": "input_change", + "keyup .oe_im_searchbox": "input_change", + "change .oe_im_searchbox": "input_change", + }, + init: function(parent) { + this._super(parent); + this.shown = false; + this.set("right_offset", 0); + this.set("current_search", ""); + this.users = []; + this.c_manager = new instance.im.ConversationManager(this); + this.on("change:right_offset", this.c_manager, _.bind(function() { + this.c_manager.set("right_offset", this.get("right_offset")); + }, this)); + this.user_search_dm = new instance.web.DropMisordered(); + }, + start: function() { + this.$el.css("right", -this.$el.outerWidth()); + $(window).scroll(_.bind(this.calc_box, this)); + $(window).resize(_.bind(this.calc_box, this)); + this.calc_box(); + + this.on("change:current_search", this, this.search_changed); + this.search_changed(); + + var self = this; + + return this.c_manager.start_polling(); + }, + calc_box: function() { + var $topbar = instance.client.$(".oe_topbar"); + var top = $topbar.offset().top + $topbar.height(); + top = Math.max(top - $(window).scrollTop(), 0); + this.$el.css("top", top); + this.$el.css("bottom", 0); + }, + input_change: function() { + this.set("current_search", this.$(".oe_im_searchbox").val()); + }, + search_changed: function(e) { + var users = new instance.web.Model("im.user"); + var self = this; + return this.user_search_dm.add(users.call("search_users", + [[["name", "ilike", this.get("current_search")], ["id", "<>", instance.session.uid]], + ["name", "user", "uuid", "im_status"], USERS_LIMIT], {context:new instance.web.CompoundContext()})).then(function(result) { + self.c_manager.add_to_user_cache(result); + self.$(".oe_im_input").val(""); + var old_users = self.users; + self.users = []; + _.each(result, function(user) { + var widget = new instance.im.UserWidget(self, self.c_manager.get_user(user.id)); + widget.appendTo(self.$(".oe_im_users")); + widget.on("activate_user", self, self.activate_user); + self.users.push(widget); + }); + _.each(old_users, function(user) { + user.destroy(); + }); + }); + }, + switch_display: function() { + var fct = _.bind(function(place) { + this.set("right_offset", place + this.$el.outerWidth()); + }, this); + var opt = { + step: fct, + }; + if (this.shown) { + this.$el.animate({ + right: -this.$el.outerWidth(), + }, opt); + } else { + if (! this.c_manager.get_activated()) { + this.do_warn("Instant Messaging is not activated on this server.", ""); + return; + } + this.$el.animate({ + right: 0, + }, opt); + } + this.shown = ! this.shown; + }, + activate_user: function(user) { + this.c_manager.activate_user(user, true); + }, + }); + + instance.im.UserWidget = instance.web.Widget.extend({ + "template": "UserWidget", + events: { + "click": "activate_user", + }, + init: function(parent, user) { + this._super(parent); + this.user = user; + this.user.add_watcher(); + }, + start: function() { + var change_status = function() { + this.$(".oe_im_user_online").toggle(this.user.get("im_status") === true); + }; + this.user.on("change:im_status", this, change_status); + change_status.call(this); + }, + activate_user: function() { + this.trigger("activate_user", this.user); + }, + destroy: function() { + this.user.remove_watcher(); + this._super(); + }, + }); + + instance.im.ImUser = instance.web.Class.extend(instance.web.PropertiesMixin, { + init: function(parent, user_rec) { + instance.web.PropertiesMixin.init.call(this, parent); + user_rec.image_url = instance.session.url("/im/static/src/img/avatar/avatar.jpeg"); + if (user_rec.user) + user_rec.image_url = instance.session.url('/web/binary/image', {model:'res.users', field: 'image_small', id: user_rec.user[0]}); + this.set(user_rec); + this.set("watcher_count", 0); + this.on("change:watcher_count", this, function() { + if (this.get("watcher_count") === 0) + this.destroy(); + }); + }, + destroy: function() { + this.trigger("destroyed"); + instance.web.PropertiesMixin.destroy.call(this); + }, + add_watcher: function() { + this.set("watcher_count", this.get("watcher_count") + 1); + }, + remove_watcher: function() { + this.set("watcher_count", this.get("watcher_count") - 1); + }, + }); + + instance.im.ConversationManager = instance.web.Controller.extend({ + init: function(parent) { + this._super(parent); + this.set("right_offset", 0); + this.conversations = []; + this.users = {}; + this.on("change:right_offset", this, this.calc_positions); + this.set("window_focus", true); + this.set("waiting_messages", 0); + this.focus_hdl = _.bind(function() { + this.set("window_focus", true); + }, this); + $(window).bind("focus", this.focus_hdl); + this.blur_hdl = _.bind(function() { + this.set("window_focus", false); + }, this); + $(window).bind("blur", this.blur_hdl); + this.on("change:window_focus", this, this.window_focus_change); + this.window_focus_change(); + this.on("change:waiting_messages", this, this.messages_change); + this.messages_change(); + this.create_ting(); + this.activated = false; + this.users_cache = {}; + this.last = null; + this.unload_event_handler = _.bind(this.unload, this); + }, + start_polling: function() { + var self = this; + return new instance.web.Model("im.user").call("get_by_user_id", [instance.session.uid]).then(function(my_id) { + self.my_id = my_id["id"]; + return self.ensure_users([self.my_id]).then(function() { + var me = self.users_cache[self.my_id]; + delete self.users_cache[self.my_id]; + self.me = me; + self.rpc("/longpolling/im/activated", {}, {shadow: true}).then(function(activated) { + if (activated) { + self.activated = true; + $(window).on("unload", self.unload_event_handler); + self.poll(); + } + }, function(a, e) { + e.preventDefault(); + }); + }); + }); + }, + unload: function() { + return new instance.web.Model("im.user").call("im_disconnect", [], {context: new instance.web.CompoundContext()}); + }, + ensure_users: function(user_ids) { + var no_cache = {}; + _.each(user_ids, function(el) { + if (! this.users_cache[el]) + no_cache[el] = el; + }, this); + var self = this; + if (_.size(no_cache) === 0) + return $.when(); + else + return new instance.web.Model("im.user").call("read", [_.values(no_cache), ["name", "user", "uuid", "im_status"]], + {context: new instance.web.CompoundContext()}).then(function(users) { + self.add_to_user_cache(users); + }); + }, + add_to_user_cache: function(user_recs) { + _.each(user_recs, function(user_rec) { + if (! this.users_cache[user_rec.id]) { + var user = new instance.im.ImUser(this, user_rec); + this.users_cache[user_rec.id] = user; + user.on("destroyed", this, function() { + delete this.users_cache[user_rec.id]; + }); + } + }, this); + }, + get_user: function(user_id) { + return this.users_cache[user_id]; + }, + poll: function() { + var self = this; + var user_ids = _.map(this.users_cache, function(el) { + return el.get("id"); + }); + this.rpc("/longpolling/im/poll", { + last: this.last, + users_watch: user_ids, + context: instance.web.pyeval.eval('context', {}), + }, {shadow: true}).then(function(result) { + _.each(result.users_status, function(el) { + if (self.get_user(el.id)) + self.get_user(el.id).set(el); + }); + self.last = result.last; + var user_ids = _.pluck(_.pluck(result.res, "from_id"), 0); + self.ensure_users(user_ids).then(function() { + _.each(result.res, function(mes) { + var user = self.get_user(mes.from_id[0]); + self.received_message(mes, user); + }); + self.poll(); + }); + }, function(unused, e) { + e.preventDefault(); + setTimeout(_.bind(self.poll, self), ERROR_DELAY); + }); + }, + get_activated: function() { + return this.activated; + }, + create_ting: function() { + var kitten = jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined; + this.ting = new Audio(instance.webclient.session.origin + "/im/static/src/audio/" + (kitten ? "purr" : "Ting") + + (new Audio().canPlayType("audio/ogg; codecs=vorbis") ? ".ogg" : ".mp3")); + }, + window_focus_change: function() { + if (this.get("window_focus")) { + this.set("waiting_messages", 0); + } + }, + messages_change: function() { + if (! instance.webclient.set_title_part) + return; + instance.webclient.set_title_part("aa_im_messages", this.get("waiting_messages") === 0 ? undefined : + _.str.sprintf(_t("%d Messages"), this.get("waiting_messages"))); + }, + activate_user: function(user, focus) { + var conv = this.users[user.get('id')]; + if (! conv) { + conv = new instance.im.Conversation(this, user, this.me); + conv.appendTo(instance.client.$el); + conv.on("destroyed", this, function() { + this.conversations = _.without(this.conversations, conv); + delete this.users[conv.user.get('id')]; + this.calc_positions(); + }); + this.conversations.push(conv); + this.users[user.get('id')] = conv; + this.calc_positions(); + } + if (focus) + conv.focus(); + return conv; + }, + received_message: function(message, user) { + if (! this.get("window_focus")) { + this.set("waiting_messages", this.get("waiting_messages") + 1); + this.ting.play(); + this.create_ting(); + } + var conv = this.activate_user(user); + conv.received_message(message); + }, + calc_positions: function() { + var current = this.get("right_offset"); + _.each(_.range(this.conversations.length), function(i) { + this.conversations[i].set("right_position", current); + current += this.conversations[i].$el.outerWidth(true); + }, this); + }, + destroy: function() { + $(window).off("unload", this.unload_event_handler); + $(window).unbind("blur", this.blur_hdl); + $(window).unbind("focus", this.focus_hdl); + this._super(); + }, + }); + + instance.im.Conversation = instance.web.Widget.extend({ + "template": "Conversation", + events: { + "keydown input": "send_message", + "click .oe_im_chatview_close": "destroy", + "click .oe_im_chatview_header": "show_hide", + }, + init: function(parent, user, me) { + this._super(parent); + this.me = me; + this.user = user; + this.user.add_watcher(); + this.set("right_position", 0); + this.shown = true; + this.set("pending", 0); + }, + start: function() { + var change_status = function() { + this.$el.toggleClass("oe_im_chatview_disconnected_status", this.user.get("im_status") === false); + this.$(".oe_im_chatview_online").toggle(this.user.get("im_status") === true); + this._go_bottom(); + }; + this.user.on("change:im_status", this, change_status); + change_status.call(this); + + this.on("change:right_position", this, this.calc_pos); + this.full_height = this.$el.height(); + this.calc_pos(); + this.on("change:pending", this, _.bind(function() { + if (this.get("pending") === 0) { + this.$(".oe_im_chatview_nbr_messages").text(""); + } else { + this.$(".oe_im_chatview_nbr_messages").text("(" + this.get("pending") + ")"); + } + }, this)); + }, + show_hide: function() { + if (this.shown) { + this.$el.animate({ + height: this.$(".oe_im_chatview_header").outerHeight(), + }); + } else { + this.$el.animate({ + height: this.full_height, + }); + } + this.shown = ! this.shown; + if (this.shown) { + this.set("pending", 0); + } + }, + calc_pos: function() { + this.$el.css("right", this.get("right_position")); + }, + received_message: function(message) { + if (this.shown) { + this.set("pending", 0); + } else { + this.set("pending", this.get("pending") + 1); + } + this._add_bubble(this.user, message.message, message.date); + }, + send_message: function(e) { + if(e && e.which !== 13) { + return; + } + var mes = this.$("input").val(); + this.$("input").val(""); + var send_it = _.bind(function() { + var model = new instance.web.Model("im.message"); + return model.call("post", [mes, this.user.get('id')], + {context: new instance.web.CompoundContext()}); + }, this); + var tries = 0; + send_it().then(_.bind(function() { + this._add_bubble(this.me, mes, instance.web.datetime_to_str(new Date())); + }, this), function(error, e) { + e.preventDefault(); + tries += 1; + if (tries < 3) + return send_it(); + }); + }, + _add_bubble: function(user, item, date) { + var items = [item]; + if (user === this.last_user) { + this.last_bubble.remove(); + items = this.last_items.concat(items); + } + this.last_user = user; + this.last_items = items; + date = instance.web.str_to_datetime(date); + var now = new Date(); + var diff = now - date; + if (diff > (1000 * 60 * 60 * 24)) { + date = $.timeago(date); + } else { + date = date.toString(Date.CultureInfo.formatPatterns.shortTime); + } + + this.last_bubble = $(QWeb.render("Conversation.bubble", {"items": items, "user": user, "time": date})); + $(this.$(".oe_im_chatview_content").children()[0]).append(this.last_bubble); + this._go_bottom(); + }, + _go_bottom: function() { + this.$(".oe_im_chatview_content").scrollTop($(this.$(".oe_im_chatview_content").children()[0]).height()); + }, + focus: function() { + this.$(".oe_im_chatview_input").focus(); + if (! this.shown) + this.show_hide(); + }, + destroy: function() { + this.user.remove_watcher(); + this.trigger("destroyed"); + return this._super(); + }, + }); + +}
\ No newline at end of file diff --git a/addons/im/static/src/xml/im.xml b/addons/im/static/src/xml/im.xml new file mode 100644 index 00000000000..795d1b3e698 --- /dev/null +++ b/addons/im/static/src/xml/im.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- vim:fdl=1: +--> +<templates xml:space="preserve"> + <t t-name="InstantMessaging"> + <div class="oe_im"> + <div class="oe_im_frame_header"> + <span class="oe_e oe_im_search_icon">ô</span> + <input class="oe_im_searchbox" t-att-placeholder="_t('Search users...')"/> + <span class="oe_e oe_im_search_clear">[</span> + </div> + <div class="oe_im_users"></div> + <div class="oe_im_content"></div> + </div> + </t> + <t t-name="ImTopButton"> + <div t-att-title='_t("Display Instant Messaging")' class="oe_topbar_item oe_topbar_imbutton"> + <span class="oe_e">+</span> + </div> + </t> + <t t-name="UserWidget"> + <div class="oe_im_user"> + <span class="oe_im_user_clip"> + <img t-att-src='widget.user.get("image_url")' class="oe_im_user_avatar"/> + </span> + <span class="oe_im_user_name"><t t-esc="widget.user.get('name')"/></span> + <img t-att-src="_s +'/im/static/src/img/green.png'" class="oe_im_user_online"/> + </div> + </t> + <t t-name="Conversation"> + <div class="oe_im_chatview"> + <div class="oe_im_chatview_header"> + <img t-att-src="_s +'/im/static/src/img/green.png'" class="oe_im_chatview_online"/> + <t t-esc="widget.user.get('name') || 'Anonymous'"/> + <scan class="oe_im_chatview_nbr_messages" /> + <button class="oe_im_chatview_close">×</button> + </div> + <div class="oe_im_chatview_disconnected"> + <t t-esc='_.str.sprintf(_t("%s is offline. He/She will receive your messages on his/her next connection."), widget.user.get("name") || "Anonymous")'/> + </div> + <div class="oe_im_chatview_content"> + <div></div> + </div> + <div class="oe_im_chatview_footer"> + <input class="oe_im_chatview_input" t-att-placeholder="_t('Say something...')" /> + </div> + </div> + </t> + <t t-name="Conversation.bubble"> + <div class="oe_im_chatview_bubble"> + <div class="oe_im_chatview_clip"> + <img class="oe_im_chatview_avatar" t-att-src='user.get("image_url")'/> + </div> + <div class="oe_im_chatview_from"><t t-esc="user.get('name') || 'Anonymous'"/></div> + <div class="oe_im_chatview_bubble_list"> + <t t-foreach="items" t-as="item"> + <div class="oe_im_chatview_bubble_item"><t t-esc="item"/></div> + </t> + </div> + <div class="oe_im_chatview_time"><t t-esc="time"/></div> + </div> + </t> +</templates>
\ No newline at end of file diff --git a/addons/im_livechat/__init__.py b/addons/im_livechat/__init__.py new file mode 100644 index 00000000000..2825a75179c --- /dev/null +++ b/addons/im_livechat/__init__.py @@ -0,0 +1,2 @@ + +import im_livechat diff --git a/addons/im_livechat/__openerp__.py b/addons/im_livechat/__openerp__.py new file mode 100644 index 00000000000..8b9ea3924d5 --- /dev/null +++ b/addons/im_livechat/__openerp__.py @@ -0,0 +1,29 @@ +{ + 'name' : 'Live Support', + 'version': '1.0', + 'summary': 'Live Chat with Visitors/Customers', + 'category': 'Tools', + 'complexity': 'easy', + 'description': + """ +Live Chat Support +================= + +Allow to drop instant messaging widgets on any web page that will communicate +with the current server and dispatch visitors request amongst several live +chat operators. + + """, + 'data': [ + "security/im_livechat_security.xml", + "security/ir.model.access.csv", + "im_livechat_view.xml", + ], + 'demo': [ + "im_livechat_demo.xml", + ], + 'depends' : ["im", "mail", "portal_anonymous"], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/addons/im_livechat/im_livechat.py b/addons/im_livechat/im_livechat.py new file mode 100644 index 00000000000..1ffb422fe6a --- /dev/null +++ b/addons/im_livechat/im_livechat.py @@ -0,0 +1,245 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import openerp +import openerp.addons.im.im as im +import json +import random +import jinja2 +from openerp.osv import osv, fields +from openerp import tools + +env = jinja2.Environment( + loader=jinja2.PackageLoader('openerp.addons.im_livechat', "."), + autoescape=False +) +env.filters["json"] = json.dumps + +class LiveChatController(openerp.addons.web.http.Controller): + _cp_path = '/im_livechat' + + @openerp.addons.web.http.httprequest + def loader(self, req, **kwargs): + p = json.loads(kwargs["p"]) + db = p["db"] + channel = p["channel"] + user_name = p.get("user_name", None) + req.session._db = db + req.session._uid = None + req.session._login = "anonymous" + req.session._password = "anonymous" + info = req.session.model('im_livechat.channel').get_info_for_chat_src(channel) + info["db"] = db + info["channel"] = channel + info["userName"] = user_name + return req.make_response(env.get_template("loader.js").render(info), + headers=[('Content-Type', "text/javascript")]) + + @openerp.addons.web.http.httprequest + def web_page(self, req, **kwargs): + p = json.loads(kwargs["p"]) + db = p["db"] + channel = p["channel"] + req.session._db = db + req.session._uid = None + req.session._login = "anonymous" + req.session._password = "anonymous" + script = req.session.model('im_livechat.channel').read(channel, ["script"])["script"] + info = req.session.model('im_livechat.channel').get_info_for_chat_src(channel) + info["script"] = script + return req.make_response(env.get_template("web_page.html").render(info), + headers=[('Content-Type', "text/html")]) + + @openerp.addons.web.http.jsonrequest + def available(self, req, db, channel): + req.session._db = db + req.session._uid = None + req.session._login = "anonymous" + req.session._password = "anonymous" + return req.session.model('im_livechat.channel').get_available_user(channel) > 0 + +class im_livechat_channel(osv.osv): + _name = 'im_livechat.channel' + + def _get_default_image(self, cr, uid, context=None): + image_path = openerp.modules.get_module_resource('im_livechat', 'static/src/img', 'default.png') + return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64')) + def _get_image(self, cr, uid, ids, name, args, context=None): + result = dict.fromkeys(ids, False) + for obj in self.browse(cr, uid, ids, context=context): + result[obj.id] = tools.image_get_resized_images(obj.image) + return result + def _set_image(self, cr, uid, id, name, value, args, context=None): + return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context) + + + def _are_you_inside(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = False + for user in record.user_ids: + if user.id == uid: + res[record.id] = True + break + return res + + def _script(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = env.get_template("include.html").render({ + "url": self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url'), + "parameters": {"db":cr.dbname, "channel":record.id}, + }) + return res + + def _web_page(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + \ + "/im_livechat/web_page?p=" + json.dumps({"db":cr.dbname, "channel":record.id}) + return res + + _columns = { + 'name': fields.char(string="Channel Name", size=200, required=True), + 'user_ids': fields.many2many('res.users', 'im_livechat_channel_im_user', 'channel_id', 'user_id', string="Users"), + 'are_you_inside': fields.function(_are_you_inside, type='boolean', string='Are you inside the matrix?', store=False), + 'script': fields.function(_script, type='text', string='Script', store=False), + 'web_page': fields.function(_web_page, type='url', string='Web Page', store=False, size="200"), + 'button_text': fields.char(string="Text of the Button", size=200), + 'input_placeholder': fields.char(string="Chat Input Placeholder", size=200), + 'default_message': fields.char(string="Welcome Message", size=200, help="This is an automated 'welcome' message that your visitor will see when they initiate a new chat session."), + # image: all image fields are base64 encoded and PIL-supported + 'image': fields.binary("Photo", + help="This field holds the image used as photo for the group, limited to 1024x1024px."), + 'image_medium': fields.function(_get_image, fnct_inv=_set_image, + string="Medium-sized photo", type="binary", multi="_get_image", + store={ + 'im_livechat.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), + }, + help="Medium-sized photo of the group. It is automatically "\ + "resized as a 128x128px image, with aspect ratio preserved. "\ + "Use this field in form views or some kanban views."), + 'image_small': fields.function(_get_image, fnct_inv=_set_image, + string="Small-sized photo", type="binary", multi="_get_image", + store={ + 'im_livechat.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), + }, + help="Small-sized photo of the group. It is automatically "\ + "resized as a 64x64px image, with aspect ratio preserved. "\ + "Use this field anywhere a small image is required."), + } + + def _default_user_ids(self, cr, uid, context=None): + return [(6, 0, [uid])] + + _defaults = { + 'button_text': "Have a Question? Chat with us.", + 'input_placeholder': "How may I help you?", + 'default_message': '', + 'user_ids': _default_user_ids, + 'image': _get_default_image, + } + + def get_available_user(self, cr, uid, channel_id, context=None): + channel = self.browse(cr, openerp.SUPERUSER_ID, channel_id, context=context) + users = [] + for user in channel.user_ids: + iuid = self.pool.get("im.user").get_by_user_id(cr, uid, user.id, context=context)["id"] + imuser = self.pool.get("im.user").browse(cr, uid, iuid, context=context) + if imuser.im_status: + users.append(imuser) + if len(users) == 0: + return False + return random.choice(users).id + + def test_channel(self, cr, uid, channel, context=None): + if not channel: + return {} + return { + 'url': self.browse(cr, uid, channel[0], context=context or {}).web_page, + 'type': 'ir.actions.act_url' + } + + def get_info_for_chat_src(self, cr, uid, channel, context=None): + url = self.pool.get('ir.config_parameter').get_param(cr, openerp.SUPERUSER_ID, 'web.base.url') + chan = self.browse(cr, uid, channel, context=context) + return { + "url": url, + 'buttonText': chan.button_text, + 'inputPlaceholder': chan.input_placeholder, + 'defaultMessage': chan.default_message, + "channelName": chan.name, + } + + def join(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'user_ids': [(4, uid)]}) + return True + + def quit(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'user_ids': [(3, uid)]}) + return True + + +class im_message(osv.osv): + _inherit = 'im.message' + + def _support_member(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = False + if record.to_id.user and record.from_id.user: + continue + elif record.to_id.user: + res[record.id] = record.to_id.user.id + elif record.from_id.user: + res[record.id] = record.from_id.user.id + return res + + def _customer(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = False + if record.to_id.uuid and record.from_id.uuid: + continue + elif record.to_id.uuid: + res[record.id] = record.to_id.id + elif record.from_id.uuid: + res[record.id] = record.from_id.id + return res + + def _direction(self, cr, uid, ids, name, arg, context=None): + res = {} + for record in self.browse(cr, uid, ids, context=context): + res[record.id] = False + if not not record.to_id.user and not not record.from_id.user: + continue + elif not not record.to_id.user: + res[record.id] = "c2s" + elif not not record.from_id.user: + res[record.id] = "s2c" + return res + + _columns = { + 'support_member_id': fields.function(_support_member, type='many2one', relation='res.users', string='Support Member', store=True, select=True), + 'customer_id': fields.function(_customer, type='many2one', relation='im.user', string='Customer', store=True, select=True), + 'direction': fields.function(_direction, type="selection", selection=[("s2c", "Support Member to Customer"), ("c2s", "Customer to Support Member")], + string='Direction', store=False), + } diff --git a/addons/im_livechat/im_livechat_demo.xml b/addons/im_livechat/im_livechat_demo.xml new file mode 100644 index 00000000000..f199179fb50 --- /dev/null +++ b/addons/im_livechat/im_livechat_demo.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<openerp> + <data> + + <record id="channel_website" model="im_livechat.channel"> + <field name="name">YourWebsite.com</field> + <field name="default_message">Hello, how may I help you?</field> + </record> + + <record id="group_im_livechat" model="res.groups"> + <field name="users" eval="[(4, ref('base.user_demo'))]"/> + </record> + + </data> +</openerp> diff --git a/addons/im_livechat/im_livechat_view.xml b/addons/im_livechat/im_livechat_view.xml new file mode 100644 index 00000000000..f684fd561fc --- /dev/null +++ b/addons/im_livechat/im_livechat_view.xml @@ -0,0 +1,146 @@ +<?xml version="1.0"?> +<openerp> + <data> + <menuitem id="im_livechat" name="Live Chat" parent="mail.mail_feeds_main" groups="group_im_livechat"/> + + <record model="ir.actions.act_window" id="action_support_channels"> + <field name="name">Live Chat Channels</field> + <field name="res_model">im_livechat.channel</field> + <field name="view_mode">kanban,form</field> + <field name="help" type="html"> + <p class="oe_view_nocontent_create"> + Click to define a new live chat channel. + </p><p> + You can create channels for each website on which you want + to integrate the live chat widget, allowing you website + visitors to talk in real time with your operators. + </p><p> + Each channel has it's own URL that you can send by email to + your customers in order to start chatting with you. + </p> + </field> + </record> + <menuitem name="Channels" parent="im_livechat" id="support_channels" action="action_support_channels" groups="group_im_livechat"/> + + + <record model="ir.ui.view" id="support_channel_kanban"> + <field name="name">support_channel.kanban</field> + <field name="model">im_livechat.channel</field> + <field name="arch" type="xml"> + <kanban> + <field name="name"/> + <field name="web_page"/> + <field name="are_you_inside"/> + <field name="user_ids"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_group_image"> + <a type="open"><img t-att-src="kanban_image('im_livechat.channel', 'image_medium', record.id.value)" class="oe_group_photo"/></a> + </div> + <div class="oe_group_details"> + <h4><a type="open"><field name="name"/></a></h4> + <div class="oe_kanban_footer_left"> + <span> + <span class="oe_e">+</span> <t t-esc="(record.user_ids.raw_value || []).length"/> + </span> + </div> + <div class="oe_group_button"> + <button t-if="record.are_you_inside.raw_value" name="quit" type="object" class="oe_group_join">Quit</button> + <button t-if="! record.are_you_inside.raw_value" name="join" type="object">Join</button> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + + <record id="support_channel_form" model="ir.ui.view"> + <field name="name">support_channel.form</field> + <field name="model">im_livechat.channel</field> + <field name="arch" type="xml"> + <form string="Support Channels" version="7.0"> + <sheet> + <field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name" placeholder="e.g. YourWebsite.com"/> + </h1> + <div> + <button type="object" name="join" class="oe_highlight" string="Join Channel" attrs='{"invisible": [["are_you_inside", "=", True]]}'/> + <button type="object" name="quit" string="Leave Channel" attrs='{"invisible": [["are_you_inside", "=", False]]}'/> + <button type="object" name="test_channel" string="Test" attrs='{"invisible": [["web_page", "=", False]]}'/> + <field name="are_you_inside" invisible="1"/> + </div> + </div> + + <group> + <group string="Operators"> + <field name="user_ids" widget="many2many_kanban" nolabel="1" colspan="2"> + <kanban> + <field name="name"/> + <templates> + <t t-name="kanban-box"> + <div> + <a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a> + <div class="oe_group_details" style="min-height: 40px"> + <img t-att-src="kanban_image('res.users', 'image', record.id.value)" + class="oe_avatar oe_kanban_avatar_smallbox" style="float:left; margin-right: 10px;"/> + <h4><field name="name"/></h4> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </group> + <group string="Options"> + <field name="button_text"/> + <field name="input_placeholder"/> + <field name="default_message" placeholder="e.g. Hello, how may I help you?"/> + </group> + </group> + + <div attrs='{"invisible": [["web_page", "=", False]]}'> + <separator string="How to use the Live Chat widget?"/> + <p> + Copy and paste this code into your website, within the &lt;head&gt; tag: + </p> + <field name="script" readonly="1" class="oe_tag"/> + <p> + or copy this url and send it by email to your customers or suppliers: + </p> + <field name="web_page" readonly="1" class="oe_tag"/> + </div> + + </sheet> + </form> + </field> + </record> + + <record model="ir.actions.act_window" id="action_history"> + <field name="name">History</field> + <field name="res_model">im.message</field> + <field name="view_mode">list</field> + <field name="domain">["|", ('to_id.user', '=', None), ('from_id.user', '=', None)]</field> + </record> + <menuitem name="History" parent="im_livechat" id="history" action="action_history" groups="group_im_livechat_manager"/> + + <record id="im_message_form" model="ir.ui.view"> + <field name="name">im.message.tree</field> + <field name="model">im.message</field> + <field name="arch" type="xml"> + <tree string="History"> + <field name="date"/> + <field name="support_member_id"/> + <field name="customer_id"/> + <field name="direction"/> + <field name="message"/> + </tree> + </field> + </record> + + </data> +</openerp> diff --git a/addons/im_livechat/include.html b/addons/im_livechat/include.html new file mode 100644 index 00000000000..55de6212361 --- /dev/null +++ b/addons/im_livechat/include.html @@ -0,0 +1,2 @@ +<script type="text/javascript" src="{{url}}/im_livechat/static/ext/static/js/require.js"></script> +<script type="text/javascript" src='{{url}}/im_livechat/loader?p={{parameters | json | escape}}'></script>
\ No newline at end of file diff --git a/addons/im_livechat/loader.js b/addons/im_livechat/loader.js new file mode 100644 index 00000000000..669591b410f --- /dev/null +++ b/addons/im_livechat/loader.js @@ -0,0 +1,24 @@ + +require.config({ + context: "oelivesupport", + baseUrl: {{url | json}} + "/im_livechat/static/ext/static/js", + shim: { + underscore: { + init: function() { + return _.noConflict(); + }, + }, + "jquery.achtung": { + deps: ['jquery'], + }, + }, +})(["livesupport", "jquery"], function(livesupport, jQuery) { + jQuery.noConflict(); + livesupport.main({{url | json}}, {{db | json}}, "anonymous", "anonymous", {{channel | json}}, { + buttonText: {{buttonText | json}}, + inputPlaceholder: {{inputPlaceholder | json}}, + defaultMessage: {{(defaultMessage or None) | json}}, + auto: window.oe_im_livechat_auto || false, + userName: {{userName | json}} || undefined, + }); +}); diff --git a/addons/im_livechat/security/im_livechat_security.xml b/addons/im_livechat/security/im_livechat_security.xml new file mode 100644 index 00000000000..5ad020a8a78 --- /dev/null +++ b/addons/im_livechat/security/im_livechat_security.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<openerp> + <data> + + <record id="module_category_im_livechat" model="ir.module.category"> + <field name="name">Live Support</field> + <field name="sequence" eval="20" /> + </record> + + <record id="group_im_livechat" model="res.groups"> + <field name="name">User</field> + <field name="category_id" ref="module_category_im_livechat"/> + <field name="comment">The user will be able to join support channels.</field> + </record> + + <record id="group_im_livechat_manager" model="res.groups"> + <field name="name">Manager</field> + <field name="comment">The user will be able to delete support channels.</field> + <field name="category_id" ref="module_category_im_livechat"/> + <field name="implied_ids" eval="[(4, ref('im_livechat.group_im_livechat'))]"/> + <field name="users" eval="[(4, ref('base.user_root'))]"/> + </record> + + <record id="message_rule_1" model="ir.rule"> + <field name="name">Live Support Managers can read messages from live support</field> + <field name="model_id" ref="im.model_im_message"/> + <field name="groups" eval="[(6,0,[ref('im_livechat.group_im_livechat_manager')])]"/> + <field name="domain_force">["|", ('to_id.user', '=', None), ('from_id.user', '=', None)]</field> + <field name="perm_unlink" eval="0"/> + <field name="perm_write" eval="0"/> + <field name="perm_read" eval="1"/> + <field name="perm_create" eval="0"/> + </record> + + </data> +</openerp> diff --git a/addons/im_livechat/security/ir.model.access.csv b/addons/im_livechat/security/ir.model.access.csv new file mode 100644 index 00000000000..6e17c1a127f --- /dev/null +++ b/addons/im_livechat/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_ls_chann1,im_livechat.channel,model_im_livechat_channel,,1,0,0,0 +access_ls_chann2,im_livechat.channel,model_im_livechat_channel,group_im_livechat,1,1,1,0 +access_ls_chann3,im_livechat.channel,model_im_livechat_channel,group_im_livechat_manager,1,1,1,1 +access_ls_message,im_livechat.im.message,im.model_im_message,portal.group_anonymous,0,0,0,0 +access_im_user,im_livechat.im.user,im.model_im_user,portal.group_anonymous,1,0,0,0
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/Makefile b/addons/im_livechat/static/ext/Makefile new file mode 100644 index 00000000000..b73ca4f2b89 --- /dev/null +++ b/addons/im_livechat/static/ext/Makefile @@ -0,0 +1,3 @@ + +static/js/livesupport_templates.js: static/js/livesupport_templates.html + python static/js/to_jsonp.py static/js/livesupport_templates.html oe_livesupport_templates_callback > static/js/livesupport_templates.js
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/audio/Ting.mp3 b/addons/im_livechat/static/ext/static/audio/Ting.mp3 Binary files differnew file mode 100644 index 00000000000..6fd090a89ce --- /dev/null +++ b/addons/im_livechat/static/ext/static/audio/Ting.mp3 diff --git a/addons/im_livechat/static/ext/static/audio/Ting.ogg b/addons/im_livechat/static/ext/static/audio/Ting.ogg Binary files differnew file mode 100644 index 00000000000..8d17ea85bd3 --- /dev/null +++ b/addons/im_livechat/static/ext/static/audio/Ting.ogg diff --git a/addons/im_livechat/static/ext/static/css/livesupport.css b/addons/im_livechat/static/ext/static/css/livesupport.css new file mode 100644 index 00000000000..bfe26b5e838 --- /dev/null +++ b/addons/im_livechat/static/ext/static/css/livesupport.css @@ -0,0 +1,190 @@ + + + +.openerp_style { /* base style of openerp */ + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; + color: #4c4c4c; + font-size: 13px; + background: white; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); +} + +/* button */ + +.oe_chat_button { + position: fixed; + bottom: 0px; + right: 6px; + display: inline-block; + min-width: 100px; + background-color: rgba(60, 60, 60, 0.6); + font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; + font-size: 14px; + font-weight: bold; + padding: 10px; + color: white; + text-shadow: rgb(59, 76, 88) 1px 1px 0px; + border: 1px solid rgb(80, 80, 80); + border-bottom: 0px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + cursor: pointer; +} + +/* conversations */ + +.oe_im_chatview { + position: fixed; + overflow: hidden; + bottom: 42px; + margin-right: 6px; + background: rgba(60, 60, 60, 0.8); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 0 3px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3); + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); + width: 240px; +} +.oe_im_chatview .oe_im_chatview_disconnected { + display:none; + z-index: 100; + width: 100%; + background: #E8EBEF; + padding: 5px; + font-size: 11px; + color: #999; + line-height: 14px; + height: 28px; + overflow: hidden; +} +.oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_disconnected { + display: block; +} +.oe_im_chatview .oe_im_chatview_header { + padding: 3px 6px 2px; + background: #DEDEDE; + background: -moz-linear-gradient(#FCFCFC, #DEDEDE); + background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE)); + -moz-border-radius: 3px 3px 0 0; + -webkit-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + border-bottom: 1px solid #AEB9BD; + cursor: pointer; +} +.oe_im_chatview .oe_im_chatview_close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; + font-size: 18px; + line-height: 16px; + float: right; + font-weight: bold; + color: black; + text-shadow: 0 1px 0 white; + opacity: 0.2; +} +.oe_im_chatview .oe_im_chatview_content { + overflow: auto; + height: 287px; + width: 240px; +} +.oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_content { + height: 249px; +} +.oe_im_chatview .oe_im_chatview_footer { + position: relative; + padding: 3px; + border-top: 1px solid #AEB9BD; + background: #DEDEDE; + background: -moz-linear-gradient(#FCFCFC, #DEDEDE); + background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE)); + -moz-border-radius: 0 0 3px 3px; + -webkit-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; +} +.oe_im_chatview .oe_im_chatview_input { + width: 222px; + font-family: Lato, Helvetica, sans-serif; + font-size: 13px; + color: #333; + padding: 1px 5px; + border: 1px solid #AEB9BD; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: inset 0 1px 4px rgba(0,0,0,0.2); + -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2); +} +.oe_im_chatview .oe_im_chatview_bubble { + background: white; + position: relative; + padding: 3px; + margin: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.oe_im_chatview .oe_im_chatview_clip { + position: relative; + float: left; + width: 26px; + height: 26px; + margin-right: 4px; + -moz-box-shadow: 0 0 2px 1px rgba(0,0,0,0.25); + -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25); +} +.oe_im_chatview .oe_im_chatview_avatar { + float: left; + width: 26px; + height: auto; + clip: rect(0, 26px, 26px, 0); + max-width: 100%; + width: auto 9; + height: auto; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} +.oe_im_chatview .oe_im_chatview_time { + position: absolute; + right: 0px; + top: 0px; + margin: 3px; + text-align: right; + line-height: 13px; + font-size: 11px; + color: #999; + width: 60px; + overflow: hidden; +} +.oe_im_chatview .oe_im_chatview_from { + margin: 0 0 2px 0; + line-height: 14px; + font-weight: bold; + font-size: 12px; + width: 140px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + color: #3A87AD; +} +.oe_im_chatview .oe_im_chatview_bubble_list { +} +.oe_im_chatview .oe_im_chatview_bubble_item { + margin: 0 0 2px 30px; + line-height: 14px; + word-wrap: break-word; +} + +.oe_im_chatview_online { + display: none; + margin-top: -4px; + width: 11px; + height: 11px; +} diff --git a/addons/im_livechat/static/ext/static/img/avatar/avatar.jpeg b/addons/im_livechat/static/ext/static/img/avatar/avatar.jpeg Binary files differnew file mode 100644 index 00000000000..7168794022e --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/avatar/avatar.jpeg diff --git a/addons/im_livechat/static/ext/static/img/button-gloss.png b/addons/im_livechat/static/ext/static/img/button-gloss.png Binary files differnew file mode 100755 index 00000000000..6f3957702fe --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/button-gloss.png diff --git a/addons/im_livechat/static/ext/static/img/glyphicons-halflings-white.png b/addons/im_livechat/static/ext/static/img/glyphicons-halflings-white.png Binary files differnew file mode 100755 index 00000000000..3bf6484a29d --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/glyphicons-halflings-white.png diff --git a/addons/im_livechat/static/ext/static/img/glyphicons-halflings.png b/addons/im_livechat/static/ext/static/img/glyphicons-halflings.png Binary files differnew file mode 100755 index 00000000000..a9969993201 --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/glyphicons-halflings.png diff --git a/addons/im_livechat/static/ext/static/img/green.png b/addons/im_livechat/static/ext/static/img/green.png Binary files differnew file mode 100644 index 00000000000..01fb373c251 --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/green.png diff --git a/addons/im_livechat/static/ext/static/img/logo.png b/addons/im_livechat/static/ext/static/img/logo.png Binary files differnew file mode 100644 index 00000000000..aca5f4c60d8 --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/logo.png diff --git a/addons/im_livechat/static/ext/static/img/wood.png b/addons/im_livechat/static/ext/static/img/wood.png Binary files differnew file mode 100644 index 00000000000..22f2450d3ad --- /dev/null +++ b/addons/im_livechat/static/ext/static/img/wood.png diff --git a/addons/im_livechat/static/ext/static/js/jquery.achtung.css b/addons/im_livechat/static/ext/static/js/jquery.achtung.css new file mode 100644 index 00000000000..820ae3e9194 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/jquery.achtung.css @@ -0,0 +1,306 @@ +/** + * achtung 0.3.0 + * + * Growl-like notifications for jQuery + * + * Copyright (c) 2009 Josh Varner <josh@voxwerk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Portions of this file are from the jQuery UI CSS framework. + * + * @license http://www.opensource.org/licenses/mit-license.php + * @author Josh Varner <josh@voxwerk.com> + */ + +/* IE 6 doesn't support position: fixed */ +* html #achtung-overlay { + position:absolute; +} + +/* IE6 includes padding in width */ +* html .achtung { + width: 280px; +} + +#achtung-overlay { + overflow: hidden; + position: fixed; + top: 15px; + right: 15px; + width: 280px; + z-index:50; +} + +.achtung { + display:none; + margin-bottom: 8px; + padding: 15px 15px; + background-color: #000; + color: white; + width: 250px; + font-weight: bold; + position:relative; + overflow: hidden; + -moz-box-shadow: #aaa 1px 1px 2px; + -webkit-box-shadow: #aaa 1px 1px 2px; + box-shadow: #aaa 1px 1px 2px; + -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; + /* Note that if using show/hide animations, IE will lose + this setting */ + opacity: .85; + filter:Alpha(Opacity=85); +} + +/** + * This section from jQuery UI CSS framework + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Can (and should) be removed if you are already loading the jQuery UI CSS + * to reduce payload size. + */ +.ui-icon { display: block; overflow: hidden; background-repeat: no-repeat; } +.ui-icon { width: 16px; height: 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + +.achtung .achtung-message-icon { + margin-top: 0px; + margin-left: -.5em; + margin-right: .5em; + float: left; + zoom: 1; +} + +.achtung .ui-icon.achtung-close-button { + float: right; + margin-right: -8px; + margin-top: -12px; + cursor: pointer; + color: white; + text-align: right; +} + +.achtung .ui-icon.achtung-close-button:after { + content: "x" +} + +/* Slightly darker for these colors (readability) */ +.achtungSuccess, .achtungFail, .achtungWait { + /* Note that if using show/hide animations, IE will lose + this setting */ + opacity: .93; filter:Alpha(Opacity=93); +} + +.achtungSuccess { + background-color: #4DB559; +} + +.achtungFail { + background-color: #D64450; +} + +.achtungWait { + background-color: #658093; +} + +.achtungSuccess .ui-icon.achtung-close-button, +.achtungFail .ui-icon.achtung-close-button { +} + +.achtungSuccess .ui-icon.achtung-close-button-hover, +.achtungFail .ui-icon.achtung-close-button-hover { +} + +.achtung .wait-icon { +} + +.achtung .achtung-message { + display: inline; +} diff --git a/addons/im_livechat/static/ext/static/js/jquery.achtung.js b/addons/im_livechat/static/ext/static/js/jquery.achtung.js new file mode 100644 index 00000000000..1aa69469c1d --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/jquery.achtung.js @@ -0,0 +1,273 @@ +/** + * achtung 0.3.0 + * + * Growl-like notifications for jQuery + * + * Copyright (c) 2009 Josh Varner <josh@voxwerk.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @license http://www.opensource.org/licenses/mit-license.php + * @author Josh Varner <josh@voxwerk.com> + */ + +/*globals jQuery,clearTimeout,document,navigator,setTimeout +*/ +(function($) { + +/** + * This is based on the jQuery UI $.widget code. I would have just made this + * a $.widget but I didn't want the jQuery UI dependency. + */ +$.fn.achtung = function(options) +{ + var isMethodCall = (typeof options === 'string'), + args = Array.prototype.slice.call(arguments, 0), + name = 'achtung'; + + // handle initialization and non-getter methods + return this.each(function() { + var instance = $.data(this, name); + + // prevent calls to internal methods + if (isMethodCall && options.substring(0, 1) === '_') { + return this; + } + + // constructor + (!instance && !isMethodCall && + $.data(this, name, new $.achtung(this))._init(args)); + + // method call + (instance && isMethodCall && $.isFunction(instance[options]) && + instance[options].apply(instance, args.slice(1))); + }); +}; + +$.achtung = function(element) +{ + var args = Array.prototype.slice.call(arguments, 0), $el; + + if (!element || !element.nodeType) { + $el = $('<div />'); + return $el.achtung.apply($el, args); + } + + this.$container = $(element); +}; + + +/** + * Static members + **/ +$.extend($.achtung, { + version: '0.3.0', + $overlay: false, + defaults: { + timeout: 10, + disableClose: false, + icon: false, + className: '', + animateClassSwitch: false, + showEffects: {'opacity':'toggle','height':'toggle'}, + hideEffects: {'opacity':'toggle','height':'toggle'}, + showEffectDuration: 500, + hideEffectDuration: 700 + } +}); + +/** + * Non-static members + **/ +$.extend($.achtung.prototype, { + $container: false, + closeTimer: false, + options: {}, + + _init: function(args) + { + var o, self = this; + + args = $.isArray(args) ? args : []; + + + args.unshift($.achtung.defaults); + args.unshift({}); + + o = this.options = $.extend.apply($, args); + + if (!$.achtung.$overlay) { + $.achtung.$overlay = $('<div id="achtung-overlay"></div>').appendTo(document.body); + } + + if (!o.disableClose) { + $('<span class="achtung-close-button ui-icon ui-icon-close" />') + .click(function () { self.close(); }) + .hover(function () { $(this).addClass('achtung-close-button-hover'); }, + function () { $(this).removeClass('achtung-close-button-hover'); }) + .prependTo(this.$container); + } + + this.changeIcon(o.icon, true); + + if (o.message) { + this.$container.append($('<span class="achtung-message">' + o.message + '</span>')); + } + + (o.className && this.$container.addClass(o.className)); + (o.css && this.$container.css(o.css)); + + this.$container + .addClass('achtung') + .appendTo($.achtung.$overlay); + + if (o.showEffects) { + this.$container.toggle(); + } else { + this.$container.show(); + } + + if (o.timeout > 0) { + this.timeout(o.timeout); + } + }, + + timeout: function(timeout) + { + var self = this; + + if (this.closeTimer) { + clearTimeout(this.closeTimer); + } + + this.closeTimer = setTimeout(function() { self.close(); }, timeout * 1000); + this.options.timeout = timeout; + }, + + /** + * Change the CSS class associated with this message, using + * a transition if available (not availble in Safari/Webkit). + * If no transition is available, the switch is immediate. + * + * #LATER Check if this has been corrected in Webkit or jQuery UI + * #TODO Make transition time configurable + * @param newClass string Name of new class to associate + */ + changeClass: function(newClass) + { + var self = this; + + if (this.options.className === newClass) { + return; + } + + this.$container.queue(function() { + if (!self.options.animateClassSwitch || + /webkit/.test(navigator.userAgent.toLowerCase()) || + !$.isFunction($.fn.switchClass)) { + self.$container.removeClass(self.options.className); + self.$container.addClass(newClass); + } else { + self.$container.switchClass(self.options.className, newClass, 500); + } + + self.options.className = newClass; + self.$container.dequeue(); + }); + }, + + changeIcon: function(newIcon, force) + { + var self = this; + + if ((force !== true || newIcon === false) && this.options.icon === newIcon) { + return; + } + + if (force || this.options.icon === false) { + this.$container.prepend($('<span class="achtung-message-icon ui-icon ' + newIcon + '" />')); + this.options.icon = newIcon; + return; + } else if (newIcon === false) { + this.$container.find('.achtung-message-icon').remove(); + this.options.icon = false; + return; + } + + this.$container.queue(function() { + var $span = $('.achtung-message-icon', self.$container); + + if (!self.options.animateClassSwitch || + /webkit/.test(navigator.userAgent.toLowerCase()) || + !$.isFunction($.fn.switchClass)) { + $span.removeClass(self.options.icon); + $span.addClass(newIcon); + } else { + $span.switchClass(self.options.icon, newIcon, 500); + } + + self.options.icon = newIcon; + self.$container.dequeue(); + }); + }, + + + changeMessage: function(newMessage) + { + this.$container.queue(function() { + $('.achtung-message', $(this)).html(newMessage); + $(this).dequeue(); + }); + }, + + + update: function(options) + { + (options.className && this.changeClass(options.className)); + (options.css && this.$container.css(options.css)); + (typeof(options.icon) !== 'undefined' && this.changeIcon(options.icon)); + (options.message && this.changeMessage(options.message)); + (options.timeout && this.timeout(options.timeout)); + }, + + close: function() + { + var o = this.options, $container = this.$container; + + if (o.hideEffects) { + this.$container.animate(o.hideEffects, o.hideEffectDuration); + } else { + this.$container.hide(); + } + + $container.queue(function() { + $container.removeData('achtung'); + $container.remove(); + + if ($.achtung.$overlay && $.achtung.$overlay.is(':empty')) { + $.achtung.$overlay.remove(); + $.achtung.$overlay = false; + } + + $container.dequeue(); + }); + } +}); + +})(jQuery);
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/js/jquery.js b/addons/im_livechat/static/ext/static/js/jquery.js new file mode 100644 index 00000000000..ded03845983 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/jquery.js @@ -0,0 +1,9555 @@ +/*! + * jQuery JavaScript Library v1.9.0 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2013-1-14 + */ +(function( window, undefined ) { +"use strict"; +var + // A central reference to the root jQuery(document) + rootjQuery, + + // The deferred used on DOM ready + readyList, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // [[Class]] -> type pairs + class2type = {}, + + // List of deleted data cache ids, so we can reuse them + core_deletedIds = [], + + core_version = "1.9.0", + + // Save a reference to some core methods + core_concat = core_deletedIds.concat, + core_push = core_deletedIds.push, + core_slice = core_deletedIds.slice, + core_indexOf = core_deletedIds.indexOf, + core_toString = class2type.toString, + core_hasOwn = class2type.hasOwnProperty, + core_trim = core_version.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + + // Used for splitting on whitespace + core_rnotwhite = /\S+/g, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }, + + // The ready event handler and self cleanup method + DOMContentLoaded = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + } else if ( document.readyState === "complete" ) { + // we're here because readyState === "complete" in oldIE + // which is good enough for us to call the dom ready! + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: core_version, + + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // scripts is true for back-compat + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return core_slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; + }, + + slice: function() { + return this.pushStack( core_slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: core_push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + if ( obj == null ) { + return String( obj ); + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ core_toString.call(obj) ] || "object" : + typeof obj; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || core_hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // keepScripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, keepScripts ) { + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + context = context || document; + + var parsed = rsingleTag.exec( data ), + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ); + if ( scripts ) { + jQuery( scripts ).remove(); + } + return jQuery.merge( [], parsed.childNodes ); + }, + + parseJSON: function( data ) { + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + if ( data === null ) { + return data; + } + + if ( typeof data === "string" ) { + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + if ( data ) { + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + } + } + } + + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + core_trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + core_push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var l = second.length, + i = first.length, + j = 0; + + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var retVal, + ret = [], + i = 0, + length = elems.length; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return core_concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + // Multifunctional method to get and set values of a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + } +}); + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + var length = obj.length, + type = jQuery.type( obj ); + + if ( jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || type !== "function" && + ( length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj ); +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + return jQuery.inArray( fn, list ) > -1; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); +jQuery.support = (function() { + + var support, all, a, select, opt, input, fragment, eventName, isSupported, i, + div = document.createElement("div"); + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + + // Support tests won't run in some limited or non-browser environments + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + if ( !all || !a || !all.length ) { + return {}; + } + + // First batch of tests + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + a.style.cssText = "top:1px;float:left;opacity:.5"; + support = { + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.5/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) + checkOn: !!input.value, + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Tests for enctype support on a form (#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", + + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: document.compatMode === "CSS1Compat", + + // Will be defined later + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + boxSizingReliable: true, + pixelPosition: false + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Support: IE<9 + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + // Check if we can trust getAttribute("value") + input = document.createElement("input"); + input.setAttribute( "value", "" ); + support.input = input.getAttribute( "value" ) === ""; + + // Check if an input maintains its value after becoming a radio + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "checked", "t" ); + input.setAttribute( "name", "t" ); + + fragment = document.createDocumentFragment(); + fragment.appendChild( input ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Opera does not clone events (and typeof div.attachEvent === undefined). + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() + if ( div.attachEvent ) { + div.attachEvent( "onclick", function() { + support.noCloneEvent = false; + }); + + div.cloneNode( true ).click(); + } + + // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php + for ( i in { submit: true, change: true, focusin: true }) { + div.setAttribute( eventName = "on" + i, "t" ); + + support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; + } + + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, marginDiv, tds, + divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + container = document.createElement("div"); + container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; + + body.appendChild( container ).appendChild( div ); + + // Support: IE8 + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Support: IE8 + // Check if empty table cells still have offsetWidth/Height + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // Use window.getComputedStyle because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. (#3333) + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = div.appendChild( document.createElement("div") ); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + + support.reliableMarginRight = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + } + + if ( typeof div.style.zoom !== "undefined" ) { + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.innerHTML = ""; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + div.style.display = "block"; + div.innerHTML = "<div></div>"; + div.firstChild.style.width = "5px"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + body.style.zoom = 1; + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE + container = div = tds = marginDiv = null; + }); + + // Null elements to avoid leaks in IE + all = select = fragment = opt = a = input = null; + + return support; +})(); + +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rmultiDash = /([A-Z])/g; + +function internalData( elem, name, data, pvt /* Internal Use Only */ ){ + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt /* For internal use only */ ){ + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } else { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } +} + +jQuery.extend({ + cache: {}, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data, false ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name, false ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; + + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var attrs, name, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attrs = elem.attributes; + for ( ; i < attrs.length; i++ ) { + name = attrs[i].name; + + if ( !name.indexOf( "data-" ) ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + // Try to fetch any internally stored data first + return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; + } + + this.each(function() { + jQuery.data( this, key, value ); + }); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + hooks.cur = fn; + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var nodeHook, boolHook, + rclass = /[\t\r\n]/g, + rreturn = /\r/g, + rfocusable = /^(?:input|select|textarea|button|object)$/i, + rclickable = /^(?:a|area)$/i, + rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, + ruseDefault = /^(?:checked|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + getSetInput = jQuery.support.input; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call( this, j, this.className ) ); + }); + } + + if ( proceed ) { + // The disjunction here is for better compressibility (see removeClass) + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + " " + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + elem.className = jQuery.trim( cur ); + + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = arguments.length === 0 || typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call( this, j, this.className ) ); + }); + } + if ( proceed ) { + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + "" + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + elem.className = value ? jQuery.trim( cur ) : ""; + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.match( core_rnotwhite ) || []; + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + // Toggle whole class name + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // If the element has a class name or if we're passed "false", + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val, + self = jQuery(this); + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, option, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? + max : + one ? index : 0; + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // oldIE doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + // Don't return options that are disabled or in a disabled optgroup + ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && + ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attr: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + + } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + // In IE9+, Flash objects don't have .getAttribute (#12945) + // Support: IE9+ + if ( typeof elem.getAttribute !== "undefined" ) { + ret = elem.getAttribute( name ); + } + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var name, propName, + i = 0, + attrNames = value && value.match( core_rnotwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( (name = attrNames[i++]) ) { + propName = jQuery.propFix[ name ] || name; + + // Boolean attributes get special treatment (#10870) + if ( rboolean.test( name ) ) { + // Set corresponding property to false for boolean attributes + // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 + if ( !getSetAttribute && ruseDefault.test( name ) ) { + elem[ jQuery.camelCase( "default-" + name ) ] = + elem[ propName ] = false; + } else { + elem[ propName ] = false; + } + + // See #9699 for explanation of this approach (setting first, then removal) + } else { + jQuery.attr( elem, name, "" ); + } + + elem.removeAttribute( getSetAttribute ? name : propName ); + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to default in case type is set after value during creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + var + // Use .prop to determine if this attribute is understood as boolean + prop = jQuery.prop( elem, name ), + + // Fetch it accordingly + attr = typeof prop === "boolean" && elem.getAttribute( name ), + detail = typeof prop === "boolean" ? + + getSetInput && getSetAttribute ? + attr != null : + // oldIE fabricates an empty string for missing boolean attributes + // and conflates checked/selected into attroperties + ruseDefault.test( name ) ? + elem[ jQuery.camelCase( "default-" + name ) ] : + !!attr : + + // fetch an attribute node for properties not recognized as boolean + elem.getAttributeNode( name ); + + return detail && detail.value !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + // IE<8 needs the *property* name + elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); + + // Use defaultChecked and defaultSelected for oldIE + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; + } + + return name; + } +}; + +// fix oldIE value attroperty +if ( !getSetInput || !getSetAttribute ) { + jQuery.attrHooks.value = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + return jQuery.nodeName( elem, "input" ) ? + + // Ignore the value *property* by using defaultValue + elem.defaultValue : + + ret && ret.specified ? ret.value : undefined; + }, + set: function( elem, value, name ) { + if ( jQuery.nodeName( elem, "input" ) ) { + // Does not return so that setAttribute is also used + elem.defaultValue = value; + } else { + // Use nodeHook if defined (#1954); otherwise setAttribute is fine + return nodeHook && nodeHook.set( elem, value, name ); + } + } + }; +} + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? + ret.value : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + elem.setAttributeNode( + (ret = elem.ownerDocument.createAttribute( name )) + ); + } + + ret.value = value += ""; + + // Break association with cloned elements by also using setAttribute (#9646) + return name === "value" || value === elem.getAttribute( name ) ? + value : + undefined; + } + }; + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + nodeHook.set( elem, value === "" ? false : value, name ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); +} + + +// Some attributes require a special call on IE +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret == null ? undefined : ret; + } + }); + }); + + // href/src property should get the full normalized URL (#10299/#12915) + jQuery.each([ "href", "src" ], function( i, name ) { + jQuery.propHooks[ name ] = { + get: function( elem ) { + return elem.getAttribute( name, 4 ); + } + }; + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Note: IE uppercases css property names, but if we were to .toLowerCase() + // .cssText, that would destroy case senstitivity in URL's, like in "background" + return elem.style.cssText || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + // Don't attach events to noData or text/comment nodes (but allow plain objects) + elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem ); + + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = event.type || event, + namespaces = event.namespace ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + event.isTrigger = true; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = core_slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG <use> instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + for ( ; cur != this; cur = cur.parentNode || this ) { + + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Chrome 23+, Safari? + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + } + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== document.activeElement && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === document.activeElement && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + + beforeunload: { + postDispatch: function( event ) { + + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + if ( !e ) { + return; + } + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "submitBubbles" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "submitBubbles", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "changeBubbles", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +(function( window, undefined ) { + +var i, + cachedruns, + Expr, + getText, + isXML, + compile, + hasDuplicate, + outermostContext, + + // Local document vars + setDocument, + document, + docElem, + documentIsXML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + sortOrder, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + support = {}, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Array methods + arr = [], + pop = arr.pop, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments quoted, + // then not containing pseudos/brackets, + // then attribute selectors/non-parenthetical expressions, + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rsibling = /[\x20\t\r\n\f]*[+~]/, + + rnative = /\{\s*\[native code\]\s*\}/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, + funescape = function( _, escaped ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + return high !== high ? + escaped : + // BMP codepoint + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Use a stripped-down slice if we can't use a native one +try { + slice.call( docElem.childNodes, 0 )[0].nodeType; +} catch ( e ) { + slice = function( i ) { + var elem, + results = []; + for ( ; (elem = this[i]); i++ ) { + results.push( elem ); + } + return results; + }; +} + +/** + * For feature detection + * @param {Function} fn The function to test for native support + */ +function isNative( fn ) { + return rnative.test( fn + "" ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var cache, + keys = []; + + return (cache = function( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key += " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key ] = value); + }); +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( !documentIsXML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { + push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); + return results; + } + } + + // QSA path + if ( support.qsa && !rbuggyQSA.test(selector) ) { + old = true; + nid = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, slice.call( newContext.querySelectorAll( + newSelector + ), 0 ) ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Detect xml + * @param {Element|Object} elem An element or a document + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var doc = node ? node.ownerDocument || node : preferredDoc; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsXML = isXML( doc ); + + // Check if getElementsByTagName("*") returns only elements + support.tagNameNoComments = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if attributes should be retrieved by attribute nodes + support.attributes = assert(function( div ) { + div.innerHTML = "<select></select>"; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }); + + // Check if getElementsByClassName can be trusted + support.getByClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }); + + // Check if getElementById returns elements by name + // Check if getElementsByName privileges form controls or returns elements by ID + support.getByName = assert(function( div ) { + // Inject content + div.id = expando + 0; + div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; + docElem.insertBefore( div, docElem.firstChild ); + + // Test + var pass = doc.getElementsByName && + // buggy browsers will return fewer than the correct 2 + doc.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + doc.getElementsByName( expando + 0 ).length; + support.getIdNotName = !doc.getElementById( expando ); + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + + // IE6/7 return modified attributes + Expr.attrHandle = assert(function( div ) { + div.innerHTML = "<a href='#'></a>"; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }) ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }; + + // ID find and filter + if ( support.getIdNotName ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && !documentIsXML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && !documentIsXML ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.tagNameNoComments ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Name + Expr.find["NAME"] = support.getByName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }; + + // Class + Expr.find["CLASS"] = support.getByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { + return context.getElementsByClassName( className ); + } + }; + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21), + // no need to also add to buggyMatches since matches checks buggyQSA + // A support test would require too much code (would include document ready) + rbuggyQSA = [ ":focus" ]; + + if ( (support.qsa = isNative(doc.querySelectorAll)) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explictly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = "<select><option selected=''></option></select>"; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE8 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = "<input type='hidden' i=''/>"; + if ( div.querySelectorAll("[i^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + // Document order sorting + sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + var compare; + + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { + if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { + if ( a === doc || contains( preferredDoc, a ) ) { + return -1; + } + if ( b === doc || contains( preferredDoc, b ) ) { + return 1; + } + return 0; + } + return compare & 4 ? -1 : 1; + } + + return a.compareDocumentPosition ? -1 : 1; + } : + function( a, b ) { + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE ); + + // Parentless nodes are either documents or disconnected + } else if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + // Always assume the presence of duplicates if sort doesn't + // pass them to our comparison function (as in Google Chrome). + hasDuplicate = false; + [0, 0].sort( sortOrder ); + support.detectDuplicates = hasDuplicate; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyQSA always contains :focus, so no need for an existence check + if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + var val; + + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + if ( !documentIsXML ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( documentIsXML || support.attributes ) { + return elem.getAttribute( name ); + } + return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? + name : + val && val.specified ? val.value : null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + i = 1, + j = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem === results[ i - 1 ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + return results; +}; + +function siblingCheck( a, b ) { + var cur = a && b && a.nextSibling; + + for ( ; cur; cur = cur.nextSibling ) { + if ( cur === b ) { + return -1; + } + } + + return a ? 1 : -1; +} + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[4] ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + + nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.substr( result.length - check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifider + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsXML ? + elem.getAttribute("xml:lang") || elem.getAttribute("lang") : + elem.lang) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push( { + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && combinator.dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var data, cache, outerCache, + dirkey = dirruns + " " + doneName; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { + if ( (data = cache[1]) === true || data === cachedruns ) { + return data === true; + } + } else { + cache = outerCache[ dir ] = [ dirkey ]; + cache[1] = matcher( elem, context, xml ) || cachedruns; + if ( cache[1] === true ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + // A counter to specify which element is currently being matched + var matcherCachedRuns = 0, + bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Nested matchers should use non-integer dirruns + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = matcherCachedRuns; + } + + // Add elements passing elementMatchers directly to results + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + for ( j = 0; (matcher = elementMatchers[j]); j++ ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++matcherCachedRuns; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + // `i` starts as a string, so matchedCount would equal "00" if there are no elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + for ( j = 0; (matcher = setMatchers[j]); j++ ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && !documentIsXML && + Expr.relative[ tokens[1].type ] ) { + + context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && context.parentNode || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, slice.call( seed, 0 ) ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + documentIsXML, + results, + rsibling.test( selector ) + ); + return results; +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Easy API for creating new setFilters +function setFilters() {} +Expr.filters = setFilters.prototype = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Initialize with the default document +setDocument(); + +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})( window ); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, + isSimple = /^.[^:#\[\.,]*$/, + rneedsContext = jQuery.expr.match.needsContext, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var i, ret, self; + + if ( typeof selector !== "string" ) { + self = this; + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < self.length; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + ret = []; + for ( i = 0; i < this.length; i++ ) { + jQuery.find( selector, this[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( jQuery.unique( ret ) ); + ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; + return ret; + }, + + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false) ); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true) ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + rneedsContext.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + cur = this[i]; + + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + } + cur = cur.parentNode; + } + } + + return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( jQuery.unique(all) ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +jQuery.fn.andSelf = jQuery.fn.addBack; + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( this.length > 1 && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /<tbody/i, + rhtml = /<|&#?\w+;/, + rnoInnerhtml = /<(?:script|style|link)/i, + manipulation_rcheckableType = /^(?:checkbox|radio)$/i, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /^$|\/(?:java|ecma)script/i, + rscriptTypeMasked = /^true\/(.*)/, + rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + option: [ 1, "<select multiple='multiple'>", "</select>" ], + legend: [ 1, "<fieldset>", "</fieldset>" ], + area: [ 1, "<map>", "</map>" ], + param: [ 1, "<object>", "</object>" ], + thead: [ 1, "<table>", "</table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +jQuery.fn.extend({ + text: function( value ) { + return jQuery.access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + }, + + append: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.insertBefore( elem, this.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, false, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, false, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function () { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return jQuery.access( this, function( value ) { + var elem = this[0] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1></$2>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function( value ) { + var isFunc = jQuery.isFunction( value ); + + // Make sure that the elements are removed from the DOM before they are inserted + // this can help fix replacing a parent with child elements + if ( !isFunc && typeof value !== "string" ) { + value = jQuery( value ).not( this ).detach(); + } + + return this.domManip( [ value ], true, function( elem ) { + var next = this.nextSibling, + parent = this.parentNode; + + if ( parent && this.nodeType === 1 || this.nodeType === 11 ) { + + jQuery( this ).remove(); + + if ( next ) { + next.parentNode.insertBefore( elem, next ); + } else { + parent.appendChild( elem ); + } + } + }); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, table, callback ) { + + // Flatten any nested arrays + args = core_concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[0], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[0] = value.call( this, index, table ? self.html() : undefined ); + } + self.domManip( args, table, callback ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + table = table && jQuery.nodeName( first, "tr" ); + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( + table && jQuery.nodeName( this[i], "table" ) ? + findOrAppend( this[i], "tbody" ) : + this[i], + node, + i + ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Hope ajax is available... + jQuery.ajax({ + url: node.src, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } else { + jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return this; + } +}); + +function findOrAppend( elem, tag ) { + return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + var attr = elem.getAttributeNode("type"); + elem.type = ( attr && attr.specified ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[1]; + } else { + elem.removeAttribute("type"); + } + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; (elem = elems[i]) != null; i++ ) { + jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); + } +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, data, e; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone(true); + jQuery( insert[i] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + core_push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + +// Used in buildFragment, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( manipulation_rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, srcElements, node, i, clone, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; (node = srcElements[i]) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + fixCloneNodeIssues( node, destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; (node = srcElements[i]) != null; i++ ) { + cloneCopyEvent( node, destElements[i] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var contains, elem, tag, tmp, wrap, tbody, j, + l = elems.length, + + // Ensure a safe fragment + safe = createSafeFragment( context ), + + nodes = [], + i = 0; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || safe.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; + + // Descend through wrappers to the right content + j = wrap[0]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Manually add leading whitespace removed by IE + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); + } + + // Remove IE's autoinserted <tbody> from table fragments + if ( !jQuery.support.tbody ) { + + // String was a <table>, *may* have spurious <tbody> + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare <thead> or <tfoot> + wrap[1] === "<table>" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var data, id, elem, type, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( typeof elem.removeAttribute !== "undefined" ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + core_deletedIds.push( id ); + } + } + } + } + } +}); +var curCSS, getStyles, iframe, + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity\s*=\s*([^)]*)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), + elemdisplay = { BODY: "block" }, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var elem, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + values[ index ] = jQuery._data( elem, "olddisplay" ); + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && elem.style.display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else if ( !values[ index ] && !isHidden( elem ) ) { + jQuery._data( elem, "olddisplay", jQuery.css( elem, "display" ) ); + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( jQuery.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + var bool = typeof state === "boolean"; + + return this.each(function() { + if ( bool ? state : isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Exclude the following css properties to add px + cssNumber: { + "columnCount": true, + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that NaN and null values aren't set. See: #7116 + if ( value == null || type === "number" && isNaN( value ) ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, + // but it would mean to define eight (for every problematic property) identical functions + if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( extra ) { + num = parseFloat( val ); + return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; + } +}); + +// NOTE: we've included the "window" in window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + getStyles = function( elem ) { + return window.getComputedStyle( elem, null ); + }; + + curCSS = function( elem, name, _computed ) { + var width, minWidth, maxWidth, + computed = _computed || getStyles( elem ), + + // getPropertyValue is only needed for .css('filter') in IE9, see #12537 + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, + style = elem.style; + + if ( computed ) { + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret; + }; +} else if ( document.documentElement.currentStyle ) { + getStyles = function( elem ) { + return elem.currentStyle; + }; + + curCSS = function( elem, name, _computed ) { + var left, rs, rsLeft, + computed = _computed || getStyles( elem ), + ret = computed ? computed[ name ] : undefined, + style = elem.style; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rs = elem.runtimeStyle; + rsLeft = rs && rs.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + rs.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + rs.left = rsLeft; + } + } + + return ret === "" ? "auto" : ret; + }; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + // at this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var valueIsBorderBox = true, + val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + styles = getStyles( elem ), + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name, styles ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + // Use the already-created iframe if possible + iframe = ( iframe || + jQuery("<iframe frameborder='0' width='0' height='0'/>") + .css( "cssText", "display:block !important" ) + ).appendTo( doc.documentElement ); + + // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse + doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; + doc.write("<!doctype html><html><body>"); + doc.close(); + + display = actualDisplay( nodeName, doc ); + iframe.detach(); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + } + + return display; +} + +// Called ONLY from within css_defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + display = jQuery.css( elem[0], "display" ); + elem.remove(); + return display; +} + +jQuery.each([ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + // certain elements can have dimension info if we invisibly show them + // however, it must have a current display style that would benefit from this + return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? + jQuery.swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + }) : + getWidthOrHeight( elem, name, extra ); + } + }, + + set: function( elem, value, extra ) { + var styles = extra && getStyles( elem ); + return setPositiveNumber( elem, value, extra ? + augmentWidthOrHeight( + elem, + name, + extra, + jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + styles + ) : 0 + ); + } + }; +}); + +if ( !jQuery.support.opacity ) { + jQuery.cssHooks.opacity = { + get: function( elem, computed ) { + // IE uses filters for opacity + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : + computed ? "1" : ""; + }, + + set: function( elem, value ) { + var style = elem.style, + currentStyle = elem.currentStyle, + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", + filter = currentStyle && currentStyle.filter || style.filter || ""; + + // IE has trouble with opacity if it does not have layout + // Force it by setting the zoom level + style.zoom = 1; + + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 + // if value === "", then remove inline opacity #12685 + if ( ( value >= 1 || value === "" ) && + jQuery.trim( filter.replace( ralpha, "" ) ) === "" && + style.removeAttribute ) { + + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText + // if "filter:" is present at all, clearType is disabled, we want to avoid this + // style.removeAttribute is IE Only, but so apparently is this code path... + style.removeAttribute( "filter" ); + + // if there is no filter style applied in a css rule or unset inline opacity, we are done + if ( value === "" || currentStyle && !currentStyle.filter ) { + return; + } + } + + // otherwise, set new filter values + style.filter = ralpha.test( filter ) ? + filter.replace( ralpha, opacity ) : + filter + " " + opacity; + } + }; +} + +// These hooks cannot be added until DOM ready because the support test +// for it is not run until after DOM ready +jQuery(function() { + if ( !jQuery.support.reliableMarginRight ) { + jQuery.cssHooks.marginRight = { + get: function( elem, computed ) { + if ( computed ) { + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Work around by temporarily setting element display to inline-block + return jQuery.swap( elem, { "display": "inline-block" }, + curCSS, [ elem, "marginRight" ] ); + } + } + }; + } + + // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 + // getComputedStyle returns percent when specified for top/left/bottom/right + // rather than make the css module depend on the offset module, we just check for it here + if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { + jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = { + get: function( elem, computed ) { + if ( computed ) { + computed = curCSS( elem, prop ); + // if curCSS returns percentage, fallback to offset + return rnumnonpx.test( computed ) ? + jQuery( elem ).position()[ prop ] + "px" : + computed; + } + } + }; + }); + } + +}); + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.hidden = function( elem ) { + return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); + }; + + jQuery.expr.filters.visible = function( elem ) { + return !jQuery.expr.filters.hidden( elem ); + }; +} + +// These hooks are used by animate to expand properties +jQuery.each({ + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // assumes a single number if not a string + parts = typeof value === "string" ? value.split(" ") : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +}); +var r20 = /%20/g, + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +jQuery.fn.extend({ + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map(function(){ + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + }) + .filter(function(){ + var type = this.type; + // Use .is(":disabled") so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !manipulation_rcheckableType.test( type ) ); + }) + .map(function( i, elem ){ + var val = jQuery( this ).val(); + + return val == null ? + null : + jQuery.isArray( val ) ? + jQuery.map( val, function( val ){ + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }) : + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }).get(); + } +}); + +//Serialize an array of form elements or a set of +//key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ).replace( r20, "+" ); +}; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( jQuery.isArray( obj ) ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // Item is non-scalar (array or object), encode its numeric index. + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} +var + // Document location + ajaxLocParts, + ajaxLocation, + + ajax_nonce = jQuery.now(), + + ajax_rquery = /\?/, + rhash = /#.*$/, + rts = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, + + // Keep a copy of the old load method + _load = jQuery.fn.load, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat("*"); + +// #8138, IE may throw an exception when accessing +// a field from window.location if document.domain has been set +try { + ajaxLocation = location.href; +} catch( e ) { + // Use the href attribute of an A element + // since IE will modify it given document.location + ajaxLocation = document.createElement( "a" ); + ajaxLocation.href = ""; + ajaxLocation = ajaxLocation.href; +} + +// Segment location into parts +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + // For each dataType in the dataTypeExpression + while ( (dataType = dataTypes[i++]) ) { + // Prepend if requested + if ( dataType[0] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); + + // Otherwise append + } else { + (structure[ dataType ] = structure[ dataType ] || []).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + }); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +jQuery.fn.load = function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + } + + var selector, type, response, + self = this, + off = url.indexOf(" "); + + if ( off >= 0 ) { + selector = url.slice( off, url.length ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // If we have elements to modify, make the request + if ( self.length > 0 ) { + jQuery.ajax({ + url: url, + + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params + }).done(function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + self.html( selector ? + + // If a selector was specified, locate the right elements in a dummy div + // Exclude scripts to avoid IE 'Permission Denied' errors + jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : + + // Otherwise use the full result + responseText ); + + }).complete( callback && function( jqXHR, status ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); + }); + } + + return this; +}; + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ + jQuery.fn[ type ] = function( fn ){ + return this.on( type, fn ); + }; +}); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + // shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + return jQuery.ajax({ + url: url, + type: method, + dataType: type, + data: data, + success: callback + }); + }; +}); + +jQuery.extend({ + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: ajaxLocation, + type: "GET", + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /xml/, + html: /html/, + json: /json/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": window.String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": jQuery.parseJSON, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + // URL without anti-cache param + cacheURL, + // Response headers + responseHeadersString, + responseHeaders, + // timeout handle + timeoutTimer, + // Cross-domain detection vars + parts, + // To know if global events are to be dispatched + fireGlobals, + // Loop variable + i, + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + // Callbacks context + callbackContext = s.context || s, + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks("once memory"), + // Status-dependent callbacks + statusCode = s.statusCode || {}, + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + // The jqXHR state + state = 0, + // Default abort message + strAbort = "canceled", + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( state === 2 ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( (match = rheaders.exec( responseHeadersString )) ) { + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return state === 2 ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + var lname = name.toLowerCase(); + if ( !state ) { + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( !state ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( state < 2 ) { + for ( code in map ) { + // Lazy-add the new callback in a way that preserves old ones + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } else { + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ).complete = completeDeferred.add; + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; + + // Remove hash character (#7531: and string promotion) + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; + + // A cross-domain request is in order when we have a protocol:host:port mismatch + if ( s.crossDomain == null ) { + parts = rurl.exec( s.url.toLowerCase() ); + s.crossDomain = !!( parts && + ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || + ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != + ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) + ); + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( state === 2 ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + fireGlobals = s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger("ajaxStart"); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + cacheURL = s.url; + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // If data is available, append data to url + if ( s.data ) { + cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add anti-cache in url if needed + if ( s.cache === false ) { + s.url = rts.test( cacheURL ) ? + + // If there is already a '_' parameter, set its value + cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : + + // Otherwise add one to the end + cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; + } + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { + // Abort if not done already and return + return jqXHR.abort(); + } + + // aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = setTimeout(function() { + jqXHR.abort("timeout"); + }, s.timeout ); + } + + try { + state = 1; + transport.send( requestHeaders, done ); + } catch ( e ) { + // Propagate exception as error if not done + if ( state < 2 ) { + done( -1, e ); + // Simply rethrow otherwise + } else { + throw e; + } + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Called once + if ( state === 2 ) { + return; + } + + // State is "done" now + state = 2; + + // Clear timeout if it exists + if ( timeoutTimer ) { + clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // If successful, handle type chaining + if ( status >= 200 && status < 300 || status === 304 ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader("etag"); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // If not modified + if ( status === 304 ) { + isSuccess = true; + statusText = "notmodified"; + + // If we have data + } else { + isSuccess = ajaxConvert( s, response ); + statusText = isSuccess.state; + success = isSuccess.data; + error = isSuccess.error; + isSuccess = !error; + } + } else { + // We extract error from statusText + // then normalize statusText and status for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger("ajaxStop"); + } + } + } + + return jqXHR; + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + } +}); + +/* Handles responses to an ajax request: + * - sets all responseXXX fields accordingly + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes, + responseFields = s.responseFields; + + // Fill responseXXX fields + for ( type in responseFields ) { + if ( type in responses ) { + jqXHR[ responseFields[type] ] = responses[ type ]; + } + } + + // Remove auto dataType and get content-type in the process + while( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +// Chain conversions given the request and the original response +function ajaxConvert( s, response ) { + + var conv, conv2, current, tmp, + converters = {}, + i = 0, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(), + prev = dataTypes[ 0 ]; + + // Apply the dataFilter if provided + if ( s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + // Convert to each sequential dataType, tolerating list modification + for ( ; (current = dataTypes[++i]); ) { + + // There's only work to do if current dataType is non-auto + if ( current !== "*" ) { + + // Convert response if prev dataType is non-auto and differs from current + if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split(" "); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.splice( i--, 0, current ); + } + + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s["throws"] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + + // Update prev for next iteration + prev = current; + } + } + + return { state: "success", data: response }; +} +// Install script dataType +jQuery.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /(?:java|ecma)script/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +}); + +// Handle cache's special case and global +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + s.global = false; + } +}); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function(s) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + + var script, + head = document.head || jQuery("head")[0] || document.documentElement; + + return { + + send: function( _, callback ) { + + script = document.createElement("script"); + + script.async = true; + + if ( s.scriptCharset ) { + script.charset = s.scriptCharset; + } + + script.src = s.url; + + // Attach handlers for all browsers + script.onload = script.onreadystatechange = function( _, isAbort ) { + + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + + // Remove the script + if ( script.parentNode ) { + script.parentNode.removeChild( script ); + } + + // Dereference the script + script = null; + + // Callback if not abort + if ( !isAbort ) { + callback( 200, "success" ); + } + } + }; + + // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending + // Use native DOM manipulation to avoid our domManip AJAX trickery + head.insertBefore( script, head.firstChild ); + }, + + abort: function() { + if ( script ) { + script.onload( undefined, true ); + } + } + }; + } +}); +var oldCallbacks = [], + rjsonp = /(=)\?(?=&|$)|\?\?/; + +// Default jsonp settings +jQuery.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); + this[ callback ] = true; + return callback; + } +}); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? + "url" : + typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" + ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + + // Insert callback into url or form data + if ( jsonProp ) { + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); + } else if ( s.jsonp !== false ) { + s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters["script json"] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + overwritten = window[ callbackName ]; + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); +var xhrCallbacks, xhrSupported, + xhrId = 0, + // #5280: Internet Explorer will keep connections alive if we don't abort on unload + xhrOnUnloadAbort = window.ActiveXObject && function() { + // Abort all pending requests + var key; + for ( key in xhrCallbacks ) { + xhrCallbacks[ key ]( undefined, true ); + } + }; + +// Functions to create xhrs +function createStandardXHR() { + try { + return new window.XMLHttpRequest(); + } catch( e ) {} +} + +function createActiveXHR() { + try { + return new window.ActiveXObject("Microsoft.XMLHTTP"); + } catch( e ) {} +} + +// Create the request object +// (This is still attached to ajaxSettings for backward compatibility) +jQuery.ajaxSettings.xhr = window.ActiveXObject ? + /* Microsoft failed to properly + * implement the XMLHttpRequest in IE7 (can't request local files), + * so we use the ActiveXObject when it is available + * Additionally XMLHttpRequest can be disabled in IE7/IE8 so + * we need a fallback. + */ + function() { + return !this.isLocal && createStandardXHR() || createActiveXHR(); + } : + // For all other browsers, use the standard XMLHttpRequest object + createStandardXHR; + +// Determine support properties +xhrSupported = jQuery.ajaxSettings.xhr(); +jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +xhrSupported = jQuery.support.ajax = !!xhrSupported; + +// Create transport if the browser can provide an xhr +if ( xhrSupported ) { + + jQuery.ajaxTransport(function( s ) { + // Cross domain only allowed if supported through XMLHttpRequest + if ( !s.crossDomain || jQuery.support.cors ) { + + var callback; + + return { + send: function( headers, complete ) { + + // Get a new xhr + var handle, i, + xhr = s.xhr(); + + // Open the socket + // Passing null username, generates a login popup on Opera (#2865) + if ( s.username ) { + xhr.open( s.type, s.url, s.async, s.username, s.password ); + } else { + xhr.open( s.type, s.url, s.async ); + } + + // Apply custom fields if provided + if ( s.xhrFields ) { + for ( i in s.xhrFields ) { + xhr[ i ] = s.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( s.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( s.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !s.crossDomain && !headers["X-Requested-With"] ) { + headers["X-Requested-With"] = "XMLHttpRequest"; + } + + // Need an extra try/catch for cross domain requests in Firefox 3 + try { + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + } catch( err ) {} + + // Do send the request + // This may raise an exception which is actually + // handled in jQuery.ajax (so no try/catch here) + xhr.send( ( s.hasContent && s.data ) || null ); + + // Listener + callback = function( _, isAbort ) { + + var status, + statusText, + responseHeaders, + responses, + xml; + + // Firefox throws exceptions when accessing properties + // of an xhr when a network error occurred + // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) + try { + + // Was never called and is aborted or complete + if ( callback && ( isAbort || xhr.readyState === 4 ) ) { + + // Only called once + callback = undefined; + + // Do not keep as active anymore + if ( handle ) { + xhr.onreadystatechange = jQuery.noop; + if ( xhrOnUnloadAbort ) { + delete xhrCallbacks[ handle ]; + } + } + + // If it's an abort + if ( isAbort ) { + // Abort it manually if needed + if ( xhr.readyState !== 4 ) { + xhr.abort(); + } + } else { + responses = {}; + status = xhr.status; + xml = xhr.responseXML; + responseHeaders = xhr.getAllResponseHeaders(); + + // Construct response list + if ( xml && xml.documentElement /* #4958 */ ) { + responses.xml = xml; + } + + // When requesting binary data, IE6-9 will throw an exception + // on any attempt to access responseText (#11426) + if ( typeof xhr.responseText === "string" ) { + responses.text = xhr.responseText; + } + + // Firefox throws an exception when accessing + // statusText for faulty cross-domain requests + try { + statusText = xhr.statusText; + } catch( e ) { + // We normalize with Webkit giving an empty statusText + statusText = ""; + } + + // Filter status for non standard behaviors + + // If the request is local and we have data: assume a success + // (success with no data won't get notified, that's the best we + // can do given current implementations) + if ( !status && s.isLocal && !s.crossDomain ) { + status = responses.text ? 200 : 404; + // IE - #1450: sometimes returns 1223 when it should be 204 + } else if ( status === 1223 ) { + status = 204; + } + } + } + } catch( firefoxAccessException ) { + if ( !isAbort ) { + complete( -1, firefoxAccessException ); + } + } + + // Call complete if needed + if ( responses ) { + complete( status, statusText, responses, responseHeaders ); + } + }; + + if ( !s.async ) { + // if we're in sync mode we fire the callback + callback(); + } else if ( xhr.readyState === 4 ) { + // (IE6 & IE7) if it's in cache and has been + // retrieved directly we need to fire the callback + setTimeout( callback ); + } else { + handle = ++xhrId; + if ( xhrOnUnloadAbort ) { + // Create the active xhrs callbacks list if needed + // and attach the unload handler + if ( !xhrCallbacks ) { + xhrCallbacks = {}; + jQuery( window ).unload( xhrOnUnloadAbort ); + } + // Add to list of active xhrs callbacks + xhrCallbacks[ handle ] = callback; + } + xhr.onreadystatechange = callback; + } + }, + + abort: function() { + if ( callback ) { + callback( undefined, true ); + } + } + }; + } + }); +} +var fxNow, timerId, + rfxtypes = /^(?:toggle|show|hide)$/, + rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), + rrun = /queueHooks$/, + animationPrefilters = [ defaultPrefilter ], + tweeners = { + "*": [function( prop, value ) { + var end, unit, + tween = this.createTween( prop, value ), + parts = rfxnum.exec( value ), + target = tween.cur(), + start = +target || 0, + scale = 1, + maxIterations = 20; + + if ( parts ) { + end = +parts[2]; + unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + + // We need to compute starting value + if ( unit !== "px" && start ) { + // Iteratively approximate from a nonzero starting point + // Prefer the current property, because this process will be trivial if it uses the same units + // Fallback to end or a simple constant + start = jQuery.css( tween.elem, prop, true ) || end || 1; + + do { + // If previous iteration zeroed out, double until we get *something* + // Use a string for doubling factor so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + start = start / scale; + jQuery.style( tween.elem, prop, start + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); + } + + tween.unit = unit; + tween.start = start; + // If a +=/-= token was provided, we're doing a relative animation + tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; + } + return tween; + }] + }; + +// Animations created synchronously will run synchronously +function createFxNow() { + setTimeout(function() { + fxNow = undefined; + }); + return ( fxNow = jQuery.now() ); +} + +function createTweens( animation, props ) { + jQuery.each( props, function( prop, value ) { + var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( collection[ index ].call( animation, prop, value ) ) { + + // we're done with this property + return; + } + } + }); +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = animationPrefilters.length, + deferred = jQuery.Deferred().always( function() { + // don't match elem in the :animated selector + delete tick.elem; + }), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ]); + + if ( percent < 1 && length ) { + return remaining; + } else { + deferred.resolveWith( elem, [ animation ] ); + return false; + } + }, + animation = deferred.promise({ + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { specialEasing: {} }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + // if we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // resolve when we played the last frame + // otherwise, reject + if ( gotoEnd ) { + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + }), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length ; index++ ) { + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + return result; + } + } + + createTweens( animation, props ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + }) + ); + + // attach callbacks from options + return animation.progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( jQuery.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'index' from above because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.split(" "); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length ; index++ ) { + prop = props[ index ]; + tweeners[ prop ] = tweeners[ prop ] || []; + tweeners[ prop ].unshift( callback ); + } + }, + + prefilter: function( callback, prepend ) { + if ( prepend ) { + animationPrefilters.unshift( callback ); + } else { + animationPrefilters.push( callback ); + } + } +}); + +function defaultPrefilter( elem, props, opts ) { + /*jshint validthis:true */ + var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire, + anim = this, + style = elem.style, + orig = {}, + handled = [], + hidden = elem.nodeType && isHidden( elem ); + + // handle queue: false promises + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always(function() { + // doing this makes sure that the complete handler will be called + // before this completes + anim.always(function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + }); + }); + } + + // height/width overflow pass + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height animated + if ( jQuery.css( elem, "display" ) === "inline" && + jQuery.css( elem, "float" ) === "none" ) { + + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { + style.display = "inline-block"; + + } else { + style.zoom = 1; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + if ( !jQuery.support.shrinkWrapBlocks ) { + anim.done(function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + }); + } + } + + + // show/hide pass + for ( index in props ) { + value = props[ index ]; + if ( rfxtypes.exec( value ) ) { + delete props[ index ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + continue; + } + handled.push( index ); + } + } + + length = handled.length; + if ( length ) { + dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + + // store state if its toggle - enables .stop().toggle() to "reverse" + if ( toggle ) { + dataShow.hidden = !hidden; + } + if ( hidden ) { + jQuery( elem ).show(); + } else { + anim.done(function() { + jQuery( elem ).hide(); + }); + } + anim.done(function() { + var prop; + jQuery._removeData( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + }); + for ( index = 0 ; index < length ; index++ ) { + prop = handled[ index ]; + tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); + orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); + + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = tween.start; + if ( hidden ) { + tween.end = tween.start; + tween.start = prop === "width" || prop === "height" ? 1 : 0; + } + } + } + } +} + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || "swing"; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + if ( tween.elem[ tween.prop ] != null && + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + return tween.elem[ tween.prop ]; + } + + // passing a non empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails + // so, simple values such as "10px" are parsed to Float. + // complex values such as "rotate(1rad)" are returned as is. + result = jQuery.css( tween.elem, tween.prop, "auto" ); + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + // use step hook for back compat - use cssHook if its there - use .style if its + // available and use plain properties where available + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Remove in 2.0 - this supports IE8's panic based approach +// to setting things on disconnected nodes + +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +}); + +jQuery.fn.extend({ + fadeTo: function( speed, to, easing, callback ) { + + // show any hidden elements after setting opacity to 0 + return this.filter( isHidden ).css( "opacity", 0 ).show() + + // animate to the value specified + .end().animate({ opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + doAnimation.finish = function() { + anim.stop( true ); + }; + // Empty animations, or finishing resolves immediately + if ( empty || jQuery._data( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each(function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = jQuery._data( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // start the next in the queue if the last step wasn't forced + // timers currently will call their complete callbacks, which will dequeue + // but only if they were gotoEnd + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + }); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each(function() { + var index, + data = jQuery._data( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // enable finishing flag on private data + data.finish = true; + + // empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.cur && hooks.cur.finish ) { + hooks.cur.finish.call( this ); + } + + // look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // turn off finishing flag + delete data.finish; + }); + } +}); + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + attrs = { height: type }, + i = 0; + + // if we include width, step value is 1 to do all cssExpand values, + // if we don't include width, step value is 2 to skip over Left and Right + includeWidth = includeWidth? 1 : 0; + for( ; i < 4 ; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show"), + slideUp: genFx("hide"), + slideToggle: genFx("toggle"), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +}); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; + + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p*Math.PI ) / 2; + } +}; + +jQuery.timers = []; +jQuery.fx = Tween.prototype.init; +jQuery.fx.tick = function() { + var timer, + timers = jQuery.timers, + i = 0; + + fxNow = jQuery.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + // Checks the timer has not already been removed + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + if ( timer() && jQuery.timers.push( timer ) ) { + jQuery.fx.start(); + } +}; + +jQuery.fx.interval = 13; + +jQuery.fx.start = function() { + if ( !timerId ) { + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); + } +}; + +jQuery.fx.stop = function() { + clearInterval( timerId ); + timerId = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + // Default speed + _default: 400 +}; + +// Back Compat <1.8 extension point +jQuery.fx.step = {}; + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.animated = function( elem ) { + return jQuery.grep(jQuery.timers, function( fn ) { + return elem === fn.elem; + }).length; + }; +} +jQuery.fn.offset = function( options ) { + if ( arguments.length ) { + return options === undefined ? + this : + this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + var docElem, win, + box = { top: 0, left: 0 }, + elem = this[ 0 ], + doc = elem && elem.ownerDocument; + + if ( !doc ) { + return; + } + + docElem = doc.documentElement; + + // Make sure it's not a disconnected DOM node + if ( !jQuery.contains( docElem, elem ) ) { + return box; + } + + // If we don't have gBCR, just use 0,0 rather than error + // BlackBerry 5, iOS 3 (original iPhone) + if ( typeof elem.getBoundingClientRect !== "undefined" ) { + box = elem.getBoundingClientRect(); + } + win = getWindow( doc ); + return { + top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), + left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) + }; +}; + +jQuery.offset = { + + setOffset: function( elem, options, i ) { + var position = jQuery.css( elem, "position" ); + + // set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + var curElem = jQuery( elem ), + curOffset = curElem.offset(), + curCSSTop = jQuery.css( elem, "top" ), + curCSSLeft = jQuery.css( elem, "left" ), + calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, + props = {}, curPosition = {}, curTop, curLeft; + + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( jQuery.isFunction( options ) ) { + options = options.call( elem, i, curOffset ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + } +}; + + +jQuery.fn.extend({ + + position: function() { + if ( !this[ 0 ] ) { + return; + } + + var offsetParent, offset, + parentOffset = { top: 0, left: 0 }, + elem = this[ 0 ]; + + // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent + if ( jQuery.css( elem, "position" ) === "fixed" ) { + // we assume that getBoundingClientRect is available when computed position is fixed + offset = elem.getBoundingClientRect(); + } else { + // Get *real* offsetParent + offsetParent = this.offsetParent(); + + // Get correct offsets + offset = this.offset(); + if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { + parentOffset = offsetParent.offset(); + } + + // Add offsetParent borders + parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); + parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); + } + + // Subtract parent offsets and element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + return { + top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), + left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) + }; + }, + + offsetParent: function() { + return this.map(function() { + var offsetParent = this.offsetParent || document.documentElement; + while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent || document.documentElement; + }); + } +}); + + +// Create scrollLeft and scrollTop methods +jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { + var top = /Y/.test( prop ); + + jQuery.fn[ method ] = function( val ) { + return jQuery.access( this, function( elem, method, val ) { + var win = getWindow( elem ); + + if ( val === undefined ) { + return win ? (prop in win) ? win[ prop ] : + win.document.documentElement[ method ] : + elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : jQuery( win ).scrollLeft(), + top ? val : jQuery( win ).scrollTop() + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length, null ); + }; +}); + +function getWindow( elem ) { + return jQuery.isWindow( elem ) ? + elem : + elem.nodeType === 9 ? + elem.defaultView || elem.parentWindow : + false; +} +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return jQuery.access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there + // isn't a whole lot we can do. See pull request at this URL for discussion: + // https://github.com/jquery/jquery/pull/764 + return elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable, null ); + }; + }); +}); +// Limit scope pollution from any deprecated API +// (function() { + +// })(); +// Expose jQuery to the global object +window.jQuery = window.$ = jQuery; + +// Expose jQuery as an AMD module, but only for AMD loaders that +// understand the issues with loading multiple versions of jQuery +// in a page that all might call define(). The loader will indicate +// they have special allowances for multiple jQuery versions by +// specifying define.amd.jQuery = true. Register as a named module, +// since jQuery can be concatenated with other files that may use define, +// but not use a proper concatenation script that understands anonymous +// AMD modules. A named AMD is safest and most robust way to register. +// Lowercase jquery is used because AMD module names are derived from +// file names, and jQuery is normally delivered in a lowercase file name. +// Do this after creating the global so that if an AMD module wants to call +// noConflict to hide this version of jQuery, it will work. +if ( typeof define === "function" && define.amd && define.amd.jQuery ) { + define( "jquery", [], function () { return jQuery; } ); +} + +})( window );
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/js/livesupport.js b/addons/im_livechat/static/ext/static/js/livesupport.js new file mode 100644 index 00000000000..0b9e52d2c07 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/livesupport.js @@ -0,0 +1,446 @@ + +define(["nova", "underscore", "oeclient", "require", "jquery", + "jquery.achtung"], function(nova, _, oeclient, require, $) { + var livesupport = {}; + + var templateEngine = new nova.TemplateEngine(); + templateEngine.extendEnvironment({"toUrl": _.bind(require.toUrl, require)}); + var connection; + + var defaultInputPlaceholder; + var userName; + + livesupport.main = function(server_url, db, login, password, channel, options) { + var defs = []; + options = options || {}; + _.defaults(options, { + buttonText: "Chat with one of our collaborators", + inputPlaceholder: "How may I help you?", + defaultMessage: null, + auto: false, + userName: "Anonymous", + }); + defaultInputPlaceholder = options.inputPlaceholder; + userName = options.userName; + defs.push($.ajax({ + url: require.toUrl("./livesupport_templates.js"), + jsonp: false, + jsonpCallback: "oe_livesupport_templates_callback", + dataType: "jsonp", + cache: true, + }).then(function(content) { + return templateEngine.loadFileContent(content); + })); + defs.push(add_css("../css/livesupport.css")); + defs.push(add_css("./jquery.achtung.css")); + + $.when.apply($, defs).then(function() { + console.log("starting live support customer app"); + connection = new oeclient.Connection(new oeclient.JsonpRPCConnector(server_url), db, login, password); + connection.connector.call("/im_livechat/available", {db: db, channel: channel}).then(function(activated) { + if (! activated & ! options.auto) + return; + var button = new livesupport.ChatButton(null, channel, options); + button.appendTo($("body")); + if (options.auto) + button.click(); + }); + }); + }; + + var add_css = function(relative_file_name) { + var css_def = $.Deferred(); + $('<link rel="stylesheet" href="' + require.toUrl(relative_file_name) + '"></link>') + .appendTo($("head")).ready(function() { + css_def.resolve(); + }); + return css_def.promise(); + }; + + var notification = function(message) { + $.achtung({message: message, timeout: 0, showEffects: false, hideEffects: false}); + }; + + var ERROR_DELAY = 5000; + + livesupport.ChatButton = nova.Widget.$extend({ + className: "openerp_style oe_chat_button", + events: { + "click": "click", + }, + __init__: function(parent, channel, options) { + this.$super(parent); + this.channel = channel; + this.options = options; + this.text = options.buttonText; + }, + render: function() { + this.$().append(templateEngine.chatButton({widget: this})); + }, + click: function() { + if (! this.manager) { + this.manager = new livesupport.ConversationManager(null); + this.activated_def = this.manager.start_polling(); + } + var def = $.Deferred(); + $.when(this.activated_def).then(function() { + def.resolve(); + }, function() { + def.reject(); + }); + setTimeout(function() { + def.reject(); + }, 5000); + def.then(_.bind(this.chat, this), function() { + notification("It seems the connection to the server is encountering problems, please try again later."); + }); + }, + chat: function() { + var self = this; + if (this.manager.conversations.length > 0) + return; + connection.getModel("im_livechat.channel").call("get_available_user", [this.channel]).then(function(user_id) { + if (! user_id) { + notification("None of our collaborators seems to be available, please try again later."); + return; + } + self.manager.ensure_users([user_id]).then(function() { + var conv = self.manager.activate_user(self.manager.get_user(user_id), true); + if (self.options.defaultMessage) { + conv.received_message({message: self.options.defaultMessage, + date: oeclient.datetime_to_str(new Date())}); + } + }); + }); + }, + }); + + livesupport.ImUser = nova.Class.$extend({ + __include__: [nova.DynamicProperties], + __init__: function(parent, user_rec) { + nova.DynamicProperties.__init__.call(this, parent); + user_rec.image_url = require.toUrl("../img/avatar/avatar.jpeg"); + if (user_rec.image) + user_rec.image_url = "data:image/png;base64," + user_rec.image; + this.set(user_rec); + this.set("watcher_count", 0); + this.on("change:watcher_count", this, function() { + if (this.get("watcher_count") === 0) + this.destroy(); + }); + }, + destroy: function() { + this.trigger("destroyed"); + nova.DynamicProperties.destroy.call(this); + }, + add_watcher: function() { + this.set("watcher_count", this.get("watcher_count") + 1); + }, + remove_watcher: function() { + this.set("watcher_count", this.get("watcher_count") - 1); + }, + }); + + livesupport.ConversationManager = nova.Class.$extend({ + __include__: [nova.DynamicProperties], + __init__: function(parent) { + nova.DynamicProperties.__init__.call(this, parent); + this.set("right_offset", 0); + this.conversations = []; + this.users = {}; + this.on("change:right_offset", this, this.calc_positions); + this.set("window_focus", true); + this.set("waiting_messages", 0); + this.focus_hdl = _.bind(function() { + this.set("window_focus", true); + }, this); + $(window).bind("focus", this.focus_hdl); + this.blur_hdl = _.bind(function() { + this.set("window_focus", false); + }, this); + $(window).bind("blur", this.blur_hdl); + this.on("change:window_focus", this, this.window_focus_change); + this.window_focus_change(); + this.on("change:waiting_messages", this, this.messages_change); + this.messages_change(); + this.create_ting(); + this.activated = false; + this.users_cache = {}; + this.last = null; + this.unload_event_handler = _.bind(this.unload, this); + }, + start_polling: function() { + var self = this; + + var uuid = localStorage["oe_livesupport_uuid"]; + var def = $.when(uuid); + + if (! uuid) { + def = connection.connector.call("/longpolling/im/gen_uuid", {}); + } + return def.then(function(uuid) { + localStorage["oe_livesupport_uuid"] = uuid; + return connection.getModel("im.user").call("get_by_user_id", [uuid]); + }).then(function(my_id) { + self.my_id = my_id["id"]; + return connection.getModel("im.user").call("assign_name", [uuid, userName]); + }).then(function() { + return self.ensure_users([self.my_id]) + }).then(function() { + var me = self.users_cache[self.my_id]; + delete self.users_cache[self.my_id]; + self.me = me; + me.set("name", "You"); + return connection.connector.call("/longpolling/im/activated", {}); + }).then(function(activated) { + if (activated) { + self.activated = true; + $(window).on("unload", self.unload_event_handler); + self.poll(); + } else { + return $.Deferred().reject(); + } + }); + }, + unload: function() { + connection.getModel("im.user").call("im_disconnect", [], {uuid: this.me.get("uuid"), context: {}}); + }, + ensure_users: function(user_ids) { + var no_cache = {}; + _.each(user_ids, function(el) { + if (! this.users_cache[el]) + no_cache[el] = el; + }, this); + var self = this; + if (_.size(no_cache) === 0) + return $.when(); + else + return connection.getModel("im.user").call("read", [_.values(no_cache), []]).then(function(users) { + self.add_to_user_cache(users); + }); + }, + add_to_user_cache: function(user_recs) { + _.each(user_recs, function(user_rec) { + if (! this.users_cache[user_rec.id]) { + var user = new livesupport.ImUser(this, user_rec); + this.users_cache[user_rec.id] = user; + user.on("destroyed", this, function() { + delete this.users_cache[user_rec.id]; + }); + } + }, this); + }, + get_user: function(user_id) { + return this.users_cache[user_id]; + }, + poll: function() { + console.debug("live support beggin polling"); + var self = this; + var user_ids = _.map(this.users_cache, function(el) { + return el.get("id"); + }); + connection.connector.call("/longpolling/im/poll", { + last: this.last, + users_watch: user_ids, + db: connection.database, + uid: connection.userId, + password: connection.password, + uuid: self.me.get("uuid"), + }).then(function(result) { + _.each(result.users_status, function(el) { + if (self.get_user(el.id)) + self.get_user(el.id).set(el); + }); + self.last = result.last; + var user_ids = _.pluck(_.pluck(result.res, "from_id"), 0); + self.ensure_users(user_ids).then(function() { + _.each(result.res, function(mes) { + var user = self.get_user(mes.from_id[0]); + self.received_message(mes, user); + }); + self.poll(); + }); + }, function() { + setTimeout(_.bind(self.poll, self), ERROR_DELAY); + }); + }, + get_activated: function() { + return this.activated; + }, + create_ting: function() { + this.ting = new Audio(new Audio().canPlayType("audio/ogg; codecs=vorbis") ? + require.toUrl("../audio/Ting.ogg") : + require.toUrl("../audio/Ting.mp3") + ); + }, + window_focus_change: function() { + if (this.get("window_focus")) { + this.set("waiting_messages", 0); + } + }, + messages_change: function() { + /*if (! instance.webclient.set_title_part) + return; + instance.webclient.set_title_part("im_messages", this.get("waiting_messages") === 0 ? undefined : + _.str.sprintf(_t("%d Messages"), this.get("waiting_messages")));*/ + }, + activate_user: function(user, focus) { + var conv = this.users[user.get('id')]; + if (! conv) { + conv = new livesupport.Conversation(this, user, this.me); + conv.appendTo($("body")); + conv.on("destroyed", this, function() { + this.conversations = _.without(this.conversations, conv); + delete this.users[conv.user.get('id')]; + this.calc_positions(); + }); + this.conversations.push(conv); + this.users[user.get('id')] = conv; + this.calc_positions(); + } + if (focus) + conv.focus(); + return conv; + }, + received_message: function(message, user) { + if (! this.get("window_focus")) { + this.set("waiting_messages", this.get("waiting_messages") + 1); + this.ting.play(); + this.create_ting(); + } + var conv = this.activate_user(user); + conv.received_message(message); + }, + calc_positions: function() { + var current = this.get("right_offset"); + _.each(_.range(this.conversations.length), function(i) { + this.conversations[i].set("right_position", current); + current += this.conversations[i].$().outerWidth(true); + }, this); + }, + destroy: function() { + $(window).off("unload", this.unload_event_handler); + $(window).unbind("blur", this.blur_hdl); + $(window).unbind("focus", this.focus_hdl); + nova.DynamicProperties.destroy.call(this); + }, + }); + + livesupport.Conversation = nova.Widget.$extend({ + className: "openerp_style oe_im_chatview", + events: { + "keydown input": "send_message", + "click .oe_im_chatview_close": "destroy", + "click .oe_im_chatview_header": "show_hide", + }, + __init__: function(parent, user, me) { + this.$super(parent); + this.me = me; + this.user = user; + this.user.add_watcher(); + this.set("right_position", 0); + this.shown = true; + this.set("pending", 0); + this.inputPlaceholder = defaultInputPlaceholder; + }, + render: function() { + this.$().append(templateEngine.conversation({widget: this})); + var change_status = function() { + this.$().toggleClass("oe_im_chatview_disconnected_status", this.user.get("im_status") === false); + this.$(".oe_im_chatview_online").toggle(this.user.get("im_status") === true); + this._go_bottom(); + }; + this.user.on("change:im_status", this, change_status); + change_status.call(this); + + this.on("change:right_position", this, this.calc_pos); + this.full_height = this.$().height(); + this.calc_pos(); + this.on("change:pending", this, _.bind(function() { + if (this.get("pending") === 0) { + this.$(".oe_im_chatview_nbr_messages").text(""); + } else { + this.$(".oe_im_chatview_nbr_messages").text("(" + this.get("pending") + ")"); + } + }, this)); + }, + show_hide: function() { + if (this.shown) { + this.$().animate({ + height: this.$(".oe_im_chatview_header").outerHeight(), + }); + } else { + this.$().animate({ + height: this.full_height, + }); + } + this.shown = ! this.shown; + if (this.shown) { + this.set("pending", 0); + } + }, + calc_pos: function() { + this.$().css("right", this.get("right_position")); + }, + received_message: function(message) { + if (this.shown) { + this.set("pending", 0); + } else { + this.set("pending", this.get("pending") + 1); + } + this._add_bubble(this.user, message.message, oeclient.str_to_datetime(message.date)); + }, + send_message: function(e) { + if(e && e.which !== 13) { + return; + } + var mes = this.$("input").val(); + this.$("input").val(""); + var send_it = _.bind(function() { + var model = connection.getModel("im.message"); + return model.call("post", [mes, this.user.get('id')], {uuid: this.me.get("uuid"), context: {}}); + }, this); + var tries = 0; + send_it().then(_.bind(function() { + this._add_bubble(this.me, mes, new Date()); + }, this), function(error, e) { + tries += 1; + if (tries < 3) + return send_it(); + }); + }, + _add_bubble: function(user, item, date) { + var items = [item]; + if (user === this.last_user) { + this.last_bubble.remove(); + items = this.last_items.concat(items); + } + this.last_user = user; + this.last_items = items; + var zpad = function(str, size) { + str = "" + str; + return new Array(size - str.length + 1).join('0') + str; + }; + date = "" + zpad(date.getHours(), 2) + ":" + zpad(date.getMinutes(), 2); + + this.last_bubble = $(templateEngine.conversation_bubble({"items": items, "user": user, "time": date})); + $(this.$(".oe_im_chatview_content").children()[0]).append(this.last_bubble); + this._go_bottom(); + }, + _go_bottom: function() { + this.$(".oe_im_chatview_content").scrollTop($(this.$(".oe_im_chatview_content").children()[0]).height()); + }, + focus: function() { + this.$(".oe_im_chatview_input").focus(); + }, + destroy: function() { + this.user.remove_watcher(); + this.trigger("destroyed"); + return this.$super(); + }, + }); + + + + return livesupport; +}); diff --git a/addons/im_livechat/static/ext/static/js/livesupport_templates.html b/addons/im_livechat/static/ext/static/js/livesupport_templates.html new file mode 100644 index 00000000000..54cdf450dc1 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/livesupport_templates.html @@ -0,0 +1,36 @@ + +<%def name="conversation"> + <div class="oe_im_chatview_header"> + <img src="${toUrl('../img/green.png')}" class="oe_im_chatview_online"/> + ${widget.user.get('name') || 'You'} + <button class="oe_im_chatview_close">×</button> + </div> + <div class="oe_im_chatview_disconnected"> + ${widget.user.get("name") + " is offline. He/She will receive your messages on his/her next connection."} + </div> + <div class="oe_im_chatview_content"> + <div></div> + </div> + <div class="oe_im_chatview_footer"> + <input class="oe_im_chatview_input" placeholder="${widget.inputPlaceholder}" /> + </div> +</%def> + +<%def name="conversation_bubble"> + <div class="oe_im_chatview_bubble"> + <div class="oe_im_chatview_clip"> + <img class="oe_im_chatview_avatar" src="${user.get('image_url')}"/> + </div> + <div class="oe_im_chatview_from">${user.get('name') || 'You'}</div> + <div class="oe_im_chatview_bubble_list"> + % _.each(items, function(item) { + <div class="oe_im_chatview_bubble_item">${item}</div> + % }); + </div> + <div class="oe_im_chatview_time">${time}</div> + </div> +</%def> + +<%def name="chatButton"> + ${widget.text} +</%def>
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/js/livesupport_templates.js b/addons/im_livechat/static/ext/static/js/livesupport_templates.js new file mode 100644 index 00000000000..aaabfd38caf --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/livesupport_templates.js @@ -0,0 +1 @@ +window.oe_livesupport_templates_callback("\n<%def name=\"conversation\">\n <div class=\"oe_im_chatview_header\">\n <img src=\"${toUrl('../img/green.png')}\" class=\"oe_im_chatview_online\"/>\n ${widget.user.get('name') || 'You'}\n <button class=\"oe_im_chatview_close\">\u00d7</button>\n </div>\n <div class=\"oe_im_chatview_disconnected\">\n ${widget.user.get(\"name\") + \" is offline. He/She will receive your messages on his/her next connection.\"}\n </div>\n <div class=\"oe_im_chatview_content\">\n <div></div>\n </div>\n <div class=\"oe_im_chatview_footer\">\n <input class=\"oe_im_chatview_input\" placeholder=\"${widget.inputPlaceholder}\" />\n </div>\n</%def>\n\n<%def name=\"conversation_bubble\">\n <div class=\"oe_im_chatview_bubble\">\n <div class=\"oe_im_chatview_clip\">\n <img class=\"oe_im_chatview_avatar\" src=\"${user.get('image_url')}\"/>\n </div>\n <div class=\"oe_im_chatview_from\">${user.get('name') || 'You'}</div>\n <div class=\"oe_im_chatview_bubble_list\">\n % _.each(items, function(item) {\n <div class=\"oe_im_chatview_bubble_item\">${item}</div>\n % });\n </div>\n <div class=\"oe_im_chatview_time\">${time}</div>\n </div>\n</%def>\n\n<%def name=\"chatButton\">\n ${widget.text}\n</%def>"); diff --git a/addons/im_livechat/static/ext/static/js/nova.js b/addons/im_livechat/static/ext/static/js/nova.js new file mode 100644 index 00000000000..eee00741fb6 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/nova.js @@ -0,0 +1,988 @@ +/* +Copyright (c) 2012, Nicolas Vanhoren +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +(function() { + +if (typeof(define) !== "undefined") { // requirejs + define(["jquery", "underscore"], nova_declare); +} else if (typeof(exports) !== "undefined") { // node + var _ = require("underscore") + _.extend(exports, nova_declare(null, _)); +} else { // define global variable 'nova' + nova = nova_declare($, _); +} + +function nova_declare($, _) { + var nova = {}; + nova.internal = {}; + + /* + * Modified Armin Ronacher's Classy library. + * + * 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. + */ + /** + * Classy - classy classes for JavaScript + * + * :copyright: (c) 2011 by Armin Ronacher. + * :license: BSD. + */ + (function(){ + var + context = this, + disable_constructor = false; + + /* we check if $super is in use by a class if we can. But first we have to + check if the JavaScript interpreter supports that. This also matches + to false positives later, but that does not do any harm besides slightly + slowing calls down. */ + var probe_super = (function(){this.$super();}).toString().indexOf('$super') > 0; + function usesSuper(obj) { + return !probe_super || /\B\$super\b/.test(obj.toString()); + } + + /* helper function to set the attribute of something to a value or + removes it if the value is undefined. */ + function setOrUnset(obj, key, value) { + if (value === undefined) + delete obj[key]; + else + obj[key] = value; + } + + /* gets the own property of an object */ + function getOwnProperty(obj, name) { + return Object.prototype.hasOwnProperty.call(obj, name) + ? obj[name] : undefined; + } + + /* instanciate a class without calling the constructor */ + function cheapNew(cls) { + disable_constructor = true; + var rv = new cls; + disable_constructor = false; + return rv; + } + + /* the base class we export */ + var Class = function() {}; + + /* extend functionality */ + Class.$extend = function(properties) { + var super_prototype = this.prototype; + + /* disable constructors and instanciate prototype. Because the + prototype can't raise an exception when created, we are safe + without a try/finally here. */ + var prototype = cheapNew(this); + + /* copy all properties of the includes over if there are any */ + prototype.__mixin_ids = _.clone(prototype.__mixin_ids || {}); + if (properties.__include__) + for (var i = 0, n = properties.__include__.length; i != n; ++i) { + var mixin = properties.__include__[i]; + if (mixin instanceof nova.Mixin) { + _.extend(prototype.__mixin_ids, mixin.__mixin_ids); + mixin = mixin.__mixin_properties; + } + for (var name in mixin) { + var value = getOwnProperty(mixin, name); + if (value !== undefined) + prototype[name] = mixin[name]; + } + } + + /* copy class vars from the superclass */ + properties.__classvars__ = properties.__classvars__ || {}; + if (prototype.__classvars__) + for (var key in prototype.__classvars__) + if (!properties.__classvars__[key]) { + var value = getOwnProperty(prototype.__classvars__, key); + properties.__classvars__[key] = value; + } + + /* copy all properties over to the new prototype */ + for (var name in properties) { + var value = getOwnProperty(properties, name); + if (name === '__include__' || + value === undefined) + continue; + + prototype[name] = typeof value === 'function' && usesSuper(value) ? + (function(meth, name) { + return function() { + var old_super = getOwnProperty(this, '$super'); + this.$super = super_prototype[name]; + try { + return meth.apply(this, arguments); + } + finally { + setOrUnset(this, '$super', old_super); + } + }; + })(value, name) : value + } + + var class_init = this.__class_init__ || function() {}; + var p_class_init = prototype.__class_init__ || function() {}; + delete prototype.__class_init__; + var n_class_init = function() { + class_init.apply(null, arguments); + p_class_init.apply(null, arguments); + } + n_class_init(prototype); + + /* dummy constructor */ + var instance = function() { + if (disable_constructor) + return; + var proper_this = context === this ? cheapNew(arguments.callee) : this; + if (proper_this.__init__) + proper_this.__init__.apply(proper_this, arguments); + proper_this.$class = instance; + return proper_this; + } + + /* copy all class vars over of any */ + for (var key in properties.__classvars__) { + var value = getOwnProperty(properties.__classvars__, key); + if (value !== undefined) + instance[key] = value; + } + + /* copy prototype and constructor over, reattach $extend and + return the class */ + instance.prototype = prototype; + instance.constructor = instance; + instance.$extend = this.$extend; + instance.$withData = this.$withData; + instance.__class_init__ = n_class_init; + return instance; + }; + + /* instanciate with data functionality */ + Class.$withData = function(data) { + var rv = cheapNew(this); + for (var key in data) { + var value = getOwnProperty(data, key); + if (value !== undefined) + rv[key] = value; + } + return rv; + }; + + /* export the class */ + this.Class = Class; + }).call(nova); + // end of Armin Ronacher's code + + var mixinId = 1; + nova.Mixin = nova.Class.$extend({ + __init__: function() { + this.__mixin_properties = {}; + this.__mixin_id = mixinId; + mixinId++; + this.__mixin_ids = {}; + this.__mixin_ids[this.__mixin_id] = true; + _.each(_.toArray(arguments), function(el) { + if (el instanceof nova.Mixin) { + _.extend(this.__mixin_properties, el.__mixin_properties); + _.extend(this.__mixin_ids, el.__mixin_ids); + } else { // object + _.extend(this.__mixin_properties, el) + } + }, this); + _.extend(this, this.__mixin_properties); + } + }); + + nova.Interface = nova.Mixin.$extend({ + __init__: function() { + var lst = []; + _.each(_.toArray(arguments), function(el) { + if (el instanceof nova.Interface) { + lst.push(el); + } else if (el instanceof nova.Mixin) { + var tmp = new nova.Interface(el.__mixin_properties); + tmp.__mixin_ids = el.__mixin_ids; + lst.push(tmp); + } else { // object + var nprops = {}; + _.each(el, function(v, k) { + nprops[k] = function() { + throw new nova.NotImplementedError(); + }; + }); + lst.push(nprops); + } + }); + this.$super.apply(this, lst); + } + }); + + nova.hasMixin = function(object, mixin) { + if (! object) + return false; + return (object.__mixin_ids || {})[mixin.__mixin_id] === true; + }; + + var ErrorBase = function() { + }; + ErrorBase.prototype = new Error(); + ErrorBase.$extend = nova.Class.$extend; + ErrorBase.$withData = nova.Class.$withData; + + nova.Error = ErrorBase.$extend({ + name: "nova.Error", + defaultMessage: "", + __init__: function(message) { + this.message = message || this.defaultMessage; + } + }); + + nova.NotImplementedError = nova.Error.$extend({ + name: "nova.NotImplementedError", + defaultMessage: "This method is not implemented" + }); + + nova.InvalidArgumentError = nova.Error.$extend({ + name: "nova.InvalidArgumentError" + }); + + /** + * Mixin to express the concept of destroying an object. + * When an object is destroyed, it should release any resource + * it could have reserved before. + */ + nova.Destroyable = new nova.Mixin({ + __init__: function() { + this.__destroyableDestroyed = false; + }, + /** + * Returns true if destroy() was called on the current object. + */ + isDestroyed : function() { + return this.__destroyableDestroyed; + }, + /** + * Inform the object it should destroy itself, releasing any + * resource it could have reserved. + */ + destroy : function() { + 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. + */ + nova.Parented = new nova.Mixin(nova.Destroyable, { + __parentedMixin : true, + __init__: function() { + nova.Destroyable.__init__.apply(this); + this.__parentedChildren = []; + 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) { + if (this.getParent()) { + if (this.getParent().__parentedMixin) { + this.getParent().__parentedChildren = _.without(this + .getParent().getChildren(), this); + } + } + this.__parentedParent = parent; + if (parent && parent.__parentedMixin) { + parent.__parentedChildren.push(this); + } + }, + /** + * Return the current parent of the object (or null). + */ + getParent : function() { + return this.__parentedParent; + }, + /** + * Return a list of the children of the current object. + */ + getChildren : function() { + return _.clone(this.__parentedChildren); + }, + destroy : function() { + _.each(this.getChildren(), function(el) { + el.destroy(); + }); + this.setParent(undefined); + nova.Destroyable.destroy.apply(this); + } + }); + + /* + * Yes, we steal Backbone's events :) + * + * This class just handle the dispatching of events, it is not meant to be extended, + * nor used directly. All integration with parenting and automatic unregistration of + * events is done in the mixin EventDispatcher. + */ + // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. + // Backbone may be freely distributed under the MIT license. + // For all details and documentation: + // http://backbonejs.org + nova.internal.Events = nova.Class.$extend({ + on : function(events, callback, context) { + var ev; + events = events.split(/\s+/); + var calls = this._callbacks || (this._callbacks = {}); + while (ev = events.shift()) { + var list = calls[ev] || (calls[ev] = {}); + var tail = list.tail || (list.tail = list.next = {}); + tail.callback = callback; + tail.context = context; + list.tail = tail.next = {}; + } + return this; + }, + off : function(events, callback, context) { + var ev, calls, node; + if (!events) { + delete this._callbacks; + } else if (calls = this._callbacks) { + events = events.split(/\s+/); + while (ev = events.shift()) { + node = calls[ev]; + delete calls[ev]; + if (!callback || !node) + continue; + while ((node = node.next) && node.next) { + if (node.callback === callback + && (!context || node.context === context)) + continue; + this.on(ev, node.callback, node.context); + } + } + } + return this; + }, + callbackList: function() { + var lst = []; + _.each(this._callbacks || {}, function(el, eventName) { + var node = el; + while ((node = node.next) && node.next) { + lst.push([eventName, node.callback, node.context]); + } + }); + return lst; + }, + trigger : function(events) { + var event, node, calls, tail, args, all, rest; + if (!(calls = this._callbacks)) + return this; + all = calls['all']; + (events = events.split(/\s+/)).push(null); + // Save references to the current heads & tails. + while (event = events.shift()) { + if (all) + events.push({ + next : all.next, + tail : all.tail, + event : event + }); + if (!(node = calls[event])) + continue; + events.push({ + next : node.next, + tail : node.tail + }); + } + rest = Array.prototype.slice.call(arguments, 1); + while (node = events.pop()) { + tail = node.tail; + args = node.event ? [ node.event ].concat(rest) : rest; + while ((node = node.next) !== tail) { + node.callback.apply(node.context || this, args); + } + } + return this; + } + }); + // end of Backbone's events class + + nova.EventDispatcher = new nova.Mixin(nova.Parented, { + __eventDispatcherMixin: true, + __init__: function() { + nova.Parented.__init__.apply(this); + this.__edispatcherEvents = new nova.internal.Events(); + this.__edispatcherRegisteredEvents = []; + }, + on: function(events, dest, func) { + var self = this; + events = events.split(/\s+/); + _.each(events, function(eventName) { + self.__edispatcherEvents.on(eventName, func, dest); + if (dest && dest.__eventDispatcherMixin) { + dest.__edispatcherRegisteredEvents.push({name: eventName, func: func, source: self}); + } + }); + return this; + }, + off: function(events, dest, func) { + var self = this; + events = events.split(/\s+/); + _.each(events, function(eventName) { + self.__edispatcherEvents.off(eventName, func, dest); + if (dest && dest.__eventDispatcherMixin) { + dest.__edispatcherRegisteredEvents = _.filter(dest.__edispatcherRegisteredEvents, function(el) { + return !(el.name === eventName && el.func === func && el.source === self); + }); + } + }); + return this; + }, + trigger: function(events) { + this.__edispatcherEvents.trigger.apply(this.__edispatcherEvents, arguments); + return this; + }, + destroy: function() { + var self = this; + _.each(this.__edispatcherRegisteredEvents, function(event) { + event.source.__edispatcherEvents.off(event.name, event.func, self); + }); + this.__edispatcherRegisteredEvents = []; + _.each(this.__edispatcherEvents.callbackList(), function(cal) { + this.off(cal[0], cal[2], cal[1]); + }, this); + this.__edispatcherEvents.off(); + nova.Parented.destroy.apply(this); + } + }); + + nova.Properties = new nova.Mixin(nova.EventDispatcher, { + __class_init__: function(proto) { + var props = {}; + _.each(proto.__properties || {}, function(v, k) { + props[k] = _.clone(v); + }); + _.each(proto, function(v, k) { + if (typeof v === "function") { + var res = /^((?:get)|(?:set))([A-Z]\w*)$/.exec(k); + if (! res) + return; + var name = res[2][0].toLowerCase() + res[2].slice(1); + var prop = props[name] || (props[name] = {}); + prop[res[1]] = v; + } + }); + proto.__properties = props; + }, + __init__: function() { + nova.EventDispatcher.__init__.apply(this); + this.__dynamicProperties = {}; + }, + set: function(arg1, arg2) { + var self = this; + var map; + if (typeof arg1 === "string") { + map = {}; + map[arg1] = arg2; + } else { + map = arg1; + } + var tmp_set = this.__props_setting; + this.__props_setting = false; + _.each(map, function(val, key) { + var prop = self.__properties[key]; + if (prop) { + if (! prop.set) + throw new nova.InvalidArgumentError("Property " + key + " does not have a setter method."); + prop.set.call(self, val); + } else { + self.fallbackSet(key, val); + } + }); + this.__props_setting = tmp_set; + if (! this.__props_setting && this.__props_setted) { + this.__props_setted = false; + self.trigger("change", self); + } + }, + get: function(key) { + var prop = this.__properties[key]; + if (prop) { + if (! prop.get) + throw new nova.InvalidArgumentError("Property " + key + " does not have a getter method."); + return prop.get.call(this); + } else { + return this.fallbackGet(key); + } + }, + fallbackSet: function(key, val) { + throw new nova.InvalidArgumentError("Property " + key + " is not defined."); + }, + fallbackGet: function(key) { + throw new nova.InvalidArgumentError("Property " + key + " is not defined."); + }, + trigger: function(name) { + nova.EventDispatcher.trigger.apply(this, arguments); + if (/(\s|^)change\:.*/.exec(name)) { + if (! this.__props_setting) + this.trigger("change"); + else + this.__props_setted = true; + } + } + }); + + nova.DynamicProperties = new nova.Mixin(nova.Properties, { + __init__: function() { + nova.Properties.__init__.apply(this); + this.__dynamicProperties = {}; + }, + fallbackSet: function(key, val) { + var tmp = this.__dynamicProperties[key]; + if (tmp === val) + return; + this.__dynamicProperties[key] = val; + this.trigger("change:" + key, this, { + oldValue: tmp, + newValue: val + }); + }, + fallbackGet: function(key) { + return this.__dynamicProperties[key]; + } + }); + + nova.Widget = nova.Class.$extend({ + __include__ : [nova.DynamicProperties], + tagName: 'div', + className: '', + attributes: {}, + events: {}, + __init__: function(parent) { + nova.Properties.__init__.apply(this); + this.__widget_element = $(document.createElement(this.tagName)); + this.$().addClass(this.className); + _.each(this.attributes, function(val, key) { + this.$().attr(key, val); + }, this); + _.each(this.events, function(val, key) { + key = key.split(" "); + val = _.bind(typeof val === "string" ? this[val] : val, this); + if (key.length > 1) { + this.$().on(key[0], key[1], val); + } else { + this.$().on(key[0], val); + } + }, this); + + this.setParent(parent); + }, + $: function(attr) { + if (attr) + return this.__widget_element.find.apply(this.__widget_element, arguments); + else + return this.__widget_element; + }, + /** + * Destroys the current widget, also destroys all its children before destroying itself. + */ + destroy: function() { + _.each(this.getChildren(), function(el) { + el.destroy(); + }); + this.$().remove(); + nova.Properties.destroy.apply(this); + }, + /** + * Renders the current widget and appends it to the given jQuery object or Widget. + * + * @param target A jQuery object or a Widget instance. + */ + appendTo: function(target) { + this.$().appendTo(target); + return this.render(); + }, + /** + * Renders the current widget and prepends it to the given jQuery object or Widget. + * + * @param target A jQuery object or a Widget instance. + */ + prependTo: function(target) { + this.$().prependTo(target); + return this.render(); + }, + /** + * Renders the current widget and inserts it after to the given jQuery object or Widget. + * + * @param target A jQuery object or a Widget instance. + */ + insertAfter: function(target) { + this.$().insertAfter(target); + return this.render(); + }, + /** + * Renders the current widget and inserts it before to the given jQuery object or Widget. + * + * @param target A jQuery object or a Widget instance. + */ + insertBefore: function(target) { + this.$().insertBefore(target); + return this.render(); + }, + /** + * Renders the current widget and replaces the given jQuery object. + * + * @param target A jQuery object or a Widget instance. + */ + replace: function(target) { + this.$().replace(target); + return this.render(); + }, + /** + * This is the method to implement to render the Widget. + */ + render: function() {} + }); + + /* + Nova Template Engine + */ + var escape_ = function(text) { + return JSON.stringify(text); + } + var indent_ = function(txt) { + var tmp = _.map(txt.split("\n"), function(x) { return " " + x; }); + tmp.pop(); + tmp.push(""); + return tmp.join("\n"); + }; + var tparams = { + def_begin: /<%\s*def\s+(?:name=(?:(?:"(.+?)")|(?:'(.+?)')))\s*>/g, + def_end: /<\/%\s*def\s*>/g, + comment_multi_begin: /<%\s*doc\s*>/g, + comment_multi_end: /<\/%\s*doc\s*>/g, + eval_long_begin: /<%/g, + eval_long_end: /%>/g, + eval_short_begin: /(?:^|\n)[[ \t]*%(?!{)/g, + eval_short_end: /\n|$/g, + escape_begin: /\${/g, + interpolate_begin: /%{/g, + comment_begin: /##/g, + comment_end: /\n|$/g + }; + // /<%\s*def\s+(?:name=(?:"(.+?)"))\s*%>([\s\S]*?)<%\s*def\s*%>/g + var allbegin = new RegExp( + "((?:\\\\)*)(" + + "(" + tparams.def_begin.source + ")|" + + "(" + tparams.def_end.source + ")|" + + "(" + tparams.comment_multi_begin.source + ")|" + + "(" + tparams.eval_long_begin.source + ")|" + + "(" + tparams.interpolate_begin.source + ")|" + + "(" + tparams.eval_short_begin.source + ")|" + + "(" + tparams.escape_begin.source + ")|" + + "(" + tparams.comment_begin.source + ")" + + ")" + , "g"); + allbegin.global = true; + var regexes = { + slashes: 1, + match: 2, + def_begin: 3, + def_name1: 4, + def_name2: 5, + def_end: 6, + comment_multi_begin: 7, + eval_long: 8, + interpolate: 9, + eval_short: 10, + escape: 11, + comment: 12 + }; + var regex_count = 4; + + var compileTemplate = function(text, options) { + options = _.extend({start: 0, indent: true}, options); + start = options.start; + var source = ""; + var current = start; + allbegin.lastIndex = current; + var text_end = text.length; + var restart = end; + var found; + var functions = []; + var indent = options.indent ? indent_ : function (txt) { return txt; }; + var rmWhite = options.removeWhitespaces ? function(txt) { + if (! txt) + return txt; + txt = _.map(txt.split("\n"), function(x) { return x.trim() }); + var last = txt.pop(); + txt = _.reject(txt, function(x) { return !x }); + txt.push(last); + return txt.join("\n") || "\n"; + } : function(x) { return x }; + while (found = allbegin.exec(text)) { + var to_add = rmWhite(text.slice(current, found.index)); + source += to_add ? "__p+=" + escape_(to_add) + ";\n" : ''; + current = found.index; + + // slash escaping handling + var slashes = found[regexes.slashes] || ""; + var nbr = slashes.length; + var nslash = slashes.slice(0, Math.floor(nbr / 2)); + source += nbr !== 0 ? "__p+=" + escape_(nslash) + ";\n" : ""; + if (nbr % 2 !== 0) { + source += "__p+=" + escape_(found[regexes.match]) + ";\n"; + current = found.index + found[0].length; + allbegin.lastIndex = current; + continue; + } + + if (found[regexes.def_begin]) { + var sub_compile = compileTemplate(text, _.extend({}, options, {start: found.index + found[0].length})); + var name = (found[regexes.def_name1] || found[regexes.def_name2]); + source += "var " + name + " = function(context) {\n" + indent(sub_compile.header + sub_compile.source + + sub_compile.footer) + "}\n"; + functions.push(name); + current = sub_compile.end; + } else if (found[regexes.def_end]) { + text_end = found.index; + restart = found.index + found[0].length; + break; + } else if (found[regexes.comment_multi_begin]) { + tparams.comment_multi_end.lastIndex = found.index + found[0].length; + var end = tparams.comment_multi_end.exec(text); + if (!end) + throw new Error("<%doc> without corresponding </%doc>"); + current = end.index + end[0].length; + } else if (found[regexes.eval_long]) { + tparams.eval_long_end.lastIndex = found.index + found[0].length; + var end = tparams.eval_long_end.exec(text); + if (!end) + throw new Error("<% without matching %>"); + var code = text.slice(found.index + found[0].length, end.index); + code = _(code.split("\n")).chain().map(function(x) { return x.trim() }) + .reject(function(x) { return !x }).value().join("\n"); + source += code + "\n"; + current = end.index + end[0].length; + } else if (found[regexes.interpolate]) { + var braces = /{|}/g; + braces.lastIndex = found.index + found[0].length; + var b_count = 1; + var brace; + while (brace = braces.exec(text)) { + if (brace[0] === "{") + b_count++; + else { + b_count--; + } + if (b_count === 0) + break; + } + if (b_count !== 0) + throw new Error("%{ without a matching }"); + source += "__p+=" + text.slice(found.index + found[0].length, brace.index) + ";\n" + current = brace.index + brace[0].length; + } else if (found[regexes.eval_short]) { + tparams.eval_short_end.lastIndex = found.index + found[0].length; + var end = tparams.eval_short_end.exec(text); + if (!end) + throw new Error("impossible state!!"); + source += text.slice(found.index + found[0].length, end.index).trim() + "\n"; + current = end.index; + } else if (found[regexes.escape]) { + var braces = /{|}/g; + braces.lastIndex = found.index + found[0].length; + var b_count = 1; + var brace; + while (brace = braces.exec(text)) { + if (brace[0] === "{") + b_count++; + else { + b_count--; + } + if (b_count === 0) + break; + } + if (b_count !== 0) + throw new Error("${ without a matching }"); + source += "__p+=_.escape(" + text.slice(found.index + found[0].length, brace.index) + ");\n" + current = brace.index + brace[0].length; + } else { // comment + tparams.comment_end.lastIndex = found.index + found[0].length; + var end = tparams.comment_end.exec(text); + if (!end) + throw new Error("impossible state!!"); + current = end.index + end[0].length; + } + allbegin.lastIndex = current; + } + var to_add = rmWhite(text.slice(current, text_end)); + source += to_add ? "__p+=" + escape_(to_add) + ";\n" : ""; + + var header = "var __p = ''; var print = function() { __p+=Array.prototype.join.call(arguments, '') };\n" + + "with (context || {}) {\n"; + var footer = "}\nreturn __p;\n"; + source = indent(source); + + return { + header: header, + source: source, + footer: footer, + end: restart, + functions: functions, + }; + }; + + nova.TemplateEngine = nova.Class.$extend({ + __init__: function() { + this.resetEnvironment(); + this.options = { + includeInDom: $ ? true : false, + indent: true, + removeWhitespaces: true, + }; + }, + loadFile: function(filename) { + var self = this; + return $.get(filename).pipe(function(content) { + return self.loadFileContent(content); + }); + }, + loadFileContent: function(file_content) { + var code = this.compileFile(file_content); + + if (this.options.includeInDom) { + var varname = _.uniqueId("novajstemplate"); + var previous = window[varname]; + code = "window." + varname + " = " + code + ";"; + var def = $.Deferred(); + var script = document.createElement("script"); + script.type = "text/javascript"; + script.text = code; + $("head")[0].appendChild(script); + $(script).ready(function() { + def.resolve(); + }); + def.then(_.bind(function() { + var tmp = window[varname]; + window[varname] = previous; + this.includeTemplates(tmp); + }, this)); + return def; + } else { + console.log("return (" + code + ")(context);"); + return this.includeTemplates(new Function('context', "return (" + code + ")(context);")); + } + }, + compileFile: function(file_content) { + var result = compileTemplate(file_content, _.extend({}, this.options)); + var to_append = ""; + _.each(result.functions, function(name) { + to_append += name + ": " + name + ",\n"; + }, this); + to_append = this.options.indent ? indent_(to_append) : to_append; + to_append = "return {\n" + to_append + "};\n"; + to_append = this.options.indent ? indent_(to_append) : to_append; + var code = "function(context) {\n" + result.header + + result.source + to_append + result.footer + "}\n"; + return code; + }, + includeTemplates: function(fct) { + var add = _.extend({engine: this}, this._env); + var functions = fct(add); + _.each(functions, function(func, name) { + if (this[name]) + throw new Error("The template '" + name + "' is already defined"); + this[name] = func; + }, this); + }, + buildTemplate: function(text) { + var comp = compileTemplate(text, _.extend({}, this.options)); + var result = comp.header + comp.source + comp.footer; + var add = _.extend({engine: this}, this._env); + var func = new Function('context', result); + return function(data) { + return func.call(this, _.extend(add, data)); + }; + }, + eval: function(text, context) { + return this.buildTemplate(text)(context); + }, + resetEnvironment: function(nenv) { + this._env = {_: _}; + this.extendEnvironment(nenv); + }, + extendEnvironment: function(env) { + _.extend(this._env, env || {}); + }, + }); + + return nova; +}; +})(); diff --git a/addons/im_livechat/static/ext/static/js/oeclient.js b/addons/im_livechat/static/ext/static/js/oeclient.js new file mode 100644 index 00000000000..b3192b786e2 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/oeclient.js @@ -0,0 +1,362 @@ +/* +Copyright (c) 2013, OpenERP +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +define(["underscore", "jquery", "nova"], function(_, $, nova) { + + var oeclient = {}; + + var genericJsonRPC = function(fct_name, params, fct) { + var data = { + jsonrpc: "2.0", + method: fct_name, + params: params, + id: Math.floor(Math.random()* (1000*1000*1000)), + }; + return fct(data).pipe(function(result) { + if (result.error !== undefined) { + console.error("Server application error", result.error); + return $.Deferred().reject("server", result.error); + } else { + return result.result; + } + }, function() { + console.error("JsonRPC communication error", _.toArray(arguments)); + var def = $.Deferred(); + return def.reject.apply(def, ["communication"].concat(_.toArray(arguments))); + }); + }; + + oeclient.jsonRpc = function(url, fct_name, params, settings) { + return genericJsonRPC(fct_name, params, function(data) { + return $.ajax(url, _.extend({}, settings, { + url: url, + dataType: 'json', + type: 'POST', + data: JSON.stringify(data), + contentType: 'application/json', + })); + }); + }; + + oeclient.jsonpRpc = function(url, fct_name, params, settings) { + return genericJsonRPC(fct_name, params, function(data) { + return $.ajax(url, _.extend({}, settings, { + url: url, + dataType: 'jsonp', + jsonp: 'jsonp', + type: 'GET', + cache: false, + data: {r: JSON.stringify(data)}, + })); + }); + }; + + oeclient.Connector = nova.Class.$extend({ + getService: function(serviceName) { + return new oeclient.Service(this, serviceName); + }, + }); + + oeclient.JsonRPCConnector = oeclient.Connector.$extend({ + __init__: function(url) { + this.url = url; + }, + call: function(sub_url, content) { + return oeclient.jsonRpc(this.url + sub_url, "call", content); + }, + send: function(serviceName, method, args) { + return this.call("/jsonrpc", {"service": serviceName, "method": method, "args": args}); + }, + }); + + oeclient.JsonpRPCConnector = oeclient.JsonRPCConnector.$extend({ + call: function(sub_url, content) { + return oeclient.jsonpRpc(this.url + sub_url, "call", content); + }, + }); + + oeclient.Service = nova.Class.$extend({ + __init__: function(connector, serviceName) { + this.connector = connector; + this.serviceName = serviceName; + }, + call: function(method, args) { + return this.connector.send(this.serviceName, method, args); + }, + }); + + oeclient.AuthenticationError = nova.Error.$extend({ + name: "oeclient.AuthenticationError", + defaultMessage: "An error occured during authentication." + }); + + oeclient.Connection = nova.Class.$extend({ + __init__: function(connector, database, login, password, userId) { + this.connector = connector; + this.setLoginInfo(database, login, password, userId); + this.userContext = null; + }, + setLoginInfo: function(database, login, password, userId) { + this.database = database; + this.login = login; + this.password = password; + this.userId = userId; + }, + checkLogin: function(force) { + force = force === undefined ? true: force; + if (this.userId && ! force) + return $.when(); + + if (! this.database || ! this.login || ! this.password) + throw new oeclient.AuthenticationError(); + + return this.getService("common").call("login", [this.database, this.login, this.password]) + .then(_.bind(function(result) { + this.userId = result; + if (! this.userId) { + console.error("Authentication failure"); + return $.Deferred().reject({message:"Authentication failure"}); + } + }, this)); + }, + getUserContext: function() { + if (! this.userContext) { + return this.getModel("res.users").call("context_get").then(_.bind(function(result) { + this.userContext = result; + return this.userContext; + }, this)); + } + return $.when(this.userContext); + }, + getModel: function(modelName) { + return new oeclient.Model(this, modelName); + }, + getService: function(serviceName) { + return this.connector.getService(serviceName); + }, + }); + + oeclient.Model = nova.Class.$extend({ + __init__: function(connection, modelName) { + this.connection = connection; + this.modelName = modelName; + }, + call: function(method, args, kw) { + return this.connection.checkLogin().then(_.bind(function() { + return this.connection.getService("object").call("execute_kw", [ + this.connection.database, + this.connection.userId, + this.connection.password, + this.modelName, + method, + args || [], + kw || {}, + ]); + }, this)); + }, + search_read: function(domain, fields, offset, limit, order, context) { + return this.call("search", [domain || [], offset || 0, limit || false, order || false, context || {}]).then(_.bind(function(record_ids) { + if (! record_ids) { + return []; + } + return this.call("read", [record_ids, fields || [], context || {}]).then(function(records) { + var index = {}; + _.each(records, function(r) { + index[r.id] = r; + }); + var res = []; + _.each(record_ids, function(id) { + if (index[id]) + res.push(index[id]); + }); + return res; + }); + }, this)); + }, + }); + + /** + * Converts a string to a Date javascript object using OpenERP's + * datetime string format (exemple: '2011-12-01 15:12:35'). + * + * The time zone is assumed to be UTC (standard for OpenERP 6.1) + * and will be converted to the browser's time zone. + * + * @param {String} str A string representing a datetime. + * @returns {Date} + */ + oeclient.str_to_datetime = function(str) { + if(!str) { + return str; + } + var regex = /^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d(?:\.\d+)?)$/; + var res = regex.exec(str); + if ( !res ) { + throw new Error("'" + str + "' is not a valid datetime"); + } + var tmp = new Date(); + tmp.setUTCFullYear(parseFloat(res[1])); + tmp.setUTCMonth(parseFloat(res[2]) - 1); + tmp.setUTCDate(parseFloat(res[3])); + tmp.setUTCHours(parseFloat(res[4])); + tmp.setUTCMinutes(parseFloat(res[5])); + tmp.setUTCSeconds(parseFloat(res[6])); + return tmp; + }; + + /** + * Converts a string to a Date javascript object using OpenERP's + * date string format (exemple: '2011-12-01'). + * + * As a date is not subject to time zones, we assume it should be + * represented as a Date javascript object at 00:00:00 in the + * time zone of the browser. + * + * @param {String} str A string representing a date. + * @returns {Date} + */ + oeclient.str_to_date = function(str) { + if(!str) { + return str; + } + var regex = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; + var res = regex.exec(str); + if ( !res ) { + throw new Error("'" + str + "' is not a valid date"); + } + var tmp = new Date(); + tmp.setFullYear(parseFloat(res[1])); + tmp.setMonth(parseFloat(res[2]) - 1); + tmp.setDate(parseFloat(res[3])); + tmp.setHours(0); + tmp.setMinutes(0); + tmp.setSeconds(0); + return tmp; + }; + + /** + * Converts a string to a Date javascript object using OpenERP's + * time string format (exemple: '15:12:35'). + * + * The OpenERP times are supposed to always be naive times. We assume it is + * represented using a javascript Date with a date 1 of January 1970 and a + * time corresponding to the meant time in the browser's time zone. + * + * @param {String} str A string representing a time. + * @returns {Date} + */ + oeclient.str_to_time = function(str) { + if(!str) { + return str; + } + var regex = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)$/; + var res = regex.exec(str); + if ( !res ) { + throw new Error("'" + str + "' is not a valid time"); + } + debugger; + var tmp = new Date(); + tmp.setFullYear(1970); + tmp.setMonth(0); + tmp.setDate(1); + tmp.setHours(parseFloat(res[1])); + tmp.setMinutes(parseFloat(res[2])); + tmp.setSeconds(parseFloat(res[3])); + return tmp; + }; + + /* + * Left-pad provided arg 1 with zeroes until reaching size provided by second + * argument. + * + * @param {Number|String} str value to pad + * @param {Number} size size to reach on the final padded value + * @returns {String} padded string + */ + var zpad = function(str, size) { + str = "" + str; + return new Array(size - str.length + 1).join('0') + str; + }; + + /** + * Converts a Date javascript object to a string using OpenERP's + * datetime string format (exemple: '2011-12-01 15:12:35'). + * + * The time zone of the Date object is assumed to be the one of the + * browser and it will be converted to UTC (standard for OpenERP 6.1). + * + * @param {Date} obj + * @returns {String} A string representing a datetime. + */ + oeclient.datetime_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getUTCFullYear(),4) + "-" + zpad(obj.getUTCMonth() + 1,2) + "-" + + zpad(obj.getUTCDate(),2) + " " + zpad(obj.getUTCHours(),2) + ":" + + zpad(obj.getUTCMinutes(),2) + ":" + zpad(obj.getUTCSeconds(),2); + }; + + /** + * Converts a Date javascript object to a string using OpenERP's + * date string format (exemple: '2011-12-01'). + * + * As a date is not subject to time zones, we assume it should be + * represented as a Date javascript object at 00:00:00 in the + * time zone of the browser. + * + * @param {Date} obj + * @returns {String} A string representing a date. + */ + oeclient.date_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getFullYear(),4) + "-" + zpad(obj.getMonth() + 1,2) + "-" + + zpad(obj.getDate(),2); + }; + + /** + * Converts a Date javascript object to a string using OpenERP's + * time string format (exemple: '15:12:35'). + * + * The OpenERP times are supposed to always be naive times. We assume it is + * represented using a javascript Date with a date 1 of January 1970 and a + * time corresponding to the meant time in the browser's time zone. + * + * @param {Date} obj + * @returns {String} A string representing a time. + */ + oeclient.time_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getHours(),2) + ":" + zpad(obj.getMinutes(),2) + ":" + + zpad(obj.getSeconds(),2); + }; + + return oeclient; + +});
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/js/require.js b/addons/im_livechat/static/ext/static/js/require.js new file mode 100644 index 00000000000..f46a9245d97 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/require.js @@ -0,0 +1,1993 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.1.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */ + +var requirejs, require, define; +(function (global) { + var req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath, + version = '2.1.2', + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + ap = Array.prototype, + aps = ap.slice, + apsp = ap.splice, + isBrowser = !!(typeof window !== 'undefined' && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false; + + function isFunction(it) { + return ostring.call(it) === '[object Function]'; + } + + function isArray(it) { + return ostring.call(it) === '[object Array]'; + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i; + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i; + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop]; + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop; + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break; + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if (deepStringMixin && typeof value !== 'string') { + if (!target[prop]) { + target[prop] = {}; + } + mixin(target[prop], value, force, deepStringMixin); + } else { + target[prop] = value; + } + } + }); + } + return target; + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments); + }; + } + + function scripts() { + return document.getElementsByTagName('script'); + } + + //Allow getting a global that expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value; + } + var g = global; + each(value.split('.'), function (part) { + g = g[part]; + }); + return g; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + e.requireType = id; + e.requireModules = requireModules; + if (err) { + e.originalError = err; + } + return e; + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } + cfg = requirejs; + requirejs = undefined; + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + function newContext(contextName) { + var inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId, + config = { + waitSeconds: 7, + baseUrl: './', + paths: {}, + pkgs: {}, + shim: {}, + map: {}, + config: {} + }, + registry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + requireCounter = 1, + unnormalizedCounter = 1; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; ary[i]; i += 1) { + part = ary[i]; + if (part === '.') { + ary.splice(i, 1); + i -= 1; + } else if (part === '..') { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, + foundMap, foundI, foundStarMap, starI, + baseParts = baseName && baseName.split('/'), + normalizedBaseParts = baseParts, + map = config.map, + starMap = map && map['*']; + + //Adjust any relative paths. + if (name && name.charAt(0) === '.') { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (getOwn(config.pkgs, baseName)) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + normalizedBaseParts = baseParts = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + } + + name = normalizedBaseParts.concat(name.split('/')); + trimDots(name); + + //Some use of packages may use a . path to reference the + //'main' module name, so normalize for that. + pkgConfig = getOwn(config.pkgs, (pkgName = name[0])); + name = name.join('/'); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf('./') === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + + //Apply map config if available. + if (applyMap && (baseParts || starMap) && map) { + nameParts = name.split('/'); + + for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/'); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment); + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break; + } + } + } + } + + if (foundMap) { + break; + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment); + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + return name; + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if (scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.parentNode.removeChild(scriptNode); + return true; + } + }); + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id); + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + removeScript(id); + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift(); + context.require.undef(id); + context.require([id]); + return true; + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, pluginModule, suffix, nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = ''; + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false; + name = '_@r' + (requireCounter += 1); + } + + nameParts = splitPrefix(name); + prefix = nameParts[0]; + name = nameParts[1]; + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap); + pluginModule = getOwn(defined, prefix); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap); + }); + } else { + normalizedName = normalize(name, parentName, applyMap); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap); + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName); + prefix = nameParts[0]; + normalizedName = nameParts[1]; + isNormalized = true; + + url = context.nameToUrl(normalizedName); + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? + '_unnormalized' + (unnormalizedCounter += 1) : + ''; + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? + prefix + '!' + normalizedName : + normalizedName) + suffix + }; + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (!mod) { + mod = registry[id] = new context.Module(depMap); + } + + return mod; + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (hasProp(defined, id) && + (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]); + } + } else { + getModule(depMap).on(name, fn); + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false; + + if (errback) { + errback(err); + } else { + each(ids, function (id) { + var mod = getOwn(registry, id); + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err; + if (mod.events.error) { + notified = true; + mod.emit('error', err); + } + } + }); + + if (!notified) { + req.onError(err); + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(defQueue, + [defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + } + + handlers = { + 'require': function (mod) { + if (mod.require) { + return mod.require; + } else { + return (mod.require = context.makeRequire(mod.map)); + } + }, + 'exports': function (mod) { + mod.usingExports = true; + if (mod.map.isDefine) { + if (mod.exports) { + return mod.exports; + } else { + return (mod.exports = defined[mod.map.id] = {}); + } + } + }, + 'module': function (mod) { + if (mod.module) { + return mod.module; + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return (config.config && getOwn(config.config, mod.map.id)) || {}; + }, + exports: defined[mod.map.id] + }); + } + } + }; + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id]; + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id; + + if (mod.error) { + mod.emit('error', mod.error); + } else { + traced[id] = true; + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId); + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]); + mod.check(); //pass false? + } else { + breakCycle(dep, traced, processed); + } + } + }); + processed[id] = true; + } + } + + function checkLoaded() { + var map, modId, err, usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true; + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return; + } + + inCheckLoaded = true; + + //Figure out the state of all the modules. + eachProp(registry, function (mod) { + map = mod.map; + modId = map.id; + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return; + } + + if (!map.isDefine) { + reqCalls.push(mod); + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true; + stillLoading = true; + } else { + noLoads.push(modId); + removeScript(modId); + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true; + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false); + } + } + } + }); + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); + err.contextName = context.contextName; + return onError(err); + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}); + }); + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + } + + inCheckLoaded = false; + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {}; + this.map = map; + this.shim = getOwn(config.shim, map.id); + this.depExports = []; + this.depMaps = []; + this.depMatched = []; + this.pluginMaps = {}; + this.depCount = 0; + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + }; + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {}; + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return; + } + + this.factory = factory; + + if (errback) { + //Register for errors on this module. + this.on('error', errback); + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err); + }); + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0); + + this.errback = errback; + + //Indicate this module has be initialized + this.inited = true; + + this.ignore = options.ignore; + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable(); + } else { + this.check(); + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true; + this.depCount -= 1; + this.depExports[i] = depExports; + } + }, + + fetch: function () { + if (this.fetched) { + return; + } + this.fetched = true; + + context.startTime = (new Date()).getTime(); + + var map = this.map; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true + })(this.shim.deps || [], bind(this, function () { + return map.prefix ? this.callPlugin() : this.load(); + })); + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load(); + } + }, + + load: function () { + var url = this.map.url; + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true; + context.load(this.map.id, url); + } + }, + + /** + * Checks is the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return; + } + + var err, cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory; + + if (!this.inited) { + this.fetch(); + } else if (this.error) { + this.emit('error', this.error); + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true; + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. + if (this.events.error) { + try { + exports = context.execCb(id, factory, depExports, exports); + } catch (e) { + err = e; + } + } else { + exports = context.execCb(id, factory, depExports, exports); + } + + if (this.map.isDefine) { + //If setting exports via 'module' is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = this.module; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== this.exports) { + exports = cjsModule.exports; + } else if (exports === undefined && this.usingExports) { + //exports already set the defined value. + exports = this.exports; + } + } + + if (err) { + err.requireMap = this.map; + err.requireModules = [this.map.id]; + err.requireType = 'define'; + return onError((this.error = err)); + } + + } else { + //Just a literal value + exports = factory; + } + + this.exports = exports; + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports; + + if (req.onResourceLoad) { + req.onResourceLoad(context, this.map, this.depMaps); + } + } + + //Clean up + delete registry[id]; + + this.defined = true; + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false; + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } + + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix); + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap); + + on(pluginMap, 'defined', bind(this, function (plugin) { + var load, normalizedMap, normalizedMod, + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true, + skipMap: true + }); + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = plugin.normalize(name, function (name) { + return normalize(name, parentName, true); + }) || ''; + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, + this.map.parentMap); + on(normalizedMap, + 'defined', bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + + normalizedMod = getOwn(registry, normalizedMap.id); + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap); + + if (this.events.error) { + normalizedMod.on('error', bind(this, function (err) { + this.emit('error', err); + })); + } + normalizedMod.enable(); + } + + return; + } + + load = bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true + }); + }); + + load.error = bind(this, function (err) { + this.inited = true; + this.error = err; + err.requireModules = [id]; + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id); + } + }); + + onError(err); + }); + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive; + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt; + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap); + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id]; + } + + try { + req.exec(text); + } catch (e) { + throw new Error('fromText eval for ' + moduleName + + ' failed: ' + e); + } + + if (hasInteractive) { + useInteractive = true; + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap); + + //Support anonymous modules. + context.completeLoad(moduleName); + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load); + }); + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config); + })); + + context.enable(pluginMap, this); + this.pluginMaps[pluginMap.id] = pluginMap; + }, + + enable: function () { + this.enabled = true; + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true; + + //Enable each dependency + each(this.depMaps, bind(this, function (depMap, i) { + var id, mod, handler; + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + !this.skipMap); + this.depMaps[i] = depMap; + + handler = getOwn(handlers, depMap.id); + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + this.defineDep(i, depExports); + this.check(); + })); + + if (this.errback) { + on(depMap, 'error', this.errback); + } + } + + id = depMap.id; + mod = registry[id]; + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this); + } + })); + + //Enable each plugin that is used in + //a dependency + eachProp(this.pluginMaps, bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id); + if (mod && !mod.enabled) { + context.enable(pluginMap, this); + } + })); + + this.enabling = false; + + this.check(); + }, + + on: function (name, cb) { + var cbs = this.events[name]; + if (!cbs) { + cbs = this.events[name] = []; + } + cbs.push(cb); + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt); + }); + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name]; + } + } + }; + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func); + } + } else { + node.removeEventListener(name, func, false); + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement; + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); + removeListener(node, context.onScriptError, 'error'); + + return { + node: node, + id: node && node.getAttribute('data-requiremodule') + }; + } + + function intakeDefines() { + var args; + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/'; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + var pkgs = config.pkgs, + shim = config.shim, + objs = { + paths: true, + config: true, + map: true + }; + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (prop === 'map') { + mixin(config[prop], value, true, true); + } else { + mixin(config[prop], value, true); + } + } else { + config[prop] = value; + } + }); + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value + }; + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value); + } + shim[id] = value; + }); + config.shim = shim; + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location; + + pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + }); + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id); + } + }); + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + makeShimExports: function (value) { + function fn() { + var ret; + if (value.init) { + ret = value.init.apply(global, arguments); + } + return ret || (value.exports && getGlobal(value.exports)); + } + return fn; + }, + + makeRequire: function (relMap, options) { + options = options || {}; + + function localRequire(deps, callback, errback) { + var id, map, requireMod; + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true; + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap); + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])'))); + } + return defined[id]; + } + + //Grab defines waiting in the global queue. + intakeDefines(); + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines(); + + requireMod = getModule(makeModuleMap(null, relMap)); + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap; + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + }); + + return localRequire; + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var index = moduleNamePlusExt.lastIndexOf('.'), + ext = null; + + if (index !== -1) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(normalize(moduleNamePlusExt, + relMap && relMap.id, true), ext); + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + } + }); + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue(); + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id); + + delete defined[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + cleanRegistry(id); + } + }; + } + + return localRequire; + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. parent module is passed in for context, + * used by the optimizer. + */ + enable: function (depMap, parent) { + var mod = getOwn(registry, depMap.id); + if (mod) { + getModule(depMap).enable(); + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, args, mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports; + + takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + args[0] = moduleName; + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break; + } + found = true; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true; + } + + callGetModule(args); + } + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName); + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return; + } else { + return onError(makeError('nodefine', + 'No define call for ' + moduleName, + null, + [moduleName])); + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + } + } + + checkLoaded(); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + parentPath; + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || ''); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split('/'); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/'); + pkg = getOwn(pkgs, parentModule); + parentPath = getOwn(paths, parentModule); + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0]; + } + syms.splice(0, i, parentPath); + break; + } else if (pkg) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/'); + url += (ext || (/\?/.test(url) ? '' : '.js')); + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url); + }, + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args); + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + var data = getScriptData(evt); + context.completeLoad(data.id); + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt); + if (!hasPathFallback(data.id)) { + return onError(makeError('scripterror', 'Script error', evt, [data.id])); + } + } + }; + + context.require = context.makeRequire(); + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + + //Find the right context, use default + var context, config, + contextName = defContextName; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = errback; + errback = optional; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = getOwn(contexts, contextName); + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName); + } + + if (config) { + context.configure(config); + } + + return context.require(deps, callback, errback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { + setTimeout(fn, 4); + } : function (fn) { fn(); }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + req.isBrowser = isBrowser; + s = req.s = { + contexts: contexts, + newContext: newContext + }; + + //Create default context. + req({}); + + //Exports some context-sensitive methods on global require. + each([ + 'toUrl', + 'undef', + 'defined', + 'specified' + ], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName]; + return ctx.require[prop].apply(ctx, arguments); + }; + }); + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node; + if (isBrowser) { + //In the browser so use a script tag + node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; + node.async = true; + + node.setAttribute('data-requirecontext', context.contextName); + node.setAttribute('data-requiremodule', moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/jrburke/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/jrburke/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true; + + node.attachEvent('onreadystatechange', context.onScriptLoad); + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEvenListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false); + node.addEventListener('error', context.onScriptError, false); + } + node.src = url; + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + + return node; + } else if (isWebWorker) { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } + }; + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + }); + return interactiveScript; + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main'); + if (dataMain) { + //Set final baseUrl if there is not already an explicit one. + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + cfg.baseUrl = subPath; + dataMain = mainScript; + } + + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = dataMain.replace(jsSuffixRegExp, ''); + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + return true; + } + }); + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, '') + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule'); + } + context = contexts[node.getAttribute('data-requirecontext')]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + }; + + define.amd = { + jQuery: true + }; + + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text); + }; + + //Set up with config info. + req(cfg); +}(this));
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/static/js/to_jsonp.py b/addons/im_livechat/static/ext/static/js/to_jsonp.py new file mode 100644 index 00000000000..61f1a885768 --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/to_jsonp.py @@ -0,0 +1,12 @@ + +import sys +import json + +file_name = sys.argv[1] +function_name = sys.argv[2] + +with open(file_name) as file_: + content = file_.read() + +print "window.%s(%s);" % (function_name, json.dumps(content)) + diff --git a/addons/im_livechat/static/ext/static/js/underscore.js b/addons/im_livechat/static/ext/static/js/underscore.js new file mode 100644 index 00000000000..c2517054bfb --- /dev/null +++ b/addons/im_livechat/static/ext/static/js/underscore.js @@ -0,0 +1,1221 @@ +// Underscore.js 1.4.3 +// http://underscorejs.org +// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `global` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Establish the object that gets returned to break out of a loop iteration. + var breaker = {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeForEach = ArrayProto.forEach, + nativeMap = ArrayProto.map, + nativeReduce = ArrayProto.reduce, + nativeReduceRight = ArrayProto.reduceRight, + nativeFilter = ArrayProto.filter, + nativeEvery = ArrayProto.every, + nativeSome = ArrayProto.some, + nativeIndexOf = ArrayProto.indexOf, + nativeLastIndexOf = ArrayProto.lastIndexOf, + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object via a string identifier, + // for Closure Compiler "advanced" mode. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.4.3'; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles objects with the built-in `forEach`, arrays, and raw objects. + // Delegates to **ECMAScript 5**'s native `forEach` if available. + var each = _.each = _.forEach = function(obj, iterator, context) { + if (obj == null) return; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + for (var key in obj) { + if (_.has(obj, key)) { + if (iterator.call(context, obj[key], key, obj) === breaker) return; + } + } + } + }; + + // Return the results of applying the iterator to each element. + // Delegates to **ECMAScript 5**'s native `map` if available. + _.map = _.collect = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); + each(obj, function(value, index, list) { + results[results.length] = iterator.call(context, value, index, list); + }); + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. + _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduce && obj.reduce === nativeReduce) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + } + each(obj, function(value, index, list) { + if (!initial) { + memo = value; + initial = true; + } else { + memo = iterator.call(context, memo, value, index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. + _.reduceRight = _.foldr = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + } + var length = obj.length; + if (length !== +length) { + var keys = _.keys(obj); + length = keys.length; + } + each(obj, function(value, index, list) { + index = keys ? keys[--length] : --length; + if (!initial) { + memo = obj[index]; + initial = true; + } else { + memo = iterator.call(context, memo, obj[index], index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, iterator, context) { + var result; + any(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Delegates to **ECMAScript 5**'s native `filter` if available. + // Aliased as `select`. + _.filter = _.select = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); + each(obj, function(value, index, list) { + if (iterator.call(context, value, index, list)) results[results.length] = value; + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, iterator, context) { + return _.filter(obj, function(value, index, list) { + return !iterator.call(context, value, index, list); + }, context); + }; + + // Determine whether all of the elements match a truth test. + // Delegates to **ECMAScript 5**'s native `every` if available. + // Aliased as `all`. + _.every = _.all = function(obj, iterator, context) { + iterator || (iterator = _.identity); + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); + each(obj, function(value, index, list) { + if (!(result = result && iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if at least one element in the object matches a truth test. + // Delegates to **ECMAScript 5**'s native `some` if available. + // Aliased as `any`. + var any = _.some = _.any = function(obj, iterator, context) { + iterator || (iterator = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); + each(obj, function(value, index, list) { + if (result || (result = iterator.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; + return any(obj, function(value) { + return value === target; + }); + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + return _.map(obj, function(value) { + return (_.isFunction(method) ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, function(value){ return value[key]; }); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // with specific `key:value` pairs. + _.where = function(obj, attrs) { + if (_.isEmpty(attrs)) return []; + return _.filter(obj, function(value) { + for (var key in attrs) { + if (attrs[key] !== value[key]) return false; + } + return true; + }); + }; + + // Return the maximum element or (element-based computation). + // Can't optimize arrays of integers longer than 65,535 elements. + // See: https://bugs.webkit.org/show_bug.cgi?id=80797 + _.max = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.max.apply(Math, obj); + } + if (!iterator && _.isEmpty(obj)) return -Infinity; + var result = {computed : -Infinity, value: -Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed >= result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.min.apply(Math, obj); + } + if (!iterator && _.isEmpty(obj)) return Infinity; + var result = {computed : Infinity, value: Infinity}; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + computed < result.computed && (result = {value : value, computed : computed}); + }); + return result.value; + }; + + // Shuffle an array. + _.shuffle = function(obj) { + var rand; + var index = 0; + var shuffled = []; + each(obj, function(value) { + rand = _.random(index++); + shuffled[index - 1] = shuffled[rand]; + shuffled[rand] = value; + }); + return shuffled; + }; + + // An internal function to generate lookup iterators. + var lookupIterator = function(value) { + return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, value, context) { + var iterator = lookupIterator(value); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value : value, + index : index, + criteria : iterator.call(context, value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index < right.index ? -1 : 1; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(obj, value, context, behavior) { + var result = {}; + var iterator = lookupIterator(value || _.identity); + each(obj, function(value, index) { + var key = iterator.call(context, value, index, obj); + behavior(result, key, value); + }); + return result; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = function(obj, value, context) { + return group(obj, value, context, function(result, key, value) { + (_.has(result, key) ? result[key] : (result[key] = [])).push(value); + }); + }; + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = function(obj, value, context) { + return group(obj, value, context, function(result, key) { + if (!_.has(result, key)) result[key] = 0; + result[key]++; + }); + }; + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iterator, context) { + iterator = iterator == null ? _.identity : lookupIterator(iterator); + var value = iterator.call(context, obj); + var low = 0, high = array.length; + while (low < high) { + var mid = (low + high) >>> 1; + iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + } + return low; + }; + + // Safely convert anything iterable into a real, live array. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if ((n != null) && !guard) { + return slice.call(array, Math.max(array.length - n, 0)); + } else { + return array[array.length - 1]; + } + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, (n == null) || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, output) { + each(input, function(value) { + if (_.isArray(value)) { + shallow ? push.apply(output, value) : flatten(value, shallow, output); + } else { + output.push(value); + } + }); + return output; + }; + + // Return a completely flattened version of an array. + _.flatten = function(array, shallow) { + return flatten(array, shallow, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iterator, context) { + if (_.isFunction(isSorted)) { + context = iterator; + iterator = isSorted; + isSorted = false; + } + var initial = iterator ? _.map(array, iterator, context) : array; + var results = []; + var seen = []; + each(initial, function(value, index) { + if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { + seen.push(value); + results.push(array[index]); + } + }); + return results; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(concat.apply(ArrayProto, arguments)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var rest = slice.call(arguments, 1); + return _.filter(_.uniq(array), function(item) { + return _.every(rest, function(other) { + return _.indexOf(other, item) >= 0; + }); + }); + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); + return _.filter(array, function(value){ return !_.contains(rest, value); }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + var args = slice.call(arguments); + var length = _.max(_.pluck(args, 'length')); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(args, "" + i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, l = list.length; i < l; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), + // we need this function. Return the position of the first occurrence of an + // item in an array, or -1 if the item is not included in the array. + // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, l = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); + for (; i < l; i++) if (array[i] === item) return i; + return -1; + }; + + // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var hasIndex = from != null; + if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { + return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + } + var i = (hasIndex ? from : array.length); + while (i--) if (array[i] === item) return i; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = arguments[2] || 1; + + var len = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(len); + + while(idx < len) { + range[idx++] = start; + start += step; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Binding with arguments is also known as `curry`. + // Delegates to **ECMAScript 5**'s native `Function.bind` if available. + // We check for `func.bind` first, to fail fast when `func` is undefined. + _.bind = function(func, context) { + var args, bound; + if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError; + args = slice.call(arguments, 2); + return bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + ctor.prototype = func.prototype; + var self = new ctor; + ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (Object(result) === result) return result; + return self; + }; + }; + + // Bind all of an object's methods to that object. Useful for ensuring that + // all callbacks defined on an object belong to it. + _.bindAll = function(obj) { + var funcs = slice.call(arguments, 1); + if (funcs.length == 0) funcs = _.functions(obj); + each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memo = {}; + hasher || (hasher = _.identity); + return function() { + var key = hasher.apply(this, arguments); + return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + }; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ return func.apply(null, args); }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. + _.throttle = function(func, wait) { + var context, args, timeout, result; + var previous = 0; + var later = function() { + previous = new Date; + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + if (!immediate) result = func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) result = func.apply(context, args); + return result; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = function(func) { + var ran = false, memo; + return function() { + if (ran) return memo; + ran = true; + memo = func.apply(this, arguments); + func = null; + return memo; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return function() { + var args = [func]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var funcs = arguments; + return function() { + var args = arguments; + for (var i = funcs.length - 1; i >= 0; i--) { + args = [funcs[i].apply(this, args)]; + } + return args[0]; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + if (times <= 0) return func(); + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = nativeKeys || function(obj) { + if (obj !== Object(obj)) throw new TypeError('Invalid object'); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var values = []; + for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var pairs = []; + for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + each(keys, function(key) { + if (key in obj) copy[key] = obj[key]; + }); + return copy; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + for (var key in obj) { + if (!_.contains(keys, key)) copy[key] = obj[key]; + } + return copy; + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + if (obj[prop] == null) obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. + if (a === b) return a !== 0 || 1 / a == 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className != toString.call(b)) return false; + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) return bStack[length] == b; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0, result = true; + // Recursively compare objects and arrays. + if (className == '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size == b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor))) { + return false; + } + // Deep compare objects. + for (var key in a) { + if (_.has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (_.has(b, key) && !(size--)) break; + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) == '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + return obj === Object(obj); + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) == '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return !!(obj && _.has(obj, 'callee')); + }; + } + + // Optimize `isFunction` if appropriate. + if (typeof (/./) !== 'function') { + _.isFunction = function(obj) { + return typeof obj === 'function'; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj != +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iterators. + _.identity = function(value) { + return value; + }; + + // Run a function **n** times. + _.times = function(n, iterator, context) { + var accum = Array(n); + for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + (0 | Math.random() * (max - min + 1)); + }; + + // List of HTML entities for escaping. + var entityMap = { + escape: { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '/': '/' + } + }; + entityMap.unescape = _.invert(entityMap.escape); + + // Regexes containing the keys and values listed immediately above. + var entityRegexes = { + escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), + unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + }; + + // Functions for escaping and unescaping strings to/from HTML interpolation. + _.each(['escape', 'unescape'], function(method) { + _[method] = function(string) { + if (string == null) return ''; + return ('' + string).replace(entityRegexes[method], function(match) { + return entityMap[method][match]; + }); + }; + }); + + // If the value of the named property is a function then invoke it; + // otherwise, return it. + _.result = function(object, property) { + if (object == null) return null; + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + each(_.functions(obj), function(name){ + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = '' + ++idCounter; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset) + .replace(escaper, function(match) { return '\\' + escapes[match]; }); + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + index = offset + match.length; + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + "return __p;\n"; + + try { + var render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function, which will delegate to the wrapper. + _.chain = function(obj) { + return _(obj).chain(); + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + _.extend(_.prototype, { + + // Start chaining a wrapped Underscore object. + chain: function() { + this._chain = true; + return this; + }, + + // Extracts the result from a wrapped and chained object. + value: function() { + return this._wrapped; + } + + }); + +}).call(this);
\ No newline at end of file diff --git a/addons/im_livechat/static/ext/test.html b/addons/im_livechat/static/ext/test.html new file mode 100644 index 00000000000..c6047ded77d --- /dev/null +++ b/addons/im_livechat/static/ext/test.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<head> + <script type="text/javascript" src="http://localhost/im_livechat/static/ext/static/js/require.js"></script> + <script type="text/javascript" src='http://localhost/im_livechat/loader?p={"db":"test","channel":1}'></script> +</head> +<body style="height:100%; margin:0; padding:0;"> + <iframe src="http://openerp.com" height="100%" width=100%"></iframe> +</body> +</html>
\ No newline at end of file diff --git a/addons/im_livechat/static/src/img/default.png b/addons/im_livechat/static/src/img/default.png Binary files differnew file mode 100644 index 00000000000..07d2503ce4e --- /dev/null +++ b/addons/im_livechat/static/src/img/default.png diff --git a/addons/im_livechat/static/src/img/icon.png b/addons/im_livechat/static/src/img/icon.png Binary files differnew file mode 100644 index 00000000000..07d2503ce4e --- /dev/null +++ b/addons/im_livechat/static/src/img/icon.png diff --git a/addons/im_livechat/web_page.html b/addons/im_livechat/web_page.html new file mode 100644 index 00000000000..2e1ea609126 --- /dev/null +++ b/addons/im_livechat/web_page.html @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html> +<head> + <script type="text/javascript"> + window.oe_im_livechat_auto = true; + </script> + {{script}} + <style type="text/css"> + body { + height: 100%; + font-size: 16px; + font-weight: 400; + font-family: "Lato", "Lucida Grande", "Helvetica neue", "Helvetica", "Verdana", "Arial", sans-serif; + overflow: hidden; + overflow-y: auto; + display: block; + margin: 0; + padding: 0; + border: none; + width: 100%; + height: 100%; + background: #C9C8E0; + background-image: -webkit-linear-gradient(top, #7c7bad, #ddddee); + background-image: -moz-linear-gradient(top, #7c7bad, #ddddee); + background-image: -ms-linear-gradient(top, #7c7bad, #ddddee); + background-image: -o-linear-gradient(top, #7c7bad, #ddddee); + background-image: linear-gradient(to bottom, #7c7bad, #ddddee); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7c7bad', endColorstr='#ddddee',GradientType=0 ); + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; + } + .main { + position: absolute; + opacity: 0; + top: 50%; + width: 100%; + margin-top: -150px; + color: white; + text-shadow: 0 1px 0 rgba(34, 52, 72, 0.2); + z-index: 10; + text-align: center; + } + .main h1 { + font-size: 54px; + } + .main div { + font-style: italic; + } + </style> +</head> +<body> + <div class="main" style="opacity: 1;"> + <h1 class="channel_name">{{channelName | escape}}</h1> + <div>Live Chat Powered by <strong>OpenERP</strong>.</div> + </div> +</body> +</html> diff --git a/addons/l10n_be_invoice_bba/partner.py b/addons/l10n_be_invoice_bba/partner.py index 8ae54617b98..bf8d5d7a0c3 100644 --- a/addons/l10n_be_invoice_bba/partner.py +++ b/addons/l10n_be_invoice_bba/partner.py @@ -44,6 +44,11 @@ class res_partner(osv.osv): help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ), } + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \ + ['out_inv_comm_type', 'out_inv_comm_algorithm'] + + _default = { 'out_inv_comm_type': 'none', } diff --git a/addons/l10n_lu/wizard/print_vat.py b/addons/l10n_lu/wizard/print_vat.py index 79213026496..bfa058720d3 100644 --- a/addons/l10n_lu/wizard/print_vat.py +++ b/addons/l10n_lu/wizard/print_vat.py @@ -9,10 +9,10 @@ from __future__ import with_statement import openerp from openerp.osv import fields, osv from openerp import tools +from openerp.modules.module import get_module_resource from openerp.tools.translate import _ from openerp.report.render import render from openerp.report.interface import report_int -from openerp import addons import tempfile import os @@ -53,7 +53,7 @@ class report_custom(report_int): try: tmp_file = tempfile.mkstemp(".pdf")[1] try: - tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) + tools.pdf_utils.fill_pdf(get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) with open(tmp_file, "r") as ofile: self.obj = external_pdf(ofile.read()) finally: diff --git a/addons/l10n_ro/res_partner.py b/addons/l10n_ro/res_partner.py index 2f1cc26faa8..96de4b4e86a 100755 --- a/addons/l10n_ro/res_partner.py +++ b/addons/l10n_ro/res_partner.py @@ -28,9 +28,32 @@ class res_partner(osv.osv): _columns = { 'nrc' : fields.char('NRC', size=16, help='Registration number at the Registry of Commerce'), } + + # The SQL constraints are no-ops but present only to display the right error message to the + # user when the partial unique indexes defined below raise errors/ + # The real constraints need to be implemented with PARTIAL UNIQUE INDEXES (see auto_init), + # due to the way accounting data is delegated by contacts to their companies in OpenERP 7.0. _sql_constraints = [ - ('vat_uniq', 'unique (vat)', 'The vat of the partner must be unique !'), - ('nrc_uniq', 'unique (nrc)', 'The code of the partner must be unique !') + ('vat_uniq', 'unique (id)', 'The vat of the partner must be unique !'), + ('nrc_uniq', 'unique (id)', 'The code of the partner must be unique !') ] + def _auto_init(self, cr, context=None): + result = super(res_partner, self)._auto_init(cr, context=context) + # Real implementation of the vat/nrc constraints: only "commercial entities" need to have + # unique numbers, and the condition for being a commercial entity is "is_company or parent_id IS NULL". + # Contacts inside a company automatically have a copy of the company's commercial fields + # (see _commercial_fields()), so they are automatically consistent. + cr.execute(""" + DROP INDEX IF EXISTS res_partner_vat_uniq_for_companies; + DROP INDEX IF EXISTS res_partner_nrc_uniq_for_companies; + CREATE UNIQUE INDEX res_partner_vat_uniq_for_companies ON res_partner (vat) WHERE is_company OR parent_id IS NULL; + CREATE UNIQUE INDEX res_partner_nrc_uniq_for_companies ON res_partner (nrc) WHERE is_company OR parent_id IS NULL; + """) + return result + + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['nrc'] + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/lunch/i18n/ko.po b/addons/lunch/i18n/ko.po new file mode 100644 index 00000000000..e76966ad73b --- /dev/null +++ b/addons/lunch/i18n/ko.po @@ -0,0 +1,896 @@ +# Korean translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-05-11 19:34+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Korean <ko@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: 2013-05-12 05:28+0000\n" +"X-Generator: Launchpad (build 16598)\n" + +#. module: lunch +#: field:lunch.product,category_id:0 +#: field:lunch.product.category,name:0 +msgid "Category" +msgstr "범주" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_order_by_supplier_form +msgid "Today's Orders by Supplier" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "My Orders" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Partially Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order.line:0 +msgid "Group By..." +msgstr "" + +#. module: lunch +#: field:lunch.alert,sunday:0 +msgid "Sunday" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,supplier:0 +#: field:lunch.product,supplier:0 +msgid "Supplier" +msgstr "공급업체" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "Today" +msgstr "오늘" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "March" +msgstr "3월" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "By Employee" +msgstr "직원에 의해" + +#. module: lunch +#: field:lunch.alert,friday:0 +msgid "Friday" +msgstr "" + +#. module: lunch +#: view:lunch.validation:0 +msgid "validate order lines" +msgstr "" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "Order lines Tree" +msgstr "" + +#. module: lunch +#: field:lunch.alert,specific_day:0 +#: field:report.lunch.order.line,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: view:lunch.order.line:0 +#: selection:lunch.order.line,state:0 +msgid "Received" +msgstr "받음" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "By Supplier" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_order_tree +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a lunch order. \n" +" </p>\n" +" <p>\n" +" A lunch order is defined by its user, date and order lines.\n" +" Each order line corresponds to a product, an additional note " +"and a price.\n" +" Before selecting your order lines, don't forget to read the " +"warnings displayed in the reddish area.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "Not Received" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_by_supplier_form +#: model:ir.ui.menu,name:lunch.menu_lunch_control_suppliers +msgid "Orders by Supplier" +msgstr "" + +#. module: lunch +#: view:lunch.validation:0 +msgid "Receive Meals" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "cashmove form" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_cashmove_form +msgid "" +"<p>\n" +" Here you can see your cash moves.<br/>A cash moves can be " +"either an expense or a payment.\n" +" An expense is automatically created when an order is " +"received while a payment is a reimbursement to the company encoded by the " +"manager.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_products +#: model:ir.ui.menu,name:lunch.menu_lunch_products +#: field:lunch.order,order_line_ids:0 +msgid "Products" +msgstr "상품" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "By Date" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +#: view:lunch.order.line:0 +#: selection:lunch.order.line,state:0 +msgid "Cancelled" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "lunch employee payment" +msgstr "" + +#. module: lunch +#: view:lunch.alert:0 +msgid "alert tree" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order_line +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_alert +msgid "Lunch Alert" +msgstr "" + +#. module: lunch +#: code:addons/lunch/lunch.py:183 +#, python-format +msgid "Select a product and put your order comments on the note." +msgstr "" + +#. module: lunch +#: selection:lunch.alert,alter_type:0 +msgid "Every Week" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove +msgid "Register Cash Moves" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "lunch orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.line:0 +msgid "Confirm" +msgstr "확정" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +msgid "Your Account" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Your Lunch Account" +msgstr "점심 계정" + +#. module: lunch +#: field:lunch.alert,active_from:0 +msgid "Between" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_order +msgid "Wizard to order a meal" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +#: selection:lunch.order.line,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: code:addons/lunch/lunch.py:180 +#, python-format +msgid "This is the first time you order a meal" +msgstr "이것은 첫번쨰 고기 주문입니다." + +#. module: lunch +#: field:report.lunch.order.line,price_total:0 +msgid "Total Price" +msgstr "총액" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_validation +msgid "lunch validation for order" +msgstr "" + +#. module: lunch +#: report:lunch.order.line:0 +msgid "Name/Date" +msgstr "이름/날짜" + +#. module: lunch +#: report:lunch.order.line:0 +msgid "Total :" +msgstr "합계 :" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_config +msgid "Configuration" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +#: field:lunch.order.line,state:0 +msgid "Status" +msgstr "상태" + +#. module: lunch +#: view:lunch.order.order:0 +msgid "" +"Order a meal doesn't mean that we have to pay it.\n" +" A meal should be paid when it is received." +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_control_accounts +#: model:ir.ui.menu,name:lunch.menu_lunch_control_accounts +msgid "Control Accounts" +msgstr "" + +#. module: lunch +#: selection:lunch.alert,alter_type:0 +msgid "Every Day" +msgstr "매일" + +#. module: lunch +#: field:lunch.order.line,cashmove:0 +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.order_order_lines +msgid "Order meals" +msgstr "육류 주문" + +#. module: lunch +#: view:lunch.alert:0 +msgid "Schedule Hour" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "September" +msgstr "9월" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_control_suppliers +msgid "" +"<p>\n" +" Here you can see every orders grouped by suppliers and by " +"date.\n" +" </p>\n" +" <p>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/terp-call-start.png\"/> to announce " +"that the order is ordered <br/>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/gtk-apply.png\"/> to announce that " +"the order is received <br/>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/gtk-cancel.png\"/> red X to announce " +"that the order isn't available\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: field:lunch.alert,tuesday:0 +msgid "Tuesday" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_tree +msgid "Your Orders" +msgstr "" + +#. module: lunch +#: field:report.lunch.order.line,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_products +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a product for lunch. \n" +" </p>\n" +" <p>\n" +" A product is defined by its name, category, price and " +"supplier.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: view:lunch.alert:0 +#: field:lunch.alert,message:0 +msgid "Message" +msgstr "" + +#. module: lunch +#: view:lunch.order.order:0 +msgid "Order Meals" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +#: view:lunch.order.order:0 +#: view:lunch.validation:0 +msgid "or" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_product_categories +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a lunch category. \n" +" </p>\n" +" <p>\n" +" Here you can find every lunch categories for products.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: view:lunch.order.order:0 +msgid "Order meal" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_categories +#: model:ir.ui.menu,name:lunch.menu_lunch_product_categories +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_control_suppliers +msgid "Control Suppliers" +msgstr "" + +#. module: lunch +#: view:lunch.alert:0 +msgid "Schedule Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_alert +#: model:ir.ui.menu,name:lunch.menu_lunch_alert +#: field:lunch.order,alerts:0 +msgid "Alerts" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,note:0 +#: field:report.lunch.order.line,note:0 +msgid "Note" +msgstr "" + +#. module: lunch +#: code:addons/lunch/lunch.py:250 +#, python-format +msgid "Add" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +#: view:lunch.product.category:0 +msgid "Products Form" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.cancel_order_lines +msgid "Cancel meals" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +#: view:lunch.cashmove:0 +msgid "lunch cashmove" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +msgid "Are you sure you want to cancel these meals?" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "My Account" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: field:lunch.alert,monday:0 +msgid "Monday" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,name:0 +msgid "unknown" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.validate_order_lines +msgid "Receive meals" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_id:0 +#: field:lunch.order,user_id:0 +#: field:report.lunch.order.line,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: model:ir.module.category,name:lunch.module_lunch_category +#: model:ir.ui.menu,name:lunch.menu_lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_title +msgid "Lunch" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_line +msgid "lunch order line" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "lunch product" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,user_id:0 +#: model:res.groups,name:lunch.group_lunch_user +msgid "User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,date:0 +#: field:lunch.order,date:0 +#: field:lunch.order.line,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Orders Tree" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Orders Form" +msgstr "" + +#. module: lunch +#: view:lunch.alert:0 +#: view:lunch.order.line:0 +msgid "Search" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_order_by_supplier_form +msgid "" +"<p>\n" +" Here you can see today's orders grouped by suppliers.\n" +" </p>\n" +" <p>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/terp-call-start.png\"/> to announce " +"that the order is ordered <br/>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/gtk-apply.png\"/> to announce that " +"the order is received <br/>\n" +" - Click on the <img " +"src=\"../../../web/static/src/img/icons/gtk-cancel.png\"/> to announce that " +"the order isn't available\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: selection:lunch.alert,alter_type:0 +msgid "Specific Day" +msgstr "" + +#. module: lunch +#: field:lunch.alert,wednesday:0 +msgid "Wednesday" +msgstr "" + +#. module: lunch +#: view:lunch.product.category:0 +msgid "Product Category: " +msgstr "" + +#. module: lunch +#: field:lunch.alert,active_to:0 +msgid "And" +msgstr "" + +#. module: lunch +#: selection:lunch.order.line,state:0 +msgid "Ordered" +msgstr "" + +#. module: lunch +#: field:report.lunch.order.line,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +msgid "Cancel Orders" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_alert +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a lunch alert. \n" +" </p>\n" +" <p>\n" +" Alerts are used to warn employee from possible issues " +"concerning the lunch orders.\n" +" To create a lunch alert you have to define its recurrency, " +"the time interval during which the alert should be executed and the message " +"to display.\n" +" </p>\n" +" <p>\n" +" Example: <br/>\n" +" - Recurency: Everyday<br/>\n" +" - Time interval: from 00h00 am to 11h59 pm<br/>\n" +" - Message: \"You must order before 10h30 am\"\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +msgid "A cancelled meal should not be paid by employees." +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cash +msgid "Administrate Cash Moves" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cancel +msgid "cancel lunch order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +#: view:lunch.order.line:0 +#: view:lunch.order.order:0 +#: view:lunch.validation:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_cashmove +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a payment. \n" +" </p>\n" +" <p>\n" +" Here you can see the employees' payment. A payment is a cash " +"move from the employee to the company.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: code:addons/lunch/lunch.py:186 +#, python-format +msgid "Your favorite meals will be created based on your last orders." +msgstr "" + +#. module: lunch +#: model:ir.module.category,description:lunch.module_lunch_category +msgid "" +"Helps you handle your lunch needs, if you are a manager you will be able to " +"create new products, cashmoves and to confirm or cancel orders." +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_lunch_control_accounts +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a new payment. \n" +" </p>\n" +" <p>\n" +" A cashmove can either be an expense or a payment.<br/>\n" +" An expense is automatically created at the order " +"receipt.<br/>\n" +" A payment represents the employee reimbursement to the " +"company.\n" +" </p>\n" +" " +msgstr "" + +#. module: lunch +#: field:lunch.alert,alter_type:0 +msgid "Recurrency" +msgstr "" + +#. module: lunch +#: code:addons/lunch/lunch.py:189 +#, python-format +msgid "Don't forget the alerts displayed in the reddish area" +msgstr "" + +#. module: lunch +#: field:lunch.alert,thursday:0 +msgid "Thursday" +msgstr "" + +#. module: lunch +#: report:lunch.order.line:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,product_id:0 +#: field:lunch.product,name:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,description:0 +#: report:lunch.order.line:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order.line,price:0 +#: field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,state:0 +msgid "Is an order or a Payment" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +msgid "New Order" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "cashmove tree" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +msgid "Cancel a meal means that we didn't receive it from the supplier." +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove +msgid "Employee Payments" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: selection:lunch.cashmove,state:0 +msgid "Payment" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:report.lunch.order.line,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "List" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_admin +msgid "Administrate Orders" +msgstr "" + +#. module: lunch +#: selection:report.lunch.order.line,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Select your order" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,order_id:0 +#: selection:lunch.cashmove,state:0 +#: report:lunch.order.line:0 +#: view:lunch.order.line:0 +#: field:lunch.order.line,order_id:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: report:lunch.order.line:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:lunch.order.order:0 +msgid "Are you sure you want to order these meals?" +msgstr "" + +#. module: lunch +#: view:lunch.cancel:0 +msgid "cancel order lines" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product_category +msgid "lunch product category" +msgstr "" + +#. module: lunch +#: field:lunch.alert,saturday:0 +msgid "Saturday" +msgstr "" + +#. module: lunch +#: model:res.groups,name:lunch.group_lunch_manager +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:lunch.validation:0 +msgid "Did your received these meals?" +msgstr "" + +#. module: lunch +#: view:lunch.validation:0 +msgid "Once a meal is received a new cash move is created for the employee." +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "Products Tree" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +#: field:lunch.order,total:0 +#: view:lunch.order.line:0 +msgid "Total" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_order_tree +msgid "Previous Orders" +msgstr "" diff --git a/addons/mail/i18n/ko.po b/addons/mail/i18n/ko.po new file mode 100644 index 00000000000..6315792f4fc --- /dev/null +++ b/addons/mail/i18n/ko.po @@ -0,0 +1,1687 @@ +# Korean translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:04+0000\n" +"PO-Revision-Date: 2013-05-12 07:37+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Korean <ko@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: 2013-05-13 05:17+0000\n" +"X-Generator: Launchpad (build 16614)\n" + +#. module: mail +#: view:mail.followers:0 +msgid "Followers Form" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_publisher_warranty_contract +msgid "publisher_warranty.contract" +msgstr "" + +#. module: mail +#: field:mail.compose.message,author_id:0 +#: field:mail.message,author_id:0 +msgid "Author" +msgstr "작성자" + +#. module: mail +#: view:mail.mail:0 +msgid "Message Details" +msgstr "" + +#. module: mail +#: help:mail.mail,email_to:0 +msgid "Message recipients" +msgstr "" + +#. module: mail +#: help:mail.message.subtype,default:0 +msgid "Activated by default when subscribing." +msgstr "" + +#. module: mail +#: view:mail.message:0 +msgid "Comments" +msgstr "" + +#. module: mail +#: view:mail.alias:0 +#: view:mail.mail:0 +msgid "Group By..." +msgstr "" + +#. module: mail +#: help:mail.compose.message,body:0 +#: help:mail.message,body:0 +msgid "Automatically sanitized HTML contents" +msgstr "" + +#. module: mail +#: help:mail.alias,alias_name:0 +msgid "" +"The name of the email alias, e.g. 'jobs' if you want to catch emails for " +"<jobs@example.my.openerp.com>" +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_email_compose_message_wizard +#: view:mail.compose.message:0 +msgid "Compose Email" +msgstr "메일 작성" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:132 +#, python-format +msgid "Add them into recipients and followers" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Group Name" +msgstr "그룹명" + +#. module: mail +#: selection:mail.group,public:0 +msgid "Public" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Body" +msgstr "본문" + +#. module: mail +#: view:mail.message:0 +msgid "Show messages to read" +msgstr "" + +#. module: mail +#: help:mail.compose.message,email_from:0 +#: help:mail.message,email_from:0 +msgid "" +"Email address of the sender. This field is set when no matching partner is " +"found for incoming emails." +msgstr "보내는 사람의 이메일 주소. 이 필드는 수신 메일에서 일치하는 파트너를 찾을 수 없을 때 설정됩니다." + +#. module: mail +#: model:ir.model,name:mail.model_mail_compose_message +msgid "Email composition wizard" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:23 +#, python-format +msgid "Add others" +msgstr "" + +#. module: mail +#: field:mail.message.subtype,parent_id:0 +msgid "Parent" +msgstr "" + +#. module: mail +#: field:mail.group,message_unread:0 +#: field:mail.thread,message_unread:0 +#: field:res.partner,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:296 +#, python-format +msgid "show" +msgstr "" + +#. module: mail +#: help:mail.group,group_ids:0 +msgid "" +"Members of those groups will automatically added as followers. Note that " +"they will be able to manage their subscription manually if necessary." +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/mail.js:1019 +#, python-format +msgid "Do you really want to delete this message?" +msgstr "" + +#. module: mail +#: view:mail.message:0 +#: field:mail.notification,read:0 +msgid "Read" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Search Groups" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/mail_followers.js:159 +#, python-format +msgid "followers" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_message.py:726 +#, python-format +msgid "Access Denied" +msgstr "" + +#. module: mail +#: help:mail.group,image_medium:0 +msgid "" +"Medium-sized photo of the group. It is automatically resized as a 128x128px " +"image, with aspect ratio preserved. Use this field in form views or some " +"kanban views." +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:212 +#, python-format +msgid "Uploading error" +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_support +msgid "Support" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_message.py:727 +#, python-format +msgid "" +"The requested operation cannot be completed due to security restrictions. " +"Please contact your system administrator.\n" +"\n" +"(Document type: %s, Operation: %s)" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +#: selection:mail.mail,state:0 +msgid "Received" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Thread" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:29 +#, python-format +msgid "Open the full mail composer" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:29 +#, python-format +msgid "ò" +msgstr "" + +#. module: mail +#: field:base.config.settings,alias_domain:0 +msgid "Alias Domain" +msgstr "" + +#. module: mail +#: field:mail.group,group_ids:0 +msgid "Auto Subscription" +msgstr "" + +#. module: mail +#: field:mail.mail,references:0 +msgid "References" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:206 +#, python-format +msgid "No messages." +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_group +msgid "Discussion group" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:98 +#: code:addons/mail/static/src/xml/mail.xml:110 +#, python-format +msgid "uploading" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:52 +#, python-format +msgid "more." +msgstr "" + +#. module: mail +#: help:mail.compose.message,type:0 +#: help:mail.message,type:0 +msgid "" +"Message type: email for email message, notification for system message, " +"comment for other messages such as user replies" +msgstr "" + +#. module: mail +#: help:mail.message.subtype,relation_field:0 +msgid "" +"Field used to link the related model to the subtype model when using " +"automatic subscription on a related document. The field is used to compute " +"getattr(related_document.relation_field)." +msgstr "" + +#. module: mail +#: selection:mail.mail,state:0 +msgid "Cancelled" +msgstr "" + +#. module: mail +#: field:mail.mail,reply_to:0 +msgid "Reply-To" +msgstr "" + +#. module: mail +#: code:addons/mail/wizard/invite.py:37 +#, python-format +msgid "<div>You have been invited to follow %s.</div>" +msgstr "" + +#. module: mail +#: help:mail.group,message_unread:0 +#: help:mail.thread,message_unread:0 +#: help:res.partner,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: mail +#: field:mail.group,image_medium:0 +msgid "Medium-sized photo" +msgstr "" + +#. module: mail +#: model:ir.actions.client,name:mail.action_mail_to_me_feeds +#: model:ir.ui.menu,name:mail.mail_tomefeeds +msgid "To: me" +msgstr "" + +#. module: mail +#: field:mail.message.subtype,name:0 +msgid "Message Type" +msgstr "" + +#. module: mail +#: field:mail.mail,auto_delete:0 +msgid "Auto Delete" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:12 +#: view:mail.group:0 +#, python-format +msgid "Unfollow" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:295 +#, python-format +msgid "show one more message" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_mail.py:74 +#: code:addons/mail/res_users.py:69 +#, python-format +msgid "Invalid Action!" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:25 +#, python-format +msgid "User img" +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_mail_mail +#: model:ir.ui.menu,name:mail.menu_mail_mail +#: view:mail.mail:0 +#: view:mail.message:0 +msgid "Emails" +msgstr "" + +#. module: mail +#: field:mail.followers,partner_id:0 +msgid "Related Partner" +msgstr "" + +#. module: mail +#: help:mail.group,message_summary:0 +#: help:mail.thread,message_summary:0 +#: help:res.partner,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: mail +#: help:mail.alias,alias_model_id:0 +msgid "" +"The model (OpenERP Document Kind) to which this alias corresponds. Any " +"incoming email that does not reply to an existing record will cause the " +"creation of a new record of this model (e.g. a Project Task)" +msgstr "" + +#. module: mail +#: field:mail.message.subtype,relation_field:0 +msgid "Relation field" +msgstr "" + +#. module: mail +#: selection:mail.compose.message,type:0 +#: selection:mail.message,type:0 +msgid "System notification" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_res_partner +#: view:mail.mail:0 +msgid "Partner" +msgstr "" + +#. module: mail +#: model:ir.ui.menu,name:mail.mail_my_stuff +msgid "Organizer" +msgstr "" + +#. module: mail +#: field:mail.compose.message,subject:0 +#: field:mail.message,subject:0 +msgid "Subject" +msgstr "" + +#. module: mail +#: field:mail.wizard.invite,partner_ids:0 +msgid "Partners" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Retry" +msgstr "" + +#. module: mail +#: field:mail.compose.message,email_from:0 +#: field:mail.mail,email_from:0 +#: field:mail.message,email_from:0 +msgid "From" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +#: view:mail.message.subtype:0 +msgid "Email message" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_base_config_settings +msgid "base.config.settings" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:36 +#: view:mail.compose.message:0 +#, python-format +msgid "Send" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/mail_followers.js:155 +#, python-format +msgid "No followers" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Failed" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:22 +#: model:ir.actions.act_window,name:mail.action_view_followers +#: model:ir.ui.menu,name:mail.menu_email_followers +#: view:mail.followers:0 +#: field:mail.group,message_follower_ids:0 +#: field:mail.thread,message_follower_ids:0 +#: field:res.partner,message_follower_ids:0 +#, python-format +msgid "Followers" +msgstr "" + +#. module: mail +#: model:ir.actions.client,name:mail.action_mail_archives_feeds +#: model:ir.ui.menu,name:mail.mail_archivesfeeds +msgid "Archives" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:97 +#: code:addons/mail/static/src/xml/mail.xml:109 +#, python-format +msgid "Delete this attachment" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:245 +#: view:mail.mail:0 +#, python-format +msgid "Reply" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/mail_followers.js:157 +#, python-format +msgid "One follower" +msgstr "" + +#. module: mail +#: field:mail.compose.message,type:0 +#: field:mail.message,type:0 +msgid "Type" +msgstr "" + +#. module: mail +#: selection:mail.compose.message,type:0 +#: view:mail.mail:0 +#: selection:mail.message,type:0 +msgid "Email" +msgstr "" + +#. module: mail +#: field:ir.ui.menu,mail_group_id:0 +msgid "Mail Group" +msgstr "" + +#. module: mail +#: selection:res.partner,notification_email_send:0 +msgid "Comments and Emails" +msgstr "" + +#. module: mail +#: field:mail.alias,alias_defaults:0 +msgid "Default Values" +msgstr "" + +#. module: mail +#: code:addons/mail/res_users.py:89 +#, python-format +msgid "%s has joined the %s network." +msgstr "" + +#. module: mail +#: help:mail.group,image_small:0 +msgid "" +"Small-sized photo of the group. It is automatically resized as a 64x64px " +"image, with aspect ratio preserved. Use this field anywhere a small image is " +"required." +msgstr "" + +#. module: mail +#: view:mail.compose.message:0 +#: field:mail.message,partner_ids:0 +msgid "Recipients" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:142 +#, python-format +msgid "<<<" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:43 +#, python-format +msgid "Write to the followers of this document..." +msgstr "" + +#. module: mail +#: field:mail.group,group_public_id:0 +msgid "Authorized Group" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Join Group" +msgstr "" + +#. module: mail +#: help:mail.mail,email_from:0 +msgid "Message sender, taken from user preferences." +msgstr "" + +#. module: mail +#: code:addons/mail/wizard/invite.py:40 +#, python-format +msgid "<div>You have been invited to follow a new document.</div>" +msgstr "" + +#. module: mail +#: field:mail.compose.message,parent_id:0 +#: field:mail.message,parent_id:0 +msgid "Parent Message" +msgstr "" + +#. module: mail +#: field:mail.compose.message,res_id:0 +#: field:mail.followers,res_id:0 +#: field:mail.message,res_id:0 +#: field:mail.wizard.invite,res_id:0 +msgid "Related Document ID" +msgstr "" + +#. module: mail +#: model:ir.actions.client,help:mail.action_mail_to_me_feeds +msgid "" +"<p>\n" +" <b>No private message.</b>\n" +" </p><p>\n" +" This list contains messages sent to you.\n" +" </p>\n" +" " +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_rd +msgid "R&D" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:61 +#, python-format +msgid "/web/binary/upload_attachment" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Advanced" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:244 +#, python-format +msgid "Move to Inbox" +msgstr "" + +#. module: mail +#: code:addons/mail/wizard/mail_compose_message.py:165 +#, python-format +msgid "Re:" +msgstr "" + +#. module: mail +#: field:mail.compose.message,to_read:0 +#: field:mail.message,to_read:0 +msgid "To read" +msgstr "" + +#. module: mail +#: code:addons/mail/res_users.py:69 +#, python-format +msgid "" +"You may not create a user. To create new users, you should use the " +"\"Settings > Users\" menu." +msgstr "" + +#. module: mail +#: help:mail.followers,res_model:0 +#: help:mail.wizard.invite,res_model:0 +msgid "Model of the followed resource" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:320 +#, python-format +msgid "like" +msgstr "" + +#. module: mail +#: view:mail.compose.message:0 +#: view:mail.wizard.invite:0 +msgid "Cancel" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:47 +#, python-format +msgid "Share with my followers..." +msgstr "" + +#. module: mail +#: field:mail.notification,partner_id:0 +msgid "Contact" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "" +"Only the invited followers can read the\n" +" discussions on this group." +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_ir_ui_menu +msgid "ir.ui.menu" +msgstr "" + +#. module: mail +#: view:mail.message:0 +msgid "Has attachments" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "on" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_message.py:915 +#, python-format +msgid "" +"The following partners chosen as recipients for the email have no email " +"address linked :" +msgstr "" + +#. module: mail +#: help:mail.alias,alias_defaults:0 +msgid "" +"A Python dictionary that will be evaluated to provide default values when " +"creating new records for this alias." +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_message_subtype +msgid "Message subtypes" +msgstr "" + +#. module: mail +#: help:mail.compose.message,notified_partner_ids:0 +#: help:mail.message,notified_partner_ids:0 +msgid "" +"Partners that have a notification pushing this message in their mailboxes" +msgstr "" + +#. module: mail +#: selection:mail.compose.message,type:0 +#: view:mail.mail:0 +#: selection:mail.message,type:0 +msgid "Comment" +msgstr "" + +#. module: mail +#: model:ir.actions.client,help:mail.action_mail_inbox_feeds +msgid "" +"<p>\n" +" <b>Good Job!</b> Your inbox is empty.\n" +" </p><p>\n" +" Your inbox contains private messages or emails sent to " +"you\n" +" as well as information related to documents or people " +"you\n" +" follow.\n" +" </p>\n" +" " +msgstr "" + +#. module: mail +#: field:mail.mail,notification:0 +msgid "Is Notification" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:188 +#, python-format +msgid "Compose a new message" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Send Now" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_mail.py:74 +#, python-format +msgid "" +"Unable to send email, please configure the sender's email address or alias." +msgstr "" + +#. module: mail +#: help:res.users,alias_id:0 +msgid "" +"Email address internally associated with this user. Incoming emails will " +"appear in the user's notifications." +msgstr "" + +#. module: mail +#: field:mail.group,image:0 +msgid "Photo" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:56 +#: code:addons/mail/static/src/xml/mail.xml:191 +#: view:mail.compose.message:0 +#: view:mail.wizard.invite:0 +#, python-format +msgid "or" +msgstr "" + +#. module: mail +#: help:mail.compose.message,vote_user_ids:0 +#: help:mail.message,vote_user_ids:0 +msgid "Users that voted for this message" +msgstr "" + +#. module: mail +#: help:mail.group,alias_id:0 +msgid "" +"The email address associated with this group. New emails received will " +"automatically create new topics." +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Month" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Email Search" +msgstr "" + +#. module: mail +#: field:mail.compose.message,child_ids:0 +#: field:mail.message,child_ids:0 +msgid "Child Messages" +msgstr "" + +#. module: mail +#: field:mail.alias,alias_user_id:0 +msgid "Owner" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_res_users +msgid "Users" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_message +#: field:mail.mail,mail_message_id:0 +#: view:mail.message:0 +#: field:mail.notification,message_id:0 +#: field:mail.wizard.invite,message:0 +msgid "Message" +msgstr "" + +#. module: mail +#: help:mail.followers,res_id:0 +#: help:mail.wizard.invite,res_id:0 +msgid "Id of the followed resource" +msgstr "" + +#. module: mail +#: field:mail.compose.message,body:0 +#: field:mail.message,body:0 +msgid "Contents" +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_mail_alias +#: model:ir.ui.menu,name:mail.mail_alias_menu +msgid "Aliases" +msgstr "" + +#. module: mail +#: help:mail.message.subtype,description:0 +msgid "" +"Description that will be added in the message posted for this subtype. If " +"void, the name will be added instead." +msgstr "" + +#. module: mail +#: field:mail.compose.message,vote_user_ids:0 +#: field:mail.message,vote_user_ids:0 +msgid "Votes" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Group" +msgstr "" + +#. module: mail +#: help:mail.compose.message,starred:0 +#: help:mail.message,starred:0 +msgid "Current user has a starred notification linked to this message" +msgstr "" + +#. module: mail +#: field:mail.group,public:0 +msgid "Privacy" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Notification" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/mail.js:650 +#, python-format +msgid "Please complete partner's informations" +msgstr "" + +#. module: mail +#: view:mail.wizard.invite:0 +msgid "Add Followers" +msgstr "" + +#. module: mail +#: view:mail.compose.message:0 +msgid "Followers of selected items and" +msgstr "" + +#. module: mail +#: field:mail.alias,alias_force_thread_id:0 +msgid "Record Thread ID" +msgstr "" + +#. module: mail +#: model:ir.ui.menu,name:mail.mail_group_root +msgid "My Groups" +msgstr "" + +#. module: mail +#: model:ir.actions.client,help:mail.action_mail_archives_feeds +msgid "" +"<p>\n" +" No message found and no message sent yet.\n" +" </p><p>\n" +" Click on the top-right icon to compose a message. This\n" +" message will be sent by email if it's an internal " +"contact.\n" +" </p>\n" +" " +msgstr "" + +#. module: mail +#: view:mail.mail:0 +#: field:mail.mail,state:0 +msgid "Status" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +#: selection:mail.mail,state:0 +msgid "Outgoing" +msgstr "" + +#. module: mail +#: selection:res.partner,notification_email_send:0 +msgid "All feeds" +msgstr "" + +#. module: mail +#: help:mail.compose.message,record_name:0 +#: help:mail.message,record_name:0 +msgid "Name get of the related document." +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_notifications +#: model:ir.model,name:mail.model_mail_notification +#: model:ir.ui.menu,name:mail.menu_email_notifications +#: field:mail.compose.message,notification_ids:0 +#: view:mail.message:0 +#: field:mail.message,notification_ids:0 +#: view:mail.notification:0 +msgid "Notifications" +msgstr "" + +#. module: mail +#: view:mail.alias:0 +msgid "Search Alias" +msgstr "" + +#. module: mail +#: help:mail.alias,alias_force_thread_id:0 +msgid "" +"Optional ID of a thread (record) to which all incoming messages will be " +"attached, even if they did not reply to it. If set, this will disable the " +"creation of new records completely." +msgstr "" + +#. module: mail +#: help:mail.message.subtype,name:0 +msgid "" +"Message subtype gives a more precise type on the message, especially for " +"system notifications. For example, it can be a notification related to a new " +"record (New), or to a stage change in a process (Stage change). Message " +"subtypes allow to precisely tune the notifications the user want to receive " +"on its wall." +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "by" +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_best_sales_practices +msgid "Best Sales Practices" +msgstr "" + +#. module: mail +#: selection:mail.group,public:0 +msgid "Selected Group Only" +msgstr "" + +#. module: mail +#: field:mail.group,message_is_follower:0 +#: field:mail.thread,message_is_follower:0 +#: field:res.partner,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: mail +#: view:mail.alias:0 +#: view:mail.mail:0 +msgid "User" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Groups" +msgstr "" + +#. module: mail +#: view:mail.message:0 +msgid "Messages Search" +msgstr "" + +#. module: mail +#: field:mail.compose.message,date:0 +#: field:mail.message,date:0 +msgid "Date" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:34 +#, python-format +msgid "Post" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Extended Filters..." +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:122 +#, python-format +msgid "To:" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:193 +#, python-format +msgid "Write to my followers" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_res_groups +msgid "Access Groups" +msgstr "" + +#. module: mail +#: field:mail.message.subtype,default:0 +msgid "Default" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:294 +#, python-format +msgid "show more message" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:246 +#, python-format +msgid "Mark as Todo" +msgstr "" + +#. module: mail +#: help:mail.message.subtype,parent_id:0 +msgid "Parent subtype, used for automatic subscription." +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_wizard_invite +msgid "Invite wizard" +msgstr "" + +#. module: mail +#: field:mail.group,message_summary:0 +#: field:mail.thread,message_summary:0 +#: field:res.partner,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: mail +#: help:mail.message.subtype,res_model:0 +msgid "" +"Model the subtype applies to. If False, this subtype applies to all models." +msgstr "" + +#. module: mail +#: field:mail.compose.message,subtype_id:0 +#: field:mail.followers,subtype_ids:0 +#: field:mail.message,subtype_id:0 +#: view:mail.message.subtype:0 +msgid "Subtype" +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "Group Form" +msgstr "" + +#. module: mail +#: field:mail.compose.message,starred:0 +#: field:mail.message,starred:0 +#: field:mail.notification,starred:0 +msgid "Starred" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:296 +#, python-format +msgid "more messages" +msgstr "" + +#. module: mail +#: code:addons/mail/update.py:93 +#, python-format +msgid "Error" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:13 +#, python-format +msgid "Following" +msgstr "" + +#. module: mail +#: sql_constraint:mail.alias:0 +msgid "" +"Unfortunately this email alias is already used, please choose a unique one" +msgstr "" + +#. module: mail +#: help:mail.alias,alias_user_id:0 +msgid "" +"The owner of records created upon receiving emails on this alias. If this " +"field is not set the system will attempt to find the right owner based on " +"the sender (From) address, or will use the Administrator account if no " +"system user is found for that address." +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:52 +#, python-format +msgid "And" +msgstr "" + +#. module: mail +#: field:mail.compose.message,message_id:0 +#: field:mail.message,message_id:0 +msgid "Message-Id" +msgstr "" + +#. module: mail +#: help:mail.group,image:0 +msgid "" +"This field holds the image used as photo for the group, limited to " +"1024x1024px." +msgstr "" + +#. module: mail +#: field:mail.compose.message,attachment_ids:0 +#: view:mail.mail:0 +#: field:mail.message,attachment_ids:0 +msgid "Attachments" +msgstr "" + +#. module: mail +#: field:mail.compose.message,record_name:0 +#: field:mail.message,record_name:0 +msgid "Message Record Name" +msgstr "" + +#. module: mail +#: field:mail.mail,email_cc:0 +msgid "Cc" +msgstr "" + +#. module: mail +#: help:mail.notification,starred:0 +msgid "Starred message that goes into the todo mailbox" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:125 +#: view:mail.compose.message:0 +#, python-format +msgid "Followers of" +msgstr "" + +#. module: mail +#: help:mail.mail,auto_delete:0 +msgid "Permanently delete this email after sending it, to save space" +msgstr "" + +#. module: mail +#: model:ir.actions.client,name:mail.action_mail_group_feeds +msgid "Discussion Group" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:242 +#, python-format +msgid "Done" +msgstr "" + +#. module: mail +#: model:mail.message.subtype,name:mail.mt_comment +msgid "Discussions" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:11 +#, python-format +msgid "Follow" +msgstr "" + +#. module: mail +#: field:mail.group,name:0 +msgid "Name" +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_all_employees +msgid "Whole Company" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:131 +#: code:addons/mail/static/src/xml/mail.xml:278 +#: view:mail.compose.message:0 +#, python-format +msgid "and" +msgstr "" + +#. module: mail +#: help:mail.mail,body_html:0 +msgid "Rich-text/HTML message" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +msgid "Creation Month" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:306 +#, python-format +msgid "Compose new Message" +msgstr "" + +#. module: mail +#: field:mail.group,menu_id:0 +msgid "Related Menu" +msgstr "" + +#. module: mail +#: view:mail.message:0 +msgid "Content" +msgstr "" + +#. module: mail +#: field:mail.mail,email_to:0 +msgid "To" +msgstr "" + +#. module: mail +#: field:mail.compose.message,notified_partner_ids:0 +#: field:mail.message,notified_partner_ids:0 +msgid "Notified partners" +msgstr "" + +#. module: mail +#: help:mail.group,public:0 +msgid "" +"This group is visible by non members. Invisible groups can add " +"members through the invite button." +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_board +msgid "Board meetings" +msgstr "" + +#. module: mail +#: constraint:mail.alias:0 +msgid "" +"Invalid expression, it must be a literal python dictionary definition e.g. " +"\"{'field': 'value'}\"" +msgstr "" + +#. module: mail +#: field:mail.alias,alias_model_id:0 +msgid "Aliased Model" +msgstr "" + +#. module: mail +#: help:mail.compose.message,message_id:0 +#: help:mail.message,message_id:0 +msgid "Message unique identifier" +msgstr "" + +#. module: mail +#: field:mail.group,description:0 +#: field:mail.message.subtype,description:0 +msgid "Description" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_followers +msgid "Document Followers" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail_followers.xml:35 +#, python-format +msgid "Remove this follower" +msgstr "" + +#. module: mail +#: selection:res.partner,notification_email_send:0 +msgid "Never" +msgstr "" + +#. module: mail +#: field:mail.mail,mail_server_id:0 +msgid "Outgoing mail server" +msgstr "" + +#. module: mail +#: code:addons/mail/mail_message.py:919 +#, python-format +msgid "Partners email addresses not found" +msgstr "" + +#. module: mail +#: view:mail.mail:0 +#: selection:mail.mail,state:0 +msgid "Sent" +msgstr "" + +#. module: mail +#: field:mail.mail,body_html:0 +msgid "Rich-text Contents" +msgstr "" + +#. module: mail +#: help:mail.compose.message,to_read:0 +#: help:mail.message,to_read:0 +msgid "Current user has an unread notification linked to this message" +msgstr "" + +#. module: mail +#: help:res.partner,notification_email_send:0 +msgid "" +"Choose in which case you want to receive an email when you receive new feeds." +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_groups +#: model:ir.ui.menu,name:mail.mail_allgroups +msgid "Join a group" +msgstr "" + +#. module: mail +#: model:ir.actions.client,help:mail.action_mail_group_feeds +msgid "" +"<p>\n" +" No message in this group.\n" +" </p>\n" +" " +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:213 +#, python-format +msgid "Please, wait while the file is uploading." +msgstr "" + +#. module: mail +#: view:mail.group:0 +msgid "" +"This group is visible by everyone,\n" +" including your customers if you " +"installed\n" +" the portal module." +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:243 +#, python-format +msgid "Set back to Todo" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:128 +#, python-format +msgid "this document" +msgstr "" + +#. module: mail +#: field:mail.compose.message,filter_id:0 +msgid "Filters" +msgstr "" + +#. module: mail +#: field:res.partner,notification_email_send:0 +msgid "Receive Feeds by Email" +msgstr "" + +#. module: mail +#: help:base.config.settings,alias_domain:0 +msgid "" +"If you have setup a catch-all email domain redirected to the OpenERP server, " +"enter the domain name here." +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_mail_message +#: model:ir.ui.menu,name:mail.menu_mail_message +#: field:mail.group,message_ids:0 +#: view:mail.message:0 +#: field:mail.thread,message_ids:0 +#: field:res.partner,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:141 +#, python-format +msgid "others..." +msgstr "" + +#. module: mail +#: model:ir.actions.client,name:mail.action_mail_star_feeds +#: model:ir.ui.menu,name:mail.mail_starfeeds +msgid "To-do" +msgstr "" + +#. module: mail +#: view:mail.alias:0 +#: field:mail.alias,alias_name:0 +#: field:mail.group,alias_id:0 +#: field:res.users,alias_id:0 +msgid "Alias" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: mail +#: help:mail.compose.message,notification_ids:0 +#: help:mail.message,notification_ids:0 +msgid "" +"Technical field holding the message notifications. Use notified_partner_ids " +"to access notified partners." +msgstr "" + +#. module: mail +#: model:ir.ui.menu,name:mail.mail_feeds +#: model:ir.ui.menu,name:mail.mail_feeds_main +msgid "Messaging" +msgstr "" + +#. module: mail +#: view:mail.alias:0 +#: field:mail.message.subtype,res_model:0 +msgid "Model" +msgstr "" + +#. module: mail +#: view:mail.message:0 +msgid "Unread" +msgstr "읽지 않음" + +#. module: mail +#: help:mail.followers,subtype_ids:0 +msgid "" +"Message subtypes followed, meaning subtypes that will be pushed onto the " +"user's Wall." +msgstr "" + +#. module: mail +#: help:mail.group,message_ids:0 +#: help:mail.thread,message_ids:0 +#: help:res.partner,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: mail +#: help:mail.mail,references:0 +msgid "Message references, such as identifiers of previous messages" +msgstr "" + +#. module: mail +#: field:mail.compose.message,composition_mode:0 +msgid "Composition mode" +msgstr "" + +#. module: mail +#: field:mail.compose.message,model:0 +#: field:mail.followers,res_model:0 +#: field:mail.message,model:0 +#: field:mail.wizard.invite,res_model:0 +msgid "Related Document Model" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:321 +#, python-format +msgid "unlike" +msgstr "" + +#. module: mail +#: help:mail.compose.message,author_id:0 +#: help:mail.message,author_id:0 +msgid "" +"Author of the message. If not set, email_from may hold an email address that " +"did not match any partner." +msgstr "" + +#. module: mail +#: help:mail.mail,email_cc:0 +msgid "Carbon copy message recipients" +msgstr "" + +#. module: mail +#: field:mail.alias,alias_domain:0 +msgid "Alias domain" +msgstr "" + +#. module: mail +#: code:addons/mail/update.py:93 +#, python-format +msgid "Error during communication with the publisher warranty server." +msgstr "" + +#. module: mail +#: selection:mail.group,public:0 +msgid "Private" +msgstr "" + +#. module: mail +#: model:ir.actions.client,help:mail.action_mail_star_feeds +msgid "" +"<p>\n" +" <b>No todo.</b>\n" +" </p><p>\n" +" When you process messages in your inbox, you can mark " +"some\n" +" as <i>todo</i>. From this menu, you can process all your " +"todo.\n" +" </p>\n" +" " +msgstr "" + +#. module: mail +#: selection:mail.mail,state:0 +msgid "Delivery Failed" +msgstr "" + +#. module: mail +#: field:mail.compose.message,partner_ids:0 +msgid "Additional contacts" +msgstr "" + +#. module: mail +#: help:mail.compose.message,parent_id:0 +#: help:mail.message,parent_id:0 +msgid "Initial thread message." +msgstr "" + +#. module: mail +#: model:mail.group,name:mail.group_hr_policies +msgid "HR Policies" +msgstr "" + +#. module: mail +#: selection:res.partner,notification_email_send:0 +msgid "Emails only" +msgstr "" + +#. module: mail +#: model:ir.actions.client,name:mail.action_mail_inbox_feeds +#: model:ir.ui.menu,name:mail.mail_inboxfeeds +msgid "Inbox" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/xml/mail.xml:58 +#, python-format +msgid "File" +msgstr "" + +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/many2many_tags_email.js:63 +#, python-format +msgid "Please complete partner's informations and Email" +msgstr "" + +#. module: mail +#: model:ir.actions.act_window,name:mail.action_view_message_subtype +#: model:ir.ui.menu,name:mail.menu_message_subtype +msgid "Subtypes" +msgstr "" + +#. module: mail +#: model:ir.model,name:mail.model_mail_alias +msgid "Email Aliases" +msgstr "" + +#. module: mail +#: field:mail.group,image_small:0 +msgid "Small-sized photo" +msgstr "" + +#. module: mail +#: help:mail.mail,reply_to:0 +msgid "Preferred response address for the message" +msgstr "" diff --git a/addons/mail/mail_alias.py b/addons/mail/mail_alias.py index f806b325291..8730599ad72 100644 --- a/addons/mail/mail_alias.py +++ b/addons/mail/mail_alias.py @@ -160,7 +160,7 @@ class mail_alias(osv.Model): alias_id_column.required = False # call _auto_init - child_model_auto_init_fct(cr, context=context) + res = child_model_auto_init_fct(cr, context=context) registry = RegistryManager.get(cr.dbname) mail_alias = registry.get('mail.alias') @@ -188,6 +188,8 @@ class mail_alias(osv.Model): # set back the unique alias_id constraint alias_id_column.required = True + return res + def create_unique_alias(self, cr, uid, vals, model_name=None, context=None): """Creates an email.alias record according to the values provided in ``vals``, with 2 alterations: the ``alias_name`` value may be suffixed in order to diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index 450b81dabbf..152b9704fd7 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -118,8 +118,8 @@ class mail_notification(osv.Model): Administrator </p> <div> - <small>Send by <a ...>Your Company</a> using <a ...>OpenERP</a>.</small> OR - <small>Send by Administrator using <a ...>OpenERP</a>.</small> + <small>Sent by <a ...>Your Company</a> using <a ...>OpenERP</a>.</small> OR + <small>Sent by Administrator using <a ...>OpenERP</a>.</small> </div> """ footer = "" @@ -139,7 +139,7 @@ class mail_notification(osv.Model): company = user.company_id.website and "<a style='color:inherit' href='%s'>%s</a>" % (user.company_id.website, user.company_id.name) or user.company_id.name else: company = user.name - signature_company = _('<small>Send by %(company)s using %(openerp)s.</small>') % { + signature_company = _('<small>Sent by %(company)s using %(openerp)s.</small>') % { 'company': company, 'openerp': "<a style='color:inherit' href='https://www.openerp.com/'>OpenERP</a>" } diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index f7c91939b98..5545745b235 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -60,8 +60,9 @@ class res_users(osv.Model): def _auto_init(self, cr, context=None): """ Installation hook: aliases, partner following themselves """ # create aliases for all users and avoid constraint errors - self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init, + res = self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init, self._columns['alias_id'], 'login', alias_force_key='id', context=context) + return res def create(self, cr, uid, data, context=None): # create default alias same as the login diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index d35a9ebcf1d..a4526b5b581 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -210,7 +210,7 @@ <separator/> <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/> <field name="product_id"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <group expand="0" string="Group By..."> <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> diff --git a/addons/note/i18n/lt.po b/addons/note/i18n/lt.po new file mode 100644 index 00000000000..3e030054520 --- /dev/null +++ b/addons/note/i18n/lt.po @@ -0,0 +1,284 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:04+0000\n" +"PO-Revision-Date: 2013-04-29 15:23+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: note +#: field:note.note,memo:0 +msgid "Note Content" +msgstr "" + +#. module: note +#: view:note.stage:0 +msgid "Stages of Notes" +msgstr "" + +#. module: note +#: model:note.stage,name:note.demo_note_stage_04 +#: model:note.stage,name:note.note_stage_02 +msgid "This Week" +msgstr "" + +#. module: note +#: model:ir.model,name:note.model_base_config_settings +msgid "base.config.settings" +msgstr "" + +#. module: note +#: model:ir.model,name:note.model_note_tag +msgid "Note Tag" +msgstr "" + +#. module: note +#: model:res.groups,name:note.group_note_fancy +msgid "Notes / Fancy mode" +msgstr "" + +#. module: note +#: model:ir.model,name:note.model_note_note +#: view:note.note:0 +msgid "Note" +msgstr "" + +#. module: note +#: view:note.note:0 +msgid "Group By..." +msgstr "" + +#. module: note +#: field:note.note,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: note +#: model:ir.actions.act_window,help:note.action_note_note +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to add a personal note.\n" +" </p><p>\n" +" Use notes to organize personal tasks or notes. All\n" +" notes are private; no one else will be able to see them. " +"However\n" +" you can share some notes with other people by inviting " +"followers\n" +" on the note. (Useful for meeting minutes, especially if\n" +" you activate the pad feature for collaborative writings).\n" +" </p><p>\n" +" You can customize how you process your notes/tasks by adding,\n" +" removing or modifying columns.\n" +" </p>\n" +" " +msgstr "" + +#. module: note +#: model:note.stage,name:note.demo_note_stage_01 +#: model:note.stage,name:note.note_stage_01 +msgid "Today" +msgstr "" + +#. module: note +#: model:ir.model,name:note.model_res_users +msgid "Users" +msgstr "" + +#. module: note +#: view:note.note:0 +msgid "í" +msgstr "" + +#. module: note +#: view:note.stage:0 +msgid "Stage of Notes" +msgstr "" + +#. module: note +#: field:note.note,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: note +#: field:note.note,current_partner_id:0 +msgid "unknown" +msgstr "" + +#. module: note +#: view:note.note:0 +msgid "By sticky note Category" +msgstr "" + +#. module: note +#: help:note.note,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: note +#: field:note.stage,name:0 +msgid "Stage Name" +msgstr "" + +#. module: note +#: field:note.note,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: note +#: model:note.stage,name:note.demo_note_stage_02 +msgid "Tomorrow" +msgstr "" + +#. module: note +#: view:note.note:0 +#: field:note.note,open:0 +msgid "Active" +msgstr "" + +#. module: note +#: help:note.stage,user_id:0 +msgid "Owner of the note stage." +msgstr "" + +#. module: note +#: model:ir.ui.menu,name:note.menu_notes_stage +msgid "Categories" +msgstr "" + +#. module: note +#: view:note.note:0 +#: field:note.note,stage_id:0 +msgid "Stage" +msgstr "" + +#. module: note +#: field:note.tag,name:0 +msgid "Tag Name" +msgstr "" + +#. module: note +#: field:note.note,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: note +#: view:base.config.settings:0 +#: model:ir.actions.act_window,name:note.action_note_note +#: model:ir.ui.menu,name:note.menu_note_notes +#: view:note.note:0 +#: model:note.stage,name:note.note_stage_04 +msgid "Notes" +msgstr "" + +#. module: note +#: model:note.stage,name:note.demo_note_stage_03 +#: model:note.stage,name:note.note_stage_03 +msgid "Later" +msgstr "" + +#. module: note +#: model:ir.model,name:note.model_note_stage +msgid "Note Stage" +msgstr "" + +#. module: note +#: field:note.note,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: note +#: field:note.note,stage_ids:0 +msgid "Stages of Users" +msgstr "" + +#. module: note +#: field:note.note,name:0 +msgid "Note Summary" +msgstr "" + +#. module: note +#: model:ir.actions.act_window,name:note.action_note_stage +#: view:note.note:0 +msgid "Stages" +msgstr "" + +#. module: note +#: help:note.note,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: note +#: view:note.note:0 +msgid "Delete" +msgstr "" + +#. module: note +#: field:note.note,color:0 +msgid "Color Index" +msgstr "" + +#. module: note +#: field:note.note,sequence:0 +#: field:note.stage,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: note +#: view:note.note:0 +#: field:note.note,tag_ids:0 +msgid "Tags" +msgstr "" + +#. module: note +#: view:note.note:0 +msgid "Archive" +msgstr "" + +#. module: note +#: field:base.config.settings,module_note_pad:0 +msgid "Use collaborative pads (etherpad)" +msgstr "" + +#. module: note +#: help:note.note,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: note +#: field:base.config.settings,group_note_fancy:0 +msgid "Use fancy layouts for notes" +msgstr "" + +#. module: note +#: field:note.note,current_partner_id:0 +#: field:note.stage,user_id:0 +msgid "Owner" +msgstr "" + +#. module: note +#: help:note.stage,sequence:0 +msgid "Used to order the note stages" +msgstr "" + +#. module: note +#: field:note.note,date_done:0 +msgid "Date done" +msgstr "" + +#. module: note +#: field:note.stage,fold:0 +msgid "Folded by Default" +msgstr "" diff --git a/addons/note_pad/i18n/lt.po b/addons/note_pad/i18n/lt.po new file mode 100644 index 00000000000..3c814e3f7eb --- /dev/null +++ b/addons/note_pad/i18n/lt.po @@ -0,0 +1,28 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:32+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: note_pad +#: model:ir.model,name:note_pad.model_note_note +msgid "Note" +msgstr "Užrašinė" + +#. module: note_pad +#: field:note.note,note_pad_url:0 +msgid "Pad Url" +msgstr "Nuorodą į užrašinę" diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index b96047340ad..1a2de41745b 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -1,67 +1,63 @@ openerp.pad = function(instance) { - instance.web.form.FieldPad = instance.web.form.AbstractField.extend({ + instance.web.form.FieldPad = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeWidgetMixin, { template: 'FieldPad', - configured: false, content: "", - start: function() { - this._super(); - var self = this; - this.on('change:effective_readonly',this,function(){ - self.renderElement(); + init: function() { + this._super.apply(this, arguments); + this.set("configured", true); + this.on("change:configured", this, this.switch_configured); + }, + initialize_content: function() { + this.switch_configured(); + this.$('.oe_pad_switch').click(function() { + self.$el.toggleClass('oe_pad_fullscreen'); }); + this.render_value(); + }, + switch_configured: function() { + this.$(".oe_unconfigured").toggle(! this.get("configured")); + this.$(".oe_configured").toggle(this.get("configured")); }, render_value: function() { - var self = this; - var _super = _.bind(this._super, this); - if (this.get("value") === false || this.get("value") === "") { - self.view.dataset.call('pad_generate_url',{context:{ + var self = this; + if (this.get("configured") && ! this.get("value")) { + self.view.dataset.call('pad_generate_url', { + context: { model: self.view.model, field_name: self.name, object_id: self.view.datarecord.id - }}).done(function(data) { - if(data&&data.url){ - self.set({value: data.url}); - _super(data.url); - self.renderElement(); + }, + }).done(function(data) { + if (! data.url) { + self.set("configured", false); + } else { + self.set("value", data.url); } }); - } else { - self.renderElement(); } - this._dirty_flag = true; - }, - renderElement: function(){ - var self = this; + this.$('.oe_pad_content').html(""); var value = this.get('value'); if (this.pad_loading_request) { this.pad_loading_request.abort(); } - if(!_.str.startsWith(value,'http')){ - this.configured = false; - this.content = ""; - }else{ - this.configured = true; - if(!this.get('effective_readonly')){ - this.content = '<iframe width="100%" height="100%" frameborder="0" src="'+value+'?showChat=false&userName='+this.session.username+'"></iframe>'; - }else{ + if (_.str.startsWith(value, 'http')) { + if (! this.get('effective_readonly')) { + var content = '<iframe width="100%" height="100%" frameborder="0" src="' + value + '?showChat=false&userName=' + this.session.username + '"></iframe>'; + this.$('.oe_pad_content').html(content); + this._dirty_flag = true; + } else { this.content = '<div class="oe_pad_loading">... Loading pad ...</div>'; - this.pad_loading_request = $.get(value+'/export/html') - .done(function(data){ + this.pad_loading_request = $.get(value + '/export/html').done(function(data) { groups = /\<\s*body\s*\>(.*?)\<\s*\/body\s*\>/.exec(data); data = (groups || []).length >= 2 ? groups[1] : ''; self.$('.oe_pad_content').html('<div class="oe_pad_readonly"><div>'); self.$('.oe_pad_readonly').html(data); - }).error(function(){ + }).fail(function() { self.$('.oe_pad_content').text('Unable to load pad'); }); } } - this._super(); - this.$('.oe_pad_content').html(this.content); - this.$('.oe_pad_switch').click(function(){ - self.$el.toggleClass('oe_pad_fullscreen'); - }); }, }); diff --git a/addons/pad/static/src/xml/pad.xml b/addons/pad/static/src/xml/pad.xml index bd3e296f9b3..f915e867b35 100644 --- a/addons/pad/static/src/xml/pad.xml +++ b/addons/pad/static/src/xml/pad.xml @@ -5,32 +5,25 @@ <t t-name="FieldPad"> - <t t-if="!widget.configured"> - <div class="oe_form_field_text oe_pad oe_unconfigured"> - <p> - You must configure the etherpad through the menu Settings > Companies > Companies, in the configuration tab of your company. - </p> - </div> - </t> - - <t t-if="widget.configured"> + <div class="oe_form_field_text oe_pad"> + <p class="oe_unconfigured"> + You must configure the etherpad through the menu Settings > Companies > Companies, in the configuration tab of your company. + </p> <t t-if="widget.get('effective_readonly')"> - <div class="oe_form_field_text oe_pad oe_configured"> - <div class="oe_pad_content etherpad_readonly"> - </div> + <div class="oe_pad_content etherpad_readonly oe_configured"> </div> </t> - - <t t-if="!widget.get('effective_readonly')"> - <div class="oe_form_field_text oe_pad oe_configured"> - <div class="oe_pad_switch_positioner"> - <span class="oe_pad_switch oe_e">&Ntilde;</span> - </div> - <div class="oe_pad_content oe_editing"> - </div> + <t t-if="! widget.get('effective_readonly')"> + <div class="oe_pad_switch_positioner oe_configured"> + <span class="oe_pad_switch oe_e">&Ntilde;</span> + </div> + <div class="oe_pad_content oe_editing oe_configured"> </div> </t> - </t> + </div> + + + </t> </templates> diff --git a/addons/pad_project/i18n/lt.po b/addons/pad_project/i18n/lt.po new file mode 100644 index 00000000000..2f7340a36e2 --- /dev/null +++ b/addons/pad_project/i18n/lt.po @@ -0,0 +1,39 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:35+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: pad_project +#: constraint:project.task:0 +msgid "Error ! Task end-date must be greater then task start-date" +msgstr "" +"Klaida! Užduotės pabaigos data negali būti ankstesnė nei pradžios data" + +#. module: pad_project +#: field:project.task,description_pad:0 +msgid "Description PAD" +msgstr "" + +#. module: pad_project +#: model:ir.model,name:pad_project.model_project_task +msgid "Task" +msgstr "Užduotis" + +#. module: pad_project +#: constraint:project.task:0 +msgid "Error ! You cannot create recursive tasks." +msgstr "Klaida! Negalima sukurti rekursinių užduočių." diff --git a/addons/plugin/i18n/lt.po b/addons/plugin/i18n/lt.po new file mode 100644 index 00000000000..dc120cadcf2 --- /dev/null +++ b/addons/plugin/i18n/lt.po @@ -0,0 +1,23 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:14+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: plugin +#: model:ir.model,name:plugin.model_plugin_handler +msgid "plugin.handler" +msgstr "plugin.handler" diff --git a/addons/point_of_sale/i18n/pt_BR.po b/addons/point_of_sale/i18n/pt_BR.po index eac24526afc..4d4efabdec3 100644 --- a/addons/point_of_sale/i18n/pt_BR.po +++ b/addons/point_of_sale/i18n/pt_BR.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-10-17 00:01+0000\n" -"Last-Translator: Syllas F. de O. Neto <syllasneto@gmail.com>\n" +"PO-Revision-Date: 2013-04-18 18:07+0000\n" +"Last-Translator: Thiago Tognoli <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:07+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-19 05:24+0000\n" +"X-Generator: Launchpad (build 16567)\n" #. module: point_of_sale #: field:report.transaction.pos,product_nb:0 msgid "Product Nb." -msgstr "Produto No." +msgstr "Núm. Produto" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_trans_pos_tree_today @@ -286,7 +286,7 @@ msgstr "Desconto (%)" #: report:pos.details:0 #: report:pos.details_summary:0 msgid "Total discount" -msgstr "Total de Desconto" +msgstr "Desconto total" #. module: point_of_sale #. openerp-web @@ -354,6 +354,9 @@ msgid "" "Check this if this point of sale should open by default in a self checkout " "mode. If unchecked, OpenERP uses the normal cashier mode by default." msgstr "" +"Marque esta opção se este ponto de venda deve ser aberto por padrão em modo " +"de auto atendimento. Se não marcada, o OpenERP irá usar o modo normal por " +"padrão." #. module: point_of_sale #: model:ir.actions.report.xml,name:point_of_sale.pos_sales_user @@ -444,7 +447,7 @@ msgstr "Você precisa associar um Ponto de Vendas a sua sessão." #. module: point_of_sale #: view:pos.order.line:0 msgid "Total qty" -msgstr "Total de Qtd" +msgstr "Qtd Total" #. module: point_of_sale #: model:product.template,name:point_of_sale.fanta_orange_33cl_product_template @@ -460,6 +463,10 @@ msgid "" "close this session, you can update the 'Closing Cash Control' to avoid any " "difference." msgstr "" +"Por favor, defina suas contas de lucros e perdas no seu método de pagamento " +"'%s'. Isso permitirá o OpenERP colocar a diferença de %.2f em seu saldo " +"final. Para fechar a sessão, você pode atualizar o 'Fechando Controle de " +"Caixa'para evitar qualquer diferença." #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:315 @@ -777,7 +784,7 @@ msgstr "Imprimir Relatório" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_bolognese_product_template msgid "Dr. Oetker Ristorante Bolognese" -msgstr "" +msgstr "Dr. Oetker Ristorante Bolognese" #. module: point_of_sale #: model:pos.category,name:point_of_sale.pizza @@ -787,7 +794,7 @@ msgstr "Pizza" #. module: point_of_sale #: view:pos.session:0 msgid "= Theoretical Balance" -msgstr "" +msgstr "= Balanço Teórico" #. module: point_of_sale #: code:addons/point_of_sale/wizard/pos_return.py:85 @@ -974,7 +981,7 @@ msgstr "Lista de Caixas Registradoras" #. module: point_of_sale #: model:product.template,name:point_of_sale.maes_50cl_product_template msgid "Maes 50cl" -msgstr "" +msgstr "Maes 50cl" #. module: point_of_sale #: view:report.pos.order:0 @@ -1030,7 +1037,7 @@ msgstr "Spa Reine 33cl" #. module: point_of_sale #: model:ir.model,name:point_of_sale.model_pos_discount msgid "Add a Global Discount" -msgstr "Adicionar Desconto Global" +msgstr "Adicionar um Desconto Global" #. module: point_of_sale #: view:pos.config:0 @@ -1040,7 +1047,7 @@ msgstr "Diários" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_prosciutto_product_template msgid "Dr. Oetker Ristorante Prosciutto" -msgstr "" +msgstr "Dr. Oetker Ristorante Prosciutto" #. module: point_of_sale #: model:product.template,name:point_of_sale.lays_light_paprika_170g_product_template @@ -1126,7 +1133,7 @@ msgstr "Re-impressão" #. module: point_of_sale #: model:product.template,name:point_of_sale.chimay_bleu_75cl_product_template msgid "Chimay Bleu 75cl" -msgstr "" +msgstr "Chimay Bleu 75cl" #. module: point_of_sale #: report:pos.payment.report.user:0 @@ -1156,7 +1163,7 @@ msgstr "No. de Linhas" #: code:addons/point_of_sale/static/src/xml/pos.xml:89 #, python-format msgid "Disc" -msgstr "Disco" +msgstr "Desc." #. module: point_of_sale #: view:pos.order:0 @@ -1166,7 +1173,7 @@ msgstr "(atualizar)" #. module: point_of_sale #: model:product.template,name:point_of_sale.ijsboerke_vanille_2,5l_product_template msgid "IJsboerke Vanilla 2.5L" -msgstr "" +msgstr "IJsboerke Vanilla 2.5L" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_report_pos_details @@ -1177,7 +1184,7 @@ msgstr "Detalhes da Venda" #. module: point_of_sale #: model:product.template,name:point_of_sale.evian_2l_product_template msgid "2L Evian" -msgstr "" +msgstr "2L Evian" #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:373 @@ -1185,7 +1192,7 @@ msgstr "" #: code:addons/point_of_sale/wizard/pos_session_opening.py:34 #, python-format msgid "Start Point Of Sale" -msgstr "" +msgstr "Iniciar Ponto de Venda" #. module: point_of_sale #: model:pos.category,name:point_of_sale.pils @@ -1195,7 +1202,7 @@ msgstr "" #. module: point_of_sale #: help:pos.session,cash_register_balance_end_real:0 msgid "Computed using the cash control lines" -msgstr "" +msgstr "Calculado usando as linhas de controle de caixa" #. module: point_of_sale #: report:all.closed.cashbox.of.the.day:0 @@ -1217,7 +1224,7 @@ msgstr "ABC" #. module: point_of_sale #: model:product.template,name:point_of_sale.ijsboerke_dame_blanche_2,5l_product_template msgid "IJsboerke 2.5L White Lady" -msgstr "" +msgstr "IJsboerke 2.5L White Lady" #. module: point_of_sale #: field:pos.order,lines:0 @@ -1239,7 +1246,7 @@ msgstr "" #: code:addons/point_of_sale/static/src/xml/pos.xml:485 #, python-format msgid "Read Weighting Scale" -msgstr "" +msgstr "Lendo a Balança" #. module: point_of_sale #. openerp-web @@ -1302,7 +1309,7 @@ msgstr "Marcar como Obsoleto" #. module: point_of_sale #: model:product.template,name:point_of_sale.limon_product_template msgid "Stringers" -msgstr "" +msgstr "Limões" #. module: point_of_sale #: field:pos.order,pricelist_id:0 @@ -1369,19 +1376,19 @@ msgstr "Stella Artois 33cl" #. module: point_of_sale #: model:product.template,name:point_of_sale.lays_naturel_300g_product_template msgid "Lays Natural XXL 300g" -msgstr "" +msgstr "Lays Natural XXL 300g" #. module: point_of_sale #. openerp-web #: code:addons/point_of_sale/static/src/xml/pos.xml:479 #, python-format msgid "Scan Item Unrecognized" -msgstr "" +msgstr "item Escaneado não Reconhecido" #. module: point_of_sale #: report:all.closed.cashbox.of.the.day:0 msgid "Today's Closed Cashbox" -msgstr "Fechamento de Caixa do dia" +msgstr "Fechamento de Caixa do Dia" #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:897 @@ -1397,7 +1404,7 @@ msgstr "Fatura Provisória" #. module: point_of_sale #: model:product.template,name:point_of_sale.lays_paprika_oven_150g_product_template msgid "Oven Baked Lays Paprika 150g" -msgstr "" +msgstr "Oven Baked Lays Paprika 150g" #. module: point_of_sale #: report:pos.invoice:0 @@ -1449,7 +1456,7 @@ msgstr "Coca-Cola Light 2L" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_funghi_product_template msgid "Dr. Oetker Ristorante Funghi" -msgstr "" +msgstr "Dr. Oetker Ristorante Funghi" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.pos_category_action @@ -1477,7 +1484,7 @@ msgstr "Ean Inválido" #. module: point_of_sale #: model:product.template,name:point_of_sale.lindemans_kriek_37,5cl_product_template msgid "Lindemans Kriek 37.5cl" -msgstr "" +msgstr "Lindemans Kriek 37.5cl" #. module: point_of_sale #: view:pos.config:0 @@ -1494,7 +1501,7 @@ msgstr "Coca-Cola Zero 33cl" #: code:addons/point_of_sale/static/src/xml/pos.xml:405 #, python-format msgid "ä" -msgstr "" +msgstr "ä" #. module: point_of_sale #: report:pos.invoice:0 @@ -1523,7 +1530,7 @@ msgstr "Desconhecido" #. module: point_of_sale #: field:product.product,income_pdt:0 msgid "Point of Sale Cash In" -msgstr "" +msgstr "Colocar dinheiro no Ponto de Venda" #. module: point_of_sale #. openerp-web @@ -1608,7 +1615,7 @@ msgstr "" #. module: point_of_sale #: model:product.template,name:point_of_sale.boon_framboise_37,5cl_product_template msgid "Boon Framboise 37.5cl" -msgstr "" +msgstr "Boon Framboise 37.5cl" #. module: point_of_sale #: model:ir.model,name:point_of_sale.model_pos_config @@ -1627,7 +1634,7 @@ msgstr "" #. module: point_of_sale #: field:product.product,expense_pdt:0 msgid "Point of Sale Cash Out" -msgstr "" +msgstr "Sacar do Ponto de Venda" #. module: point_of_sale #: selection:report.pos.order,month:0 @@ -1639,7 +1646,7 @@ msgstr "Novembro" #: code:addons/point_of_sale/static/src/xml/pos.xml:267 #, python-format msgid "Please scan an item or your member card" -msgstr "" +msgstr "Por favor escaneie um item ou seu cartão de associado" #. module: point_of_sale #: model:product.template,name:point_of_sale.poivron_verts_product_template @@ -1649,7 +1656,7 @@ msgstr "Pimentões Verdes" #. module: point_of_sale #: model:product.template,name:point_of_sale.timmermans_faro_37,5cl_product_template msgid "Timmermans Faro 37.5cl" -msgstr "" +msgstr "Timmermans Faro 37.5cl" #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:410 @@ -1662,7 +1669,7 @@ msgstr "" #. module: point_of_sale #: view:pos.session:0 msgid "Validate Closing & Post Entries" -msgstr "" +msgstr "Validar Encerramento e Lançar Entradas" #. module: point_of_sale #: field:report.transaction.pos,no_trans:0 @@ -1705,7 +1712,7 @@ msgstr "Cancelar" #: code:addons/point_of_sale/static/src/xml/pos.xml:296 #, python-format msgid "Please put your product on the scale" -msgstr "" +msgstr "Por favor, coloque seu produto na balança" #. module: point_of_sale #: model:ir.actions.report.xml,name:point_of_sale.pos_details_summary @@ -1715,12 +1722,12 @@ msgstr "Vendas(Resumo)" #. module: point_of_sale #: model:product.template,name:point_of_sale.nectarine_product_template msgid "Peach" -msgstr "" +msgstr "Pêssego" #. module: point_of_sale #: model:product.template,name:point_of_sale.timmermans_kriek_37,5cl_product_template msgid "Timmermans Kriek 37.5cl" -msgstr "" +msgstr "Timmermans Kriek 37.5cl" #. module: point_of_sale #: field:pos.config,sequence_id:0 @@ -1753,7 +1760,7 @@ msgstr "fechar" #. module: point_of_sale #: model:ir.actions.report.xml,name:point_of_sale.report_user_label msgid "User Labels" -msgstr "" +msgstr "Etiquetas do Usuário" #. module: point_of_sale #: model:ir.model,name:point_of_sale.model_pos_order_line @@ -1897,6 +1904,9 @@ msgid "" "complete\n" " your purchase" msgstr "" +"Por favor, insira seu cartão no leitor e aguarde as instruções para " +"completar\n" +" sua compra" #. module: point_of_sale #: help:product.product,income_pdt:0 @@ -1935,6 +1945,8 @@ msgid "" "Unable to open the session. You have to assign a sale journal to your point " "of sale." msgstr "" +"Não é possível abrir a sessão. Você tem que atribuir um diário de venda para " +"o seu ponto de venda." #. module: point_of_sale #: view:report.pos.order:0 @@ -1988,7 +2000,7 @@ msgstr "Estabelecimento:" #. module: point_of_sale #: field:account.journal,self_checkout_payment_method:0 msgid "Self Checkout Payment Method" -msgstr "" +msgstr "Forma de Pagamento do Auto Atendimento" #. module: point_of_sale #: view:pos.order:0 @@ -2124,7 +2136,7 @@ msgstr "Produtos" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_4formaggi_product_template msgid "Dr. Oetker Ristorante Quattro Formaggi" -msgstr "" +msgstr "Dr. Oetker Ristorante Quattro Formaggi" #. module: point_of_sale #: model:product.template,name:point_of_sale.croky_naturel_45g_product_template @@ -2654,7 +2666,7 @@ msgstr "Fatura" #: code:addons/point_of_sale/static/src/xml/pos.xml:701 #, python-format msgid "shift" -msgstr "" +msgstr "shift" #. module: point_of_sale #: model:product.template,name:point_of_sale.rochefort_8_33cl_product_template @@ -2786,7 +2798,7 @@ msgstr "Produto" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_pollo_product_template msgid "Dr. Oetker Ristorante Pollo" -msgstr "" +msgstr "Dr. Oetker Ristorante Pollo" #. module: point_of_sale #: constraint:pos.session:0 @@ -2836,7 +2848,7 @@ msgstr "" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_margherita_product_template msgid "Dr. Oetker La Margherita" -msgstr "" +msgstr "Dr. Oetker La Margherita" #. module: point_of_sale #: view:pos.order:0 @@ -2936,7 +2948,7 @@ msgstr "Gerente" #. module: point_of_sale #: model:product.template,name:point_of_sale.lays_poivre_sel_oven_150g_product_template msgid "Lays Salt and Pepper Oven Baked 150g" -msgstr "" +msgstr "Lays Salt and Pepper Oven Baked 150g" #. module: point_of_sale #: field:pos.details,date_start:0 @@ -2993,7 +3005,7 @@ msgstr "Procurar Pedido de Venda" #. module: point_of_sale #: field:pos.config,iface_self_checkout:0 msgid "Self Checkout Mode" -msgstr "" +msgstr "Modo de Auto Atendimento" #. module: point_of_sale #: field:account.journal,journal_user:0 @@ -3027,7 +3039,7 @@ msgstr "Relatório de Pagamento" #. module: point_of_sale #: model:product.template,name:point_of_sale.fanta_orange_25cl_product_template msgid "Fanta Orange 25cl" -msgstr "" +msgstr "Fanta Laranja 25cl" #. module: point_of_sale #: view:pos.confirm:0 @@ -3063,7 +3075,7 @@ msgstr "Motivo" #. module: point_of_sale #: model:product.template,name:point_of_sale.orangina_33cl_product_template msgid "Orangina 33cl" -msgstr "" +msgstr "Orangina 33cl" #. module: point_of_sale #: view:pos.config:0 @@ -3073,7 +3085,7 @@ msgstr "Definir como Inativo" #. module: point_of_sale #: model:product.template,name:point_of_sale.chimay_bleu_33cl_product_template msgid "Chimay Bleu 33cl" -msgstr "" +msgstr "Chimay Bleu 33cl" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_account_journal_form @@ -3089,7 +3101,7 @@ msgstr "Fritas" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_spinaci_product_template msgid "Dr. Oetker Ristorante Spinaci" -msgstr "" +msgstr "Dr. Oetker Ristorante Spinaci" #. module: point_of_sale #. openerp-web @@ -3121,7 +3133,7 @@ msgstr "Colocar dinheiro em" #. module: point_of_sale #: model:product.template,name:point_of_sale.fanta_zero_orange_1,5l_product_template msgid "Fanta Orange Zero 1.5L" -msgstr "" +msgstr "Fanta Laranja Zero 1.5L" #. module: point_of_sale #: model:product.template,name:point_of_sale.boni_orange_product_template @@ -3234,7 +3246,7 @@ msgstr "Relatório do PDV" #. module: point_of_sale #: model:product.template,name:point_of_sale.chaudfontaine_1,5l_product_template msgid "Chaudfontaine 1.5l" -msgstr "" +msgstr "Chaudfontaine 1.5l" #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:1069 @@ -3304,7 +3316,7 @@ msgstr "Coca-Cola Zero 50cl" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_tonno_product_template msgid "Dr. Oetker Ristorante Tonno" -msgstr "" +msgstr "Dr. Oetker Ristorante Tonno" #. module: point_of_sale #: report:pos.invoice:0 @@ -3346,7 +3358,7 @@ msgstr "cash.box.out" #. module: point_of_sale #: model:product.template,name:point_of_sale.fanta_zero_orange_33cl_product_template msgid "Fanta Zero Orange 33cl" -msgstr "" +msgstr "Fanta Laranja Zero 33cl" #. module: point_of_sale #: help:product.product,available_in_pos:0 @@ -3361,7 +3373,7 @@ msgstr "Dia da data do pedido" #. module: point_of_sale #: model:product.template,name:point_of_sale.maes_33cl_product_template msgid "Maes 33cl" -msgstr "" +msgstr "Maes 33cl" #. module: point_of_sale #. openerp-web @@ -3378,7 +3390,7 @@ msgstr "Configuração" #. module: point_of_sale #: model:product.template,name:point_of_sale.orval_33cl_product_template msgid "Orval 33cl" -msgstr "" +msgstr "Orval 33cl" #. module: point_of_sale #. openerp-web @@ -3411,7 +3423,7 @@ msgstr "Frutas Frescas" #. module: point_of_sale #: model:product.template,name:point_of_sale.lindemans_pecheresse_37,,5cl_product_template msgid "Lindemans sinful 37.5cl" -msgstr "" +msgstr "Lindemans sinful 37.5cl" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_pos_invoice @@ -3431,7 +3443,7 @@ msgstr "Imagem" #. module: point_of_sale #: model:product.template,name:point_of_sale.spa_gazeuse_1,5l_product_template msgid "Spa Barisart 1.5l" -msgstr "" +msgstr "Spa Barisart 1.5l" #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:789 @@ -3443,7 +3455,7 @@ msgstr "Retornar Produtos" #. module: point_of_sale #: model:product.template,name:point_of_sale.jupiler_33cl_product_template msgid "Jupiler 33cl" -msgstr "" +msgstr "Jupiler 33cl" #. module: point_of_sale #. openerp-web @@ -3551,7 +3563,7 @@ msgstr "Balança Eletrônica" #. module: point_of_sale #: model:product.template,name:point_of_sale.spa_gazeuse_50cl_product_template msgid "Spa Barisart 50cl" -msgstr "" +msgstr "Spa Barisart 50cl" #. module: point_of_sale #: field:res.users,pos_config:0 @@ -3595,7 +3607,7 @@ msgstr "Pago" #: code:addons/point_of_sale/static/src/xml/pos.xml:464 #, python-format msgid "3.141Kg Oranges" -msgstr "" +msgstr "3.141Kg de Laranjas" #. module: point_of_sale #: report:pos.invoice:0 @@ -3611,7 +3623,7 @@ msgstr "Por favor informe um parceiro para a venda" #. module: point_of_sale #: model:pos.category,name:point_of_sale.fruity_beers msgid "Fruity Beers" -msgstr "" +msgstr "Cerveja de Frutas" #. module: point_of_sale #: view:pos.session:0 @@ -3623,7 +3635,7 @@ msgstr "" #: code:addons/point_of_sale/static/src/xml/pos.xml:463 #, python-format msgid "Soda 33cl" -msgstr "" +msgstr "Soda 33cl" #. module: point_of_sale #: help:pos.session,cash_register_balance_start:0 @@ -3644,7 +3656,7 @@ msgstr "Vendas do Usuário" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_hawaii_product_template msgid "Dr. Oetker Ristorante Hawaii" -msgstr "" +msgstr "Dr. Oetker Ristorante Hawaii" #. module: point_of_sale #. openerp-web @@ -3678,12 +3690,12 @@ msgstr "" #. module: point_of_sale #: model:product.template,name:point_of_sale.chaudfontaine_petillante_33cl_product_template msgid "Chaudfontaine Petillante 33cl" -msgstr "" +msgstr "Chaudfontaine Petillante 33cl" #. module: point_of_sale #: model:product.template,name:point_of_sale.pepsi_max_2l_product_template msgid "Pepsi Max 2L" -msgstr "" +msgstr "Pepsi Max 2L" #. module: point_of_sale #: field:pos.session,details_ids:0 @@ -3693,17 +3705,17 @@ msgstr "Controle de Caixa" #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_vegetale_product_template msgid "Dr. Oetker Ristorante Vegetable" -msgstr "" +msgstr "Dr. Oetker Ristorante Vegetable" #. module: point_of_sale #: model:pos.category,name:point_of_sale.soda msgid "Soda" -msgstr "" +msgstr "Soda" #. module: point_of_sale #: model:product.template,name:point_of_sale.lays_paprika_300g_product_template msgid "Lays Paprika XXL 300g" -msgstr "" +msgstr "Lays Paprika XXL 300g" #. module: point_of_sale #: report:pos.invoice:0 @@ -3715,7 +3727,7 @@ msgstr "Reembolso" #: code:addons/point_of_sale/static/src/xml/pos.xml:417 #, python-format msgid "Your shopping cart is empty" -msgstr "" +msgstr "Seu Carrinho de Compras está vazio" #. module: point_of_sale #: code:addons/point_of_sale/report/pos_invoice.py:46 @@ -3726,7 +3738,7 @@ msgstr "Por favor crie uma fatura para esta venda." #. module: point_of_sale #: model:product.template,name:point_of_sale.oetker_mozzarella_product_template msgid "Dr. Oetker Ristorante Mozzarella" -msgstr "" +msgstr "Dr. Oetker Ristorante Mozzarella" #. module: point_of_sale #: report:pos.details:0 @@ -3737,7 +3749,7 @@ msgstr "Desc(%)" #. module: point_of_sale #: view:pos.session.opening:0 msgid "The session" -msgstr "" +msgstr "A sessão" #. module: point_of_sale #: view:pos.order:0 @@ -3762,7 +3774,7 @@ msgstr "Ordem de Linhas" #. module: point_of_sale #: view:pos.session.opening:0 msgid "PoS Session Opening" -msgstr "" +msgstr "Abrindo Sessão do PDV" #. module: point_of_sale #: field:pos.order.line,price_subtotal:0 @@ -3780,7 +3792,7 @@ msgstr "excluir" #. module: point_of_sale #: model:product.template,name:point_of_sale.spa_50cl_product_template msgid "Spa Reine 50cl" -msgstr "" +msgstr "Spa Reine 50cl" #. module: point_of_sale #: model:product.template,name:point_of_sale.chicon_flandria_extra_product_template @@ -3791,22 +3803,22 @@ msgstr "" #: model:product.template,name:point_of_sale.lays_light_naturel_170g_product_template #: model:product.template,name:point_of_sale.lays_naturel_170g_product_template msgid "Lays Natural Light 170g" -msgstr "" +msgstr "Lays Natural Light 170g" #. module: point_of_sale #: model:product.template,name:point_of_sale.leffe_blonde_33cl_product_template msgid "Leffe Blonde 33cl" -msgstr "" +msgstr "Leffe Blonde 33cl" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_report_pos_payment msgid "Pyament Report" -msgstr "" +msgstr "Relatório de Pagamento" #. module: point_of_sale #: field:report.transaction.pos,jl_id:0 msgid "Cash Journals" -msgstr "" +msgstr "Diários de Dinheiro" #. module: point_of_sale #: view:pos.session:0 @@ -3816,12 +3828,12 @@ msgstr "Sessão:" #. module: point_of_sale #: field:pos.config,iface_print_via_proxy:0 msgid "Print via Proxy" -msgstr "" +msgstr "Imprimir via Proxy" #. module: point_of_sale #: report:pos.sales.user.today:0 msgid "Today's Sales By User" -msgstr "" +msgstr "Vendas de hoje por Usuário" #. module: point_of_sale #: report:pos.invoice:0 @@ -3858,7 +3870,7 @@ msgstr "Anotações Internas" #. module: point_of_sale #: model:product.template,name:point_of_sale.ijsboerke_chocolat_2,5l_product_template msgid "IJsboerke Chocolat 2.5L" -msgstr "" +msgstr "IJsboerke Chocolat 2.5L" #. module: point_of_sale #: help:pos.category,image_small:0 @@ -3871,7 +3883,7 @@ msgstr "" #. module: point_of_sale #: field:pos.session.opening,pos_state:0 msgid "Session Status" -msgstr "" +msgstr "Status da Sessão" #. module: point_of_sale #: field:pos.order,picking_id:0 @@ -3915,7 +3927,7 @@ msgstr "Editar" #. module: point_of_sale #: view:pos.session.opening:0 msgid "Click to continue the session." -msgstr "" +msgstr "Clique para continuar a sessão." #. module: point_of_sale #: view:pos.config:0 @@ -3930,7 +3942,7 @@ msgstr "" #. module: point_of_sale #: view:pos.session.opening:0 msgid "Start Selling" -msgstr "" +msgstr "Começar a Vender" #. module: point_of_sale #: selection:report.pos.order,month:0 @@ -3963,7 +3975,7 @@ msgstr "" #. module: point_of_sale #: model:product.template,name:point_of_sale.leffe_9_33cl_product_template msgid "Leffe Brune \"9\" 33cl" -msgstr "" +msgstr "Leffe Brune \"9\" 33cl" #. module: point_of_sale #: help:account.journal,journal_user:0 @@ -4011,7 +4023,7 @@ msgstr "" #: code:addons/point_of_sale/static/src/xml/pos.xml:351 #, python-format msgid "Sorry, we could not create a session for this user." -msgstr "" +msgstr "Desculpe, não podemos criar uma sessão para esse usuário." #. module: point_of_sale #: code:addons/point_of_sale/point_of_sale.py:98 @@ -4019,7 +4031,7 @@ msgstr "" #: selection:pos.session.opening,pos_state:0 #, python-format msgid "Opening Control" -msgstr "" +msgstr "Abrindo Controle" #. module: point_of_sale #: view:report.pos.order:0 diff --git a/addons/point_of_sale/i18n/zh_CN.po b/addons/point_of_sale/i18n/zh_CN.po index e4d914ae56e..23dc97f2376 100644 --- a/addons/point_of_sale/i18n/zh_CN.po +++ b/addons/point_of_sale/i18n/zh_CN.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-05-10 18:26+0000\n" -"Last-Translator: 开阖软件 Jeff Wang <jeff@osbzr.com>\n" +"PO-Revision-Date: 2013-04-24 06:41+0000\n" +"Last-Translator: viney <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:07+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" #. module: point_of_sale #: field:report.transaction.pos,product_nb:0 @@ -67,7 +67,7 @@ msgstr "" #. module: point_of_sale #: model:pos.category,name:point_of_sale.plain_water msgid "Plain Water" -msgstr "白开水" +msgstr "纯净水" #. module: point_of_sale #: model:product.template,name:point_of_sale.poire_conference_product_template @@ -2269,7 +2269,7 @@ msgstr "7月" #: model:ir.ui.menu,name:point_of_sale.menu_pos_config_pos #: view:pos.session:0 msgid "Point of Sales" -msgstr "" +msgstr "零售" #. module: point_of_sale #: report:pos.details:0 @@ -2303,7 +2303,7 @@ msgstr "打印数" #. module: point_of_sale #: model:ir.model,name:point_of_sale.model_pos_make_payment msgid "Point of Sale Payment" -msgstr "POS付款" +msgstr "付款" #. module: point_of_sale #: model:product.template,name:point_of_sale.coca_light_50cl_product_template @@ -2407,7 +2407,7 @@ msgstr "" #. module: point_of_sale #: model:ir.model,name:point_of_sale.model_pos_receipt msgid "Point of sale receipt" -msgstr "POS收银条" +msgstr "收银条" #. module: point_of_sale #: model:ir.actions.act_window,name:point_of_sale.action_report_sales_by_margin_pos_today diff --git a/addons/portal/i18n/ko.po b/addons/portal/i18n/ko.po new file mode 100644 index 00000000000..b1d03cc0e7e --- /dev/null +++ b/addons/portal/i18n/ko.po @@ -0,0 +1,497 @@ +# Korean translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-05-14 01:12+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Korean <ko@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: 2013-05-15 05:15+0000\n" +"X-Generator: Launchpad (build 16617)\n" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "Mako" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/share_wizard.py:50 +#, python-format +msgid "Please select at least one user to share with" +msgstr "" + +#. module: portal +#: view:portal.wizard:0 +msgid "" +"Select which contacts should belong to the portal in the list below.\n" +" The email address of each selected contact must be " +"valid and unique.\n" +" If necessary, you can fix any contact's email " +"address directly in the list." +msgstr "" + +#. module: portal +#: model:mail.group,name:portal.company_jobs +msgid "Company Jobs" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "amount: the total amount to pay, as a float" +msgstr "" + +#. module: portal +#: view:portal.wizard.user:0 +msgid "Contacts" +msgstr "연락처" + +#. module: portal +#: view:share.wizard:0 +#: field:share.wizard,group_ids:0 +msgid "Existing groups" +msgstr "기존 그룹" + +#. module: portal +#: view:res.groups:0 +msgid "Portal Groups" +msgstr "포털 그룹" + +#. module: portal +#: field:portal.wizard,welcome_message:0 +msgid "Invitation Message" +msgstr "초대 메시지" + +#. module: portal +#: view:res.groups:0 +msgid "Non-Portal Groups" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/share_wizard.py:54 +#, python-format +msgid "Please select at least one group to share with" +msgstr "" + +#. module: portal +#: view:share.wizard:0 +msgid "Details" +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_orders +msgid "Quotations and Sales Orders" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "reference: the reference number of the document to pay" +msgstr "" + +#. module: portal +#: help:portal.payment.acquirer,visible:0 +msgid "" +"Make this payment acquirer available in portal forms (Customer invoices, " +"etc.)" +msgstr "" + +#. module: portal +#: model:ir.model,name:portal.model_share_wizard +msgid "Share Wizard" +msgstr "" + +#. module: portal +#: field:portal.wizard.user,email:0 +msgid "Email" +msgstr "" + +#. module: portal +#: model:ir.actions.client,help:portal.action_news +msgid "" +"<p>\n" +" Youd don't have unread company's news.\n" +" </p>\n" +" " +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/portal_wizard.py:194 +#, python-format +msgid "" +"You must have an email address in your User Preferences to send emails." +msgstr "" + +#. module: portal +#: model:ir.actions.client,name:portal.action_jobs +#: model:ir.ui.menu,name:portal.portal_jobs +msgid "Jobs" +msgstr "" + +#. module: portal +#: field:portal.wizard,user_ids:0 +msgid "Users" +msgstr "" + +#. module: portal +#: code:addons/portal/acquirer.py:82 +#, python-format +msgid "Pay safely online" +msgstr "" + +#. module: portal +#: code:addons/portal/acquirer.py:77 +#, python-format +msgid "No online payment acquirers configured" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"kind: the kind of document on which the payment form is rendered (translated " +"to user language, e.g. \"Invoice\")" +msgstr "" + +#. module: portal +#: help:portal.wizard,portal_id:0 +msgid "The portal that users can be added in or removed from." +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/share_wizard.py:38 +#, python-format +msgid "Users you already shared with" +msgstr "" + +#. module: portal +#: model:ir.actions.client,help:portal.action_jobs +msgid "" +"<p>\n" +" Youd don't have unread job offers.\n" +" </p>\n" +" " +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +", so it may use Mako expressions.\n" +" The Mako evaluation context provides:" +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_menu +#: field:portal.wizard,portal_id:0 +#: field:res.groups,is_portal:0 +#: model:res.groups,name:portal.group_portal +msgid "Portal" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/portal_wizard.py:34 +#, python-format +msgid "Your OpenERP account at %(company)s" +msgstr "" + +#. module: portal +#: model:res.groups,name:portal.group_anonymous +msgid "Anonymous" +msgstr "" + +#. module: portal +#: field:portal.wizard.user,in_portal:0 +msgid "In Portal" +msgstr "" + +#. module: portal +#: model:ir.actions.client,name:portal.action_news +#: model:ir.ui.menu,name:portal.portal_company_news +msgid "News" +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_after_sales +msgid "After Sale Services" +msgstr "" + +#. module: portal +#: model:res.groups,comment:portal.group_portal +msgid "" +"Portal members have specific access rights (such as record rules and " +"restricted menus).\n" +" They usually do not belong to the usual OpenERP groups." +msgstr "" + +#. module: portal +#: model:ir.actions.act_window,name:portal.action_acquirer_list +#: view:portal.payment.acquirer:0 +msgid "Payment Acquirers" +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_projects +msgid "Projects" +msgstr "" + +#. module: portal +#: model:ir.actions.client,name:portal.action_mail_inbox_feeds_portal +#: model:ir.ui.menu,name:portal.portal_inbox +msgid "Inbox" +msgstr "" + +#. module: portal +#: view:share.wizard:0 +#: field:share.wizard,user_ids:0 +msgid "Existing users" +msgstr "" + +#. module: portal +#: field:portal.wizard.user,wizard_id:0 +msgid "Wizard" +msgstr "" + +#. module: portal +#: field:portal.payment.acquirer,name:0 +msgid "Name" +msgstr "" + +#. module: portal +#: model:ir.model,name:portal.model_res_groups +msgid "Access Groups" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "uid: the current user id" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"quote(): a method to quote special string character to make them suitable " +"for inclusion in a URL" +msgstr "" + +#. module: portal +#: help:res.groups,is_portal:0 +msgid "If checked, this group is usable as a portal." +msgstr "" + +#. module: portal +#: field:portal.payment.acquirer,form_template:0 +msgid "Payment form template (HTML)" +msgstr "" + +#. module: portal +#: field:portal.wizard.user,partner_id:0 +msgid "Contact" +msgstr "" + +#. module: portal +#: model:ir.model,name:portal.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/portal_wizard.py:193 +#, python-format +msgid "Email required" +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_messages +msgid "Messaging" +msgstr "" + +#. module: portal +#: model:res.groups,comment:portal.group_anonymous +msgid "" +"Anonymous users have specific access rights (such as record rules and " +"restricted menus).\n" +" They usually do not belong to the usual OpenERP groups." +msgstr "" + +#. module: portal +#: model:ir.model,name:portal.model_portal_payment_acquirer +msgid "Online Payment Acquirer" +msgstr "" + +#. module: portal +#: model:mail.group,name:portal.company_news_feed +msgid "Company News" +msgstr "" + +#. module: portal +#: code:addons/portal/acquirer.py:76 +#, python-format +msgid "" +"You can finish the configuration in the <a href=\"%s\">Bank&Cash settings</a>" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "cr: the current database cursor" +msgstr "" + +#. module: portal +#: model:ir.actions.client,help:portal.action_mail_inbox_feeds_portal +msgid "" +"<p>\n" +" <b>Good Job!</b> Your inbox is empty.\n" +" </p><p>\n" +" Your inbox contains private messages or emails sent to " +"you\n" +" as well as information related to documents or people " +"you\n" +" follow.\n" +" </p>\n" +" " +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"object: the document on which the payment form is rendered (usually an " +"invoice or sales order record)" +msgstr "" + +#. module: portal +#: help:portal.wizard,welcome_message:0 +msgid "This text is included in the email sent to new users of the portal." +msgstr "" + +#. module: portal +#: model:ir.ui.menu,name:portal.portal_company +msgid "About Us" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"currency: the currency record in which the document is issued (e.g. " +"currency.name could be EUR)" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "Payment Acquirer" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/portal_wizard.py:35 +#, python-format +msgid "" +"Dear %(name)s,\n" +"\n" +"You have been given access to %(portal)s.\n" +"\n" +"Your login account data is:\n" +"Database: %(db)s\n" +"Username: %(login)s\n" +"\n" +"In order to complete the signin process, click on the following url:\n" +"%(url)s\n" +"\n" +"%(welcome_message)s\n" +"\n" +"--\n" +"OpenERP - Open Source Business Applications\n" +"http://www.openerp.com\n" +msgstr "" + +#. module: portal +#: view:portal.wizard:0 +msgid "or" +msgstr "" + +#. module: portal +#: model:portal.payment.acquirer,form_template:portal.paypal_acquirer +msgid "" +"\n" +"% if object.company_id.paypal_account:\n" +"<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" " +"target=\"_blank\">\n" +" <input type=\"hidden\" name=\"cmd\" value=\"_xclick\"/>\n" +" <input type=\"hidden\" name=\"business\" " +"value=\"${object.company_id.paypal_account}\"/>\n" +" <input type=\"hidden\" name=\"item_name\" " +"value=\"${object.company_id.name} ${kind.title()} ${reference}\"/>\n" +" <input type=\"hidden\" name=\"amount\" value=\"${amount}\"/>\n" +" <input type=\"hidden\" name=\"currency_code\" " +"value=\"${currency.name}\"/>\n" +" <input type=\"image\" name=\"submit\" " +"src=\"https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif\"/>\n" +"</form>\n" +"% endif\n" +" " +msgstr "" + +#. module: portal +#: model:ir.model,name:portal.model_portal_wizard_user +msgid "Portal User Config" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"If the template renders to an empty result in a certain context it will be " +"ignored, as if it was inactive." +msgstr "" + +#. module: portal +#: field:portal.payment.acquirer,visible:0 +msgid "Visible" +msgstr "" + +#. module: portal +#: code:addons/portal/wizard/share_wizard.py:39 +#, python-format +msgid "Existing Groups (e.g Portal Groups)" +msgstr "" + +#. module: portal +#: view:portal.wizard:0 +msgid "Cancel" +msgstr "" + +#. module: portal +#: view:portal.wizard:0 +msgid "Apply" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "ctx: the current context dictionary" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "" +"This is an HTML form template to submit a payment through this acquirer.\n" +" The template will be rendered with" +msgstr "" + +#. module: portal +#: code:addons/portal/mail_mail.py:42 +#, python-format +msgid "" +"Access your personal documents through <a href=\"%s\">our Customer Portal</a>" +msgstr "" + +#. module: portal +#: view:portal.payment.acquirer:0 +msgid "Form Template" +msgstr "" + +#. module: portal +#: model:ir.actions.act_window,name:portal.partner_wizard_action +#: model:ir.model,name:portal.model_portal_wizard +#: view:portal.wizard:0 +msgid "Portal Access Management" +msgstr "" diff --git a/addons/portal_anonymous/i18n/lt.po b/addons/portal_anonymous/i18n/lt.po new file mode 100644 index 00000000000..60643c7f356 --- /dev/null +++ b/addons/portal_anonymous/i18n/lt.po @@ -0,0 +1,25 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-24 18:34+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: portal_anonymous +#. openerp-web +#: code:addons/portal_anonymous/static/src/xml/portal_anonymous.xml:8 +#, python-format +msgid "Login" +msgstr "Prisijungti" diff --git a/addons/portal_crm/i18n/lt.po b/addons/portal_crm/i18n/lt.po new file mode 100644 index 00000000000..b2b223c6124 --- /dev/null +++ b/addons/portal_crm/i18n/lt.po @@ -0,0 +1,546 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:24+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,type:0 +msgid "Lead" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,title:0 +msgid "Title" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,probability:0 +msgid "Success Rate (%)" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Contact us" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_action:0 +msgid "Next Action Date" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,fax:0 +msgid "Fax" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,zip:0 +msgid "Zip" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,company_id:0 +msgid "Company" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,day_open:0 +msgid "Days to Open" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Thank you for your interest, we'll respond to your request shortly." +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,priority:0 +msgid "Highest" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,mobile:0 +msgid "Mobile" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,description:0 +msgid "Notes" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,color:0 +msgid "Color Index" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_latitude:0 +msgid "Geo Latitude" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_name:0 +msgid "Customer Name" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,state:0 +msgid "Cancelled" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,channel_id:0 +msgid "Communication channel (mail, direct, phone, ...)" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,type_id:0 +msgid "Campaign" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,ref:0 +msgid "Reference" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_action_next:0 +#: field:portal_crm.crm_contact_us,title_action:0 +msgid "Next Action" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_id:0 +msgid "Partner" +msgstr "" + +#. module: portal_crm +#: model:ir.actions.act_window,name:portal_crm.action_contact_us +msgid "Contact Us" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,name:0 +msgid "Subject" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,opt_out:0 +msgid "Opt-Out" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,priority:0 +msgid "Priority" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,state_id:0 +msgid "State" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,partner_id:0 +msgid "Linked partner (optional). Usually created when converting the lead." +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,payment_mode:0 +msgid "Payment Mode" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,state:0 +msgid "New" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,type:0 +msgid "Type" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,email_from:0 +msgid "Email" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,channel_id:0 +msgid "Channel" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Name" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,priority:0 +msgid "Lowest" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Close" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,state:0 +msgid "Pending" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,type:0 +msgid "Type is used to separate Leads and Opportunities" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,categ_ids:0 +msgid "Categories" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,stage_id:0 +msgid "Stage" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,user_login:0 +msgid "User Login" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,opt_out:0 +msgid "" +"If opt-out is checked, this contact has refused to receive emails or " +"unsubscribed to a campaign." +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,contact_name:0 +msgid "Contact Name" +msgstr "" + +#. module: portal_crm +#: model:ir.ui.menu,name:portal_crm.portal_company_contact +msgid "Contact" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_address_email:0 +msgid "Partner Contact Email" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,planned_revenue:0 +msgid "Expected Revenue" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,task_ids:0 +msgid "Tasks" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Contact form" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,company_currency:0 +msgid "Currency" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,write_date:0 +msgid "Update Date" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_deadline:0 +msgid "Expected Closing" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,ref2:0 +msgid "Reference 2" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,user_email:0 +msgid "User Email" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_open:0 +msgid "Opened" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,state:0 +msgid "In Progress" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,partner_name:0 +msgid "" +"The name of the future partner company that will be created while converting " +"the lead into opportunity" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,planned_cost:0 +msgid "Planned Costs" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,date_deadline:0 +msgid "Estimate of the date on which the opportunity will be won." +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,email_cc:0 +msgid "" +"These email addresses will be added to the CC field of all inbound and " +"outbound emails for this record before being sent. Separate multiple email " +"addresses with a comma" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,priority:0 +msgid "Low" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_closed:0 +#: selection:portal_crm.crm_contact_us,state:0 +msgid "Closed" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_assign:0 +msgid "Assignation Date" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,state:0 +msgid "Status" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,priority:0 +msgid "Normal" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,email_cc:0 +msgid "Global CC" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,street2:0 +msgid "Street2" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,id:0 +msgid "ID" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,phone:0 +msgid "Phone" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,active:0 +msgid "Active" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,user_id:0 +msgid "Salesperson" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,day_close:0 +msgid "Days to Close" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,company_ids:0 +msgid "Companies" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,section_id:0 +msgid "" +"When sending mails, the default email address is taken from the sales team." +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_address_name:0 +msgid "Partner Contact Name" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_longitude:0 +msgid "Geo Longitude" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,date_assign:0 +msgid "Last date this case was forwarded/assigned to a partner" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,email_from:0 +msgid "Email address of the contact" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,city:0 +msgid "City" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Submit" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,function:0 +msgid "Function" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,referred:0 +msgid "Referred By" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,partner_assigned_id:0 +msgid "Assigned Partner" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,type:0 +msgid "Opportunity" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,partner_assigned_id:0 +msgid "Partner this case has been forwarded/assigned to." +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,country_id:0 +msgid "Country" +msgstr "" + +#. module: portal_crm +#: view:portal_crm.crm_contact_us:0 +msgid "Thank you" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,state:0 +msgid "" +"The Status is set to 'Draft', when a case is created. If the case is in " +"progress the Status is set to 'Open'. When the case is over, the Status is " +"set to 'Done'. If the case needs to be reviewed then the Status is set to " +"'Pending'." +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: portal_crm +#: help:portal_crm.crm_contact_us,type_id:0 +msgid "" +"From which campaign (seminar, marketing campaign, mass mailing, ...) did " +"this contact come from?" +msgstr "" + +#. module: portal_crm +#: selection:portal_crm.crm_contact_us,priority:0 +msgid "High" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,section_id:0 +msgid "Sales Team" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,street:0 +msgid "Street" +msgstr "" + +#. module: portal_crm +#: field:portal_crm.crm_contact_us,date_action_last:0 +msgid "Last Action" +msgstr "" + +#. module: portal_crm +#: model:ir.model,name:portal_crm.model_portal_crm_crm_contact_us +msgid "Contact form for the portal" +msgstr "" diff --git a/addons/portal_hr_employees/i18n/lt.po b/addons/portal_hr_employees/i18n/lt.po new file mode 100644 index 00000000000..50a5a872eac --- /dev/null +++ b/addons/portal_hr_employees/i18n/lt.po @@ -0,0 +1,95 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-04-29 15:24+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Coach" +msgstr "" + +#. module: portal_hr_employees +#: model:ir.actions.act_window,name:portal_hr_employees.action_team +#: view:portal_crm.crm_contact_us:0 +msgid "Our Team" +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Group By..." +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Company" +msgstr "" + +#. module: portal_hr_employees +#: selection:hr.employee,visibility:0 +msgid "Public" +msgstr "" + +#. module: portal_hr_employees +#: help:hr.employee,visibility:0 +msgid "Employee's visibility in the portal's contact page" +msgstr "" + +#. module: portal_hr_employees +#: selection:hr.employee,visibility:0 +msgid "Private" +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Manager" +msgstr "" + +#. module: portal_hr_employees +#: model:ir.model,name:portal_hr_employees.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Job" +msgstr "" + +#. module: portal_hr_employees +#: field:hr.employee,visibility:0 +msgid "Visibility" +msgstr "" + +#. module: portal_hr_employees +#: field:hr.employee,public_info:0 +msgid "Public Info" +msgstr "" + +#. module: portal_hr_employees +#: model:ir.model,name:portal_hr_employees.model_portal_crm_crm_contact_us +msgid "Contact form for the portal" +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +msgid "Department" +msgstr "" + +#. module: portal_hr_employees +#: view:hr.employee:0 +#: field:portal_crm.crm_contact_us,employee_ids:0 +msgid "Employees" +msgstr "" diff --git a/addons/portal_sale/i18n/lt.po b/addons/portal_sale/i18n/lt.po new file mode 100644 index 00000000000..92db39babce --- /dev/null +++ b/addons/portal_sale/i18n/lt.po @@ -0,0 +1,344 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-29 15:25+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: portal_sale +#: model:ir.model,name:portal_sale.model_account_config_settings +msgid "account.config.settings" +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,help:portal_sale.portal_action_invoices +msgid "We haven't sent you any invoice." +msgstr "" + +#. module: portal_sale +#: model:email.template,report_name:portal_sale.email_template_edi_sale +msgid "" +"${(object.name or '').replace('/','_')}_${object.state == 'draft' and " +"'draft' or ''}" +msgstr "" + +#. module: portal_sale +#: model:res.groups,name:portal_sale.group_payment_options +msgid "View Online Payment Options" +msgstr "" + +#. module: portal_sale +#: field:account.config.settings,group_payment_options:0 +msgid "Show payment buttons to employees too" +msgstr "" + +#. module: portal_sale +#: model:email.template,subject:portal_sale.email_template_edi_sale +msgid "" +"${object.company_id.name} ${object.state in ('draft', 'sent') and " +"'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })" +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,help:portal_sale.action_quotations_portal +msgid "We haven't sent you any quotation." +msgstr "" + +#. module: portal_sale +#: model:ir.ui.menu,name:portal_sale.portal_sales_orders +msgid "Sales Orders" +msgstr "" + +#. module: portal_sale +#: model:res.groups,comment:portal_sale.group_payment_options +msgid "" +"Members of this group see the online payment options\n" +"on Sale Orders and Customer Invoices. These options are meant for customers " +"who are accessing\n" +"their documents through the portal." +msgstr "" + +#. module: portal_sale +#: model:email.template,body_html:portal_sale.email_template_edi_sale +msgid "" +"\n" +"<div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-" +"serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, " +"255, 255); \">\n" +"\n" +" <p>Hello ${object.partner_id.name},</p>\n" +" \n" +" <p>Here is your ${object.state in ('draft', 'sent') and 'quotation' or " +"'order confirmation'} from ${object.company_id.name}: </p>\n" +"\n" +" <p style=\"border-left: 1px solid #8e0000; margin-left: 30px;\">\n" +" <strong>REFERENCES</strong><br />\n" +" Order number: <strong>${object.name}</strong><br />\n" +" Order total: <strong>${object.amount_total} " +"${object.pricelist_id.currency_id.name}</strong><br />\n" +" Order date: ${object.date_order}<br />\n" +" % if object.origin:\n" +" Order reference: ${object.origin}<br />\n" +" % endif\n" +" % if object.client_order_ref:\n" +" Your reference: ${object.client_order_ref}<br />\n" +" % endif\n" +" % if object.user_id:\n" +" Your contact: <a href=\"mailto:${object.user_id.email or " +"''}?subject=Order%20${object.name}\">${object.user_id.name}</a>\n" +" % endif\n" +" </p>\n" +"\n" +" <% set signup_url = object.get_signup_url() %>\n" +" % if signup_url:\n" +" <p>\n" +" You can access this document and pay online via our Customer Portal:\n" +" </p>\n" +" <a style=\"display:block; width: 150px; height:20px; margin-left: " +"120px; color: #DDD; font-family: 'Lucida Grande', Helvetica, Arial, sans-" +"serif; font-size: 13px; font-weight: bold; text-align: center; text-" +"decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; " +"background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat " +"no-repeat;\"\n" +" href=\"${signup_url}\">View ${object.state in ('draft', 'sent') " +"and 'Quotation' or 'Order'}</a>\n" +" % endif\n" +"\n" +" % if object.paypal_url:\n" +" <br/>\n" +" <p>It is also possible to directly pay with Paypal:</p>\n" +" <a style=\"margin-left: 120px;\" href=\"${object.paypal_url}\">\n" +" <img class=\"oe_edi_paypal_button\" " +"src=\"https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif\"/>\n" +" </a>\n" +" % endif\n" +"\n" +" <br/>\n" +" <p>If you have any question, do not hesitate to contact us.</p>\n" +" <p>Thank you for choosing ${object.company_id.name or 'us'}!</p>\n" +" <br/>\n" +" <br/>\n" +" <div style=\"width: 375px; margin: 0px; padding: 0px; background-color: " +"#8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; " +"background-repeat: repeat no-repeat;\">\n" +" <h3 style=\"margin: 0px; padding: 2px 14px; font-size: 12px; color: " +"#DDD;\">\n" +" <strong style=\"text-" +"transform:uppercase;\">${object.company_id.name}</strong></h3>\n" +" </div>\n" +" <div style=\"width: 347px; margin: 0px; padding: 5px 14px; line-height: " +"16px; background-color: #F2F2F2;\">\n" +" <span style=\"color: #222; margin-bottom: 5px; display: block; \">\n" +" % if object.company_id.street:\n" +" ${object.company_id.street}<br/>\n" +" % endif\n" +" % if object.company_id.street2:\n" +" ${object.company_id.street2}<br/>\n" +" % endif\n" +" % if object.company_id.city or object.company_id.zip:\n" +" ${object.company_id.zip} ${object.company_id.city}<br/>\n" +" % endif\n" +" % if object.company_id.country_id:\n" +" ${object.company_id.state_id and ('%s, ' % " +"object.company_id.state_id.name) or ''} ${object.company_id.country_id.name " +"or ''}<br/>\n" +" % endif\n" +" </span>\n" +" % if object.company_id.phone:\n" +" <div style=\"margin-top: 0px; margin-right: 0px; margin-bottom: " +"0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: " +"0px; padding-left: 0px; \">\n" +" Phone: ${object.company_id.phone}\n" +" </div>\n" +" % endif\n" +" % if object.company_id.website:\n" +" <div>\n" +" Web : <a " +"href=\"${object.company_id.website}\">${object.company_id.website}</a>\n" +" </div>\n" +" % endif\n" +" <p></p>\n" +" </div>\n" +"</div>\n" +" " +msgstr "" + +#. module: portal_sale +#: model:email.template,report_name:portal_sale.email_template_edi_invoice +msgid "" +"Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' " +"and 'draft' or ''}" +msgstr "" + +#. module: portal_sale +#: model:email.template,subject:portal_sale.email_template_edi_invoice +msgid "${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })" +msgstr "" + +#. module: portal_sale +#: model:ir.model,name:portal_sale.model_mail_mail +msgid "Outgoing Mails" +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,name:portal_sale.action_quotations_portal +#: model:ir.ui.menu,name:portal_sale.portal_quotations +msgid "Quotations" +msgstr "" + +#. module: portal_sale +#: model:ir.model,name:portal_sale.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: portal_sale +#: field:account.invoice,portal_payment_options:0 +#: field:sale.order,portal_payment_options:0 +msgid "Portal Payment Options" +msgstr "" + +#. module: portal_sale +#: help:account.config.settings,group_payment_options:0 +msgid "" +"Show online payment options on Sale Orders and Customer Invoices to " +"employees. If not checked, these options are only visible to portal users." +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,name:portal_sale.portal_action_invoices +#: model:ir.ui.menu,name:portal_sale.portal_invoices +msgid "Invoices" +msgstr "" + +#. module: portal_sale +#: view:account.config.settings:0 +msgid "Configure payment acquiring methods" +msgstr "" + +#. module: portal_sale +#: model:email.template,body_html:portal_sale.email_template_edi_invoice +msgid "" +"\n" +"<div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-" +"serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, " +"255, 255); \">\n" +"\n" +" <p>Hello ${object.partner_id.name},</p>\n" +"\n" +" <p>A new invoice is available for you: </p>\n" +" \n" +" <p style=\"border-left: 1px solid #8e0000; margin-left: 30px;\">\n" +" <strong>REFERENCES</strong><br />\n" +" Invoice number: <strong>${object.number}</strong><br />\n" +" Invoice total: <strong>${object.amount_total} " +"${object.currency_id.name}</strong><br />\n" +" Invoice date: ${object.date_invoice}<br />\n" +" % if object.origin:\n" +" Order reference: ${object.origin}<br />\n" +" % endif\n" +" % if object.user_id:\n" +" Your contact: <a href=\"mailto:${object.user_id.email or " +"''}?subject=Invoice%20${object.number}\">${object.user_id.name}</a>\n" +" % endif\n" +" </p> \n" +"\n" +" <% set signup_url = object.get_signup_url() %>\n" +" % if signup_url:\n" +" <p>\n" +" You can access the invoice document and pay online via our Customer " +"Portal:\n" +" </p>\n" +" <a style=\"display:block; width: 150px; height:20px; margin-left: " +"120px; color: #DDD; font-family: 'Lucida Grande', Helvetica, Arial, sans-" +"serif; font-size: 13px; font-weight: bold; text-align: center; text-" +"decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; " +"background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat " +"no-repeat;\"\n" +" href=\"${signup_url}\">View Invoice</a>\n" +" % endif\n" +" \n" +" % if object.paypal_url:\n" +" <br/>\n" +" <p>It is also possible to directly pay with Paypal:</p>\n" +" <a style=\"margin-left: 120px;\" href=\"${object.paypal_url}\">\n" +" <img class=\"oe_edi_paypal_button\" " +"src=\"https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif\"/>\n" +" </a>\n" +" % endif\n" +" \n" +" <br/>\n" +" <p>If you have any question, do not hesitate to contact us.</p>\n" +" <p>Thank you for choosing ${object.company_id.name or 'us'}!</p>\n" +" <br/>\n" +" <br/>\n" +" <div style=\"width: 375px; margin: 0px; padding: 0px; background-color: " +"#8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; " +"background-repeat: repeat no-repeat;\">\n" +" <h3 style=\"margin: 0px; padding: 2px 14px; font-size: 12px; color: " +"#DDD;\">\n" +" <strong style=\"text-" +"transform:uppercase;\">${object.company_id.name}</strong></h3>\n" +" </div>\n" +" <div style=\"width: 347px; margin: 0px; padding: 5px 14px; line-height: " +"16px; background-color: #F2F2F2;\">\n" +" <span style=\"color: #222; margin-bottom: 5px; display: block; \">\n" +" % if object.company_id.street:\n" +" ${object.company_id.street}<br/>\n" +" % endif\n" +" % if object.company_id.street2:\n" +" ${object.company_id.street2}<br/>\n" +" % endif\n" +" % if object.company_id.city or object.company_id.zip:\n" +" ${object.company_id.zip} ${object.company_id.city}<br/>\n" +" % endif\n" +" % if object.company_id.country_id:\n" +" ${object.company_id.state_id and ('%s, ' % " +"object.company_id.state_id.name) or ''} ${object.company_id.country_id.name " +"or ''}<br/>\n" +" % endif\n" +" </span>\n" +" % if object.company_id.phone:\n" +" <div style=\"margin-top: 0px; margin-right: 0px; margin-bottom: " +"0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: " +"0px; padding-left: 0px; \">\n" +" Phone: ${object.company_id.phone}\n" +" </div>\n" +" % endif\n" +" % if object.company_id.website:\n" +" <div>\n" +" Web : <a " +"href=\"${object.company_id.website}\">${object.company_id.website}</a>\n" +" </div>\n" +" % endif\n" +" <p></p>\n" +" </div>\n" +"</div>\n" +" " +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,help:portal_sale.action_orders_portal +msgid "We haven't sent you any sales order." +msgstr "" + +#. module: portal_sale +#: model:ir.model,name:portal_sale.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: portal_sale +#: model:ir.actions.act_window,name:portal_sale.action_orders_portal +msgid "Sale Orders" +msgstr "" diff --git a/addons/procurement/i18n/lt.po b/addons/procurement/i18n/lt.po new file mode 100644 index 00000000000..6b2ac1a24be --- /dev/null +++ b/addons/procurement/i18n/lt.po @@ -0,0 +1,1005 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-29 15:26+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: procurement +#: model:ir.ui.menu,name:procurement.menu_stock_sched +msgid "Schedulers" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_make_procurement +msgid "Make Procurements" +msgstr "" + +#. module: procurement +#: help:procurement.order.compute.all,automatic:0 +msgid "" +"Triggers an automatic procurement for all products that have a virtual stock " +"under 0. You should probably not use this option, we suggest using a MTO " +"configuration on products." +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Group By..." +msgstr "" + +#. module: procurement +#: help:stock.warehouse.orderpoint,procurement_draft_ids:0 +msgid "Draft procurement of the product and location of that orderpoint" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"required quantities are always\n" +" available" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"If there are not enough quantities available, the delivery order\n" +" will wait for new products. To fulfill the " +"inventory, you should\n" +" create others rules like orderpoints." +msgstr "" + +#. module: procurement +#: field:procurement.order,procure_method:0 +#: field:product.template,procure_method:0 +msgid "Procurement Method" +msgstr "" + +#. module: procurement +#: selection:product.template,supply_method:0 +msgid "Manufacture" +msgstr "" + +#. module: procurement +#: model:process.process,name:procurement.process_process_serviceproductprocess0 +msgid "Service" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.action_procurement_compute +msgid "Compute Stock Minimum Rules Only" +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Rules" +msgstr "" + +#. module: procurement +#: field:procurement.order,company_id:0 +#: field:stock.warehouse.orderpoint,company_id:0 +msgid "Company" +msgstr "" + +#. module: procurement +#: field:procurement.order,product_uos_qty:0 +msgid "UoS Quantity" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Reason" +msgstr "" + +#. module: procurement +#: view:procurement.order.compute:0 +msgid "Compute Procurements" +msgstr "" + +#. module: procurement +#: field:procurement.order,message:0 +msgid "Latest error" +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,product_min_qty:0 +msgid "Minimum Quantity" +msgstr "" + +#. module: procurement +#: help:mrp.property,composition:0 +msgid "Not used in computations, for information purpose only." +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,procurement_id:0 +msgid "Latest procurement" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,help:procurement.action_orderpoint_form +msgid "" +"You can define your minimum stock rules, so that OpenERP will automatically " +"create draft manufacturing orders or purchase quotations according to the " +"stock level. Once the virtual stock of a product (= stock on hand minus all " +"confirmed orders and reservations) is below the minimum quantity, OpenERP " +"will generate a procurement request to increase the stock up to the maximum " +"quantity." +msgstr "" + +#. module: procurement +#: field:procurement.order,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: procurement +#: help:procurement.order,message:0 +msgid "Exception occurred while computing procurement orders." +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "Products" +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Cancelled" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Permanent Procurement Exceptions" +msgstr "" + +#. module: procurement +#: help:procurement.order,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: procurement +#: view:procurement.order.compute.all:0 +msgid "Scheduler Parameters" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "Stockable products" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:138 +#, python-format +msgid "Invalid Action!" +msgstr "" + +#. module: procurement +#: help:procurement.order,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Ready" +msgstr "" + +#. module: procurement +#: field:procurement.order.compute.all,automatic:0 +msgid "Automatic orderpoint" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,help:procurement.procurement_exceptions +msgid "" +"<p>\n" +" Procurement Orders represent the need for a certain quantity " +"of products, at a given time, in a given location. Sales Orders are one " +"typical source of Procurement Orders (but these are distinct documents). " +"Depending on the procurement parameters and the product configuration, the " +"procurement engine will attempt to satisfy the need by reserving products " +"from stock, ordering products from a supplier, or passing a manufacturing " +"order, etc. A Procurement Exception occurs when the system cannot find a way " +"to fulfill a procurement. Some exceptions will resolve themselves " +"automatically, but others require manual intervention (those are identified " +"by a specific error message).\n" +" </p>\n" +" " +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Retry" +msgstr "" + +#. module: procurement +#: view:procurement.order.compute:0 +#: view:procurement.orderpoint.compute:0 +msgid "Parameters" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Confirm" +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Quantity Multiple" +msgstr "" + +#. module: procurement +#: help:procurement.order,origin:0 +msgid "" +"Reference of the document that created this Procurement.\n" +"This is automatically completed by OpenERP." +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Procurement Orders to Process" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:370 +#, python-format +msgid "Procurement '%s' is in exception: " +msgstr "" + +#. module: procurement +#: field:procurement.order,priority:0 +msgid "Priority" +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Reordering Rules Search" +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Waiting" +msgstr "" + +#. module: procurement +#: field:procurement.order,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: procurement +#: field:procurement.order,location_id:0 +#: view:stock.warehouse.orderpoint:0 +#: field:stock.warehouse.orderpoint,location_id:0 +msgid "Location" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: procurement +#: field:make.procurement,warehouse_id:0 +#: view:stock.warehouse.orderpoint:0 +#: field:stock.warehouse.orderpoint,warehouse_id:0 +msgid "Warehouse" +msgstr "" + +#. module: procurement +#: selection:stock.warehouse.orderpoint,logic:0 +msgid "Best price (not yet active!)" +msgstr "" + +#. module: procurement +#: code:addons/procurement/schedulers.py:110 +#, python-format +msgid "PROC %d: from stock - %3.2f %-5s - %s" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_procurement_order_compute +msgid "Compute Procurement" +msgstr "" + +#. module: procurement +#: field:res.company,schedule_range:0 +msgid "Scheduler Range Days" +msgstr "" + +#. module: procurement +#: view:make.procurement:0 +msgid "Ask New Products" +msgstr "" + +#. module: procurement +#: field:make.procurement,date_planned:0 +msgid "Planned Date" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Group By" +msgstr "" + +#. module: procurement +#: field:make.procurement,qty:0 +#: field:procurement.order,product_qty:0 +msgid "Quantity" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:365 +#, python-format +msgid "Not enough stock and no minimum orderpoint rule defined." +msgstr "" + +#. module: procurement +#: field:make.procurement,uom_id:0 +#: view:procurement.order:0 +msgid "Unit of Measure" +msgstr "" + +#. module: procurement +#: selection:procurement.order,procure_method:0 +#: selection:product.template,procure_method:0 +msgid "Make to Stock" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,help:procurement.procurement_action +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a procurement order. \n" +" </p><p>\n" +" A procurement order is used to record a need for a specific\n" +" product at a specific location. Procurement orders are " +"usually\n" +" created automatically from sales orders, pull logistic rules " +"or\n" +" minimum stock rules.\n" +" </p><p>\n" +" When the procurement order is confirmed, it automatically\n" +" creates the necessary operations to fullfil the need: " +"purchase\n" +" order proposition, manufacturing order, etc.\n" +" </p>\n" +" " +msgstr "" + +#. module: procurement +#: help:procurement.order,procure_method:0 +msgid "" +"If you encode manually a Procurement, you probably want to use a make to " +"order method." +msgstr "" + +#. module: procurement +#: model:ir.ui.menu,name:procurement.menu_stock_procurement +msgid "Automatic Procurements" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"use the available\n" +" inventory" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_procurement_order +#: model:process.process,name:procurement.process_process_procurementprocess0 +#: view:procurement.order:0 +msgid "Procurement" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.procurement_action +msgid "Procurement Orders" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "To Fix" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Exceptions" +msgstr "" + +#. module: procurement +#: model:process.node,note:procurement.process_node_serviceonorder0 +msgid "Assignment from Production or Purchase Order." +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_mrp_property +msgid "Property" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.act_make_procurement +#: view:make.procurement:0 +msgid "Procurement Request" +msgstr "" + +#. module: procurement +#: view:procurement.orderpoint.compute:0 +msgid "Compute Stock" +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,procurement_draft_ids:0 +msgid "Related Procurement Orders" +msgstr "" + +#. module: procurement +#: field:procurement.order,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: procurement +#: selection:mrp.property,composition:0 +msgid "plus" +msgstr "" + +#. module: procurement +#: help:procurement.order,state:0 +msgid "" +"When a procurement is created the status is set to 'Draft'.\n" +" If the procurement is confirmed, the status is set to 'Confirmed'. " +" \n" +"After confirming the status is set to 'Running'.\n" +" If any exception arises in the order then the status is set to " +"'Exception'.\n" +" Once the exception is removed the status becomes 'Ready'.\n" +" It is in 'Waiting'. status when the procurement is waiting for another one " +"to finish." +msgstr "" + +#. module: procurement +#: help:stock.warehouse.orderpoint,active:0 +msgid "" +"If the active field is set to False, it will allow you to hide the " +"orderpoint without removing it." +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"When you sell this service, nothing special will be triggered\n" +" to deliver the customer, as you set the " +"procurement method as\n" +" 'Make to Stock'." +msgstr "" + +#. module: procurement +#: help:procurement.orderpoint.compute,automatic:0 +msgid "If the stock of a product is under 0, it will act like an orderpoint" +msgstr "" + +#. module: procurement +#: field:procurement.order,product_uom:0 +#: field:stock.warehouse.orderpoint,product_uom:0 +msgid "Product Unit of Measure" +msgstr "" + +#. module: procurement +#: constraint:stock.warehouse.orderpoint:0 +msgid "" +"You have to select a product unit of measure in the same category than the " +"default unit of measure of the product" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Procurement Lines" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"as it's a consumable (as a result of this, the quantity\n" +" on hand may become negative)." +msgstr "" + +#. module: procurement +#: field:procurement.order,note:0 +msgid "Note" +msgstr "" + +#. module: procurement +#: help:stock.warehouse.orderpoint,product_min_qty:0 +msgid "" +"When the virtual stock goes below the Min Quantity specified for this field, " +"OpenERP generates a procurement to bring the forecasted quantity to the Max " +"Quantity." +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Draft" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.action_compute_schedulers +#: model:ir.ui.menu,name:procurement.menu_stock_proc_schedulers +#: view:procurement.order.compute.all:0 +msgid "Run Schedulers" +msgstr "" + +#. module: procurement +#: view:procurement.order.compute:0 +msgid "This wizard will schedule procurements." +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +#: field:procurement.order,state:0 +msgid "Status" +msgstr "" + +#. module: procurement +#: selection:product.template,supply_method:0 +msgid "Buy" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "for the delivery order." +msgstr "" + +#. module: procurement +#: selection:procurement.order,priority:0 +msgid "Normal" +msgstr "" + +#. module: procurement +#: help:product.template,supply_method:0 +msgid "" +"Manufacture: When procuring the product, a manufacturing order or a task " +"will be generated, depending on the product type. \n" +"Buy: When procuring the product, a purchase order will be generated." +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,product_max_qty:0 +msgid "Maximum Quantity" +msgstr "" + +#. module: procurement +#: field:procurement.order,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:367 +#, python-format +msgid "Not enough stock." +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,active:0 +msgid "Active" +msgstr "" + +#. module: procurement +#: model:process.node,name:procurement.process_node_procureproducts0 +msgid "Procure Products" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:312 +#, python-format +msgid "" +"Please check the quantity in procurement order(s) for the product \"%s\", it " +"should not be 0 or less!" +msgstr "" + +#. module: procurement +#: field:procurement.order,date_planned:0 +msgid "Scheduled date" +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Exception" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "" +"When you sell this product, a delivery order will be created.\n" +" OpenERP will consider that the" +msgstr "" + +#. module: procurement +#: code:addons/procurement/schedulers.py:133 +#, python-format +msgid "Automatic OP: %s" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_procurement_orderpoint_compute +msgid "Automatic Order Point" +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,qty_multiple:0 +msgid "Qty Multiple" +msgstr "" + +#. module: procurement +#: help:stock.warehouse.orderpoint,qty_multiple:0 +msgid "The procurement quantity will be rounded up to this multiple." +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_res_company +msgid "Companies" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Extra Information" +msgstr "" + +#. module: procurement +#: field:procurement.order,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: procurement +#: sql_constraint:stock.warehouse.orderpoint:0 +msgid "Qty Multiple must be greater than zero." +msgstr "" + +#. module: procurement +#: selection:stock.warehouse.orderpoint,logic:0 +msgid "Order to Max" +msgstr "" + +#. module: procurement +#: field:procurement.order,date_close:0 +msgid "Date Closed" +msgstr "" + +#. module: procurement +#: view:res.company:0 +msgid "Logistics" +msgstr "" + +#. module: procurement +#: help:product.template,procure_method:0 +msgid "" +"Make to Stock: When needed, the product is taken from the stock or we wait " +"for replenishment. \n" +"Make to Order: When needed, the product is purchased or produced." +msgstr "" + +#. module: procurement +#: field:mrp.property,composition:0 +msgid "Properties composition" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:311 +#, python-format +msgid "Data Insufficient !" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_mrp_property_group +#: field:mrp.property,group_id:0 +#: field:mrp.property.group,name:0 +msgid "Property Group" +msgstr "" + +#. module: procurement +#: view:stock.warehouse.orderpoint:0 +msgid "Misc" +msgstr "" + +#. module: procurement +#: field:stock.move,procurements:0 +msgid "Procurements" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Run Procurement" +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Done" +msgstr "" + +#. module: procurement +#: view:make.procurement:0 +#: view:procurement.order.compute:0 +#: view:procurement.order.compute.all:0 +#: view:procurement.orderpoint.compute:0 +msgid "Cancel" +msgstr "" + +#. module: procurement +#: field:stock.warehouse.orderpoint,logic:0 +msgid "Reordering Mode" +msgstr "" + +#. module: procurement +#: field:procurement.order,origin:0 +msgid "Source Document" +msgstr "" + +#. module: procurement +#: selection:procurement.order,priority:0 +msgid "Not urgent" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.product_open_orderpoint +#: view:product.product:0 +msgid "Orderpoints" +msgstr "" + +#. module: procurement +#: help:stock.warehouse.orderpoint,product_max_qty:0 +msgid "" +"When the virtual stock goes below the Min Quantity, OpenERP generates a " +"procurement to bring the forecasted quantity to the Quantity specified as " +"Max Quantity." +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_procurement_order_compute_all +msgid "Compute all schedulers" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Late" +msgstr "" + +#. module: procurement +#: view:board.board:0 +msgid "Procurements in Exception" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.procurement_action5 +#: model:ir.actions.act_window,name:procurement.procurement_action_board +#: model:ir.actions.act_window,name:procurement.procurement_exceptions +#: model:ir.ui.menu,name:procurement.menu_stock_procurement_action +#: view:procurement.order:0 +msgid "Procurement Exceptions" +msgstr "" + +#. module: procurement +#: field:product.product,orderpoint_ids:0 +msgid "Minimum Stock Rules" +msgstr "" + +#. module: procurement +#: view:make.procurement:0 +msgid "" +"Fill is this for to launch a procurement request for this\n" +" product. According to the product configuration, " +"this may\n" +" trigger a draft purchase order, a manufacturing " +"order or\n" +" a new task." +msgstr "" + +#. module: procurement +#: field:procurement.order,close_move:0 +msgid "Close Move at end" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Scheduled Date" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_product_product +#: field:make.procurement,product_id:0 +#: view:procurement.order:0 +#: field:procurement.order,product_id:0 +#: field:stock.warehouse.orderpoint,product_id:0 +msgid "Product" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Temporary" +msgstr "" + +#. module: procurement +#: field:mrp.property,description:0 +#: field:mrp.property.group,description:0 +#: field:procurement.order,name:0 +msgid "Description" +msgstr "" + +#. module: procurement +#: selection:procurement.order,priority:0 +msgid "Urgent" +msgstr "" + +#. module: procurement +#: selection:procurement.order,state:0 +msgid "Running" +msgstr "" + +#. module: procurement +#: model:process.node,name:procurement.process_node_serviceonorder0 +#: selection:procurement.order,procure_method:0 +#: selection:product.template,procure_method:0 +msgid "Make to Order" +msgstr "" + +#. module: procurement +#: field:product.template,supply_method:0 +msgid "Supply Method" +msgstr "" + +#. module: procurement +#: field:procurement.order,move_id:0 +msgid "Reservation" +msgstr "" + +#. module: procurement +#: model:process.node,note:procurement.process_node_procureproducts0 +msgid "The way to procurement depends on the product type." +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "When you sell this product, OpenERP will" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Temporary Procurement Exceptions" +msgstr "" + +#. module: procurement +#: field:mrp.property,name:0 +#: field:stock.warehouse.orderpoint,name:0 +msgid "Name" +msgstr "" + +#. module: procurement +#: selection:mrp.property,composition:0 +msgid "max" +msgstr "" + +#. module: procurement +#: model:ir.actions.act_window,name:procurement.act_procurement_2_stock_warehouse_orderpoint +#: model:ir.actions.act_window,name:procurement.act_stock_warehouse_2_stock_warehouse_orderpoint +#: model:ir.actions.act_window,name:procurement.action_orderpoint_form +#: model:ir.ui.menu,name:procurement.menu_stock_order_points +#: view:stock.warehouse.orderpoint:0 +msgid "Reordering Rules" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:139 +#, python-format +msgid "Cannot delete Procurement Order(s) which are in %s state." +msgstr "" + +#. module: procurement +#: field:procurement.order,product_uos:0 +msgid "Product UoS" +msgstr "" + +#. module: procurement +#: model:ir.model,name:procurement.model_product_template +msgid "Product Template" +msgstr "" + +#. module: procurement +#: view:procurement.orderpoint.compute:0 +msgid "" +"Wizard checks all the stock minimum rules and generate procurement order." +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Search Procurement" +msgstr "" + +#. module: procurement +#: help:res.company,schedule_range:0 +msgid "" +"This is the time frame analysed by the scheduler when computing " +"procurements. All procurements that are not between today and today+range " +"are skipped for future computation." +msgstr "" + +#. module: procurement +#: selection:procurement.order,priority:0 +msgid "Very Urgent" +msgstr "" + +#. module: procurement +#: field:procurement.orderpoint.compute,automatic:0 +msgid "Automatic Orderpoint" +msgstr "" + +#. module: procurement +#: help:procurement.order,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: procurement +#: view:procurement.order:0 +msgid "Procurement started late" +msgstr "" + +#. module: procurement +#: selection:mrp.property,composition:0 +msgid "min" +msgstr "" + +#. module: procurement +#: view:make.procurement:0 +#: view:procurement.order.compute:0 +#: view:procurement.order.compute.all:0 +#: view:procurement.orderpoint.compute:0 +msgid "or" +msgstr "" + +#. module: procurement +#: code:addons/procurement/schedulers.py:134 +#, python-format +msgid "SCHEDULER" +msgstr "" + +#. module: procurement +#: view:product.product:0 +msgid "Request Procurement" +msgstr "" + +#. module: procurement +#: code:addons/procurement/schedulers.py:87 +#, python-format +msgid "PROC %d: on order - %3.2f %-5s - %s" +msgstr "" + +#. module: procurement +#: code:addons/procurement/procurement.py:339 +#, python-format +msgid "Products reserved from stock." +msgstr "" diff --git a/addons/procurement/i18n/pt_BR.po b/addons/procurement/i18n/pt_BR.po index 626e66dc827..9e425149ee3 100644 --- a/addons/procurement/i18n/pt_BR.po +++ b/addons/procurement/i18n/pt_BR.po @@ -8,15 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-12-21 17:06+0000\n" -"PO-Revision-Date: 2012-12-21 00:27+0000\n" -"Last-Translator: Fábio Martinelli - http://zupy.com.br " -"<webmaster@guaru.net>\n" +"PO-Revision-Date: 2013-04-18 17:42+0000\n" +"Last-Translator: Thiago Tognoli <Unknown>\n" "Language-Team: Brazilian Portuguese <pt_BR@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: 2013-03-16 05:43+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-04-19 05:24+0000\n" +"X-Generator: Launchpad (build 16567)\n" #. module: procurement #: model:ir.ui.menu,name:procurement.menu_stock_sched @@ -57,7 +56,7 @@ msgid "" " available" msgstr "" "quantidades necessárias estão sempre\n" -" disponíveis" +" disponíveis" #. module: procurement #: view:product.product:0 @@ -68,9 +67,9 @@ msgid "" " create others rules like orderpoints." msgstr "" "Se não houver quantidade suficiente disponível, a ordem de entrega\n" -" vai esperar por novos produtos. Para cumprir o " +" vai esperar por novos produtos. Para cumprir o " "inventário, você deve\n" -" criar outras regras como ponto de compra." +" criar outras regras como ponto de compra." #. module: procurement #: field:procurement.order,procure_method:0 @@ -632,7 +631,7 @@ msgstr "Provisório" #: model:ir.ui.menu,name:procurement.menu_stock_proc_schedulers #: view:procurement.order.compute.all:0 msgid "Run Schedulers" -msgstr "executar Agendadores" +msgstr "Executar Agendadores" #. module: procurement #: view:procurement.order.compute:0 diff --git a/addons/product/partner.py b/addons/product/partner.py index 159c687bedf..fbfee76d0b2 100644 --- a/addons/product/partner.py +++ b/addons/product/partner.py @@ -36,6 +36,9 @@ class res_partner(osv.osv): help="This pricelist will be used, instead of the default one, for sales to the current partner"), } + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_product_pricelist'] + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml index acb087533ac..5117da6044e 100644 --- a/addons/product/partner_view.xml +++ b/addons/product/partner_view.xml @@ -8,9 +8,12 @@ <field name="arch" type="xml"> <page string="Sales & Purchases" position="inside"> <group> - <group name="pricelists" groups="product.group_sale_pricelist"> + <group name="pricelists" groups="product.group_sale_pricelist" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> <field name="property_product_pricelist"/> </group> + <div name="parent_pricelists" groups="product.group_sale_pricelist" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}"> + <p>Pricelists are managed on <button name="open_commercial_entity" type="object" string="the parent company" class="oe_link"/></p> + </div> </group> </page> </field> diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index ef5b42aef02..6fc926980dd 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -234,7 +234,10 @@ class product_pricelist(osv.osv): qty, context=context)[res['base_pricelist_id']] ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id uom_price_already_computed = True - price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) + price = currency_obj.compute(cr, uid, + ptype_src, res['currency_id'], + price_tmp, round=False, + context=context) elif res['base'] == -2: # this section could be improved by moving the queries outside the loop: where = [] diff --git a/addons/product/product.py b/addons/product/product.py index fdcbee20cb4..518e455ddc1 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -518,6 +518,13 @@ class product_product(osv.osv): def _set_image(self, cr, uid, id, name, value, args, context=None): return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context) + def _get_name_template_ids(self, cr, uid, ids, context=None): + result = set() + template_ids = self.pool.get('product.product').search(cr, uid, [('product_tmpl_id', 'in', ids)]) + for el in template_ids: + result.add(el) + return list(result) + _defaults = { 'active': lambda *a: 1, 'price_extra': lambda *a: 0.0, @@ -549,7 +556,11 @@ class product_product(osv.osv): 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')), 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')), 'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'), - 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', size=128, store=True, select=True), + 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', size=128, store={ + 'product.template': (_get_name_template_ids, ['name'], 10), + 'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10), + + }, select=True), 'color': fields.integer('Color Index'), # image: all image fields are base64 encoded and PIL-supported 'image': fields.binary("Image", diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 00e925fd6a0..bcc0ae838ae 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -88,6 +88,7 @@ <div name="ean"> <field name="ean13" placeholder="e.g. 5901234123457"/> </div> + <field name="company_id" groups="base.group_multi_company" widget="selection"/> </group> </group> <field name="description" placeholder="describe the product characteristics..."/> diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 261e84c6dd9..5cf3d5d9400 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -196,7 +196,7 @@ <separator/> <filter string="Project(s) Manager" domain="[('user_id','=',uid)]" help="Projects in which I am a manager" icon="terp-personal"/> <field name="user_id" string="Project Manager"/> - <field name="partner_id" string="Contact"/> + <field name="partner_id" string="Contact" filter_domain="[('partner_id', 'child_of', self)]"/> <group expand="0" string="Group By..."> <filter string="Manager" name="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> <filter string="Contact" name="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index 10f3f4a8c7c..d9650e165ce 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -69,7 +69,7 @@ <filter icon="terp-personal-" string="Non Assigned Tasks to users" help="Non Assigned Tasks to users" domain="[('user_id','=',False)]"/> <field name="project_id"/> <field name="user_id"/> - <field name="partner_id" /> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <group expand="0" string="Extended Filters..."> <field name="priority"/> <field name="company_id" groups="base.group_multi_company"/> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index f888ff9da77..f15355e9cc8 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -146,7 +146,7 @@ <field name="model">project.issue</field> <field name="arch" type="xml"> <search string="Issue Tracker Search"> - <field name="name" string="Issue" filter_domain="['|', '|',('description','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/> + <field name="name" string="Issue" filter_domain="['|', '|', '|', ('partner_id','child_of',self), ('description','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/> <field name="id"/> <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/> <separator/> @@ -154,10 +154,11 @@ <filter string="To Do" domain="[('state','=','open')]" help="To Do Issues" icon="terp-check"/> <separator/> <filter string="Unassigned Issues" domain="[('user_id','=',False)]" help="Unassigned Issues" icon="terp-personal-"/> - <field name="partner_id"/> + <separator/> <field name="user_id"/> <field name="project_id"/> <field name="categ_ids"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <group expand="0" string="Group By..." > <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> <filter string="Contact" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index e56c6612e0d..a885dcd8a7f 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -55,7 +55,7 @@ <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/> <field name="project_id"/> <field name="user_id"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="version_id"/> <group expand="1" string="Group By..."> <filter string="Assigned to" name="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" /> diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml index 9f16dc80b97..af81ff4d295 100644 --- a/addons/project_issue/test/subscribe_issue.yml +++ b/addons/project_issue/test/subscribe_issue.yml @@ -2,8 +2,7 @@ In Order to test process of Issue in OpenERP, Custmer send the issue by email. - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('project_issue','test', 'issue.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('project_issue','test', 'issue.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'project.issue', request_message) - @@ -14,4 +13,4 @@ assert issue_ids and len(issue_ids), "issue is not created after getting request" issue = self.browse(cr, uid, issue_ids[0], context=context) assert not issue.partner_id, "Customer should be a new" - assert issue.name == "Error in the account module", "Subject does not match"
\ No newline at end of file + assert issue.name == "Error in the account module", "Subject does not match" diff --git a/addons/purchase/partner.py b/addons/purchase/partner.py index ad17a1dbae9..5e5af0815e3 100644 --- a/addons/purchase/partner.py +++ b/addons/purchase/partner.py @@ -43,6 +43,9 @@ class res_partner(osv.osv): super(res_partner, self).copy(cr, uid, id, default=default, context=context) + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_product_pricelist_purchase'] + _columns = { 'property_product_pricelist_purchase': fields.property( 'product.pricelist', diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 056a06f0750..4432d2b3200 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -270,7 +270,7 @@ <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/> <separator/> <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="product_id"/> <field name="create_uid"/> <group expand="0" string="Group By..."> @@ -297,7 +297,7 @@ <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/> <separator/> <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="product_id"/> <field name="create_uid"/> <group expand="0" string="Group By..."> @@ -335,7 +335,7 @@ <field name="type">ir.actions.act_window</field> <field name="res_model">purchase.order</field> <field name="context">{}</field> - <field name="domain">[('state','in',('draft','sent','cancel'))]</field> + <field name="domain">[('state','in',('draft','sent','cancel', 'confirmed'))]</field> <field name="view_mode">tree,form,graph,calendar</field> <field name="search_view_id" ref="view_purchase_order_filter"/> <field name="help" type="html"> @@ -481,7 +481,7 @@ <search string="Search Purchase Order"> <field name="order_id"/> <field name="product_id"/> - <field name="partner_id" string="Supplier"/> + <field name="partner_id" string="Supplier" filter_domain="[('partner_id', 'child_of', self)]"/> <group expand="0" string="Group By..."> <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" /> <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" /> diff --git a/addons/purchase_double_validation/i18n/lt.po b/addons/purchase_double_validation/i18n/lt.po new file mode 100644 index 00000000000..7205a152f84 --- /dev/null +++ b/addons/purchase_double_validation/i18n/lt.po @@ -0,0 +1,49 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-29 15:27+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: purchase_double_validation +#: model:ir.model,name:purchase_double_validation.model_purchase_config_settings +msgid "purchase.config.settings" +msgstr "" + +#. module: purchase_double_validation +#: view:purchase.order:0 +msgid "Purchase orders which are not approved yet." +msgstr "" + +#. module: purchase_double_validation +#: field:purchase.config.settings,limit_amount:0 +msgid "limit to require a second approval" +msgstr "" + +#. module: purchase_double_validation +#: view:board.board:0 +#: model:ir.actions.act_window,name:purchase_double_validation.purchase_waiting +msgid "Purchase Orders Waiting Approval" +msgstr "" + +#. module: purchase_double_validation +#: view:purchase.order:0 +msgid "To Approve" +msgstr "" + +#. module: purchase_double_validation +#: help:purchase.config.settings,limit_amount:0 +msgid "Amount after which validation of purchase is required." +msgstr "" diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 01536f471fe..3d8e41c42ff 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -40,8 +40,8 @@ import logging from report_helper import WebKitHelper import openerp +from openerp.modules.module import get_module_resource from openerp.report.report_sxw import * -from openerp import addons from openerp import tools from openerp.tools.translate import _ from openerp.osv.osv import except_osv @@ -280,7 +280,7 @@ class WebKitParser(report_sxw): template = False if report_xml.report_file : - path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep)) + path = get_module_resource(*report_xml.report_file.split(os.path.sep)) if path and os.path.exists(path) : template = file(path).read() if not template and report_xml.report_webkit_data : @@ -296,7 +296,7 @@ class WebKitParser(report_sxw): ) if not report_xml.header : header = '' - default_head = addons.get_module_resource('report_webkit', 'default_header.html') + default_head = get_module_resource('report_webkit', 'default_header.html') with open(default_head,'r') as f: header = f.read() css = report_xml.webkit_header.css diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index ec2307ca983..bfbaa5f0a6f 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -58,7 +58,7 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), implied_group='product.group_product_variant', help="""Allow to manage several variants per product. As an example, if you sell T-Shirts, for the same "Linux T-Shirt", you may have variants on sizes or colors; S, M, L, XL, XXL."""), 'module_warning': fields.boolean("Allow configuring alerts by customer or products", - help="""Allow to configure notification on products and trigger them when a user wants to sale a given product or a given customer. + help="""Allow to configure notification on products and trigger them when a user wants to sell a given product or a given customer. Example: Product: this product is deprecated, do not purchase more than 5. Supplier: don't forget to ask for an express delivery."""), 'module_sale_margin': fields.boolean("Display margins on sales orders", diff --git a/addons/sale/res_partner_view.xml b/addons/sale/res_partner_view.xml index 54a9813eea9..40ac119fdee 100644 --- a/addons/sale/res_partner_view.xml +++ b/addons/sale/res_partner_view.xml @@ -63,14 +63,34 @@ <field name="arch" type="xml"> <xpath expr="//label[@for='type']" position="attributes"> <attribute name="groups">sale.group_delivery_invoice_address</attribute> - </xpath> - <xpath expr="//label[@for='type']" position="attributes"> <attribute name="invisible">False</attribute> </xpath> <xpath expr="//div[@name='div_type']" position="attributes"> <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> </xpath> - <xpath expr="//div[@name='div_type']" position="attributes"> + <xpath expr="//field[@name='use_parent_address']" position="attributes"> + <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> + </xpath> + <xpath expr="//label[@for='use_parent_address']" position="attributes"> + <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> + </xpath> + <xpath expr="//field[@name='child_ids']//field[@name='use_parent_address']" position="attributes"> + <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> + </xpath> + <xpath expr="//field[@name='child_ids']//label[@for='use_parent_address']" position="attributes"> + <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> + </xpath> + <xpath expr="//field[@name='child_ids']//div[@name='div_type']" position="attributes"> + <attribute name="invisible">False</attribute> + <attribute name="groups">sale.group_delivery_invoice_address</attribute> + </xpath> + <xpath expr="//field[@name='child_ids']//label[@for='type']" position="attributes"> + <attribute name="invisible">False</attribute> <attribute name="groups">sale.group_delivery_invoice_address</attribute> </xpath> </field> diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 76b0f9c2159..210e4dd3be6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -320,10 +320,6 @@ class sale_order(osv.osv): return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} part = self.pool.get('res.partner').browse(cr, uid, part, context=context) - #if the chosen partner is not a company and has a parent company, use the parent to choose the delivery, the - #invoicing addresses and all the fields related to the partner. - if part.parent_id and not part.is_company: - part = part.parent_id addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact']) pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False payment_term = part.property_payment_term and part.property_payment_term.id or False @@ -1024,4 +1020,16 @@ class account_invoice(osv.Model): sale_order_obj.message_post(cr, uid, so_ids, body=_("Invoice paid"), context=context) return res + def unlink(self, cr, uid, ids, context=None): + """ Overwrite unlink method of account invoice to send a trigger to the sale workflow upon invoice deletion """ + invoice_ids = self.search(cr, uid, [('id', 'in', ids), ('state', 'in', ['draft', 'cancel'])], context=context) + #if we can't cancel all invoices, do nothing + if len(invoice_ids) == len(ids): + #Cancel invoice(s) first before deleting them so that if any sale order is associated with them + #it will trigger the workflow to put the sale order in an 'invoice exception' state + wf_service = netsvc.LocalService("workflow") + for id in ids: + wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) + return super(account_invoice, self).unlink(cr, uid, ids, context=context) + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 9a4866d14f1..e24a6e45fe0 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -156,7 +156,7 @@ <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/> <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/> <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/> - <field name="project_id" context="{'partner_id':partner_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/> + <field name="project_id" context="{'partner_id':partner_invoice_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/> </group> <group> <field name="date_order"/> @@ -308,7 +308,7 @@ <filter icon="terp-dolar_ok!" string="Done" domain="[('state','=','done')]" help="Sales Order done"/> <separator/> <filter string="My Sales Orders" domain="[('user_id','=',uid)]" help="My Sales Orders" icon="terp-personal" name="my_sale_orders_filter"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="user_id"/> <field name="project_id"/> <group expand="0" string="Group By..."> @@ -329,7 +329,6 @@ <field name="view_mode">tree,form,calendar,graph</field> <field name="search_view_id" ref="view_sales_order_filter"/> <field name="context">{ - 'show_address': 1, 'search_default_my_sale_orders_filter': 1 } </field> @@ -376,7 +375,7 @@ <field name="view_type">form</field> <field name="view_id" ref="view_quotation_tree"/> <field name="view_mode">tree,form,calendar,graph</field> - <field name="context">{'show_address': 1, 'search_default_my_sale_orders_filter': 1}</field> + <field name="context">{'search_default_my_sale_orders_filter': 1}</field> <field name="domain">[('state','in',('draft','sent','cancel'))]</field> <field name="search_view_id" ref="view_sales_order_filter"/> <field name="help" type="html"> @@ -477,7 +476,7 @@ <separator/> <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/> <field name="order_id"/> - <field name="order_partner_id"/> + <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/> <field name="product_id"/> <field name="salesman_id"/> <group expand="0" string="Group By..."> @@ -503,7 +502,7 @@ <separator/> <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/> <field name="order_id"/> - <field name="order_partner_id"/> + <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/> <field name="product_id"/> <field name="salesman_id"/> <group expand="0" string="Group By..."> diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py index 32db3a7c86e..9e10c826898 100644 --- a/addons/sale_journal/sale_journal.py +++ b/addons/sale_journal/sale_journal.py @@ -52,6 +52,10 @@ class res_partner(osv.osv): help = "This invoicing type will be used, by default, to invoice the current partner."), } + def _commercial_fields(self, cr, uid, context=None): + return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_invoice_type'] + + class picking(osv.osv): _inherit = "stock.picking" _columns = { diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml index bcd83b5be84..9d41103252e 100644 --- a/addons/sale_journal/sale_journal_view.xml +++ b/addons/sale_journal/sale_journal_view.xml @@ -146,7 +146,7 @@ <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <page string="Sales & Purchases" position="inside"> - <group colspan="2" col="2"> + <group colspan="2" col="2" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> <separator string="Invoicing" colspan="2"/> <field name="property_invoice_type"/> </group> diff --git a/addons/sale_mrp/i18n/lt.po b/addons/sale_mrp/i18n/lt.po new file mode 100644 index 00000000000..185753c3663 --- /dev/null +++ b/addons/sale_mrp/i18n/lt.po @@ -0,0 +1,43 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-29 15:30+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: sale_mrp +#: model:ir.model,name:sale_mrp.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: sale_mrp +#: help:mrp.production,sale_name:0 +msgid "Indicate the name of sales order." +msgstr "" + +#. module: sale_mrp +#: help:mrp.production,sale_ref:0 +msgid "Indicate the Customer Reference from sales order." +msgstr "" + +#. module: sale_mrp +#: field:mrp.production,sale_ref:0 +msgid "Sale Reference" +msgstr "" + +#. module: sale_mrp +#: field:mrp.production,sale_name:0 +msgid "Sale Name" +msgstr "" diff --git a/addons/sale_stock/stock.py b/addons/sale_stock/stock.py index e1070998ae8..ad19684c4cf 100644 --- a/addons/sale_stock/stock.py +++ b/addons/sale_stock/stock.py @@ -54,7 +54,7 @@ class stock_picking(osv.osv): We select the partner of the sales order as the partner of the customer invoice """ if picking.sale_id: - return picking.sale_id.partner_id + return picking.sale_id.partner_invoice_id return super(stock_picking, self)._get_partner_to_invoice(cr, uid, picking, context=context) def _get_comment_invoice(self, cursor, user, picking): diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index 92cdac4a85c..afffda1ef21 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -5,6 +5,12 @@ - !assert {model: sale.order, id: sale.sale_order_6, string: The amount of the Quotation is not correctly computed}: - sum([l.price_subtotal for l in order_line]) == amount_untaxed +- + I set an explicit invoicing partner that is different from the main SO Customer +- + !python {model: sale.order, id: sale.sale_order_6}: | + order = self.browse(cr, uid, ref("sale.sale_order_6")) + order.write({'partner_invoice_id': ref('base.res_partner_address_29')}) - I confirm the quotation with Invoice based on deliveries policy. - @@ -110,13 +116,13 @@ !python {model: sale.order}: | order = self.browse(cr, uid, ref("sale.sale_order_6")) assert order.invoice_ids, "Invoice is not created." - ac = order.partner_id.property_account_receivable.id + ac = order.partner_invoice_id.property_account_receivable.id journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)]) for invoice in order.invoice_ids: assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice." assert invoice.account_id.id == ac,"Invoice account is not correspond." assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond." - assert invoice.partner_id.id == order.partner_id.id,"Customer is not correspond." + assert invoice.partner_id.id == order.partner_invoice_id.id,"Customer does not correspond." assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond." assert invoice.comment == (order.note or ''),"Note is not correspond." assert invoice.journal_id.id in journal_ids,"Sales Journal is not link on Invoice." diff --git a/addons/share/i18n/lt.po b/addons/share/i18n/lt.po new file mode 100644 index 00000000000..497de8b405d --- /dev/null +++ b/addons/share/i18n/lt.po @@ -0,0 +1,617 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-29 15:32+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-30 05:29+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:841 +#, python-format +msgid "Invitation to collaborate about %s" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:779 +#, python-format +msgid "" +"The share engine has not been able to fetch a record_id for your invitation." +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Include an Optional Personal Message" +msgstr "" + +#. module: share +#: field:share.wizard,embed_option_title:0 +msgid "Display title" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Access granted!" +msgstr "" + +#. module: share +#: field:share.wizard,record_name:0 +msgid "Record name" +msgstr "" + +#. module: share +#: help:share.wizard,message:0 +msgid "" +"An optional personal message, to be included in the email notification." +msgstr "" + +#. module: share +#: field:share.wizard,user_type:0 +msgid "Sharing method" +msgstr "" + +#. module: share +#: field:share.wizard,name:0 +msgid "Share Title" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:847 +#: code:addons/share/wizard/share_wizard.py:876 +#, python-format +msgid "" +"The documents are not attached, you can view them online directly on my " +"OpenERP server at:\n" +" %s\n" +"\n" +msgstr "" + +#. module: share +#: model:ir.module.category,name:share.module_category_share +msgid "Sharing" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:842 +#: code:addons/share/wizard/share_wizard.py:874 +#, python-format +msgid "" +"Hello,\n" +"\n" +msgstr "" + +#. module: share +#: field:share.wizard,share_root_url:0 +msgid "Share Access URL" +msgstr "" + +#. module: share +#: field:share.wizard,email_1:0 +#: field:share.wizard,email_2:0 +#: field:share.wizard,email_3:0 +msgid "New user email" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:886 +#, python-format +msgid "You may use your current login (%s) and password to view them.\n" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:620 +#, python-format +msgid "(Modified)" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:664 +#, python-format +msgid "You must be a member of the Share/User group to use the share wizard." +msgstr "" + +#. module: share +#. openerp-web +#: code:addons/share/static/src/js/share.js:63 +#, python-format +msgid "Embed" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:598 +#, python-format +msgid "Sharing filter created by user %s (%s) for group %s" +msgstr "" + +#. module: share +#: field:share.wizard,embed_url:0 +#: field:share.wizard.result.line,share_url:0 +msgid "Share URL" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:848 +#: code:addons/share/wizard/share_wizard.py:880 +#, python-format +msgid "These are your credentials to access this protected area:\n" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Access info" +msgstr "" + +#. module: share +#. openerp-web +#: code:addons/share/static/src/js/share.js:60 +#: view:share.wizard:0 +#, python-format +msgid "Share" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:570 +#, python-format +msgid "(Duplicated for modified sharing permissions)" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:668 +#, python-format +msgid "" +"Please indicate the emails of the persons to share with, one per line." +msgstr "" + +#. module: share +#: help:share.wizard,domain:0 +msgid "Optional domain for further data filtering" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Next" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:661 +#, python-format +msgid "Action and Access Mode are required to create a shared access." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:849 +#: code:addons/share/wizard/share_wizard.py:881 +#, python-format +msgid "Username" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Sharing Options" +msgstr "" + +#. module: share +#. openerp-web +#: code:addons/share/static/src/xml/share.xml:9 +#, python-format +msgid "Invite" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Embedded code options" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Configuration" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "" +"Please select the action that opens the screen containing the data you want " +"to share." +msgstr "" + +#. module: share +#: field:res.groups,share:0 +msgid "Share Group" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:834 +#: code:addons/share/wizard/share_wizard.py:865 +#, python-format +msgid "Email required" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "" +"Optionally, you may specify an additional domain restriction that will be " +"applied to the shared data." +msgstr "" + +#. module: share +#: view:res.groups:0 +msgid "Non-Share Groups" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "" +"An email notification with instructions has been sent to the following " +"people:" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:77 +#, python-format +msgid "Direct link or embed code" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:855 +#: code:addons/share/wizard/share_wizard.py:889 +#, python-format +msgid "" +"OpenERP is a powerful and user-friendly suite of Business Applications (CRM, " +"Sales, HR, etc.)\n" +"It is open source and can be found on http://www.openerp.com." +msgstr "" + +#. module: share +#: field:share.wizard,action_id:0 +msgid "Action to share" +msgstr "" + +#. module: share +#: help:share.wizard,record_name:0 +msgid "Name of the shared record, if sharing a precise record" +msgstr "" + +#. module: share +#: field:res.users,share:0 +msgid "Share User" +msgstr "" + +#. module: share +#: field:share.wizard.result.line,user_id:0 +msgid "unknown" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:61 +#: code:addons/share/wizard/share_wizard.py:656 +#, python-format +msgid "Sharing access cannot be created." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:779 +#, python-format +msgid "Record id not found" +msgstr "" + +#. module: share +#: help:res.groups,share:0 +msgid "Group created to set access rights for sharing data with some users." +msgstr "" + +#. module: share +#: view:res.groups:0 +msgid "Share Groups" +msgstr "" + +#. module: share +#: help:share.wizard,action_id:0 +msgid "" +"The action that opens the screen containing the data you wish to share." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:545 +#, python-format +msgid "(Copy for sharing)" +msgstr "" + +#. module: share +#: field:share.wizard.result.line,newly_created:0 +msgid "Newly created" +msgstr "" + +#. module: share +#: help:share.wizard,name:0 +msgid "Title for the share (displayed to users as menu and shortcut name)" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:635 +#, python-format +msgid "Indirect sharing filter created by user %s (%s) for group %s" +msgstr "" + +#. module: share +#: help:share.wizard,share_root_url:0 +msgid "Main access page for users that are granted shared access" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:206 +#, python-format +msgid "" +"You must configure your email address in the user preferences before using " +"the Share button." +msgstr "" + +#. module: share +#: model:res.groups,name:share.group_share_user +msgid "User" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:657 +#, python-format +msgid "" +"Sorry, the current screen and filter you are trying to share are not " +"supported at the moment.\n" +"You may want to try a simpler filter." +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Use this link" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:851 +#: code:addons/share/wizard/share_wizard.py:883 +#, python-format +msgid "Database" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Share with these People (one email per line)" +msgstr "" + +#. module: share +#: field:share.wizard,domain:0 +msgid "Domain" +msgstr "" + +#. module: share +#: view:res.groups:0 +msgid "{'search_default_no_share':1}" +msgstr "" + +#. module: share +#: view:share.wizard:0 +#: field:share.wizard,result_line_ids:0 +msgid "Summary" +msgstr "" + +#. module: share +#: help:share.wizard,embed_code:0 +msgid "" +"Embed this code in your documents to provide a link to the shared document." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:512 +#, python-format +msgid "Copied access for sharing" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:816 +#, python-format +msgid "Invitation" +msgstr "" + +#. module: share +#: model:ir.actions.act_window,name:share.action_share_wizard_step1 +msgid "Share your documents" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Or insert the following code where you want to embed your documents" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:885 +#, python-format +msgid "" +"The documents have been automatically added to your current OpenERP " +"documents.\n" +msgstr "" + +#. module: share +#: model:ir.model,name:share.model_share_wizard_result_line +msgid "share.wizard.result.line" +msgstr "" + +#. module: share +#: field:share.wizard,embed_code:0 +msgid "Code" +msgstr "" + +#. module: share +#: help:share.wizard,user_type:0 +msgid "Select the type of user(s) you would like to share data with." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:843 +#, python-format +msgid "" +"I have shared %s (%s) with you!\n" +"\n" +msgstr "" + +#. module: share +#: field:share.wizard,view_type:0 +msgid "Current View Type" +msgstr "" + +#. module: share +#: selection:share.wizard,access_mode:0 +msgid "Can view" +msgstr "" + +#. module: share +#: selection:share.wizard,access_mode:0 +msgid "Can edit" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Cancel" +msgstr "" + +#. module: share +#: help:res.users,share:0 +msgid "" +"External user with limited access, created only for the purpose of sharing " +"data." +msgstr "" + +#. module: share +#: model:ir.actions.act_window,name:share.action_share_wizard +#: model:ir.model,name:share.model_share_wizard +#: field:share.wizard.result.line,share_wizard_id:0 +msgid "Share Wizard" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:792 +#, python-format +msgid "Shared access created!" +msgstr "" + +#. module: share +#: model:res.groups,comment:share.group_share_user +msgid "" +"\n" +"Members of this groups have access to the sharing wizard, which allows them " +"to invite external users to view or edit some of their documents." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:852 +#, python-format +msgid "" +"The documents have been automatically added to your subscriptions.\n" +"\n" +msgstr "" + +#. module: share +#: model:ir.model,name:share.model_res_users +msgid "Users" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:875 +#, python-format +msgid "" +"I've shared %s with you!\n" +"\n" +msgstr "" + +#. module: share +#: model:ir.model,name:share.model_res_groups +msgid "Access Groups" +msgstr "" + +#. module: share +#: field:share.wizard,invite:0 +msgid "Invite users to OpenSocial record" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:850 +#: code:addons/share/wizard/share_wizard.py:882 +#: field:share.wizard.result.line,password:0 +#, python-format +msgid "Password" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:77 +#: field:share.wizard,new_users:0 +#, python-format +msgid "Emails" +msgstr "" + +#. module: share +#: field:share.wizard,embed_option_search:0 +msgid "Display search view" +msgstr "" + +#. module: share +#: field:share.wizard,message:0 +msgid "Personal Message" +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:834 +#: code:addons/share/wizard/share_wizard.py:865 +#, python-format +msgid "" +"The current user must have an email address configured in User Preferences " +"to be able to send outgoing emails." +msgstr "" + +#. module: share +#: code:addons/share/wizard/share_wizard.py:205 +#, python-format +msgid "No email address configured" +msgstr "" + +#. module: share +#: field:share.wizard.result.line,login:0 +msgid "Login" +msgstr "" + +#. module: share +#: view:res.users:0 +msgid "Regular users only (no share user)" +msgstr "" + +#. module: share +#: field:share.wizard,access_mode:0 +msgid "Access Mode" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "Sharing: preparation" +msgstr "" + +#. module: share +#: model:ir.model,name:share.model_ir_model_access +msgid "ir.model.access" +msgstr "" + +#. module: share +#: view:share.wizard:0 +msgid "or" +msgstr "" + +#. module: share +#: help:share.wizard,access_mode:0 +msgid "Access rights to be granted on the shared documents." +msgstr "" diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index dc80c0f950a..e52a0181206 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -110,12 +110,11 @@ </group> </group> <group name="status" position="after" version="7.0"> - <group name="store" string="Storage Location"> - <field name="company_id" groups="base.group_multi_company" widget="selection"/> - <field name="loc_rack" attrs="{'invisible':[('type','=','service')]}"/> - <field name="loc_row" attrs="{'invisible':[('type','=','service')]}"/> - <field name="loc_case" attrs="{'invisible':[('type','=','service')]}"/> - </group> + <group name="store" string="Storage Location" attrs="{'invisible':[('type','=','service')]}"> + <field name="loc_rack"/> + <field name="loc_row"/> + <field name="loc_case"/> + </group> </group> <group name="Weights" position="after"> <group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties"> diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml index 4f3e256389c..fcf99f6e51e 100644 --- a/addons/stock/report/report_stock_move_view.xml +++ b/addons/stock/report/report_stock_move_view.xml @@ -149,7 +149,7 @@ <field name="location_id" filter_domain="[('location_id', 'child_of', self)]"/> <field name="company_id" groups="base.group_multi_company"/> <group expand="0" string="Extended Filters..."> - <field name="partner_id" context="{'contact_display':'partner'}"/> + <field name="partner_id" context="{'contact_display':'partner'}" filter_domain="[('partner_id', 'child_of', self)]"/> <field name="product_categ_id" /> <field name="prodlot_id"/> <field name="state"/> diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 6162d073fde..6097885175b 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -817,7 +817,7 @@ <filter icon="terp-check" name="available" string="Ready" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/> <filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves"/> <filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/> - <field name="partner_id"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="product_id"/> <field name="stock_journal_id"/> <group expand="0" string="Group By..."> @@ -944,6 +944,7 @@ <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> <separator/> <filter icon="terp-dolar" name="to_invoice" string="To Invoice" domain="[('invoice_state','=','2binvoiced')]" help="Delivery orders to invoice"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="stock_journal_id"/> <field name="company_id" groups="base.group_multi_company"/> <group expand="0" string="Group By..."> @@ -1069,6 +1070,7 @@ <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> <separator/> <filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]"/> + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> <field name="stock_journal_id"/> <field name="product_id"/> <group expand="0" string="Group By..."> @@ -1380,7 +1382,7 @@ <filter icon="terp-go-today" string="Today" domain="[('date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/> <field name="product_id"/> <field name="name" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/> - <field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','ilike',self)]"/> + <field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','child_of',self)]"/> <field name="prodlot_id"/> <group expand="0" string="Group By..."> <filter string="Product" name="by_product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> diff --git a/addons/web_shortcuts/i18n/lt.po b/addons/web_shortcuts/i18n/lt.po new file mode 100644 index 00000000000..70fc0a04b6c --- /dev/null +++ b/addons/web_shortcuts/i18n/lt.po @@ -0,0 +1,25 @@ +# Lithuanian translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:06+0000\n" +"PO-Revision-Date: 2013-04-24 18:29+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Lithuanian <lt@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: 2013-04-25 05:20+0000\n" +"X-Generator: Launchpad (build 16580)\n" + +#. module: web_shortcuts +#. openerp-web +#: code:addons/web_shortcuts/static/src/xml/web_shortcuts.xml:21 +#, python-format +msgid "Add / Remove Shortcut..." +msgstr "Pridėti / pašalinti trumpinį..." |
