function getByDefaultname($default_name) { $seed = new ReportParameter(); $results = $seed->get_full_list("", "default_name='" . $default_name . "'"); if (!empty($results)) { $result = $results[0]; $result->retrieve(); return $result; } else { return NULL; } }
public function setReportParameters($reportParameters) { $parameters = array(); if ($reportParameters instanceof \stdClass) { $reportParameters = isset($reportParameters->ReportParameter) ? $reportParameters->ReportParameter : array(); $reportParameters = is_array($reportParameters) ? $reportParameters : array($reportParameters); } foreach ($reportParameters as $reportParam) { if (is_object($reportParam)) { $data = array('name' => $reportParam->Name, 'value' => isset($reportParam->Value) ? $reportParam->Value : null); } else { $data = $reportParam; } $parameter = new ReportParameter($data['name'], $data['value']); $parameter->setData($reportParam); $parameters[] = $parameter; } $this->data['ReportParameters'] = $parameters; return $this; }
<?php require_once 'include/formbase.php'; require_once 'include/upload_file.php'; require_once 'modules/ZuckerReportParameter/ReportParameter.php'; if (!is_admin($current_user)) { sugar_die("only admin allowed"); } if (!empty($_REQUEST['record'])) { $template = new ReportParameter(); $template->mark_deleted($_REQUEST['record']); } header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);
$lv->setHeaderTitle($current_module_strings['LBL_LISTING_FILTER_LIST']); $lv->show_export_button = false; $lv->processListView($focus->get_filters(), "filters", "FILTER"); echo "\n</p>\n"; echo "\n<p>\n"; $lv = new ListView(); $lv->setXTemplate($xtpl); $lv->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path . 'delete_inline', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"')); $lv->setHeaderTitle($current_module_strings['LBL_LISTING_ORDER_LIST']); $lv->show_export_button = false; $lv->processListView($focus->get_orders(), "orders", "ORDER"); echo "\n</p>\n"; if (is_admin($current_user)) { $field_select = $focus->get_full_fields_list(); asort($field_select); $rp = new ReportParameter(); $rps = $rp->get_full_list(); $param_select = array("" => ""); if (!empty($rps)) { foreach ($rps as $rp) { $param_select[$rp->id] = $rp->get_summary_text(); } } $options_select = $focus->get_field_options_list($_REQUEST["filter_field_name"]); echo "\n<p/>\n"; echo get_form_header($current_module_strings['LBL_LISTING_FILTER_NEW'], "", false); $xtpl->assign("TEMPLATE_ID", $focus->id); $xtpl->assign("TEMPLATE_MODULE", $focus->mainmodule); $xtpl->assign("FILTER_FIELD_SELECTION", get_select_options_with_id($field_select, $_REQUEST["filter_field_name"])); $filter_comparator = $focus->get_full_comparator_list($_REQUEST["filter_field_name"]); asort($filter_comparator);
<?php require_once 'XTemplate/xtpl.php'; require_once 'include/formbase.php'; require_once 'modules/ZuckerReportParameter/ReportParameter.php'; require_once 'modules/ZuckerReportParameter/Forms.php'; global $app_strings; global $app_list_strings; global $mod_strings; global $current_user; global $current_language; echo get_set_focus_js(); $mod_list_strings = return_mod_list_strings_language($current_language, "ZuckerReports"); $focus = new ReportParameter(); if (isset($_REQUEST['record']) && !empty($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); $friendly_name = $focus->friendly_name; $default_name = $focus->default_name; $default_value = $focus->default_value; $description = $focus->description; $range_name = $focus->range_name; $range_options = $focus->range_options; $title = $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->default_name; } else { $title = $mod_strings['LBL_PARAM_NEW']; } if (!empty($_REQUEST['friendly_name'])) { $friendly_name = $_REQUEST['friendly_name']; } if (!empty($_REQUEST['default_name'])) { $default_name = $_REQUEST['default_name'];
<?php require_once 'include/formbase.php'; require_once 'include/upload_file.php'; require_once 'modules/ZuckerReportParameter/ReportParameter.php'; if (!is_admin($current_user)) { sugar_die("only admin allowed"); } $param = new ReportParameter(); if (!empty($_REQUEST['record'])) { $param->retrieve($_REQUEST['record']); } if ($_REQUEST["range_name"] == "SCRIPT") { require_once "modules/ZuckerReports/config.php"; if ($zuckerreports_config["param_script_enabled"] != "yes") { sugar_die($mod_strings["LBL_PARAM_RANGE_SCRIPT_DISABLED"]); } } $param = populateFromPost("", $param); $return_id = $param->save(); header("Location: index.php?action=ListView&module=ZuckerReportParameter"); exit;
require_once 'include/formbase.php'; require_once 'include/upload_file.php'; require_once 'modules/ZuckerListingTemplateFilter/ListingTemplateFilter.php'; if (!is_admin($current_user)) { sugar_die("only admin allowed"); } $filter = new ListingTemplateFilter(); if (!empty($_REQUEST['record'])) { $filter->retrieve($_REQUEST['record']); } $filter = populateFromPost("filter_", $filter); $lt = new ListingTemplate(); $lt->retrieve($filter->listing_template_id); if (!empty($_REQUEST["filter_value_param"])) { $rp = new ReportParameter(); $rp->retrieve($_REQUEST["filter_value_param"]); $rpl = new ReportParameterLink(); $rpl->template_id = $lt->id; $rpl->parameter_id = $rp->id; $rpl->name = $rp->default_name; $rpl->default_value = $rp->default_value; $rpl->save(); $filter->value = $rpl->id; $filter->value_type = "parameter"; } else { if (!empty($_REQUEST["filter_value_enum"])) { $filter->value = $_REQUEST["filter_value_enum"]; $filter->value_type = "text"; } else { if (!empty($_REQUEST["filter_value_input"])) {
} if (!empty($execbutton)) { $xtpl->assign("EXEC_BUTTON", $execbutton); } if (!empty($schedulebutton)) { $xtpl->assign("SCHEDULE_BUTTON", $schedulebutton); } $xtpl->parse("main"); $xtpl->out("main"); } } if (!empty($focus->id) && $_REQUEST['run'] == "true") { $parameter_values = array(); $links = $focus->get_parameter_links(); foreach ($links as $link) { $parameter_values[$link->name] = ReportParameter::get_parameter_value($link->parameter, $link); } $success = $focus->execute_request($parameter_values); if ($success) { if ($is_scheduler) { $_REQUEST['REPORT_RESULT'] = $focus->report_result; $_REQUEST['REPORT_RESULT_NAME'] = $focus->report_result_name; $_REQUEST['REPORT_RESULT_TYPE'] = $focus->report_result_type; } if ($focus->report_result_type == "FILE") { if (!empty($_REQUEST['parent_category'])) { $report = new ZuckerReport(); $report->container_id = $_REQUEST['parent_category']; if ($zuckerreports_config["debug"] == "yes") { $report->description = $focus->report_output; }
} } } echo "</div>"; } } else { if ($action === 'getChildParameters') { $reportParameter = new ReportParameter($_GET['parentReportParameterID']); $parmArray = array(); foreach ($reportParameter->getChildren() as $parm) { echo $parm->ID . "|"; } } else { if ($action === 'getChildUpdate') { $reportParameterVal = $_GET['reportParameterVal']; $parm = new ReportParameter($_GET['reportParameterID']); if ($parm->typeCode === "dd") { echo "<br><label for='prm_" . $parm->ID . "'>" . $parm->displayPrompt . "</label><select name='prm_" . $parm->ID . "' id='prm_" . $parm->ID . "' class='opt' "; // check if it's a parent if ($parm->isParent()) { echo "onchange='javascript:updateChildren(" . $parm->ID . ");'>"; } else { echo ">"; } if ($parm->requiredInd != '1') { echo "<option value='' selected>All</option>"; } $rownumber = 1; foreach ($parm->getSelectValues($reportParameterVal) as $value) { if ($rownumber === 1 && $parm->requiredInd == '1') { $parmValue[$parm->ID] = $value[0];