Change log:
-----------

Version 1.5.4 (2007-10-29):

    - Bug 1060:

      Nr          : 1060
      Title       : Run time error in aggregate functions
      Description : A run time error in the aggregate functions of the report
                    generator like SUM, AVG and STDDEV occurs in the following
                    situation:
                    
                      - the report is based on a LEFT OUTER JOIN;
                    
                      - there is no record for the right table, i.e. nulls
                        are returned for the right table;
                    
                      - the aggregate function is applied to an attribute of the
                        right table.
      Type        : error
      Priority    : medium
      Against     : 1.5.3
      Promised    : 1.5.4
      Solution    : Modification on aggregate functions SUM, AVG and STDDEV
                    such that null-values are ignored. So, for AVG and STDDEV
                    they are also ignored for counting the number of values.
      Originator  : wim
      Date        : 2007-10-29


Version 1.5.3 (2007-09-22):

    - Feature request 1059:

      Nr          : 1059
      Title       : Readonly attribute with default initial value
      Description : It would be nice to have the possibility to set an atrribute
                    "tgReadOnly" and still have it assigned the initial default
                    value defined in the form definition. At the moment that is
                    not possible because "tgReadOnly" attributes are not
                    considered attributes of the form's main table.
      Type        : enhancement
      Priority    : medium
      Against     : 1.5.2
      Promised    : 1.5.3
      Solution    : Change 1 statement in proc getAttributes:
                    
                    statement in 1.5.2:
                    
                    if { ![string equal $typeofget {tgReadOnly}] } then {
                        lappend tableAttribList $attribute
                    }
                    
                    statement in 1.5.3:
                    
                    if { ($typeofget ne {tgReadOnly}) || ($defVal ne {}) } then
                    {
                        lappend tableAttribList $attribute
                    }
                    
      Originator  : Mark Hindley
      Date        : 2007-09-18

    - Correction: In the ::gen:: module there where a number of
      statements with "upvar 0". Although I have never seen the
      procedures ListBox or TextEdit fail in pfm, I think now, after
      reading the tcl documentation again, that it should be "upvar #0"
      instead of "upvar 0".

    - New feature: The TextEdit window now also has a "Find string" function.

    - tclkit 8.4.13 has been upgraded to version 8.4.15


Version 1.5.2 (2007-08-21):

    - Bug 1057: convert_from_1.2.0.sql script fails on PostgreSQL 7.4

         The convert_from_1.2.0.sql script fails on PostgreSQL version
         7.4. on two statements:

             1. UPDATE pfm_form SET help = E'The data returned by the
                report''s SQL SELECT statement may be considered as a
                table with a column for each ''field'' specified after
                the ....'

             2. ALTER TABLE ONLY pfm_form
                ADD COLUMN sqlorderby text,
                ADD COLUMN sqllimit text;

         Solution:

         1. Instead of using the E'....' syntax, convert_from_1.2.0
            now uses the standard SQL syntax: string is delimited by
            single quotes, single quotes within the string are doubled
            and strings of more than 1 line are also written as
            several lines instead of using "\n". Example:

            UPDATE test
            SET poem = 'Wee, sleekit, cow''rin, tim''rous beastie,
O, what a panic''s in thy breastie!';

            This makes it necessary to change the ConvertToUTF-8
            procedure in pfm.tcl as well.

            When pfm runs the convert_from_1.2.0.sql script, it
            creates a temporary file which is the result of converting
            the character encoding to UTF-8.  This temporary file is
            made using the standard tcl procedures "open" and "puts".

            These procedures normally use the platform specific
            conventions for creating text files. Hence, on Windows the
            temporary file uses CR LF as line endings. When this
            temporary file is offered to psql with "i", psql
            recognizes the LF as line ending, but interprets the CR as
            an extra character of the string.

            To avoid this problem, the procedure "ConvertToUTF-8" in
            pfm.tcl is changed.  The statement

            fconfigure $outFile -encoding utf-8

            is changed to

            fconfigure $outFile -encoding utf-8 -translation lf

         2. Make two statements:

            ALTER TABLE ONLY pfm_form ADD COLUMN sqlorderby text;
            ALTER TABLE ONLY pfm_form ADD COLUMN sqllimit text;

    - Bug 1058:

      If the user switches mode (normal / design) while a form is open
      and the user then does any operation on the open form, a run
      time error occurs.

      This is caused by the fact that the global variable formsArray
      is only filled with the forms that also appear in the listbox on
      the main window.

      To avoid this problem, the procedure refreshFormsList is
      modified such that formsArray is filled with all the forms,
      regardless of the mode (normal/design).



