[903] | 1 | /***************************************************************************\ |
---|
| 2 | * eGroupWare - Contacts Center * |
---|
| 3 | * http://www.egroupware.org * |
---|
| 4 | * Written by: * |
---|
| 5 | * - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net> * |
---|
| 6 | * sponsored by Thyamad - http://www.thyamad.com * |
---|
| 7 | * ------------------------------------------------------------------------- * |
---|
| 8 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 9 | * under the terms of the GNU General Public License as published by the * |
---|
| 10 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 11 | * option) any later version. * |
---|
| 12 | \***************************************************************************/ |
---|
| 13 | |
---|
| 14 | /* ContactCenter Table - Provides visualization in Table Mode */ |
---|
| 15 | |
---|
| 16 | function ccEntriesTable (params) |
---|
| 17 | { |
---|
| 18 | this.table = newTable('ccTable_table'); |
---|
| 19 | this.columns = Array(); |
---|
| 20 | this.rows = Array(); |
---|
| 21 | |
---|
| 22 | this.actualIndex = 'a'; |
---|
| 23 | this.actualLetter = 1; |
---|
| 24 | |
---|
| 25 | this.table.setSelectionVisible(true); |
---|
| 26 | |
---|
| 27 | if (params['fields']) |
---|
| 28 | { |
---|
| 29 | for (var i in params['fields']) |
---|
| 30 | { |
---|
| 31 | this._addColumn(params['fields'][i]); |
---|
| 32 | } |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | ccEntriesTable.prototype.showEntries = function (index, page, extra) |
---|
| 37 | { |
---|
| 38 | |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | ccEntriesTable.prototype.addEntry = function () |
---|
| 42 | { |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | ccEntriesTable.prototype.removeSelectedEntries = function () |
---|
| 46 | { |
---|
| 47 | var selected = this.table.getRowsBySelection(); |
---|
| 48 | |
---|
| 49 | for (var i in selected) |
---|
| 50 | { |
---|
| 51 | } |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | /****************************************************************************\ |
---|
| 55 | * Private Methods * |
---|
| 56 | \****************************************************************************/ |
---|
| 57 | |
---|
| 58 | // TODO: Check for errors |
---|
| 59 | ccEntriesTable.prototype._addColumn = function (params) |
---|
| 60 | { |
---|
| 61 | var type; |
---|
| 62 | |
---|
| 63 | switch (params['type']) |
---|
| 64 | { |
---|
| 65 | case 'number': |
---|
| 66 | type = 'numericCompare'; |
---|
| 67 | break; |
---|
| 68 | |
---|
| 69 | case 'text': |
---|
| 70 | type = 'lexicalCompare'; |
---|
| 71 | break; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | this.columns[this.columns.length] = this.table.newTitle(params['caption'], type); |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | ccEntriesTable.prototype._addRow = function (params) |
---|
| 78 | { |
---|
| 79 | var row = this.table.newRow(); |
---|
| 80 | |
---|
| 81 | row.table |
---|
| 82 | for (var i in params) |
---|
| 83 | { |
---|
| 84 | row.newCell().addText(params[i]); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | this.rows[this.rows.length] = row; |
---|
| 88 | } |
---|
| 89 | |
---|