if( thisid == "row10" || thisid == "row11") window.location=URL; } } }); } }); if ($("option:selected").length == 0) { $("select").get(0).selectedIndex = 0; } empty_table_list();'; $tables = ""; if (is_wr_db() && count($arr_tables_db)) { $arr_tables = $arr_tables_db; $isCustom=false; } elseif(count($arr_tables_project) && is_wr_project()) { $arr_tables = $arr_tables_project; $isCustom=false; } else { $arr_tables = $arr_tables_custom; $isCustom=true; }
AssignFunction($editcont, "xt_buildeditcontrol", $parameters); $arr_page_order_fields["data"][$key]["editcontrol"] = $editcont; //$editcont1 = $editcont; $editcont1 = array(); $parameters["second"]=true; $parameters["fieldNum"]=1; AssignFunction($editcont1, "xt_buildeditcontrol", $parameters); if(@$_SESSION[$sessPrefix."_search"]==2) { $editcont1["params"]["value"] = @$_SESSION[$sessPrefix."_asearchfor2"][$table_field]; } $arr_page_order_fields["data"][$key]["editcontrol1"] = $editcont1; if(is_wr_db()) $arr_page_order_fields["data"][$key]["fieldblock"] = ' <input type="hidden" name="asearchfield[]" value="'.runner_htmlspecialchars($ftable).".".runner_htmlspecialchars($fname).'"> <input type="hidden" name="asearchtable[]" value="'.runner_htmlspecialchars($ftable).'"> '; else $arr_page_order_fields["data"][$key]["fieldblock"] = ' <input type="hidden" name="asearchfield[]" value="'.runner_htmlspecialchars($fname).'"> <input type="hidden" name="asearchtable[]" value="'.runner_htmlspecialchars($ftable).'"> '; $arr_page_order_fields["data"][$key]["notbox"] = ($not) ? 'name="not_'.$gname.'_1" checked' : 'name="not_'.$gname.'_1"'; $arr_page_order_fields["data"][$key]["second_id"] = "id=\"second_".$gname."\""; $arr_options = GetAdvSearchOptions($ftable, $fname); $options = "";
function update_report_totals() { $root =& $_SESSION["webreports"]; // ensure all fields in reports are listed in the tables $tables = getReportTablesList(); if (is_wr_custom()) { $fields = WRGetFieldsList(''); } $arr_unset = array(); foreach ($root["totals"] as $idx => $fld) { if (array_search($fld["table"], $tables) !== false || is_null($fld["table"]) && is_wr_custom()) { if (!is_wr_custom()) { $fields = WRGetFieldsList($fld["table"]); } if (array_search($fld["name"], $fields) !== false) { continue; } } // remove $total if found $arr_unset[] = $idx; } foreach ($arr_unset as $idx => $fld) { unset($root["totals"][$fld]); } // ensure all fields appear in the totals $all_fields = array(); foreach ($tables as $t) { $fields = WRGetFieldsList($t); foreach ($fields as $f) { if (is_wr_db()) { $all_fields[] = $t . "." . $f; } else { $all_fields[] = $f; } } } // ensure all series fields appear in the totals foreach ($all_fields as $fieldItem) { $f = $fieldItem; $table = ""; $fld = ""; if (is_wr_db()) { WRSplitFieldName($f, $table, $fld); } else { $table = $tables[0]; $fld = $f; $f = $table . "_" . $f; } if (array_key_exists(GoodFieldName($f), $root["totals"])) { continue; } $pSet = new ProjectSettings($table, PAGE_LIST); $root['totals'][GoodFieldName($f)] = array(); $root['totals'][GoodFieldName($f)]["name"] = $fld; $root['totals'][GoodFieldName($f)]["table"] = $table; $root['totals'][GoodFieldName($f)]["label"] = $pSet->label($fld); $root['totals'][GoodFieldName($f)]["show"] = "true"; $root['totals'][GoodFieldName($f)]["min"] = "false"; $root['totals'][GoodFieldName($f)]["max"] = "false"; $root['totals'][GoodFieldName($f)]["sum"] = "false"; $root['totals'][GoodFieldName($f)]["avg"] = "false"; $root['totals'][GoodFieldName($f)]["curr"] = "false"; $root['totals'][GoodFieldName($f)]["search"] = ""; $root['totals'][GoodFieldName($f)]["view_format"] = GetGenericViewFormat($table, $fld); $root['totals'][GoodFieldName($f)]["edit_format"] = GetGenericEditFormat($table, $fld); $root['totals'][GoodFieldName($f)]["display_field"] = $pSet->getDisplayField($fld); $root['totals'][GoodFieldName($f)]["linkfield"] = $pSet->getLinkField($fld); $root['totals'][GoodFieldName($f)]["show_thumbnail"] = $pSet->showThumbnail($fld); $root['totals'][GoodFieldName($f)]["need_encode"] = $pSet->NeedEncode($fld); $root['totals'][GoodFieldName($f)]["thumbnail"] = $pSet->getStrThumbnail($fld); $root['totals'][GoodFieldName($f)]["listformatobj_imgwidth"] = $pSet->getImageWidth($fld); $root['totals'][GoodFieldName($f)]["listformatobj_imgheight"] = $pSet->getImageHeight($fld); $root['totals'][GoodFieldName($f)]["hlprefix"] = $pSet->getLinkPrefix($fld); $root['totals'][GoodFieldName($f)]["listformatobj_filename"] = $pSet->getFilenameField($fld); $root['totals'][GoodFieldName($f)]["lookupobj_lookuptype"] = $pSet->getLookupType($fld); $root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_customdispaly"] = $pSet->getDisplayField($fld); $root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_table"] = $pSet->getLookupTable($fld); $root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_where"] = GetLWWhere($fld, PAGE_REPORT); } $_SESSION["webreports"] = $root; }
function db_fld_value(&$data, $field) { global $rpt_array; if (is_wr_db()) return $data[GoodFieldName($field)]; return $data[$field]; }
function update_report_sort_fields() { // ensure all group fields are listed in the tables $root =& $_SESSION["webreports"]; if (!$root["sort_fields"]) { return; } // ensure all fields in reports are listed in the tables $tables = getReportTablesList(); $changed = false; $arr_unset = array(); foreach ($root["sort_fields"] as $idx => $fld) { $table = ""; $field = ""; if (is_wr_db()) { WRSplitFieldName($fld["name"], $table, $field); } else { $field = $fld["name"]; $table = $root['tables'][0]; } if (array_search($table, $tables) !== false) { $fields = WRGetFieldsList($table); if (array_search($field, $fields) !== false) { continue; } } // remove $total if found $arr_unset[] = $idx; } foreach ($arr_unset as $idx => $fld) { unset($root["sort_fields"][$fld]); } // make new array $newarr = array(); // add group fields foreach ($root["group_fields"] as $fld) { if ($fld["name"] == "Summary") { continue; } $newarr[] = array("name" => $fld["name"], "desc" => "false"); } // add the rest of fields $keys = array_keys($root["sort_fields"]); $j = count($newarr); foreach ($keys as $idx) { $found = false; foreach ($newarr as $nfld) { if ($nfld["name"] == $root["sort_fields"][$idx]["name"]) { $found = true; break; } } if ($found) { continue; } $newarr[$j] = $root["sort_fields"][$idx]; $j++; } $root["sort_fields"] = $newarr; }