<?php

// MTCE customization ar stored in
// https://hg.dev.itsapiens.eu/SugarCRM_AnalyticReporting_customizations/summary
// currently for ESCHENBACH

$mtcFields = array(
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "id",
        "fieldname" => "id",
        "fieldlabel" => "id",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "type",
        "fieldname" => "type",
        "fieldlabel" => "Type",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "name",
        "fieldname" => "name",
        "fieldlabel" => "Name",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "date_entered",
        "fieldname" => "date_entered",
        "fieldlabel" => "Date entered",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "date_modified",
        "fieldname" => "date_modified",
        "fieldlabel" => "Date modified",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "date_due",
        "fieldname" => "date_due",
        "fieldlabel" => "Due date",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "date_start",
        "fieldname" => "date_start",
        "fieldlabel" => "Start Date",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls",
        "columnname"    => "modified_user_id",
        "fieldname"     => "modified_user_id",
        "fieldlabel"    => "Modified by",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "modified_user_id",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls",
        "columnname"    => "created_by",
        "fieldname"     => "created_by",
        "fieldlabel"    => "Created by",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "created_by",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls",
        "columnname"    => "assigned_user_id",
        "fieldname"     => "assigned_user_id",
        "fieldlabel"    => "Assigned user",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "assigned_user_id",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "deleted",
        "fieldname" => "deleted",
        "fieldlabel" => "Deleted",
        "uitype" => "checkbox",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "description",
        "fieldname" => "description",
        "fieldlabel" => "Description",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "status",
        "fieldname" => "status",
        "fieldlabel" => "Status",
        "uitype" => "enum",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "parent_type",
        "fieldname" => "parent_type",
        "fieldlabel" => "Parent type",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls",
        "columnname" => "parent_id",
        "fieldname" => "parent_id",
        "fieldlabel" => "Parent id",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
);

$mtceFields = array(
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "id",
        "fieldname" => "id",
        "fieldlabel" => "id",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "type",
        "fieldname" => "type",
        "fieldlabel" => "Type",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "name",
        "fieldname" => "name",
        "fieldlabel" => "Name",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "date_entered",
        "fieldname" => "date_entered",
        "fieldlabel" => "Date entered",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "date_modified",
        "fieldname" => "date_modified",
        "fieldlabel" => "Date modified",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "date_due",
        "fieldname" => "date_due",
        "fieldlabel" => "Due date",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "date_start",
        "fieldname" => "date_start",
        "fieldlabel" => "Start Date",
        "uitype" => "datetime",
        "typeofdata" => "DT~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls_emails",
        "columnname"    => "modified_user_id",
        "fieldname"     => "modified_user_id",
        "fieldlabel"    => "Modified by",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "modified_user_id",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls_emails",
        "columnname"    => "created_by",
        "fieldname"     => "created_by",
        "fieldlabel"    => "Created by",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "created_by",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename"     => "advancedreports_tasks_meetings_calls_emails",
        "columnname"    => "assigned_user_id",
        "fieldname"     => "assigned_user_id",
        "fieldlabel"    => "Assigned user",
        "uitype"        => "relate",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Users",
        "table"         => "users",
        "id_name"       => "assigned_user_id",
        "rname"         => "user_name",
        "presence" => 1,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "deleted",
        "fieldname" => "deleted",
        "fieldlabel" => "Deleted",
        "uitype" => "checkbox",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "description",
        "fieldname" => "description",
        "fieldlabel" => "Description",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "status",
        "fieldname" => "status",
        "fieldlabel" => "Status",
        "uitype" => "enum",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "parent_type",
        "fieldname" => "parent_type",
        "fieldlabel" => "Parent type",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
    array(
        "tablename" => "advancedreports_tasks_meetings_calls_emails",
        "columnname" => "parent_id",
        "fieldname" => "parent_id",
        "fieldlabel" => "Parent id",
        "uitype" => "txt",
        "typeofdata" => "V~O",
        "presence" => 1,
        "block" => -6,
    ),
);

