Sebastien LANGE
8 years ago
1 changed files with 42 additions and 44 deletions
@ -1,48 +1,46 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<data> |
|||
<odoo> |
|||
|
|||
<template id="minimal_layout" inherit_id="report.minimal_layout"> |
|||
<xpath expr="//t[@t-if='subst is True']" position="replace"> |
|||
<t t-if="subst is True"> |
|||
<script> |
|||
function subst() { |
|||
var vars = {}; |
|||
var x = document.location.search.substring(1).split('&'); |
|||
for (var i in x) { |
|||
var z = x[i].split('=', 2); |
|||
vars[z[0]] = unescape(z[1]); |
|||
} |
|||
var x=['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection']; |
|||
for (var i in x) { |
|||
var y = document.getElementsByClassName(x[i]); |
|||
for (var j=0; j<y.length; ++j) |
|||
y[j].textContent = vars[x[i]]; |
|||
<template id="minimal_layout" inherit_id="report.minimal_layout"> |
|||
<xpath expr="//t[@t-if='subst is True']" position="replace"> |
|||
<t t-if="subst is True"> |
|||
<script> |
|||
function subst() { |
|||
var vars = {}; |
|||
var x = document.location.search.substring(1).split('&'); |
|||
for (var i in x) { |
|||
var z = x[i].split('=', 2); |
|||
vars[z[0]] = unescape(z[1]); |
|||
} |
|||
var x=['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection']; |
|||
for (var i in x) { |
|||
var y = document.getElementsByClassName(x[i]); |
|||
for (var j=0; j<y.length; ++j) |
|||
y[j].textContent = vars[x[i]]; |
|||
} |
|||
var operations = { |
|||
'not-first-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.frompage) ? "hidden" : "visible"; |
|||
}, |
|||
'not-last-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.topage) ? "hidden" : "visible"; |
|||
}, |
|||
'first-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.frompage) ? "visible" : "hidden"; |
|||
}, |
|||
'last-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.topage) ? "visible" : "hidden"; |
|||
}, |
|||
}; |
|||
for (var klass in operations) { |
|||
var y = document.getElementsByClassName(klass); |
|||
for (var j=0; j<y.length; ++j) |
|||
operations[klass](y[j]); |
|||
} |
|||
} |
|||
var operations = { |
|||
'not-first-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.frompage) ? "hidden" : "visible"; |
|||
}, |
|||
'not-last-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.topage) ? "hidden" : "visible"; |
|||
}, |
|||
'first-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.frompage) ? "visible" : "hidden"; |
|||
}, |
|||
'last-page': function (elt) { |
|||
elt.style.visibility = (vars.page === vars.topage) ? "visible" : "hidden"; |
|||
}, |
|||
}; |
|||
for (var klass in operations) { |
|||
var y = document.getElementsByClassName(klass); |
|||
for (var j=0; j<y.length; ++j) |
|||
operations[klass](y[j]); |
|||
} |
|||
} |
|||
</script> |
|||
</t> |
|||
</xpath> |
|||
</template> |
|||
</script> |
|||
</t> |
|||
</xpath> |
|||
</template> |
|||
|
|||
</data> |
|||
</openerp> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue