From bc108f4573319fce3d3391c2c5159fd19f6d664e Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 15 Sep 2016 11:50:18 +0200 Subject: [PATCH] Another try to fix base_url for print_dialog template. Seems it's necessary to keep the template_base_url untocued, because template_base_url gets calculated everytime when an et2 instance loads a template. --- api/js/etemplate/et2_extension_nextmatch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index c88325f30e..c74d77a04b 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -2243,12 +2243,14 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ } },this); + var base_url = this.getInstanceManager().template_base_url; + if (base_url.substr(base_url.length - 1) == '/') base_url = base_url.slice (0, -1); // otherwise we generate a url //api/templates, which is wrong var dialog = et2_createWidget("dialog",{ // If you use a template, the second parameter will be the value of the template, as if it were submitted. callback: callback, // return false to prevent dialog closing buttons: et2_dialog.BUTTONS_OK_CANCEL, title: 'Print', - template:this.egw().link('/api/templates/default/nm_print_dialog.xet'), + template:this.egw().link(base_url+'/api/templates/default/nm_print_dialog.xet'), value: { content: { row_count: Math.min(100,total),