Difference between revisions of "Sf assemblage"

From ARK
Jump to: navigation, search
(Additional Fields)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
These are some notes describing the sf_assemblage.
 
 
 
===Description===
 
===Description===
  
sf_assemblage can be used for displaying and editing attributes that have numbers chained to them. As an example, this could be used for recording the numbers of a certain type of seed in a sample, or for attaching total numbers of findtypes.
+
sf_assemblage can be used for displaying and editing attributes that have numbers chained to them. As an example, this could be used for recording the numbers of a certain type of seed in a sample, or for attaching total numbers of findtypes. This form should normally be used in conjunction with [[sf_attr_bytype]]. The attribute gets added to the item and then sf_assemblage will offer you the chance to add one or more numbers to that attribute.
 
 
===Usage===
 
 
 
This form should normally be used in conjunction with [[sf_attr_bytype]]. The attribute gets added to the item and then sf_assemblage will offer you the chance to add one or more numbers to that attribute.
 
  
===Set-Up===
+
===Additional Fields===
  
sf_assemblage needs a number of different 'op' variables set in the sf_conf and also it will need some custom validation set up (to allow for the chains).
+
The sf_assemblage needs a number of different 'op' variables set in the sf_conf:
 +
*'''op_assemblage_type''' - this is the type of attribute (in cor_lut_attribute) that the fields will be chained to.
 +
*'''op_chart''' - sets whether the assemblage information will be displayed in pie-chart form on micro view, set as TRUE/FALSE
  
===Examples===
+
===Example Configuration===
 
+
<pre>
In this example, sf_assemblage is being used to chain coordinates to a projection system that is attached to the item.
+
$conf_mcd_botanic =
 
 
====the sf_conf====
 
 
 
  $conf_mcd_coords =
 
 
     array(
 
     array(
 
         'view_state' => 'max',
 
         'view_state' => 'max',
 
         'edit_state' => 'view',
 
         'edit_state' => 'view',
 +
        'sf_title' => 'botanictype', //is used for getting the attributetype
 +
        'sf_html_id' => 'smp_botanic', //the form id tag (must be unique)
 
         'sf_nav_type' => 'full',
 
         'sf_nav_type' => 'full',
        'sf_title' => 'coordinates', //appears in the titlebar of the subform (mk nname)
 
        'sf_html_id' => 'fst_cd_coordinates', //the form id tag (must be unique)
 
 
         'script' => 'php/subforms/sf_assemblage.php',
 
         'script' => 'php/subforms/sf_assemblage.php',
        'op_assemblage_type' => 'projection',
+
         'op_label' => 'space',
         'op_label' => 'save',
 
 
         'op_input' => 'save',
 
         'op_input' => 'save',
 +
        'op_assemblage_type' => 'botanictype',
 +
        'op_chart' => TRUE,
 
         'fields' => array(
 
         'fields' => array(
            $conf_field_easting,
+
            $conf_field_total           
            $conf_field_northing
 
 
         )
 
         )
  );
+
);
 
+
</pre>
As you can see here this is a normal sf_conf setup except:
 
 
 
*'op_assemblage_type' - this is the type of attribute (in cor_lut_attribute) that the fields will be chained to.
 
 
 
====the fields====
 
 
 
The fields that are sent to this form - are the numbers (or in fact txt) that you want to chain to the attribute. They will need some custom validation rules setup to ensure that the add routine works correctly.
 
  
  //set up some custom validation for the coordinate chains
 
$vd_chainkey =
 
    array(
 
      'rq_func' => 'reqManual',
 
      'vd_func' => 'chkSet',
 
      'var_name' => 'itemkey',
 
      'force_var' => 'cor_tbl_attribute',
 
);
 
$vd_chainval =
 
    array(
 
      'rq_func' => 'reqMulti',
 
      'vd_func' => 'chkSet',
 
      'var_name' => 'itemval',
 
      'lv_name' => 'itemval',
 
      'var_locn' => 'request',
 
);
 
$conf_field_easting =
 
    array(
 
        'dataclass' => 'number',
 
        'classtype' => 'easting',
 
        'alias_tbl' => 'cor_lut_numbertype',
 
        'alias_col' => 'numbertype',
 
        'alias_src_key' => 'easting',
 
        'alias_type' => '1',
 
        'editable' => TRUE,
 
        'field_op_hidden' => FALSE,
 
        'add_validation' => $number_add_validation,
 
        'edt_validation' => $number_edt_validation
 
);
 
$conf_field_northing =
 
    array(
 
        'dataclass' => 'number',
 
        'classtype' => 'northing',
 
        'alias_tbl' => 'cor_lut_numbertype',
 
        'alias_col' => 'numbertype',
 
        'alias_src_key' => 'northing',
 
        'alias_type' => '1',
 
        'editable' => TRUE,
 
        'field_op_hidden' => FALSE,
 
        'add_validation' => $number_add_validation,
 
        'edt_validation' => $number_edt_validation
 
);
 
//add in the custom validation
 
$conf_field_easting['add_validation'][] = $vd_chainkey;
 
$conf_field_easting['add_validation'][] = $vd_chainval;
 
$conf_field_northing['add_validation'][] = $vd_chainkey;
 
$conf_field_northing['add_validation'][] = $vd_chainval;
 
  
 
[[category: Administrator]]
 
[[category: Administrator]]

Latest revision as of 10:49, 14 November 2008

Description

sf_assemblage can be used for displaying and editing attributes that have numbers chained to them. As an example, this could be used for recording the numbers of a certain type of seed in a sample, or for attaching total numbers of findtypes. This form should normally be used in conjunction with sf_attr_bytype. The attribute gets added to the item and then sf_assemblage will offer you the chance to add one or more numbers to that attribute.

Additional Fields

The sf_assemblage needs a number of different 'op' variables set in the sf_conf:

  • op_assemblage_type - this is the type of attribute (in cor_lut_attribute) that the fields will be chained to.
  • op_chart - sets whether the assemblage information will be displayed in pie-chart form on micro view, set as TRUE/FALSE

Example Configuration

$conf_mcd_botanic =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_title' => 'botanictype', //is used for getting the attributetype
        'sf_html_id' => 'smp_botanic', //the form id tag (must be unique)
        'sf_nav_type' => 'full',
        'script' => 'php/subforms/sf_assemblage.php',
        'op_label' => 'space',
        'op_input' => 'save',
        'op_assemblage_type' => 'botanictype',
        'op_chart' => TRUE,
        'fields' => array(
             $conf_field_total            
        )
);