<form class="cmxform" >
  Lumping and splitting are special cases of Relationships. They implement a means to implement changes in the taxon list over time, as individual taxa are split up into a set of taxa, or the opposite, where several taxa are lumped together into another.<br/><br/>
<?php 
if ($can_split == false) {
    echo html::initial_value($values, 'taxon:taxon') . ' ' . $splitRecord->forward_term . ' ';
    $first = true;
    foreach ($split as $target) {
        $t1 = ORM::factory('taxa_taxon_list', array('preferred' => 't', 'taxon_meaning_id' => $target->to_taxon_meaning_id));
        $t2 = ORM::factory('taxon', $t1->taxon_id);
        echo ($first == true ? '' : ', ') . $t2->taxon;
        $first = false;
    }
    echo '.<br/><br/>';
}
if ($can_lump == false) {
    echo html::initial_value($values, 'taxon:taxon') . ' ' . $lumpRecord->forward_term . ' ';
    $first = true;
    foreach ($lumped as $target) {
        $t1 = ORM::factory('taxa_taxon_list', array('preferred' => 't', 'taxon_meaning_id' => $target->to_taxon_meaning_id));
        $t2 = ORM::factory('taxon', $t1->taxon_id);
        echo ($first == true ? '' : ', ') . $t2->taxon;
        $first = false;
    }
    echo '.<br/><br/>';
}
if ($can_split || $can_lump) {
    ?>
    <input id="LStaxon" name="LStaxon" value="" />
    <input type="hidden" id="LStaxon_meaning_id" />
    <input type="button" value="Add to List" onClick="addLStaxon()" class="ui-corner-all ui-state-default button" /><br/>
    <table id="LS_taxa_table" class="ui-widget ui-widget-content"><thead class="ui-widget-header" ><tr class="headingRow" >
" method="post" enctype="multipart/form-data">
<?php 
echo $metadata;
?>
<fieldset>
<input type="hidden" name="occurrence_comment:id" value="<?php 
echo $id;
?>
" />
<input type="hidden" name="occurrence_comment:occurrence_id" value="<?php 
echo html::initial_value($values, 'occurrence_comment:occurrence_id');
?>
" />
<legend>Occurrence Comment</legend>
<?php 
if (html::initial_value($values, 'occurrence_comment:auto_generated') === 't') {
    ?>
  <p>This comment was generated by the auto verification rule  
      <?php 
    echo html::initial_value($values, 'occurrence_comment:generated_by');
    ?>
.</p>
<?php 
}
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'occurrence_comment:comment', 'default' => html::initial_value($values, 'occurrence_comment:comment')));
?>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
?>
</form>
"
    <?php 
echo $enabled;
?>
 /> <?php 
echo html::error_message($model->getError('valid_max'));
?>
  </li>
  <li id="li_valid_date_in_past">
    <label class="narrow" for="valid_date_in_past">Date is in past</label><?php 
echo form::checkbox('valid_date_in_past', TRUE, isset($model->valid_date_in_past) and $model->valid_date_in_past == 't', 'class="vnarrow" ' . $enabled);
echo html::error_message($model->getError('valid_date_in_past'));
?>
  </li>
  <li id="li_valid_time"><label class="narrow" for="valid_integer">Time</label><?php 
echo form::checkbox('valid_time', TRUE, isset($model->valid_time) and $model->valid_time == 't', 'class="vnarrow" ' . $enabled);
?>
</li>
</ol>
</fieldset>
<?php 
// Output the view that lets this custom attribute associate with websites, surveys, checklists
// or whatever is appropriate for the attribute type.
$this->associationsView->other_data = $other_data;
$this->associationsView->model = $model;
echo $this->associationsView;
echo $metadata;
echo html::form_buttons(html::initial_value($values, $model->object_name . ':id') != null);
?>
</form>
<legend>Verification rule details</legend>
<?php 
data_entry_helper::link_default_stylesheet();
data_entry_helper::enable_validation('entry-form');
if (isset($values['verification_rule:id'])) {
    ?>
  <input type="hidden" name="verification_rule:id" value="<?php 
    echo html::initial_value($values, 'verification_rule:id');
    ?>
" />
<?php 
}
echo data_entry_helper::text_input(array('label' => 'Title', 'fieldname' => 'verification_rule:title', 'class' => 'control-width-4', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:title')));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'verification_rule:description', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:description')));
echo data_entry_helper::text_input(array('label' => 'Test Type', 'fieldname' => 'verification_rule:test_type', 'class' => 'control-width-4', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:test_type')));
echo data_entry_helper::text_input(array('label' => 'Source URL', 'fieldname' => 'verification_rule:source_url', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:source_url'), 'helpText' => 'When this verification rule file was imported, this identifies the name of the file ' . 'it was imported from'));
echo data_entry_helper::text_input(array('label' => 'Source Filename', 'fieldname' => 'verification_rule:source_filename', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:source_filename')));
echo data_entry_helper::text_input(array('label' => 'Error Message', 'fieldname' => 'verification_rule:error_message', 'class' => 'control-width-6', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:error_message')));
echo data_entry_helper::checkbox(array('label' => 'Reverse Rule', 'fieldname' => 'verification_rule:reverse_rule', 'default' => html::initial_value($values, 'verification_rule:reverse_rule'), 'helpText' => 'Tick this box to reverse the rule logic - i.e. items that pass the test are flagged as failures.'));
echo data_entry_helper::textarea(array('label' => 'Metadata', 'fieldname' => 'metaFields:metadata', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'metaFields:metadata'), 'helpText' => 'Additional settings from the header of the verification rule file, in parameter=value format with ' . 'one parameter per line'));
echo data_entry_helper::textarea(array('label' => 'Other Data', 'fieldname' => 'metaFields:data', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'metaFields:data'), 'helpText' => 'Additional settings from the data part of the verification rule file, with blocks of data items ' . 'started by a header name in square brackets, followed by parameters in parameter=value format with ' . 'one parameter per line'));
echo $metadata;
echo html::form_buttons(html::initial_value($values, 'verification_rule:id') != null, false, false);
data_entry_helper::link_default_stylesheet();
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
        $name .= ':' . $attr['id'];
    }
    echo '<li><label for="">' . $attr['caption'] . "</label>\n";
    switch ($attr['data_type']) {
        case 'D':
            echo form::input($name, $attr['value'], 'class="date-picker"');
            break;
        case 'V':
            echo form::input($name, $attr['value'], 'class="vague-date-picker"');
            break;
        case 'L':
            echo form::dropdown($name, $values['terms_' . $attr['termlist_id']], $attr['raw_value']);
            break;
        case 'B':
            echo form::dropdown($name, array('' => '', '0' => 'false', '1' => 'true'), $attr['value']);
            break;
        default:
            echo form::input($name, $attr['value']);
    }
    echo '<br/>' . html::error_message($model->getError($name)) . '</li>';
}
?>
 </ol>
 </fieldset>
 
<?php 
echo html::form_buttons(html::initial_value($values, 'occurrence:id') != null, false, false);
?>
</form>

        }
        switch ($attr['data_type']) {
            case 'D':
            case 'V':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            case 'L':
                echo data_entry_helper::select(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['raw_value'], 'lookupValues' => $values['terms_' . $attr['termlist_id']], 'blankText' => '<Please select>'));
                break;
            case 'B':
                echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            default:
                echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
        }
    }
    ?>
</ol>
</fieldset>
<?php 
}
echo html::form_buttons(html::initial_value($values, 'identifier:id') != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'json';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
?>
" />
<legend>Taxon Group details</legend>
<ol>
<li>
<label for="title">Title</label>
<input id="title" name="taxon_group:title" value="<?php 
echo html::initial_value($values, 'taxon_group:title');
?>
" />
<?php 
echo html::error_message($model->getError('taxon_group:title'));
?>
</li>
<li>
<label for="title">External key</label>
<input id="title" name="taxon_group:external_key" value="<?php 
echo html::initial_value($values, 'taxon_group:external_key');
?>
" />
<?php 
echo html::error_message($model->getError('taxon_group:external_key'));
?>
</li>
</ol>
</fieldset>
<?php 
echo html::form_buttons(html::initial_value($values, 'taxon_group:id') != null);
?>
</form>
Esempio n. 8
0
        switch ($attr['data_type']) {
            case 'D':
            case 'V':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            case 'L':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['raw_value'], 'lookupValues' => $values['terms_' . $attr['termlist_id']]));
                break;
            case 'B':
                echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            default:
                echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
        }
    }
    ?>
   </ol>
   </fieldset>
