package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import org.ofbiz.base.util.*;
import org.ofbiz.security.*;
import com.sourcetap.sfa.ui.UIScreenSection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Calendar;
import java.util.StringTokenizer;
import java.text.SimpleDateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.sql.Timestamp;
import java.sql.Time;
import java.sql.*;
import org.ofbiz.entity.util.SequenceUtil;
import org.ofbiz.security.*;
import org.ofbiz.entity.*;
import org.ofbiz.entity.condition.*;
import org.ofbiz.entity.model.*;
import org.ofbiz.base.util.*;
import com.sourcetap.sfa.ui.*;
import com.sourcetap.sfa.event.*;
import com.sourcetap.sfa.util.UserInfo;
public class menu_jsp extends HttpJspBase {
/*
* Takes a string in the following format:
* formatString
* Where the first letter is lowercase, and
* subsequent unique words begin with an upper case.
* The function will convert a java string to a regular
* string in title case format.
*/
String formatJavaString(String s){
char ca[] = s.toCharArray();
StringBuffer sb = new StringBuffer();
int previous = 0;
for(int i=0;i<ca.length;i++){
if(i==s.length()-1){
sb.append(s.substring(previous, previous+1).toUpperCase());
sb.append(s.substring(previous+1, s.length()));
}
if(Character.isUpperCase(ca[i])){
sb.append(s.substring(previous, previous+1).toUpperCase());
sb.append(s.substring(previous+1, i));
sb.append(" ");
previous = i;
}
}
return sb.toString();
}
/**
Properties must include:
NAME-name of the select used in name-value form submit.
VALUE_FIELD-the value sent in form submit.
DISPLAY_FIELD-the field used in the display of the drop-down. use a
Properties can include:
Selected-The value to test for, and set selected on the drop-down
EMPTY_FIRST: if just a blank field use "{field display vaalue}, else if value supplied use "{field value}, {field value display name}"
*/
String buildDropDown(List l, Map properties){
StringBuffer returnString = new StringBuffer();
GenericValue genericValue = null;
Iterator i = l.iterator();
String selected = ((String)(properties.get("SELECTED") != null ? properties.get("SELECTED") : ""));
String display = ((String)(properties.get("DISPLAY_FIELD") != null ? properties.get("DISPLAY_FIELD") : ""));
String selectJavaScript = ((String)(properties.get("SELECT_JAVASCRIPT") != null ? properties.get("SELECT_JAVASCRIPT") : ""));
returnString.append("<select name=\"" + properties.get("NAME") + "\" " + selectJavaScript + " >");
if(properties.get("EMPTY_FIRST") != null) {
String empty = (String)properties.get("EMPTY_FIRST");
if(empty.indexOf(",") != -1){
StringTokenizer tok = new StringTokenizer(empty, ",");
returnString.append("<option value=\"" + ((String)tok.nextElement()).trim() + "\">" + ((String)tok.nextElement()).trim());
} else {
returnString.append("<option value=\"\">" + empty);
}
}
try{
while(i.hasNext()){
genericValue = (GenericValue)i.next();
returnString.append("<option value=\"" + String.valueOf(genericValue.get((String)properties.get("VALUE_FIELD"))) + "\"");
if(String.valueOf(genericValue.get((String)properties.get("VALUE_FIELD"))).equals(selected)){
returnString.append(" SELECTED ");
}
returnString.append(" >");
if(display.indexOf(",") != -1){
StringTokenizer tok = new StringTokenizer(display, ",");
while(tok.hasMoreElements()){
String elem = (String)tok.nextElement();
returnString.append(String.valueOf(genericValue.get(elem.trim())));
returnString.append(" ");
}
} else {
returnString.append(genericValue.get(display));
}
}
} catch (Exception e){ e.printStackTrace(); }
returnString.append("</select>");
return returnString.toString();
}
String buildStringDropDown(List l, Map properties){
StringBuffer returnString = new StringBuffer();
String value = "";
Iterator i = l.iterator();
String selected = ((String)(properties.get("SELECTED") != null ? properties.get("SELECTED") : ""));
String display = ((String)(properties.get("DISPLAY_FIELD") != null ? properties.get("DISPLAY_FIELD") : ""));
String selectJavaScript = ((String)(properties.get("SELECT_JAVASCRIPT") != null ? properties.get("SELECT_JAVASCRIPT") : ""));
returnString.append("<select name=\"" + properties.get("NAME") + "\" " + selectJavaScript + " >");
if(properties.get("EMPTY_FIRST") != null) {
String empty = (String)properties.get("EMPTY_FIRST");
if(empty.indexOf(",") != -1){
StringTokenizer tok = new StringTokenizer(empty, ",");
returnString.append("<option value=\"" + ((String)tok.nextElement()).trim() + "\">" + ((String)tok.nextElement()).trim());
} else {
returnString.append("<option value=\"\">" + empty);
}
}
while(i.hasNext()){
value = (String)i.next();
returnString.append("<option value=\"" + value + "\"");
if(value.equals(selected)){
returnString.append(" SELECTED ");
}
returnString.append(" >");
if(display.indexOf(",") != -1){
StringTokenizer tok = new StringTokenizer(display, ",");
while(tok.hasMoreElements()){
String elem = (String)tok.nextElement();
returnString.append(value);
returnString.append(" ");
}
} else {
returnString.append(value);
}
}
returnString.append("</select>");
return returnString.toString();
}
String buildFieldDropDown(Vector fields, String entityName, HashMap properties){
if(properties == null) properties = new HashMap();
StringBuffer returnString = new StringBuffer();
ModelField modelField = null;
String selected = ((String)(properties.get("SELECTED") != null ? properties.get("SELECTED") : ""));
returnString.append("<select name=\"" + entityName + "\" >");
if(properties.get("EMPTY_FIRST") != null) returnString.append("<option value=\"\">" + properties.get("EMPTY_FIRST"));
for(int i=0;i<fields.size();i++){
modelField = (ModelField)fields.get(i);
returnString.append("<option value=\"" + modelField.getName() + "\"");
if((modelField.getName()).equals(selected)){
returnString.append(" SELECTED ");
}
returnString.append(" >" + formatJavaString(modelField.getName()));
}
returnString.append("</select>");
return returnString.toString();
}
/**
* Checks a List of fields to see if the string
* that is passed in exists in the vector. If so,
* it returns the ModelField for the named field, else
* it returns null.
*/
ModelField contains(List v, String s){
ModelField field;
for(int i=0; i<v.size();i++){
field = (ModelField)v.get(i);
if(field.getName().equals(s))
return field;
}
return null;
}
String buildUIFieldDropDown(String sectionName, List fields, String entityName, HashMap properties){
if(properties == null) properties = new HashMap();
StringBuffer returnString = new StringBuffer();
UIFieldInfo fieldInfo = null;
String selected = ((String)(properties.get("SELECTED") != null ? properties.get("SELECTED") : ""));
returnString.append("<select name=\"" + entityName + "\" >");
if(properties.get("EMPTY_FIRST") != null) returnString.append("<option value=\"\">" + properties.get("EMPTY_FIRST"));
for(int i=0;i<fields.size();i++){
fieldInfo = (UIFieldInfo)fields.get(i);
if ( fieldInfo.getIsVisible() && !fieldInfo.getIsReadOnly() )
{
String attrId = UIWebUtility.getHtmlName(sectionName, fieldInfo, 0);
String attrName = fieldInfo.getDisplayLabel();
returnString.append("<option value=\"" + attrId + "\"");
if(attrName.equals(selected)){
returnString.append(" SELECTED ");
}
returnString.append(" >" + attrName);
}
}
returnString.append("</select>");
return returnString.toString();
}
/**
* Given a ModelField and a value, this function checks the datatype for the field, and
* converts the value to the correct datatype.
*/
GenericValue setCorrectDataType(GenericValue entity, ModelField curField, String value){
ModelFieldTypeReader modelFieldTypeReader = new ModelFieldTypeReader("mysql");
ModelFieldType mft = modelFieldTypeReader.getModelFieldType(curField.getType());
String fieldType = mft.getJavaType();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm a");
if(fieldType.equals("java.lang.String") || fieldType.equals("String")){
if ( mft.getType().equals("indicator") )
{
if ( value.equals("on") )
entity.set(curField.getName(), "Y");
else if ( value.equals("off") )
entity.set(curField.getName(), "N");
else
entity.set(curField.getName(), value);
}
else
entity.set(curField.getName(), value);
} else if(fieldType.equals("java.sql.Timestamp") || fieldType.equals("Timestamp")) {
if(value.trim().length() == 0){
entity.set(curField.getName(), null);
} else {
try { entity.set(curField.getName(), new Timestamp(timeFormat.parse(value).getTime()));
} catch (ParseException e) { e.printStackTrace();
} //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
}
} else if(fieldType.equals("java.sql.Time") || fieldType.equals("Time")) {
if(value.trim().length() == 0){
entity.set(curField.getName(), null);
} else {
try { entity.set(curField.getName(), new Time(timeFormat.parse(value).getTime()));
} catch (ParseException e) { e.printStackTrace();
} //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
}
} else if(fieldType.equals("java.util.Date")) {
if(value.trim().length() == 0) {
entity.set(curField.getName(), null);
} else {
try { entity.set(curField.getName(), new java.sql.Date(dateFormat.parse(value).getTime()));
} catch (ParseException e) { e.printStackTrace();
} //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
}
} else if(fieldType.equals("java.sql.Date") || fieldType.equals("Date")) {
if(value.trim().length() == 0) {
entity.set(curField.getName(), null);
} else {
try { entity.set(curField.getName(), new java.sql.Date(dateFormat.parse(value).getTime()));
} catch (ParseException e) { e.printStackTrace();
} //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
}
} else if(fieldType.equals("java.lang.Integer") || fieldType.equals("Integer")) {
if(value.trim().length() == 0) value = "0";
entity.set(curField.getName(), Integer.valueOf(value));
}
else if(fieldType.equals("java.lang.Long") || fieldType.equals("Long")) {
if(value.trim().length() == 0) value = "0";
entity.set(curField.getName(), Long.valueOf(value));
}
else if(fieldType.equals("java.lang.Float") || fieldType.equals("Float")) {
if(value.trim().length() == 0) value = "0.0";
entity.set(curField.getName(), Float.valueOf(value));
}
else if(fieldType.equals("java.lang.Double") || fieldType.equals("Double")) {
if(value.trim().length() == 0 || value == null) value = "0";
entity.set(curField.getName(), Double.valueOf(value));
}
return entity;
}
String getFieldValue(List l, String fieldName, String equalsValue, String returnFieldName){
Iterator i = l.iterator();
GenericEntity genericEntity = null;
String retVal = "";
//TODO: add StringTokenizer to parse multiple fields.
while(i.hasNext()){
genericEntity = (GenericValue)i.next();
if(String.valueOf(genericEntity.get(fieldName)).equals(equalsValue))
retVal = String.valueOf(genericEntity.get(returnFieldName));
}
return retVal;
}
String getFieldValue(HttpServletRequest request, String fieldName){
return (request.getParameter(fieldName) != null ? request.getParameter(fieldName) : "");
}
Vector getGenericValue(List l, String fieldName, String equalsValue){
Vector returnVector = new Vector();
GenericValue genericValue = null;
GenericValue genericValues[] = (GenericValue[])l.toArray(new GenericValue[0]);
for(int i=0;i<genericValues.length;i++){
genericValue = (GenericValue)genericValues[i];
if(String.valueOf(genericValue.get(fieldName)).equals(equalsValue))
returnVector.add(genericValue);
}
return returnVector;
}
String getDateTimeFieldValue(List l, String fieldName, String equalsValue, String returnFieldName, String dateFormatString){
GenericValue genericValue = null;
GenericValue genericValues[] = (GenericValue[])l.toArray(new GenericValue[0]);
String retVal = "";
SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatString);
for(int i=0;i<genericValues.length;i++){
genericValue = genericValues[i];
try{
if(dateFormat.parse(genericValue.getString(fieldName)).equals(dateFormat.parse(equalsValue)))
retVal = String.valueOf(genericValue.get(returnFieldName));
} catch (ParseException e) {
e.printStackTrace();
}
}
return retVal;
}
Vector getDateTimeGenericValue(List l, String fieldName, String equalsValue, String dateFormatString){
Vector returnVector = new Vector();
GenericValue genericValue = null;
GenericValue genericValues[] = (GenericValue[])l.toArray(new GenericValue[0]);
String retVal = "";
SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatString);
for(int i=0;i<genericValues.length;i++){
genericValue = genericValues[i];
try{
if(dateFormat.parse(genericValue.getString(fieldName)).equals(dateFormat.parse(equalsValue)))
returnVector.add(genericValue);
} catch (ParseException e) {
e.printStackTrace();
}
}
return returnVector;
}
String getStatesDropDown(String name, String selected){
if(name == null) return null;
StringBuffer returnString = new StringBuffer();
returnString.append("<select class=\"\" name=\"" + name + "\" >");
returnString.append("<option " + (selected == null || selected.equals("") ? "selected" : "") + " >");
returnString.append("<option " + (selected != null && selected.equals("AK") ? "selected" : "") + " >AK");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("AL") ? " selected" : "") + ">AL");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("AR") ? " selected" : "") + ">AR");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("AZ") ? " selected" : "") + ">AZ");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("CA") ? " selected" : "") + ">CA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("CO") ? " selected" : "") + ">CO");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("CT") ? " selected" : "") + ">CT");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("DC") ? " selected" : "") + ">DC");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("DE") ? " selected" : "") + ">DE");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("FL") ? " selected" : "") + ">FL");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("GA") ? " selected" : "") + ">GA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("GU") ? " selected" : "") + ">GU");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("HI") ? " selected" : "") + ">HI");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("IA") ? " selected" : "") + ">IA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("ID") ? " selected" : "") + ">ID");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("IL") ? " selected" : "") + ">IL");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("IN") ? " selected" : "") + ">IN");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("KS") ? " selected" : "") + ">KS");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("KY") ? " selected" : "") + ">KY");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("LA") ? " selected" : "") + ">LA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MA") ? " selected" : "") + ">MA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MD") ? " selected" : "") + ">MD");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("ME") ? " selected" : "") + ">ME");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MI") ? " selected" : "") + ">MI");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MN") ? " selected" : "") + ">MN");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MO") ? " selected" : "") + ">MO");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MS") ? " selected" : "") + ">MS");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("MT") ? " selected" : "") + ">MT");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NC") ? " selected" : "") + ">NC");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("ND") ? " selected" : "") + ">ND");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NE") ? " selected" : "") + ">NE");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NH") ? " selected" : "") + ">NH");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NJ") ? " selected" : "") + ">NJ");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NM") ? " selected" : "") + ">NM");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NV") ? " selected" : "") + ">NV");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("NY") ? " selected" : "") + ">NY");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("OH") ? " selected" : "") + ">OH");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("OK") ? " selected" : "") + ">OK");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("OR") ? " selected" : "") + ">OR");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("PA") ? " selected" : "") + ">PA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("PR") ? " selected" : "") + ">PR");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("RI") ? " selected" : "") + ">RI");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("SC") ? " selected" : "") + ">SC");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("SD") ? " selected" : "") + ">SD");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("TN") ? " selected" : "") + ">TN");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("TX") ? " selected" : "") + ">TX");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("UT") ? " selected" : "") + ">UT");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("VA") ? " selected" : "") + ">VA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("VI") ? " selected" : "") + ">VI");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("VT") ? " selected" : "") + ">VT");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("WA") ? " selected" : "") + ">WA");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("WI") ? " selected" : "") + ">WI");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("WV") ? " selected" : "") + ">WV");
returnString.append("<option" + (selected != null && selected.equalsIgnoreCase("WY") ? " selected" : "") + ">WY");
returnString.append("</select>");
return returnString.toString();
}
private static java.util.Vector _jspx_includes;
static {
_jspx_includes = new java.util.Vector(11);
_jspx_includes.add("/includes/crossbrowser.js");
_jspx_includes.add("/includes/outlook.js");
_jspx_includes.add("/includes/header.jsp");
_jspx_includes.add("/includes/oldFunctions.jsp");
_jspx_includes.add("/includes/oldDeclarations.jsp");
_jspx_includes.add("/includes/windowTitle.jsp");
_jspx_includes.add("/includes/userStyle.jsp");
_jspx_includes.add("/includes/uiFunctions.js");
_jspx_includes.add("/includes/onBeforeUnload.jsp");
_jspx_includes.add("/includes/ts_picker.js");
_jspx_includes.add("/includes/getMenuPrivileges.jsp");
}
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_ofbiz_url;
public menu_jsp() {
_jspx_tagPool_ofbiz_url = new org.apache.jasper.runtime.TagHandlerPool();
}
public java.util.List getIncludes() {
return _jspx_includes;
}
public void _jspDestroy() {
_jspx_tagPool_ofbiz_url.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("<BASE target=\"content\">\r\n\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<script language=\"JavaScript1.2\">\r\n\r\n// ---------------------------------------------------------------------------\r\n// this script is copyright (c) 2001 by Michael Wallner!\r\n// http://www.wallner-software.com\r\n// mailto:dhtml@wallner-software.com\r\n//\r\n// you may use this script on web pages of your own\r\n// you must not remove this copyright note!\r\n//\r\n// This script featured on Dynamic Drive (http://www.dynamicdrive.com)\r\n// Visit http://www.dynamicdrive.com for full source to this script and more\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n// crossbrowser DHTML functions version 1.0\r\n//\r\n// supported browsers: IE4, IE5, NS4, NS6, MOZ, OP5\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n//get browser info\r\n//ermittle den verwendeten Browser\r\n//Unterstützt IE4, IE5, IE6?, NS4, NS6, Mozilla5 und Opera5\r\n//(Achtung op5 kann sich auch als NS oder IE ausgeben!)\r\n");
out.write("function browserType() {\r\n this.name = navigator.appName;\r\n this.version = navigator.appVersion;\t\t\t //Version string\r\n this.dom=document.getElementById?1:0\t\t\t //w3-dom\r\n this.op5=(this.name.indexOf(\"Opera\") > -1 && (this.dom))?1:0\t //Opera Browser\r\n this.ie4=(document.all && !this.dom)?1:0\t\t\t //ie4\r\n this.ie5=(this.dom && this.version.indexOf(\"MSIE \") > -1)?1:0\t //IE5, IE6?\r\n this.ns4=(document.layers && !this.dom)?1:0\t\t\t //NS4\r\n this.ns5=(this.dom && this.version.indexOf(\"MSIE \") == -1)?1:0 //NS6, Mozilla5\r\n\r\n //test if op5 telling \"i'm ie...\" (works because op5 doesn't support clip)\r\n //testen ob sich ein op5 als ie5 'ausgibt' (funktioniert weil op5 kein clip\r\n //unterstützt)\r\n if (this.ie4 || this.ie5) {\r\n document.write('");
out.write("<DIV id=testOpera style=\"position:absolute; visibility:hidden\">TestIfOpera5");
out.write("</DIV>');\r\n if (document.all['testOpera'].style.clip=='rect()') {\r\n this.ie4=0;\r\n this.ie5=0;\r\n this.op5=1;\r\n }\r\n }\r\n\r\n this.ok=(this.ie4 || this.ie5 || this.ns4 || this.ns5 || this.op5) //any DHTML\r\n eval (\"bt=this\");\r\n}\r\nbrowserType();\r\n\r\n\r\n//crossbrowser replacement for getElementById (find ns4 sublayers also!)\r\n//ersetzte 'getElementById' (findet auch sublayers in ns4)\r\nfunction getObj(obj){\r\n//do not use 'STYLE=' attribut in ");
out.write("<DIV> tags for NS4!\r\n//zumindest beim NS 4.08 dürfen ");
out.write("<DIV> Tags keine 'STYLE=' Angabe beinhalten\r\n//sonst werden die restlichen Layers nicht gefunden! class= ist jedoch erlaubt!\r\n\r\n //search layer for ns4\r\n //Recursive Suche nach Layer für NS4\r\n function getRefNS4(doc,obj){\r\n var fobj=0;\r\n var c=0\r\n while (c ");
out.write("< doc.layers.length) {\r\n if (doc.layers[c].name==obj) return doc.layers[c];\r\n\tfobj=getRefNS4(doc.layers[c].document,obj)\r\n\tif (fobj != 0) return fobj\r\n\tc++;\r\n }\r\n return 0;\r\n }\r\n\r\n return (bt.dom)?document.getElementById(obj):(bt.ie4)?\r\n document.all[obj]:(bt.ns4)?getRefNS4(document,obj):0\r\n}\r\n\r\n\r\n//get the actual browser window size\r\n//ermittle die größe der Browser Anzeigefläche\r\n//op5 supports offsetXXXX ans innerXXXX but offsetXXXX only after pageload!\r\n//op5 unterstützt sowohl innerXXXX als auch offsetXXXX aber offsetXXXX erst\r\n//nach dem vollständigen Laden der Seite!\r\nfunction createPageSize(){\r\n this.width=(bt.ns4 || bt.ns5 || bt.op5)?innerWidth:document.body.offsetWidth;\r\n this.height=(bt.ns4 || bt.ns5 || bt.op5)?innerHeight:document.body.offsetHeight;\r\n return this;\r\n}\r\nvar screenSize = new createPageSize();\r\n\r\n//create a crossbrowser layer object\r\nfunction createLayerObject(name) {\r\n this.name=name;\r\n this.obj=getObj(name);\r\n this.css=(bt.ns4)?obj:obj.style;\r\n this.x=parseInt(this.css.left);\r\n");
out.write(" this.y=parseInt(this.css.top);\r\n this.show=b_show;\r\n this.hide=b_hide;\r\n this.moveTo=b_moveTo;\r\n this.moveBy=b_moveBy;\r\n this.writeText=b_writeText;\r\n return this;\r\n}\r\n \r\n//crossbrowser show\r\nfunction b_show(){\r\n// this.visibility='visible'\r\n this.css.visibility='visible';\r\n}\r\n\r\n//crossbrowser hide\r\nfunction b_hide(){\r\n// this.visibility='hidden'\r\n this.css.visibility='hidden';\r\n}\r\n\r\n//crossbrowser move absolute\r\nfunction b_moveTo(x,y){\r\n this.x = x;\r\n this.y = y;\r\n this.css.left=x;\r\n this.css.top=y;\r\n}\r\n\r\n//crossbrowser move relative\r\nfunction b_moveBy(x,y){\r\n this.moveTo(this.x+x, this.y+y)\r\n}\r\n\r\n//write text into a layer (not supported by Opera 5!)\r\n//this function is not w3c-dom compatible but ns6\r\n//support innerHTML also!\r\n//Opera 5 does not support change of layer content!!\r\nfunction b_writeText(text) {\r\n if (bt.ns4) {\r\n this.obj.document.write(text);\r\n this.obj.document.close();\r\n }\r\n else {\r\n this.obj.innerHTML=text;\r\n }\r\n}\r\n");
out.write("</SCRIPT>\r\n\r\n\r\n");
out.write("\r\n");
out.write("<script language=\"JavaScript1.2\">\r\n// ---------------------------------------------------------------------------\r\n// this script is copyright (c) 2001 by Michael Wallner!\r\n// http://www.wallner-software.com\r\n// mailto:dhtml@wallner-software.com\r\n//\r\n// you may use this script on web pages of your own\r\n// you must not remove this copyright note!\r\n//\r\n// This script featured on Dynamic Drive (http://www.dynamicdrive.com)\r\n// Visit http://www.dynamicdrive.com for full source to this script and more\r\n// ---------------------------------------------------------------------------\r\n\r\n// ---------------------------------------------------------------------------\r\n// Outlook like navigation bar version 1.2\r\n//\r\n// supported browsers: IE4, IE5, NS4, NS6, MOZ, OP5\r\n// needed script files: crossbrowser.js\r\n//\r\n// History:\r\n// 1.0: initial version\r\n// 1.1: no Reload in IE and NS6\r\n// 1.2: no Reload in OP5 if width is not changed\r\n// ---------------------------------------------------------------------------\r\n");
out.write("\r\n//add one button to a panel\r\n//einen Button zu einem Panel hinzufügen\r\n//img: image name - Name der Bilddatei\r\n//label: button caption - Beschriftung des Buttons\r\n//action: javascript on MouseUp event - Javascript beim onMouseUp event\r\nfunction b_addButton(img, label, action) {\r\n this.img[this.img.length]=img;\r\n this.lbl[this.lbl.length]=label;\r\n this.act[this.act.length]=action;\r\n this.sta[this.sta.length]=0;\r\n\r\n return this\r\n}\r\n\r\n//reset all panel buttons (ns4, op5)\r\n//alle Panel Buttons zurücksetzten (ns4, op5)\r\nfunction b_clear() {\r\nvar i\r\n for (i=0;i");
out.write("<this.sta.length;i++) {\r\n if (this.sta[i] != 0)\r\n this.mOut(i);\r\n }\r\n}\r\n\r\n\r\n//----------------------------------------------------------------------------\r\n// Panel functions for Netscape 4\r\n//----------------------------------------------------------------------------\r\n\r\n// write new htmlcode into the button layer\r\n// schreibe den neuen HTML Code in den Button Layer\r\nfunction b_mOver_ns4(nr) {\r\n this.clear();\r\n l=this.obj.layers[0].layers[nr].document;\r\n l.open();\r\n l.write(\"");
out.write("<Center>\");\r\n l.write(\"");
out.write("<SPAN class='imgbout'>\");\r\n l.write(\"");
out.write("<A href='#' onmouseOut='\"+this.v+\".mOut(\"+nr+\")' \");\r\n l.write(\"onMousedown='\"+this.v+\".mDown(\"+nr+\")'>");
out.write("<img src='\"+this.img[nr]);\r\n l.write(\"' border=0>");
out.write("</A>");
out.write("</SPAN>");
out.write("<Font size=3 weight=bold face=Arial color=black>\");\r\n l.write(this.lbl[nr]+\"");
out.write("</FONT>");
out.write("<");
out.write("<BR>");
out.write("<BR>\");\r\n l.close();\r\n this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mOut_ns4(nr) {\r\n l=this.obj.layers[0].layers[nr].document;\r\n l.open();\r\n l.write(\"");
out.write("<Center>\")\r\n l.write(\"");
out.write("<SPAN class='imgnob'>\")\r\n l.write(\"");
out.write("<A href='#' onmouseOver='\"+this.v+\".mOver(\"+nr+\")' \");\r\n l.write(\"onmouseOut='\"+this.v+\".mOut(\"+nr+\")'>");
out.write("<img src='\"+this.img[nr]);\r\n l.write(\"' border=0>");
out.write("</A>");
out.write("</SPAN>");
out.write("<Font size=3 weight=bold Face=Arial color=black>\");\r\n l.write(this.lbl[nr]+\"");
out.write("</FONT>");
out.write("<BR>");
out.write("<BR>\");\r\n l.close();\r\n this.sta[nr]=0;\r\n}\r\n\r\nfunction b_mDown_ns4(nr) {\r\n l=this.obj.layers[0].layers[nr].document;\r\n l.open();\r\n l.write(\"");
out.write("<Center>\")\r\n l.write(\"");
out.write("<SPAN class='imgbin'>\")\r\n l.write(\"");
out.write("<A href='#' onmouseOver='\"+this.v+\".mOver(\"+nr+\")' \");\r\n l.write(\"onmouseOut='\"+this.v+\".mOut(\"+nr+\")' onMouseup='\"+this.act[nr]);\r\n l.write(\";\"+this.v+\".mOver(\"+nr+\")'>");
out.write("<img src='\"+this.img[nr]);\r\n l.write(\"' border=0>");
out.write("</A>");
out.write("</SPAN>");
out.write("<Font size=3 weight=bold Face=Arial color=black>\");\r\n l.write(this.lbl[nr]+\"");
out.write("</FONT>");
out.write("<BR>");
out.write("<BR>\");\r\n l.close();\r\n this.sta[nr]=1;\r\n}\r\n\r\n//test if scroll buttons should be visible\r\n//teste ob Scroll-Buttons sichtbar sein sollen\r\nfunction b_testScroll_ns4() {\r\nvar i\r\nvar j\r\nvar k\r\n\r\n i=this.obj.clip.bottom;\r\n j=this.obj.layers[0].clip.bottom;\r\n k=parseInt(this.obj.layers[0].top);\r\n\r\n if (k==38)\r\n this.obj.layers[2].visibility='hide';\r\n else\r\n this.obj.layers[2].visibility='show';\r\n\r\n if ((j+k)");
out.write("<i) {\r\n this.obj.layers[3].visibility='hide';\r\n }\r\n else\r\n this.obj.layers[3].visibility='show';\r\n}\r\n\r\n//scroll the panel content up\r\n//scrolle den Panel Inhalt nach Oben\r\nfunction b_up_ns4(nr) {\r\n this.ftop = this.ftop - 5;\r\n this.obj.layers[0].top=this.ftop;\r\n nr--\r\n if (nr>0)\r\n setTimeout(this.v+'.up('+nr+');',10);\r\n else\r\n this.testScroll();\r\n}\r\n\r\n//scroll the panel content down\r\n//scrolle den Panel Inhalt nach Unten\r\nfunction b_down_ns4(nr) {\r\n this.ftop = this.ftop + 5;\r\n if (this.ftop>=38) {\r\n this.ftop=38;\r\n nr=0;\r\n }\r\n this.obj.layers[0].top=this.ftop;\r\n nr--\r\n\r\n if (nr>0)\r\n setTimeout(this.v+'.down('+nr+');',10);\r\n else\r\n this.testScroll();\r\n}\r\n\r\n//----------------------------------------------------------------------------\r\n// Panel functions for Opera5\r\n//----------------------------------------------------------------------------\r\n\r\n//show one panelbutton layer and hide the others two\r\n//zeige einen Panel Button Layer und verstecke die anderen beiden\r\n");
out.write("function b_mOver_op5(nr) {\r\n var obj0=getObj(this.name+'_b'+nr+'0')\r\n var obj1=getObj(this.name+'_b'+nr+'1')\r\n var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n this.clear();\r\n obj1.style.visibility=\"VISIBLE\";\r\n obj0.style.visibility=\"HIDDEN\";\r\n obj2.style.visibility=\"HIDDEN\";\r\n this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mOut_op5(nr) {\r\n var obj0=getObj(this.name+'_b'+nr+'0')\r\n var obj1=getObj(this.name+'_b'+nr+'1')\r\n var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n obj2.style.visibility=\"visible\";\r\n obj0.style.visibility=\"hidden\";\r\n obj1.style.visibility=\"hidden\";\r\n this.sta[nr]=1;\r\n}\r\n\r\nfunction b_mDown_op5(nr) {\r\n var obj0=getObj(this.name+'_b'+nr+'0')\r\n var obj1=getObj(this.name+'_b'+nr+'1')\r\n var obj2=getObj(this.name+'_b'+nr+'2')\r\n\r\n obj0.style.visibility=\"visible\";\r\n obj1.style.visibility=\"hidden\";\r\n obj2.style.visibility=\"hidden\";\r\n this.sta[nr]=1;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Panel functions for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n");
out.write("\r\n//test if scroll buttons should be visible\r\n//teste ob Scroll-Buttons sichtbar sein sollen\r\nfunction b_testScroll() {\r\n\r\n if (bt.op5) {\r\n var i=parseInt(this.obj.style.pixelHeight);\r\n var j=parseInt(this.objf.style.pixelHeight);\r\n }\r\n else {\r\n var i=parseInt(this.obj.style.height);\r\n var j=parseInt(this.objf.style.height);\r\n }\r\n var k=parseInt(this.objf.style.top);\r\n\r\n\r\n if (k==38)\r\n this.objm1.style.visibility='hidden';\r\n else\r\n this.objm1.style.visibility='visible';\r\n\r\n if ((j+k)");
out.write("<i) {\r\n this.objm2.style.visibility='hidden';\r\n }\r\n else\r\n this.objm2.style.visibility='visible';\r\n}\r\n\r\n//scroll the panel content up\r\n//scrolle den Panel Inhalt nach Oben\r\nfunction b_up(nr) {\r\n this.ftop = this.ftop - 5;\r\n this.objf.style.top=this.ftop;\r\n nr--\r\n if (nr>0)\r\n setTimeout(this.v+'.up('+nr+');',10);\r\n else\r\n this.testScroll();\r\n}\r\n\r\n//scroll the panel content down\r\n//scrolle den Panel Inhalt nach Unten\r\nfunction b_down(nr) {\r\n this.ftop = this.ftop + 5;\r\n if (this.ftop>=38) {\r\n this.ftop=38;\r\n nr=0;\r\n }\r\n this.objf.style.top=this.ftop;\r\n nr--\r\n\r\n if (nr>0)\r\n setTimeout(this.v+'.down('+nr+');',10);\r\n else\r\n this.testScroll();\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Panel object\r\n// ---------------------------------------------------------------------------\r\n\r\n//create one panel\r\nfunction createPanel(name,caption) {\r\n this.name=name; // panel layer ID\r\n this.ftop=38; // actual panel scroll position\r\n");
out.write(" this.obj=null; // panel layer object\r\n this.objc=null; // caption layer object\r\n this.objf=null; // panel field layer object\r\n this.objm1=null; // scroll button up\r\n this.objm2=null; // scroll button down\r\n this.caption=caption; // panel caption\r\n this.img=new Array(); // button images\r\n this.lbl=new Array(); // button labels\r\n this.act=new Array(); // button actions\r\n this.sta=new Array(); // button status (internal)\r\n this.addButton=b_addButton; // add one button to panel\r\n this.clear=b_clear; // reset all buttons\r\n if (bt.ns4) { // functions for ns4\r\n this.mOver=b_mOver_ns4; // handles mouseOver event\r\n this.mOut=b_mOut_ns4; // handles mouseOut & mouseUp event\r\n this.mDown=b_mDown_ns4; // handles mouseDown event\r\n this.testScroll=b_testScroll_ns4; // test if scroll buttons visible\r\n");
out.write(" this.up=b_up_ns4; // scroll panel buttons up\r\n this.down=b_down_ns4; // scroll panel buttons down\r\n }\r\n if (bt.op5) { // functions for op5\r\n this.mOver=b_mOver_op5; // handles mouseOver event\r\n this.mOut=b_mOut_op5; // handles mouseOut & mouseUp event\r\n this.mDown=b_mDown_op5; // handles mouseDown event\r\n }\r\n if (!bt.ns4) { // functions for all browsers but ns4\r\n this.testScroll=b_testScroll; // test if scroll buttons should be visible\r\n this.up=b_up; // scroll panel buttons up\r\n this.down=b_down; // scroll panel buttons down\r\n }\r\n\r\n this.v = this.name + \"var\"; // global var of 'this'\r\n eval(this.v + \"=this\");\r\n\r\n return this\r\n}\r\n\r\n//add one panel to the outlookbar\r\nfunction b_addPanel(panel) {\r\n panel.name=this.name+'_panel'+this.panels.length\r\n this.panels[this.panels.length] = panel;\r\n}\r\n\r\n//write style sheets\r\n//schreibe die Style sheets\r\n");
out.write("function b_writeStyle() {\r\n\r\n document.write('");
out.write("<STYLE TYPE=\"text/css\">');\r\n\r\n document.write('.button {width:300; text-align:center; font-family:arial;');\r\n document.write(' font-size:8pt; font-weight:bold; cursor:hand; border-width:2;');\r\n document.write(' border-style:outset; border-color:silver; ');\r\n document.write('background-color:silver;}');\r\n\r\n document.write('.noLine {text-decoration:none;}');\r\n\r\n document.write('.imgB {color:black; font-weight:bold; font-family:arial; font-size:8pt; cursor:default;}');\r\n\r\n if (bt.op5) {\r\n document.write('.imgbin {border-width:3; border-style:inset; ');\r\n document.write('border-color:white; cursor:hand;}');\r\n }\r\n else {\r\n document.write('.imgbin {border-width:3; border-style:inset; ');\r\n document.write('border-color:silver; cursor:hand;}');\r\n }\r\n\r\n if (bt.op5) {\r\n document.write('.imgbout {border-width:3; border-style:outset; ');\r\n document.write('border-color:white; cursor:hand;}');\r\n }\r\n else {\r\n document.write('.imgbout {border-width:3; border-style:outset; ');\r\n document.write('border-color:silver; cursor:hand;}');\r\n");
out.write(" }\r\n\r\n document.write(' .imgnob {border-width:3; border-style:solid; ');\r\n document.write('border-color:'+this.bgcolor+';}');\r\n\r\n document.write('");
out.write("</STYLE>');\r\n\r\n}\r\n\r\n// Draw the Outlook Bar\r\nfunction b_draw() {\r\nvar i;\r\nvar j;\r\nvar t=0;\r\nvar h;\r\nvar c=0;\r\n\r\n this.writeStyle();\r\n\r\n if (bt.ns5 || bt.op5) c=6; //two times border width\r\n\r\n\r\n\r\n if (bt.ns4) { //draw OutlookBar for ns4\r\n //OutlookBar layer..\r\n document.write('");
out.write("<layer bgcolor='+this.bgcolor+' name='+this.name+' left=');\r\n document.write(this.xpos+' top='+this.ypos+' width='+this.width);\r\n document.write(' clip=\"0,0,'+this.width+','+this.height+'\">');\r\n\r\n //one layer for every panel...\r\n for (i=0;i");
out.write("<this.panels.length;i++) {\r\n document.write('");
out.write("<Layer name='+this.name+'_panel'+i+' width='+this.width);\r\n document.write(' top='+i*28+' bgcolor='+this.bgcolor);\r\n document.write(' clip=\"0,0,'+this.width+',');\r\n document.write(this.height-(this.panels.length-1)*28+'\">');\r\n\r\n //one layer to host the panel buttons\r\n document.write('");
out.write("<Layer top=38 width='+this.width+'>');\r\n mtop=0\r\n\r\n //one layer for every button\r\n for (j=0;j");
out.write("<this.panels[i].img.length;j++) {\r\n document.write('");
out.write("<Layer top='+mtop+' width='+this.width);\r\n document.write('>");
out.write("<Center>");
out.write("<SPAN class=imgnob>');\r\n document.write(\"");
out.write("<A href='#' onmouseOut='\"+this.panels[i].v);\r\n document.write(\".rst(\"+j+\")' onmouseOver='\"+this.panels[i].v);\r\n document.write(\".mOver(\"+j+\")'>");
out.write("<img src='\"+this.panels[i].img[j]);\r\n document.write(\"' border=0>");
out.write("</A>");
out.write("</SPAN>\");\r\n document.write(\"");
out.write("<Font size=3 weight=bold face=arial color=black>\");\r\n document.write(this.panels[i].lbl[j]+\"");
out.write("</FONT>");
out.write("<BR>");
out.write("<BR>\");\r\n document.write('");
out.write("</Layer>');\r\n mtop=mtop+this.buttonspace;\r\n }\r\n\r\n document.write('");
out.write("</Layer>');\r\n\r\n //one layer for the panels caption\r\n document.write('");
out.write("<Layer top=0 width='+this.width+' clip=\"0,0,');\r\n document.write(this.width+',28\" bgcolor=silver class=button ');\r\n document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n document.write('");
out.write("<A class=noLine href=\"javascript:'+this.v+'.showPanel(');\r\n document.write(i+');\" onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n document.write('");
out.write("<Font Color=black weight=bold class=noLine>'+this.panels[i].caption);\r\n document.write('");
out.write("</Font>");
out.write("</A>");
out.write("</Layer>');\r\n\r\n //two layers for scroll-up -down buttons\r\n document.write('");
out.write("<Layer visibility=hide top=40 left='+(this.width-20));\r\n document.write('>");
out.write("<A href=\"#\" onClick=\"'+this.panels[i].v+'.down(16);\" ');\r\n document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">");
out.write("<img ');\r\n document.write('width=16 height=16 src=/sfaimages/arrowup.gif border=0>');\r\n document.write('");
out.write("</A>");
out.write("</LAYER>");
out.write("<Layer top=');\r\n document.write((this.height-(this.panels.length)*28)+'");
out.write("<Layer top=');\r\n document.write((this.height-(this.panels.length)*28)+' left=');\r\n document.write((this.width-20)+'>");
out.write("<A href=\"#\" onClick=\"');\r\n document.write(this.panels[i].v+'.up(16);\" onmouseOver=\"');\r\n document.write(this.panels[i].v+'.clear();\">");
out.write("<img width=16 height=16 ');\r\n document.write('src=/sfaimages/arrowdown.gif border=0>");
out.write("</A>");
out.write("</LAYER>');\r\n\r\n document.write('");
out.write("</LAYER>');\r\n }\r\n document.write('");
out.write("</LAYER>');\r\n }\r\n else { //draw Outlook bar for all browsers but ns4\r\n\r\n //OutlookBar layer..\r\n document.write('");
out.write("<DIV id='+this.name+' Style=\"position:absolute; left:');\r\n document.write(this.xpos+'; top:'+this.ypos+'; width:'+this.width);\r\n document.write('; height:'+this.height+'; background-color:'+this.bgcolor)\r\n document.write('; clip:rect(0,'+this.width+','+this.height+',0)\">');\r\n h=this.height-((this.panels.length-1)*28)\r\n\r\n //one layer for every panel...\r\n for (i=0;i");
out.write("<this.panels.length;i++) {\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i);\r\n document.write(' Style=\"position:absolute; left:0; top:'+t);\r\n document.write('; width:'+this.width+'; height:'+h+'; clip:rect(0px, ');\r\n document.write(this.width+'px, '+h+'px, 0px); background-color:');\r\n document.write(this.bgcolor+';\">')\r\n t=t+28;\r\n\r\n //one layer to host the panel buttons\r\n document.write('");
out.write("<div id='+this.name+'_panel'+i);\r\n document.write('_f Style=\"position:absolute; left:0; top:38; width:');\r\n document.write(this.width+'; height:');\r\n document.write((this.panels[i].img.length*this.buttonspace));\r\n document.write('; background-color:'+this.bgcolor+';\">')\r\n mtop=0\r\n\r\n //one (ie4, ie5, ns5) or three layers (op5) for every button\r\n for (j=0;j");
out.write("<this.panels[i].img.length;j++) {\r\n if (bt.op5) {\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i+'_b'+j);\r\n document.write('0 class=imgB Style=\"position:absolute; ');\r\n document.write('visibility:hidden; left:0; width:'+this.width);\r\n document.write('; top:'+mtop+'; text-align:center;\">');\r\n document.write('");
out.write("<img src='+this.panels[i].img[j]);\r\n document.write(' class=imgbin onmouseUp=\\''+this.panels[i].v);\r\n document.write('.mOver('+j+');'+this.panels[i].act[j]);\r\n document.write(';\\' onmouseOut=\"'+this.panels[i].v+'.mOut('+j);\r\n document.write(');\">");
out.write("<BR>'+this.panels[i].lbl[j]+'");
out.write("</DIV>');\r\n\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i+'_b'+j+'1 class=imgB');\r\n document.write(' Style=\"position:absolute; visibility:hidden; ');\r\n document.write('left:0; width:'+this.width+'; top:'+mtop);\r\n document.write('; text-align:center;\">');\r\n document.write('");
out.write("<img src='+this.panels[i].img[j]);\r\n document.write(' class=imgbout onmouseDown=\"'+this.panels[i].v);\r\n document.write('.mDown('+j+');\" onmouseUp=\\''+this.panels[i].v);\r\n document.write('.mOver('+j+');'+this.panels[i].act[j]);\r\n document.write(';\\' onmouseOut=\"'+this.panels[i].v+'.mOut('+j);\r\n document.write(');\">");
out.write("<BR>'+this.panels[i].lbl[j]+'");
out.write("</DIV>');\r\n\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i+'_b'+j);\r\n document.write('2 class=imgB Style=\"position:absolute; ');\r\n document.write('visibility:visible; left:0; width:'+this.width);\r\n document.write('; top:'+mtop+'; text-align:center;\">');\r\n document.write('");
out.write("<img src='+this.panels[i].img[j]+' class=imgnob ');\r\n document.write('onmouseOver=\"'+this.panels[i].v+'.mOver('+j);\r\n document.write(');\">");
out.write("<BR>'+this.panels[i].lbl[j]+'");
out.write("</DIV>');\r\n }\r\n else {\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i+'_b'+j+' class=imgB ');\r\n document.write('Style=\"position:absolute; left:0; width:'+this.width);\r\n document.write('; top:'+mtop+'; text-align:center;\">');\r\n document.write('");
out.write("<img src='+this.panels[i].img[j]+' class=imgnob ');\r\n document.write('onmouseOver=\"this.className=\\'imgbout\\';\" ');\r\n document.write('onmouseDown=\"this.className=\\'imgbin\\';\" ');\r\n document.write('onmouseUp=\\'this.className=\"imgbout\";');\r\n document.write(this.panels[i].act[j]+';\\' ');\r\n document.write('onmouseOut=\"this.className=\\'imgnob\\';\">");
out.write("<BR>');\r\n document.write(this.panels[i].lbl[j]+'");
out.write("</DIV>');\r\n }\r\n mtop=mtop+this.buttonspace;\r\n }\r\n\r\n document.write('");
out.write("</DIV>');\r\n\r\n //one layer for the panels caption if not op5!\r\n if (!bt.op5) {\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i+'_c class=button ');\r\n document.write('onClick=\"javascript:'+this.v+'.showPanel('+i);\r\n document.write(');\" style=\"position:absolute; left:0; top:0; width:');\r\n document.write((this.width-c)+'; height:'+(28-c)+';\">");
out.write("<A href=\"#\" ');\r\n document.write('onClick=\"'+this.v+'.showPanel('+i+');this.blur();');\r\n document.write('return false;\" class=noLine>");
out.write("<FONT weight=bold color=black ');\r\n document.write('class=noLine\">'+this.panels[i].caption);\r\n document.write('");
out.write("</FONT>");
out.write("</A>");
out.write("</DIV>')\r\n }\r\n //two layers for scroll-up -down buttons\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i);\r\n document.write('_m1 style=\"position:absolute; top:40; left:');\r\n document.write((this.width-20)+';\">");
out.write("<A href=\"#\" onClick=\"');\r\n document.write(this.panels[i].v+'.down(16);this.blur();return false;\" ');\r\n document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n document.write('");
out.write("<img width=16 height=16 src=/sfaimages/arrowup.gif border=0>');\r\n document.write('");
out.write("</A>");
out.write("</DIV>');\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i);\r\n document.write('_m2 style=\"position:absolute; top:');\r\n document.write((this.height-(this.panels.length)*28)+'; left:');\r\n document.write((this.width-20)+';\">");
out.write("<A href=\"#\" onClick=\"');\r\n document.write(this.panels[i].v+'.up(16);this.blur();return false\" ');\r\n document.write('onmouseOver=\"'+this.panels[i].v+'.clear();\">');\r\n document.write('");
out.write("<img width=16 height=16 src=/sfaimages/arrowdown.gif border=0>');\r\n document.write('");
out.write("</A>");
out.write("</DIV>');\r\n\r\n\r\n document.write('");
out.write("</DIV>')\r\n\r\n }\r\n //Opera bug (Clip!)\r\n //op5 doesn't support layer clipping! so use top layers for panel caption\r\n //and two top layers with background-color like page color to hide\r\n //panel content outside of the outlookbar.\r\n //op5 unterstützt kein Clip bei Layers! darum erzeugen wir drei top level\r\n //layers für die Panel Überschrift und zwei top Layers mit der gleichen\r\n //Hintergrundfarbe wie die HTML Seite um den Panel Inhalt außerhalb des\r\n //Outlook Bars zu verdecken!\r\n if (bt.op5) {\r\n //one layers for panel captions if op5\r\n for (i=0;i");
out.write("<this.panels.length;i++) {\r\n document.write('");
out.write("<DIV id='+this.name+'_panel'+i);\r\n document.write('_c class=button onmouseOver=\"'+this.panels[i].v);\r\n document.write('.clear();\" onClick=\"'+this.v+'.showPanel('+i);\r\n document.write(');\" style=\"position:absolute; left:0; top:0; width:');\r\n document.write((this.width-c)+'; height:'+(28-c)+';\">');\r\n document.write('");
out.write("<A href=\"#\" ');\r\n document.write('onClick=\"'+this.v+'.showPanel('+i+');this.blur();');\r\n document.write('return false;\" class=noLine>");
out.write("<FONT weight=bold color=black ');\r\n document.write('class=noLine\">'+this.panels[i].caption);\r\n document.write('");
out.write("</FONT>");
out.write("</A>");
out.write("</DIV>')\r\n }\r\n //two layers to hide 'nonvisible' part of panel\r\n //(op5 doesn't support clipping!)\r\n //document.write('");
out.write("<DIV style=\"position:absolute; left:0; top:');\r\n //document.write(this.height+'; height:300; width:'+this.width);\r\n //document.write('; background-color:'+this.pagecolor+';\">");
out.write("</DIV>');\r\n //document.write('");
out.write("<DIV style=\"position:absolute; left:0; top:-300; ');\r\n //document.write('height:300; width:'+this.width+'; background-color:');\r\n //document.write(this.pagecolor+';\">");
out.write("</DIV>');\r\n }\r\n document.write('");
out.write("</DIV>');\r\n\r\n }\r\n for (i=0;i");
out.write("<this.panels.length;i++) {\r\n this.panels[i].obj=getObj(this.name+'_panel'+i);\r\n if (!bt.ns4) {\r\n this.panels[i].objc=getObj(this.name+'_panel'+i+'_c');\r\n this.panels[i].objf=getObj(this.name+'_panel'+i+'_f');\r\n this.panels[i].objm1=getObj(this.name+'_panel'+i+'_m1');\r\n this.panels[i].objm2=getObj(this.name+'_panel'+i+'_m2');\r\n }\r\n this.panels[i].testScroll();\r\n }\r\n\r\n// SFOWLER - 03/04/02 this causes the session id to be corrupted after it times out.\r\n// //activate last panel\r\n// //op5 dosen't support cookies!\r\n// //so get actual panel from url paramter\r\n// if (bt.op5) {\r\n// if (document.location.search=='') {\r\n// this.showPanel(0);\r\n// }\r\n// else\r\n// this.showPanel(document.location.search.substr(1,1));\r\n// }\r\n// else {\r\n// //actual panel is saved in a cookie\r\n// if (document.cookie)\r\n// this.showPanel(document.cookie);\r\n// else\r\n// this.showPanel(0);\r\n// }\r\n//\r\n}\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n");
out.write("// outlookbar function for ns4\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction b_showPanel_ns4(nr) {\r\nvar i\r\nvar l\r\n// document.cookie=nr;\r\n l = this.panels.length;\r\n for (i=0;i");
out.write("<l;i++) {\r\n if (i>nr) {\r\n this.panels[i].obj.top=this.height-((l-i)*28)-1;\r\n }\r\n else {\r\n this.panels[i].obj.top=i*28;\r\n }\r\n }\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// outlookbar function for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction b_showPanel(nr) {\r\nvar i\r\nvar l\r\nvar o\r\n //document.cookie=nr;\r\n this.aktPanel=nr;\r\n l = this.panels.length;\r\n for (i=0;i");
out.write("<l;i++) {\r\n if (i>nr) {\r\n this.panels[i].obj.style.top=this.height-((l-i)*28);\r\n //Opera doesn't support clip:rect()!\r\n //so hide non visible panels\r\n //and move panel caption\r\n if (bt.op5) {\r\n this.panels[i].objf.style.visibility='hidden';\r\n this.panels[i].objc.style.top=this.height-((l-i)*28);\r\n }\r\n }\r\n else {\r\n this.panels[i].obj.style.top=i*28;\r\n //Opera doesn't support clip:rect()!\r\n //so show visible panel\r\n //and move panel caption\r\n if (bt.op5) {\r\n this.panels[i].objf.style.visibility='visible';\r\n this.panels[i].objc.style.top=i*28;\r\n }\r\n }\r\n }\r\n}\r\n\r\n//resize the Outlook Like Bar\r\n//IE4/5 & NS6 -> resize all layers (width & height)\r\n//op5 -> resize only height - reload on width change\r\n//ns4 -> reload on any change!\r\n//\r\n//if you change the width of a layer (style=\"text-align:center;\") then\r\n//the content will not be moved!\r\nfunction b_resize(x,y,width,height) {\r\nvar o\r\nvar i\r\nvar j\r\nvar h\r\n");
out.write("var c=(bt.ns5)?6:0;\r\n\r\n if (bt.ns4)\r\n location.reload();\r\n else {\r\n if (bt.op5 && (width!=this.width))\r\n if (location.href.indexOf('?')!=-1)\r\n location.href=location.href.replace(/\\?./,\"?\"+this.aktPanel)\r\n else\r\n location.href= location.href+'?'+this.aktPanel;\r\n else {\r\n this.xpos=x;\r\n this.yPos=y;\r\n this.width=width\r\n this.height=height\r\n\r\n o=getObj(this.name);\r\n o.style.left=x;\r\n o.style.top=y;\r\n o.style.width=width;\r\n o.style.height=height;\r\n o.style.clip='rect(0px '+this.width+'px '+this.height+'px 0px)';\r\n\r\n h=this.height-((this.panels.length-1)*28)\r\n\r\n for (i=0; i");
out.write("<this.panels.length; i++) {\r\n\r\n o=getObj(this.name+'_panel'+i+'_c');\r\n o.style.width=(this.width-c);\r\n\r\n if (!bt.op5)\r\n for (j=0;j");
out.write("<this.panels[i].img.length;j++) {\r\n o=getObj(this.name+'_panel'+i+'_b'+j);\r\n o.style.width=this.width;\r\n }\r\n\r\n this.panels[i].objm1.style.left=(this.width-20);\r\n this.panels[i].objm2.style.top=(this.height-(this.panels.length)*28);\r\n this.panels[i].objm2.style.left=(this.width-20);\r\n this.panels[i].objf.style.width=this.width;\r\n this.panels[i].obj.style.width=this.width\r\n this.panels[i].obj.style.height=h\r\n this.panels[i].obj.style.pixelHeight=h\r\n this.panels[i].obj.style.clip='rect(0px '+this.width+'px '+h+'px 0px)';\r\n\r\n this.panels[i].testScroll();\r\n }\r\n }\r\n this.showPanel(this.aktPanel);\r\n }\r\n}\r\n\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n// OutlookBar object for ie4, ie5, ns5, op5\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction createOutlookBar(name,x,y,width,height,bgcolor,pagecolor) {\r\n this.aktPanel=0; // last open panel\r\n");
out.write(" this.name=name // OutlookBar name\r\n this.xpos=x; // bar x-pos\r\n this.ypos=y; // bar y-pos\r\n this.width=width; // bar width\r\n this.height=height; // bar height\r\n this.bgcolor=bgcolor; // bar background color\r\n this.pagecolor=pagecolor; // page bgcolor (op5!)\r\n this.buttonspace=74; // distance of panel buttons\r\n this.panels=new Array() // OutlookBar panels\r\n this.addPanel=b_addPanel; // add new panel to bar\r\n this.writeStyle=b_writeStyle;\r\n this.draw=b_draw; // write HTML code of bar\r\n if (bt.ns4)\r\n this.showPanel=b_showPanel_ns4; // make a panel visible (ns4)\r\n else\r\n this.showPanel=b_showPanel; // make a panel visible (!=ns4)\r\n\r\n this.resize=b_resize; // resize Outlook Like Bar\r\n\r\n this.v = name + \"var\"; // global var of 'this'\r\n");
out.write(" eval(this.v + \"=this\");\r\n\r\n return this\r\n}\r\n");
out.write("</SCRIPT>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n\r\n");
out.write("\r\n\r\n");
org.ofbiz.security.Security security = null;
synchronized (application) {
security = (org.ofbiz.security.Security) pageContext.getAttribute("security", PageContext.APPLICATION_SCOPE);
if (security == null){
throw new java.lang.InstantiationException("bean security not found within scope");
}
}
out.write("\r\n");
org.ofbiz.entity.GenericDelegator delegator = null;
synchronized (application) {
delegator = (org.ofbiz.entity.GenericDelegator) pageContext.getAttribute("delegator", PageContext.APPLICATION_SCOPE);
if (delegator == null){
throw new java.lang.InstantiationException("bean delegator not found within scope");
}
}
out.write("\r\n");
com.sourcetap.sfa.event.GenericWebEventProcessor webEventProcessor = null;
synchronized (application) {
webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) pageContext.getAttribute("webEventProcessor", PageContext.APPLICATION_SCOPE);
if (webEventProcessor == null){
try {
webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.sourcetap.sfa.event.GenericWebEventProcessor");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class " + "com.sourcetap.sfa.event.GenericWebEventProcessor", exc);
}
pageContext.setAttribute("webEventProcessor", webEventProcessor, PageContext.APPLICATION_SCOPE);
}
}
out.write("\r\n");
com.sourcetap.sfa.event.GenericEventProcessor eventProcessor = null;
synchronized (application) {
eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) pageContext.getAttribute("eventProcessor", PageContext.APPLICATION_SCOPE);
if (eventProcessor == null){
try {
eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.sourcetap.sfa.event.GenericEventProcessor");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class " + "com.sourcetap.sfa.event.GenericEventProcessor", exc);
}
pageContext.setAttribute("eventProcessor", eventProcessor, PageContext.APPLICATION_SCOPE);
}
}
out.write("\r\n");
com.sourcetap.sfa.ui.UICache uiCache = null;
synchronized (application) {
uiCache = (com.sourcetap.sfa.ui.UICache) pageContext.getAttribute("uiCache", PageContext.APPLICATION_SCOPE);
if (uiCache == null){
try {
uiCache = (com.sourcetap.sfa.ui.UICache) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.sourcetap.sfa.ui.UICache");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class " + "com.sourcetap.sfa.ui.UICache", exc);
}
pageContext.setAttribute("uiCache", uiCache, PageContext.APPLICATION_SCOPE);
}
}
out.write("\r\n\r\n");
out.write("<!-- [oldFunctions.jsp] Begin -->\r\n");
out.write("\r\n");
out.write("<!-- [oldFunctions.jsp] End -->\r\n\r\n");
out.write("\r\n");
out.write("<!-- [oldDeclarations.jsp] Start -->\r\n\r\n");
GenericValue userLogin = (GenericValue)session.getAttribute("_USER_LOGIN_");
out.write("\r\n");
UserInfo userInfo = (UserInfo) session.getAttribute("userInfo");
out.write("\r\n\r\n");
String partyId = "";
if (userLogin != null )
partyId = userLogin.getString("partyId");
out.write("\r\n\r\n");
DecimalFormat decimalFormat = new DecimalFormat("#,###.##");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy");
SimpleDateFormat simpleTimeFormat = new SimpleDateFormat("K:mm a");
out.write("\r\n\r\n");
String controlPath=(String)request.getAttribute("_CONTROL_PATH_");
out.write("\r\n");
String contextRoot=(String)request.getAttribute("_CONTEXT_ROOT_");
out.write("\r\n\r\n");
String pageName = UtilFormatOut.checkNull((String)pageContext.getAttribute("PageName"));
out.write("\r\n\r\n");
String companyName = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "company.name");
out.write("\r\n");
String companySubtitle = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "company.subtitle");
out.write("\r\n");
String headerImageUrl = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.image.url");
out.write("\r\n\r\n");
String headerBoxBorderColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.border.color", "black");
out.write("\r\n");
String headerBoxBorderWidth = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.border.width", "1");
out.write("\r\n");
String headerBoxTopColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.top.color", "#336699");
out.write("\r\n");
String headerBoxBottomColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.bottom.color", "#cccc99");
out.write("\r\n");
String headerBoxBottomColorAlt = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.bottom.alt.color", "#eeeecc");
out.write("\r\n");
String headerBoxTopPadding = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.top.padding", "4");
out.write("\r\n");
String headerBoxBottomPadding = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "header.box.bottom.padding", "2");
out.write("\r\n\r\n");
String boxBorderColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.border.color", "black");
out.write("\r\n");
String boxBorderWidth = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.border.width", "1");
out.write("\r\n");
String boxTopColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.top.color", "#336699");
out.write("\r\n");
String boxBottomColor = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.bottom.color", "white");
out.write("\r\n");
String boxBottomColorAlt = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.bottom.alt.color", "white");
out.write("\r\n");
String boxTopPadding = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.top.padding", "4");
out.write("\r\n");
String boxBottomPadding = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "box.bottom.padding", "4");
out.write("\r\n");
String userStyleSheet = "/sfa/includes/maincss.css";
out.write("\r\n");
String alphabet[]={"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "*"};
out.write("\r\n\r\n");
out.write("<!-- [oldDeclarations.jsp] End -->\r\n\r\n");
out.write("\r\n\r\n");
out.write("<HTML>\r\n");
out.write("<HEAD>\r\n\r\n");
String clientRequest = (String)session.getAttribute("_CLIENT_REQUEST_");
//out.write("Client request: " + clientRequest + "<BR>");
String hostName = "";
if (clientRequest!=null && clientRequest.indexOf("//") > 0) {
int startPos = clientRequest.indexOf("//") + 2;
int endPos = clientRequest.indexOf(":", startPos);
if ( endPos < startPos )
endPos = clientRequest.indexOf("/", startPos);
if ( endPos < startPos )
hostName = clientRequest.substring(startPos);
else
hostName = clientRequest.substring(startPos, endPos);
} else {
hostName = "";
}
//out.write("Host name: " + hostName + "<BR>");
out.write("\r\n\r\n");
out.write("<title>");
out.print(hostName);
out.write(" - Sales Force Automation - ");
out.print(companyName);
out.write("</title>\r\n\r\n");
out.write("\r\n");
out.write("<!-- [userStyle.jsp] Start -->\r\n\r\n");
//------------ Get the style sheet
String styleSheetId = null;
ModelEntity entityStyleUser = delegator.getModelEntity("UiUserTemplate");
HashMap hashMapStyleUser = new HashMap();
if ( userLogin != null ) {
String ulogin = userLogin.getString("userLoginId");
hashMapStyleUser.put("userLoginId", ulogin);
} else {
hashMapStyleUser.put("userLoginId", "Default");
}
GenericPK stylePk = new GenericPK(entityStyleUser, hashMapStyleUser);
GenericValue userTemplate = delegator.findByPrimaryKey(stylePk);
if ( userTemplate != null ) {
styleSheetId = userTemplate.getString("styleSheetId");
}
if (styleSheetId == null){
hashMapStyleUser.put("userLoginId", "Default");
stylePk = new GenericPK(entityStyleUser, hashMapStyleUser);
userTemplate = delegator.findByPrimaryKey(stylePk);
if ( userTemplate != null ) {
styleSheetId = userTemplate.getString("styleSheetId");
}
}
if (styleSheetId != null){
ModelEntity entityStyle = delegator.getModelEntity("UiStyleTemplate");
HashMap hashMapStyle = new HashMap();
hashMapStyle.put("styleSheetId", styleSheetId);
stylePk = new GenericPK(entityStyle, hashMapStyle);
GenericValue styleTemplate = delegator.findByPrimaryKey(stylePk);
userStyleSheet = styleTemplate.getString("styleSheetLoc");
if ( userStyleSheet == null ){
userStyleSheet = "/sfa/includes/maincss.css";
}
}
out.write("\r\n");
out.write("<link rel=\"stylesheet\" href=\"");
out.print(userStyleSheet);
out.write("\" type=\"text/css\">\r\n\r\n");
out.write("<!-- [userStyle.jsp] End -->\r\n\r\n");
out.write("\r\n");
out.write("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/sfa/css/gridstyles.css\">\r\n");
out.write("<script language=\"JavaScript\" >\r\n\r\n function sendDropDown(elementName, idName, fieldName, findClass, paramName, paramValue, frm, action)\r\n {\r\n var sUrl = '");
if (_jspx_meth_ofbiz_url_0(pageContext))
return;
out.write("?findMode=filter&fieldName=' +\r\n\t\t\tfieldName + '&idName=' + idName + '¶m_' + paramName + '=' + paramValue +\r\n\t\t\t'&formName=' + frm.name + '&elementName=' + elementName + '&findClass=' + findClass + '&action=' + action;\r\n document.anchors('searchA').href=sUrl;\r\n document.anchors('searchA').click();\r\n }\r\n\r\n\r\n function sendData(ele, frm, action){\r\n if(ele.tagName != 'SELECT'){\r\n if(ele.value.length > 0){\r\n entity = ele.getAttribute(\"entityName\");\r\n field = ele.getAttribute(\"fieldName\");\r\n idName = ele.getAttribute(\"idName\");\r\n findClass = ele.getAttribute(\"findClass\");\r\n findValue = ele.value;\r\n elementName = ele.name;\r\n var sUrl = '");
if (_jspx_meth_ofbiz_url_1(pageContext))
return;
out.write("?entityName=' + entity + '&fieldName=' +\r\n\t\t\tfield + '&idName=' + idName + '&findByLikeValue=' + findValue + '&formName=' + frm.name +\r\n\t\t\t'&elementName=' + elementName + '&findClass=' + findClass + '&action=' + action;\r\n document.anchors('searchA').href=sUrl;\r\n document.anchors('searchA').click();\r\n } else {\r\n //alert('Enter search criteria to find a value.');\r\n //frm.item(ele.name).value = 'Enter search criteria.';\r\n }\r\n }\r\n }\r\n\r\n function updateForm(){\r\n var innDoc = document.frames('searchIFrame').document;\r\n var innHtml = innDoc.body.innerHTML;\r\n if(innHtml.length > 0){\r\n var sDiv = innDoc.all('searchResultDiv');\r\n if(sDiv != null){\r\n var formName = sDiv.getAttribute(\"formName\");\r\n var fieldName = sDiv.getAttribute(\"fieldName\");\r\n var elementName = sDiv.getAttribute(\"elementName\");\r\n var findClass = sDiv.getAttribute(\"findClass\");\r\n var findMode = sDiv.getAttribute(\"findMode\");\r\n var showMultiple = sDiv.getAttribute(\"showMultiple\");\r\n");
out.write(" var nde = innDoc.all(elementName);\r\n var existingNode = document.all(elementName);\r\n if(nde != null){\r\n var frm = document.forms(formName);\r\n if(nde.tagName == 'SELECT'){\r\n var opts = nde.children.tags('OPTION');\r\n if ( findMode == 'filter')\r\n {\r\n\t\t\t\tvar oldOpts = existingNode.children.tags('OPTION');\r\n//\t\t\t\talert('oldOpts.length = ' + oldOpts.length);\r\n//\t\t\t\talert('opts.length = ' + opts.length);\r\n\t\t\t\tvar numOpt = existingNode.options.length;\r\n//\t\t\t\talert('numOpt = ' + numOpt);\r\n\t\t\t\tfor (var i=0; i");
out.write("<numOpt;i++)\r\n\t\t\t\t\texistingNode.options.remove(numOpt - 1 - i);\r\n\t\t\t\tfor (var i=0; i");
out.write("<opts.length;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar opt = document.createElement(\"option\");\r\n\t\t\t\t\topt.setAttribute(\"value\", opts(i).value);\r\n\t\t\t\t\topt.innerText = opts(i).innerText;\r\n\t\t\t\t\texistingNode.appendChild(opt);\r\n\t\t\t\t}\r\n }\r\n else if(opts.length");
out.write("<=0){\r\n //alert('No results were found. Please try another search.');\r\n existingNode.focus();\r\n } else {\r\n var ele = document.createElement(nde.tagName);\r\n ele.id = nde.name;\r\n ele.name = nde.name;\r\n ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n\t\t\t ele.setAttribute(\"entityName\", sDiv.getAttribute(\"entityName\"));\r\n ele.setAttribute(\"fieldName\", sDiv.getAttribute(\"fieldName\"));\r\n ele.setAttribute(\"elementName\", sDiv.getAttribute(\"elementName\"));\r\n ele.setAttribute(\"idName\", sDiv.getAttribute(\"idName\"));\r\n ele.setAttribute(\"findClass\", sDiv.getAttribute(\"findClass\"));\r\n if (showMultiple == \"true\") ele.multiple = true;\r\n ele.tabIndex = existingNode.tabIndex;\r\n ele.attachEvent(\"onchange\", searchAgain);\r\n for(var i=0;i");
out.write("<opts.length;i++){\r\n var opt = document.createElement(\"option\");\r\n opt.setAttribute(\"value\", opts(i).value);\r\n opt.innerText = opts(i).innerText;\r\n ele.appendChild(opt);\r\n }\r\n var opt = document.createElement(\"option\");\r\n opt.setAttribute(\"value\", \"search again\");\r\n opt.innerText = \"Search again...\";\r\n ele.appendChild(opt);\r\n var sRepNde = elementName + 'Holder';\r\n var repNde = document.all(sRepNde);\r\n repNde.replaceChild(ele, existingNode);\r\n ele.focus();\r\n\t ele.fireEvent(\"onchange\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function searchAgain(sel, frm){\r\n if(sel.tagName == 'SELECT'){\r\n var fieldName = sel.getAttribute('fieldName');\r\n var findClass = sel.getAttribute('findClass');\r\n var elementName = sel.name;\r\n var formName = frm.name;\r\n var existingNode = document.all(elementName);\r\n");
out.write(" if(sel.value == 'search again'){\r\n var ele = document.createElement(\"INPUT\");\r\n ele.id = sel.name;\r\n ele.name = sel.name;\r\n ele.type = \"TEXT\";\r\n ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n ele.setAttribute(\"entityName\", sel.getAttribute(\"entityName\"));\r\n ele.setAttribute(\"fieldName\", fieldName);\r\n ele.setAttribute(\"elementName\", elementName);\r\n ele.setAttribute(\"idName\", sel.getAttribute(\"idName\"));\r\n ele.setAttribute(\"findClass\", findClass);\r\n ele.tabIndex = sel.tabIndex;\r\n var sRepNde = elementName + 'Holder';\r\n var repNde = document.all(sRepNde);\r\n repNde.replaceChild(ele, existingNode);\r\n ele.focus();\r\n }\r\n }\r\n }\r\n\r\n // currently only used by accountPopup to force activity_accountId to be a select field\r\n function forceSearchAgain(sel, frm){\r\n if(sel.tagName == 'SELECT'){\r\n var fieldName = sel.getAttribute('fieldName');\r\n var findClass = sel.getAttribute('findClass');\r\n");
out.write(" var elementName = sel.name;\r\n var formName = frm.name;\r\n var existingNode = document.all(elementName);\r\n\t var ele = document.createElement(\"INPUT\");\r\n\t ele.id = sel.name;\r\n\t ele.name = sel.name;\r\n\t ele.type = \"TEXT\";\r\n\t ele.setAttribute(\"className\", existingNode.getAttribute(\"className\"));\r\n\t ele.setAttribute(\"entityName\", sel.getAttribute(\"entityName\"));\r\n\t ele.setAttribute(\"fieldName\", fieldName);\r\n\t ele.setAttribute(\"elementName\", elementName);\r\n\t ele.setAttribute(\"idName\", sel.getAttribute(\"idName\"));\r\n\t ele.setAttribute(\"findClass\", findClass);\r\n\t ele.tabIndex = sel.tabIndex;\r\n\t var sRepNde = elementName + 'Holder';\r\n\t var repNde = document.all(sRepNde);\r\n\t repNde.replaceChild(ele, existingNode);\r\n }\r\n }\r\n\r\nvar currentCol = 0;\r\nvar previousCol = -1;\r\nvar reverse = false;\r\n\r\n function CompareAlpha(a, b) {\r\n if (a[currentCol] ");
out.write("< b[currentCol]) { return -1; }\r\n if (a[currentCol] > b[currentCol]) { return 1; }\r\n return 0;\r\n }\r\n\r\n function CompareAlphaIgnore(a, b) {\r\n strA = a[currentCol].toLowerCase();\r\n strB = b[currentCol].toLowerCase();\r\n if (strA ");
out.write("< strB) { return -1;\r\n } else {\r\n if (strA > strB) { return 1;\r\n } else { return 0;\r\n }\r\n }\r\n }\r\n\r\n function CompareDate(a, b) {\r\n datA = new Date(a[currentCol]);\r\n datB = new Date(b[currentCol]);\r\n if (datA ");
out.write("< datB) { return -1;\r\n } else {\r\n if (datA > datB) { return 1;\r\n } else { return 0;\r\n }\r\n }\r\n }\r\n\r\n function CompareDateEuro(a, b) {\r\n strA = a[currentCol].split(\".\");\r\n strB = b[currentCol].split(\".\");\r\n datA = new Date(strA[2], strA[1], strA[0]);\r\n datB = new Date(strB[2], strB[1], strB[0]);\r\n if (datA ");
out.write("< datB) { return -1;\r\n } else {\r\n if (datA > datB) { return 1;\r\n } else { return 0;\r\n }\r\n }\r\n }\r\n\r\n function CompareNumeric(a, b) {\r\n numA = a[currentCol];\r\n numB = b[currentCol];\r\n if (isNaN(numA)) { return 0;\r\n } else {\r\n if (isNaN(numB)) { return 0;\r\n } else { return numA - numB;\r\n }\r\n }\r\n }\r\n\r\nfunction TableSort(myTable, myCol, myType) {\r\n\r\n var mySource = document.all(myTable);\r\n var myRows = mySource.rows.length;\r\n var myCols = mySource.rows(0).cells.length;\r\n currentCol = myCol\r\n\r\n var theadrow = mySource.parentElement.tHead;\r\n var imgcol= theadrow.all('srtImg');\r\n for(var x = 0; x ");
out.write("< imgcol.length; x++){\r\n imgcol[x].src = \"dude07232001blank.gif\";\r\n imgcol[x].alt = \"sort\";\r\n }\r\n\r\n if(previousCol == myCol){\r\n if(reverse == false){\r\n imgcol[myCol-1].src = \"dude07232001down.gif\";\r\n reverse = true;\r\n } else {\r\n imgcol[myCol-1].src = \"dude07232001up.gif\";\r\n reverse = false;\r\n }\r\n } else {\r\n reverse = false;\r\n imgcol[myCol-1].src = \"dude07232001up.gif\";\r\n }\r\n\r\n myArray = new Array(myRows)\r\n for (i=0; i ");
out.write("< myRows; i++) {\r\n myArray[i] = new Array(myCols)\r\n for (j=0; j ");
out.write("< myCols; j++) {\r\n myArray[i][j] = document.all(myTable).rows(i).cells(j).innerHTML;\r\n }\r\n }\r\n\r\n if (myCol == previousCol) {\r\n myArray.reverse();\r\n } else {\r\n switch (myType) {\r\n case \"a\":\r\n myArray.sort(CompareAlpha);\r\n break;\r\n case \"ai\":\r\n myArray.sort(CompareAlphaIgnore);\r\n break;\r\n case \"d\":\r\n myArray.sort(CompareDate);\r\n break;\r\n case \"de\":\r\n myArray.sort(CompareDateEuro);\r\n break;\r\n case \"n\":\r\n myArray.sort(CompareNumeric);\r\n break;\r\n default:\r\n myArray.sort();\r\n }\r\n }\r\n\r\n\r\n // Re-write the table contents\r\n for (i=0; i ");
out.write("< myRows; i++) {\r\n for (j=0; j ");
out.write("< myCols; j++) {\r\n mySource.rows(i).cells(j).innerHTML = myArray[i][j];\r\n }\r\n }\r\n\r\n previousCol = myCol;\r\n highlightSelectedRow();\r\n return 0;\r\n\r\n}\r\n\r\n function fixSize() {\r\n // The body represents the outer-most frameset for frameset documents.\r\n if ( parent.name == \"content\" )\r\n {\r\n\t maxH = parent.document.body.clientHeight - 150;\r\n\t topH = document.body.scrollHeight + 10;\r\n\t if ( topH > maxH )\r\n\t \ttopH = maxH;\r\n\t \t\r\n\t parent.document.body.rows = topH + \", *\"\r\n\t //window.frames.headerFrame.document.body.rows = window.frames.headerFrame.document.body.scrollHeight + \", *\" \r\n\t // Walk into the header frame and get the scrollHeight - \r\n\t // this represents the height of the contents in pixels. \r\n\t }\r\n }\r\n");
out.write("</script>\r\n\r\n\r\n");
out.write("\r\n\r\n");
out.write("</HEAD>\r\n\r\n");
out.write("<BASE TARGET=\"content\">\r\n");
out.write("<!--");
out.write("<BODY CLASS=\"bodyform\" onbeforeunload=\"verifyClose()\">-->\r\n");
out.write("<BODY CLASS=\"bodyform\"\">\r\n\r\n");
out.write("\r\n");
out.write("<!-- onBeforeUnload.jsp - Start -->\r\n\r\n");
out.write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\" FOR=window EVENT=onbeforeunload>\r\n return doOnBeforeUnload();\r\n");
out.write("</SCRIPT>\r\n\r\n");
out.write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\">\r\n\r\n // Create variable we can change to prevent the check from being done.\r\n var checkForChanges = true;\r\n \r\n function doOnBeforeUnload() {\r\n // This script fires when anything is about to cause the current page to be unloaded.\r\n // If any unsaved changes have been made, this script returns a non-empty string, which\r\n // causes a response window to warn the user that changes will be lost, and to allow\r\n // them to cancel.\r\n \r\n // In free form, tabular, and select screen sections built by the UI builder,\r\n // the preSubmit method fired by the onSubmit event of the form removes this script from\r\n // the onBeforeUnload event, which prevents this check from happening if the Save button\r\n // was just clicked.\r\n \r\n // alert(\"event.fromElement: \" + event.fromElement);\r\n \r\n // See if the checkForChanges flag has been cleared. If so, just allow the\r\n // body unload to continue.\r\n if (!checkForChanges) return;\r\n \r\n // Look at all forms on the page to see if any of them have any changes.\r\n");
out.write(" var vFormC = document.forms;\r\n for (var vFormNbr = 0; vFormNbr ");
out.write("< vFormC.length; vFormNbr++) {\r\n //alert(\"[verifyClose] Window name: \" + window.name);\r\n //alert(\"[verifyClose] Checking form #\" + vFormNbr);\r\n var vFormObj = vFormC.item(vFormNbr);\r\n //alert(\"[verifyClose] Form name is \" + vFormObj.name);\r\n \r\n // Check the action. If it's query or view mode, don't bother checking this form.\r\n var vActionObj = vFormObj.elements.item(\"action\");\r\n if (vActionObj != null) {\r\n var vAction = vActionObj.value;\r\n if (vAction!=null) {\r\n //alert(\"Action: \" + vAction);\r\n if (vAction==\"");
out.print(UIScreenSection.ACTION_INSERT);
out.write("\" ||\r\n vAction==\"");
out.print(UIScreenSection.ACTION_UPDATE);
out.write("\" ||\r\n vAction==\"");
out.print(UIScreenSection.ACTION_UPDATE_SELECT);
out.write("\") {\r\n \r\n // This is an updateable form in an updateable mode. Check for changes.\r\n \r\n // Look through all the objects in the form to see if there are any unsaved changes.\r\n var vElemC = vFormObj.elements;\r\n for (var vElemNbr = 0; vElemNbr ");
out.write("< vElemC.length; vElemNbr++) {\r\n var vElemObj = vElemC.item(vElemNbr);\r\n \r\n // Find out if this is the \"add\" or \"delete\" select object that appears on a \"select\" type screen section.\r\n //alert(\"[window.onbeforeunload] Object name: \" + vElemObj.name);\r\n if (vElemObj.name.indexOf(\"DBSel\")>=0) {\r\n // This is the add or delete select object. See if there are any items in it. If so, it means\r\n // the user has made changes.\r\n if (vElemObj.length > 0) {\r\n // Changes have been made. Trigger the response window.\r\n return \"IF YOU CLICK OK, YOUR CHANGES WILL BE LOST.\";\r\n } else {\r\n // No changes in this add or delete select object.\r\n }\r\n } else {\r\n // Object is not the add or delete select object.\");\r\n // See if this element is an original value field.\r\n var vOrigPrefix = \"");
out.print(UIWebUtility.HTML_NAME_PREFIX_ORIGINAL);
out.write("\";\r\n if (vElemObj.name.indexOf(vOrigPrefix)==0) {\r\n // This is an original value field. Compare its value to the current value field.\r\n var vOrigElemObj = vElemObj;\r\n var vOrigElemName = vOrigElemObj.name;\r\n var vCurElemName = vOrigElemName.substring(vOrigPrefix.length, vOrigElemName.length);\r\n var vCurElemObj = vElemC.item(vCurElemName);\r\n var vCurElemTagName = vCurElemObj.tagName;\r\n var vCurElemType = vCurElemObj.type;\r\n if (vCurElemObj!=null) {\r\n // Got the current field. Compare the values.\r\n var vCurValue;\r\n if (vCurElemTagName==\"INPUT\" && vCurElemType==\"checkbox\") {\r\n // This is a check box. Use special processing to get current value.\r\n vCurValue = vCurElemObj.checked ? \"Y\" : \"N\";\r\n } else {\r\n // Not a check box.\r\n vCurValue = vCurElemObj.value;\r\n }\r\n var vOrigValue = vOrigElemObj.value;\r\n if (vCurValue != vOrigValue) {\r\n // This field was changed. Trigger the response window.\r\n");
out.write(" // alert('Field ' + vCurElemName + ' changed.');\r\n // alert('Original Value: ' + vOrigValue);\r\n // alert('Current Value: ' + vCurValue);\r\n return \"IF YOU CLICK OK, YOUR CHANGES WILL BE LOST.\";\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n");
out.write("</SCRIPT>\r\n\r\n");
out.write("<!-- onBeforeUnload.jsp - End -->\r\n\r\n\r\n");
out.write("\r\n\r\n");
out.write("<script>\r\n// Title: Timestamp picker\r\n// Description: See the demo at url\r\n// URL: http://us.geocities.com/tspicker/\r\n// Script featured on: http://javascriptkit.com/script/script2/timestamp.shtml\r\n// Version: 1.0\r\n// Date: 12-05-2001 (mm-dd-yyyy)\r\n// Author: Denis Gritcyuk ");
out.write("<denis@softcomplex.com>; ");
out.write("<tspicker@yahoo.com>\r\n// Notes: Permission given to use this script in any kind of applications if\r\n// header lines are left unchanged. Feel free to contact the author\r\n// for feature requests and/or donations\r\n\r\nfunction setCalendarHasFocus(aFormObj, aHasFocus) {\r\n\t// Set hidden variable to show that a popup calendar is about to\r\n\t// be displayed. This variable will be tested in the onBeforeUnload\r\n\t// handling to avoid popping up a confimation prompt.\r\n\talert(\"setCalendarHasFocus start - \" + aHasFocus);\r\n\tvar vCalendarHasFocusObj = aFormObj.elements.item(\"calendarHasFocus\");\r\n\tif (vCalendarHasFocusObj == null) {\r\n\t\t//alert(\"Did not find calendarHasFocus hidden field\");\r\n\t} else {\r\n\t\t//alert(\"Found calendarHasFocus hidden field\");\r\n\t\tif (aHasFocus) {\r\n\t\t\t//alert(\"Setting calendarHasFocus to true\");\r\n\t\t\tvCalendarHasFocusObj.value = \"true\";\r\n\t\t} else {\r\n\t\t\t//alert(\"Setting calendarHasFocus to false\");\r\n\t\t\tvCalendarHasFocusObj.value = \"false\";\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction show_calendar(str_target, str_datetime, isDateTime) {\r\n");
out.write("//\talert(\"show_calendar start\");\r\n\tvar arr_months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\r\n\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n\tvar week_days = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\r\n\tvar n_weekstart = 1; // day week starts from (normally 0 or 1)\r\n\r\n\tvar dt_datetime = (str_datetime == null || str_datetime ==\"\" ? new Date() : str2datetime(str_datetime) );\r\n\tvar dt_prev_month = new Date(dt_datetime);\r\n\tdt_prev_month.setMonth(dt_datetime.getMonth()-1);\r\n\tvar dt_next_month = new Date(dt_datetime);\r\n\tdt_next_month.setMonth(dt_datetime.getMonth()+1);\r\n\tvar dt_firstday = new Date(dt_datetime);\r\n\tdt_firstday.setDate(1);\r\n\tdt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);\r\n\tvar dt_lastday = new Date(dt_next_month);\r\n\tdt_lastday.setDate(0);\r\n\t\r\n\t// html generation (feel free to tune it for your particular application)\r\n\t// print calendar header\r\n\tvar str_buffer = new String (\r\n\t\t\"");
out.write("<html>\\n\"+\r\n\t\t\" ");
out.write("<head>\\n\"+\r\n\t\t\" ");
out.write("<title>Calendar");
out.write("</title>\\n\"+\r\n\t\t\" ");
out.write("</head>\\n\"+\r\n\t\t\" ");
out.write("<body bgcolor=\\\"White\\\">\\n\"+\r\n\t\t\" ");
out.write("<table class=\\\"clsOTable\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
out.write("<tr>\\n\" +\r\n\t\t\" ");
out.write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
out.write("<table cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
out.write("<tr>\\n\" +\r\n\t\t\" ");
out.write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
out.write("<a href=\\\"javascript:window.opener.show_calendar('\"+\r\n\t\t str_target + \"', '\" + dt2dtstr(dt_prev_month)+\"'+' ' +document.cal.time.value);\\\">\" +\r\n\t\t\" ");
out.write("<img src=\\\"/sfaimages/prev.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"previous month\\\">\\n\" +\r\n\t\t\" ");
out.write("</a>\\n\" +\r\n\t\t\" ");
out.write("</td>\\n\" +\r\n\t\t\" ");
out.write("<td bgcolor=\\\"#4682B4\\\" colspan=\\\"5\\\">\\n\" +\r\n\t\t\" ");
out.write("<font color=\\\"white\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\" \" + arr_months[dt_datetime.getMonth()] + \" \" + dt_datetime.getFullYear() + \"\\n\" +\r\n\t\t\" ");
out.write("</font>\\n\" +\r\n\t\t\" ");
out.write("</td>\\n\" +\r\n\t\t\" ");
out.write("<td bgcolor=\\\"#4682B4\\\" align=\\\"right\\\">\\n\" +\r\n\t\t\" ");
out.write("<a href=\\\"javascript:window.opener.show_calendar('\" +\r\n\t\t str_target+\"', '\"+dt2dtstr(dt_next_month)+\"'+' ' +document.cal.time.value);\\\">\\n\" +\r\n\t\t\" ");
out.write("<img src=\\\"/sfaimages/next.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"next month\\\">\\n\" +\r\n\t\t\" ");
out.write("</a>\\n\" +\r\n\t\t\" ");
out.write("</td>\\n\" +\r\n\t\t\" ");
out.write("</tr>\\n\"\r\n\t);\r\n\r\n\tvar dt_current_day = new Date(dt_firstday);\r\n\t// print weekdays titles\r\n\tstr_buffer += \" ");
out.write("<tr>\\n\";\r\n\tfor (var n=0; n");
out.write("<7; n++)\r\n\t\tstr_buffer += \" ");
out.write("<td bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
out.write("<font color=\\\"white\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\" \" + week_days[(n_weekstart+n)%7] + \"\\n\" +\r\n\t\t\" ");
out.write("</font>");
out.write("</td>\\n\";\r\n\t// print calendar table\r\n\tstr_buffer += \" ");
out.write("</tr>\\n\";\r\n\twhile (dt_current_day.getMonth() == dt_datetime.getMonth() ||\r\n\t\tdt_current_day.getMonth() == dt_firstday.getMonth()) {\r\n\t\t// print row heder\r\n\t\tstr_buffer += \" ");
out.write("<tr>\\n\";\r\n\t\tfor (var n_current_wday=0; n_current_wday");
out.write("<7; n_current_wday++) {\r\n\t\t\t\tif (dt_current_day.getDate() == dt_datetime.getDate() &&\r\n\t\t\t\t\tdt_current_day.getMonth() == dt_datetime.getMonth())\r\n\t\t\t\t\t// print current date\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<td bgcolor=\\\"#FFB6C1\\\" align=\\\"right\\\">\\n\";\r\n\t\t\t\telse if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)\r\n\t\t\t\t\t// weekend days\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<td bgcolor=\\\"#DBEAF5\\\" align=\\\"right\\\">\\n\";\r\n\t\t\t\telse\r\n\t\t\t\t\t// print working days of current month\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<td bgcolor=\\\"white\\\" align=\\\"right\\\">\\n\";\r\n\r\n\t\t\t\tif (isDateTime == \"1\" )\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<a href=\\\"javascript:window.opener.\" + str_target +\r\n\t\t\t\t\t\t\".value='\"+dt2dtstr(dt_current_day)+\"'+' ' +document.cal.time.value;window.close();\\\">\\n\";\r\n\t\t\t\telse\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<a href=\\\"javascript:window.opener.\" + str_target +\r\n\t\t\t\t\t\t\".value='\"+dt2dtstr(dt_current_day)+\"';window.close();\\\">\\n\";\r\n\t\t\t\t\t\r\n\t\t\t\tif (dt_current_day.getMonth() == dt_datetime.getMonth())\r\n\t\t\t\t\t// print days of current month\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<font color=\\\"black\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\";\r\n\t\t\t\telse \r\n\t\t\t\t\t// print days of other months\r\n\t\t\t\t\tstr_buffer += \" ");
out.write("<font color=\\\"gray\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\";\r\n\t\t\t\t\t\r\n\t\t\t\tstr_buffer += \" \" + dt_current_day.getDate() + \"\\n\" +\r\n\t\t\t\t\" ");
out.write("</font>\\n\" +\r\n\t\t\t\t\" ");
out.write("</a>\\n\" +\r\n\t\t\t\t\" ");
out.write("</td>\\n\";\r\n\t\t\t\tdt_current_day.setDate(dt_current_day.getDate()+1);\r\n\t\t}\r\n\t\t// print row footer\r\n\t\tstr_buffer += \" ");
out.write("</tr>\\n\";\r\n\t}\r\n\t// print calendar footer\r\n\tstr_buffer +=\r\n\t\t\" ");
out.write("<form name=\\\"cal\\\">\\n\" +\r\n\t\t\" ");
out.write("<tr>\\n\" +\r\n\t\t\" ");
out.write("<td colspan=\\\"7\\\" bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
out.write("<font color=\\\"White\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\" Time:\\n\" +\r\n\t\t\" ");
out.write("<input type=\\\"text\\\" name=\\\"time\\\" value=\\\"\" + dt2tmstr(dt_datetime) +\r\n\t\t\"\\\" size=\\\"8\\\" maxlength=\\\"8\\\">\\n\" +\r\n\t\t\" ");
out.write("</font>\\n\" +\r\n\t\t\" ");
out.write("</td>\\n\" +\r\n\t\t\" ");
out.write("</tr>\\n\" +\r\n\t\t\" ");
out.write("</form>\\n\" +\r\n\t\t\" ");
out.write("</table>\\n\" +\r\n\t\t\" ");
out.write("</tr>\\n\" +\r\n\t\t\" ");
out.write("</td>\\n\" +\r\n\t\t\" ");
out.write("</table>\\n\" +\r\n\t\t\" ");
out.write("</body>\\n\" +\r\n\t\t\"");
out.write("</html>\\n\";\r\n\r\n\t//alert(\"Fixin to open window\");\r\n\tvar vWinCal = window.open(\"\", \"Calendar\", \r\n\t\t\"width=200,height=250,status=no,resizable=yes,top=200,left=200\");\r\n\t//alert(\"Fixin to set window opener to self\");\r\n\tvWinCal.opener = self;\r\n\tvar calc_doc = vWinCal.document;\r\n\t//alert(\"Fixin to write str_buffer\");\r\n\tcalc_doc.write (str_buffer);\r\n\tcalc_doc.close();\r\n}\r\n// datetime parsing and formatting routimes. modify them if you wish other datetime format\r\nfunction str2datetime (str_datetime) {\r\n\tvar re_date = /^(\\d+)\\/(\\d+)\\/(\\d+)\\s+(\\d+)\\:(\\d+)\\:(\\d+)$/;\r\n\tif (!re_date.exec(str_datetime))\r\n\t\treturn str2date(str_datetime)\r\n\treturn (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2, RegExp.$4, RegExp.$5, RegExp.$6));\r\n}\r\nfunction str2date (str_date) {\r\n\tvar re_date = /^(\\d+)\\/(\\d+)\\/(\\d+)$/;\r\n\tif (!re_date.exec(str_date))\r\n\t\treturn alert(\"Invalid Date format: \"+ str_date);\r\n\treturn (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2, 0, 0, 0));\r\n}\r\n\r\nfunction dt2dtstr (dt_datetime) {\r\n\treturn (new String (\r\n\t\t\t(dt_datetime.getMonth()+1)+\"/\"+dt_datetime.getDate()+\"/\"+dt_datetime.getFullYear()));\r\n");
out.write("}\r\nfunction dt2tmstr (dt_datetime) {\r\n\treturn (new String (\r\n\t\t\tdt_datetime.getHours()+\":\"+dt_datetime.getMinutes()+\":\"+dt_datetime.getSeconds()));\r\n}\r\n\r\n");
out.write("</script>\r\n");
out.write("\r\n\r\n");
out.write("\r\n");
// Define the roles.
String ROLE_SFA_ADMIN = "SFA_ADMIN";
String ROLE_SFA_USER = "SFA_USER";
String ROLE_SFA_LEADS_ADMIN = "SFA_LEADS_ADMIN";
String ROLE_SFA_LEADS_USER = "SFA_LEADS_USER";
// Define menu items on Sales menu.
Integer MENU_DASHBOARD = new Integer(100);
Integer MENU_LEADS = new Integer(101);
Integer MENU_ACCOUNTS = new Integer(102);
Integer MENU_CONTACTS = new Integer(103);
Integer MENU_OPPORTUNITIES = new Integer(104);
Integer MENU_ACTIVITIES = new Integer(105);
Integer MENU_TIME_MANAGEMENT = new Integer(106);
Integer MENU_FORECASTS = new Integer(107);
Integer MENU_PRODUCTS = new Integer(108);
Integer MENU_TERRITORIES = new Integer(109);
Integer MENU_XFER = new Integer(110);
// Define menu items on Services menu.
Integer MENU_ISSUE_TRACKING = new Integer(200);
Integer MENU_CURRENT_ISSUES = new Integer(201);
Integer MENU_ISSUE_CHARTS = new Integer(202);
// Define menu items on Reports menu.
Integer MENU_ACCOUNT_LIST_RPT = new Integer(300);
Integer MENU_CONTACT_LIST_RPT = new Integer(301);
Integer MENU_PIPELINE_RPT = new Integer(302);
Integer MENU_PIPELINE_CHART = new Integer(303);
Integer MENU_WIN_LOSS_RPT = new Integer(304);
Integer MENU_ACTIVITIES_RPT = new Integer(305);
Integer MENU_OPPORTUNITY_OVERVIEW_RPT = new Integer(306);
Integer MENU_REPORT_BUILDER_RPT = new Integer(307);
// Define menu items on Admin menu.
Integer MENU_MY_COMPANY = new Integer(400);
Integer MENU_APPLICATIONS = new Integer(401);
Integer MENU_SCREENS = new Integer(402);
Integer MENU_ENTITIES = new Integer(403);
Integer MENU_CODES = new Integer(404);
Integer MENU_DISPLAY_TYPES = new Integer(405);
Integer MENU_PREFERENCES = new Integer(406);
Integer MENU_LEAD_QUEUES = new Integer(407);
Integer MENU_LEAD_RULES = new Integer(408);
Integer MENU_STEPS_TO_CLOSE = new Integer(409);
Integer MENU_REPLICATION = new Integer(410);
Integer MENU_SQL_QUERY = new Integer(411);
Integer MENU_USER_TRANSFER = new Integer(412);
// Define privileges for SFA Admin role.
ArrayList menuPrivsSfaAdmin = new ArrayList();
menuPrivsSfaAdmin.add( MENU_DASHBOARD );
menuPrivsSfaAdmin.add( MENU_LEADS );
menuPrivsSfaAdmin.add( MENU_ACCOUNTS );
menuPrivsSfaAdmin.add( MENU_CONTACTS );
menuPrivsSfaAdmin.add( MENU_OPPORTUNITIES );
menuPrivsSfaAdmin.add( MENU_ACTIVITIES );
menuPrivsSfaAdmin.add( MENU_TIME_MANAGEMENT );
menuPrivsSfaAdmin.add( MENU_FORECASTS );
menuPrivsSfaAdmin.add( MENU_PRODUCTS );
menuPrivsSfaAdmin.add( MENU_TERRITORIES );
menuPrivsSfaAdmin.add( MENU_XFER );
menuPrivsSfaAdmin.add( MENU_ISSUE_TRACKING );
menuPrivsSfaAdmin.add( MENU_CURRENT_ISSUES );
menuPrivsSfaAdmin.add( MENU_ISSUE_CHARTS );
menuPrivsSfaAdmin.add( MENU_ACCOUNT_LIST_RPT );
menuPrivsSfaAdmin.add( MENU_CONTACT_LIST_RPT );
menuPrivsSfaAdmin.add( MENU_PIPELINE_RPT );
menuPrivsSfaAdmin.add( MENU_PIPELINE_CHART );
menuPrivsSfaAdmin.add( MENU_WIN_LOSS_RPT );
menuPrivsSfaAdmin.add( MENU_ACTIVITIES_RPT );
menuPrivsSfaAdmin.add( MENU_OPPORTUNITY_OVERVIEW_RPT );
menuPrivsSfaAdmin.add( MENU_REPORT_BUILDER_RPT );
menuPrivsSfaAdmin.add( MENU_MY_COMPANY );
menuPrivsSfaAdmin.add( MENU_APPLICATIONS );
menuPrivsSfaAdmin.add( MENU_SCREENS );
menuPrivsSfaAdmin.add( MENU_ENTITIES );
menuPrivsSfaAdmin.add( MENU_CODES );
menuPrivsSfaAdmin.add( MENU_DISPLAY_TYPES );
menuPrivsSfaAdmin.add( MENU_PREFERENCES );
menuPrivsSfaAdmin.add( MENU_LEAD_QUEUES );
menuPrivsSfaAdmin.add( MENU_LEAD_RULES );
menuPrivsSfaAdmin.add( MENU_STEPS_TO_CLOSE );
menuPrivsSfaAdmin.add( MENU_REPLICATION );
menuPrivsSfaAdmin.add( MENU_SQL_QUERY );
menuPrivsSfaAdmin.add( MENU_USER_TRANSFER );
// Define privileges for SFA User role.
ArrayList menuPrivsSfaUser = new ArrayList();
menuPrivsSfaUser.add( MENU_DASHBOARD );
menuPrivsSfaUser.add( MENU_LEADS );
menuPrivsSfaUser.add( MENU_ACCOUNTS );
menuPrivsSfaUser.add( MENU_CONTACTS );
menuPrivsSfaUser.add( MENU_OPPORTUNITIES );
menuPrivsSfaUser.add( MENU_ACTIVITIES );
menuPrivsSfaUser.add( MENU_TIME_MANAGEMENT );
menuPrivsSfaUser.add( MENU_FORECASTS );
menuPrivsSfaUser.add( MENU_PRODUCTS );
menuPrivsSfaUser.add( MENU_XFER );
menuPrivsSfaUser.add( MENU_ISSUE_TRACKING );
menuPrivsSfaUser.add( MENU_CURRENT_ISSUES );
menuPrivsSfaUser.add( MENU_ISSUE_CHARTS );
menuPrivsSfaUser.add( MENU_ACCOUNT_LIST_RPT );
menuPrivsSfaUser.add( MENU_CONTACT_LIST_RPT );
menuPrivsSfaUser.add( MENU_PIPELINE_RPT );
menuPrivsSfaUser.add( MENU_PIPELINE_CHART );
menuPrivsSfaUser.add( MENU_WIN_LOSS_RPT );
menuPrivsSfaUser.add( MENU_ACTIVITIES_RPT );
menuPrivsSfaUser.add( MENU_OPPORTUNITY_OVERVIEW_RPT );
menuPrivsSfaUser.add( MENU_REPORT_BUILDER_RPT );
menuPrivsSfaUser.add( MENU_REPLICATION );
menuPrivsSfaUser.add( MENU_XFER );
// Define privileges for SFA Leads Admin role.
ArrayList menuPrivsSfaLeadsAdmin = new ArrayList();
menuPrivsSfaLeadsAdmin.add( MENU_DASHBOARD );
menuPrivsSfaLeadsAdmin.add( MENU_LEADS );
menuPrivsSfaLeadsAdmin.add( MENU_ACCOUNTS );
menuPrivsSfaLeadsAdmin.add( MENU_CONTACTS );
menuPrivsSfaLeadsAdmin.add( MENU_ACTIVITIES );
menuPrivsSfaLeadsAdmin.add( MENU_TIME_MANAGEMENT );
menuPrivsSfaLeadsAdmin.add( MENU_TERRITORIES );
menuPrivsSfaLeadsAdmin.add( MENU_XFER );
menuPrivsSfaLeadsAdmin.add( MENU_ISSUE_TRACKING );
menuPrivsSfaLeadsAdmin.add( MENU_CURRENT_ISSUES );
menuPrivsSfaLeadsAdmin.add( MENU_ISSUE_CHARTS );
menuPrivsSfaLeadsAdmin.add( MENU_ACTIVITIES_RPT );
menuPrivsSfaLeadsAdmin.add( MENU_REPORT_BUILDER_RPT );
menuPrivsSfaLeadsAdmin.add( MENU_MY_COMPANY );
menuPrivsSfaLeadsAdmin.add( MENU_SCREENS );
menuPrivsSfaLeadsAdmin.add( MENU_CODES );
menuPrivsSfaLeadsAdmin.add( MENU_PREFERENCES );
menuPrivsSfaLeadsAdmin.add( MENU_LEAD_QUEUES );
menuPrivsSfaLeadsAdmin.add( MENU_LEAD_RULES );
menuPrivsSfaLeadsAdmin.add( MENU_XFER );
// Define privileges for SFA Leads User role.
ArrayList menuPrivsSfaLeadsUser = new ArrayList();
menuPrivsSfaLeadsUser.add( MENU_DASHBOARD );
menuPrivsSfaLeadsUser.add( MENU_LEADS );
menuPrivsSfaLeadsUser.add( MENU_ACTIVITIES );
menuPrivsSfaLeadsUser.add( MENU_TIME_MANAGEMENT );
menuPrivsSfaLeadsUser.add( MENU_ACTIVITIES_RPT );
menuPrivsSfaLeadsUser.add( MENU_REPORT_BUILDER_RPT );
menuPrivsSfaLeadsUser.add( MENU_XFER );
ArrayList menuPrivileges = new ArrayList();
String module = "getMenuPrivileges";
if (userInfo!=null && userInfo.getPartyId()!=null && !userInfo.getPartyId().equals("")) {
// User is logged in. Get the user's roles.
HashMap partyRoleFindMap = new HashMap();
partyRoleFindMap.put("partyId", userInfo.getPartyId());
try {
List partyRoleL = delegator.findByAnd("PartyRole", partyRoleFindMap);
Iterator partyRoleI = partyRoleL.iterator();
while (partyRoleI.hasNext()) {
GenericValue partyRoleGV = (GenericValue)partyRoleI.next();
String roleTypeId = partyRoleGV.getString("roleTypeId")==null ? "" : partyRoleGV.getString("roleTypeId");
if (roleTypeId.equals(ROLE_SFA_ADMIN)) {
menuPrivileges.addAll(menuPrivsSfaAdmin);
} else if (roleTypeId.equals(ROLE_SFA_USER)) {
menuPrivileges.addAll(menuPrivsSfaUser);
} else if (roleTypeId.equals(ROLE_SFA_LEADS_ADMIN)) {
menuPrivileges.addAll(menuPrivsSfaLeadsAdmin);
} else if (roleTypeId.equals(ROLE_SFA_LEADS_USER)) {
menuPrivileges.addAll(menuPrivsSfaLeadsUser);
}
}
} catch (Exception e) {
Debug.logError("Error retrieving user roles: " + e.getLocalizedMessage(), module);
out.write("Error retrieving user roles: " + e.getLocalizedMessage());
return;
}
}
out.write("\r\n");
out.write("\r\n\r\n");
out.write("<STYLE>\r\n div {\r\n position:absolute;\r\n }\r\n");
out.write("</STYLE>\r\n\r\n");
out.write("<SCRIPT>\r\n\r\n// ---------------------------------------------------------------------------\r\n// Example of howto: use OutlookBar\r\n// ---------------------------------------------------------------------------\r\n\r\n\r\n //create OutlookBar\r\n var o = new createOutlookBar('Bar',0,0,screenSize.width,screenSize.height,'#6699CC','white')//'#000099') // OutlookBar\r\n var p\r\n var mtarget = \"parent.mainwindow.content.location\"\r\n\r\n //create first panel\r\n p = new createPanel('l4','Sales');\r\n\r\n");
if (menuPrivileges.contains(MENU_DASHBOARD)) {
out.write("\r\n p.addButton('/sfaimages/screens.gif','Dashboard', mtarget+'=\"/sfa/control/frontpage\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_LEADS)) {
out.write("\r\n p.addButton('/sfaimages/leads.gif','Leads', mtarget+'=\"/sfa/control/leadHome?action=");
out.print(UIScreenSection.ACTION_QUERY);
out.write("&savedQueryName=");
out.print(UIQuery.LAST_QUERY_NAME_URL_ENCODED);
out.write("\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_ACCOUNTS)) {
out.write("\r\n p.addButton('/sfaimages/accounts.gif','Accounts', mtarget+'=\"/sfa/control/accounts\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_CONTACTS)) {
out.write("\r\n p.addButton('/sfaimages/contacts.gif','Contacts', mtarget+'=\"/sfa/control/contacts\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_OPPORTUNITIES)) {
out.write("\r\n p.addButton('/sfaimages/opportunities.gif','Opportunities', mtarget+'=\"/sfa/control/deals\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_ACTIVITIES)) {
out.write("\r\n p.addButton('/sfaimages/activities.gif','Activities', mtarget+'=\"/sfa/control/activities\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_TIME_MANAGEMENT)) {
out.write("\r\n p.addButton('/sfaimages/clock.gif','Time Management', mtarget+'=\"/sfa/control/activityCalendar\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_FORECASTS)) {
out.write("\r\n p.addButton('/sfaimages/forecasts.gif','Forecasts', mtarget+'=\"/sfa/control/forecasts\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_PRODUCTS)) {
out.write("\r\n p.addButton('/sfaimages/products.gif','Products', mtarget+'=\"/sfa/control/productsAdmin\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_TERRITORIES)) {
out.write("\r\n p.addButton('/sfaimages/territories.gif','Territories', mtarget+'=\"/sfa/control/territory\"');\r\n");
}
out.write("\r\n\r\n ");
if (menuPrivileges.contains(MENU_REPORT_BUILDER_RPT)) {
out.write("\r\n p.addButton('/sfaimages/quotas.gif','Report Builder', mtarget+'=\"/sfa/reports/uiReport.jsp?action=start\"');\r\n");
}
out.write("\r\n\r\n\r\n");
if (menuPrivileges.contains(MENU_XFER)) {
out.write("\r\n p.addButton('/sfaimages/Refresh24.gif','Import/Export', mtarget+'=\"/sfa/control/xferHome\"');\r\n");
}
out.write("\r\n \r\n o.addPanel(p);\r\n\r\n p = new createPanel('p','Services');\r\n");
if (menuPrivileges.contains(MENU_ISSUE_TRACKING)) {
out.write("\r\n p.addButton('/sfaimages/issues.gif','Issue Tracking', mtarget+'=\"/sfa/control/issues\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_CURRENT_ISSUES)) {
out.write("\r\n p.addButton('/sfaimages/issuelist.gif','Current Issues', mtarget+'=\"/sfa/control/issueListReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_ISSUE_CHARTS)) {
out.write("\r\n // p.addButton('/sfaimages/forecasts.gif','Issue Charts', mtarget+'=\"/sfa/control/issueChartFrame?chart=1\"');\r\n");
}
out.write("\r\n \r\n o.addPanel(p);\r\n\r\n p = new createPanel('l','Reports');\r\n");
if (menuPrivileges.contains(MENU_REPORT_BUILDER_RPT)) {
out.write("\r\n p.addButton('/sfaimages/quotas.gif','Report Builder', mtarget+'=\"/sfa/reports/uiReport.jsp?action=start\"');\r\n");
}
out.write("\r\n");
if (menuPrivileges.contains(MENU_ACCOUNT_LIST_RPT)) {
out.write("\r\n p.addButton('/sfaimages/accounts.gif','Account List', mtarget+'=\"/sfa/control/accountListReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_CONTACT_LIST_RPT)) {
out.write("\r\n p.addButton('/sfaimages/contacts.gif','Contact List', mtarget+'=\"/sfa/control/contactListReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_PIPELINE_RPT)) {
out.write("\r\n p.addButton('/sfaimages/quotas.gif','Pipeline Report', mtarget+'=\"/sfa/control/opportunityPipelineReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_PIPELINE_CHART)) {
out.write("\r\n //p.addButton('/sfaimages/forecasts.gif','Pipeline Chart', mtarget+'=\"/sfa/control/pipelineChart\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_WIN_LOSS_RPT)) {
out.write("\r\n //p.addButton('/sfaimages/winloss.gif','Win Loss', mtarget+'=\"/sfa/control/frontpage\"');\r\n");
}
out.write("\r\n \r\n");
if (menuPrivileges.contains(MENU_ACTIVITIES_RPT)) {
out.write("\r\n p.addButton('/sfaimages/clock.gif','Activities', mtarget+'=\"/sfa/control/activitiesReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_ACTIVITIES_RPT)) {
out.write("\r\n p.addButton('/sfaimages/leads.gif','Lead Report', mtarget+'=\"/sfa/control/leadReport?groupName=status\"');\r\n");
}
out.write(" \r\n \r\n");
if (menuPrivileges.contains(MENU_OPPORTUNITY_OVERVIEW_RPT)) {
out.write("\r\n p.addButton('/sfaimages/opportunities.gif','Opportunity Overview', mtarget+'=\"/sfa/control/opportunityOverviewReportQuery?action=");
out.print(UIScreenSection.ACTION_SHOW_QUERY_REPORT);
out.write("\"');\r\n");
}
out.write("\r\n\r\n o.addPanel(p);\r\n\r\n p = new createPanel('l2','Admin');\r\n");
if (menuPrivileges.contains(MENU_MY_COMPANY)) {
out.write("\r\n p.addButton('/sfaimages/accounts.gif','My Company', mtarget+'=\"/sfa/control/myCompany\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_APPLICATIONS)) {
out.write("\r\n p.addButton('/sfaimages/applications.gif','Applications', mtarget+'=\"/sfa/control/applications\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_SCREENS)) {
out.write("\r\n p.addButton('/sfaimages/screens.gif','Screens', mtarget+'=\"/sfa/control/uiScreen\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_ENTITIES)) {
out.write("\r\n p.addButton('/sfaimages/account.gif','Entities', mtarget+'=\"/sfa/control/uiEntity\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_CODES)) {
out.write("\r\n p.addButton('/sfaimages/codes.gif','Codes', mtarget+'=\"/sfa/control/codes\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_DISPLAY_TYPES)) {
out.write("\r\n p.addButton('/sfaimages/display.gif','Display Types', mtarget+'=\"/sfa/control/uiDisplayType\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_PREFERENCES)) {
out.write("\r\n p.addButton('/sfaimages/admin3.gif','Preferences', mtarget+'=\"/sfa/control/preferences\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_LEAD_QUEUES)) {
out.write("\r\n p.addButton('/sfaimages/leadQueue.gif','Lead Queues', mtarget+'=\"/sfa/control/leadQueues\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_LEAD_RULES)) {
out.write("\r\n p.addButton('/sfaimages/leadRule.gif', 'Lead Rules', mtarget+'=\"/sfa/control/leadRules\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_STEPS_TO_CLOSE)) {
out.write("\r\n p.addButton('/sfaimages/admin4.gif','Steps To Close', mtarget+'=\"/sfa/control/stepsToCloseAdmin\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_REPLICATION)) {
out.write("\r\n p.addButton('/sfaimages/admin2.gif','Replication', mtarget+'=\"/sfa/control/replicationLogin\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_SQL_QUERY)) {
out.write("\r\n p.addButton('/sfaimages/search.gif','Sql Query', mtarget+'=\"/sfa/control/sqlQueryInput\"');\r\n");
}
out.write("\r\n\r\n");
if (menuPrivileges.contains(MENU_USER_TRANSFER)) {
out.write("\r\n p.addButton('/sfaimages/contacts.gif','User Transfer', mtarget+'=\"/sfa/control/contactTransfer\"');\r\n");
}
out.write("\r\n\r\n o.addPanel(p);\r\n\r\n\r\n\r\n o.draw(); //draw the OutlookBar\r\n o.showPanel(0);\r\n\r\n//-----------------------------------------------------------------------------\r\n//functions to manage window resize\r\n//-----------------------------------------------------------------------------\r\n//resize OP5 (test screenSize every 100ms)\r\nfunction resize_op5() {\r\n if (bt.op5) {\r\n o.showPanel(o.aktPanel);\r\n var s = new createPageSize();\r\n if ((screenSize.width!=s.width) || (screenSize.height!=s.height)) {\r\n screenSize=new createPageSize();\r\n //need setTimeout or resize on window-maximize will not work correct!\r\n //benötige das setTimeout oder das Maximieren funktioniert nicht richtig\r\n setTimeout(\"o.resize(0,0,screenSize.width,screenSize.height)\",100);\r\n }\r\n setTimeout(\"resize_op5()\",100);\r\n }\r\n}\r\n\r\n//resize IE & NS (onResize event!)\r\nfunction myOnResize() {\r\n if (bt.ie4 || bt.ie5 || bt.ns5) {\r\n var s=new createPageSize();\r\n o.resize(0,0,s.width,s.height);\r\n }\r\n else\r\n if (bt.ns4) location.reload();\r\n");
out.write("}\r\n\r\n");
out.write("</SCRIPT>\r\n\r\n\r\n\r\n");
out.write("</head>\r\n");
out.write("<!-- need an onResize event to redraw outlookbar after pagesize changes! -->\r\n");
out.write("<!-- OP5 does not support onResize event! use setTimeout every 100ms -->\r\n");
out.write("<body onLoad=\"resize_op5();\" onResize=\"myOnResize();\">\r\n\r\n");
} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
private boolean _jspx_meth_ofbiz_url_0(javax.servlet.jsp.PageContext pageContext)
throws Throwable {
JspWriter out = pageContext.getOut();
/* ---- ofbiz:url ---- */
org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_0 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url.get(org.ofbiz.content.webapp.taglib.UrlTag.class);
_jspx_th_ofbiz_url_0.setPageContext(pageContext);
_jspx_th_ofbiz_url_0.setParent(null);
int _jspx_eval_ofbiz_url_0 = _jspx_th_ofbiz_url_0.doStartTag();
if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
out = _bc;
_jspx_th_ofbiz_url_0.setBodyContent(_bc);
_jspx_th_ofbiz_url_0.doInitBody();
}
do {
out.write("/testServer");
int evalDoAfterBody = _jspx_th_ofbiz_url_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = pageContext.popBody();
}
if (_jspx_th_ofbiz_url_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_0);
return false;
}
private boolean _jspx_meth_ofbiz_url_1(javax.servlet.jsp.PageContext pageContext)
throws Throwable {
JspWriter out = pageContext.getOut();
/* ---- ofbiz:url ---- */
org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_1 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url.get(org.ofbiz.content.webapp.taglib.UrlTag.class);
_jspx_th_ofbiz_url_1.setPageContext(pageContext);
_jspx_th_ofbiz_url_1.setParent(null);
int _jspx_eval_ofbiz_url_1 = _jspx_th_ofbiz_url_1.doStartTag();
if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
out = _bc;
_jspx_th_ofbiz_url_1.setBodyContent(_bc);
_jspx_th_ofbiz_url_1.doInitBody();
}
do {
out.write("/testServer");
int evalDoAfterBody = _jspx_th_ofbiz_url_1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = pageContext.popBody();
}
if (_jspx_th_ofbiz_url_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_1);
return false;
}
}