Version 1.5.1 (2007-02-27):

    - Bug 1054: Error in locateRecord:

           When returning from a link and when there are no records
           left in the form that is about to be opened, "locateRecord"
           fails because "match" is a non-existent variable when
           executing "if {$match}" just after the for loop.

      A "set match 0" has been added before the for loop.

    - Bug 1055: Focus not visible in Windows version:

          In the Windows version, it is not clear which entry has the
          input focus.

          This makes it impossible to to use the form without using
          the mouse.

      The option "highlightThickness" has been set to 1.

      This was the default on UNIX platforms, but not on Windows.

    - Bug 1056: Run time error when closing Reports window.

          Sometimes closing the "Reports" window causes a run time
          error at

              set ::report::windowSize(.report) \
	           [string map {{+0+0} {}} [wm geometry .report]]

          in proc cmdReportSQL.

          It is not reproducable.

      I assume that it is caused by the fact that this statement,
      which is bound to the <Configure> event on toplevel .report, is
      executed sometimes after .report has already been destroyed.

      Therefore a "catch" has been added, to avoid raising a run time
      error.

      The same has been done for all statements boud to <Configure>
      events.


Version 1.5.0 (2007-02-13):

    - The designer of a form can define a default ORDER BY clause
      which is displayed in teh "Open form" window when the user opens
      a form.

    - The designer of a form can limit the number of records loaded
      into the form's internal buffer. This makes it possible to
      handle large tables without using a lot of memory. 

    - When working with forms, it is possible to open several "Expand"
      windows simultaneously.

    - The options editor has been made more user friendly.

    - The report generator can now handle mult-line data in a table
      layout also.

    - You can specify a maximum line length for data displayed in a
      report. When data exceed that maximum, one or more line breaks
      are inserted before printing the report. This feature, together
      with the previous one makes the report generator much more
      usable.

    - There is an automatic update on the pfm_tables when you start
      using version 1.5.0 on a database that has already been used
      with a previous version of pfm.

    - Many windows have resizable panes now.

    - You can use the mouse wheel to scroll the form canvas now.


Version 1.4.3 (2007-01-10):

    - Bug 1052 solved: pfm hangs when quiting, in some versions of
      Tcl/Tk.

    - Version 3.0.1 of pgintcl replaces version 3.0.0

    - Version 8.4.13 of Tclkit replaces version 8.4.11

    - The pfm project has moved to pgFoundry at

      http://pgfoundry.org/projects/pfm/

    - There is a new option, called 'fontstyle', which determines
      whether the fonts for menus, buttons, labels and listboxes are
      'bold' or 'normal'. The default is 'normal'. So, UNIX users will
      notice a difference with respect to earlier versions. They can
      go back to bold fonts by setting this option to 'bold'.

    - The options editor now has a font chooser, which makes it easier
      to modify the 'fontmonospace' and 'fontproportional' options.


Version 1.4.2 (2006-07-05):

    - Bug 1049 solved: When the form for a view is displayed,
      the Record menu is disabled now.

    - Feature request 1050: When pressing [Update] or [Add] on a form,
      the input focus should stay on the same attribute entry.

      Similarly, when pressing [OK] or [Cancel] when updating or
      adding a record, the input focus should stay on the same
      attribute entry.

    - Feature request 1051: The open form window should also have a
      Form -> Close menu.

    - The "relief" of the attribute name labels on the form window has
      been changed to "sunken".

    - I have finally discovered how to get a meaningful result from
      the canvas "bbox" command. First call "update" before calling
      the canvas "bbox" command. That has been used to get the correct
      size for the canvas scrollregion in displayAttribLabels and
      displayAttribEntries.

    - The scrollForm procedure has been reworked. The attribute with
      input focus now stays nicely in the visible part of the canvas.


