For developers

This section is intended to developers in charge of maintaining the Green Book source code, and it is aimed to help in the understanding of certain implementation concepts.

Notice that, starting on version 0.87, the project was rebranded "Green Book". However, "Circuit Tables" is still the code name for this project, so you will see that name in the source code and internal documentation.

Frames implementation

Frames have dual existence: they are locations as well as devices. "Locations", because they hold other locations (slots) so they are including in the locations tree. They are also "devices" because, unlike pure locations, they have device attributes such as: Manufacturer, Model, Serial Number and Ports.

This duality is implemented with separate records: one in the devices table and the other in the locations table. When a frame is created, the two records are created at the same time. They relate to each other by the mean of the field devices.locfr which points to the corresponding locations.locid.

FRAMES is also a built-in Device Type (pre-populated in the devtypes table) which devtyp ID is referred in code by the constant DEVTYP_FRAME defined in script lib_class.php, currently with value 2.

Care is taken in code to prevent the user from deleting that dev type from Entities. In general, built-in database values (those which primary key is less than SEED_ID, currently 101) are restricted from general use.