or : Why do a lot of your scripts have numbers at the beginning of them?
Jomres uses a unique trigger system to run certain scripts at certain times. These can be identified by a prefix jNNNNNXXXXX.class.php and are known within the system as minicomponents. This trigger system is exceptionally flexible and we believe that it is the reason that Jomres has been able to evolve into such a powerful system. Because the system is designed to be CMS agnostic we cannot use the CMS's own trigger processes, whatever they may be.
We recognise that this trigger system might be unusual to some developers, so this document will describe how the trigger system is used to trigger certain scripts at various times. Some numbers aren't called in a logical order, this is for historic reasons and we are in the process of normalising the system as various areas are reviewed.
Where are they?
The bulk of the scripts can be found in /jomres/core-minicomponents/, however if you have core plugins they are in /jomres/core-plugins/xxxxx, and any third party plugins will be found in /jomres/remote_plugins/xxxxx
Any of these scripts can be overriden by a script of the same name that is placed in /jomres/core-plugins/xxxxx dir, or /jomres/remote_plguins/xxxxx dir. We very rarely override scripts in core plugins however it is common for our users to want to override them and we recommend that they be placed in /jomres/remote_plugins/custom_code ( it doesn't need to be called "custom_code", the choice is up to you ). Once a script is placed in that directory and the registry rebuilt then that version of the script will be used instead. Upgrades to the system will not modify anything in /remote_plugins/.
Script loading priority :
If it exists in /remote_plugins/xxxxx, then that will be used.
Else, if it exists in /core-plugins/xxxxx then that one will be used.
Otherwise, the version in /core-minicomponents will be used.
Key trigger numbers
The most up-to-date version of this list of trigger numbers can be found on Github, here is a basic breakdown and description of most of the trigger numbers.
00001 Set into place various functions that can be overriden, or for other bootstrapping purposes.
00002 Boostraps the system's user information.
00003 Currently used to boostrap the input filtering settings.
00006 Currently only used for sanity checks.
The next three trigger numbers are used to build menu options.
00009 Guest level ( both logged in and not logged in )
00010 Reception level
00011 Manager level
00012 Currently used to build pathways for the host CMS to display. Joomla only is supported, primarily used to interface with routing functionality to build SEO friendly routes
In the past availability calendars were displayed in 00017 & 00018 trigger points. Internally Jomres still calls these trigger numbers to display those calendars, but they're no longer part of the normal page logic.
00017 SRP (Villa/apartments/etc) calendars
00018 MRP (Hotel/B&B/Pension) calendars
00021 Used to insert Jomres specific css files into the system.
00030 Search. This script is used when searching is performed by various modules or widgets.
00035 These scripts are used to built tab contents in the property details pages. Again, this numbering is not generally used in normal page logic.
00060 This is used to build the top template, which is at the very top of every page and used to output many different things such as logos, sanity checks etc.
00061 This is used to build the footer template(s).
The next three numbers are typically used when amending bookings or configuring other data, before the page is loaded properly.
00501 These trigger numbers are used for building tabs in the Property Configuration page.
The next trigger numbers are used when building the property list/search results page.
00042 Used by plugins to inject property information into property details, that otherwise isn't built by the script. Not currently used, but available.
07015 is used by the Jintour plugin ( and optionally other plugins ) to advise if this property's price will be supplied by the Jintour plugin's code.
01004 Differing list views ( Photo/Map/List/Swipe) are bootstrapped by this trigger number.
01008 Not used, but available.
01009 Used to build the sorting options seen at the top of the search page, and also performs sorting of properties returned by search functionality.
01010 Displays the results of searches.
01011 Used by 01010 to receive information about discounts
01012 Not used, but available.
Trigger numbers 01025 through to 04910 largely point to specific tasks in the system which will eventually be refactored to 06001 or 06002 tasks, so I will not describe them all, however some are worth noting here.
01050 Builds the Google maps output which is used in property details, edit property details, extended maps and other scripts.
03000 When a booking is inserted, if it's an amendment this ensures that overrides are pushed to the booking details stored in the tmpBooking object.
03020 Actually performs the booking creation after payment ( where valid )
03025 Creates the invoice that corresponds to the booking.
03030 Shows the booking completed message.
03100 Sends emails to managers, guests and admin to update each on the new booking.
03150 Various email scripts.
03200 Triggers 07005 & 07010
07005 Optional minicomponent trigger, eg for system cleanups or other pre-booking activity
07010 Allows us to run post insertion functionality for importing into foreign systems. Currently used for inserting commission line items
03379 These scripts are used by the media centre to configure media uploading options.
03381 Media centre uses these to determine individual ids for uploading of resource specific images.
03383 Media centre uses these to determine images that already exist for specific resources.
04901 This trigger is used when a new property is created, typically for sending welcome emails
05000 level scripts are generally used by the booking engine. A new booking engine is being planned and these will likely not be used in the future.
06000 These scripts are individual tasks that can called that do not require a user to be logged in. The bulk of these scripts are used for displaying public/guest facing output.
06001 These tasks are for Reception level functionality. Jomres includes Access Control functionality, however we find that a more simplistic approach suits the vast majority of users.
06002 These tasks are for Manager level functionality.
06005 These tasks/scripts are for pages that can be viewed by any registered and logged in user.
07020 Used for building notification badges in the site manager menus.
07060 Used for building manager FAQs.
07070 Used for building administrator area FAQs.
07080 Used for building guest FAQs. Whilst the code to support these in place, currently there are no guest level FAQs.
99994 Post run scripts are run here, for example the Channel Manager functionality has a watcher for here, and webhooks are triggered at this point.
These triggers are used for creating the Jomres main menu.
99999 Anything that needs to be done right at the end of a run.
10001 Builds the control panel.
10002 Administrator menu options.
10003 Administrator control panel menu generation
10004 Builds the control panel.
10501 Site Configuration tabs.
11010 Administrator area Media centre resource options.
16000 These are similar to the 06000 tasks in the frontend.