This patch extends the LBF plugin functions. We use this code for LBFs that let us create pre-configured procedure orders with a single checkbox or record shots and in the background record immunizations, reduce inventory and update billing by selecting 2 fields. Hopefully others will find more creative ways for their situations.
If a field option is set to ‘F’, plugin will completely manage that field content and layout. (Current list of options is misleading and hardcoded. Options.inc was changed to make an array available in case anyone decides to use it).
Pre and Post save hooks provide additional control over saving of LBF data and subsequent workflow steps.
Function generate_select_list is extended to accept a SQL statement (with 3 columns to maintain comparability) and return dropdown html code.
A sample plugin template is included showing invoked functions.
This code contains references to ‘features’ based on earlier patch. If that patch is not present, fancybox functionality in LBF will be impacted as the code assumes latest fancybox addon availability. The code also invokes jquery-ui addon to render different groups as tabs rather than checkboxes.
This is an interesting notion although I personally dislike the architecture of the LBF plugin injection mechanism where by javascript is dynamically “echo’d in” to the page. It makes developing the javascript you want to use in the first place more difficult as it becomes a string literal instead of javascript which the IDE can still syntax highlight and such.
I took a different approach where by pure javascript can be managed in a separate file and then added to the page.
The browser can also cache the .js for you where by the “echo method” requires additional server cycles to manage every time the page is accessed.
To each his own. I kind of like the idea of a plugin being in a single self-contained file and tend to doubt that the overhead of echoing / not cacheing would be noticeable. Also I’ve had trouble in the past with browsers continuing to use cached JS even when a newer .js file is on the site.
I’m pleased to see others working on LBF improvements, and will try to find some time for code review this evening.
Kevin, Each of 4 new functions introduced here are full extensions of LBF core that allow us to use standard php libraries to implement installation specific workflow functionality. js hooks are needed for us to add JSONP links in LBFs.
See my github comment regarding being stuck since based on a commit/feature that is not yet in the official codebase. Once that issue is dealt with (either getting the feature in or not using the feature), then will try to get Rod to go through it again.
I added a couple of comments. Main thing is, for now, to leave the option to use the original layout instead of tabs. If nobody complains about tabs we can take out the old method later.