From: erickson Date: Sun, 13 May 2007 19:39:31 +0000 (+0000) Subject: added logic to spawn the correct clone-template interface based on template version X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=708221dae284378f44fe8513c55f381b01ce2a66;p=Evergreen.git added logic to spawn the correct clone-template interface based on template version git-svn-id: svn://svn.open-ils.org/ILS/trunk@7300 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/reports/oils_rpt_folder_window.js b/Open-ILS/web/reports/oils_rpt_folder_window.js index 7e199aba77..85ff58ca33 100644 --- a/Open-ILS/web/reports/oils_rpt_folder_window.js +++ b/Open-ILS/web/reports/oils_rpt_folder_window.js @@ -1,5 +1,5 @@ var OILS_TEMPLATE_INTERFACE = 'xul/template_builder.xul'; -var OILS_CLONE_TEMPLATE_INTERFACE = 'oils_rpt_builder.xhtml'; +var OILS_LEGACY_TEMPLATE_INTERFACE = 'oils_rpt_builder.xhtml'; /* generic folder window class */ @@ -286,7 +286,13 @@ oilsRptFolderWindow.prototype.cloneTemplate = function(template) { var s = location.search+''; s = s.replace(/\&folder=\d+/g,''); s = s.replace(/\&ct=\d+/g,''); - goTo(OILS_CLONE_TEMPLATE_INTERFACE+s+'&folder='+folderid+'&ct='+template.id()); + version = JSON2js(template.data()).version; + if(version && version >= 2) { + _debug('entering new template building interface with template version ' + version); + goTo(OILS_TEMPLATE_INTERFACE+s+'&folder='+folderid+'&ct='+template.id()); + } else { + goTo(OILS_LEGACY_TEMPLATE_INTERFACE+s+'&folder='+folderid+'&ct='+template.id()); + } } ); }