Difference between revisions of "Sf chaintable"

From ARK
Jump to: navigation, search
(Created page with "Example configuration: $conf_mcd_assemblage = array( 'view_state' => 'max', 'edit_state' => 'view', 'sf_title' => 'assemblage', //appears in the titl...")
 
Line 1: Line 1:
Example configuration:
+
===Description===
  
 +
sf_chaintable can be used for displaying and editing data fragments that are chained to other data fragments. One 'root' field is linked to the item being viewed, which may have one or more fragments per item creating rows for the table and then one or more fragments can be chained to these to create additional columns. Examples of this include attaching numbers to find attributes - mirroring and supplements [[sf_assemblage]] for linking usage to periods of sites, or for levels tables.
 +
 +
By default the chaintable hides any empty columns. As of version 1.2 the new records feature is uncomplete and only some of the edit functions are supported - numbers, text and attributes.
 +
 +
===Additional Fields===
 +
 +
The sf_assemblage needs a number of different 'op' variables set in the sf_conf:
 +
*'''op_assemblage_type''' - the root field which is connected to the item
 +
*'''op_sum_field''' - if this is set then the rows will be aggregated where they are identical and the number in this field will be summed for the output. this field must be a number!
 +
*'''fields''' - the columns that will be added to the table
 +
 +
===Example Configuration===
 +
<pre>
 
$conf_mcd_assemblage =
 
$conf_mcd_assemblage =
 
     array(
 
     array(
Line 12: Line 25:
 
         'op_sum_field' => $conf_field_total,
 
         'op_sum_field' => $conf_field_total,
 
         'default' => '0', //the default value for creating new records
 
         'default' => '0', //the default value for creating new records
        // 'op_chart' => 'yes',
 
 
         'op_label' => 'space',
 
         'op_label' => 'space',
 
         'op_input' => 'save',
 
         'op_input' => 'save',
Line 21: Line 33:
 
             $conf_field_finddates,
 
             $conf_field_finddates,
 
             $conf_field_sherdfunction,
 
             $conf_field_sherdfunction,
            //$conf_field_locxmicat,
 
 
             $conf_field_catxmiloc,
 
             $conf_field_catxmiloc,
 
             $conf_field_total,
 
             $conf_field_total,
 
         ),
 
         ),
 
);
 
);
 +
</pre>
 +
 +
 +
[[category: Administrator]]

Revision as of 16:52, 12 October 2015

Description

sf_chaintable can be used for displaying and editing data fragments that are chained to other data fragments. One 'root' field is linked to the item being viewed, which may have one or more fragments per item creating rows for the table and then one or more fragments can be chained to these to create additional columns. Examples of this include attaching numbers to find attributes - mirroring and supplements sf_assemblage for linking usage to periods of sites, or for levels tables.

By default the chaintable hides any empty columns. As of version 1.2 the new records feature is uncomplete and only some of the edit functions are supported - numbers, text and attributes.

Additional Fields

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

  • op_assemblage_type - the root field which is connected to the item
  • op_sum_field - if this is set then the rows will be aggregated where they are identical and the number in this field will be summed for the output. this field must be a number!
  • fields - the columns that will be added to the table

Example Configuration

$conf_mcd_assemblage =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_title' => 'assemblage', //appears in the titlebar of the subform (mk nname)
        'sf_html_id' => 'pottery_ass', //the form id tag (must be unique)
        'sf_nav_type' => 'nmedit',
        'script' => 'php/subforms/sf_chaintable.php',
        'op_assemblage_type' =>  $conf_field_total,// the field of data attached to the item
        'op_sum_field' => $conf_field_total,
        'default' => '0', //the default value for creating new records
        'op_label' => 'space',
        'op_input' => 'save',
        'fields' => array(
            $conf_field_sherd_class,
            $conf_field_sherd_form,
            $conf_field_sherd_type,
            $conf_field_finddates,
            $conf_field_sherdfunction,
            $conf_field_catxmiloc,
            $conf_field_total,
        ),
);