Version 1.4.1 (2006-07-01):

    - The user interface has been modified to make it possible to
      operate pfm without using the mouse. See text file
      mouseless-operation.txt in the doc sub-directory.

      Acknowledgement: I hereby thank Mark Hindley, who has suggested
      ---------------  to improve pfm in this area. Many of his ideas
                       have found their way into this version.

    - The window that used to be called "Query mode" of form, has been
      renamed to "Open form" window, and the so called "Paste buttons"
      have been moved to 2 menus which can be invoked by 2 buttons:

          o paste attribute Names; and

          o paste attribute Valuse.

    - The help file has been updated accordingly.

    - The help file's layout and structure has been reworked. It now
      uses a less poor html. On browsers that support frames, the
      table of contents is displayed in the left frame and the body of
      the document is displayed in the right frame.

Version 1.4.0 (2006-06-13):

    - This a preliminary version for evaluation and testing.

    - The user interface has been modified such that there is less
      need for to user to use the mouse. See text file
      mouseless-operation.txt in the doc sub-directory.

    - The help file has not been updated yet.

    - This version is only available for UNIX platforms.

Version 1.3.0 (2006-05-29):

    - On UNIX and Linux systems, pfm now uses the UNIX "cat" utility
      instead of the "cat.tcl" script. This removes the necessity to
      have the tclkit installed on UNIX systems on which pfm runs in
      the system's native Tcl/Tk environment. The README.txt file has
      been updated accordingly.

    - On UNIX and Linux systems, pfm now has a configuration file
      named pfm.conf which defines values for some configuration
      parameters. It resides either in pfm's installations directory
      or in /etc.

    - The files in the distribution have been moved to other
      subdirectories to ease the derivation of a Debian package.

    - There are 2 new menu items in the Tools menu:

          o install pfm_* tables
          o install example database.

    - The user is no longer asked whether to install the pfm_* tables
      when a database is opened that does not contains them yet.
      Instead, a warrning that the pfm_* tables are not installed is
      issued and a hint is given to use the "Tools -> Install pfm_*
      tables" or the "Tools -> Install example database" menu.

    - The Tools -> Install example database menu eases the
      installation of the example databases.

    - When importing an SQL-script in the RunSQL window, the user can
      now also select the character encoding with which the SQL-script
      was made.

    - The help text has been enhanced and corrected on several
      locations:

          o help text for pfm_form was corrected, also the help text
            inside pfm_form. In particular, the statement that a form
            has a one-to-one relation with just one table was wrong. A
            form can only administer the data of one table, but it is
            possible that there are more forms for the same table.

          o Modifications to document the new features.

    - Some menu items have become context aware:

          o Database -> Close is disabled when no database is open.

          o Database -> Open ... is disabled when a database is open.

          o Install Tools -> Install pfm_* tables and Tools -> Install
            example database are disabled when a database that already
            contains the pfm_* tables is open.

    - pfm no longer touches the pfm_* tables when it finds an older,
      compatible version. In this way older, compatible versions of
      pfm can continue accessing databases that have been accessed by
      this version of pfm. Similarly, when installing the pfm_tables
      or an example database and when converting a database of
      versions before 1.2.0, pfm marks the pfm_tables as belonging to
      version 1.2.0 (the earliest compatible version). In this way,
      older, compatible versions of pfm can access databases that have
      been made with this version of pfm.

    - E-mail address for sending bug reports has been changed in
      README.txt and it has also been added in the 'Help -> About'
      response.
        

