0001: package org.apache.jsp;
0002:
0003: import javax.servlet.*;
0004: import javax.servlet.http.*;
0005: import javax.servlet.jsp.*;
0006: import org.apache.jasper.runtime.*;
0007: import org.ofbiz.base.util.*;
0008: import org.ofbiz.security.*;
0009: import com.sourcetap.sfa.ui.UIScreenSection;
0010: import java.util.Date;
0011: import java.util.List;
0012: import java.util.Map;
0013: import java.util.Vector;
0014: import java.util.ArrayList;
0015: import java.util.Enumeration;
0016: import java.util.Iterator;
0017: import java.util.HashMap;
0018: import java.util.Calendar;
0019: import java.util.StringTokenizer;
0020: import java.text.SimpleDateFormat;
0021: import java.text.DecimalFormat;
0022: import java.text.ParseException;
0023: import java.sql.Timestamp;
0024: import java.sql.Time;
0025: import java.sql.*;
0026: import org.ofbiz.entity.util.SequenceUtil;
0027: import org.ofbiz.security.*;
0028: import org.ofbiz.entity.*;
0029: import org.ofbiz.entity.condition.*;
0030: import org.ofbiz.entity.model.*;
0031: import org.ofbiz.base.util.*;
0032: import com.sourcetap.sfa.ui.*;
0033: import com.sourcetap.sfa.event.*;
0034: import com.sourcetap.sfa.util.UserInfo;
0035:
0036: public class topBar_jsp extends HttpJspBase {
0037:
0038: /*
0039: * Takes a string in the following format:
0040: * formatString
0041: * Where the first letter is lowercase, and
0042: * subsequent unique words begin with an upper case.
0043: * The function will convert a java string to a regular
0044: * string in title case format.
0045: */
0046: String formatJavaString(String s) {
0047: char ca[] = s.toCharArray();
0048: StringBuffer sb = new StringBuffer();
0049: int previous = 0;
0050: for (int i = 0; i < ca.length; i++) {
0051: if (i == s.length() - 1) {
0052: sb.append(s.substring(previous, previous + 1)
0053: .toUpperCase());
0054: sb.append(s.substring(previous + 1, s.length()));
0055: }
0056: if (Character.isUpperCase(ca[i])) {
0057: sb.append(s.substring(previous, previous + 1)
0058: .toUpperCase());
0059: sb.append(s.substring(previous + 1, i));
0060: sb.append(" ");
0061: previous = i;
0062: }
0063: }
0064: return sb.toString();
0065: }
0066:
0067: /**
0068: Properties must include:
0069: NAME-name of the select used in name-value form submit.
0070: VALUE_FIELD-the value sent in form submit.
0071: DISPLAY_FIELD-the field used in the display of the drop-down. use a
0072: Properties can include:
0073: Selected-The value to test for, and set selected on the drop-down
0074: EMPTY_FIRST: if just a blank field use "{field display vaalue}, else if value supplied use "{field value}, {field value display name}"
0075: */
0076: String buildDropDown(List l, Map properties) {
0077: StringBuffer returnString = new StringBuffer();
0078: GenericValue genericValue = null;
0079: Iterator i = l.iterator();
0080: String selected = ((String) (properties.get("SELECTED") != null ? properties
0081: .get("SELECTED")
0082: : ""));
0083: String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0084: .get("DISPLAY_FIELD")
0085: : ""));
0086: String selectJavaScript = ((String) (properties
0087: .get("SELECT_JAVASCRIPT") != null ? properties
0088: .get("SELECT_JAVASCRIPT") : ""));
0089: returnString.append("<select name=\"" + properties.get("NAME")
0090: + "\" " + selectJavaScript + " >");
0091: if (properties.get("EMPTY_FIRST") != null) {
0092: String empty = (String) properties.get("EMPTY_FIRST");
0093: if (empty.indexOf(",") != -1) {
0094: StringTokenizer tok = new StringTokenizer(empty, ",");
0095: returnString.append("<option value=\""
0096: + ((String) tok.nextElement()).trim() + "\">"
0097: + ((String) tok.nextElement()).trim());
0098: } else {
0099: returnString.append("<option value=\"\">" + empty);
0100: }
0101: }
0102: try {
0103: while (i.hasNext()) {
0104: genericValue = (GenericValue) i.next();
0105: returnString.append("<option value=\""
0106: + String.valueOf(genericValue
0107: .get((String) properties
0108: .get("VALUE_FIELD"))) + "\"");
0109: if (String.valueOf(
0110: genericValue.get((String) properties
0111: .get("VALUE_FIELD"))).equals(selected)) {
0112: returnString.append(" SELECTED ");
0113: }
0114: returnString.append(" >");
0115: if (display.indexOf(",") != -1) {
0116: StringTokenizer tok = new StringTokenizer(display,
0117: ",");
0118: while (tok.hasMoreElements()) {
0119: String elem = (String) tok.nextElement();
0120: returnString.append(String.valueOf(genericValue
0121: .get(elem.trim())));
0122: returnString.append(" ");
0123: }
0124: } else {
0125: returnString.append(genericValue.get(display));
0126: }
0127: }
0128: } catch (Exception e) {
0129: e.printStackTrace();
0130: }
0131: returnString.append("</select>");
0132: return returnString.toString();
0133: }
0134:
0135: String buildStringDropDown(List l, Map properties) {
0136: StringBuffer returnString = new StringBuffer();
0137: String value = "";
0138: Iterator i = l.iterator();
0139: String selected = ((String) (properties.get("SELECTED") != null ? properties
0140: .get("SELECTED")
0141: : ""));
0142: String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0143: .get("DISPLAY_FIELD")
0144: : ""));
0145: String selectJavaScript = ((String) (properties
0146: .get("SELECT_JAVASCRIPT") != null ? properties
0147: .get("SELECT_JAVASCRIPT") : ""));
0148: returnString.append("<select name=\"" + properties.get("NAME")
0149: + "\" " + selectJavaScript + " >");
0150: if (properties.get("EMPTY_FIRST") != null) {
0151: String empty = (String) properties.get("EMPTY_FIRST");
0152: if (empty.indexOf(",") != -1) {
0153: StringTokenizer tok = new StringTokenizer(empty, ",");
0154: returnString.append("<option value=\""
0155: + ((String) tok.nextElement()).trim() + "\">"
0156: + ((String) tok.nextElement()).trim());
0157: } else {
0158: returnString.append("<option value=\"\">" + empty);
0159: }
0160: }
0161: while (i.hasNext()) {
0162: value = (String) i.next();
0163: returnString.append("<option value=\"" + value + "\"");
0164: if (value.equals(selected)) {
0165: returnString.append(" SELECTED ");
0166: }
0167: returnString.append(" >");
0168: if (display.indexOf(",") != -1) {
0169: StringTokenizer tok = new StringTokenizer(display, ",");
0170: while (tok.hasMoreElements()) {
0171: String elem = (String) tok.nextElement();
0172: returnString.append(value);
0173: returnString.append(" ");
0174: }
0175: } else {
0176: returnString.append(value);
0177: }
0178: }
0179: returnString.append("</select>");
0180: return returnString.toString();
0181: }
0182:
0183: String buildFieldDropDown(Vector fields, String entityName,
0184: HashMap properties) {
0185: if (properties == null)
0186: properties = new HashMap();
0187: StringBuffer returnString = new StringBuffer();
0188: ModelField modelField = null;
0189: String selected = ((String) (properties.get("SELECTED") != null ? properties
0190: .get("SELECTED")
0191: : ""));
0192: returnString.append("<select name=\"" + entityName + "\" >");
0193: if (properties.get("EMPTY_FIRST") != null)
0194: returnString.append("<option value=\"\">"
0195: + properties.get("EMPTY_FIRST"));
0196: for (int i = 0; i < fields.size(); i++) {
0197: modelField = (ModelField) fields.get(i);
0198: returnString.append("<option value=\""
0199: + modelField.getName() + "\"");
0200: if ((modelField.getName()).equals(selected)) {
0201: returnString.append(" SELECTED ");
0202: }
0203: returnString.append(" >"
0204: + formatJavaString(modelField.getName()));
0205: }
0206: returnString.append("</select>");
0207: return returnString.toString();
0208: }
0209:
0210: /**
0211: * Checks a List of fields to see if the string
0212: * that is passed in exists in the vector. If so,
0213: * it returns the ModelField for the named field, else
0214: * it returns null.
0215: */
0216: ModelField contains(List v, String s) {
0217: ModelField field;
0218: for (int i = 0; i < v.size(); i++) {
0219: field = (ModelField) v.get(i);
0220: if (field.getName().equals(s))
0221: return field;
0222: }
0223: return null;
0224: }
0225:
0226: String buildUIFieldDropDown(String sectionName, List fields,
0227: String entityName, HashMap properties) {
0228: if (properties == null)
0229: properties = new HashMap();
0230: StringBuffer returnString = new StringBuffer();
0231: UIFieldInfo fieldInfo = null;
0232: String selected = ((String) (properties.get("SELECTED") != null ? properties
0233: .get("SELECTED")
0234: : ""));
0235: returnString.append("<select name=\"" + entityName + "\" >");
0236: if (properties.get("EMPTY_FIRST") != null)
0237: returnString.append("<option value=\"\">"
0238: + properties.get("EMPTY_FIRST"));
0239: for (int i = 0; i < fields.size(); i++) {
0240: fieldInfo = (UIFieldInfo) fields.get(i);
0241: if (fieldInfo.getIsVisible() && !fieldInfo.getIsReadOnly()) {
0242: String attrId = UIWebUtility.getHtmlName(sectionName,
0243: fieldInfo, 0);
0244: String attrName = fieldInfo.getDisplayLabel();
0245: returnString.append("<option value=\"" + attrId + "\"");
0246: if (attrName.equals(selected)) {
0247: returnString.append(" SELECTED ");
0248: }
0249: returnString.append(" >" + attrName);
0250: }
0251: }
0252: returnString.append("</select>");
0253: return returnString.toString();
0254: }
0255:
0256: /**
0257: * Given a ModelField and a value, this function checks the datatype for the field, and
0258: * converts the value to the correct datatype.
0259: */
0260: GenericValue setCorrectDataType(GenericValue entity,
0261: ModelField curField, String value) {
0262: ModelFieldTypeReader modelFieldTypeReader = new ModelFieldTypeReader(
0263: "mysql");
0264: ModelFieldType mft = modelFieldTypeReader
0265: .getModelFieldType(curField.getType());
0266: String fieldType = mft.getJavaType();
0267: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
0268: SimpleDateFormat timeFormat = new SimpleDateFormat(
0269: "yyyy-MM-dd hh:mm a");
0270:
0271: if (fieldType.equals("java.lang.String")
0272: || fieldType.equals("String")) {
0273: if (mft.getType().equals("indicator")) {
0274: if (value.equals("on"))
0275: entity.set(curField.getName(), "Y");
0276: else if (value.equals("off"))
0277: entity.set(curField.getName(), "N");
0278: else
0279: entity.set(curField.getName(), value);
0280: } else
0281: entity.set(curField.getName(), value);
0282: } else if (fieldType.equals("java.sql.Timestamp")
0283: || fieldType.equals("Timestamp")) {
0284: if (value.trim().length() == 0) {
0285: entity.set(curField.getName(), null);
0286: } else {
0287: try {
0288: entity.set(curField.getName(), new Timestamp(
0289: timeFormat.parse(value).getTime()));
0290: } catch (ParseException e) {
0291: e.printStackTrace();
0292: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0293: }
0294: } else if (fieldType.equals("java.sql.Time")
0295: || fieldType.equals("Time")) {
0296: if (value.trim().length() == 0) {
0297: entity.set(curField.getName(), null);
0298: } else {
0299: try {
0300: entity.set(curField.getName(), new Time(timeFormat
0301: .parse(value).getTime()));
0302: } catch (ParseException e) {
0303: e.printStackTrace();
0304: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0305: }
0306: } else if (fieldType.equals("java.util.Date")) {
0307: if (value.trim().length() == 0) {
0308: entity.set(curField.getName(), null);
0309: } else {
0310: try {
0311: entity.set(curField.getName(), new java.sql.Date(
0312: dateFormat.parse(value).getTime()));
0313: } catch (ParseException e) {
0314: e.printStackTrace();
0315: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0316: }
0317: } else if (fieldType.equals("java.sql.Date")
0318: || fieldType.equals("Date")) {
0319: if (value.trim().length() == 0) {
0320: entity.set(curField.getName(), null);
0321: } else {
0322: try {
0323: entity.set(curField.getName(), new java.sql.Date(
0324: dateFormat.parse(value).getTime()));
0325: } catch (ParseException e) {
0326: e.printStackTrace();
0327: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0328: }
0329: } else if (fieldType.equals("java.lang.Integer")
0330: || fieldType.equals("Integer")) {
0331: if (value.trim().length() == 0)
0332: value = "0";
0333: entity.set(curField.getName(), Integer.valueOf(value));
0334: } else if (fieldType.equals("java.lang.Long")
0335: || fieldType.equals("Long")) {
0336: if (value.trim().length() == 0)
0337: value = "0";
0338: entity.set(curField.getName(), Long.valueOf(value));
0339: } else if (fieldType.equals("java.lang.Float")
0340: || fieldType.equals("Float")) {
0341: if (value.trim().length() == 0)
0342: value = "0.0";
0343: entity.set(curField.getName(), Float.valueOf(value));
0344: } else if (fieldType.equals("java.lang.Double")
0345: || fieldType.equals("Double")) {
0346: if (value.trim().length() == 0 || value == null)
0347: value = "0";
0348: entity.set(curField.getName(), Double.valueOf(value));
0349: }
0350: return entity;
0351: }
0352:
0353: String getFieldValue(List l, String fieldName, String equalsValue,
0354: String returnFieldName) {
0355: Iterator i = l.iterator();
0356: GenericEntity genericEntity = null;
0357: String retVal = "";
0358: //TODO: add StringTokenizer to parse multiple fields.
0359: while (i.hasNext()) {
0360: genericEntity = (GenericValue) i.next();
0361: if (String.valueOf(genericEntity.get(fieldName)).equals(
0362: equalsValue))
0363: retVal = String.valueOf(genericEntity
0364: .get(returnFieldName));
0365: }
0366: return retVal;
0367: }
0368:
0369: String getFieldValue(HttpServletRequest request, String fieldName) {
0370: return (request.getParameter(fieldName) != null ? request
0371: .getParameter(fieldName) : "");
0372: }
0373:
0374: Vector getGenericValue(List l, String fieldName, String equalsValue) {
0375: Vector returnVector = new Vector();
0376: GenericValue genericValue = null;
0377: GenericValue genericValues[] = (GenericValue[]) l
0378: .toArray(new GenericValue[0]);
0379: for (int i = 0; i < genericValues.length; i++) {
0380: genericValue = (GenericValue) genericValues[i];
0381: if (String.valueOf(genericValue.get(fieldName)).equals(
0382: equalsValue))
0383: returnVector.add(genericValue);
0384: }
0385: return returnVector;
0386: }
0387:
0388: String getDateTimeFieldValue(List l, String fieldName,
0389: String equalsValue, String returnFieldName,
0390: String dateFormatString) {
0391: GenericValue genericValue = null;
0392: GenericValue genericValues[] = (GenericValue[]) l
0393: .toArray(new GenericValue[0]);
0394: String retVal = "";
0395: SimpleDateFormat dateFormat = new SimpleDateFormat(
0396: dateFormatString);
0397: for (int i = 0; i < genericValues.length; i++) {
0398: genericValue = genericValues[i];
0399: try {
0400: if (dateFormat.parse(genericValue.getString(fieldName))
0401: .equals(dateFormat.parse(equalsValue)))
0402: retVal = String.valueOf(genericValue
0403: .get(returnFieldName));
0404: } catch (ParseException e) {
0405: e.printStackTrace();
0406: }
0407: }
0408: return retVal;
0409: }
0410:
0411: Vector getDateTimeGenericValue(List l, String fieldName,
0412: String equalsValue, String dateFormatString) {
0413: Vector returnVector = new Vector();
0414: GenericValue genericValue = null;
0415: GenericValue genericValues[] = (GenericValue[]) l
0416: .toArray(new GenericValue[0]);
0417: String retVal = "";
0418: SimpleDateFormat dateFormat = new SimpleDateFormat(
0419: dateFormatString);
0420: for (int i = 0; i < genericValues.length; i++) {
0421: genericValue = genericValues[i];
0422: try {
0423: if (dateFormat.parse(genericValue.getString(fieldName))
0424: .equals(dateFormat.parse(equalsValue)))
0425: returnVector.add(genericValue);
0426: } catch (ParseException e) {
0427: e.printStackTrace();
0428: }
0429: }
0430: return returnVector;
0431: }
0432:
0433: String getStatesDropDown(String name, String selected) {
0434: if (name == null)
0435: return null;
0436: StringBuffer returnString = new StringBuffer();
0437: returnString.append("<select class=\"\" name=\"" + name
0438: + "\" >");
0439: returnString.append("<option "
0440: + (selected == null || selected.equals("") ? "selected"
0441: : "") + " >");
0442: returnString
0443: .append("<option "
0444: + (selected != null && selected.equals("AK") ? "selected"
0445: : "") + " >AK");
0446: returnString
0447: .append("<option"
0448: + (selected != null
0449: && selected.equalsIgnoreCase("AL") ? " selected"
0450: : "") + ">AL");
0451: returnString
0452: .append("<option"
0453: + (selected != null
0454: && selected.equalsIgnoreCase("AR") ? " selected"
0455: : "") + ">AR");
0456: returnString
0457: .append("<option"
0458: + (selected != null
0459: && selected.equalsIgnoreCase("AZ") ? " selected"
0460: : "") + ">AZ");
0461: returnString
0462: .append("<option"
0463: + (selected != null
0464: && selected.equalsIgnoreCase("CA") ? " selected"
0465: : "") + ">CA");
0466: returnString
0467: .append("<option"
0468: + (selected != null
0469: && selected.equalsIgnoreCase("CO") ? " selected"
0470: : "") + ">CO");
0471: returnString
0472: .append("<option"
0473: + (selected != null
0474: && selected.equalsIgnoreCase("CT") ? " selected"
0475: : "") + ">CT");
0476: returnString
0477: .append("<option"
0478: + (selected != null
0479: && selected.equalsIgnoreCase("DC") ? " selected"
0480: : "") + ">DC");
0481: returnString
0482: .append("<option"
0483: + (selected != null
0484: && selected.equalsIgnoreCase("DE") ? " selected"
0485: : "") + ">DE");
0486: returnString
0487: .append("<option"
0488: + (selected != null
0489: && selected.equalsIgnoreCase("FL") ? " selected"
0490: : "") + ">FL");
0491: returnString
0492: .append("<option"
0493: + (selected != null
0494: && selected.equalsIgnoreCase("GA") ? " selected"
0495: : "") + ">GA");
0496: returnString
0497: .append("<option"
0498: + (selected != null
0499: && selected.equalsIgnoreCase("GU") ? " selected"
0500: : "") + ">GU");
0501: returnString
0502: .append("<option"
0503: + (selected != null
0504: && selected.equalsIgnoreCase("HI") ? " selected"
0505: : "") + ">HI");
0506: returnString
0507: .append("<option"
0508: + (selected != null
0509: && selected.equalsIgnoreCase("IA") ? " selected"
0510: : "") + ">IA");
0511: returnString
0512: .append("<option"
0513: + (selected != null
0514: && selected.equalsIgnoreCase("ID") ? " selected"
0515: : "") + ">ID");
0516: returnString
0517: .append("<option"
0518: + (selected != null
0519: && selected.equalsIgnoreCase("IL") ? " selected"
0520: : "") + ">IL");
0521: returnString
0522: .append("<option"
0523: + (selected != null
0524: && selected.equalsIgnoreCase("IN") ? " selected"
0525: : "") + ">IN");
0526: returnString
0527: .append("<option"
0528: + (selected != null
0529: && selected.equalsIgnoreCase("KS") ? " selected"
0530: : "") + ">KS");
0531: returnString
0532: .append("<option"
0533: + (selected != null
0534: && selected.equalsIgnoreCase("KY") ? " selected"
0535: : "") + ">KY");
0536: returnString
0537: .append("<option"
0538: + (selected != null
0539: && selected.equalsIgnoreCase("LA") ? " selected"
0540: : "") + ">LA");
0541: returnString
0542: .append("<option"
0543: + (selected != null
0544: && selected.equalsIgnoreCase("MA") ? " selected"
0545: : "") + ">MA");
0546: returnString
0547: .append("<option"
0548: + (selected != null
0549: && selected.equalsIgnoreCase("MD") ? " selected"
0550: : "") + ">MD");
0551: returnString
0552: .append("<option"
0553: + (selected != null
0554: && selected.equalsIgnoreCase("ME") ? " selected"
0555: : "") + ">ME");
0556: returnString
0557: .append("<option"
0558: + (selected != null
0559: && selected.equalsIgnoreCase("MI") ? " selected"
0560: : "") + ">MI");
0561: returnString
0562: .append("<option"
0563: + (selected != null
0564: && selected.equalsIgnoreCase("MN") ? " selected"
0565: : "") + ">MN");
0566: returnString
0567: .append("<option"
0568: + (selected != null
0569: && selected.equalsIgnoreCase("MO") ? " selected"
0570: : "") + ">MO");
0571: returnString
0572: .append("<option"
0573: + (selected != null
0574: && selected.equalsIgnoreCase("MS") ? " selected"
0575: : "") + ">MS");
0576: returnString
0577: .append("<option"
0578: + (selected != null
0579: && selected.equalsIgnoreCase("MT") ? " selected"
0580: : "") + ">MT");
0581: returnString
0582: .append("<option"
0583: + (selected != null
0584: && selected.equalsIgnoreCase("NC") ? " selected"
0585: : "") + ">NC");
0586: returnString
0587: .append("<option"
0588: + (selected != null
0589: && selected.equalsIgnoreCase("ND") ? " selected"
0590: : "") + ">ND");
0591: returnString
0592: .append("<option"
0593: + (selected != null
0594: && selected.equalsIgnoreCase("NE") ? " selected"
0595: : "") + ">NE");
0596: returnString
0597: .append("<option"
0598: + (selected != null
0599: && selected.equalsIgnoreCase("NH") ? " selected"
0600: : "") + ">NH");
0601: returnString
0602: .append("<option"
0603: + (selected != null
0604: && selected.equalsIgnoreCase("NJ") ? " selected"
0605: : "") + ">NJ");
0606: returnString
0607: .append("<option"
0608: + (selected != null
0609: && selected.equalsIgnoreCase("NM") ? " selected"
0610: : "") + ">NM");
0611: returnString
0612: .append("<option"
0613: + (selected != null
0614: && selected.equalsIgnoreCase("NV") ? " selected"
0615: : "") + ">NV");
0616: returnString
0617: .append("<option"
0618: + (selected != null
0619: && selected.equalsIgnoreCase("NY") ? " selected"
0620: : "") + ">NY");
0621: returnString
0622: .append("<option"
0623: + (selected != null
0624: && selected.equalsIgnoreCase("OH") ? " selected"
0625: : "") + ">OH");
0626: returnString
0627: .append("<option"
0628: + (selected != null
0629: && selected.equalsIgnoreCase("OK") ? " selected"
0630: : "") + ">OK");
0631: returnString
0632: .append("<option"
0633: + (selected != null
0634: && selected.equalsIgnoreCase("OR") ? " selected"
0635: : "") + ">OR");
0636: returnString
0637: .append("<option"
0638: + (selected != null
0639: && selected.equalsIgnoreCase("PA") ? " selected"
0640: : "") + ">PA");
0641: returnString
0642: .append("<option"
0643: + (selected != null
0644: && selected.equalsIgnoreCase("PR") ? " selected"
0645: : "") + ">PR");
0646: returnString
0647: .append("<option"
0648: + (selected != null
0649: && selected.equalsIgnoreCase("RI") ? " selected"
0650: : "") + ">RI");
0651: returnString
0652: .append("<option"
0653: + (selected != null
0654: && selected.equalsIgnoreCase("SC") ? " selected"
0655: : "") + ">SC");
0656: returnString
0657: .append("<option"
0658: + (selected != null
0659: && selected.equalsIgnoreCase("SD") ? " selected"
0660: : "") + ">SD");
0661: returnString
0662: .append("<option"
0663: + (selected != null
0664: && selected.equalsIgnoreCase("TN") ? " selected"
0665: : "") + ">TN");
0666: returnString
0667: .append("<option"
0668: + (selected != null
0669: && selected.equalsIgnoreCase("TX") ? " selected"
0670: : "") + ">TX");
0671: returnString
0672: .append("<option"
0673: + (selected != null
0674: && selected.equalsIgnoreCase("UT") ? " selected"
0675: : "") + ">UT");
0676: returnString
0677: .append("<option"
0678: + (selected != null
0679: && selected.equalsIgnoreCase("VA") ? " selected"
0680: : "") + ">VA");
0681: returnString
0682: .append("<option"
0683: + (selected != null
0684: && selected.equalsIgnoreCase("VI") ? " selected"
0685: : "") + ">VI");
0686: returnString
0687: .append("<option"
0688: + (selected != null
0689: && selected.equalsIgnoreCase("VT") ? " selected"
0690: : "") + ">VT");
0691: returnString
0692: .append("<option"
0693: + (selected != null
0694: && selected.equalsIgnoreCase("WA") ? " selected"
0695: : "") + ">WA");
0696: returnString
0697: .append("<option"
0698: + (selected != null
0699: && selected.equalsIgnoreCase("WI") ? " selected"
0700: : "") + ">WI");
0701: returnString
0702: .append("<option"
0703: + (selected != null
0704: && selected.equalsIgnoreCase("WV") ? " selected"
0705: : "") + ">WV");
0706: returnString
0707: .append("<option"
0708: + (selected != null
0709: && selected.equalsIgnoreCase("WY") ? " selected"
0710: : "") + ">WY");
0711: returnString.append("</select>");
0712: return returnString.toString();
0713: }
0714:
0715: private static java.util.Vector _jspx_includes;
0716:
0717: static {
0718: _jspx_includes = new java.util.Vector(8);
0719: _jspx_includes.add("/includes/header.jsp");
0720: _jspx_includes.add("/includes/oldFunctions.jsp");
0721: _jspx_includes.add("/includes/oldDeclarations.jsp");
0722: _jspx_includes.add("/includes/windowTitle.jsp");
0723: _jspx_includes.add("/includes/userStyle.jsp");
0724: _jspx_includes.add("/includes/uiFunctions.js");
0725: _jspx_includes.add("/includes/onBeforeUnload.jsp");
0726: _jspx_includes.add("/includes/ts_picker.js");
0727: }
0728:
0729: private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_ofbiz_url;
0730:
0731: public topBar_jsp() {
0732: _jspx_tagPool_ofbiz_url = new org.apache.jasper.runtime.TagHandlerPool();
0733: }
0734:
0735: public java.util.List getIncludes() {
0736: return _jspx_includes;
0737: }
0738:
0739: public void _jspDestroy() {
0740: _jspx_tagPool_ofbiz_url.release();
0741: }
0742:
0743: public void _jspService(HttpServletRequest request,
0744: HttpServletResponse response) throws java.io.IOException,
0745: ServletException {
0746:
0747: JspFactory _jspxFactory = null;
0748: javax.servlet.jsp.PageContext pageContext = null;
0749: HttpSession session = null;
0750: ServletContext application = null;
0751: ServletConfig config = null;
0752: JspWriter out = null;
0753: Object page = this ;
0754: JspWriter _jspx_out = null;
0755:
0756: try {
0757: _jspxFactory = JspFactory.getDefaultFactory();
0758: response.setContentType("text/html;charset=ISO-8859-1");
0759: pageContext = _jspxFactory.getPageContext(this , request,
0760: response, null, true, 8192, true);
0761: application = pageContext.getServletContext();
0762: config = pageContext.getServletConfig();
0763: session = pageContext.getSession();
0764: out = pageContext.getOut();
0765: _jspx_out = out;
0766:
0767: out.write("<BASE target=\"content\">\r\n");
0768: out.write("\r\n");
0769: out.write("\r\n");
0770: out.write("\r\n");
0771: out.write("\r\n");
0772: out.write("\r\n");
0773: out.write("\r\n");
0774: out.write("\r\n");
0775: out.write("\r\n");
0776: out.write("\r\n");
0777: out.write("\r\n");
0778: out.write("\r\n");
0779: out.write("\r\n");
0780: out.write("\r\n\r\n");
0781: out.write("\r\n");
0782: out.write("\r\n");
0783: out.write("\r\n");
0784: out.write("\r\n");
0785: out.write("\r\n");
0786: out.write("\r\n\r\n");
0787: out.write("\r\n");
0788: out.write("\r\n");
0789: out.write("\r\n");
0790: out.write("\r\n");
0791: out.write("\r\n");
0792: out.write("\r\n");
0793: out.write("\r\n");
0794: out.write("\r\n");
0795: out.write("\r\n\r\n");
0796: out.write("\r\n\r\n");
0797: org.ofbiz.security.Security security = null;
0798: synchronized (application) {
0799: security = (org.ofbiz.security.Security) pageContext
0800: .getAttribute("security",
0801: PageContext.APPLICATION_SCOPE);
0802: if (security == null) {
0803: throw new java.lang.InstantiationException(
0804: "bean security not found within scope");
0805: }
0806: }
0807: out.write("\r\n");
0808: org.ofbiz.entity.GenericDelegator delegator = null;
0809: synchronized (application) {
0810: delegator = (org.ofbiz.entity.GenericDelegator) pageContext
0811: .getAttribute("delegator",
0812: PageContext.APPLICATION_SCOPE);
0813: if (delegator == null) {
0814: throw new java.lang.InstantiationException(
0815: "bean delegator not found within scope");
0816: }
0817: }
0818: out.write("\r\n");
0819: com.sourcetap.sfa.event.GenericWebEventProcessor webEventProcessor = null;
0820: synchronized (application) {
0821: webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) pageContext
0822: .getAttribute("webEventProcessor",
0823: PageContext.APPLICATION_SCOPE);
0824: if (webEventProcessor == null) {
0825: try {
0826: webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) java.beans.Beans
0827: .instantiate(this .getClass()
0828: .getClassLoader(),
0829: "com.sourcetap.sfa.event.GenericWebEventProcessor");
0830: } catch (ClassNotFoundException exc) {
0831: throw new InstantiationException(exc
0832: .getMessage());
0833: } catch (Exception exc) {
0834: throw new ServletException(
0835: "Cannot create bean of class "
0836: + "com.sourcetap.sfa.event.GenericWebEventProcessor",
0837: exc);
0838: }
0839: pageContext.setAttribute("webEventProcessor",
0840: webEventProcessor,
0841: PageContext.APPLICATION_SCOPE);
0842: }
0843: }
0844: out.write("\r\n");
0845: com.sourcetap.sfa.event.GenericEventProcessor eventProcessor = null;
0846: synchronized (application) {
0847: eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) pageContext
0848: .getAttribute("eventProcessor",
0849: PageContext.APPLICATION_SCOPE);
0850: if (eventProcessor == null) {
0851: try {
0852: eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) java.beans.Beans
0853: .instantiate(this .getClass()
0854: .getClassLoader(),
0855: "com.sourcetap.sfa.event.GenericEventProcessor");
0856: } catch (ClassNotFoundException exc) {
0857: throw new InstantiationException(exc
0858: .getMessage());
0859: } catch (Exception exc) {
0860: throw new ServletException(
0861: "Cannot create bean of class "
0862: + "com.sourcetap.sfa.event.GenericEventProcessor",
0863: exc);
0864: }
0865: pageContext.setAttribute("eventProcessor",
0866: eventProcessor,
0867: PageContext.APPLICATION_SCOPE);
0868: }
0869: }
0870: out.write("\r\n");
0871: com.sourcetap.sfa.ui.UICache uiCache = null;
0872: synchronized (application) {
0873: uiCache = (com.sourcetap.sfa.ui.UICache) pageContext
0874: .getAttribute("uiCache",
0875: PageContext.APPLICATION_SCOPE);
0876: if (uiCache == null) {
0877: try {
0878: uiCache = (com.sourcetap.sfa.ui.UICache) java.beans.Beans
0879: .instantiate(this .getClass()
0880: .getClassLoader(),
0881: "com.sourcetap.sfa.ui.UICache");
0882: } catch (ClassNotFoundException exc) {
0883: throw new InstantiationException(exc
0884: .getMessage());
0885: } catch (Exception exc) {
0886: throw new ServletException(
0887: "Cannot create bean of class "
0888: + "com.sourcetap.sfa.ui.UICache",
0889: exc);
0890: }
0891: pageContext.setAttribute("uiCache", uiCache,
0892: PageContext.APPLICATION_SCOPE);
0893: }
0894: }
0895: out.write("\r\n\r\n");
0896: out.write("<!-- [oldFunctions.jsp] Begin -->\r\n");
0897: out.write("\r\n");
0898: out.write("<!-- [oldFunctions.jsp] End -->\r\n\r\n");
0899: out.write("\r\n");
0900: out.write("<!-- [oldDeclarations.jsp] Start -->\r\n\r\n");
0901: GenericValue userLogin = (GenericValue) session
0902: .getAttribute("_USER_LOGIN_");
0903: out.write("\r\n");
0904: UserInfo userInfo = (UserInfo) session
0905: .getAttribute("userInfo");
0906: out.write("\r\n\r\n");
0907: String partyId = "";
0908: if (userLogin != null)
0909: partyId = userLogin.getString("partyId");
0910:
0911: out.write("\r\n\r\n");
0912:
0913: DecimalFormat decimalFormat = new DecimalFormat("#,###.##");
0914: SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
0915: "MM/dd/yyyy");
0916: SimpleDateFormat simpleTimeFormat = new SimpleDateFormat(
0917: "K:mm a");
0918:
0919: out.write("\r\n\r\n");
0920: String controlPath = (String) request
0921: .getAttribute("_CONTROL_PATH_");
0922: out.write("\r\n");
0923: String contextRoot = (String) request
0924: .getAttribute("_CONTEXT_ROOT_");
0925: out.write("\r\n\r\n");
0926: String pageName = UtilFormatOut
0927: .checkNull((String) pageContext
0928: .getAttribute("PageName"));
0929: out.write("\r\n\r\n");
0930: String companyName = UtilProperties.getPropertyValue(
0931: contextRoot + "/WEB-INF/sfa.properties",
0932: "company.name");
0933: out.write("\r\n");
0934: String companySubtitle = UtilProperties.getPropertyValue(
0935: contextRoot + "/WEB-INF/sfa.properties",
0936: "company.subtitle");
0937: out.write("\r\n");
0938: String headerImageUrl = UtilProperties.getPropertyValue(
0939: contextRoot + "/WEB-INF/sfa.properties",
0940: "header.image.url");
0941: out.write("\r\n\r\n");
0942: String headerBoxBorderColor = UtilProperties
0943: .getPropertyValue(contextRoot
0944: + "/WEB-INF/sfa.properties",
0945: "header.box.border.color", "black");
0946: out.write("\r\n");
0947: String headerBoxBorderWidth = UtilProperties
0948: .getPropertyValue(contextRoot
0949: + "/WEB-INF/sfa.properties",
0950: "header.box.border.width", "1");
0951: out.write("\r\n");
0952: String headerBoxTopColor = UtilProperties.getPropertyValue(
0953: contextRoot + "/WEB-INF/sfa.properties",
0954: "header.box.top.color", "#336699");
0955: out.write("\r\n");
0956: String headerBoxBottomColor = UtilProperties
0957: .getPropertyValue(contextRoot
0958: + "/WEB-INF/sfa.properties",
0959: "header.box.bottom.color", "#cccc99");
0960: out.write("\r\n");
0961: String headerBoxBottomColorAlt = UtilProperties
0962: .getPropertyValue(contextRoot
0963: + "/WEB-INF/sfa.properties",
0964: "header.box.bottom.alt.color", "#eeeecc");
0965: out.write("\r\n");
0966: String headerBoxTopPadding = UtilProperties
0967: .getPropertyValue(contextRoot
0968: + "/WEB-INF/sfa.properties",
0969: "header.box.top.padding", "4");
0970: out.write("\r\n");
0971: String headerBoxBottomPadding = UtilProperties
0972: .getPropertyValue(contextRoot
0973: + "/WEB-INF/sfa.properties",
0974: "header.box.bottom.padding", "2");
0975: out.write("\r\n\r\n");
0976: String boxBorderColor = UtilProperties.getPropertyValue(
0977: contextRoot + "/WEB-INF/sfa.properties",
0978: "box.border.color", "black");
0979: out.write("\r\n");
0980: String boxBorderWidth = UtilProperties.getPropertyValue(
0981: contextRoot + "/WEB-INF/sfa.properties",
0982: "box.border.width", "1");
0983: out.write("\r\n");
0984: String boxTopColor = UtilProperties.getPropertyValue(
0985: contextRoot + "/WEB-INF/sfa.properties",
0986: "box.top.color", "#336699");
0987: out.write("\r\n");
0988: String boxBottomColor = UtilProperties.getPropertyValue(
0989: contextRoot + "/WEB-INF/sfa.properties",
0990: "box.bottom.color", "white");
0991: out.write("\r\n");
0992: String boxBottomColorAlt = UtilProperties.getPropertyValue(
0993: contextRoot + "/WEB-INF/sfa.properties",
0994: "box.bottom.alt.color", "white");
0995: out.write("\r\n");
0996: String boxTopPadding = UtilProperties.getPropertyValue(
0997: contextRoot + "/WEB-INF/sfa.properties",
0998: "box.top.padding", "4");
0999: out.write("\r\n");
1000: String boxBottomPadding = UtilProperties.getPropertyValue(
1001: contextRoot + "/WEB-INF/sfa.properties",
1002: "box.bottom.padding", "4");
1003: out.write("\r\n");
1004: String userStyleSheet = "/sfa/includes/maincss.css";
1005: out.write("\r\n");
1006: String alphabet[] = { "a", "b", "c", "d", "e", "f", "g",
1007: "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
1008: "r", "s", "t", "u", "v", "w", "x", "y", "z", "*" };
1009: out.write("\r\n\r\n");
1010: out.write("<!-- [oldDeclarations.jsp] End -->\r\n\r\n");
1011: out.write("\r\n\r\n");
1012: out.write("<HTML>\r\n");
1013: out.write("<HEAD>\r\n\r\n");
1014:
1015: String clientRequest = (String) session
1016: .getAttribute("_CLIENT_REQUEST_");
1017: //out.write("Client request: " + clientRequest + "<BR>");
1018: String hostName = "";
1019: if (clientRequest != null
1020: && clientRequest.indexOf("//") > 0) {
1021: int startPos = clientRequest.indexOf("//") + 2;
1022: int endPos = clientRequest.indexOf(":", startPos);
1023: if (endPos < startPos)
1024: endPos = clientRequest.indexOf("/", startPos);
1025: if (endPos < startPos)
1026: hostName = clientRequest.substring(startPos);
1027: else
1028: hostName = clientRequest
1029: .substring(startPos, endPos);
1030: } else {
1031: hostName = "";
1032: }
1033: //out.write("Host name: " + hostName + "<BR>");
1034:
1035: out.write("\r\n\r\n");
1036: out.write("<title>");
1037: out.print(hostName);
1038: out.write(" - Sales Force Automation - ");
1039: out.print(companyName);
1040: out.write("</title>\r\n\r\n");
1041: out.write("\r\n");
1042: out.write("<!-- [userStyle.jsp] Start -->\r\n\r\n");
1043:
1044: //------------ Get the style sheet
1045: String styleSheetId = null;
1046:
1047: ModelEntity entityStyleUser = delegator
1048: .getModelEntity("UiUserTemplate");
1049: HashMap hashMapStyleUser = new HashMap();
1050: if (userLogin != null) {
1051: String ulogin = userLogin.getString("userLoginId");
1052: hashMapStyleUser.put("userLoginId", ulogin);
1053: } else {
1054: hashMapStyleUser.put("userLoginId", "Default");
1055: }
1056: GenericPK stylePk = new GenericPK(entityStyleUser,
1057: hashMapStyleUser);
1058: GenericValue userTemplate = delegator
1059: .findByPrimaryKey(stylePk);
1060: if (userTemplate != null) {
1061: styleSheetId = userTemplate.getString("styleSheetId");
1062: }
1063:
1064: if (styleSheetId == null) {
1065: hashMapStyleUser.put("userLoginId", "Default");
1066: stylePk = new GenericPK(entityStyleUser,
1067: hashMapStyleUser);
1068: userTemplate = delegator.findByPrimaryKey(stylePk);
1069: if (userTemplate != null) {
1070: styleSheetId = userTemplate
1071: .getString("styleSheetId");
1072: }
1073: }
1074:
1075: if (styleSheetId != null) {
1076: ModelEntity entityStyle = delegator
1077: .getModelEntity("UiStyleTemplate");
1078: HashMap hashMapStyle = new HashMap();
1079: hashMapStyle.put("styleSheetId", styleSheetId);
1080: stylePk = new GenericPK(entityStyle, hashMapStyle);
1081: GenericValue styleTemplate = delegator
1082: .findByPrimaryKey(stylePk);
1083: userStyleSheet = styleTemplate
1084: .getString("styleSheetLoc");
1085:
1086: if (userStyleSheet == null) {
1087: userStyleSheet = "/sfa/includes/maincss.css";
1088: }
1089: }
1090:
1091: out.write("\r\n");
1092: out.write("<link rel=\"stylesheet\" href=\"");
1093: out.print(userStyleSheet);
1094: out.write("\" type=\"text/css\">\r\n\r\n");
1095: out.write("<!-- [userStyle.jsp] End -->\r\n\r\n");
1096: out.write("\r\n");
1097: out
1098: .write("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/sfa/css/gridstyles.css\">\r\n");
1099: out
1100: .write("<script language=\"JavaScript\" >\r\n\r\n function sendDropDown(elementName, idName, fieldName, findClass, paramName, paramValue, frm, action)\r\n {\r\n var sUrl = '");
1101: if (_jspx_meth_ofbiz_url_0(pageContext))
1102: return;
1103: out
1104: .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 = '");
1105: if (_jspx_meth_ofbiz_url_1(pageContext))
1106: return;
1107: out
1108: .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");
1109: out
1110: .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");
1111: out
1112: .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");
1113: out
1114: .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");
1115: out
1116: .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");
1117: out
1118: .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");
1119: out
1120: .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");
1121: out
1122: .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] ");
1123: out
1124: .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 ");
1125: out
1126: .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 ");
1127: out
1128: .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 ");
1129: out
1130: .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 ");
1131: out
1132: .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 ");
1133: out
1134: .write("< myRows; i++) {\r\n myArray[i] = new Array(myCols)\r\n for (j=0; j ");
1135: out
1136: .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 ");
1137: out.write("< myRows; i++) {\r\n for (j=0; j ");
1138: out
1139: .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");
1140: out.write("</script>\r\n\r\n\r\n");
1141: out.write("\r\n\r\n");
1142: out.write("</HEAD>\r\n\r\n");
1143: out.write("<BASE TARGET=\"content\">\r\n");
1144: out.write("<!--");
1145: out
1146: .write("<BODY CLASS=\"bodyform\" onbeforeunload=\"verifyClose()\">-->\r\n");
1147: out.write("<BODY CLASS=\"bodyform\"\">\r\n\r\n");
1148: out.write("\r\n");
1149: out.write("<!-- onBeforeUnload.jsp - Start -->\r\n\r\n");
1150: out
1151: .write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\" FOR=window EVENT=onbeforeunload>\r\n return doOnBeforeUnload();\r\n");
1152: out.write("</SCRIPT>\r\n\r\n");
1153: out
1154: .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");
1155: out
1156: .write(" var vFormC = document.forms;\r\n for (var vFormNbr = 0; vFormNbr ");
1157: out
1158: .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==\"");
1159: out.print(UIScreenSection.ACTION_INSERT);
1160: out.write("\" ||\r\n vAction==\"");
1161: out.print(UIScreenSection.ACTION_UPDATE);
1162: out.write("\" ||\r\n vAction==\"");
1163: out.print(UIScreenSection.ACTION_UPDATE_SELECT);
1164: out
1165: .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 ");
1166: out
1167: .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 = \"");
1168: out.print(UIWebUtility.HTML_NAME_PREFIX_ORIGINAL);
1169: out
1170: .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");
1171: out
1172: .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");
1173: out.write("</SCRIPT>\r\n\r\n");
1174: out.write("<!-- onBeforeUnload.jsp - End -->\r\n\r\n\r\n");
1175: out.write("\r\n\r\n");
1176: out
1177: .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 ");
1178: out.write("<denis@softcomplex.com>; ");
1179: out
1180: .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");
1181: out
1182: .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\"");
1183: out.write("<html>\\n\"+\r\n\t\t\" ");
1184: out.write("<head>\\n\"+\r\n\t\t\" ");
1185: out.write("<title>Calendar");
1186: out.write("</title>\\n\"+\r\n\t\t\" ");
1187: out.write("</head>\\n\"+\r\n\t\t\" ");
1188: out.write("<body bgcolor=\\\"White\\\">\\n\"+\r\n\t\t\" ");
1189: out
1190: .write("<table class=\\\"clsOTable\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
1191: out.write("<tr>\\n\" +\r\n\t\t\" ");
1192: out
1193: .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
1194: out
1195: .write("<table cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
1196: out.write("<tr>\\n\" +\r\n\t\t\" ");
1197: out
1198: .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
1199: out
1200: .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\" ");
1201: out
1202: .write("<img src=\\\"/sfaimages/prev.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"previous month\\\">\\n\" +\r\n\t\t\" ");
1203: out.write("</a>\\n\" +\r\n\t\t\" ");
1204: out.write("</td>\\n\" +\r\n\t\t\" ");
1205: out
1206: .write("<td bgcolor=\\\"#4682B4\\\" colspan=\\\"5\\\">\\n\" +\r\n\t\t\" ");
1207: out
1208: .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\" ");
1209: out.write("</font>\\n\" +\r\n\t\t\" ");
1210: out.write("</td>\\n\" +\r\n\t\t\" ");
1211: out
1212: .write("<td bgcolor=\\\"#4682B4\\\" align=\\\"right\\\">\\n\" +\r\n\t\t\" ");
1213: out
1214: .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\" ");
1215: out
1216: .write("<img src=\\\"/sfaimages/next.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"next month\\\">\\n\" +\r\n\t\t\" ");
1217: out.write("</a>\\n\" +\r\n\t\t\" ");
1218: out.write("</td>\\n\" +\r\n\t\t\" ");
1219: out
1220: .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 += \" ");
1221: out.write("<tr>\\n\";\r\n\tfor (var n=0; n");
1222: out.write("<7; n++)\r\n\t\tstr_buffer += \" ");
1223: out
1224: .write("<td bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
1225: out
1226: .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\" ");
1227: out.write("</font>");
1228: out
1229: .write("</td>\\n\";\r\n\t// print calendar table\r\n\tstr_buffer += \" ");
1230: out
1231: .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 += \" ");
1232: out
1233: .write("<tr>\\n\";\r\n\t\tfor (var n_current_wday=0; n_current_wday");
1234: out
1235: .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 += \" ");
1236: out
1237: .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 += \" ");
1238: out
1239: .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 += \" ");
1240: out
1241: .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 += \" ");
1242: out
1243: .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 += \" ");
1244: out
1245: .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 += \" ");
1246: out
1247: .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 += \" ");
1248: out
1249: .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\" ");
1250: out.write("</font>\\n\" +\r\n\t\t\t\t\" ");
1251: out.write("</a>\\n\" +\r\n\t\t\t\t\" ");
1252: out
1253: .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 += \" ");
1254: out
1255: .write("</tr>\\n\";\r\n\t}\r\n\t// print calendar footer\r\n\tstr_buffer +=\r\n\t\t\" ");
1256: out
1257: .write("<form name=\\\"cal\\\">\\n\" +\r\n\t\t\" ");
1258: out.write("<tr>\\n\" +\r\n\t\t\" ");
1259: out
1260: .write("<td colspan=\\\"7\\\" bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
1261: out
1262: .write("<font color=\\\"White\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\" Time:\\n\" +\r\n\t\t\" ");
1263: out
1264: .write("<input type=\\\"text\\\" name=\\\"time\\\" value=\\\"\" + dt2tmstr(dt_datetime) +\r\n\t\t\"\\\" size=\\\"8\\\" maxlength=\\\"8\\\">\\n\" +\r\n\t\t\" ");
1265: out.write("</font>\\n\" +\r\n\t\t\" ");
1266: out.write("</td>\\n\" +\r\n\t\t\" ");
1267: out.write("</tr>\\n\" +\r\n\t\t\" ");
1268: out.write("</form>\\n\" +\r\n\t\t\" ");
1269: out.write("</table>\\n\" +\r\n\t\t\" ");
1270: out.write("</tr>\\n\" +\r\n\t\t\" ");
1271: out.write("</td>\\n\" +\r\n\t\t\" ");
1272: out.write("</table>\\n\" +\r\n\t\t\" ");
1273: out.write("</body>\\n\" +\r\n\t\t\"");
1274: out
1275: .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");
1276: out
1277: .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");
1278: out.write("</script>\r\n");
1279: out.write("\r\n\r\n");
1280: out.write("\r\n\r\n");
1281: out
1282: .write("<SCRIPT LANGUAGE=\"javascript\">\r\n\tfunction openAddScreen() {\r\n\t\tvar vSelectObj = document.all(\"addNewSelect\");\r\n\t\tvar vSelectedIndex = vSelectObj.selectedIndex;\r\n\t\tvar vSelectedOptionObj = vSelectObj.item(vSelectedIndex);\r\n\t\tvar vSelectedValue = vSelectedOptionObj.value;\r\n\r\n\t\t// Reselect the first item so next time the user can pick the same option to open the add window again.\r\n\t\tvSelectObj.selectedIndex = 0;\r\n\r\n\t\t// Submit the form to the appropriate jsp page.\r\n\t\tvar vFormObj = document.forms(\"addForm\");\r\n\t\tvFormObj.target = \"_blank\";\r\n\t\tvFormObj.action = \"/sfa/control/\" + vSelectedValue + \"?action=");
1283: out.print(UIScreenSection.ACTION_SHOW_INSERT);
1284: out
1285: .write("\";\r\n\t\tvFormObj.submit();\r\n\t}\r\n\r\n\r\n\r\n\tfunction loadHistoryUrl() {\r\n\t\tvar vSelectObj = document.all(\"historySelect\");\r\n\t\tvar vSelectedIndex = vSelectObj.selectedIndex;\r\n\t\tvar vSelectedOptionObj = vSelectObj.item(vSelectedIndex);\r\n\t\tvar vSelectedValue = vSelectedOptionObj.value;\r\n\r\n\t\tif ((vSelectedValue != null)&&(vSelectedValue != \"\")) {\r\n\t\t\t// Submit the form to the appropriate jsp page.\r\n\t\t\tvar vFormObj = document.forms(\"historyForm\");\r\n\t\t\tvFormObj.action = vSelectedValue;\r\n\r\n\t\t\tif (vSelectedValue.indexOf(\"activityPopup\") > 0) {\r\n\t\t\t\tvFormObj.target = \"activityPopup\";\r\n\t\t\t} else {\r\n\t\t\t\tvFormObj.target = \"content\";\r\n\t\t\t}\r\n\r\n\t\t\tvFormObj.submit();\r\n\t\t}\r\n\t}\r\n\r\n");
1286: out.write("</SCRIPT>\r\n\r\n");
1287: out.write("<BODY CLASS=\"bodyform\">\r\n\r\n");
1288: out
1289: .write("<LINK REL=\"stylesheet\" HREF=\"/sfa/includes/maincss.css\" TYPE=\"text/css\">\r\n\r\n");
1290: out
1291: .write("<TABLE WIDTH=\"100%\" CLASS=\"viewManyHeader\" BORDER=1 >\r\n\t");
1292: out.write("<TR>");
1293: out.write("<TD>\r\n\t");
1294: out
1295: .write("<TABLE width=\"100%\" CLASS=\"viewManyHeader\" BORDER=0>\r\n\t ");
1296: out.write("<TR>\r\n\t\t");
1297: out.write("<TD>");
1298: out.write("<p align=\"Left\">");
1299: out
1300: .write("<img border=\"0\" src=\"/sfaimages/sourcetap_logo.gif\" >");
1301: out.write("</p>");
1302: out.write("</TD>\r\n\t\t");
1303: out.write("<TD>Sales Force Automation");
1304: out.write("</TD>\r\n\t\t");
1305: out.write("<TD WIDTH=\"150\" ALIGN=\"center\">\r\n\t\t\t");
1306: out
1307: .write("<FORM METHOD=\"post\" NAME=\"historyForm\" ID=\"historyForm\" ACTION=\"\" TARGET=\"content\">\r\n\t\t\t\t");
1308: out
1309: .write("<SELECT ID=\"historySelect\" NAME=\"historySelect\" MAXLENGTH=\"60\" CLASS=\"selectBox\">\r\n\t\t\t\t\t");
1310: out
1311: .write("<OPTION VALUE=\"\" SELECTED>Click For User History...");
1312: out.write("</OPTION>\r\n\t\t\t\t");
1313: out.write("</SELECT>\r\n\t\t\t");
1314: out.write("</FORM>\r\n\t\t");
1315: out.write("</TD>\r\n\t\t");
1316: out.write("<TD WIDTH=\"120\" ALIGN=\"center\">\r\n\t\t\t");
1317: out
1318: .write("<FORM METHOD=\"post\" NAME=\"addForm\" ID=\"addForm\" ACTION=\"\" TARGET=\"popupWindow\">\r\n\t\t\t\t");
1319: out
1320: .write("<SELECT ID=\"addNewSelect\" NAME=\"addNewSelect\" CLASS=\"addSelectBox\" onChange=\"openAddScreen()\">\r\n\t\t\t\t\t");
1321: out.write("<OPTION VALUE=\"\" SELECTED>New...");
1322: out.write("</OPTION>\r\n\t\t\t\t\t");
1323: out.write("<OPTION VALUE=\"accountPopup\">Account");
1324: out.write("</OPTION>\r\n\t\t\t\t\t");
1325: out.write("<OPTION VALUE=\"activityPopup\">Activity");
1326: out.write("</OPTION>\r\n\t\t\t\t");
1327: out.write("</SELECT>\r\n\t\t\t");
1328: out.write("</FORM>\r\n\t\t");
1329: out.write("</TD>\r\n\t\t");
1330: out.write("<TD width=\"40\" ALIGN=\"center\">");
1331: out.write("<A HREF=\"");
1332: if (_jspx_meth_ofbiz_url_2(pageContext))
1333: return;
1334: out.write("\" TARGET=\"content\">Home");
1335: out.write("</A>");
1336: out.write("</TD>\r\n\t\t");
1337: out.write("<TD width=\"40\" ALIGN=\"center\">");
1338: out.write("<A HREF=\"");
1339: if (_jspx_meth_ofbiz_url_3(pageContext))
1340: return;
1341: out.write("\" TARGET=\"content\">Login");
1342: out.write("</A>");
1343: out.write("</TD>\r\n\t\t");
1344: out.write("<TD width=\"60\" ALIGN=\"center\">");
1345: out.write("<A HREF=\"");
1346: if (_jspx_meth_ofbiz_url_4(pageContext))
1347: return;
1348: out.write("\">Log Out");
1349: out.write("</A>");
1350: out.write("</TD>\r\n\t");
1351: out.write("</TR>\r\n\t");
1352: out.write("</TABLE>\r\n\t");
1353: out.write("</TD>");
1354: out.write("</TR>\r\n");
1355: out.write("</TABLE>\r\n\r\n");
1356: out
1357: .write("<!-- Use the hidden iFrame to update the Assigned To dropdown based on the account selected.-->\r\n");
1358: out
1359: .write("<script for='historySelect' event='onfocus()' language='JavaScript'>\r\n\tsendDropDown(\r\n\t\t'historySelect',\r\n\t\t'url',\r\n\t\t'description',\r\n\t\t'com.sourcetap.sfa.ui.UIHistoryDropDown',\r\n\t\t'',\r\n\t\t'',\r\n\t\tthis.form,\r\n\t\t'');\r\n");
1360: out.write("</script>\r\n");
1361: out
1362: .write("<script for='historySelect' event='onchange()' language='JavaScript'>\r\n\tloadHistoryUrl();\r\n");
1363: out.write("</script>\r\n\r\n\r\n\r\n\r\n\r\n");
1364: out
1365: .write("<!-- used to get dynamic information from a server -->\r\n");
1366: out
1367: .write("<A style='visibility:hidden' id='searchA' name='searchA' target=\"searchIFrame\">");
1368: out.write("</A>\r\n");
1369: out
1370: .write("<iframe style='visibility:hidden; width:0; height:0; margin:0; padding:0;' id='searchIFrame' name='searchIFrame' FRAMEBORDER=0 FRAMESPACING=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload='updateForm();' >");
1371: out.write("</iframe>\r\n");
1372: out.write("<!--");
1373: out
1374: .write("<iframe id='searchIFrame' name='searchIFrame' WIDTH=\"100%\" onload='updateForm();' >");
1375: out.write("</iframe>-->\r\n\r\n");
1376: out.write("</BODY>\r\n");
1377: } catch (Throwable t) {
1378: out = _jspx_out;
1379: if (out != null && out.getBufferSize() != 0)
1380: out.clearBuffer();
1381: if (pageContext != null)
1382: pageContext.handlePageException(t);
1383: } finally {
1384: if (_jspxFactory != null)
1385: _jspxFactory.releasePageContext(pageContext);
1386: }
1387: }
1388:
1389: private boolean _jspx_meth_ofbiz_url_0(
1390: javax.servlet.jsp.PageContext pageContext) throws Throwable {
1391: JspWriter out = pageContext.getOut();
1392: /* ---- ofbiz:url ---- */
1393: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_0 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1394: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1395: _jspx_th_ofbiz_url_0.setPageContext(pageContext);
1396: _jspx_th_ofbiz_url_0.setParent(null);
1397: int _jspx_eval_ofbiz_url_0 = _jspx_th_ofbiz_url_0.doStartTag();
1398: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1399: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1400: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1401: .pushBody();
1402: out = _bc;
1403: _jspx_th_ofbiz_url_0.setBodyContent(_bc);
1404: _jspx_th_ofbiz_url_0.doInitBody();
1405: }
1406: do {
1407: out.write("/testServer");
1408: int evalDoAfterBody = _jspx_th_ofbiz_url_0
1409: .doAfterBody();
1410: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1411: break;
1412: } while (true);
1413: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1414: out = pageContext.popBody();
1415: }
1416: if (_jspx_th_ofbiz_url_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1417: return true;
1418: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_0);
1419: return false;
1420: }
1421:
1422: private boolean _jspx_meth_ofbiz_url_1(
1423: javax.servlet.jsp.PageContext pageContext) throws Throwable {
1424: JspWriter out = pageContext.getOut();
1425: /* ---- ofbiz:url ---- */
1426: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_1 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1427: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1428: _jspx_th_ofbiz_url_1.setPageContext(pageContext);
1429: _jspx_th_ofbiz_url_1.setParent(null);
1430: int _jspx_eval_ofbiz_url_1 = _jspx_th_ofbiz_url_1.doStartTag();
1431: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1432: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1433: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1434: .pushBody();
1435: out = _bc;
1436: _jspx_th_ofbiz_url_1.setBodyContent(_bc);
1437: _jspx_th_ofbiz_url_1.doInitBody();
1438: }
1439: do {
1440: out.write("/testServer");
1441: int evalDoAfterBody = _jspx_th_ofbiz_url_1
1442: .doAfterBody();
1443: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1444: break;
1445: } while (true);
1446: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1447: out = pageContext.popBody();
1448: }
1449: if (_jspx_th_ofbiz_url_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1450: return true;
1451: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_1);
1452: return false;
1453: }
1454:
1455: private boolean _jspx_meth_ofbiz_url_2(
1456: javax.servlet.jsp.PageContext pageContext) throws Throwable {
1457: JspWriter out = pageContext.getOut();
1458: /* ---- ofbiz:url ---- */
1459: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_2 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1460: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1461: _jspx_th_ofbiz_url_2.setPageContext(pageContext);
1462: _jspx_th_ofbiz_url_2.setParent(null);
1463: int _jspx_eval_ofbiz_url_2 = _jspx_th_ofbiz_url_2.doStartTag();
1464: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1465: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1466: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1467: .pushBody();
1468: out = _bc;
1469: _jspx_th_ofbiz_url_2.setBodyContent(_bc);
1470: _jspx_th_ofbiz_url_2.doInitBody();
1471: }
1472: do {
1473: out.write("/checkLogin/frontpage");
1474: int evalDoAfterBody = _jspx_th_ofbiz_url_2
1475: .doAfterBody();
1476: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1477: break;
1478: } while (true);
1479: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1480: out = pageContext.popBody();
1481: }
1482: if (_jspx_th_ofbiz_url_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1483: return true;
1484: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_2);
1485: return false;
1486: }
1487:
1488: private boolean _jspx_meth_ofbiz_url_3(
1489: javax.servlet.jsp.PageContext pageContext) throws Throwable {
1490: JspWriter out = pageContext.getOut();
1491: /* ---- ofbiz:url ---- */
1492: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_3 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1493: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1494: _jspx_th_ofbiz_url_3.setPageContext(pageContext);
1495: _jspx_th_ofbiz_url_3.setParent(null);
1496: int _jspx_eval_ofbiz_url_3 = _jspx_th_ofbiz_url_3.doStartTag();
1497: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1498: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1499: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1500: .pushBody();
1501: out = _bc;
1502: _jspx_th_ofbiz_url_3.setBodyContent(_bc);
1503: _jspx_th_ofbiz_url_3.doInitBody();
1504: }
1505: do {
1506: out.write("/checkLogin/frontpage");
1507: int evalDoAfterBody = _jspx_th_ofbiz_url_3
1508: .doAfterBody();
1509: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1510: break;
1511: } while (true);
1512: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1513: out = pageContext.popBody();
1514: }
1515: if (_jspx_th_ofbiz_url_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1516: return true;
1517: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_3);
1518: return false;
1519: }
1520:
1521: private boolean _jspx_meth_ofbiz_url_4(
1522: javax.servlet.jsp.PageContext pageContext) throws Throwable {
1523: JspWriter out = pageContext.getOut();
1524: /* ---- ofbiz:url ---- */
1525: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_4 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
1526: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
1527: _jspx_th_ofbiz_url_4.setPageContext(pageContext);
1528: _jspx_th_ofbiz_url_4.setParent(null);
1529: int _jspx_eval_ofbiz_url_4 = _jspx_th_ofbiz_url_4.doStartTag();
1530: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
1531: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
1532: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
1533: .pushBody();
1534: out = _bc;
1535: _jspx_th_ofbiz_url_4.setBodyContent(_bc);
1536: _jspx_th_ofbiz_url_4.doInitBody();
1537: }
1538: do {
1539: out.write("/logout/frontpage");
1540: int evalDoAfterBody = _jspx_th_ofbiz_url_4
1541: .doAfterBody();
1542: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
1543: break;
1544: } while (true);
1545: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
1546: out = pageContext.popBody();
1547: }
1548: if (_jspx_th_ofbiz_url_4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
1549: return true;
1550: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_4);
1551: return false;
1552: }
1553: }
|