if (!PlatformConnector::isSugar6V()) {
    $mtcField = array(
        "tablename"     => "advancedreports_tasks_meetings_calls",
        "columnname"    => "team_id",
        "fieldname"     => "team_id",
        "fieldlabel"    => "Team",
        "uitype"        => "txt",
        "typeofdata"    => "V~O",
        "block"         => -6,
        "related_module"=> "Teams",
        "table"         => "teams",
        "id_name"       => "team_id",
        "rname"         => "name",
        "presence" => 1,
    );

    $mtceField = $mtcField;
    $mtceField['tablename'] = "advancedreports_tasks_meetings_calls_emails";

    array_splice($mtcFields, 9, 0, array($mtcField));
    array_splice($mtceFields, 9, 0, array($mtceField));
}


$mtcefFields = $mtceFields;

foreach ($mtcefFields as &$mtcefField) {
    $mtcefField['tablename'] = 'ar_mtce_full';
}

$fields = array( // common fields
    'id', 'name', 'date_entered', 'date_modified', 'modified_user_id',
    'created_by', 'assigned_user_id', 'deleted', 'status',
    'parent_type', 'parent_id'
);

if (!function_exists('fieldDef')) {
    function fieldDef($fieldName, $opt = array())
    {
        return array(
            'fieldName' => $fieldName,
            'aliasField' => isset($opt['aliasField']) ? $opt['aliasField'] : null,
            'useColumn' => isset($opt['useColumn']) ? $opt['useColumn'] : true,
        );
    }
}

$dateEndField = fieldDef('date_end', array('aliasField' => 'date_due'));

// SuiteCRM and Sugar differs in column names
if(PlatformConnector::isSuiteCRM()) {
    $dateSentField = fieldDef('date_sent_received', array('aliasField' => 'date_due'));
    $teamIdField = fieldDef("team_id", array(
        "aliasField" => null,
        "useColumn" => false
    ));
} else {
    $dateSentField = fieldDef('date_sent', array('aliasField' => 'date_due'));
    $teamIdField = fieldDef("team_id");
}

$intentField = fieldDef('intent', array('aliasField' => 'description'));

$MTCQueryFields = array(
    'tasks' => array(
        'type' => 'Task',
        'fields' => array(fieldDef('description'), fieldDef('date_due'), fieldDef('date_start')),
        'custom' => array(),
    ),
    'meetings' => array(
        'type' => 'Meeting',
        'fields' => array(fieldDef('description'), $dateEndField, fieldDef('date_start')),
        'custom' => array(),
    ),
    'calls' => array(
        'type' => 'Call',
        'fields' => array(fieldDef('description'), $dateEndField, fieldDef('date_start')),
        'custom' => array(),
    ),
);

$MTCEQueryFields = array_merge($MTCQueryFields, array(
    'emails' => array(
        'type' => 'Email',
        'fields' => array($intentField, $dateSentField, fieldDef('date_start', array('useColumn' => false))),
        'custom' => array(),
    ),
));

foreach ($MTCQueryFields as $table => $definitions) {
    $fieldDefinitions = $definitions['fields'];

    foreach ($fields as $field) {
        $fieldDefinitions[] = fieldDef($field);
    }

    $fieldDefinitions[] = $teamIdField;

    $MTCQueryFields[$table]['fields'] = $fieldDefinitions;
}

foreach ($MTCEQueryFields as $table => $definitions) {
    $fieldDefinitions = $definitions['fields'];

    foreach ($fields as $field) {
        $fieldDefinitions[] = fieldDef($field);
    }

    $fieldDefinitions[] = $teamIdField;

    $MTCEQueryFields[$table]['fields'] = $fieldDefinitions;
}

