本文整理汇总了PHP中iform_report_get_report_options函数的典型用法代码示例。如果您正苦于以下问题:PHP iform_report_get_report_options函数的具体用法?PHP iform_report_get_report_options怎么用?PHP iform_report_get_report_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iform_report_get_report_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: records_by_week_chart
/**
* A report showing a chart of incoming records per week.
*/
public static function records_by_week_chart($auth, $args, $tabalias, $options, $path)
{
iform_load_helpers(array('report_helper'));
$args = array_merge(array('report_name' => 'library/weeks/filterable_records_by_week'), $args);
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('id' => 'records-by-week-chart', 'width' => 900, 'height' => 500, 'chartType' => 'line', 'yValues' => array('processed', 'total'), 'xLabels' => 'week', 'legendOptions' => array('show' => true), 'seriesOptions' => array(array('label' => 'Processed by verifiers', 'color' => '#00FF00'), array('label' => 'All records', 'color' => '#FF9900')), 'axesOptions' => array('yaxis' => array('min' => 0, 'tickOptions' => array('formatString' => '%d')), 'xaxis' => array('label' => 'Weeks ago'))), $options);
return report_helper::report_chart($reportOptions);
}
示例2: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
$r = '<div class="ui-helper-clearfix">';
$reportOptions['geoserverLayer'] = $args['geoserver_layer'];
$reportOptions['geoserverLayerStyle'] = $args['geoserver_layer_style'];
$reportOptions['cqlTemplate'] = $args['cql_template'];
$reportOptions['clickable'] = $args['click_on_map_mode'] != 'none';
$reportOptions['clickableLayersOutputDiv'] = $args['click_on_map_div'];
if (!empty($args['click_on_map_columns'])) {
$reportOptions['clickableLayersOutputColumns'] = helper_base::explode_lines_key_value_pairs($args['click_on_map_columns']);
}
if ($args['click_on_map_mode'] != 'none') {
$reportOptions['clickableLayersOutputMode'] = $args['click_on_map_mode'];
}
// Use the proxy module if enabled, to get round limitations in URL length for
// filtered WMS requests.
if (defined('DRUPAL_BOOTSTRAP_CONFIGURATION') && module_exists('iform_proxy')) {
global $base_url;
$reportOptions['proxy'] = $base_url . '/?q=' . variable_get('iform_proxy_path', 'proxy') . '&url=';
}
$r .= '<br/>' . report_helper::report_map($reportOptions);
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// This is used for drawing, so need an editlayer, but not used for input
$options['editLayer'] = true;
$options['editLayerInSwitcher'] = true;
$options['clickForSpatialRef'] = false;
if ($args['layer_picker'] != 'none') {
$picker = array('id' => 'map-layer-picker', 'includeIcons' => false, 'includeSwitchers' => true, 'includeHiddenLayers' => true);
if ($args['layer_picker'] == 'before') {
$r .= map_helper::layer_list($picker);
}
// as we have a layer picker, we can drop the layerSwitcher from the OL map.
if (array_search('layerSwitcher', $options['standardControls']) !== false) {
unset($options['standardControls'][array_search('layerSwitcher', $options['standardControls'])]);
}
}
if ($args['legend'] != 'none') {
$legend = array('id' => 'map-legend', 'includeIcons' => true, 'includeSwitchers' => false, 'includeHiddenLayers' => false);
if ($args['legend'] == 'before') {
$r .= map_helper::layer_list($legend);
}
}
if (isset($args['map_toolbar_pos'])) {
$options['toolbarDiv'] = $args['map_toolbar_pos'];
}
$r .= map_helper::map_panel($options, $olOptions);
if ($args['layer_picker'] == 'after') {
$r .= map_helper::layer_list($picker);
}
if ($args['legend'] == 'after') {
$r .= map_helper::layer_list($legend);
}
$r .= '</div>';
return $r;
}
示例3: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args, $node, $response = null)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$conn = iform_get_connection_details($node);
$readAuth = report_helper::get_read_auth($conn['website_id'], $conn['password']);
$r = '<div id="leftcol">';
$reportOptions = iform_report_get_report_options($args, $readAuth);
iform_report_apply_explore_user_own_preferences($reportOptions);
$reportOptions = array_merge(array('rowId' => 'external_key', 'columns' => array(), 'callback' => 'grid_load', 'rememberParamsReportGroup' => 'explore', 'paramsFormButtonCaption' => lang::get('Filter')), $reportOptions);
$reportOptions['rowId'] = 'external_key';
$imgPath = empty(report_helper::$images_path) ? report_helper::relative_client_helper_path() . "../media/images/" : report_helper::$images_path;
$reportOptions['columns'][] = array('actions' => array(array('img' => "{$imgPath}/add.png", 'caption' => 'Click to add this species to the map')));
$r .= report_helper::report_grid($reportOptions);
$r .= '</div>';
$args['indicia_species_layer_slds'] = report_helper::explode_lines($args['indicia_species_layer_slds']);
$r .= '<div id="rightcol">';
$r .= '<div id="layerbox">';
$r .= '<p id="instruct">' . lang::get('Click on the + buttons in the grid to add species layers to the map. You can add up to {1} layers at a time.', count($args['indicia_species_layer_slds']));
$r .= '<p id="instruct2" style="display: none">' . lang::get('Use the - buttons to permanently remove layers, or untick the box in the legend to temporarily hide them.');
$mapOptions = iform_map_get_map_options($args, $readAuth);
$mapOptions['clickForSpatialRef'] = false;
$olOptions = iform_map_get_ol_options($args, $readAuth);
$r .= map_helper::layer_list(array('layerTypes' => array('overlay'), 'includeSwitchers' => true, 'includeHiddenLayers' => true));
$r .= '</div>';
$r .= map_helper::map_panel($mapOptions, $olOptions);
$r .= '</div>';
$websiteIds = iform_get_allowed_website_ids($readAuth);
if (!empty($args['indicia_species_layer_feature_type']) && !empty(report_helper::$geoserver_url)) {
$training = function_exists('hostsite_get_user_field') && hostsite_get_user_field('training') ? 't' : 'f';
$cql = 'website_id IN (' . implode(',', $websiteIds) . ') AND ' . $args['indicia_species_layer_filter_field'] . "='{filterValue}' AND record_status NOT IN ('R', 'I', 'T') AND training='{$training}'";
if (isset($_POST[$reportOptions['reportGroup'] . '-quality'])) {
$quality = $_POST[$reportOptions['reportGroup'] . '-quality'];
} else {
$quality = $reportOptions['extraParams']['quality'];
}
// logic here must match the quality_check function logic on the database.
switch ($quality) {
case 'V':
$cql .= " AND record_status='V'";
break;
case 'C':
$cql .= " AND (record_status='V' OR certainty='C')";
break;
case 'L':
$cql .= " AND (record_status='V' OR ((certainty <> 'U' OR certainty IS NULL) AND record_status <> 'D'))";
break;
case '!D':
$cql .= " AND record_status<>'D'";
break;
case '!R':
// nothing to add - rejects are always excluded
}
report_helper::$javascript .= "indiciaData.indiciaSpeciesLayer = {\n" . ' "title":"' . lang::get('{1}') . "\",\n" . ' "myRecords":"' . lang::get('my records') . "\",\n" . ' "userId":"' . hostsite_get_user_field('indicia_user_id') . "\",\n" . ' "featureType":"' . $args['indicia_species_layer_feature_type'] . "\",\n" . ' "wmsUrl":"' . data_entry_helper::$geoserver_url . "wms\",\n" . " \"cqlFilter\":\"{$cql}\",\n" . " \"filterField\":\"taxon_meaning_id\",\n" . ' "slds":' . json_encode($args['indicia_species_layer_slds']) . "\n" . "};\n";
}
return $r;
}
示例4: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args, $node, $response = null)
{
require_once drupal_get_path('module', 'iform') . '/client_helpers/report_helper.php';
$auth = report_helper::get_read_write_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
$reportOptions['header'] = $args['header'];
$reportOptions['footer'] = $args['footer'];
$reportOptions['bands'] = json_decode($args['bands'], true);
return report_helper::freeform_report($reportOptions);
}
示例5: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args, $node, $response = null)
{
iform_load_helpers(array('report_helper'));
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
$reportOptions['header'] = $args['header'];
$reportOptions['footer'] = $args['footer'];
$reportOptions['bands'] = json_decode($args['bands'], true);
return report_helper::freeform_report($reportOptions);
}
示例6: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting a verification.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
require_once drupal_get_path('module', 'iform') . '/client_helpers/report_helper.php';
require_once drupal_get_path('module', 'iform') . '/client_helpers/map_helper.php';
$auth = report_helper::get_read_write_auth($args['website_id'], $args['password']);
$chartOptions = iform_report_get_report_options($args, $auth);
$chartOptions = array_merge($chartOptions, array('id' => 'chart-div', 'width' => $args['width'], 'height' => $args['height'], 'chartType' => $args['chart_type'], 'yValues' => explode(',', $args['y_values'])));
$xLabels = trim($args['x_labels']);
if (empty($xLabels)) {
$chartOptions['xValues'] = explode(',', $args['x_values']);
} else {
$chartOptions['xLabels'] = explode(',', $args['x_labels']);
}
// advanced options
$rendererOptions = trim($args['renderer_options']);
if (!empty($rendererOptions)) {
$chartOptions['rendererOptions'] = json_decode($rendererOptions, true);
}
$legendOptions = trim($args['legend_options']);
if (!empty($legendOptions)) {
$chartOptions['legendOptions'] = json_decode($legendOptions, true);
}
$seriesOptions = trim($args['series_options']);
if (!empty($seriesOptions)) {
$chartOptions['seriesOptions'] = json_decode($seriesOptions, true);
}
$axesOptions = trim($args['axes_options']);
if (!empty($axesOptions)) {
$chartOptions['axesOptions'] = json_decode($axesOptions, true);
}
// now the chart itself
$r .= '<br/>' . report_helper::report_chart($chartOptions);
return $r;
}
示例7: get_control_reportchartparams
protected static function get_control_reportchartparams($auth, $args, $tabalias, $options)
{
if (!isset($options['yValues']) || !isset($options['dataSource']) || !isset($options['chartType'])) {
$r = '<h4>Please fill in the following options for the chart parameters control: yValues, dataSource, chartType</h4>';
return $r;
}
iform_load_helpers(array('report_helper'));
$sharing = empty($args['sharing']) ? 'reporting' : $args['sharing'];
$args['report_name'] = '';
$options = array_merge(iform_report_get_report_options($args, $auth), $options, array('reportGroup' => 'dynamic', 'paramsOnly' => true, 'sharing' => $sharing, 'paramsFormButtonCaption' => lang::get('Filter'), 'yValues' => explode(',', $options['yValues']), 'readAuth' => $auth['read'], 'dataSource' => $options['dataSource']));
$r = '<br/>' . report_helper::report_chart($options);
return $r;
}
示例8: get_form
/**
* Return the generated output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
*/
public static function get_form($args, $node, $response = null)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$readAuth = report_helper::get_read_auth($args['website_id'], $args['password']);
$sharing = 'reporting';
$reportOptions = array_merge(iform_report_get_report_options($args, $readAuth), array('reportGroup' => 'explore', 'rememberParamsReportGroup' => 'explore', 'paramsOnly' => true, 'paramsInMapToolbar' => true, 'sharing' => $sharing, 'paramsFormButtonCaption' => lang::get('Filter'), 'rowId' => 'occurrence_id'));
iform_report_apply_explore_user_own_preferences($reportOptions);
$reportOptions['extraParams']['limit'] = 3000;
$r = report_helper::report_grid($reportOptions);
$r .= report_helper::report_map(array('readAuth' => $readAuth, 'dataSource' => $args['report_name'], 'extraParams' => $reportOptions['extraParams'], 'paramDefaults' => $reportOptions['paramDefaults'], 'autoParamsForm' => false, 'reportGroup' => 'explore', 'rememberParamsReportGroup' => 'explore', 'clickableLayersOutputMode' => 'report', 'sharing' => $sharing, 'rowId' => 'occurrence_id', 'ajax' => TRUE));
$options = array_merge(iform_map_get_map_options($args, $readAuth), array('featureIdField' => 'occurrence_id', 'clickForSpatialRef' => false, 'reportGroup' => 'explore', 'toolbarDiv' => 'top'));
$olOptions = iform_map_get_ol_options($args);
$r .= map_helper::map_panel($options, $olOptions);
$allowDownload = !isset($args['downloadOwnDataOnly']) || !$args['downloadOwnDataOnly'] || isset($reportOptions['extraParams']['ownData']) && $reportOptions['extraParams']['ownData'] === 1 || isset($_POST['explore-ownData']) && $_POST['explore-ownData'] === '1' || !(isset($_POST['explore-ownData']) || $_POST['explore-ownData'] === '0') && isset($reportOptions['paramDefaults']['ownData']) && $reportOptions['paramDefaults']['ownData'] === 1;
$reportOptions = array_merge($reportOptions, array('id' => 'explore-records', 'paramsOnly' => false, 'autoParamsForm' => false, 'downloadLink' => $allowDownload, 'rowClass' => 'certainty{certainty}'));
if (isset($args['includeEditLink']) && $args['includeEditLink'] && !empty($args['includeEditLinkPath'])) {
$reportOptions['columns'][] = array('display' => 'Actions', 'actions' => array(array('caption' => 'edit', 'url' => url($args['includeEditLinkPath']), 'urlParams' => array('occurrence_id' => '{occurrence_id}'), 'visibility_field' => 'belongs_to_user')));
}
$r .= report_helper::report_grid($reportOptions);
return $r;
}
示例9: map
/**
* Hierarchy map control, which can be added to user interface form configurations using [site_hierarchy_navigator.map].
*
* Display a map with polygons loaded onto it of a particular location type. When the user clicks on one, reloads the map layer
* to show the intersecting polygons from the next location type. Continues down the locations hierarchy in a supplied sequence of
* location types (e.g. you might set the location type sequence to Country, County, Parish, Site).
*
* Supply an option @layerLocationTypes with a comma separated array of the location types ID to load in top down order.
*/
public function map($auth, $args, $tabalias, $options, $path)
{
global $base_root;
//Setup the path to the cudi information sheets.
//Include the parameter on the end of the path, but leave off the parameter values
//as these will change for each path used.
iform_load_helpers(array('map_helper', 'report_helper'));
$informationSheetLinkParts = explode('|', $options['informationSheetLink']);
$path = $base_root . base_path() . (variable_get('clean_url', 0) ? '' : '?q=') . $informationSheetLinkParts[0] . (variable_get('clean_url', 0) ? '?' : '&') . $informationSheetLinkParts[1] . '=';
map_helper::$javascript .= "indiciaData.informationSheetLink='" . $path . "';\n";
if (empty($options['layerLocationTypes'])) {
return '<p>Please provide a @layerLocationTypes option for the [site_hierarchy_navigator.map] map control on the edit tab</p>';
}
$msg = self::check_format($options, 'layerLocationTypes', 'location_type_id (from the termlists term table)', '/^([0-9]*,\\s*)*[0-9]*\\s*$/');
if ($msg !== true) {
return $msg;
}
//This option is optional, so don't need to check if it isn't present
$msg = self::check_format($options, 'showCountUnitsForLayers', 'location_type_id (from the termlists term table)', '/^([0-9]*,\\s*)*[0-9]*\\s*$/');
if ($msg !== true) {
return $msg;
}
drupal_add_js(iform_client_helpers_path() . 'prebuilt_forms/extensions/site_hierarchy_navigator.js');
//The location types are supplied by the user in a comma seperated list.
//The first number is used as the initial location type to display.
//The second number is used after the user clicks the first time on a feature and so on
$layerLocationTypes = explode(',', $options['layerLocationTypes']);
//Comma seperated list of location types which signify which layers should also display the Count Unit location type.
//This should be a subset of $layerLocationTypes.
$showCountUnitsForLayers = explode(',', $options['showCountUnitsForLayers']);
$locationTypesWithSymbols = explode(',', $options['locationTypesWithSymbols']);
//Annotation location types as defined on edit tab
$annotationTypeIds = explode(',', $options['annotationTypeIds']);
$mapOptions = iform_map_get_map_options($args, $auth);
$olOptions = iform_map_get_ol_options($args);
$mapOptions['readAuth'] = $mapOptions['readAuth']['read'];
$mapOptions['clickForSpatialRef'] = false;
//When user clicks on map, run specified Javascript function
$mapOptions['clickableLayersOutputMode'] = 'customFunction';
$mapOptions['customClickFn'] = 'move_to_new_layer';
$mapOptions['clickableLayersOutputDiv'] = '';
//Tell the system which layers we to be clickable.
$mapOptions['clickableLayers'] = array('indiciaData.reportlayer');
$r .= map_helper::map_panel($mapOptions, $olOptions);
map_helper::$javascript .= "indiciaData.layerLocationTypes=" . json_encode($layerLocationTypes) . ";\n";
$reportOptions = array('dataSource' => 'reports_for_prebuilt_forms/CUDI/get_layer_list_names', 'readAuth' => $auth['read'], 'mode' => 'report', 'extraParams' => array('layer_ids' => $options['layerLocationTypes']));
//Return a list of location type names for the location type id layers list
//provided by the user in the form structure.
$locationTypeNamesDirty = data_entry_helper::get_report_data($reportOptions);
//The data returned by the database is not a simple array of names, so convert the data and put into correct order
foreach ($layerLocationTypes as $originalLayerIndex => $layerLocationTypeFromOriginalList) {
foreach ($locationTypeNamesDirty as $locationTypeNamesData) {
if ($locationTypeNamesData['id'] === $layerLocationTypeFromOriginalList) {
$locationTypeNamesClean[$originalLayerIndex] = $locationTypeNamesData['name'];
}
}
}
//Send the array of names to javascript
map_helper::$javascript .= "indiciaData.layerLocationTypesNames=" . json_encode($locationTypeNamesClean) . ";\n";
//Send the user supplied options for layers to display count units to Javascript
map_helper::$javascript .= "indiciaData.showCountUnitsForLayers=" . json_encode($showCountUnitsForLayers) . ";\n";
map_helper::$javascript .= "indiciaData.countUnitBoundaryTypeId=" . $options['countUnitBoundaryTypeId'] . ";\n";
map_helper::$javascript .= "indiciaData.annotationTypeIds=" . json_encode($annotationTypeIds) . ";\n";
map_helper::$javascript .= "indiciaData.deactivateSiteAttributeId=" . $options['deactivateSiteAttributeId'] . ";\n";
//Get translatable label for top-level breadcrub item.
map_helper::$javascript .= "indiciaData.allSitesLabel='" . lang::get('All Sites') . "';\n";
$reportOptions = array('linkOnly' => 'true', 'dataSource' => 'reports_for_prebuilt_forms/cudi/get_boundaries_and_locations_for_cudi_map', 'readAuth' => $auth['read']);
//Get the report options such as the Preset Parameters on the Edit Tab
$reportOptions = array_merge(iform_report_get_report_options($args, $readAuth), $reportOptions);
//Run the report that shows the locations (features) to the user when the map loads the first time.
map_helper::$javascript .= "indiciaData.layerReportRequest='" . report_helper::get_report_data($reportOptions) . "';\n";
//Options for the report that is used to draw the map breadcrumb
$reportOptions = array('linkOnly' => 'true', 'dataSource' => 'reports_for_prebuilt_forms/CUDI/get_map_hierarchy_for_current_position', 'readAuth' => $auth['read']);
//Get the report options such as the Preset Parameters on the Edit Tab
$reportOptions = array_merge(iform_report_get_report_options($args, $readAuth), $reportOptions);
//Run the report that builds the map breadcrumb.
map_helper::$javascript .= "indiciaData.breadcrumbReportRequest='" . report_helper::get_report_data($reportOptions) . "';\n";
return $r;
}
示例10: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting a verification.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$chartOptions = iform_report_get_report_options($args, $auth);
$chartOptions = array_merge($chartOptions, array('id' => 'chart-div', 'width' => $args['width'], 'height' => $args['height'], 'chartType' => $args['chart_type'], 'yValues' => explode(',', $args['y_values']), 'output' => $args['output']));
$xLabels = trim($args['x_labels']);
if (empty($xLabels)) {
$chartOptions['xValues'] = explode(',', $args['x_values']);
} else {
$chartOptions['xLabels'] = explode(',', $args['x_labels']);
}
// advanced options
if (!empty($args['renderer_options'])) {
$rendererOptions = trim($args['renderer_options']);
$chartOptions['rendererOptions'] = json_decode($rendererOptions, true);
}
if (!empty($args['legend_options'])) {
$legendOptions = trim($args['legend_options']);
$chartOptions['legendOptions'] = json_decode($legendOptions, true);
}
if (!empty($args['axes_options'])) {
$seriesOptions = trim($args['series_options']);
$chartOptions['seriesOptions'] = json_decode($seriesOptions, true);
}
if (!empty($args['series_options'])) {
$axesOptions = trim($args['axes_options']);
$chartOptions['axesOptions'] = json_decode($axesOptions, true);
}
//User has elected for parameters form only
if ($args['output'] === 'form') {
$chartOptions['paramsOnly'] = true;
} else {
if (isset($chartOptions['paramsOnly'])) {
unset($chartOptions['paramsOnly']);
}
}
//User has elected for parameters form only or
//both the chart and parameters form together
if ($args['output'] === 'form' || $args['output'] === 'default') {
$chartOptions['completeParamsForm'] = true;
} else {
if (isset($chartOptions['completeParamsForm'])) {
unset($chartOptions['completeParamsForm']);
}
}
//User has elected for the chart only
if ($args['output'] === 'output') {
$chartOptions['autoParamsForm'] = false;
}
$r = '<br/>' . report_helper::report_chart($chartOptions);
return $r;
}
示例11: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting a verification.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
iform_load_helpers(array('report_helper'));
data_entry_helper::add_resource('jquery_form');
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
// get the grid output before outputting the download link, so we can check if the download link is needed.
$reportOptions['id'] = 'grid-' . $node->nid;
if (isset($args['footer'])) {
$reportOptions['footer'] = $args['footer'];
}
$reportOptions['downloadLink'] = !isset($args['download_link']) || $args['download_link'];
$grid = report_helper::report_grid($reportOptions);
return $grid;
}
示例12: unallocated_squares_grid
public static function unallocated_squares_grid($auth, $args, $tabalias, $options, $path)
{
if (!isset($options['reportGridNumber'])) {
drupal_set_message('Please fill in the report grid number option for the unallocated_squares_grid control, starting with 0 for the first grid on the page');
return false;
}
iform_load_helpers(array('report_helper'));
$args['report_name'] = '';
$sharing = empty($args['sharing']) ? 'reporting' : $args['sharing'];
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('reportGroup' => 'dynamic', 'autoParamsForm' => false, 'sharing' => $sharing, 'ajax' => true, 'id' => 'report-grid-' . $options['reportGridNumber']), $options);
if (!empty($_GET['dynamic-post_code_geom']) && !empty($_GET['dynamic-distance_from_post_code'])) {
$reportOptions['sendOutputToMap'] = true;
$reportOptions['zoomMapToOutput'] = true;
}
return report_helper::report_grid($reportOptions);
}
示例13: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
$r = "";
data_entry_helper::add_resource('jquery_ui');
if (isset($args['advancedUI']) && $args['advancedUI']) {
// TODO Sort out
// data_entry_helper::$resource_list['jquery_ui_slider'] =
// array('deps' => array('jquery_ui'), 'javascript' => array('/misc/ui/jquery.ui.slider.js'));
// data_entry_helper::add_resource('jquery_ui_slider');
// drupal_add_js(drupal_get_path('module', 'jquery_update') .'/replace/ui/ui/jquery.ui.slider.js');
// drupal_add_js('/misc/ui/jquery.ui.slider.min.js');
drupal_add_js('/misc/ui/jquery.ui.slider.js');
// drupal_add_js('/misc/ui/jquery.ui.button.min.js');
}
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
$now = new DateTime('now');
$year = isset($_REQUEST['year']) ? $_REQUEST['year'] : ($year = $now->format('Y'));
iform_load_helpers(array('report_helper', 'map_helper'));
$options = iform_report_get_report_options($args, $readAuth);
$currentParamValues = array();
if (isset($options['extraParams'])) {
foreach ($options['extraParams'] as $key => $value) {
// trim data to ensure blank lines are not handled.
$key = trim($key);
$value = trim($value);
// We have found a parameter, so put it in the request to the report service
if (!empty($key)) {
$currentParamValues[$key] = $value;
}
}
}
$extras = '&wantColumns=1&wantParameters=1&' . report_helper::array_to_query_string($currentParamValues, true);
$canIDuser = false;
// Report record should have location_id, sample_id, occurrence_id, sample_date, species ttl_id, attributes, geometry. created_by_id is optional
// Event definition: Name|attribute_id|attribute_values
// Loop through event definitions
/* $events = array(array('type'=>'arrayVal', 'name'=>'Budburst', 'attr'=>'289', 'values'=>array(3904,3961,3905,3906,3962,3907)),
array('type'=>'arrayVal', 'name'=>'Leaf', 'attr'=>'289', 'values'=>array(3906,3962,3907)),
array('type'=>'arrayVal', 'name'=>'Flowering', 'attr'=>'291', 'values'=>array(3912,3913,3914,3916,3917,3918)),
array('type'=>'presence', 'name'=>'Presence')); */
$events = str_replace("\r\n", "\n", $args['triggerEvents']);
$events = str_replace("\r", "\n", $events);
$events = explode("\n", trim($events));
foreach ($events as $idx => $event) {
$events[$idx] = explode(':', $event);
}
$triggerEvents = array();
$SpeciesEventSelections = array();
$Species = array();
$r .= '<div id="errorMsg"></div>' . '<table class="ui-widget ui-widget-content ui-corner-all controls-table" id="controls-table">' . '<thead class="ui-widget-header">' . '<tr><th><label for="yearControl">' . lang::get("Year") . ' : </label><select id="yearControl" name="year">';
for ($i = $now->format('Y'); $i >= $args['first_year']; $i--) {
$r .= '<option value="' . $i . '">' . $i . '</option>';
}
$r .= '</select></th>' . '<th><label for="speciesControl">' . lang::get("Species") . ' : </label><select id="speciesControl"><option value="">' . lang::get("Please select species") . '</option></select></th>' . '<th><label for="eventControl">' . lang::get("Event") . ' : </label><select id="eventControl"><option value="">' . lang::get("Please select event") . '</option>';
foreach ($events as $index => $event) {
$r .= '<option value="' . $index . '">' . $event[0] . '</option>';
$triggerEvents[] = '{"name":"' . $event[0] . '","type":"' . $event[1] . '"' . (count($event) > 2 ? ',"attr":' . $event[2] . ',"values":[' . $event[3] . ']' : '') . '}';
}
$r .= "</select></th>\n";
if (isset($args['twinMaps']) && $args['twinMaps']) {
$r .= '<th><label for="rhsCtrl">' . lang::get("Compare") . ' : </label><select id="rhsCtrl" name="rhsCtrl"><option value="">' . lang::get("Please select.") . '</option><option value="Test">' . lang::get("Test.") . "</option></select></th>\n";
}
$r .= '</tr></thead></table>' . "\n";
$args['map_width'] = "auto";
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
$options['editLayer'] = false;
$options['clickForSpatialRef'] = false;
$options['scroll_wheel_zoom'] = false;
$r .= '<div class="leftMap mapContainers leftMapOnly">' . map_helper::map_panel($options, $olOptions) . '</div>';
$options['divId'] = 'map2';
if (isset($args['twinMaps']) && $args['twinMaps']) {
$r .= '<div class="rightMap mapContainers leftMapOnly">' . map_helper::map_panel($options, $olOptions) . '</div>';
}
$r .= '<div class="ui-helper-clearfix"></div><div id="timeControls">' . (isset($args['advancedUI']) && $args['advancedUI'] ? '<div id="timeSlider"></div>' : '') . '<div id="toolbar">' . '<span id="dotControlLabel">' . lang::get('Dot Size') . ' :</span>' . (isset($args['advancedUI']) && $args['advancedUI'] ? '<div id="dotSlider"></div>' : '<select id="dotSelect"><option>2</option><option>3</option><option>4</option><option>5</option></select>') . '<button id="beginning">go to beginning</button><button id="playMap">play</button><button id="end">go to end</button>' . '<span id="dateControlLabel">' . lang::get("Date Currently displayed") . ' : ' . (isset($args['advancedUI']) && $args['advancedUI'] ? '<span id="displayDate" ></span>' : '<select id="timeSelect"><option value="">' . lang::get("Please select date") . '</option></select>') . '</span>' . '</div>';
$imgPath = empty(data_entry_helper::$images_path) ? data_entry_helper::relative_client_helper_path() . "../media/images/" : data_entry_helper::$images_path;
data_entry_helper::$javascript .= "\ninitTreeMap2({\n advanced_UI: " . (isset($args['advancedUI']) && $args['advancedUI'] ? "true" : "false") . ",\n dotSize: " . $args['dotSize'] . ",\n lat: " . $args['map_centroid_lat'] . ",\n long: " . $args['map_centroid_long'] . ",\n zoom: " . $args['map_zoom'] . ",\n triggerEvents: [" . implode(',', $triggerEvents) . "],\n base_url: '" . data_entry_helper::$base_url . "',\n report_name: '" . $args['report_name'] . "',\n auth_token: '" . $readAuth['auth_token'] . "',\n nonce: '" . $readAuth['nonce'] . "',\n reportExtraParams: '" . $extras . "',\n indicia_user_id: " . (hostsite_get_user_field('indicia_user_id') ? hostsite_get_user_field('indicia_user_id') : 'false') . ",\n timeControlSelector: '" . (isset($args['advancedUI']) && $args['advancedUI'] ? '#timeSlider' : '#timeSelect') . "',\n dotControlSelector: '" . (isset($args['advancedUI']) && $args['advancedUI'] ? '#dotSlider' : '#dotSelect') . "',\n timerDelay: " . (int) 1000 / $args['frameRate'] . ",\n twinMaps: " . (isset($args['twinMaps']) && $args['twinMaps'] ? 'true' : 'false') . ",\n imgPath: '" . $imgPath . "'\n});\n";
$r .= '</div>';
return $r;
}
示例14: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting a verification.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
require_once drupal_get_path('module', 'iform') . '/client_helpers/report_helper.php';
$auth = report_helper::get_read_write_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
// get the grid output before outputting the download link, so we can check if the download link is needed.
$reportOptions['id'] = 'grid-' . $node->nid;
if (isset($args['footer'])) {
$reportOptions['footer'] = $args['footer'];
}
$reportOptions['downloadLink'] = !isset($args['download_link']) || $args['download_link'];
$grid = report_helper::report_grid($reportOptions);
return $grid;
}
示例15: league_table_position
private static function league_table_position($auth, $args, $options, $report, $label)
{
$userId = hostsite_get_user_field('indicia_user_id');
if (!$userId) {
return '';
}
iform_load_helpers(array('report_helper'));
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('dataSource' => $report, 'autoParamsForm' => false), $options);
if (hostsite_get_user_field('training')) {
$reportOptions['extraParams']['training'] = 'true';
}
$reportOptions['extraParams']['user_id'] = $userId;
$rows = report_helper::get_report_data($reportOptions);
if (count($rows)) {
$r = self::output_title($options);
$r .= '<div>';
$r .= '<div class="totals">' . lang::get('Position {1}', $rows[0]['position']) . '</div>';
$r .= '<div class="totals">' . lang::get('{1} species', $rows[0]['value']) . '</div>';
$r .= '</div>';
}
return $r;
}