Version 1.2.5 (2006-01-04):

    - Bugfix: The layout of a multi-section report was wrong if 2
      consecutive records have the same values for the fields of a
      higher numbered section but different values for the fields of a
      lower numbered section.

Version 1.2.4 (2005-12-28):

    - The default value for the option "browser" has been modified to
      "firefox %s" in the case of UNIX.

    - On UNIX, the browser command is now implicitly run in the
      background so that the pfm user interface is not blocked by
      calling the browser. So, it is no longer necessary to end the
      browser command with a "&". On Windows, that was already the
      case before.

    - Version 8.4.9 of the tclkit has been replaced with version 8.4.11.

    - The ".gif" files of the on-line help have been converted to
      ".png" format.

Version 1.2.3 (2005-04-18):

    - Version 2.2.0 of pgintcl has been replaced with version 3.0.0.
      This new version of pgintcl allows the use of database character
      encodings other than LATIN1.

Version 1.2.2 (2005-02-06):

    - Bug solved: Application error when trying to scroll the text
      widget of the SELECT statement in the open form window.

Version 1.2.1 (2005-01-22):

    - Corrections in help text.

    - Modification in database conversion from 1.2.0 to 1.2.1 such
      that it does not use the keyword "DEFAULT" as value for INSERT
      ... INTO. This to be compatible with older versions of
      PostgreSQL.

    - On Windows platforms the ~/.pgpass file is moved and renamed to

      %APPDATA%\postgresql\pgpass.conf

      where APPDATA is the environment variable which points to the
      user's application data. Usually that is

      C:\Documents and Settings\<username>\Application Data

    - Similarly on Windows platforms, the ~/.pfmrc file is moved and
      renamed to:

      %APPDATA%\pfm\pfm.conf


Version 1.2.0 (2005-01-10):

    - Previous versions of pfm relied upon the 'oid' for updating
      records. However, according to the PostgreSQL documentation the
      uniqueness of the 'oid' is not guaranteed, even not within a
      table. To solve this problem, a new attribute 'pkey' is
      introduced in pfm_form. This attribute should be filled with the
      space separated list of primary key attributes of the form's
      main table. If that table does not have a primary key, then the
      table cannot be modified.

      For databases already managed with a previous version of pfm,
      the database conversion script fills 'pkey' with 'oid'. This
      means that pfm continues to work with the oid if you do not
      change it manually. You can continue to use the oid as pkey, but
      then it is recommended to add a UNIQUE constraint on the oid.

    - In the previous versions of pfm you could assign the default
      value to an attribute when adding a record by typing an '=' sign
      for the attribute value. This feature has been replaced by
      another, more advanced feature. You can now define a default
      value for an attribute in pfm_attribute. If that value begins
      with an '=' sign, it must be an SQL SELECT statement that
      returns exactly one value. This replacement was done, because
      the old one did not work properly with attributes that were
      mentioned in the 'pkey' list.

      Note: The automatic conversion script does not automatically
            fill the 'default' attribute of pfm_attribute. You may
            need to fill out this attribute manually after the
            conversion script has run.

    - Enhancement of the report generator. It is now possible to print
      summaries at the end of the report or report sections. These
      summaries are calculated by means of aggregate operators COUNT,
      SUM, AVG, STDDEV, MIN, or MAX applied on the fields of the
      report.

    - The "Import SQL" feature can now also use the psql '\i'
      command. This was necessary because the SQL script for
      converting to the new format of the pfm_* tables turned out to
      be too long to run from the SQL text window.

    - There are a few new options:

          o 'tempdir' defines a directory where pfm can write
             temporary files. The default value is '\tmp'.

          o 'psql' defines where pfm can find the 'psql' executable.

          o 'fontmonospace' defines the monospace font famlily and size

          o 'fontproportional' defines the proportional font family
             and size.

    - There is a context menu which pops up when the right mouse
      button is clicked. It has the classic 'Copy', 'Cut' and 'Paste'
      menu items and can be used to move/copy text to/from the
      clipboard.

    - pfm now fully supports the ./pgpass file, including the '\:' and
      the '\\' escapes.

    - the buttons on the left of the form, labeled with the attribute
      names, can be used to search the internal buffer for records
      with a particular value for the corresponding attribute;

      Note: Only the internal buffer is searched. If the record you
            are looking for exists in the database but is not loaded
            in the internal buffer, it cannot be found in this way.



