diff --git a/js/designer/history.js b/js/designer/history.js index d5d0d6a3e0..d242e71050 100644 --- a/js/designer/history.js +++ b/js/designer/history.js @@ -7,8 +7,10 @@ * @version $Id$ */ +var DesignerHistory = {}; + var historyArray = []; // Global array to store history objects -var selectField = []; // Global array to store informaation for columns which are used in select clause +var selectField = []; // Global array to store information for columns which are used in select clause var gIndex; var vqbEditor = null; @@ -19,35 +21,35 @@ var vqbEditor = null; * **/ -function detail (index) { - var type = historyArray[index].get_type(); +DesignerHistory.detail = function (index) { + var type = historyArray[index].getType(); var str; if (type === 'Where') { - str = 'Where ' + historyArray[index].get_column_name() + historyArray[index].get_obj().getrelation_operator() + historyArray[index].get_obj().getquery(); + str = 'Where ' + historyArray[index].getColumnName() + historyArray[index].getObj().getRelationOperator() + historyArray[index].getObj().getQuery(); } if (type === 'Rename') { - str = 'Rename ' + historyArray[index].get_column_name() + ' To ' + historyArray[index].get_obj().getrename_to(); + str = 'Rename ' + historyArray[index].getColumnName() + ' To ' + historyArray[index].getObj().getRenameTo(); } if (type === 'Aggregate') { - str = 'Select ' + historyArray[index].get_obj().get_operator() + '( ' + historyArray[index].get_column_name() + ' )'; + str = 'Select ' + historyArray[index].getObj().getOperator() + '( ' + historyArray[index].getColumnName() + ' )'; } if (type === 'GroupBy') { - str = 'GroupBy ' + historyArray[index].get_column_name(); + str = 'GroupBy ' + historyArray[index].getColumnName(); } if (type === 'OrderBy') { - str = 'OrderBy ' + historyArray[index].get_column_name() + ' ' + historyArray[index].get_obj().get_order(); + str = 'OrderBy ' + historyArray[index].getColumnName() + ' ' + historyArray[index].getObj().getOrder(); } if (type === 'Having') { str = 'Having '; - if (historyArray[index].get_obj().get_operator() !== 'None') { - str += historyArray[index].get_obj().get_operator() + '( ' + historyArray[index].get_column_name() + ' )'; - str += historyArray[index].get_obj().getrelation_operator() + historyArray[index].get_obj().getquery(); + if (historyArray[index].getObj().getOperator() !== 'None') { + str += historyArray[index].getObj().getOperator() + '( ' + historyArray[index].getColumnName() + ' )'; + str += historyArray[index].getObj().getRelationOperator() + historyArray[index].getObj().getQuery(); } else { - str = 'Having ' + historyArray[index].get_column_name() + historyArray[index].get_obj().getrelation_operator() + historyArray[index].get_obj().getquery(); + str = 'Having ' + historyArray[index].getColumnName() + historyArray[index].getObj().getRelationOperator() + historyArray[index].getObj().getQuery(); } } return str; -} +}; /** * Sorts historyArray[] first,using table name as the key and then generates the HTML code for history tab, @@ -60,7 +62,7 @@ function detail (index) { * **/ -function display (init, finit) { +DesignerHistory.display = function (init, finit) { var str; var i; var j; @@ -70,9 +72,9 @@ function display (init, finit) { // this part sorts the history array based on table name,this is needed for clubbing all object of same name together. for (i = init; i < finit; i++) { sto = historyArray[i]; - temp = historyArray[i].get_tab();// + '.' + historyArray[i].get_obj_no(); for Self JOINS + temp = historyArray[i].getTab();// + '.' + historyArray[i].getObjNo(); for Self JOINS for (j = 0; j < i; j++) { - if (temp > (historyArray[j].get_tab())) {// + '.' + historyArray[j].get_obj_no())) { //for Self JOINS + if (temp > (historyArray[j].getTab())) {// + '.' + historyArray[j].getObjNo())) { //for Self JOINS for (k = i; k > j; k--) { historyArray[k] = historyArray[k - 1]; } @@ -84,28 +86,28 @@ function display (init, finit) { // this part generates HTML code for history tab.adds delete,edit,and/or and detail features with objects. str = ''; // string to store Html code for history tab for (i = 0; i < historyArray.length; i++) { - temp = historyArray[i].get_tab(); // + '.' + historyArray[i].get_obj_no(); for Self JOIN + temp = historyArray[i].getTab(); // + '.' + historyArray[i].getObjNo(); for Self JOIN str += '
| ';
- if (historyArray[i].get_and_or()) {
- str += ' | ';
+ if (historyArray[i].getAndOr()) {
+ str += '' + Functions.getImage('b_sbrowse', 'column name') + ' | ' + - '' + historyArray[i].get_column_name() + ' | '; - if (historyArray[i].get_type() === 'GroupBy' || historyArray[i].get_type() === 'OrderBy') { - str += ' | ' + Functions.getImage('s_info', detail(i)) + ' | ' + - '' + historyArray[i].get_type() + ' | ' + - '' + Functions.getImage('b_drop', Messages.strDelete) + ' | '; + '' + historyArray[i].getColumnName() + ' | '; + if (historyArray[i].getType() === 'GroupBy' || historyArray[i].getType() === 'OrderBy') { + str += ' | ' + Functions.getImage('s_info', DesignerHistory.detail(i)) + ' | ' + + '' + historyArray[i].getType() + ' | ' + + '' + Functions.getImage('b_drop', Messages.strDelete) + ' | '; } else { - str += '' + Functions.getImage('s_info', detail(i)) + ' | ' + - '' + historyArray[i].get_type() + ' | ' + - '' + Functions.getImage('b_edit', Messages.strEdit) + ' | ' + - '' + Functions.getImage('b_drop', Messages.strDelete) + ' | '; + str += '' + Functions.getImage('s_info', DesignerHistory.detail(i)) + ' | ' + + '' + historyArray[i].getType() + ' | ' + + '' + Functions.getImage('b_edit', Messages.strEdit) + ' | ' + + '' + Functions.getImage('b_drop', Messages.strDelete) + ' | '; } str += '