<?php
/*

This is the archive of the changelog. The latest changes are noted in
phplens.inc.php. Here are the changes from 1.0 to 1.9.

== 1.9.8 15 March 2002

Changes
=======
Alignment of numeric fields with lookups was set to left - bug introduced in 1.9 - reset to right - fix for JMJ

Better stored procedure code (spNew and spEdit properties)
  - Properties spNew and spEdit now support PHP code with "=phpcode"

  - Fix: Now readonly fields when editing and spEdit is set are also passed back 
    on Submit,as stored procedures can access readonly fields too!  

  - Fix: If no value was entered in a edit/new form, the spNew and spEdit properties
          would not be set properly. Now we pass nulls for these empty fields.

  -Fix: All redirect properties: eg. redirectOnInsert and redirectOnUpdate, did not 
        work with	spNew and spEdit - fixed.

Allow you to customize SQL based on state for higher performance using new sqlDetail, sqlEditNew properties.
   -   So if you have a field that is only entered when editing, remove that
        field from the normal sql and put it in sqlEditNew

New property eventDetailView that triggers a function call when viewing a detail record.
     - Useful for simulating email systems where the detail record is marked as read 
    when  it is displayed.

Disabled email regular expression validation for Opera. Damned software has terrible
	javascript support.

Fixed the ugly background colour boxes around Navigator 4.77 radios buttons. 
    
When data entry validation failed, the hot update popups not reset properly. Fixed.

Fixed regular expression matching for autogeneration of anchor tags for email and http

== 1.9.7
Implemented collections with saveOptions.
Changed constant LENS_INPUT_WIDTH to $LENS_INPUT_WIDTH (variable) so it can be dynamicly modified.
Several lookupLens optimizations added. 
	Formerly all lookupLens were evaluated for all states (FILTERVIEW, FILTER, VIEW, NEW, EDIT).
	Now we can define which states a lookup is used for using the new syntax:
		$lens->lookupLens = 'col^==1/2/3^VIEW'; 
	Above means only evaluate for VIEW and FILTERVIEW states for field "col", for legal values 1,2,3
		$lens->lookupLens = 'col^==1/2/3^!VIEW'; 
	Above means only evaluate for not VIEW state.
		$lens->lookupLens = 'col^==1/2/3^EDIT'; 
	Above means only evaluate for EDIT state.
	Also we now support PHP generation of code using =% and ==%
		$lens->lookupLens = 'col^=%GenValuesText()';  // generates 1/one/2/two/3/three (value/text pairs)
		$lens->lookupLens = 'col^==%GenValues()';  // generates 1/2/3/4/5/6 (values only)

== 1.9.6 22 Feb 2002
Fixed referer check to compare only the domain name.

== 1.9.5 21 Feb 2002
Changed PHPLENS_MD5_SALT from a dynamic value to a constant to avoid relative addressing problems.
Moved default urlParams anchor tag to above debugging messages.
Removed some bad html from the filter screen

== 1.9.4 18 Feb 2002
When editing a record on the 2nd page or later, sometimes no record would be found
	because we still perform a SELECT LIMIT accidentally. Fixed.

== 1.9.3 18 Feb 2002
For NN 4.77, problem when saving.
	Missed removing one urlParams when clicking on Save and editMultiple = true. Fixed.
$PHPLENS_GRAPHICS_SERVER not configured correctly in edit mode, so the jsrsClient.js was not
	setup correctly, reported by JMJ - fixed.
Search form html had duplicate tags and javascript, reported by Jose - fixed.
Entering dates did not work properly for oracle - fixed.
Opera compat fixes (with anchor tags).

== 1.9.2 16 Feb 2002
Fixed some bugs in filtering with hot updates.
Sort descending did not work with new bookmarks feature - fixed.
Changed default table attributes in order to make the look and feel similar for Mozilla, NN 4.77 and IE.
	The main culprit being Mozilla which renders table borders with cellspacing=0 with black - uggh.
		Changed gridTableHeader to 'width="100%"  border=1 cellspacing=1 cellpadding=1 '
		from formerly 'width="100%"  border=1 cellspacing=0 cellpadding=2 '.
		Changed navTableHeader to 'border=1 cellspacing=1 cellpadding=0 bgcolor=silver'
		from 'border=1 cellspacing=0, bgcolor=silver'.
Bookmarks did not work with NN 4.77 - in fact some urls stopped working -fixed by disabling for NN.

== 1.9.1 16 Feb 2002
When editMultiple is true, set canEdit = true also.
Renamed jsrsServer.inc.php to phplens-jsrsServer.inc.php.

== 1.9.0 3 Feb 2002
Added editMultiple property.
Added new type 'P' for positive numeric (>= 0.0) and 'J' for positive integer (>= 0).
Rollout of hot updates with lookupLens property.
Disabled webcal when IE 4 - otherwise scripting error message occurs.
Cleanup of all "New Record" messages so that they are classified as LENSNOTICE. 


== 1.3.15 29 Jan 2002
When using filterModifierFn, not created in generate code. Fixed.
Referer security check for https now working.
Property errHideMessages was set wrongly, so severe error messages were also hidden. Fixed.
Misc fixes for PHP 4.1.0 compatibility.
Implemented remote scripting that allows dynamic select fields in search and edit using # in lookupLens.
Added properties phplensDatabase and remoteQuery.
Added LENSIDPREFIX constant.
Added LENS_MD5_SALT constant.
Added urlParams property and autobookmarking.

== 1.3.14 14 Jan 2002
Fixed some bugs in sizing of input tags.
For tables with lots of columns, added PHPLENS_SORTALPHA_COLS, which will cause
	the cols to be sorted alphabetically if table is at least this number of cols
	when dynamicly editing cols
Added readOnlyFontPrefix and readOnlyFontSuffix properties for readonly text.
Old fields were not cleared properly when saving applets.
Added property keyColVariable.
You can change the column title in the filter column screen.

== 1.3.13 19 Dec 2001
Autogenerated code works with autoGeneratedKey and inputMD5 properties
upperCase property to force uppercasing of search text. Requires ADOConnection->upperCase
set to the name of the function to use.
New errHideMessages property - currently, only $lens->txtErrNoRecords is considered a warning
Changed error constants to start from 1 instead of -1. Also added new error constant,
	LENSNOTICE.
Now empty dates are no longer must fill, unless expressly set to must fill.

== 1.3.12 28 Nov 2001
Made filterModifierFn a synonym for filterLikeFunction.
Some databases such as Oracle require generation of integer keys for sequences.
PhpLens will generate the sequence for you automatically if  
	$lens->autoGenerateKey = true;
	$lens->generatedKey will hold the generated value after Render() is called.
Added query/reflection interface to applets.
Now applets can be moved from the applets directory, and phpLens will autodetect.
Added $lens->md5Input = true|false to stop those pathological md5 errors in forms
Fixed some bugs with listing Applets on MS Windows.

== 1.3.11 20 Nov Nov 2001
Added forceType property to change types of fields for display and data entry
	- mostly for changing date to datetime, or numeric to integer.
Added filterAnyWhere property (default true).
Fixed row width being set wrongly in textSizeLens.
Fixed display problems in column settings view.
Added back radio buttons for numeric field input.

== 1.3.10  13 Nov 2001
Added textSizeLens, showSortCols properties. Now the textAreaLens is obsolete.
Check the type of numeric input boxes, and only allow text/checkbox to be selected for inputTypeLens.
 
== 1.3.9   7 Nov 2001
Implemented the APPLET saving code and session support speedup when dynEdit set to false.
            The overhead with the new APPLET code is 0.020 secs for running SQL and parsing 7 fields,
            0.035secs to render 10 rows, 0.070 secs for 20 rows showing grid and details
            on my P3 800 Mhz IIS5 notebook. Excludes script parsing, or DB connection times.

== 1.3.8  18th Oct 2001
Misc fixes to do with pageSize=1 and showGrid=false - unusual behavior.
	Only 1 child editor (for 1st record) will now be shown when showGrid = false and pageSize>1.
	Now no new record child editor when showGrid = false because it doesn't make sense.

Made textareaLens and textAreaLens synonyms.

Added month popup support for dates when N is used instead of M 
	(set the date input mask to "d/N/Y" in phplens-lang-en_us.inc.php)
	
Made no groupLens column error message optional if $lens->lang->txtErrGroupLens is empty.

== 1.3.7
Some more bugs found in lookupLens introduced in 1.3.6. Fixed.

== 1.3.6
Insert new record when in FILTER state will reset to original first state, 
	so that the new record is visible.

Fixes filtering so that lookupLens works properly (when odd number of elements).

Added "select" type to inputTypeLens.

== 1.3.5
When htmlLens = '*', only C and X types should be converted to HTML. Formerly all types
	were converted, which is wrong!

Demo version did not allow data edits. Fixed.

Misc builder improvements.

== 1.3.4
Added 2 new installation test scripts to aid in debugging config bugs. They are 
	testzendopt.php and testconfig.php. Also updated docs.

== 1.3.3
Fixed problem with spEdit and spNew and storing \, the \ not quoted properly. Fixed.

The paths in PHPLENS_GRAPHIC_SERVER not used when editing/new record. Fixed.

When lookupLens and readonlyLens is set for a column, the value is not shown in edit form. Fixed.

Export to text (rawExport property) no longer needs templateGrid. 
	Formerly, pageSize was reset to -1. Now we use whatever the user defines...

== 1.3b2
Fixed some bugs in the calculations of how many radio/check boxes to put per line, and now use nowrap attribute.  Added LENS_INPUT_WIDTH constant to help with this
Added mustFillMarker property.

Transparent coloring did not work properly because of the rowColorLens addition-fixed.

Fixed accidental printing of PHPLENS_GRAPHIC_SERVER variable.

==1.2.23 / 1.3b1

Added $INIT_GRID_FIELDS to set the number of cols to show if no gridLens defined. See phplens.inc.php.
Now nameLens allows {nbsp} to be embedded in the names.

Added new property to modify LIKE matching: filterLikeFunction. Given a column name, will return the 
	like code required. See filterLikeFunction in documentation.
Major rewrite of filtering - found a few bugs
	Added filterAllOr property - set to true  to force ORing of sql where clauses (default is to AND)
	Fixed saving of filter settings so they are retained for the session.

Added new value to showRecNo = 3. This will show RecNo and hide Details grid. 
	Child editor will override this setting.

	
== 1.2 launched 5th October 2001

	
==1.2b22
Fixed editLens/newLens not working when dynEdit=0. This was an optimization from earlier - did not 
	parse these properties when viewing grid - this does not work when a child editor is in place. 
	Removed this optimization.

Under some unusual conditions, the array of checkboxes can be unset. Now we check for this condition.

==1.2b21
Fixed phplens highlighting problem
Checkboxes not visible in search form under certain situations. Fixed.
Property spEdit did not handle keyCol of the form table.column properly. Fixed.
Fixed MD5 fingerprint problem when child editor visible in search form. Clear _editMap everytime before used.

==1.2b20
Fixed text database driver - now permitted in all phplens products, not merely Enterprise

==1.2b19
Fixed recno width to 4% in grid when showHeaders = false. This is because Netscape is brain-damaged
	about col widths.

==1.2b18
Cleaned up editbtn.gif, adding width and height to the img tag.
Cleaned up hide menus code.
ColorLens did not handle single-quotes properly. Fixed.
Improved builder - merged save applet and change id.
Added LAYOUT_ATTR to replace COLORBACKGROUND template variable

==1.2b17
Supporting double byte introduced some compat problems dealing with &amp; Now we convert
	text using LensStrTr() - which should convert ampersand correctly!
Made colorLens a first class citizen, supporting all powerLens vars

==1.2b16
Dynamic editor can manage hideMenus now.
Empty strings checked with strlen( ), to workaround "0" strings not displaying.
DynEdit checks for true, and we reset it to 1 now.
FileComboBox( ) now can handle incorrect paths without failing.
Force canEdit and canNew when childLens is set.
Property overrideFunction not working properly - fixed. 

==1.2b15
Search filter did not size the number of cols in select statement properly. Fixed.
ParseSQL regex did not work for php 4.0.3 - reported by jmzuzan. Patched by ignoring
	GLOBAL array bounds in 4.0.3.

==1.2b14
Added http and https support for varchar

==1.2b13
Added combo
Fixed javascript so mustfill matches whitespace properly
Added jsLens property

==1.2b12
Fixed NN6 problems with delete/edit icon wrapping around
Added support for automatic creatiion of anchor tags for https://abc.com
Must fill now works properly for textareas. Formerly, \n not recognised

==1.2b11
Removed "AAAA A" debug statement in phplens-core.inc.php.
Prototyped iframe support. Works with Mozilla 0.9 and IE 5.5.
Fixed some documentation stuff that was bugging me.
On errors in edit/save, the new form was displayed (should be edit) 
	when childLens new/edit enabled.

==1.2b10 
Cleaned up rowColorLens again and disabled hiliting when no detail grid to maintain compat
	with phpLens 1.0.
Fixed missing <TR> when menus hidden.
MySQL updates on empty char/text fields properly save as empty '' strings now. 1.2b9 fix did not work
Changed LensRowColor() use style.backgroundColor instead of runtimeStyle.backgroundColor
	to maintain compat with Netscape 6.0
Support for dreamweaver (see phplens-dreamweaver.zip file). 
	You can add a phpLens object from the dreamweaver toolbar.

== 1.2b9 30-Aug-2001
String primary keys did not work when updating. Fixed in this version.
	We now autodetect whether the keyVal is string and quote it if needed in sql stmt
Now mysql does not add an extra space to a string update/insert if the string length is zero.
Added templateFilter property when you want to modify the way the search form looks. 
	This completes all the possible template combinations.
Oci8 blob support stopped working because of accidental quoting. Fixed.
Blobs are only treated as images now if htmlLens not set for that column
Oci8 update statements no longer use bind for the primary key because of bug in oci8
The primary key is trimed before we md5 it during updates.
The dynamic editor now supports both only edit and edit+create in detail grid (childLens property).

== 1.2b8 26-Aug-2001
Added $lens->htmlLens = '*'; to mean do not encode any database columns - useful for double-byte chars.
Cleaned up the comments in this file.

== 1.2b7 24-Aug-2001
Resumed testing with NJStar Communicator. Gotta fix those double-byte blues.
	Because double-byte characters include '&', we cannot convert them using htmlspecialchars()
  	so we use strtr() with a patched translation table.
Added default rowColorLens = LensRowColor() function.
Added support for multiple select - egrau suggestion.
Fixed xml parsing bug - extra space added accidentally.

=== 1.2b6
Now  recno is always selected when childLens set.
Only if calendar is used is the iframe tag inserted now!
Problem - oci8 ocibindbyname sets var to null if storing ' '.

=== 1.2b5
Added xmlLens support
Bug fix: htmlspecialchars() called twice if rowColorLens used and powerLens not used (egrau reported).

=== 1.2b4
Added global variable support to powerLens. 
The errorHandler property added.
Added childLens property.

=== 1.2b3
Added rowColorLens property.
changed lookupLens and sql property variable parsing so that it is triggered by %.
Added _HILITE_RECNO_ variable in powerLens and rowColorLens
Made keyTable property dynamic

=== 1.2b2
Reverted oci8 to not use bind variables (set init.ora to CURSOR_SHARING=force instead) because
  blank strings are automatically changed to null -- not desired behaviour in most cases.
lookupLens sql allows variables now.
numeric fields did not become checkboxes when inputTypeLens set to checkbox - fixed
builder/grid now appears to work reliably
added 'LENS_SHOW_TOP_MIN_ITEMS' to control when the Save/Cancel buttons appear in both navbars

=== 1.2b1
added showCancel property.
added _ISEDIT_ set to 'N' or 'E' for new or edit in templates, and set to '' otherwise.
changed checkboxLens to inputTypeLens and added radio and submit support
moved save and cancel to top right when new/edit
added _EDIT_ -> _DYNEDIT_ for dynamic editing (_EDIT_ still means edit button)

=== 1.1b03
Nested templates support added by modifying rn GET variable.
_RECNO_ variable in powerLens added.
Extended textAreaHeader to support different textarea rows and cols for different fields.
Modified template support so that the template compiler works.
Applet concepts more fully fleshed out.

Added templateBaseDir, templateAssign, templateMode properties...

== 1.1b02
now if redirectoninsert and redirectoninsertcancel is set, then no viewing of grid is allowed
added == to lookup value handling for 1 dimensional arrays

=== 1.1b01
integrated popcalendarxp
property sqlBind, checkboxLens, displaySep
property powerEditLens -- if edit field is readonly, then we still update using hidden field. If field
is hidden, then the lens is not executed. Also all hidden input fields are checksummed for security now

added property templateSecure
readonly field is still editable on creating a new record if it is a must fill

== 1.0
reset '_' for $ctl
PHPLens_undomq needed for key in checkmd5 and % in default values disabled becoz no checksum
_InsertSQL set checkmd5 to true

=== 1.28b 
Oracle optimizations. Now we bind SQL variables for highest performance by maximizing
	shared SQL and reducing parsing of SQL statements to the minimum when editing/creating
	records.
Support for bpchar in postgresql.
Default color scheme not working in javascript. Fixed.
Gridbuilder PHP code generation bugs. Fixed.
Property dynUseSessions defaults to true now.

=== 1.27b 5-June-2001
include variables converted to constants for security
Added property templateShowErrors
move this->eventPreInsertField and eventPreUpdateField to Advanced/Ent
powerLensOff to escape powerLens
Changed filterShowGrid to filterShowForm
Add some images to help/img
Improved error handling in testtext.php.
Remove DEFAULT_GRAPHICS_SERVER so people don't change this.
Windows HELP CHM file.
Added toUpper property

=== 1.26b 19-May-2001  
Fixed recno problem in phplens-core2.inc.php

=== 1.25b 16-May-2001
Removed error_reporting(63). 

When in firstState == 'FILTER' mode, creating a new record doesn't reset() anymore.

Added includeHeader and includeFooter properties.

Planning to be IE 6 compatible. Tested - works fine!

Default values not saved properly in 1.24b. Fixed.

Added templateFilterGrid property.

=== 1.24b 14-May-2001
Calendar renderer

Fixed netscape popup bugs. Seems netscape requires the options to be predefined to
calculate the select menu width. So we put in a fake option.

=== 1.24b 11-May-2001
Scroll to end of recordset did not reset the recno properly for mysql. Fixed.

Rewritten mustFill properties to work with javascript.

Fields following text areas did not display correctly. Fixed.

Changed uploading images so that empty upload does nothing.

=== 1.23b
Column offset check did not work for defaultLens. Fixed.

==== 1.22b 7-May-2001
Added Smarty Template Engine support

Changed image labels to from TITLE to ALT tag to support NN.

==== 1.18b 2-May-2001
Htmlspecialchars() called twice in templates. Fixed.

Added multi-column detail table handling.

Fixed javascript validation problem with netscape.

Fixed $dyn2 and $noinput uninitialized var errors.

==== 1.17b: 30-April-2001
Generate PHP code: The first item in a property string is always converted to uppercase. This
is a bug. Fixed.

==== 1.16b: 30-April-2001
Fixed bug in lookups. Did not handle "0" properly because used empty(). Changed to strlen().

Changed eventPost*SQL properties to include primary key of affected record.

Default directory page not index.php on some systems. So set the pagename explicitly.

PageSize=0 to indicate show all records in one page broke in 1.15b. Fixed.

Improved docs.

==== 1.15b : 25-April-2001 
Select with limits properly implemented now. This improves efficiency of paged scrolling.

Clicking on Column Edit Icon bug fixed.

==== 1.14beta 23-April-2001
Hiding filter menu item was flawed. Fixed. 

Used isset() to check where clause string. A mistake. Changed to !empty().

==== 1.13beta  
Searching when the original $lens->sql statement had a where clause did not work. Fixed.

Phplens directory can now be placed anywhere on the web server (relative paths work better now). 
Formerly, had to be in /php/phplens

Double-click checking on the Save button when editing now timeouts after 3 seconds. 
This solves the problem of when you click on Save, then browser Stop, Save would be 
disabled permanently.

When saving illegal email addresses, phpLens now generates clearer error messages.

Error messages when must fill fields are empty now work again.


==== 1.12beta 19-April-2001
Saving of HTML text improved:
-anchor tags entered by user now preserved
-header tags do not have extra BR's appended to it

Bug in msgs.php in forums. Now body field selected correctly.

Error handling on saving of new records was flawed. Fixed.

Dynamic editing interface for charting improved.

==== 1.11beta 03-April-2001
Changed phpLens internals to make installation easier. 

Changed name of Query Builder to Grid Builder to make it easier to newbies to understand.

Making progress with docs. Added security, charting, etc. Edited setup.

==== 1.10beta 30-March-2001
Added anchorTags property to convert http://* and www.* and emails to links.

Fixed dynamic editing so autodetection of primary key works more reliably.

Docs are improving -- still a massive job to document 160+ properties and example code.
*/
?>