Version 1.1.1 (2004-11-24):

    - Wrong status of "After Last" after adding a record

      After adding a record the status of the dummy record after the
      last one is put to "After last". However, all the cases in which
      pfm checks for the status of a record, it only checks for "After
      Last". The result is that the "Update" button is not disabled
      when the dummy "After Last" record is displayed. If that button
      is pressed, a run-time error occurs.

      Solution:

          The spelling of the statuses has been reviewed. They are now
          all with only the first word capitalised. They are :

          Not modified
          Updated
          Added
          Not added
          Deleted
          After last
          Adding
          Updating

          The last 2 ones have been added to remind the user what he
          is doing after having pressed [Add] or [Updated]
          respectively.

    - Links are still enabled when in Updating or Adding mode:

      When updating or adding a record, the link buttons are still
      enabled. Although nothing wrong seems to result from it, it
      would be cleaner if they were disbaled.

    - Problem with pfm.kit when glibc has version 2.2.5:

      The pfm.kit included in pfm 1.1.0. does not work with glibc
      2.2.5. It requires glibc 2.3.

      Solution:

      pfm has been reworked such that it does not require Iwidgets
      anymore.

      pfm used Iwidgets mainly for getting scrollable text and listbox
      widgets. These can be made, with a little extra effort, in pure
      Tcl/Tk. A workaround has been implemented for simulating a
      scrollable frame which is absent in pure Tcl/Tk. The on-line
      help which used the scrolledhtml widget has been replaced with a
      call to an external html-browser. There is a new option, which
      allows the user to choose the external browser.

      The advantage is that pfm.kit no longer contains binary files,
      which enhances its portatbility.


