From 6265a0bbbb6056a50f55a6206c66bf8a417664dc Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 25 Jan 2013 14:47:17 +0530 Subject: [PATCH] minor fixes --- core/doctype/profile/locale/nl-doc.json | 1 + public/js/legacy/widgets/form/form.js | 9 +++++---- public/js/legacy/widgets/form/grid.js | 4 +--- public/js/legacy/widgets/form/print_format.js | 7 +------ public/js/wn/form/formatters.js | 17 +++++++++-------- public/js/wn/locale/_messages_js.json | 2 ++ public/js/wn/locale/ar-js.json | 2 ++ public/js/wn/locale/es-js.json | 2 ++ public/js/wn/locale/fr-js.json | 2 ++ public/js/wn/locale/hi-js.json | 2 ++ public/js/wn/locale/nl-js.json | 2 ++ public/js/wn/locale/pt-js.json | 2 ++ public/js/wn/print/print_table.js | 6 +----- public/js/wn/ui/listing.js | 5 +++-- public/js/wn/views/reportview.js | 10 +++++----- 15 files changed, 40 insertions(+), 33 deletions(-) diff --git a/core/doctype/profile/locale/nl-doc.json b/core/doctype/profile/locale/nl-doc.json index 40077c5bd2..c5e09656db 100644 --- a/core/doctype/profile/locale/nl-doc.json +++ b/core/doctype/profile/locale/nl-doc.json @@ -63,6 +63,7 @@ "english": "Engels", "espa\u00f1ol": "espa\u00f1ol", "fran\u00e7ais": "fran\u00e7ais", + "nederlands": "nederlands", "portugu\u00eas": "portugu\u00eas", "user_image_show": "user_image_show", "\u0627\u0644\u0639\u0631\u0628\u064a\u0629": "\u0627\u0644\u0639\u0631\u0628\u064a\u0629", diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index c27fee0066..ff27edb9ee 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -802,11 +802,12 @@ _f.Frm.prototype.setup_client_js = function(caller, cdt, cdn) { // js var cs = doctype.__js || (doctype.client_script_core + doctype.client_script); if(cs) { - //try { + try { var tmp = eval(cs); - // } catch(e) { - // console.log(e); - // } + } catch(e) { + show_alert("Error in Client Script.") + console.log(e); + } } // css diff --git a/public/js/legacy/widgets/form/grid.js b/public/js/legacy/widgets/form/grid.js index 4bf9fc586f..074628a8c3 100644 --- a/public/js/legacy/widgets/form/grid.js +++ b/public/js/legacy/widgets/form/grid.js @@ -245,9 +245,7 @@ _f.Grid.prototype.set_cell_value = function(cell) { // variations if(cell.cellIndex) { var df = copy_dict(hc); - if(df.fieldtype=="Link") - df.fieldtype=="Data"; - $(cell.div).html(wn.format(v, hc, doc)); + $(cell.div).html(wn.format(v, hc, {for_print:true})); } else { // Index column cell.div.style.padding = '2px'; diff --git a/public/js/legacy/widgets/form/print_format.js b/public/js/legacy/widgets/form/print_format.js index c109a210c4..fe39c1ad06 100644 --- a/public/js/legacy/widgets/form/print_format.js +++ b/public/js/legacy/widgets/form/print_format.js @@ -652,12 +652,7 @@ $.extend(_p, { // Add label row.cells[0].innerHTML = f.label ? f.label : f.fieldname; - var df = f; - if(f.fieldtype=="Link") { - df = copy_dict(f); - df.fieldtype = "Data"; - } - row.cells[1].innerHTML = wn.format(val, df); + row.cells[1].innerHTML = wn.format(val, f, {for_print: true}); // left align currency in normal display if(f.fieldtype == 'Currency') { diff --git a/public/js/wn/form/formatters.js b/public/js/wn/form/formatters.js index 98d632cb6f..bdd481f9ab 100644 --- a/public/js/wn/form/formatters.js +++ b/public/js/wn/form/formatters.js @@ -23,12 +23,13 @@ wn.form.formatters = { Check: function(value) { return value ? "" : ""; }, - Link: function(value, docfield) { - if(!value) return ""; + Link: function(value, docfield, options) { + if(options && options.for_print) + return value; + if(!value) + return ""; if(docfield && docfield.options) { - return repl('\ - %(name)s', { + return repl('%(name)s', { doctype: docfield.options, name: value }); @@ -91,7 +92,7 @@ wn.form.get_formatter = function(fieldtype) { return wn.form.formatters[fieldtype.replace(/ /g, "")] || wn.form.formatters.Data; } -wn.format = function(value, df) { - if(!df) df = {"fieldtype":"Data"} - return wn.form.get_formatter(df.fieldtype)(value, df); +wn.format = function(value, df, options) { + if(!df) df = {"fieldtype":"Data"}; + return wn.form.get_formatter(df.fieldtype)(value, df, options); } \ No newline at end of file diff --git a/public/js/wn/locale/_messages_js.json b/public/js/wn/locale/_messages_js.json index f935821cdf..321d1b1e6d 100644 --- a/public/js/wn/locale/_messages_js.json +++ b/public/js/wn/locale/_messages_js.json @@ -43,6 +43,7 @@ "New", "Save", "Type", + "More", "No records tagged.", "Page not found", "Add Message", @@ -97,6 +98,7 @@ "and", "For Links, use define linked", "From Date must be before To Date", + "Sort By", "Permissions will be based on this DocType", "Attach", "Note: Other permission rules may also apply", diff --git a/public/js/wn/locale/ar-js.json b/public/js/wn/locale/ar-js.json index 267bed090b..ccdbeb4cf7 100644 --- a/public/js/wn/locale/ar-js.json +++ b/public/js/wn/locale/ar-js.json @@ -59,6 +59,7 @@ "Make a new": "\u062c\u0639\u0644 \u062c\u062f\u064a\u062f\u0629", "Message": "\u0631\u0633\u0627\u0644\u0629", "Modified by": "\u062a\u0639\u062f\u064a\u0644\u0647\u0627 \u0645\u0646 \u0642\u0628\u0644", + "More": "\u0623\u0643\u062b\u0631", "New": "\u062c\u062f\u064a\u062f", "New Record": "\u0631\u0642\u0645 \u0642\u064a\u0627\u0633\u064a \u062c\u062f\u064a\u062f", "Next actions": "\u0627\u0644\u0625\u062c\u0631\u0627\u0621\u0627\u062a \u0627\u0644\u062a\u0627\u0644\u064a\u0629", @@ -109,6 +110,7 @@ "Showing only for": "\u062a\u0638\u0647\u0631 \u0641\u0642\u0637 \u0644\u0644", "Sorry we were unable to find what you were looking for.": "\u0648\u0622\u0633\u0641 \u0646\u062a\u0645\u0643\u0646 \u0645\u0646 \u0627\u0644\u0639\u062b\u0648\u0631 \u0639\u0644\u0649 \u0645\u0627 \u0643\u0646\u062a \u062a\u0628\u062d\u062b \u0639\u0646\u0647.", "Sorry you are not permitted to view this page.": "\u0639\u0630\u0631\u0627 \u063a\u064a\u0631 \u0645\u0633\u0645\u0648\u062d \u0644\u0643 \u0628\u0639\u0631\u0636 \u0647\u0630\u0647 \u0627\u0644\u0635\u0641\u062d\u0629.", + "Sort By": "\u0641\u0631\u0632 \u062d\u0633\u0628", "Start Report For": "\u062a\u0642\u0631\u064a\u0631 \u0639\u0646 \u0628\u062f\u0621", "Subject": "\u0645\u0648\u0636\u0648\u0639", "Submitted": "\u0627\u0644\u0645\u0642\u062f\u0645\u0629", diff --git a/public/js/wn/locale/es-js.json b/public/js/wn/locale/es-js.json index f8e94232ea..fd4c886ee3 100644 --- a/public/js/wn/locale/es-js.json +++ b/public/js/wn/locale/es-js.json @@ -59,6 +59,7 @@ "Make a new": "Hacer una nueva", "Message": "Mensaje", "Modified by": "Modificado por", + "More": "M\u00e1s", "New": "Nuevo", "New Record": "Nuevo registro", "Next actions": "Pr\u00f3ximas acciones", @@ -109,6 +110,7 @@ "Showing only for": "Mostrando s\u00f3lo para", "Sorry we were unable to find what you were looking for.": "Lamentablemente no hemos podido encontrar lo que estabas buscando.", "Sorry you are not permitted to view this page.": "Disculpe, no tiene permiso para ver esta p\u00e1gina.", + "Sort By": "Ordenado por", "Start Report For": "Inicio Informe para", "Subject": "Sujeto", "Submitted": "Enviado", diff --git a/public/js/wn/locale/fr-js.json b/public/js/wn/locale/fr-js.json index 0ea5d292a1..d33e877173 100644 --- a/public/js/wn/locale/fr-js.json +++ b/public/js/wn/locale/fr-js.json @@ -59,6 +59,7 @@ "Make a new": "Faire une nouvelle", "Message": "Message", "Modified by": "Modifi\u00e9 par", + "More": "Plus", "New": "Nouveau", "New Record": "Nouveau record", "Next actions": "Prochaines actions", @@ -109,6 +110,7 @@ "Showing only for": "Affichage seulement pour", "Sorry we were unable to find what you were looking for.": "D\u00e9sol\u00e9, nous n'avons pas pu trouver ce que vous recherchez.", "Sorry you are not permitted to view this page.": "D\u00e9sol\u00e9, vous n'\u00eates pas autoris\u00e9 \u00e0 afficher cette page.", + "Sort By": "Trier par", "Start Report For": "D\u00e9marrer Rapport pour", "Subject": "Sujet", "Submitted": "Soumis", diff --git a/public/js/wn/locale/hi-js.json b/public/js/wn/locale/hi-js.json index 4b0427f0b9..21a00af30a 100644 --- a/public/js/wn/locale/hi-js.json +++ b/public/js/wn/locale/hi-js.json @@ -59,6 +59,7 @@ "Make a new": "\u090f\u0915 \u0928\u092f\u093e", "Message": "\u0938\u0902\u0926\u0947\u0936", "Modified by": "\u0915\u0947 \u0926\u094d\u0935\u093e\u0930\u093e \u091c\u093e\u0901\u091a\u093e \u0917\u092f\u093e", + "More": "\u0905\u0927\u093f\u0915", "New": "\u0928\u0908", "New Record": "\u0928\u092f\u093e \u0930\u093f\u0915\u0949\u0930\u094d\u0921", "Next actions": "\u0905\u0917\u0932\u0940 \u0915\u093e\u0930\u094d\u0930\u0935\u093e\u0908", @@ -110,6 +111,7 @@ "Sorry we were unable to find what you were looking for.": "\u0916\u0947\u0926 \u0939\u0948 \u0915\u093f \u0939\u092e \u0916\u094b\u091c\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0906\u092a \u0915\u094d\u092f\u093e \u0926\u0947\u0916 \u0930\u0939\u0947 \u0925\u0947 \u0915\u0930\u0928\u0947 \u092e\u0947\u0902 \u0905\u0938\u092e\u0930\u094d\u0925 \u0925\u0947.", "Sorry you are not permitted to view this page": "\u0916\u0947\u0926 \u0939\u0948 \u0915\u093f \u0906\u092a\u0915\u094b \u0907\u0938 \u092a\u0943\u0937\u094d\u0920 \u0915\u094b \u0926\u0947\u0916\u0928\u0947 \u0915\u0940 \u0905\u0928\u0941\u092e\u0924\u093f \u0928\u0939\u0940\u0902 \u0939\u0948", "Sorry you are not permitted to view this page.": "\u0916\u0947\u0926 \u0939\u0948 \u0915\u093f \u0906\u092a\u0915\u094b \u0907\u0938 \u092a\u0943\u0937\u094d\u0920 \u0915\u094b \u0926\u0947\u0916\u0928\u0947 \u0915\u0940 \u0905\u0928\u0941\u092e\u0924\u093f \u0928\u0939\u0940\u0902 \u0939\u0948.", + "Sort By": "\u0926\u094d\u0935\u093e\u0930\u093e \u0915\u094d\u0930\u092e\u092c\u0926\u094d\u0927 \u0915\u0930\u0947\u0902", "Start Report For": "\u092a\u094d\u0930\u093e\u0930\u0902\u092d \u0932\u093f\u090f \u0930\u093f\u092a\u094b\u0930\u094d\u091f", "Subject": "\u0935\u093f\u0937\u092f", "Submitted": "\u092a\u0947\u0936", diff --git a/public/js/wn/locale/nl-js.json b/public/js/wn/locale/nl-js.json index cdd0fbe4bd..e8942be1f4 100644 --- a/public/js/wn/locale/nl-js.json +++ b/public/js/wn/locale/nl-js.json @@ -59,6 +59,7 @@ "Make a new": "Maak een nieuw", "Message": "Bericht", "Modified by": "Aangepast door", + "More": "Meer", "New": "Nieuw", "New Record": "Nieuwe record", "Next actions": "Volgende acties", @@ -109,6 +110,7 @@ "Showing only for": "Resultaat alleen voor", "Sorry we were unable to find what you were looking for.": "Sorry we waren niet in staat om te vinden wat u zocht.", "Sorry you are not permitted to view this page.": "Sorry dat je niet toegestaan \u200b\u200bom deze pagina te bekijken.", + "Sort By": "Sorteer op", "Start Report For": "Start Rapport Voor", "Subject": "Onderwerp", "Submitted": "Ingezonden", diff --git a/public/js/wn/locale/pt-js.json b/public/js/wn/locale/pt-js.json index 2e2c453c77..23251866cc 100644 --- a/public/js/wn/locale/pt-js.json +++ b/public/js/wn/locale/pt-js.json @@ -59,6 +59,7 @@ "Make a new": "Fa\u00e7a um novo", "Message": "Mensagem", "Modified by": "Modificado por", + "More": "Mais", "New": "Novo", "New Record": "Novo Registro", "Next actions": "Pr\u00f3ximas a\u00e7\u00f5es", @@ -109,6 +110,7 @@ "Showing only for": "Mostrando apenas para", "Sorry we were unable to find what you were looking for.": "Desculpe, n\u00e3o foram capazes de encontrar o que voc\u00ea estava procurando.", "Sorry you are not permitted to view this page.": "Desculpe, voc\u00ea n\u00e3o tem permiss\u00e3o para visualizar esta p\u00e1gina.", + "Sort By": "Classificar por", "Start Report For": "Para come\u00e7ar Relat\u00f3rio", "Subject": "Assunto", "Submitted": "Enviado", diff --git a/public/js/wn/print/print_table.js b/public/js/wn/print/print_table.js index 1a4194e592..8c493ad2f6 100644 --- a/public/js/wn/print/print_table.js +++ b/public/js/wn/print/print_table.js @@ -136,11 +136,7 @@ wn.print.Table = Class.extend({ var value = row[fieldname]; var df = wn.meta.docfield_map[me.tabletype][fieldname]; - if(df && df.fieldtype=="Link") { - df = copy_dict(df); - df.fieldtype = "Data"; - } - value = wn.format(value, df); + value = wn.format(value, df, {for_print:true}); // set formatted value back into data so that modifer can use it row[fieldname] = value; diff --git a/public/js/wn/ui/listing.js b/public/js/wn/ui/listing.js index 6faf8c4627..981fe8cf2f 100644 --- a/public/js/wn/ui/listing.js +++ b/public/js/wn/ui/listing.js @@ -69,8 +69,9 @@ wn.ui.Listing = Class.extend({ } } if(!this.opts.no_result_message) { - this.opts.no_result_message = 'Nothing to show' + this.opts.no_result_message = wn._('Nothing to show'); } + this.opts._more = wn._("More"); }, make: function(opts) { if(opts) { @@ -112,7 +113,7 @@ wn.ui.Listing = Class.extend({ \ \
\ -
\ +