</div>
<?php 
}
echo html::form_buttons(html::initial_value($values, 'location:id') != null, $disabled_input === 'YES');
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('location-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
  
        }
        switch ($attr['data_type']) {
            case 'D':
            case 'V':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            case 'L':
                echo data_entry_helper::select(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['raw_value'], 'lookupValues' => $values['terms_' . $attr['termlist_id']], 'blankText' => '<Please select>'));
                break;
            case 'B':
                echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            default:
                echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
        }
    }
    ?>
</ol>
</fieldset>
<?php 
}
echo html::form_buttons(html::initial_value($values, 'known_subject:id') != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'json';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
?>
 </div><div id="div-provide_for_verification"><?php 
echo data_entry_helper::checkbox(array('label' => 'Provides data for verification', 'helpText' => 'Check this box if the website provides its data to other agreement participants for verification.', 'fieldname' => 'websites_website_agreement:provide_for_verification', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_verification'), 'labelClass' => 'control-width-4'));
?>
 </div><div id="div-receive_for_verification"><?php 
echo data_entry_helper::checkbox(array('label' => 'Receives data for verification', 'helpText' => 'Check this box if the website receives data from other agreement participants for verification.', 'fieldname' => 'websites_website_agreement:receive_for_verification', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_verification'), 'labelClass' => 'control-width-4'));
?>
 </div><div id="div-provide_for_data_flow"><?php 
echo data_entry_helper::checkbox(array('label' => 'Provides data for data flow', 'helpText' => 'Check this box if the website provides its data to other agreement participants for data flow, e.g. for passing data onto national information portals.', 'fieldname' => 'websites_website_agreement:provide_for_data_flow', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_data_flow'), 'labelClass' => 'control-width-4'));
?>
 </div><div id="div-receive_for_data_flow"><?php 
echo data_entry_helper::checkbox(array('label' => 'Receives data for data flow', 'helpText' => 'Check this box if the website receives data from other agreement participants for data flow, e.g. for passing data onto national information portals.', 'fieldname' => 'websites_website_agreement:receive_for_data_flow', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_data_flow'), 'labelClass' => 'control-width-4'));
?>
 </div><div id="div-provide_for_moderation"><?php 
echo data_entry_helper::checkbox(array('label' => 'Provides data for moderation', 'helpText' => 'Check this box if the website provides its data to other agreement participants for moderation, e.g. to check images before publishing.', 'fieldname' => 'websites_website_agreement:provide_for_moderation', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_moderation'), 'labelClass' => 'control-width-4'));
?>
 </div><div id="div-receive_for_moderation"><?php 
echo data_entry_helper::checkbox(array('label' => 'Receives data for moderation', 'helpText' => 'Check this box if the website receives data from other agreement participants for moderation, e.g. to check images before publishing.', 'fieldname' => 'websites_website_agreement:receive_for_moderation', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_moderation'), 'labelClass' => 'control-width-4'));
?>
</div>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('websites-website-agreement-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
Esempio n. 11
0
?>
" /><br/>
<?php 
echo data_entry_helper::date_picker(array('label' => 'Date', 'fieldname' => 'sample:date', 'default' => html::initial_value($values, 'sample:date'), 'class' => 'required'));
echo data_entry_helper::sref_and_system(array('label' => 'Spatial Ref', 'fieldname' => 'sample:entered_sref', 'geomFieldname' => 'sample:geom', 'default' => html::initial_value($values, 'sample:entered_sref'), 'defaultGeom' => html::initial_value($values, 'sample:geom'), 'systems' => spatial_ref::system_list(), 'defaultSystem' => html::initial_value($values, 'sample:entered_sref_system'), 'class' => 'control-width-3', 'validation' => 'required'));
?>
<p class="instruct">Zoom the map in by double-clicking then single click on the sample's centre to set the
spatial reference. The more you zoom in, the more accurate the reference will be.</p>
<?php 
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
echo map_helper::map_panel(array('readAuth' => $readAuth, 'presetLayers' => array('google_satellite', 'google_streets'), 'editLayer' => true, 'layers' => array(), 'initial_lat' => 52, 'initial_long' => -2, 'initial_zoom' => 7, 'width' => 870, 'height' => 400, 'initialFeatureWkt' => html::initial_value($values, 'sample:geom'), 'standardControls' => array('layerSwitcher', 'panZoom')));
echo data_entry_helper::text_input(array('label' => 'Location Name', 'fieldname' => 'sample:location_name', 'default' => html::initial_value($values, 'sample:location_name')));
echo data_entry_helper::textarea(array('label' => 'Recorder Names', 'helpText' => 'Enter the names of the recorders, one per line', 'fieldname' => 'sample:recorder_names', 'default' => html::initial_value($values, 'sample:recorder_names')));
echo data_entry_helper::select(array('label' => 'Sample Method', 'fieldname' => 'sample:sample_method_id', 'default' => html::initial_value($values, 'sample:sample_method_id'), 'lookupValues' => $other_data['method_terms'], 'blankText' => '<Please select>'));
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'sample:comment', 'default' => html::initial_value($values, 'sample:comment')));
echo data_entry_helper::text_input(array('label' => 'External Key', 'fieldname' => 'sample:external_key', 'default' => html::initial_value($values, 'sample:external_key')));
?>
 </fieldset>
 <fieldset>
 <legend>Survey Specific Attributes</legend>
 <ol>
 <?php 
foreach ($values['attributes'] as $attr) {
    $name = 'smpAttr:' . $attr['sample_attribute_id'];
    // if this is an existing attribute, tag it with the attribute value record id so we can re-save it
    if ($attr['id']) {
        $name .= ':' . $attr['id'];
    }
    switch ($attr['data_type']) {
        case 'D':
        case 'V':
Esempio n. 12
0
        switch ($attr['data_type']) {
            case 'D':
            case 'V':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            case 'L':
                echo data_entry_helper::select(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['raw_value'], 'lookupValues' => $values['terms_' . $attr['termlist_id']], 'blankText' => '<Please select>'));
                break;
            case 'B':
                echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            default:
                echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
        }
    }
    ?>
 </ol>
 </fieldset>
<?php 
}
echo html::form_buttons(html::initial_value($values, 'survey:id') != null);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('survey-edit');
data_entry_helper::link_default_stylesheet();
data_entry_helper::$javascript .= "\n// ensure the parent lookup does not allow an inappropriate survey to be selected (i.e. self or wrong website)\nfunction setParentFilter() {  \n  var filter={\"query\":{}};\n  filter.query.notin=['id', [1]];\n  filter.query.where=['website_id', \$('#survey\\\\:website_id').val()];\n  filter.query=JSON.stringify(filter.query);\n  \$('#survey\\\\:parent_id\\\\:title').setExtraParams(filter);\n}\n\$('#survey\\\\:website_id').change(function() {\n  \$('#survey\\\\:parent_id\\\\:title').val('');\n  \$('#survey\\\\:parent_id').val('');\n  setParentFilter();\n});\nsetParentFilter();\n";
echo data_entry_helper::dump_javascript();
?>
</form>
<fieldset>
<input type="hidden" name="website_agreement:id" value="<?php 
echo html::initial_value($values, 'website_agreement:id');
?>
" />
<legend>Website Agreement Details</legend>
<?php 
echo data_entry_helper::text_input(array('label' => 'Agreement title', 'helpText' => 'Enter the title of the agreement', 'fieldname' => 'website_agreement:title', 'default' => html::initial_value($values, 'website_agreement:title')));
echo data_entry_helper::textarea(array('label' => 'Description', 'helpText' => 'Enter an optional description of the agreement', 'fieldname' => 'website_agreement:description', 'default' => html::initial_value($values, 'website_agreement:description')));
echo data_entry_helper::select(array('label' => 'Providing data for reporting', 'helpText' => 'Select the requirements of participants with respect to providing data for reporting. When data is provided ' . 'by a website, other websites participating in the same agreement will be able to report on this data if they select to receive ' . 'data for reporting.', 'fieldname' => 'website_agreement:provide_for_reporting', 'default' => html::initial_value($values, 'website_agreement:provide_for_reporting'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Receive data for reporting', 'helpText' => 'Select the requirements of participants with respect to receiving data for reporting. When a website selects ' . 'to receive data for reporting, reports run on the website can include data from other websites participating in the same ' . 'agreement if they elect to provide data for reporting.', 'fieldname' => 'website_agreement:receive_for_reporting', 'default' => html::initial_value($values, 'website_agreement:receive_for_reporting'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Providing data for peer review', 'helpText' => 'Select the requirements of participants with respect to providing data for peer review. When data is provided ' . 'by a website, other websites participating in the same agreement will be able to review this data if they select to receive ' . 'data for peer review.', 'fieldname' => 'website_agreement:provide_for_peer_review', 'default' => html::initial_value($values, 'website_agreement:provide_for_peer_review'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Receive data for peer review', 'helpText' => 'Select the requirements of participants with respect to receiving data for peer review. When a website selects ' . 'to receive data for peer review, review processes such as record reviewing and commenting run on the website can include ' . 'data from other websites participating in the same agreement if they elect to provide data for peer review.', 'fieldname' => 'website_agreement:receive_for_peer_review', 'default' => html::initial_value($values, 'website_agreement:receive_for_peer_review'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Providing data for verification', 'helpText' => 'Select the requirements of participants with respect to providing data for verification. When data is provided ' . 'by a website, other websites participating in the same agreement will be able to verify this data if they select to receive ' . 'data for verification.', 'fieldname' => 'website_agreement:provide_for_verification', 'default' => html::initial_value($values, 'website_agreement:provide_for_verification'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Receive data for verification', 'helpText' => 'Select the requirements of participants with respect to receiving data for verification. When a website selects ' . 'to receive data for verification, verification systems run on the website can include data from other websites ' . 'participating in the same agreement if they elect to provide data for verification.', 'fieldname' => 'website_agreement:receive_for_verification', 'default' => html::initial_value($values, 'website_agreement:receive_for_verification'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Providing data for data flow', 'helpText' => 'Select the requirements of participants with respect to providing data for data flow. When data is provided ' . 'by a website, other websites participating in the same agreement will be able to pass this data on (for example ' . 'to a national informaiton portal) if they select to receive data for data flow.', 'fieldname' => 'website_agreement:provide_for_data_flow', 'default' => html::initial_value($values, 'website_agreement:provide_for_data_flow'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Receive data for data flow', 'helpText' => 'Select the requirements of participants with respect to receiving data for data flow. When a website selects ' . 'to receive data for data flow, they can pass on data from other websites for data flow purposes (e.g. to a national information ' . 'portal) from other websites participating in the same agreement if they elect to provide data for data flow.', 'fieldname' => 'website_agreement:receive_for_data_flow', 'default' => html::initial_value($values, 'website_agreement:receive_for_data_flow'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Providing data for moderation', 'helpText' => 'Select the requirements of participants with respect to providing data for moderation. When data is provided ' . 'by a website, other websites participating in the same agreement will be able to moderate this data, e.g. to check ' . 'images before publication, if they select to receive data for moderation.', 'fieldname' => 'website_agreement:provide_for_moderation', 'default' => html::initial_value($values, 'website_agreement:provide_for_moderation'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
echo data_entry_helper::select(array('label' => 'Receive data for moderation', 'helpText' => 'Select the requirements of participants with respect to receiving data for moderation. When a website selects ' . 'to receive data for modeartion, they can perform moderation tasks such as checking images before publication ' . 'from other websites participating in the same agreement if they elect to provide data for moderation.', 'fieldname' => 'website_agreement:receive_for_moderation', 'default' => html::initial_value($values, 'website_agreement:receive_for_moderation'), 'lookupValues' => array('D' => 'Not allowed', 'O' => 'Optional', 'A' => 'Optional, but must be setup by an administrator', 'R' => 'Required')));
?>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('website-agreement-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
Esempio n. 14
0
}
?>
 >
  <option value=''>&lt;Warehouse&gt;</option>
<?php 
if (!is_null($this->auth_filter)) {
    $websites = ORM::factory('website')->in('id', $this->auth_filter['values'])->orderby('title', 'asc')->find_all();
} else {
    $websites = ORM::factory('website')->orderby('title', 'asc')->find_all();
}
foreach ($websites as $website) {
    echo '	<option value="' . $website->id . '" ';
    if ($website->id == $website_id) {
        echo 'selected="selected" ';
    }
    echo '>' . $website->title . '</option>';
}
?>
</select>
<?php 
echo html::error_message($model->getError('termlist:website_id'));
?>
</li>
</ol>
</fieldset>
<?php 
echo html::form_buttons(html::initial_value($values, 'termlist:id') != null && html::initial_value($values, 'termlist:id') != '', false, false);
echo html::error_message($model->getError('deleted'));
?>
</form>
</div>
echo $metadata;
?>
<fieldset>
<input type="hidden" name="identifiers_subject_observation:id" value="<?php 
echo $id;
?>
" />
<input type="hidden" name="identifiers_subject_observation:subject_observation_id" value="<?php 
echo html::initial_value($values, 'identifiers_subject_observation:subject_observation_id');
?>
" />
<legend>Identifier Details</legend>
<?php 
echo data_entry_helper::autocomplete(array('label' => 'Identifier', 'fieldname' => 'identifiers_subject_observation:identifier_id', 'table' => 'identifier', 'captionField' => 'coded_value', 'valueField' => 'id', 'extraParams' => $readAuth, 'default' => html::initial_value($values, 'identifiers_subject_observation:identifier_id'), 'defaultCaption' => html::initial_value($values, 'identifier:coded_value'), 'validation' => 'required'));
echo data_entry_helper::checkbox(array('fieldname' => 'identifiers_subject_observation:matched', 'label' => 'Matched', 'helpText' => 'Does this observation match a known identifier?', 'default' => html::initial_value($values, 'identifiers_subject_observation:matched')));
echo data_entry_helper::select(array('fieldname' => 'identifiers_subject_observation:verified_status', 'label' => 'Verified status', 'helpText' => 'Status of this identifier observation.', 'lookupValues' => array('' => 'Please select>', 'U' => 'unknown', 'M' => 'misread', 'V' => 'verified'), 'default' => html::initial_value($values, 'identifiers_subject_observation:verified_status'), 'validation' => 'required'));
?>
</fieldset>

 <?php 
if (array_key_exists('attributes', $values) && count($values['attributes']) > 0) {
    ?>
  <fieldset>
 <legend>Custom Attributes</legend>
 <ol>
 <?php 
    foreach ($values['attributes'] as $attr) {
        $name = 'isoAttr:' . $attr['identifiers_subject_observation_attribute_id'];
        // if this is an existing attribute, tag it with the attribute value record id so we can re-save it
        if ($attr['id']) {
            $name .= ':' . $attr['id'];
Esempio n. 16
0
?>
" method="post">
<?php 
echo $metadata;
?>
<fieldset>
<input type="hidden" name="trigger:id" value="<?php 
echo html::initial_value($values, 'trigger:id');
?>
" />
<legend>Trigger details</legend>
<?php 
echo data_entry_helper::text_input(array('label' => 'Name', 'fieldname' => 'trigger:name', 'default' => html::initial_value($values, 'trigger:name'), 'class' => 'control-width-5'));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'trigger:description', 'default' => html::initial_value($values, 'trigger:description')));
echo data_entry_helper::select(array('label' => 'Trigger template', 'fieldname' => 'trigger:trigger_template_file', 'default' => html::initial_value($values, 'trigger:trigger_template_file'), 'lookupValues' => $other_data['triggerFileList']));
echo data_entry_helper::checkbox(array('label' => 'Public', 'fieldname' => 'trigger:public', 'default' => html::initial_value($values, 'trigger:public')));
data_entry_helper::link_default_stylesheet();
// No need to re-link to jQuery
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
<fieldset class="button-set">
<input type="submit" name="submit" value="<?php 
echo kohana::lang('misc.next');
?>
" class="ui-corner-all ui-state-default button ui-priority-primary" />
<input type="submit" name="submit" value="<?php 
echo kohana::lang('misc.cancel');
Esempio n. 17
0
 <?php 
    foreach ($values['attributes'] as $attr) {
        $name = 'psnAttr:' . $attr['person_attribute_id'];
        // if this is an existing attribute, tag it with the attribute value record id so we can re-save it
        if ($attr['id']) {
            $name .= ':' . $attr['id'];
        }
        switch ($attr['data_type']) {
            case 'D':
            case 'V':
                echo data_entry_helper::date_picker(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            case 'L':
                echo data_entry_helper::select(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['raw_value'], 'lookupValues' => $values['terms_' . $attr['termlist_id']], 'blankText' => '<Please select>'));
                break;
            case 'B':
                echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
                break;
            default:
                echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
        }
    }
    ?>
 </ol>
 </fieldset>
<?php 
}
echo html::form_buttons(html::initial_value($values, 'person:id') != null);
?>
</form>
    echo form::checkbox('valid_time', TRUE, isset($model->valid_time) and $model->valid_time == 't', 'class="vnarrow" ');
    ?>
</li>
<?php 
}
?>
</ol>
</fieldset>
<fieldset>
<legend>Other information</legend>
<?php 
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
echo data_entry_helper::outputAttribute(array('caption' => 'Default value', 'data_type' => $dataType, 'fieldname' => 'default_value', 'id' => 'default_value', 'termlist_id' => $model->{$attrModelName}->termlist_id, 'default' => $model->default_value), array('extraParams' => $readAuth));
$controlTypeId = html::initial_value($values, $_GET['type'] . '_attributes_website:control_type_id');
$types = array('' => '<Not specified>');
foreach ($other_data['controlTypes'] as $controlType) {
    $types[$controlType->id] = $controlType->control;
}
echo data_entry_helper::select(array('label' => 'Default control type', 'fieldname' => $model->object_name . ':control_type_id', 'lookupValues' => $types, 'default' => $controlTypeId));
if ($_GET['type'] == 'location') {
    $terms = array('' => '<Not specified>') + $this->get_termlist_terms('indicia:location_types');
    echo data_entry_helper::select(array('label' => 'Location Type', 'fieldname' => 'location_attributes_website:restrict_to_location_type_id', 'lookupValues' => $terms, 'default' => html::initial_value($values, 'location_attributes_website:restrict_to_location_type_id'), 'helpText' => 'If you want this attribute to only apply for locations of a certain type, select the type here.'));
} elseif ($_GET['type'] == 'sample') {
    $terms = array('' => '<Not specified>') + $this->get_termlist_terms('indicia:sample_methods');
    echo data_entry_helper::select(array('label' => 'Sample Method', 'fieldname' => 'sample_attributes_website:restrict_to_sample_method_id', 'lookupValues' => $terms, 'default' => html::initial_value($values, 'sample_attributes_website:restrict_to_sample_method_id'), 'helpText' => 'If you want this attribute to only apply for samples of a certain method, select the method here.'));
}
echo $metadata;
echo html::form_buttons(html::initial_value($values, 'custom_attribute:id') != null, false, false);
?>
</fieldset></form>
echo data_entry_helper::text_input(array('label' => 'Period Start', 'fieldname' => 'summariser_definition:period_start', 'default' => html::initial_value($values, 'summariser_definition:period_start'), 'helpText' => 'Define the first day of each period. There are 2 options.<br/>' . "&nbsp;&nbsp;<strong>weekday=&lt;n&gt;</strong> where <strong>&lt;n&gt;</strong> is a number between 1 (for Monday) and 7 (for Sunday).<br/>" . "&nbsp;&nbsp;<strong>date=MMM/DD</strong> where <strong>MMM/DD</strong> is a month/day combination: e.g. choosing Apr-1 will start each week on the day of the week on which the 1st of April occurs.<br/>", 'validation' => 'required'));
echo data_entry_helper::text_input(array('label' => 'Period One Contains', 'fieldname' => 'summariser_definition:period_one_contains', 'default' => html::initial_value($values, 'summariser_definition:period_one_contains'), 'helpText' => 'Calculate week one as the week containing this date: value should be in the format <strong>MMM/DD</strong>, which is a month/day combination: e.g. choosing Apr-1 will mean week one contains the date of the 1st of April. Default is the Jan-01', 'validation' => 'required'));
echo data_entry_helper::select(array('label' => 'Attribute to Sum', 'fieldname' => 'summariser_definition:occurrence_attribute_id', 'lookupValues' => $other_data['occAttrs'], 'default' => html::initial_value($values, 'summariser_definition:occurrence_attribute_id'), 'helpText' => 'The occurrence attribute which is used as the count associated with the occurrence. If not provided then each occurrence has a count of one.'));
echo data_entry_helper::checkbox(array('label' => 'Calculate Estimates', 'fieldname' => 'summariser_definition:calculate_estimates', 'default' => html::initial_value($values, 'summariser_definition:calculate_estimates')));
?>
<fieldset><legend>Data Handling</legend>
<?php 
echo data_entry_helper::select(array('label' => 'Summary Data Combination method', 'fieldname' => 'summariser_definition:data_combination_method', 'lookupValues' => array('A' => 'Add all occurrences together', 'M' => 'Choose the value from the sample with the greatest count', 'L' => 'Average over all samples for that location during that period'), 'default' => html::initial_value($values, 'summariser_definition:data_combination_method'), 'helpText' => 'When data is aggregated for a location/period combination, this determines how.'));
echo data_entry_helper::select(array('label' => 'Data Rounding', 'fieldname' => 'summariser_definition:data_rounding_method', 'lookupValues' => array('N' => 'To the nearest integer, .5 rounds up', 'U' => 'Up: To the integer greater than or equal to the value', 'D' => 'Down: To the integer less than or equal to the value', 'X' => 'None (may result in non-integer values)'), 'default' => html::initial_value($values, 'summariser_definition:data_rounding_method'), 'helpText' => 'When data is averaged, this determines what rounding is carried out. Note that anything between 0 and 1 will be rounded up to 1.'));
?>
</fieldset><fieldset><legend>Estimate Generation</legend>
<p>Only one interpolation option (linear) available at the moment.</p>
<?php 
// Only one interpolation option at the moment. This may change in future. Keep hidden control until that point.
// 'L' = 'Linear interpolation'
echo data_entry_helper::hidden_text(array('fieldname' => 'summariser_definition:interpolation', 'default' => 'L'));
echo data_entry_helper::text_input(array('label' => 'Season Limits', 'fieldname' => 'summariser_definition:season_limits', 'default' => html::initial_value($values, 'summariser_definition:season_limits'), 'helpText' => 'This is a comma separated pair of the week numbers for the start and end of the season. When provided, and data is not entered for these weeks, the value is taken as zero, irrespective of the First/Last value processing. First/Last value processing is not carried out outwith these weeks.'));
echo data_entry_helper::select(array('label' => 'First Value Processing', 'fieldname' => 'summariser_definition:first_value', 'lookupValues' => array('X' => 'No special processing', 'H' => 'The entry for the previous week is half the entered value'), 'default' => html::initial_value($values, 'summariser_definition:first_value'), 'helpText' => 'When encountering the first entered value, this determines what happens.'));
echo data_entry_helper::select(array('label' => 'Last Value Processing', 'fieldname' => 'summariser_definition:last_value', 'lookupValues' => array('X' => 'No special processing', 'H' => 'The entry for the next week is half the entered value'), 'default' => html::initial_value($values, 'summariser_definition:last_value'), 'helpText' => 'When encountering the last entered value, this determines what happens.'));
?>
</fieldset>
<?php 
echo $metadata;
echo html::form_buttons($existing, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
require_once DOCROOT . 'client_helpers/data_entry_helper.php';
if (isset($_POST)) {
    data_entry_helper::dump_errors(array('errors' => $this->model->getAllErrors()));
}
?>
<form class="iform" action="<?php 
echo url::site();
?>
taxon_designation/save" method="post">
<fieldset>
<legend>Taxon designation details</legend>
<?php 
data_entry_helper::link_default_stylesheet();
if (isset($values['taxon_designation:id'])) {
    ?>
  <input type="hidden" name="taxon_designation:id" value="<?php 
    echo html::initial_value($values, 'taxon_designation:id');
    ?>
" />
<?php 
}
echo data_entry_helper::text_input(array('label' => 'Title', 'fieldname' => 'taxon_designation:title', 'class' => 'control-width-4', 'default' => html::initial_value($values, 'taxon_designation:title')));
echo data_entry_helper::text_input(array('label' => 'Code', 'fieldname' => 'taxon_designation:code', 'class' => 'control-width-4', 'default' => html::initial_value($values, 'taxon_designation:code')));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'taxon_designation:description', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'taxon_designation:description')));
echo data_entry_helper::select(array('label' => 'Category', 'fieldname' => 'taxon_designation:category_id', 'lookupValues' => $other_data['category_terms'], 'default' => html::initial_value($values, 'taxon_designation:category_id')));
echo $metadata;
echo html::form_buttons(html::initial_value($values, 'taxon_designation:id') != null, false, false);
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
<input type="hidden" name="trigger_action:trigger_id" value="<?php 
echo html::initial_value($values, 'trigger_action:trigger_id');
?>
" />
<input type="hidden" name="trigger_action:type" value="E" />
<input type="hidden" name="trigger_action:param1" value="<?php 
echo html::initial_value($values, 'trigger_action:param1');
?>
" />
<input type="hidden" name="return_url" value="<?php 
echo url::site();
?>
trigger" />
<?php 
echo data_entry_helper::radio_group(array('fieldname' => 'trigger_action:param2', 'label' => 'Notification frequency', 'labelClass' => 'align-top', 'class' => 'check-or-radio-box', 'default' => html::initial_value($values, 'trigger_action:param2'), 'helpText' => 'Please specify how frequently you would like to receive email notifications for this trigger?', 'lookupValues' => array('N' => 'No emails', 'I' => 'Immediate', 'D' => 'Daily', 'W' => 'Weekly'), 'sep' => '<br/>'));
echo data_entry_helper::textarea(array('label' => 'Copy email to', 'helpText' => 'Provide a comma separated list of email addresses to copy this notification to.', 'labelClass' => 'align-top', 'fieldname' => 'trigger_action:param3', 'default' => html::initial_value($values, 'trigger_action:param3')));
?>
</fieldset>
<input type="submit" name="submit" value="<?php 
echo kohana::lang('misc.save');
?>
" class="ui-corner-all ui-state-default button ui-priority-primary" />
<input type="submit" name="submit" value="<?php 
echo kohana::lang('misc.cancel');
?>
" class="ui-corner-all ui-state-default button" />
<input type="submit" name="submit" value="<?php 
echo kohana::lang('misc.unsubscribe');
?>
" onclick="if (!confirm('<?php 
echo kohana::lang('misc.confirm_unsubscribe');
            break;
        case 'B':
            echo data_entry_helper::checkbox(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
            break;
        case 'G':
            echo '<input type="hidden" name="' . $name . '" value="' . $attr['value'] . '" id="imp-geom"/>';
            echo '<label>' . $attr['caption'] . ':</label>';
            echo map_helper::map_panel(array('presetLayers' => array('osm'), 'editLayer' => true, 'clickForSpatialRef' => false, 'layers' => array(), 'initial_lat' => 55, 'initial_long' => -2, 'initial_zoom' => 4, 'width' => 870, 'height' => 400, 'standardControls' => array('panZoomBar', 'layerSwitcher', 'hoverFeatureHighlight', 'drawPolygon', 'modifyFeature', 'clearEditLayer')));
            break;
        default:
            echo data_entry_helper::text_input(array('label' => $attr['caption'], 'fieldname' => $name, 'default' => $attr['value']));
    }
}
?>
 </ol>
 </fieldset>
<?php 
// some script to handle drawn polygons. Only allow 1 polygon on the layer
data_entry_helper::$javascript .= "mapInitialisationHooks.push(function(div) {\n  function featureChangeEvent(evt) {\n    var featuresToRemove=[];\n    \$.each(evt.feature.layer.features, function(idx, feature) {\n      if (feature.id !== evt.feature.id) {\n        featuresToRemove.push(feature);\n      }\n    });\n    evt.feature.layer.removeFeatures(featuresToRemove);\n    \$('#imp-geom').val(evt.feature.geometry.toString());\n  }\n  div.map.editLayer.events.on({'featureadded': featureChangeEvent, 'afterfeaturemodified': featureChangeEvent}); \n});\n";
echo html::form_buttons(html::initial_value($values, 'taxa_taxon_list:id') != null);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
</div>


Esempio n. 23
0
if ($parent_id != null && array_key_exists('parent_website_id', $values) && $values['parent_website_id'] !== null) {
    $website_id = $values['parent_website_id'];
} else {
    $website_id = html::initial_value($values, 'taxon_list:website_id');
    if ($this->auth->logged_in('CoreAdmin') || !$website_id && $id !== null) {
        // Core admin can select Warehouse as owner. Other users can only have this option in the list if the
        // list is already assigned to the warehouse in which case the list is read only.
        echo '<option value="">&lt;Warehouse&gt;</option>';
    }
    foreach ($other_data['websites'] as $website) {
        echo '  <option value="' . $website->id . '" ';
        if ($website->id == $website_id) {
            echo 'selected="selected" ';
        }
        echo '>' . $website->title . '</option>';
    }
}
?>
</select>
<?php 
echo html::error_message($model->getError('taxon_list:website_id'));
?>
</li>
</ol>
</fieldset>
<?php 
echo html::form_buttons(html::initial_value($values, 'taxon_list:id') != null, $this->get_read_only($values));
?>
</form>
</div>
<form class="cmxform" action="<?php 
echo url::site() . 'user_identifier/save';
?>
" method="post" enctype="multipart/form-data">
<?php 
echo $metadata;
?>
<fieldset>
<input type="hidden" name="user_identifier:id" value="<?php 
echo $id;
?>
" />
<input type="hidden" name="user_identifier:user_id" value="<?php 
echo html::initial_value($values, 'user_identifier:user_id');
?>
" />
<legend>Identifier</legend>
<?php 
echo data_entry_helper::text_input(array('label' => 'Identifier', 'fieldname' => 'user_identifier:identifier', 'default' => html::initial_value($values, 'user_identifier:identifier'), 'helpText' => 'The externally provided identifier, e.g. a Twitter account ID or OpenID URL.'));
echo data_entry_helper::select(array('label' => 'Identifier Type', 'fieldname' => 'user_identifier:type_id', 'default' => html::initial_value($values, 'user_identifier:type_id'), 'lookupValues' => $other_data['identifier_types'], 'blankText' => '<Please select>', 'helpText' => 'Select the type of identifier, i.e. the external system that the identifier is registered with.'));
?>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
data_entry_helper::link_default_stylesheet();
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</form>
Esempio n. 25
0
 /**
  * Existing entries owned by warehouse are read only, unless you are core admin
  */
 protected function get_read_only($values)
 {
     return html::initial_value($values, 'termlist:id') && !$this->auth->logged_in('CoreAdmin') && !html::initial_value($values, 'termlist:website_id');
 }
 * @link 	http://code.google.com/p/indicia/
 */
$id = html::initial_value($values, 'known_subject_comment:id');
require_once DOCROOT . 'client_helpers/data_entry_helper.php';
?>
<p>This page allows you to specify the details of a known subject comment.</p>
<form class="cmxform" action="<?php 
echo url::site() . 'known_subject_comment/save';
?>
" method="post" enctype="multipart/form-data">
<?php 
echo $metadata;
?>
<fieldset>
<input type="hidden" name="known_subject_comment:id" value="<?php 
echo $id;
?>
" />
<input type="hidden" name="known_subject_comment:known_subject_id" value="<?php 
echo html::initial_value($values, 'known_subject_comment:known_subject_id');
?>
" />
<legend>Known Subject Comment</legend>
<?php 
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'known_subject_comment:comment', 'default' => html::initial_value($values, 'known_subject_comment:comment')));
?>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
?>
</form>
Esempio n. 27
0
//So to fix this, collect the existing filters from the database so we can compare the titles with the one we create and then
//do the validation manually.
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
$existingFilterData = data_entry_helper::get_population_data(array('table' => 'filter', 'extraParams' => $readAuth, 'nocache' => true));
//When we save a milestone when we need to automatically set the filter title as there isn't a separate field
//to fill this in.
//Also hide the "who" filter as we don't need this for milestones as they can apply to all users
//Also manually do the unique milestone/filter title validation (see note above)
data_entry_helper::$javascript .= "\nvar existingFilterData=" . json_encode($existingFilterData) . ";  \n\$('#pane-filter_who').hide();\n\$('#milestones-form').submit(function() {\n  \$('#filter-title-val').val('" . 'Filter for milestone' . " ' + \$('#milestone\\\\:title').val());\n  for (var i = 0; i<existingFilterData.length;i++) {\n    //Note we must allow a duplicate title in the situaton where the duplicate title is for the already existing item\n    if (existingFilterData[i]['title']==\$('#filter-title-val').val() && existingFilterData[i]['id']!=\$('#filter\\\\:id').val()) {\n      alert('The filter title is generated from the milestone title you have entered and would cause a duplicate filter title, please choose a different title');\n      return false;\n    }\n  }\n  \$('#filter-def-val').val(JSON.stringify(indiciaData.filter.def));\n});\n";
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
$filterPanelHTML = '<h3>Specify the filter used to define which records count</h3>';
$hiddenPopupDivs = '';
$filterPanelHTML .= report_filter_panel($readAuth, array('allowLoad' => false, 'allowSave' => false, 'embedInExistingForm' => true, 'runningOnWarehouse' => true, 'taxon_list_id' => kohana::config('cache_builder_variables.master_list_id'), 'website_id' => html::initial_value($values, 'milestone:website_id') ? html::initial_value($values, 'milestone:website_id') : $values['website_id']), $this->uri->argument(1), $hiddenStuff);
// fields to auto-create a filter record for this group's defined set of records
$filterPanelHTML .= data_entry_helper::hidden_text(array('fieldname' => 'filter:id', 'default' => html::initial_value($values, 'filter:id')));
$filterPanelHTML .= '<input type="hidden" name="filter:title" id="filter-title-val"/>';
$filterPanelHTML .= '<input type="hidden" name="filter:definition" id="filter-def-val"/>';
$filterPanelHTML .= '<input type="hidden" name="filter:sharing" value="R"/>';
echo $filterPanelHTML;
echo html::form_buttons(html::initial_value($values, 'milestone:id') != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('milestones-form');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
<?php 
echo $hiddenStuff;
?>
<fieldset>
<input type="hidden" name="occurrence_comment:id" value="<?php 
echo $id;
?>
" />
<input type="hidden" name="occurrence_comment:occurrence_id" value="<?php 
echo html::initial_value($values, 'occurrence_comment:occurrence_id');
?>
" />
<legend>Occurrence Comment</legend>
<?php 
if (html::initial_value($values, 'occurrence_comment:auto_generated') === 't') {
    ?>
  <p>This comment was generated by the auto verification rule  
      <?php 
    echo html::initial_value($values, 'occurrence_comment:generated_by');
    ?>
.</p>
<?php 
}
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'occurrence_comment:comment', 'default' => html::initial_value($values, 'occurrence_comment:comment')));
if (html::initial_value($values, 'occurrence_comment:auto_generated') === 'f') {
    echo data_entry_helper::checkbox(array('label' => 'Query', 'fieldname' => 'occurrence_comment:query', 'helpText' => 'Does this comment represent a query about the record?', 'default' => html::initial_value($values, 'occurrence_comment:query')));
}
?>
</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
?>
</form>
echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:id', 'default' => $id));
echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:location_id', 'default' => html::initial_value($values, 'location_medium:location_id')));
?>
<legend>Media file details</legend>
<?php 
$mediaTypeId = html::initial_value($values, 'location_medium:media_type_id');
$mediaType = $mediaTypeId ? $other_data['media_type_terms'][$mediaTypeId] : 'Image:Local';
if ($mediaType === 'Image:Local') {
    echo '<label>Image:</label>';
    echo html::sized_image(html::initial_value($values, 'occurrence_medium:path')) . '</br>';
    echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:path', 'default' => html::initial_value($values, 'location_medium:path')));
    echo data_entry_helper::image_upload(array('label' => 'Upload image file', 'fieldname' => 'image_upload', 'default' => html::initial_value($values, 'location_medium:path')));
} else {
    echo data_entry_helper::text_input(array('label' => 'Path or URL', 'fieldname' => 'location_medium:path', 'default' => html::initial_value($values, 'location_medium:path'), 'class' => 'control-width-5'));
}
echo data_entry_helper::text_input(array('label' => 'Caption', 'fieldname' => 'location_medium:caption', 'default' => html::initial_value($values, 'location_medium:caption'), 'class' => 'control-width-5'));
if ($mediaTypeId && $mediaType !== 'Image:Local') {
    echo data_entry_helper::select(array('label' => 'Media type', 'fieldname' => 'location_medium:media_type_id', 'default' => $mediaTypeId, 'lookupValues' => $other_data['media_type_terms'], 'blankText' => '<Please select>', 'class' => 'control-width-5'));
}
?>

</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('location-medium-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
<input id="parent" name="termlists_term:parent" readonly="readonly" value="<?php 
$parent_id = html::initial_value($values, 'termlists_term:parent_id');
echo $parent_id != null ? html::specialchars(ORM::factory('termlists_term', $parent_id)->term->term) : '';
?>
" />
</li>
<li>
<label for="synonyms">Synonyms
<span class="ui-state-highlight ui-widget-content ui-corner-all" title="Enter synonyms one per line. Optionally follow each name by a | character then the 3 character code for the language, e.g. 'Countryside | eng'.">?</span></label>
<textarea rows="7" columns="40" id="synonyms" name="metaFields:synonyms"><?php 
echo html::initial_value($values, 'metaFields:synonyms');
?>
</textarea>
</li>
<li>
<label for="sort_order">Sort Order in List</label>
<input id="sort_order" name="termlists_term:sort_order" class="narrow" value="<?php 
echo html::initial_value($values, 'termlists_term:sort_order');
?>
" />
<?php 
echo html::error_message($model->getError('termlists_term:sort_order'));
?>
</li>
</fieldset>
<?php 
echo html::form_buttons(html::initial_value($values, 'termlists_term:id') != null);
echo html::error_message($model->getError('deleted'));
?>
</form>