Let egw.link takes care of the base url. Fix sometimes nm_print_dialog template runs into CSP error

This commit is contained in:
Hadi Nategh 2016-09-14 15:09:32 +02:00
parent 5fa0d4dc5a
commit 16992899d4

View File

@ -2243,14 +2243,12 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
} }
},this); },this);
var base_url = this.getInstanceManager().template_base_url;
if (base_url == '/') base_url = ''; // otherwise we generate a url //api/templates, which is wrong
var dialog = et2_createWidget("dialog",{ 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. // 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 callback: callback, // return false to prevent dialog closing
buttons: et2_dialog.BUTTONS_OK_CANCEL, buttons: et2_dialog.BUTTONS_OK_CANCEL,
title: 'Print', title: 'Print',
template:this.egw().link(base_url+'/api/templates/default/nm_print_dialog.xet'), template:this.egw().link('/api/templates/default/nm_print_dialog.xet'),
value: { value: {
content: { content: {
row_count: Math.min(100,total), row_count: Math.min(100,total),