Wednesday, November 9, 2011

More Bespoke Plugins for BB2.0 : Controlling Fields

For PHP developers there are many ways in which you can control and manipulate the outcomes of system processes within BlueBox2.0. One of these is via our plugins architecture.

The newest feature in this regard is the ability to intercept and control fields and the way they display in forms as well as other outputs (ie views and viewlists).

Interception can take place at 3 levels for form-fields and for displaying variable values.
  • Level 1: Global level - whenever the variable is 'called' it will look to your new method to render it to the engine.
  • Level 2: Class/variable level - whenever the variable is called from forms within a specified class it will look to your new method to render it to the engine.  
  • Level 3: Field level - specified using a naming syntax within the variable name, your method will only be called when your specific custom named variable is called.
  • For Form Fields:
    • Within the BB2 Forms Engine we have a function which renders form-fields to the GUI engine. At it's simplest form it can be called with a BB2.0 Tag like this:
      <!--:formfield:variable_name:-->
    • These new plugins essentially hi-jack the process that is invoked by this tag and allow you to determine what form-field element/s get rendered to the GUI when this variable is called
    • To change the form-field globally for a variable name (ie cashbookISbb_finance_cashbooksID) you can use the class->method call within bb_plugins.php. To do this you will need a bb_plugins.php file in your custom_modules folder and then you will need to name/format your function as follows:

      function formfield_cashbookISbb_finance_cashbooksID($conf=NULL){
            //the value of $conf is an array with useful data in it
            //most notably $conf[default] which is the current value, if any, for this variable
            //for the full array simply resp_r($conf) at this point...
            return("
                         <input
                                id=global[fields][cashbookISbb_finance_cashbooksID]
                                name=global[fields][cashbookISbb_finance_cashbooksID]
                                value='$conf[default]'
                          >");
      }


      In the above example you can see that you need to return a string with a form element in it, but this can be any combination of html, javascript, etc instructions. Basically, wherever this variable is called through the forms engine, this will be sent back to the form as the 'field'.
    • For a specific class/variable combination by using a bbsetting, namely bbsetting_field_display_formfield_plugins. This can be set within a PHP file as follows:

      var $bbsetting_field_display_formfield_plugins=array("field_name"=>"method_to_call");

      or it can be set using the Admin>Module Settings functionality by entering the field=>method pairs separated by commas ie:

      field_name=method_name,
      field_name2=method_name2,

      You can set multiple field=>method values within this array. The 'method' can then sit within the bb_plugins class or the parent class where the bbsetting has been set, either place will work. The method can be styled exactly as per the function example above. So, just to drive the point home, in this instance, if the bbsetting was set in the bb_finance_cashbook_entries class, then only when forms within that class are rendering the cashbookISbb_finance_cashbooksID will this form-field override take effect.
    • On an ad-hoc basis within the variable/field name itself, by using the variable naming syntax as follows : variable_nameISPLUGIN_method_name. This behaves exactly as per the second example above, whereby it looks for the method within the bb_plugins class or, if it can detect a current related class to the variable, within the current class. The method can be styled exactly as per the function example above.
     
  • For Field Value Display:
    • Within the BB2 GUI engine we have a function called item_display_value. This takes an input in the form of an array which specifies the variable name to display and any possible value/s for it. The function then determines how to render the variable/value to the GUI engine.
    • These new plugin options essentially hi-jack this process and override the renderer with your bespoke method.
    • To change the form-field globally for a variable name (ie cashbookISbb_finance_cashbooksID) you can use the class->method call within bb_plugins.php. To do this you will need a bb_plugins.php file in your custom_modules folder and then you will need to name/format your function as follows:

      function item_display_value_cashbookISbb_finance_cashbooksID($conf=NULL){
            //the value of $conf is an array with useful data in it
            //most notably $conf[1] which is the current value, if any, for this variable
            //for the full array simply resp_r($conf) at this point...
            return($conf[1]);
      }


      In the above example you can see that you need to return a string with the value as you want it represented in it, but this can be any combination of html, javascript, etcas required. Basically, wherever this variable is called through the GUI engine, this will be sent back as the value/output.

    • For a specific class/variable combination by using a bbsetting, namely bbsetting_field_display_plugins. This can be set within a PHP file as follows:

      var $bbsetting_field_display_plugins=array("field_name"=>"method_to_call");

      or it can be set using the Admin>Module Settings functionality by entering the field=>method pairs separated by commas ie:

      field_name=method_name,
      field_name2=method_name2,

      You can set multiple field=>method values within this array. The 'method' can then sit within the bb_plugins class or the parent class where the bbsetting has been set, either place will work. The method can be styled exactly as per the function example above. So, just to drive the point home, in this instance, if the bbsetting was set in the bb_finance_cashbook_entries class, then only when forms within that class are rendering the cashbookISbb_finance_cashbooksID will this form-field override take effect.

    • On an ad-hoc basis within the variable name itself, by using the variable naming syntax of variable_nameISPLUGIN_method_name. This behaves exactly as per the second example above, whereby it looks for the method within the bb_plugins class or, if it can detect a current related class to the variable, within the current class. The method can be styled exactly as per the function example above.

Sunday, November 6, 2011

Better Visibility of Inventory Overallocation in BlueBox2.0

BlueBox2.0 has wonderful inventory visibility and control features. These include a detailed inventory report which shows inventory in real time, specifying it's location, allocation status etc.

A new addition to this report is the visibility of whether an item allocated to a document in the system is over-allocated or not. The appearance of a red ! will indicate that the system thinks the item is over-allocated and you are then able to click through to the parent document for further info.



Following on from this, our 'Release Stock' function has also had an upgrade in that it now allows filtering for only those items which are over-allocated, and will indicate in a normal listing of items to release, which it thinks are over-allocated.



Both new features will assist Inventory Controllers as they go about their day-to-day tasks, making finding and releasing over-allocated stock as simple a a few clicks of the mouse.

Friday, November 4, 2011

New BB2.0 Currency Converter via Yahoo

For the past 4 years the BlueBox2.0 Currency Engine has been driven by the Google currency service. However in the past week, our method of gathering the conversion figures from Google results stopped working, due to what appears to be Google's new format of mashing various result sets on their search results page from numerous sources, making getting at the info difficult and unpredictable.

To get away from this method, and to continue to provide a reliable, free web-based source of currency values, we have implemented a Yahoo Currency service which returns a far cleaner result.

This service relies on the 3 digit currency code for each currency, and so, in order for older BB2.0 sites to use this feature their currency 'codes' will need to be updated manually. As soon as these are updated the converter will work automatically. Each time the automatic currency updates function is run from BB2.0, any currencies without a currency code will be skipped.

The codes for standard BB2.0 roll-out currencies are:
  • US Dollar = USD
  • British Pound=GBP
  • South African Rand=ZAR
  • Australian Dollar=AUD
  • New Zealand Dollar=NZD
  • Canadian Dollar=CAD
  • Euro=EUR
  • Japanese Yen=JPY

Friday, October 21, 2011

Php Plugins for BlueBox2.0

Not many developers are aware that writing a plugin for BlueBox2.0 is as easy as it actually is.

By plugin, we are referring to an 'intercept function' that dove-tails into the current system process model built into BlueBox2.0.

Each time a standard class->method is called within the BB2 framework, a plugin can be inserted to handle the data passing through at that point.

Here is how...
  • Firstly, create a php file in portal/{database_name}/custom_modules called bb_plugins.php
  • The file should have the following format:

    <?php
    class bb_plugins extends baseclass{
       ...
    }
    ?>

  • Then add as many plugn functions as you require, naming them as class_name_plugin_name, ie

    function bb_sales_orders_post_add(){
    ...
    }

  • The format of the plugin is also important and should have at minimum, the following:

    function bb_sales_orders_post_add($conf=NULL){
           global $global,$class,$method;
           .....
           return($conf)
    }

  •  Standard intercept-nodes are:
    • pre_view
    • post_view
    • pre_viewlist
    • post_viewlist
    • pre_get
    • post_get
    • pre_add_form
    • post_add_form
    • pre_add
    • post_add
    • pre_edit_form
    • post_edit_form
    • pre_edit
    • post_edit
    • pre_delete
    • post_delete
    • pre_truedelete
    • post_truedelete

    And some special instances are:

    • bb_secure->pre_login
    • bb_secure->post_login
    • bb_datamerge->extra_data

  • And that's it... from there it is up to you. You can intercept data, call other functions, do whatever you require with the data that is passed into the function via $conf, just as long as you pass it back out with return $conf at the end...
  • As an extra feature, bb_plugins.php can also be used to set bbsettings dynamically.
    This is done by declaring a function as class_name_bbsetting_full_name, eg:

    function bb_sales_orders_bbsetting_display_name_template($conf=NULL){
          
    global $global,$class,$method;
           $value=$conf[name]." ".$conf[_id];
           return($value)
    }

Friday, October 14, 2011

New Module : BlueBox Financial Document Templates

This week we released a new module for BlueBox2.0 which allows you to template the header and lines for financial documents.

Similar to the Module Defaults module, this new module adds the functionality of being able to attach a number of pre-set lines to the template. Using this new module you will be able to set up 'standard' documents which are captured regularly, and specify which items, quantities and prices to apply automatically.

The templates are accessed via the DataFunctions menu, and if you have permission to add new templates a quick-link can be seen there as well.

Here is the process:

The new module can be accessed, added to and edited via it's direct link under the admin menu:

As easy way to access the Findoc Templates for a specific module is to click on DatabaseFunctions in the top menu for that module (ie SalesOrders). Click on New Findoc Template...

A new Findoc Template requires a name and a module_name. Optionally you can set header-defaults in the 'other variables' area... these are to be separated into new lines, with an = between the variable name and it's raw value.

Once added you can then add multiple lines to the template, at minimum you must add the item, with qty, price and description optional.

Finally, back in the SalesOrders module, if you click on the DatabaseFuntions menu you will now see the new template available for selection...clicking on it will apply the defaults to a new sales order.



Friday, September 23, 2011

New bbsettings for Image Thumbnails and Resizing Options

A new set of bbsettings has been added to the base code for BlueBox2.0 which allow the control of thumbnail image sizing as well as final image resizing at class/module level.

Previously this was controlled at 'global' level by the config file.

The new settings are:

bbsetting_skip_image_resize - ignores the global resizing parameters for all images in this module

bbsetting_image_resize_width - sets the width for image resizing for all images in this module

bbsetting_image_resize_height - sets the height (if left blank, height is proportional to width)

bbsetting_image_thumbnail_width - as above, but for the auto-generated thumbnails

bbsetting_image_thumbnail_height - as above

Friday, September 16, 2011

BB2.0 Server Statistics Report

New to BlueBox2.0 this week is a System Statistics Module.

This new module is still in it's infancy, and currently stores a history of the highest ram-consuming page in the past hour on the server. The obvious uses for this report are to monitor which users/pages/reports are causing ram/processor outages on the system. We used the memory_get_peak_usage() function in PHP for this. An interesting article on PHP memory usage can be seen here.

To find the report go to Admin->System Stats

Available bbsettings for this module are:

bbsetting_system_stats_enable_storage : defaults to 1 (on) but can be disabled with a 0
bbsetting_system_stats_store_for_days : deafults to 7, number of days before 'old data' is deleted from the cache

In future this module will be used to store slow SQL queries, peak-usage stats etc.

Sunday, September 4, 2011

Quicker Access to bbsettings in BlueBox2.0

For those of you who use bbsettings a lot in the configuration of your BlueBox2.0 systems, you will relate to the time-consuming frustration of having to go to the admin->module_settings menu item, then having to select the relevant module from the long list of 100's... etc.

Recently added is a contextual menu item within each module which automatically takes you directly to the Module Settings module and auto-loads the correct module for you... enjoy:


Cashbook Error Reduction in BlueBox2.0

A quick, little update to the Cashbook Module in BlueBox2.0 has been the introduction of the archivedYN flag.

This field, which is set in the bb_cashbooks table, determined whether a cashbook can be selected for manual cashbook entry. If not, it will not appear in the dropdown list.

Note: this setting does not stop automated entries from posting to the nominated cashbook.


Thursday, September 1, 2011

Introducing BlueBox2.0 WebClicks Tracker

Released with today's code update for BlueBox2.0 is a nifty new module called the WebClicks Tracker.

As a web development agency we often get asked to assist customers with Google, Yahoo, Facebook etc Pay-Per-Click ad-campaigns, and invariably, these are then followed on with monthly feedback on the progress and status of the various campaigns we are running for them.

All too often, the stats we garner from Google Analytics or engines like Google Adwords, are too generic and don't offer the sort of in-depth drilldown analysis that would make the answer to 'who is clicking on our ads' or 'what pages are they viewing' or 'how many of them leave immediately' etc etc.

Given, an experienced eye cast of the Google Analytics report for each client would provide them with lots of info, but this is very time consuming and requires a lot of hand-holding.

What we decided was necessary was a stats engine that:
  • stored ONLY the click-throughs from your priority engines, ie: traced the clicks you were paying for
  • allowed you to analyse the clicks in groups per user-experience, not as separate page-stats
  • sent you a daily or weekly automated email summary of your site, to keep you in the loop
Our WebClicks Tracker does just that. You can edit a pre-defined list of 'accepted' referring domains, initially set to Google, Yahoo and Bing, and only traffic originating from these domains will be tracked. You can determine the frequency and recipients of an automated email which sends you all the info at regular intervals. And most importantly, you can get to view each user-session in a click-by-click manner, seeing which engine they came through, what keywords they were searching for and where they landed on your site. From there you get to see the pages they clicked on, and, if the cookie that is created by this process isn't deleted, you will see every page they come back to during the report period, even if they leave the site and return later.

The module is found under the Publishing menu, and configuration options are a set of bbsettings that can be configured by going to Admin->Module Settings:
  • bbsetting_webclicks_tracker_maxmind_apikey
    This setting is optional, and if you have a web-service key from MaxMind.com the system will translate your visitor IP addresses into country codes.

  • bbsetting_webclicks_tracker_search_domains
    This defaults to 'google.', 'yahoo.' and 'bing.' You can add more, just remember to leave the domain at the period (.) as this will allow traffic from all their country sites as well as the .com's

  • bbsetting_webclicks_tracker_searchphrase_variables
    This defaults to 'p' and 'q' as the top 3 engines all store their search queries in either &p=my+query or &q=my+query. If any of your extra sites store their search phrases in alternate GET variables, put them in here.

  • bbsetting_webclicks_tracker_email_recipients
    This is blank by default (ie no emails will be sent). It can contain an unlimited list of email recipients, separated by semi-colons (;). The email engine will only send one email every x days (where x is the value in the next bbsetting). To force the email script to send an email you can add the following to the URL of any page in you BB2 site... &global[force_webclicks_tracker_email]=1

  • bbsetting_webclicks_tracker_email_frequency
    This defaults to 7, which means that the above email function will send an email to all recipients every 7 days for the previous 7 day period. To change this simply put s different number in.
Finally, and most importantly, to enable this module you will need to put the following BB2.0 tag into your page.template:

<!--:class:bb_webclicks_tracker:track:-->

As part of an ongoing enhancement of this module, we intend to integrate it with Google Adwords so that the origin adverts and their CPC details can be included in the reports.

That's it! Have fun!

Saturday, August 13, 2011

PHP code for rendering a 'barrel widget' for charting and graphing.

I had call to write a PHP based barrel widget the other day and through I'd share the process.
The end-result needed to look like this: 
 
In order to achieve this, I chopped the graphic into the following PNG files:






Then the code which made it render as a complete new 'barrell chart' or 'barrell widget' looked like this:

<?php
function graph_render_barrel($val,$name){
    //$val is the percent value passed to the function, and $name is the name of the file to be saved
    $filename=$name;
    $img = imagecreatefrompng("g_barrel.png");
    imagealphablending($img, true);
    imagesavealpha($img, true);
    $greenbase = imagecreatefrompng("g_barrel_breen_bot.png");
    imagealphablending($greenbase, true);
    imagesavealpha($greenbase, true);
    $greenmid = imagecreatefrompng("g_barrel_breen_bak.png");
    imagealphablending($greenmid, true);
    imagesavealpha($greenmid, true);
    $greentop = imagecreatefrompng("g_barrel_breen_top.png");
    imagealphablending($greentop, true);
    imagesavealpha($greentop, true);
    $stretch=floor(184*($val/100)); //0 to 184
    imagecopyresampled($img, $greenbase, 2, 211, 0, 0, 143,21, 143,21);
    imagecopyresampled($img, $greenmid, 2, (211-$stretch), 0, 0, 143,(20+($stretch-20)), 143,20);
    imagecopyresampled($img, $greentop, 2, ((211-$stretch)-22), 0, 0, 143,45, 143,45);
    imagepng ( $img , "portal/saasmsallstar/UserFiles/bb_crp_graph_images/$filename" , 0 ,  PNG_ALL_FILTERS);
    imagedestroy($img);
    return($name); //handle possible retuns here
}
?>

So, in practice it could be used like this:

<?php
echo("<img src=\"".graph_render_barrel(66,"path/to/new_graphic.png")."\" >");
?>

Managing Timezones in BlueBox2.0

If you need to set the timzone for your BB2.0 system, or for specific timezones for individual users, you can use the following built-in settings:
  • for a system-wide setting, set the config (admin->config) setting system_default_timezone
  • for a user-specific timezone setting there is a field in the bb_users table called 'timezone'
The value for either of these can be set to one of the standards described in http://www.php.net/manual/en/timezones.php

Adding Multiple email responses to new data added in BB2.0

If you are familiar with the bbsetting_email_onadd setting for BlueBox2.0, you may be interested to know that you can set multiple arrays which send different results to various recipients, as follows:

In a .php file, use the following:

var $bbsetting_email_onadd=array(
array("to"=>"some@user.com","bcc"=>"","
from"=>"admin@domain.com","subject"=>"Subject One","template"=>"email_one"),
array("to"=>"some_other_user@domain.com","bcc"=>"","from"=>"admin@domain.com","subject"=>"Subject Two","template"=>"email_two")
);
 
or if you are editing within Admin->module settings, you can enter nested arrays as follows:
 
{to=admin@site.com,from=some@domain.com,subject=Subject One for Admin Email,template=name_of_email_
template_for_admin,}
{to=user@site.com,from=some@domain.com,subject=Subject Two for User Email ,template=name_of_email_template_for_user,}



Monday, July 18, 2011

Updated Security In BlueBox2.0

BlueBox2.0 security and passwords just got a bit of a face-lift with the inclusion of 2 new features:


Javascript Password Confirmation:

When entering a new password (or changing an existing one) a Javascript/modal popup is initiated which confirms the password prior to accepting it.

New bbsettings for Enhanced Security:

These new bbsettings have been added to the bb_secure module and can be edited via admin->module settings...

A new standard minimum password length of 5 characters has been introduced. This can be shortened or lengthened by editing bbsetting_enable_password_length for bb_secure to the number of characters required.

You can also force combined alpha/numeric passwords by setting bbsetting_enable_password_alphanumeric to 1.

Finally, you can force users to update/change their password regularly by setting bbsetting_enable_force_password_change_in_days to the number of days per cycle.

Wednesday, July 6, 2011

New In-Line Form Field Management in BlueBox2.0

One of the most powerful things about BlueBox2.0 is the ability to design form and templates for every screen and output in the system. One of the difficulties, up till now, has been knowing which bbsetting to apply in order to achieve these customisations.

In an effort to simplify this, there is now an in-line toolbox next to each field in a form which displays various options with regards to the display/behaviour of that field... for example, whether to hide it, or make it required etc.. Only users with 'admin' rights to the specific module will see these toolbox icons:

This tool will evolve significantly over the next few months, but this is a good starting point for now...

Friday, July 1, 2011

Using conditional IF and IFNOT statements in BlueBox2.0 Tags

Today I decided to use my 'sharpening time' to get to grips with BB2.0 <!--:if and <!--:ifnot tags.

The basic syntax for these tags is:

<!--:if:{variable_name}{optional condition}:{action}:-->

This can be used as follows:


<!--:if:email:{print:Your email address is (#email#).}:-->

or

<!--:ifnot:email:{print:You do not have an email address.}:-->

This is fairly straightforward, the condition of the if and ifnot statements purely checks if a positive value exists for the variable and, if so, then it runs a sub-tag between the { }'s. This subtag is exactly the same as a normal BB2.0 tag, but, due to it's embedded nature, it gets { in place of <!--: and } in place of :-->. Also: you will notice that referring to the variable value within subtags you use the (# approach, by wrappinf the variable name in (# and #).

To up the ante a bit, I then decided to play with conditional statements like ==, !=, > and <. These work as follows:

<!--:if:email==bill@microsoft.com:{print:Hi Bill!}:-->

Note here that the value is never encapsulated in the ' and " string-wrappers normally used in code, and also that the condtional statement for 'equals' is double =.

Last thought on this, and this one stumped me for a while, is that when you are evaluating form-posted variables, remember to describe the variable name fully using the global|fields|variable_name method, eg:

<!--:if:global|fields|email==bill@microsoft.com:{print:Hi Bill!}:-->

Friday, June 24, 2011

Using Postcodes in BlueBox2.0 via PostCodeAnywhere

Recently we have integrated an excellent UK postcodes library/database/service with BlueBox2.0. This is the PostCodeAnywhere product. The API's have been integrated formally into BlueBox2.0 and offer the following features:
  • Postcode Lookup
  • Find nearest-to from a certain address (used for finding 'a store near you' etc)
  • Geo-spatial data (long/lat data for mapping)
  • Government Data (wards/districts etc)
  • Database Cleansing
Installing PostCode Lookups into BlueBox2.0

This is a very easy process. Simply go to toe Postcode Module under Integration. There you will be asked for your PostcodeAnywhere customer 'code' and the API Key for your lookup-account with them. These are easily got by surfing to PostcodeAnywhere.co.uk using this link:

Postcode Anywhere

Sign up for an account, then create a new key from the backoffice menu. Once you have your account and key simply enter these into the PostCode module by clicking on Accounts in the top menu. Click on 'DataFunctions->Add' and fill in your account details.

Once these have been filled in and the account is added, go back to the Postcodes Dashboard and you will see a test lookup facility which you can use to test if the account is working correctly.

Configuring your BlueBox2.0 System for Postcode Use

Now that Postcodes have been set up in your system, you may want to configure it as follows:

Limiting abuse: BB2.0 has a default limit of 3 lookups per IP address per hour, to stop web-users from chewing up your credits unnecessarily. This would apply for 'public use', but if you have a backoffice function you may want to set this to a much higher amount, or remove the limit altogether. There is a bbsetting for this, called bbsetting_postcode_limit_per_hour. If you set this to 0, there will be no limit.

Forcing Postcode Lookups: The postcode module will not automatically 'hijack' fields with the name containing 'zipcode', but if you want all 'zipcode' formfields to automatically become postcode lookups, you can set bbsetting_postcode_force_lookups_in_forms to 1.

Disabiling Postal Address fields for manual entry: Part of postcode lookup functionality is to stop users from messing up the data. To make your address fields 'readonly' use bbsetting_readonly_fields for each module that has postal address fields. Ie for the user table you will set bb_users->bbsetting_readonly_fields to be:

postal_address,
postal_address2,
postal_suburb,
postal_city,
postal_state,

Saturday, June 18, 2011

bbsetting_item_data_qty_blank_in_forms

A new bbsetting for BB2.0 is bb_item_data->bbsetting_item_data_qty_blank_in_forms which sets the qty field in financial docs to 'blank' as opposed to zero or 1. It is part of the bb_item_data class. To edit this setting go to admin>module settings and select bb_item_data from the class list. Then select this bbsetting from the list.

Friday, June 17, 2011

PHP secure communications library

This week one of our BlueBox team discovered a nifty PHP secure communications library which we needed for SFTP comms between one of our Linux Servers and a Windows machine. It works great and helped us avoid adding extra libraries to our server to achieve the same thing.

Also this week, as part of the axe sharpening process we started the redevelopment of our corporate website at www.blueboxonline.com. It has been a long time coming, and what we decided to do was get the design done by a 3rd party (we are too close to the machine to do it ourselves).

Our aim is to keep the site clean and simple, and above all to have a scalable, neat CSS structure behind it to ensure that as we expand the content areas, that the site remains navigable and easy to use.

Friday, June 10, 2011

Easy extension of User Data

This week I faced the challenge of adding more data to the standard BB2.0 system user profile than is normally required.

One way it to use the list of generic xtra_fields, but this can be limiting.

In writing a system for Care Management, the user data that needs to be stored is very detailed and complex. It does not make sense to extend the 'standard user table' with all these extra fields.

So I developed a cool 'extension' function that essentially copies the required fields to the matching user record in the main user table, while allowing you the autonomy of building a bespoke module that meets your needs.

So, for example, if I wanted to create a new module to store info regarding tradespeople in a new module called bb_tradespeople, you would create the new module, and have a link-field called userISbb_usersID in the table. You would also include all the 'common' fields in your new table, for example : first_name, last_name, email, and telephone. (These need to be named exactly as they are in the bb_users table).

Now that your new class has been created, extend it using the 3 over-ride methods below:

 function pre_edit_form($conf=NULL) {   
                global $global, $class, $method;  
                $res=load_linked_user_data_in_external_module($conf,"userISbb_usersID");  
                $conf=$res;  
                return $conf;  
           }  
function post_add($conf=NULL) {   
                global $global, $class, $method;  
                $res=process_linked_user_data_in_external_module($conf,"userISbb_usersID",array("Debtors"));  
                $conf=$res;  
                return $conf;  
           }  
function post_edit($conf=NULL) {   
                global $global, $class, $method;  
                $res=process_linked_user_data_in_external_module($conf,"userISbb_usersID",array("Debtors"));  
                $conf=$res;  
                return $conf;  
}  

The 2 new functions are

load_linked_user_data_in_external_module


this takes the standard $conf input as well as a string with the field name which links to the user table

and

process_linked_user_data_in_external_module

this takes the standard $conf input as well as a string with the field name which links to the user table and also the group that you want to add the new linked-user into.

Thursday, June 2, 2011

BB2.0 Imports : Adding linked data on-the-fly

For a while now I have wanted to be able to add data to other tables via the standard BB2.0 CSV import functionality.

For example, if I am importing staff data, it would be great if I could import the user linked to the staff data at the same time, rather than having to import the user first and then import the staff data separately.

This has led to the addition of a nifty noew import syntax for bb2.0 imports, namely add_linked_data_ which allows you to add extra columns to your CSV import spreadsheet which look like this:

add_linked_data_userISbb_usersID.first_name or 
add_linked_data_userISbb_usersID.last_name

The presence of these columns will force the import script to check to see if a field exists in this import called

userISbb_usersID

and if so, to try to add the new data found in these columns to the database BEFORE importing the current line of data, and thereafter linking the field  userISbb_usersID to the newly added data. If it finds that the data already exists (it may have been added a few lines previously for another row in the import) then it simply links this row's data to the existing entry.

Friday, May 27, 2011

Easier BB2.0 Permission Assignment

Setting permissions in BB2.0 can be quite hard work. The system works on the principle of denying all access to all system functions unless told otherwise. At BlueBox we believe permissions systems should work this way, but that does make setting up a system time consuming.

Overview
As a quick recap of how the BB2.0 permissions structure works: permissions are issued per user group, and a user inherits the aggregation of all the permissions for all the groups they are in when he or she logs into the system. This is the cached into their session-state and, if changes are made to their profile/permissions, they would normally need to log out and back in again to get the new permissions.

In-line permissions setting
To ease the pain we have just released a new 'inline' permission setting functionality. Basically, when a user is presented with a 'you do not have permissions' dialogue, there is a SET button which appears. This allows another user, with the correct permissions, to assign the missing permissions to that user 'on the fly'. The new permission is automatically set (without the need to log out) and the user can proceed as required.

Quick refresh
Another innovation is the session-refresh functionality which was recently added next to the 'edit user' link in the top left of the screen. This nifty link simply refreshes all the system cache'd items for that user, including the menu. This will save users having to log off for updates in future.

Sunday, May 8, 2011

Access to and understanding BlueBox2.0 bbsetting_'s

Underlying the BB2.0 framework is a powerful set of settings, known as the bbsettings.

These are configurations which allow the system administrator to change the behaviour of BB2.0 modules without needing to apply any code.

An example of a bbsetting is bbsetting_module_name. This determines how the module is 'seen' and 'named' across the system. This way, for a specific installation, Sales Orders can become known as Internal Sales, for example, without impacting the formal class structure or the data structure.

An example of a more impactful bbsetting is bbsetting_email_on_add which takes an array in the form of

to=myemail@mydomain.com,

and optionally:

to=myemail@mydomain.com,
subject=This is a sample subject for this auto-generated email,
body=This is a sample message for this autogenerated email. The dosument just added has an id of (#_id#)

This hugely powerful bbsetting allows the system adim to drop in email triggers into any module which will email a specified or dynamic list of recipients with data pertaining to that specific new data entry.

This weekly blogging process is supposed to contribute to our internal 'sharpening of the axe' process, which is a weekly discipline to put 2-3 hours into 'fixing stuff' rather than continuing week after week with a blunter and blunter axe.

So, in this post, I am identifying a few imporvements for bbsettings which I plan to work on over the next few weeks:
  • If system admin is logged in (or a user with pseudo-admin rights), they should be able to see all settings for a specific module when they are in the module, without having to go to the Module Settings module.
  • This list of settings should allow them to edit the settings and view the options for each setting.
So, having decided on my next sharpening excercise... watch this space!

Sunday, May 1, 2011

Adobe BrowserLab

As a cross-browser developer I need an easy single source for testing my work on all the latest browsers. I searched around a bit and found Adobe BrowserLab to fit the bill.

I managed to get a free account, though I see from Adobe Forms that there will eventually be a charge of around $10-$20 per month for the service... still, having looked at a few of the competitors in this market, that is not a bad price.

Features include engines for all the latest browsers, a handy side-by-side viewer so that you can compare your development version next to the various other versions, and even cleverer was the onion-skin viewer which overlays the 2 verions to make spotting differences even easier.

Thursday, April 28, 2011

BlueBox2.0 Sharpening

Having just set up another BB2.0 system, I am reminded that the following areas of development are going to smooth the process significantly:

1. An easier way to kill session data on-the-fly without having to log off and back on again.

2. A more fluid permission granting process which allows the admin user to log in as another user, experience their permission blocks and then simply add the required permissions as they arise.

3. A replacement forms engine which allows for more bespoke add/edit forms based on a user's profile.

Saturday, April 23, 2011

BlueBox2.0 Blue Sky Strategy

Part of this blogging process is to produce the space for 'blue sky' or creative startegy which will allow the team at BlueBox to 'sharpen the axe' - to quote a cliche.

This week I have applied my mind to what 'sharpening the axe' for BlueBox2.0 really means. What are the 'blunt edges' of our business that we pound out day after day, getting less and less effective as time goes on?

If we can identify just a few of these areas, and we then act upon those thoughts, we are sure to start a refining process that leads to business process optimisation.

So here are my top 5 'sharpening' wish-list items for BlueBox2.0:

1) Intuitive SQL Report writing:
A tool that will allow us to build sql statements visually, while also allowing for the creation of a filter for various elements of the query. The results will be tabular, but can easily be switched to widget/graphic mode.

2) Better GUI interface for tablulated data:
A neater way of tabulating data so that we can sort, filter, search, include columns, exclude columns, export, import, print, dump to pdf etc.

3) Better visibility for bbsettings
These settings are so critical to the running of BB2 systems, but very often the settings and the options they provide are hidden from view. It would be great to see what is available for any module as you view it.

4) A forms designer
A dragable form designer which allows us to layout the input/edit forms which are currently quite rigid in their layout. This engine would take into account required fields and allow different forms to be stored for each user group/business unit as required.

5) Updade the FCK Editor to the latest version.

6) A better PDF rendering engine

7) A better page-to-print feature

8) A 'print template' editor which makes designing the output/print view of modules easier.

Wednesday, April 13, 2011

BlueBox South Africa Seminar 2011

The BlueBox 2011 Seminar has just concluded and it was great fun to have customers, partners and staff all under one roof for a great lunch and some lateral thinking.

We covered a bunch of topics, from Web Apps to Biometrics... and there was lots to chat about. Our new Quality Assurance Module attracted a bunch of attention too, specifically in the light of moving towards a Quality Control platform for manufacturing.

Videographer, Keith Farr from Crosspond, is busy preparing our 3 minute out-take as I write this, which we'll publish next week.

So... what made the biggest dent in everyone's psyche? Two things... firstly we were all blown away by Dan Pink's 'Drive' video, supported by amazing animation by RSA Animate. This is a total game changer for us... and really made everyone think differently about motivating creatives.



Secondly, from a technological point of view, seeing as one of our focus areas was Mobile Apps, we loved Mozilla Lab's 'Seabird' - a Community Driven Mobile Phone Concept.