Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -N -r9659 -r9969 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 9659) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 9969) @@ -150,3 +150,7 @@ REPLACE INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_general'); REPLACE INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_general'); REPLACE INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_general'); + +# ===== v 4.2.2 ===== +INSERT INTO ConfigurationAdmin VALUES ('UseColumnFreezer', 'la_Text_Website', 'la_config_UseColumnFreezer', 'checkbox', '', '', 10.22, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseColumnFreezer', '0', 'In-Portal', 'in-portal:configure_general'); \ No newline at end of file Index: branches/RC/core/units/general/helpers/col_picker_helper.php =================================================================== diff -u -N -r9639 -r9969 --- branches/RC/core/units/general/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 9639) +++ branches/RC/core/units/general/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 9969) @@ -3,6 +3,13 @@ class kColumnPickerHelper extends kHelper { var $PickerData; var $GridName; + var $UseFreezer; + + function Init($prefix,$special,$event_params=null) + { + parent::Init($prefix, $special, $event_params); + $this->UseFreezer = $this->Application->ConfigValue('UseColumnFreezer'); + } function LoadColumns($prefix) { @@ -90,10 +97,10 @@ { $splited = $this->Application->processPrefix($prefix); $grids = $this->Application->getUnitOption($splited['prefix'], 'Grids'); - $conf_fields = array_merge_recursive( + $conf_fields = $this->UseFreezer ? array_merge_recursive( array('__FREEZER__' => array('title' => '__FREEZER__')), $grids[$this->GridName]['Fields'] - ); + ) : $grids[$this->GridName]['Fields']; // $conf_fields = $grids[$this->GridName]['Fields']; // we NEED to recall dummy here to apply fields changes imposed by formatters, Index: branches/RC/core/admin_templates/js/script.js =================================================================== diff -u -N -r9884 -r9969 --- branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 9884) +++ branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 9969) @@ -1439,7 +1439,6 @@ { window.setTimeout(function() { if (win.closed) { - alert('It has been closed ('+url+')'); var req = Request.getRequest(); var $ajax_mark = (url.indexOf('?') ? '&' : '?') + 'ajax=yes'; req.open('GET', url + $ajax_mark, false); //!!!SYNCRONIOUS!!! REQUEST (3rd param = false!!!) Index: branches/RC/core/kernel/processors/tag_processor.php =================================================================== diff -u -N -r9951 -r9969 --- branches/RC/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 9951) +++ branches/RC/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 9969) @@ -134,7 +134,7 @@ function PreparePostProcess(&$params) { - $flags = Array('js_escape', 'equals_to', 'result_to_var', 'pass_params', 'html_escape', 'strip_nl'); + $flags = Array('js_escape', 'equals_to', 'result_to_var', 'pass_params', 'html_escape', 'strip_nl', 'trim'); $flag_values = Array(); foreach ($flags as $flag_name) { @@ -161,7 +161,9 @@ // 1 - strip \r,\n; 2 - strip tabs too $ret = preg_replace($flag_values['strip_nl'] == 2 ? "/[\r\n\t]/" : "/[\r\n]/", '', $ret); } - + if ($flag_values['trim']) { + $ret = trim($ret); + } // TODO: in new parser implement this parameter in compiled code (by Alex) if ($flag_values['equals_to'] !== false) { $equals_to = explode('|', $flag_values['equals_to']); Index: branches/RC/core/admin_templates/js/grid.js =================================================================== diff -u -N -r8929 -r9969 --- branches/RC/core/admin_templates/js/grid.js (.../grid.js) (revision 8929) +++ branches/RC/core/admin_templates/js/grid.js (.../grid.js) (revision 9969) @@ -115,17 +115,36 @@ } } - if ( this.Grid.MouseOverClass ) { +// if ( this.Grid.MouseOverClass ) { addEvent(this.HTMLelement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true); // true for traditional event model addEvent(this.HTMLelement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true); if ( this.LeftElement ) { addEvent(this.LeftElement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true); addEvent(this.LeftElement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true); } - } +// } } +GridItem.prototype.AddClass = function(elem, class_name) +{ + var cur_classes = elem.className; +// if (cur_classes.match(class_name)) return; + elem.className = cur_classes+' '+class_name; +// console.log('added %s to %s resulted %s', class_name, elem.id, elem.className) +} + +GridItem.prototype.RemoveClass = function(elem, class_name) +{ + var cur_classes = elem.className; +// console.log('looking for %s in %s', class_name, cur_classes) + if (!cur_classes.match(class_name)) return; + cur_classes = cur_classes.replace(class_name, ''); + cur_classes = cur_classes.replace(/[ ]+/, ' '); + elem.className = cur_classes; +// console.log('removed %s from %s resulted %s', class_name, elem.id, elem.className) +} + GridItem.prototype.DisableClicking = function () { this.HTMLelement.onclick = function(ev) { @@ -153,9 +172,11 @@ { if (this.selected) return; this.selected = true; - this.HTMLelement.className = this.class_on; + this.HTMLelement.setAttribute('_row_selected', 1) + this.AddClass(this.HTMLelement, this.class_on); if ( this.LeftElement ) { - this.LeftElement.className = this.class_on; + this.LeftElement.setAttribute('_row_selected', 1) + this.AddClass(this.LeftElement, this.class_on); } if ( isset(this.CheckBox) ) { this.CheckBox.checked = true; @@ -174,9 +195,11 @@ { if ( !this.selected && !force) return; this.selected = false; - this.HTMLelement.className = this.class_off; + this.HTMLelement.removeAttribute('_row_selected') + this.RemoveClass(this.HTMLelement, this.class_on); if ( this.LeftElement ) { - this.LeftElement.className = this.class_off; + this.LeftElement.removeAttribute('_row_selected') + this.RemoveClass(this.LeftElement, this.class_on); } if ( isset(this.CheckBox) ) { this.CheckBox.checked = false; @@ -244,16 +267,28 @@ GridItem.prototype.MouseOver = function (ev) { - this.HTMLelement.className = this.Grid.MouseOverClass; + this.HTMLelement.setAttribute('_row_highlighted', 1) + + this.AddClass(this.HTMLelement, this.Grid.MouseOverClass); + +// if (this.Grid.MouseOverClass) {this.HTMLelement.className = this.Grid.MouseOverClass;} if ( this.LeftElement ) { - this.LeftElement.className = this.Grid.MouseOverClass; + this.LeftElement.setAttribute('_row_highlighted', 1) +// if (this.Grid.MouseOverClass) this.LeftElement.className = this.Grid.MouseOverClass; + this.AddClass(this.LeftElement, this.Grid.MouseOverClass); +// this.LeftElement.className = this.LeftElement.className; // this is to make IE re-render the element } } GridItem.prototype.MouseOut = function (ev) { - this.HTMLelement.className = this.selected ? this.class_on : this.class_off; + this.HTMLelement.removeAttribute('_row_highlighted') + this.RemoveClass(this.HTMLelement, this.Grid.MouseOverClass); +// if (this.Grid.MouseOverClass) {this.HTMLelement.className = this.selected ? this.class_on : this.class_off;} if ( this.LeftElement ) { - this.LeftElement.className = this.selected ? this.class_on : this.class_off; + this.LeftElement.removeAttribute('_row_highlighted') + this.RemoveClass(this.LeftElement, this.Grid.MouseOverClass); +// if (this.Grid.MouseOverClass) this.LeftElement.className = this.selected ? this.class_on : this.class_off; +// this.LeftElement.className = this.LeftElement.className; // this is to make IE re-render the element } } Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r9844 -r9969 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9844) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9969) @@ -137,12 +137,16 @@ $picker_helper =& $this->Application->RecallObject('ColumnPickerHelper'); /* @var $picker_helper kColumnPickerHelper */ $picker_helper->ApplyPicker($this->getPrefixSpecial(), $grid_config, $params['grid']); + + if ($mode == 'fields') { + return "'".join("','", array_keys($grid_config))."'"; + } $std_params['pass_params'] = 'true'; $std_params['PrefixSpecial'] = $this->getPrefixSpecial(); $object =& $this->GetList($params); - + $o = ''; $i = 0; foreach ($grid_config as $field => $options) { @@ -156,7 +160,7 @@ $w = $picker_helper->GetWidth($field); if ($w) $options['width'] = $w; - if (isset($options['filter_width'])) { + /*if (isset($options['filter_width'])) { $block_params['filter_width'] = $options['filter_width']; } elseif (isset($options['width'])) { @@ -172,9 +176,19 @@ else { $block_params['filter_width'] = max($options['width']-10, 20); } + }*/ + /*if (isset($block_params['filter_width'])) $block_params['filter_width'] .= 'px'; + + + if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) { + $block_params['filter_width'] = '20px'; } - if (isset($block_params['filter_width'])) $block_params['filter_width'] .= 'px'; + else { + $block_params['filter_width'] = '97%'; +// $block_params['filter_width'] = max($options['width']-10, 20); + }*/ + $field_options = $object->GetFieldOptions($field); if (array_key_exists('use_phrases', $field_options)) { $block_params['use_phrases'] = $field_options['use_phrases']; Index: branches/RC/core/admin_templates/js/grid_scroller.js =================================================================== diff -u -N -r9359 -r9969 --- branches/RC/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 9359) +++ branches/RC/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 9969) @@ -154,9 +154,8 @@ this.PickerCRC = ''; -// this.FixedHeights = true; - this.FixedHeaderHeights = [50,30]; - this.FixedRowHeight = 25; + this.MaxHeaderHeights = [50,30]; + this.MaxRowHeight = 45; } GridScroller.prototype.Render = function(id) @@ -228,6 +227,7 @@ this.Resize(); } + this.AdjustInputWidths(); this.TheGrid.style.visibility = 'visible' this.MainScroller.style.visibility = 'visible' // Profile('Finalizng', 1); @@ -393,7 +393,8 @@ // reseting heights table1.rows[row].cells[0].style.height = 'auto'; table2.rows[row].cells[0].style.height = 'auto'; - + table1.rows[row].style.height = 'auto'; + table2.rows[row].style.height = 'auto'; var height1_div = document.getElementById(table1_id+'_left_height_'+row); if (height1_div) { height1_div.style.height = 'auto'; @@ -407,7 +408,6 @@ GridScroller.prototype.SetHeights = function(table1_id, table2_id) { - if (this.FixedHeights) return; var table1 = document.getElementById(table1_id); var table2 = document.getElementById(table2_id); var height1_div, height2_div; @@ -439,12 +439,12 @@ else { if (!is.ie) { // firefox needs div, but it can display it as table-cell var width = table.rows[row].cells[0].clientWidth; - table.rows[row].cells[0].innerHTML = '
' + table.rows[row].cells[0].innerHTML + '
' +// table.rows[row].cells[0].innerHTML = '
' + table.rows[row].cells[0].innerHTML + '
' } } // IE can't display div as table-cell, but it respects the tr height table.rows[row].cells[0].style.height = the_height+'px'; -// table.rows[row].style.height = the_height+'px'; + table.rows[row].style.height = the_height+'px'; } } @@ -455,8 +455,9 @@ var height for (var row=0; row 0) { + var left_inputs = this.LeftHeaderTable.getElementsByTagName('INPUT'); + for (var i=0; i= this.LeftCells) { @@ -610,6 +638,7 @@ this.SetLeftWidth(new_left_total_w+left_diff); } + this.AdjustInputWidths(); this.MinWidths[col] = width; this.SetLeftHeights(); @@ -817,9 +846,9 @@ var footer_rows = this.Footer.length; var header_h = 80; - if (this.FixedHeights) { - for (var i=0; i'+"\n" + + var row_class = 'grid-'+class_name+'-row '+(even ? even_class : '')+' grid-'+class_name+'-row-'+row + (source[row].row_class ? ' '+source[row].row_class : ''); + rh +=''+"\n" even = !even; total_width = 0; - if (this.FixedHeights) { - var height_style = id.match(/^(left_)?header/) ? 'height: '+this.FixedHeaderHeights[row]+'px;' : 'height: '+this.FixedRowHeight+'px;'; + if (this.LimitedHeights) { + var row_height = id.match(/^(left_)?header/) ? this.MaxHeaderHeights[row]+'px;' : this.MaxRowHeight+'px;' + var height_style = id.match(/^(left_)?header/) ? 'height: '+this.MaxHeaderHeights[row]+'px;' : 'height: '+this.MaxRowHeight+'px;'; } else { + var row_height = 'auto' var height_style = ''; } for (var col=start_col; col
', '
']; + if (id.match(/^(left_)?header/) && is.gecko) { + cursor_workaround = ['
', '
']; + } + else { + if (this.LimitedHeights) { + cursor_workaround = ['
','
']; } - /*else { - var cursor_workaround = ['
','
'] - }*/ } - var width_style = width_printed ? '' : 'style="width: '+this.MinWidths[col]+'px;"' - rh += "\t"+''+cursor_workaround[0]+source[row][col]+cursor_workaround[1]+''+"\n" + var width_style = width_printed ? '' : 'width: '+this.MinWidths[col]+'px;"' + var td_style = 'style="overflow: hidden; max-height: '+row_height+'; '+width_style+'"'; + var td_class = 'grid-'+class_name+'-col-'+col; + if (this.FieldNames) { + td_class += ' '+this.FieldNames[col]; + } + rh += "\t"+''+cursor_workaround[0]+row_data[col]+cursor_workaround[1]+''+"\n" } width_printed = true; // print widths in first row only if (needs_last) { @@ -1047,7 +1087,7 @@ GridScroller.prototype.SetHeader = function(a_header) { this.Header = a_header; - this.FixedHeaderHeightCorrection = (6*this.Header.length)+1; + this.MaxHeaderHeightCorrection = (6*this.Header.length)+1; } GridScroller.prototype.SetFooter = function(a_footer)