menu_banner (2K)

dict_table(generate)b - Generate PHP scripts (b) - Enter details

dict_table(generate)b (8K)

The purpose of this function is to generate the PHP scripts which will provide access to the selected database table using the Transaction Pattern which was selected in the previous screen. Skeleton scripts are obtained from the default directory, modified, then written out to the directory which is specified on the subsystem record.

Depending on which pattern was selected different combinations of the following fields will be presented:

Task Id The identity of the entry that will be created on the MNU_TASK table of the MENU database. This will default to <prefix><table>(<pattern>), but can be changed if required.

If the table name already contains <prefix> it will not be added again.

If the pattern is LIST 1 an entry will also be added to the MNU_MENU table so that the task can be activated without the need for any additional steps.

Script Id The identity of the component script that will be created in the file system directory for this subsystem. This will default to <table>(<pattern>).php, but can be changed if required.
Screen Structure The identity of the screen structure script that will be created in the file system directory for this subsystem. This will default to <table>.<pattern>, but can be changed if required.

When a database table is specified the screen structure script will by default include every field from that table, but this script can be modified as required. Should the generate procedure be rerun any existing files will NOT be overwritten, so any customisations will not be lost.

Table Name This will be read-only, and will show the target table that was selected in the previous screen.
Table Alias It is possible for a table to be related to itself, which means that in a one-to-many relationship the same table will need to be referenced twice. As explained in How can you deal with a table that is related to itself? you will need to give one of these references an alias name so that the data can be correctly identified in the XML document. You can use this field to enter that alias name.
Outer Database This is only available if 'Outer Table' exists. This identifies the database from which the list of 'Outer Table' names will be obtained. By default this will be the current database, but it can be changed by pressing the popup button. Upon return the list of table names will be reconstructed from the specified database.
Outer Table Any combination of these additional tables may be required depending on the selected pattern.

Where more than one table name is requested they must have a suitable relationship defined. Each relationship is for a one/parent/senior table and a many/child/junior table which is expressed using the senior=>junior notation. These relationships must be as follows:

  • outer => inner
  • outer => middle => inner
  • Outer => link <= inner
  • Outer => inner <= popup
Link Table
Inner Table
Child Forms In some cases the selected pattern is the parent form in a family of forms, in which case a series of child forms will automatically be created and added to the parent form's navigation bar.

In most cases only one set of child forms is possible, in which case the list will be read-only. In other cases the user must make a choice from the possible options.

When the child tasks are created all task id's, script id's and screen structure files will use the default naming conventions as described above.

Popup Table This only appears if the CHILD FORMS entry contains a popup. It will be used to automatically create a popup task for the selected database table.

This form is accessed from the Generate PHP Scripts (a) screen by pressing the 'Submit' button in the action bar.

For a complete description of how this type of function works please see Transaction Pattern UPDATE 1.