return array(
    //table created via job CombineMeetingsTasksCallsJob.php
    "MTC" => array(
        "fields" => $mtcFields,
        "tab_name_index" => array(
            array("name"=>"advancedreports_tasks_meetings_calls", "idCol"=>"id")
            //"advancedreports_tasks_meetings_calls" => "id",
        ),
        "table_name" => "advancedreports_tasks_meetings_calls",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -6,
                "blocklabel" => "Tasks, meetings, calls",
            )
        ),
        "query_definitions" => $MTCQueryFields,
    ),
    //table created via job CombineMeetingsTasksCallsEmailsJob.php
    "MTCE" => array(
        "fields" => $mtceFields,
        "tab_name_index" => array(
            array("name"=>"advancedreports_tasks_meetings_calls_emails", "idCol"=>"id")
            //"advancedreports_tasks_meetings_calls" => "id",
        ),
        "table_name" => "advancedreports_tasks_meetings_calls_emails",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -6,
                "blocklabel" => "Tasks, meetings, calls, emails",
            )
        ),
        "query_definitions" => $MTCEQueryFields,
    ),
    "MTCEF" => array(
        "fields" => $mtcefFields,
        "tab_name_index" => array(
            array("name"=>"ar_mtce_full", "idCol"=>"id")
        ),
        "table_name" => "ar_mtce_full",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -6,
                "blocklabel" => "Tasks, meetings, calls, emails (full)",
            )
        ),
        "query_definitions" => $MTCEQueryFields,
    ),
    "Opportunities_contacts" => array(
        "fields" => array(
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "id",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "contact_id",
                "fieldname" => "contact_id",
                "fieldlabel" => "Contact id",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "opportunity_id",
                "fieldname" => "opportunity_id",
                "fieldlabel" => "Opportunity id",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "contact_role",
                "fieldname" => "contact_role",
                "fieldlabel" => "Contact role",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "date_modified",
                "fieldname" => "date_modified",
                "fieldlabel" => "Due modified",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "opportunities_contacts",
                "columnname" => "deleted",
                "fieldname" => "deleted",
                "fieldlabel" => "Deleted",
                "uitype" => "bool",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
        ),
        "tab_name_index" => array(
            array("name"=>"opportunities_contacts", "idCol"=>"id")
            //"advancedreports_tasks_meetings_calls" => "id",
        ),
        "table_name" => "opportunities_contacts",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -6,
                "blocklabel" => "Opportunities Contacts",
            )
        )
    ),
    "Currencies" => array(
        "fields" => array(
            array(
                "tablename" => "currencies",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "id",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "symbol",
                "fieldname" => "symbol",
                "fieldlabel" => "Symbol",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "iso4217",
                "fieldname" => "iso4217",
                "fieldlabel" => "ISO4217",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "conversion_rate",
                "fieldname" => "conversion_rate",
                "fieldlabel" => "Conversion rate",
                "uitype" => "float",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "status",
                "fieldname" => "status",
                "fieldlabel" => "Status",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "deleted",
                "fieldname" => "deleted",
                "fieldlabel" => "Deleted",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "date_entered",
                "fieldname" => "date_entered",
                "fieldlabel" => "Date entered",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename" => "currencies",
                "columnname" => "date_modified",
                "fieldname" => "date_modified",
                "fieldlabel" => "Due modified",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => -6,
            ),
            array(
                "tablename"     => "currencies",
                "columnname"    => "created_by",
                "fieldname"     => "created_by",
                "fieldlabel"    => "Created by",
                "uitype"        => "relate",
                "typeofdata"    => "V~O",
                "block"         => -6,
                "related_module"=> "Users",
                "table"         => "users",
                "id_name"       => "created_by",
                "rname"         => "user_name",
                "presence" => 1,
            ),
        ),
        "tab_name_index" => array(
            array("name"=>"currencies", "idCol"=>"id")
            //"advancedreports_tasks_meetings_calls" => "id",
        ),
        "table_name" => "currencies",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -6,
                "blocklabel" => "Currencies",
            )
        )
    ),
    "EmailAddrRel" => array(
        "fields" => array(
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "EmailAddrRel ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "email_id",
                "fieldname" => "email_id",
                "fieldlabel" => "Email ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "address_type",
                "fieldname" => "address_type",
                "fieldlabel" => "Address Type",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "email_address_id",
                "fieldname" => "email_address_id",
                "fieldlabel" => "Email Address ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "parent_type",
                "fieldname" => "parent_type",
                "fieldlabel" => "Parent Type",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "parent_id",
                "fieldname" => "parent_id",
                "fieldlabel" => "Parent ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "deleted",
                "fieldname" => "deleted",
                "fieldlabel" => "Deleted",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "date_entered",
                "fieldname" => "date_entered",
                "fieldlabel" => "Date Entered",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => -7,
            ),
            array(
                "tablename" => "emails_email_addr_rel",
                "columnname" => "date_modified",
                "fieldname" => "date_modified",
                "fieldlabel" => "Date Modified",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => -7,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "emails_email_addr_rel",
                "idCol" => "id"
            )
        ),
        "table_name" => "emails_email_addr_rel",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => -7,
                "blocklabel" => "Emails EmailAddress",
            )
        )
    ),

    /**
     * Leadjig modules
     */
    "LeadjigUsers" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_users",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 101,
            ),
            array(
                "tablename" => "ar_lj_users",
                "columnname" => "email",
                "fieldname" => "email",
                "fieldlabel" => "Email",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 101,
            ),
            array(
                "tablename" => "ar_lj_users",
                "columnname" => "first_name",
                "fieldname" => "first_name",
                "fieldlabel" => "First Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 101,
            ),
            array(
                "tablename" => "ar_lj_users",
                "columnname" => "last_name",
                "fieldname" => "last_name",
                "fieldlabel" => "Last Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 101,
            ),
            array(
                "tablename" => "ar_lj_users",
                "columnname" => "company_name",
                "fieldname" => "company_name",
                "fieldlabel" => "Company Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 101,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_users",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_users",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 101,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigCampaigns" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "headline",
                "fieldname" => "headline",
                "fieldlabel" => "Headline",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "views",
                "fieldname" => "views",
                "fieldlabel" => "Views",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "emails_sent",
                "fieldname" => "emails_sent",
                "fieldlabel" => "Emails sent",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "first_event_date",
                "fieldname" => "first_event_date",
                "fieldlabel" => "First event date",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "last_event_date",
                "fieldname" => "last_event_date",
                "fieldlabel" => "Last event date",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "user_id",
                "fieldname" => "user_id",
                "fieldlabel" => "User ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "reach",
                "fieldname" => "reach",
                "fieldlabel" => "Reach",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "total_attendee_count",
                "fieldname" => "total_attendee_count",
                "fieldlabel" => "Total attendee count",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "total_registrations_count",
                "fieldname" => "total_registrations_count",
                "fieldlabel" => "Total registrations count",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
//            array(
//                "tablename" => "ar_lj_campaigns",
//                "columnname" => "topic",
//                "fieldname" => "topic",
//                "fieldlabel" => "Topic",
//                "uitype" => "txt",
//                "typeofdata" => "V~O",
//                "presence" => 1,
//                "block" => 102,
//            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "topic_to_s",
                "fieldname" => "topic_to_s",
                "fieldlabel" => "Topic",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "created_at",
                "fieldname" => "created_at",
                "fieldlabel" => "Created At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 102,
            ),
            array(
                "tablename" => "ar_lj_campaigns",
                "columnname" => "updated_at",
                "fieldname" => "updated_at",
                "fieldlabel" => "Updated At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 102,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_campaigns",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_campaigns",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 102,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigEvents" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "user_id",
                "fieldname" => "user_id",
                "fieldlabel" => "User ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "campaign_id",
                "fieldname" => "campaign_id",
                "fieldlabel" => "Campaign ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "venue",
                "fieldname" => "venue",
                "fieldlabel" => "Venue",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "sugar_campaign_name",
                "fieldname" => "sugar_campaign_name",
                "fieldlabel" => "Sugar Campaign Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "attendee_count",
                "fieldname" => "attendee_count",
                "fieldlabel" => "Attendee Count",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "created_at",
                "fieldname" => "created_at",
                "fieldlabel" => "Created At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 103,
            ),
            array(
                "tablename" => "ar_lj_events",
                "columnname" => "updated_at",
                "fieldname" => "updated_at",
                "fieldlabel" => "Updated At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 103,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_events",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_events",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 103,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigEventRecords" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "event_id",
                "fieldname" => "event_id",
                "fieldlabel" => "Event ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "lure_id",
                "fieldname" => "lure_id",
                "fieldlabel" => "Lure ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "contact_id",
                "fieldname" => "contact_id",
                "fieldlabel" => "Contact ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "is_guest",
                "fieldname" => "is_guest",
                "fieldlabel" => "Is Guest",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "waitlisted",
                "fieldname" => "waitlisted",
                "fieldlabel" => "Waitlisted",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
//            array(
//                "tablename" => "ar_lj_event_records",
//                "columnname" => "confirmation_status",
//                "fieldname" => "confirmation_status",
//                "fieldlabel" => "Confirmation Status",
//                "uitype" => "txt",
//                "typeofdata" => "V~O",
//                "presence" => 1,
//                "block" => 104,
//            ),
//            array(
//                "tablename" => "ar_lj_event_records",
//                "columnname" => "attended_status",
//                "fieldname" => "attended_status",
//                "fieldlabel" => "Attended Status",
//                "uitype" => "txt",
//                "typeofdata" => "V~O",
//                "presence" => 1,
//                "block" => 104,
//            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "confirmation_call_status",
                "fieldname" => "confirmation_call_status",
                "fieldlabel" => "Confirmation Call Status",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "created_at",
                "fieldname" => "created_at",
                "fieldlabel" => "Created At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "updated_at",
                "fieldname" => "updated_at",
                "fieldlabel" => "Updated At",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "communication_opt_in",
                "fieldname" => "communication_opt_in",
                "fieldlabel" => "Communication Opt In",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "medicare_communication_opt_in",
                "fieldname" => "medicare_communication_opt_in",
                "fieldlabel" => "Medicare Communication Opt In",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "opt_in_accepted",
                "fieldname" => "opt_in_accepted",
                "fieldlabel" => "Opt In Accepted",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "opt_in_text",
                "fieldname" => "opt_in_text",
                "fieldlabel" => "Opt In Text",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "source_medium_to_s",
                "fieldname" => "source_medium_to_s",
                "fieldlabel" => "Source Medium",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "confirmation_status_to_s",
                "fieldname" => "confirmation_status_to_s",
                "fieldlabel" => "Confirmation Status",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "attended_status_to_s",
                "fieldname" => "attended_status_to_s",
                "fieldlabel" => "Attended Status",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "paid",
                "fieldname" => "paid",
                "fieldlabel" => "Paid",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "guest_of_paid",
                "fieldname" => "guest_of_paid",
                "fieldlabel" => "Guest Of Paid",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
            array(
                "tablename" => "ar_lj_event_records",
                "columnname" => "relationship",
                "fieldname" => "relationship",
                "fieldlabel" => "Relationship",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 104,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_event_records",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_event_records",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 104,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigLures" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "channel",
                "fieldname" => "channel",
                "fieldlabel" => "Channel",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "code",
                "fieldname" => "code",
                "fieldlabel" => "Code",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "needs_toll_number",
                "fieldname" => "needs_toll_number",
                "fieldlabel" => "Needs Toll Number",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "leads_processed_at",
                "fieldname" => "leads_processed_at",
                "fieldlabel" => "Leads Processed At",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "deployment_status",
                "fieldname" => "deployment_status",
                "fieldlabel" => "Deployment Status",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "end_date",
                "fieldname" => "end_date",
                "fieldlabel" => "End Date",
                "uitype" => "date",
                "typeofdata" => "D~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "deployment_date",
                "fieldname" => "deployment_date",
                "fieldlabel" => "Deployment Date",
                "uitype" => "date",
                "typeofdata" => "D~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "available_units",
                "fieldname" => "available_units",
                "fieldlabel" => "Available Units",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "selected_units",
                "fieldname" => "selected_units",
                "fieldlabel" => "Selected Units",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "purchased_units",
                "fieldname" => "purchased_units",
                "fieldlabel" => "Purchased Units",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "mailjig_campaign_id",
                "fieldname" => "mailjig_campaign_id",
                "fieldlabel" => "Mailjig Campaign ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "icon",
                "fieldname" => "icon",
                "fieldlabel" => "Icon",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "status",
                "fieldname" => "status",
                "fieldlabel" => "Status",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "unit",
                "fieldname" => "unit",
                "fieldlabel" => "Unit",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "leads_processing",
                "fieldname" => "leads_processing",
                "fieldlabel" => "Leads Processing",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "has_leads",
                "fieldname" => "has_leads",
                "fieldlabel" => "Has Leads",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_direct_mail",
                "fieldname" => "is_direct_mail",
                "fieldlabel" => "Is Direct Mail",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_radio",
                "fieldname" => "is_radio",
                "fieldlabel" => "Is Radio",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_digital",
                "fieldname" => "is_digital",
                "fieldlabel" => "Is Digital",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_email",
                "fieldname" => "is_email",
                "fieldlabel" => "Is Email",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_pending",
                "fieldname" => "is_pending",
                "fieldlabel" => "Is Pending",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_ready",
                "fieldname" => "is_ready",
                "fieldlabel" => "Is Ready",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_approved",
                "fieldname" => "is_approved",
                "fieldlabel" => "Is Approved",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_stable",
                "fieldname" => "is_stable",
                "fieldlabel" => "Is Stable",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_deployed",
                "fieldname" => "is_deployed",
                "fieldlabel" => "Is Deployed",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_active",
                "fieldname" => "is_active",
                "fieldlabel" => "Is Active",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "has_pending_items",
                "fieldname" => "has_pending_items",
                "fieldlabel" => "Has Pending Items",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_completed",
                "fieldname" => "is_completed",
                "fieldlabel" => "Is Completed",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "is_expiring_early",
                "fieldname" => "is_expiring_early",
                "fieldlabel" => "Is Expiring Early",
                "uitype" => "checkbox",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "langing_page_url",
                "fieldname" => "langing_page_url",
                "fieldlabel" => "Landing Page URL",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
            array(
                "tablename" => "ar_lj_lures",
                "columnname" => "fb_ad_manager_url",
                "fieldname" => "fb_ad_manager_url",
                "fieldlabel" => "FB Ad Manager URL",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 105,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_lures",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_lures",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 105,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigAges" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_ages",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 106,
            ),
            array(
                "tablename" => "ar_lj_ages",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 106,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_ages",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_ages",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 106,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigAssets" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_assets",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 107,
            ),
            array(
                "tablename" => "ar_lj_assets",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 107,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_assets",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_assets",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 107,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigIncomes" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_incomes",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 108,
            ),
            array(
                "tablename" => "ar_lj_incomes",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 108,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_incomes",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_incomes",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 108,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigZips" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_zips",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 109,
            ),
            array(
                "tablename" => "ar_lj_zips",
                "columnname" => "name",
                "fieldname" => "name",
                "fieldlabel" => "Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 109,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_zips",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_zips",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 109,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigContacts" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "sugar_contact_id",
                "fieldname" => "sugar_contact_id",
                "fieldlabel" => "Sugar Contact ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "sugar_lead_id",
                "fieldname" => "sugar_lead_id",
                "fieldlabel" => "Sugar Lead ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "first_name",
                "fieldname" => "first_name",
                "fieldlabel" => "First Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "last_name",
                "fieldname" => "last_name",
                "fieldlabel" => "Last Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "full_name",
                "fieldname" => "full_name",
                "fieldlabel" => "Full Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "email",
                "fieldname" => "email",
                "fieldlabel" => "Email",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "phone",
                "fieldname" => "phone",
                "fieldlabel" => "Phone",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "address_full",
                "fieldname" => "address_full",
                "fieldlabel" => "Address Full",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "zip",
                "fieldname" => "zip",
                "fieldlabel" => "ZIP",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "city",
                "fieldname" => "city",
                "fieldlabel" => "City",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "state",
                "fieldname" => "state",
                "fieldlabel" => "State",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "county",
                "fieldname" => "county",
                "fieldlabel" => "County",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "street",
                "fieldname" => "street",
                "fieldlabel" => "Street",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "country",
                "fieldname" => "country",
                "fieldlabel" => "Country",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "state_full",
                "fieldname" => "state_full",
                "fieldlabel" => "State Full",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "street_full",
                "fieldname" => "street_full",
                "fieldlabel" => "Street Full",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "country_full",
                "fieldname" => "country_full",
                "fieldlabel" => "Country Full",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "street_number",
                "fieldname" => "street_number",
                "fieldlabel" => "Street Number",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "street_address",
                "fieldname" => "street_address",
                "fieldlabel" => "Street Address",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "postal_code_suffix",
                "fieldname" => "postal_code_suffix",
                "fieldlabel" => "Postal Code Suffix",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "administrative_area_level_3",
                "fieldname" => "administrative_area_level_3",
                "fieldlabel" => "Administrative Are Level 3",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "has_special_name",
                "fieldname" => "has_special_name",
                "fieldlabel" => "Has Special Name",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "income",
                "fieldname" => "income",
                "fieldlabel" => "Income",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "worth",
                "fieldname" => "worth",
                "fieldlabel" => "Worth",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
            array(
                "tablename" => "ar_lj_contacts",
                "columnname" => "age",
                "fieldname" => "age",
                "fieldlabel" => "Age",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 110,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_contacts",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_contacts",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 110,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
    "LeadjigContactsToLeads" => array(
        "fields" => array(
            array(
                "tablename" => "ar_lj_contacts_leads",
                "columnname" => "id",
                "fieldname" => "id",
                "fieldlabel" => "ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 111,
            ),
            array(
                "tablename" => "ar_lj_contacts_leads",
                "columnname" => "contact_id",
                "fieldname" => "contact_id",
                "fieldlabel" => "Leadjig Contact ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 111,
            ),
            array(
                "tablename" => "ar_lj_contacts_leads",
                "columnname" => "lead_id",
                "fieldname" => "lead_id",
                "fieldlabel" => "Sugar Lead ID",
                "uitype" => "txt",
                "typeofdata" => "V~O",
                "presence" => 1,
                "block" => 111,
            ),
            array(
                "tablename" => "ar_lj_contacts_leads",
                "columnname" => "date_entered",
                "fieldname" => "date_entered",
                "fieldlabel" => "Date Entered",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 111,
            ),
            array(
                "tablename" => "ar_lj_contacts_leads",
                "columnname" => "date_modified",
                "fieldname" => "date_modified",
                "fieldlabel" => "Date Modified",
                "uitype" => "datetime",
                "typeofdata" => "DT~O",
                "presence" => 1,
                "block" => 111,
            ),
        ),
        "tab_name_index" => array(
            array(
                "name" => "ar_lj_contacts_leads",
                "idCol" => "id"
            )
        ),
        "table_name" => "ar_lj_contacts_leads",
        "table_index" => "id",
        "blocks" => array(
            array(
                "blockid" => 111,
                "blocklabel" => "Information",
            )
        ),
        "query_definitions" => null,
    ),
);