Version 1.1.0 (2004-11-11):

    - Option "usePGPASSWORD" has been added. It determines whether pfm
      uses the environment variable PGPASSWORD to store the password
      entered by the user during the short time between clicking 'OK'
      on the 'Open database' window and the actual opening of the
      database. If this option is 'no', the user is not prompted for a
      password when opening a database, but then a properly configured
      ~/.pgpass file is required.

      Notes:

          o This option was added because, according to the postgreSQL
            documentation, the use of the PGPASSWORD environment
            variable is deprecated for security reasons.

          o The default value for this options is still 'yes', for
            backwards compatibilty and for getting started more
            easily. Consider changing this option to 'no'.

          o For connecting to postgreSQL via the Tcl interfaces Pgtcl
            or pgin.tcl, pfm reads the .pgpass file and supplies the
            password to postgreSQL via the "password" connection
            parameter. This was necessary because pgin.tcl ignores the
            pgpass file.

          o pfm supports the "\:" escape sequence in ~/.pgpass, but
            not the "\\" escape sequence. 

    - The connection parameter and option "hostaddr" have been dropped
      because psql does not have a matching "--hostaddr" option, which
      led to a behaviour that was difficult to understand and which
      was unnecessary complicated.

    - Behaviour of 'Run SQL' command history was improved again. In
      particular, the input screen is cleared automatically after
      pressing 'Run'. This saves the user pressing 'Clear' after every
      'Run'. In the case that he wants to see and reuse the command,
      he can do so by pressing 'Back'.

    - It has been reported (see bug 935) that pfm does not work with
      older versions of postgreSQL. The problem is probably only
      install_pfm.sql, which has been generated by pg_dump of 7.3.2.,
      but which is not understood by older versions of postgreSQL.
      install_pfm has been modified such that it probably also works
      with version 7.2.1. of postgreSQL.

      Note: I cannot test this myself, because I don't have access to
            a version 7.2.1. I would be quite happy to receive
            feedback on this.

      The views pfm_table, pfm_table_def and pfm_table_report have
      been dropped.

    - The help file has been improved on serveral points.

    - The report definition has changed significantly. The attributes
      'table_or_view', 'sqlwhere', and 'orderby' of pfm_report have
      been combined into one attribute 'sqlselect' which may contain
      parameters that are entered by the user at run-time. This
      enhances the user's possibilty to introduce run-time parameters
      for the report, and there is no need anymore to create a view
      for designing a report.

    - The menu-item "Tools -> Install pfm-* tables" has been
      dropped. Instead, the user is prompted to install the pfm_*
      tables when opening a database that does not contain them yet.

    - When opening a database containing the pfm_tables generated by
      an older version of pfm, the user is prompted to convert them to
      the new format.

    - An addressbook sample database has been added. The sample
      database of version 1.0.4. has been renamed to customerdb.
     
    - The groupby_having attribute of pfm_form has been renamed to
      groupby. The reason is that no HAVING CLAUSE should be specified
      in the definition of the form. The WHERE clause specified by the
      user when opening the form is automatically converted to a
      HAVING clause if there is a GROUP BY clause in the form
      definition.

    - pgintcl versions 2.1.0 and 1.5.0 have been included in the
      distribution.

    - Tclkit for linux on PC is included in the distribution.

    - A GUI install script is included in the distribution (only for
      Linux on PC).

    - Bug 1048 Encoding problems:

      When pfm uses pgintcl to communicate with postgreSQL, the
      special characters like , , etc., typed on the Run SQL input
      screen are not correctly entered in the database.

      This is the situation in version 1.0.4:

          If Pgtcl is loaded, it sets the environment variable
          PGCLIENTENCODING to "UNICODE". When pfm subsequently calls
          'psql' for the 'Run SQL' feature of pfm, 'psql' also assumes
          client_encoding "UNICODE". Therefore, pfm sends data with
          encoding UTF-8 to 'psql'.

          If pgintcl is loaded, the environment variable
          PGCLIENTENCODING is not set.  When pfm subsequently calls
          'psql' for the 'Run SQL' feature of pfm, 'psql' assumes the
          same encoding as the database, e.g. LATIN1, but since pfm
          still sends the data with encoding UTF-8, there is an
          encoding mismatch between pfm and psql.

      Solution in version 1.1.0:

          After loading pgintcl, pfm also sets the environment
          variable PGCLIENTENCODING to "UNICODE".


Version 1.0.4. (2004-02-19):

    - Bugs solved:

          o 690: pfm hangs when psql exits

          o 691: The' Run SQL' command history behaves strangely
                 sometimes

          o 692: Printing fails if title contains several words

    - Feature request implemented:

          o 693: Character encoding for sending text to print command


Version 1.0.3. (2004-02-16):

    - Bug 686 solved: Connecting to psql fails in some cases:

      Database name, host or hostaddr, port, user and password
      specified by the user at database open are reused for invoking
      psql.

    - psql is invoked in a different way now: it is invoked when a
      database is opened and it is closed when the database is
      closed. The result is that the state of psql is no longer
      cleared after each command sent to psql.

    - The 'dblist' option is no longer read from the pg_database table
      when the options are reset to their default values. The default
      is now a list containing only the database with the same name as
      the user's logon name.

    - When opening a database, the user can either type the database
      name directly or select it from the 'dblist' option. When the
      database is successfully opened, the name is added to the
      'dblist' option if it was not already in it. The name of the
      last opened database becomes the default database for the next
      'open database'.
      

Version 1.0.2. (2004-02-12)

    - Bug 679 solved: Transaction kept open for too long.

    - Bug 680 solved: Updating a record already deleted by another
      user.

    - Contact information in copy right notices changed.

Version 1.0.1. (2004-02-06)

    - E-mail address in copy right notices changed back to personal
      E-mail because pfm-comments mailing list was out of order.

Version 1.0.0. (2004-02-05)

    - First published version