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.entity.*;
0009: import org.ofbiz.entity.condition.*;
0010: import org.ofbiz.security.*;
0011: import com.sourcetap.sfa.activity.*;
0012: import java.util.*;
0013: import java.text.*;
0014: import com.sourcetap.sfa.ui.UIScreenSection;
0015: import com.sourcetap.sfa.code.CodeHelper;
0016: import com.sourcetap.sfa.activity.CalendarUtil;
0017: import java.util.Date;
0018: import java.util.List;
0019: import java.util.Map;
0020: import java.util.Vector;
0021: import java.util.ArrayList;
0022: import java.util.Enumeration;
0023: import java.util.Iterator;
0024: import java.util.HashMap;
0025: import java.util.Calendar;
0026: import java.util.StringTokenizer;
0027: import java.text.SimpleDateFormat;
0028: import java.text.DecimalFormat;
0029: import java.text.ParseException;
0030: import java.sql.Timestamp;
0031: import java.sql.Time;
0032: import java.sql.*;
0033: import org.ofbiz.entity.util.SequenceUtil;
0034: import org.ofbiz.security.*;
0035: import org.ofbiz.entity.*;
0036: import org.ofbiz.entity.condition.*;
0037: import org.ofbiz.entity.model.*;
0038: import org.ofbiz.base.util.*;
0039: import com.sourcetap.sfa.ui.*;
0040: import com.sourcetap.sfa.event.*;
0041: import com.sourcetap.sfa.util.UserInfo;
0042: import org.ofbiz.base.util.*;
0043:
0044: public class frontPage_jsp extends HttpJspBase {
0045:
0046: /*
0047: * Takes a string in the following format:
0048: * formatString
0049: * Where the first letter is lowercase, and
0050: * subsequent unique words begin with an upper case.
0051: * The function will convert a java string to a regular
0052: * string in title case format.
0053: */
0054: String formatJavaString(String s) {
0055: char ca[] = s.toCharArray();
0056: StringBuffer sb = new StringBuffer();
0057: int previous = 0;
0058: for (int i = 0; i < ca.length; i++) {
0059: if (i == s.length() - 1) {
0060: sb.append(s.substring(previous, previous + 1)
0061: .toUpperCase());
0062: sb.append(s.substring(previous + 1, s.length()));
0063: }
0064: if (Character.isUpperCase(ca[i])) {
0065: sb.append(s.substring(previous, previous + 1)
0066: .toUpperCase());
0067: sb.append(s.substring(previous + 1, i));
0068: sb.append(" ");
0069: previous = i;
0070: }
0071: }
0072: return sb.toString();
0073: }
0074:
0075: /**
0076: Properties must include:
0077: NAME-name of the select used in name-value form submit.
0078: VALUE_FIELD-the value sent in form submit.
0079: DISPLAY_FIELD-the field used in the display of the drop-down. use a
0080: Properties can include:
0081: Selected-The value to test for, and set selected on the drop-down
0082: EMPTY_FIRST: if just a blank field use "{field display vaalue}, else if value supplied use "{field value}, {field value display name}"
0083: */
0084: String buildDropDown(List l, Map properties) {
0085: StringBuffer returnString = new StringBuffer();
0086: GenericValue genericValue = null;
0087: Iterator i = l.iterator();
0088: String selected = ((String) (properties.get("SELECTED") != null ? properties
0089: .get("SELECTED")
0090: : ""));
0091: String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0092: .get("DISPLAY_FIELD")
0093: : ""));
0094: String selectJavaScript = ((String) (properties
0095: .get("SELECT_JAVASCRIPT") != null ? properties
0096: .get("SELECT_JAVASCRIPT") : ""));
0097: returnString.append("<select name=\"" + properties.get("NAME")
0098: + "\" " + selectJavaScript + " >");
0099: if (properties.get("EMPTY_FIRST") != null) {
0100: String empty = (String) properties.get("EMPTY_FIRST");
0101: if (empty.indexOf(",") != -1) {
0102: StringTokenizer tok = new StringTokenizer(empty, ",");
0103: returnString.append("<option value=\""
0104: + ((String) tok.nextElement()).trim() + "\">"
0105: + ((String) tok.nextElement()).trim());
0106: } else {
0107: returnString.append("<option value=\"\">" + empty);
0108: }
0109: }
0110: try {
0111: while (i.hasNext()) {
0112: genericValue = (GenericValue) i.next();
0113: returnString.append("<option value=\""
0114: + String.valueOf(genericValue
0115: .get((String) properties
0116: .get("VALUE_FIELD"))) + "\"");
0117: if (String.valueOf(
0118: genericValue.get((String) properties
0119: .get("VALUE_FIELD"))).equals(selected)) {
0120: returnString.append(" SELECTED ");
0121: }
0122: returnString.append(" >");
0123: if (display.indexOf(",") != -1) {
0124: StringTokenizer tok = new StringTokenizer(display,
0125: ",");
0126: while (tok.hasMoreElements()) {
0127: String elem = (String) tok.nextElement();
0128: returnString.append(String.valueOf(genericValue
0129: .get(elem.trim())));
0130: returnString.append(" ");
0131: }
0132: } else {
0133: returnString.append(genericValue.get(display));
0134: }
0135: }
0136: } catch (Exception e) {
0137: e.printStackTrace();
0138: }
0139: returnString.append("</select>");
0140: return returnString.toString();
0141: }
0142:
0143: String buildStringDropDown(List l, Map properties) {
0144: StringBuffer returnString = new StringBuffer();
0145: String value = "";
0146: Iterator i = l.iterator();
0147: String selected = ((String) (properties.get("SELECTED") != null ? properties
0148: .get("SELECTED")
0149: : ""));
0150: String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0151: .get("DISPLAY_FIELD")
0152: : ""));
0153: String selectJavaScript = ((String) (properties
0154: .get("SELECT_JAVASCRIPT") != null ? properties
0155: .get("SELECT_JAVASCRIPT") : ""));
0156: returnString.append("<select name=\"" + properties.get("NAME")
0157: + "\" " + selectJavaScript + " >");
0158: if (properties.get("EMPTY_FIRST") != null) {
0159: String empty = (String) properties.get("EMPTY_FIRST");
0160: if (empty.indexOf(",") != -1) {
0161: StringTokenizer tok = new StringTokenizer(empty, ",");
0162: returnString.append("<option value=\""
0163: + ((String) tok.nextElement()).trim() + "\">"
0164: + ((String) tok.nextElement()).trim());
0165: } else {
0166: returnString.append("<option value=\"\">" + empty);
0167: }
0168: }
0169: while (i.hasNext()) {
0170: value = (String) i.next();
0171: returnString.append("<option value=\"" + value + "\"");
0172: if (value.equals(selected)) {
0173: returnString.append(" SELECTED ");
0174: }
0175: returnString.append(" >");
0176: if (display.indexOf(",") != -1) {
0177: StringTokenizer tok = new StringTokenizer(display, ",");
0178: while (tok.hasMoreElements()) {
0179: String elem = (String) tok.nextElement();
0180: returnString.append(value);
0181: returnString.append(" ");
0182: }
0183: } else {
0184: returnString.append(value);
0185: }
0186: }
0187: returnString.append("</select>");
0188: return returnString.toString();
0189: }
0190:
0191: String buildFieldDropDown(Vector fields, String entityName,
0192: HashMap properties) {
0193: if (properties == null)
0194: properties = new HashMap();
0195: StringBuffer returnString = new StringBuffer();
0196: ModelField modelField = null;
0197: String selected = ((String) (properties.get("SELECTED") != null ? properties
0198: .get("SELECTED")
0199: : ""));
0200: returnString.append("<select name=\"" + entityName + "\" >");
0201: if (properties.get("EMPTY_FIRST") != null)
0202: returnString.append("<option value=\"\">"
0203: + properties.get("EMPTY_FIRST"));
0204: for (int i = 0; i < fields.size(); i++) {
0205: modelField = (ModelField) fields.get(i);
0206: returnString.append("<option value=\""
0207: + modelField.getName() + "\"");
0208: if ((modelField.getName()).equals(selected)) {
0209: returnString.append(" SELECTED ");
0210: }
0211: returnString.append(" >"
0212: + formatJavaString(modelField.getName()));
0213: }
0214: returnString.append("</select>");
0215: return returnString.toString();
0216: }
0217:
0218: /**
0219: * Checks a List of fields to see if the string
0220: * that is passed in exists in the vector. If so,
0221: * it returns the ModelField for the named field, else
0222: * it returns null.
0223: */
0224: ModelField contains(List v, String s) {
0225: ModelField field;
0226: for (int i = 0; i < v.size(); i++) {
0227: field = (ModelField) v.get(i);
0228: if (field.getName().equals(s))
0229: return field;
0230: }
0231: return null;
0232: }
0233:
0234: String buildUIFieldDropDown(String sectionName, List fields,
0235: String entityName, HashMap properties) {
0236: if (properties == null)
0237: properties = new HashMap();
0238: StringBuffer returnString = new StringBuffer();
0239: UIFieldInfo fieldInfo = null;
0240: String selected = ((String) (properties.get("SELECTED") != null ? properties
0241: .get("SELECTED")
0242: : ""));
0243: returnString.append("<select name=\"" + entityName + "\" >");
0244: if (properties.get("EMPTY_FIRST") != null)
0245: returnString.append("<option value=\"\">"
0246: + properties.get("EMPTY_FIRST"));
0247: for (int i = 0; i < fields.size(); i++) {
0248: fieldInfo = (UIFieldInfo) fields.get(i);
0249: if (fieldInfo.getIsVisible() && !fieldInfo.getIsReadOnly()) {
0250: String attrId = UIWebUtility.getHtmlName(sectionName,
0251: fieldInfo, 0);
0252: String attrName = fieldInfo.getDisplayLabel();
0253: returnString.append("<option value=\"" + attrId + "\"");
0254: if (attrName.equals(selected)) {
0255: returnString.append(" SELECTED ");
0256: }
0257: returnString.append(" >" + attrName);
0258: }
0259: }
0260: returnString.append("</select>");
0261: return returnString.toString();
0262: }
0263:
0264: /**
0265: * Given a ModelField and a value, this function checks the datatype for the field, and
0266: * converts the value to the correct datatype.
0267: */
0268: GenericValue setCorrectDataType(GenericValue entity,
0269: ModelField curField, String value) {
0270: ModelFieldTypeReader modelFieldTypeReader = new ModelFieldTypeReader(
0271: "mysql");
0272: ModelFieldType mft = modelFieldTypeReader
0273: .getModelFieldType(curField.getType());
0274: String fieldType = mft.getJavaType();
0275: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
0276: SimpleDateFormat timeFormat = new SimpleDateFormat(
0277: "yyyy-MM-dd hh:mm a");
0278:
0279: if (fieldType.equals("java.lang.String")
0280: || fieldType.equals("String")) {
0281: if (mft.getType().equals("indicator")) {
0282: if (value.equals("on"))
0283: entity.set(curField.getName(), "Y");
0284: else if (value.equals("off"))
0285: entity.set(curField.getName(), "N");
0286: else
0287: entity.set(curField.getName(), value);
0288: } else
0289: entity.set(curField.getName(), value);
0290: } else if (fieldType.equals("java.sql.Timestamp")
0291: || fieldType.equals("Timestamp")) {
0292: if (value.trim().length() == 0) {
0293: entity.set(curField.getName(), null);
0294: } else {
0295: try {
0296: entity.set(curField.getName(), new Timestamp(
0297: timeFormat.parse(value).getTime()));
0298: } catch (ParseException e) {
0299: e.printStackTrace();
0300: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0301: }
0302: } else if (fieldType.equals("java.sql.Time")
0303: || fieldType.equals("Time")) {
0304: if (value.trim().length() == 0) {
0305: entity.set(curField.getName(), null);
0306: } else {
0307: try {
0308: entity.set(curField.getName(), new Time(timeFormat
0309: .parse(value).getTime()));
0310: } catch (ParseException e) {
0311: e.printStackTrace();
0312: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0313: }
0314: } else if (fieldType.equals("java.util.Date")) {
0315: if (value.trim().length() == 0) {
0316: entity.set(curField.getName(), null);
0317: } else {
0318: try {
0319: entity.set(curField.getName(), new java.sql.Date(
0320: dateFormat.parse(value).getTime()));
0321: } catch (ParseException e) {
0322: e.printStackTrace();
0323: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0324: }
0325: } else if (fieldType.equals("java.sql.Date")
0326: || fieldType.equals("Date")) {
0327: if (value.trim().length() == 0) {
0328: entity.set(curField.getName(), null);
0329: } else {
0330: try {
0331: entity.set(curField.getName(), new java.sql.Date(
0332: dateFormat.parse(value).getTime()));
0333: } catch (ParseException e) {
0334: e.printStackTrace();
0335: } //WTD: Implement error processing for ParseException. i.e. get rid of the printStackTrace()
0336: }
0337: } else if (fieldType.equals("java.lang.Integer")
0338: || fieldType.equals("Integer")) {
0339: if (value.trim().length() == 0)
0340: value = "0";
0341: entity.set(curField.getName(), Integer.valueOf(value));
0342: } else if (fieldType.equals("java.lang.Long")
0343: || fieldType.equals("Long")) {
0344: if (value.trim().length() == 0)
0345: value = "0";
0346: entity.set(curField.getName(), Long.valueOf(value));
0347: } else if (fieldType.equals("java.lang.Float")
0348: || fieldType.equals("Float")) {
0349: if (value.trim().length() == 0)
0350: value = "0.0";
0351: entity.set(curField.getName(), Float.valueOf(value));
0352: } else if (fieldType.equals("java.lang.Double")
0353: || fieldType.equals("Double")) {
0354: if (value.trim().length() == 0 || value == null)
0355: value = "0";
0356: entity.set(curField.getName(), Double.valueOf(value));
0357: }
0358: return entity;
0359: }
0360:
0361: String getFieldValue(List l, String fieldName, String equalsValue,
0362: String returnFieldName) {
0363: Iterator i = l.iterator();
0364: GenericEntity genericEntity = null;
0365: String retVal = "";
0366: //TODO: add StringTokenizer to parse multiple fields.
0367: while (i.hasNext()) {
0368: genericEntity = (GenericValue) i.next();
0369: if (String.valueOf(genericEntity.get(fieldName)).equals(
0370: equalsValue))
0371: retVal = String.valueOf(genericEntity
0372: .get(returnFieldName));
0373: }
0374: return retVal;
0375: }
0376:
0377: String getFieldValue(HttpServletRequest request, String fieldName) {
0378: return (request.getParameter(fieldName) != null ? request
0379: .getParameter(fieldName) : "");
0380: }
0381:
0382: Vector getGenericValue(List l, String fieldName, String equalsValue) {
0383: Vector returnVector = new Vector();
0384: GenericValue genericValue = null;
0385: GenericValue genericValues[] = (GenericValue[]) l
0386: .toArray(new GenericValue[0]);
0387: for (int i = 0; i < genericValues.length; i++) {
0388: genericValue = (GenericValue) genericValues[i];
0389: if (String.valueOf(genericValue.get(fieldName)).equals(
0390: equalsValue))
0391: returnVector.add(genericValue);
0392: }
0393: return returnVector;
0394: }
0395:
0396: String getDateTimeFieldValue(List l, String fieldName,
0397: String equalsValue, String returnFieldName,
0398: String dateFormatString) {
0399: GenericValue genericValue = null;
0400: GenericValue genericValues[] = (GenericValue[]) l
0401: .toArray(new GenericValue[0]);
0402: String retVal = "";
0403: SimpleDateFormat dateFormat = new SimpleDateFormat(
0404: dateFormatString);
0405: for (int i = 0; i < genericValues.length; i++) {
0406: genericValue = genericValues[i];
0407: try {
0408: if (dateFormat.parse(genericValue.getString(fieldName))
0409: .equals(dateFormat.parse(equalsValue)))
0410: retVal = String.valueOf(genericValue
0411: .get(returnFieldName));
0412: } catch (ParseException e) {
0413: e.printStackTrace();
0414: }
0415: }
0416: return retVal;
0417: }
0418:
0419: Vector getDateTimeGenericValue(List l, String fieldName,
0420: String equalsValue, String dateFormatString) {
0421: Vector returnVector = new Vector();
0422: GenericValue genericValue = null;
0423: GenericValue genericValues[] = (GenericValue[]) l
0424: .toArray(new GenericValue[0]);
0425: String retVal = "";
0426: SimpleDateFormat dateFormat = new SimpleDateFormat(
0427: dateFormatString);
0428: for (int i = 0; i < genericValues.length; i++) {
0429: genericValue = genericValues[i];
0430: try {
0431: if (dateFormat.parse(genericValue.getString(fieldName))
0432: .equals(dateFormat.parse(equalsValue)))
0433: returnVector.add(genericValue);
0434: } catch (ParseException e) {
0435: e.printStackTrace();
0436: }
0437: }
0438: return returnVector;
0439: }
0440:
0441: String getStatesDropDown(String name, String selected) {
0442: if (name == null)
0443: return null;
0444: StringBuffer returnString = new StringBuffer();
0445: returnString.append("<select class=\"\" name=\"" + name
0446: + "\" >");
0447: returnString.append("<option "
0448: + (selected == null || selected.equals("") ? "selected"
0449: : "") + " >");
0450: returnString
0451: .append("<option "
0452: + (selected != null && selected.equals("AK") ? "selected"
0453: : "") + " >AK");
0454: returnString
0455: .append("<option"
0456: + (selected != null
0457: && selected.equalsIgnoreCase("AL") ? " selected"
0458: : "") + ">AL");
0459: returnString
0460: .append("<option"
0461: + (selected != null
0462: && selected.equalsIgnoreCase("AR") ? " selected"
0463: : "") + ">AR");
0464: returnString
0465: .append("<option"
0466: + (selected != null
0467: && selected.equalsIgnoreCase("AZ") ? " selected"
0468: : "") + ">AZ");
0469: returnString
0470: .append("<option"
0471: + (selected != null
0472: && selected.equalsIgnoreCase("CA") ? " selected"
0473: : "") + ">CA");
0474: returnString
0475: .append("<option"
0476: + (selected != null
0477: && selected.equalsIgnoreCase("CO") ? " selected"
0478: : "") + ">CO");
0479: returnString
0480: .append("<option"
0481: + (selected != null
0482: && selected.equalsIgnoreCase("CT") ? " selected"
0483: : "") + ">CT");
0484: returnString
0485: .append("<option"
0486: + (selected != null
0487: && selected.equalsIgnoreCase("DC") ? " selected"
0488: : "") + ">DC");
0489: returnString
0490: .append("<option"
0491: + (selected != null
0492: && selected.equalsIgnoreCase("DE") ? " selected"
0493: : "") + ">DE");
0494: returnString
0495: .append("<option"
0496: + (selected != null
0497: && selected.equalsIgnoreCase("FL") ? " selected"
0498: : "") + ">FL");
0499: returnString
0500: .append("<option"
0501: + (selected != null
0502: && selected.equalsIgnoreCase("GA") ? " selected"
0503: : "") + ">GA");
0504: returnString
0505: .append("<option"
0506: + (selected != null
0507: && selected.equalsIgnoreCase("GU") ? " selected"
0508: : "") + ">GU");
0509: returnString
0510: .append("<option"
0511: + (selected != null
0512: && selected.equalsIgnoreCase("HI") ? " selected"
0513: : "") + ">HI");
0514: returnString
0515: .append("<option"
0516: + (selected != null
0517: && selected.equalsIgnoreCase("IA") ? " selected"
0518: : "") + ">IA");
0519: returnString
0520: .append("<option"
0521: + (selected != null
0522: && selected.equalsIgnoreCase("ID") ? " selected"
0523: : "") + ">ID");
0524: returnString
0525: .append("<option"
0526: + (selected != null
0527: && selected.equalsIgnoreCase("IL") ? " selected"
0528: : "") + ">IL");
0529: returnString
0530: .append("<option"
0531: + (selected != null
0532: && selected.equalsIgnoreCase("IN") ? " selected"
0533: : "") + ">IN");
0534: returnString
0535: .append("<option"
0536: + (selected != null
0537: && selected.equalsIgnoreCase("KS") ? " selected"
0538: : "") + ">KS");
0539: returnString
0540: .append("<option"
0541: + (selected != null
0542: && selected.equalsIgnoreCase("KY") ? " selected"
0543: : "") + ">KY");
0544: returnString
0545: .append("<option"
0546: + (selected != null
0547: && selected.equalsIgnoreCase("LA") ? " selected"
0548: : "") + ">LA");
0549: returnString
0550: .append("<option"
0551: + (selected != null
0552: && selected.equalsIgnoreCase("MA") ? " selected"
0553: : "") + ">MA");
0554: returnString
0555: .append("<option"
0556: + (selected != null
0557: && selected.equalsIgnoreCase("MD") ? " selected"
0558: : "") + ">MD");
0559: returnString
0560: .append("<option"
0561: + (selected != null
0562: && selected.equalsIgnoreCase("ME") ? " selected"
0563: : "") + ">ME");
0564: returnString
0565: .append("<option"
0566: + (selected != null
0567: && selected.equalsIgnoreCase("MI") ? " selected"
0568: : "") + ">MI");
0569: returnString
0570: .append("<option"
0571: + (selected != null
0572: && selected.equalsIgnoreCase("MN") ? " selected"
0573: : "") + ">MN");
0574: returnString
0575: .append("<option"
0576: + (selected != null
0577: && selected.equalsIgnoreCase("MO") ? " selected"
0578: : "") + ">MO");
0579: returnString
0580: .append("<option"
0581: + (selected != null
0582: && selected.equalsIgnoreCase("MS") ? " selected"
0583: : "") + ">MS");
0584: returnString
0585: .append("<option"
0586: + (selected != null
0587: && selected.equalsIgnoreCase("MT") ? " selected"
0588: : "") + ">MT");
0589: returnString
0590: .append("<option"
0591: + (selected != null
0592: && selected.equalsIgnoreCase("NC") ? " selected"
0593: : "") + ">NC");
0594: returnString
0595: .append("<option"
0596: + (selected != null
0597: && selected.equalsIgnoreCase("ND") ? " selected"
0598: : "") + ">ND");
0599: returnString
0600: .append("<option"
0601: + (selected != null
0602: && selected.equalsIgnoreCase("NE") ? " selected"
0603: : "") + ">NE");
0604: returnString
0605: .append("<option"
0606: + (selected != null
0607: && selected.equalsIgnoreCase("NH") ? " selected"
0608: : "") + ">NH");
0609: returnString
0610: .append("<option"
0611: + (selected != null
0612: && selected.equalsIgnoreCase("NJ") ? " selected"
0613: : "") + ">NJ");
0614: returnString
0615: .append("<option"
0616: + (selected != null
0617: && selected.equalsIgnoreCase("NM") ? " selected"
0618: : "") + ">NM");
0619: returnString
0620: .append("<option"
0621: + (selected != null
0622: && selected.equalsIgnoreCase("NV") ? " selected"
0623: : "") + ">NV");
0624: returnString
0625: .append("<option"
0626: + (selected != null
0627: && selected.equalsIgnoreCase("NY") ? " selected"
0628: : "") + ">NY");
0629: returnString
0630: .append("<option"
0631: + (selected != null
0632: && selected.equalsIgnoreCase("OH") ? " selected"
0633: : "") + ">OH");
0634: returnString
0635: .append("<option"
0636: + (selected != null
0637: && selected.equalsIgnoreCase("OK") ? " selected"
0638: : "") + ">OK");
0639: returnString
0640: .append("<option"
0641: + (selected != null
0642: && selected.equalsIgnoreCase("OR") ? " selected"
0643: : "") + ">OR");
0644: returnString
0645: .append("<option"
0646: + (selected != null
0647: && selected.equalsIgnoreCase("PA") ? " selected"
0648: : "") + ">PA");
0649: returnString
0650: .append("<option"
0651: + (selected != null
0652: && selected.equalsIgnoreCase("PR") ? " selected"
0653: : "") + ">PR");
0654: returnString
0655: .append("<option"
0656: + (selected != null
0657: && selected.equalsIgnoreCase("RI") ? " selected"
0658: : "") + ">RI");
0659: returnString
0660: .append("<option"
0661: + (selected != null
0662: && selected.equalsIgnoreCase("SC") ? " selected"
0663: : "") + ">SC");
0664: returnString
0665: .append("<option"
0666: + (selected != null
0667: && selected.equalsIgnoreCase("SD") ? " selected"
0668: : "") + ">SD");
0669: returnString
0670: .append("<option"
0671: + (selected != null
0672: && selected.equalsIgnoreCase("TN") ? " selected"
0673: : "") + ">TN");
0674: returnString
0675: .append("<option"
0676: + (selected != null
0677: && selected.equalsIgnoreCase("TX") ? " selected"
0678: : "") + ">TX");
0679: returnString
0680: .append("<option"
0681: + (selected != null
0682: && selected.equalsIgnoreCase("UT") ? " selected"
0683: : "") + ">UT");
0684: returnString
0685: .append("<option"
0686: + (selected != null
0687: && selected.equalsIgnoreCase("VA") ? " selected"
0688: : "") + ">VA");
0689: returnString
0690: .append("<option"
0691: + (selected != null
0692: && selected.equalsIgnoreCase("VI") ? " selected"
0693: : "") + ">VI");
0694: returnString
0695: .append("<option"
0696: + (selected != null
0697: && selected.equalsIgnoreCase("VT") ? " selected"
0698: : "") + ">VT");
0699: returnString
0700: .append("<option"
0701: + (selected != null
0702: && selected.equalsIgnoreCase("WA") ? " selected"
0703: : "") + ">WA");
0704: returnString
0705: .append("<option"
0706: + (selected != null
0707: && selected.equalsIgnoreCase("WI") ? " selected"
0708: : "") + ">WI");
0709: returnString
0710: .append("<option"
0711: + (selected != null
0712: && selected.equalsIgnoreCase("WV") ? " selected"
0713: : "") + ">WV");
0714: returnString
0715: .append("<option"
0716: + (selected != null
0717: && selected.equalsIgnoreCase("WY") ? " selected"
0718: : "") + ">WY");
0719: returnString.append("</select>");
0720: return returnString.toString();
0721: }
0722:
0723: int daysSinceLastSale(String ownerId, int daysFromHire,
0724: GenericDelegator delegator) throws GenericEntityException {
0725: //find last sale
0726: Calendar lastSale = Calendar.getInstance();
0727: HashMap fields = new HashMap();
0728: fields.put("dealStatusId", "10"); //Sold
0729: fields.put("ownerId", ownerId);
0730: ArrayList order = new ArrayList();
0731: order.add("actualCloseDate");
0732: order.add("DESC");
0733: List deals = delegator.findByAnd("Deal", fields, order);
0734: if (deals.size() >= 1) {
0735: GenericValue details[] = (GenericValue[]) deals
0736: .toArray(new GenericValue[0]);
0737: GenericValue deal = details[deals.size() - 1];
0738: lastSale.setTime(deal.getDate("actualCloseDate"));
0739: } else {
0740: // No sales yet. Return the number of days since hire.
0741: return daysFromHire;
0742: }
0743: //calc time since last sale
0744: int returnInt = CalendarUtil.differenceBetweenDates(lastSale,
0745: Calendar.getInstance(), Calendar.DAY_OF_YEAR);
0746: return returnInt;
0747: }
0748:
0749: int daysSinceLastLeadConversion(String ownerId, int daysFromHire,
0750: GenericDelegator delegator) throws GenericEntityException {
0751: // Find last lead conversion
0752: Calendar lastLeadConversion = Calendar.getInstance();
0753: HashMap fields = new HashMap();
0754: fields.put("statusId", "50"); // Converted
0755: fields.put("leadOwnerId", ownerId);
0756: ArrayList order = new ArrayList();
0757: order.add("convertedDate");
0758: order.add("DESC");
0759: List leadL = delegator.findByAnd("Lead", fields, order);
0760: if (leadL.size() >= 1) {
0761: GenericValue details[] = (GenericValue[]) leadL
0762: .toArray(new GenericValue[0]);
0763: GenericValue leadGV = details[leadL.size() - 1];
0764: lastLeadConversion.setTime(leadGV
0765: .getTimestamp("convertedDate"));
0766: } else {
0767: // No lead conversions yet. Return the number of days since hire.
0768: return daysFromHire;
0769: }
0770: // Calc time since last conversion
0771: int returnInt = CalendarUtil.differenceBetweenDates(
0772: lastLeadConversion, Calendar.getInstance(),
0773: Calendar.DAY_OF_YEAR);
0774: return returnInt;
0775: }
0776:
0777: double calculateYearlyQuota(String partyId,
0778: GenericDelegator delegator) throws GenericEntityException {
0779: double yearlyQuotaAmount = 0.0;
0780: HashMap fields = new HashMap();
0781: fields.put("year", String.valueOf(Calendar.getInstance().get(
0782: Calendar.YEAR)));
0783: fields.put("contactId", partyId);
0784: List forecastL = delegator.findByAnd("Forecast", fields);
0785: Iterator forecastI = forecastL.iterator();
0786: while (forecastI.hasNext()) {
0787: GenericValue forecastGV = (GenericValue) forecastI.next();
0788: double quotaAmount = forecastGV.getDouble("quotaAmount") == null ? 0.0
0789: : forecastGV.getDouble("quotaAmount").doubleValue();
0790: yearlyQuotaAmount += quotaAmount;
0791: }
0792: return yearlyQuotaAmount;
0793: }
0794:
0795: double calculateYearlySales(String ownerId,
0796: GenericDelegator delegator) throws GenericEntityException {
0797: double actual = 0.0;
0798:
0799: Calendar start = Calendar.getInstance();
0800: start.set(Calendar.MONTH, Calendar.JANUARY);
0801: start.set(Calendar.DAY_OF_MONTH, 1);
0802:
0803: Calendar end = Calendar.getInstance();
0804: end.set(Calendar.MONTH, Calendar.DECEMBER);
0805: end.set(Calendar.DAY_OF_MONTH, 31);
0806:
0807: ArrayList list = new ArrayList();
0808: list.add(new EntityExpr("dealStatusId", EntityOperator.EQUALS,
0809: "10")); // Sold
0810: list.add(new EntityExpr("ownerId", EntityOperator.EQUALS,
0811: ownerId));
0812: list.add(new EntityExpr("actualCloseDate",
0813: EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date(
0814: end.getTime().getTime())));
0815: list.add(new EntityExpr("actualCloseDate",
0816: EntityOperator.GREATER_THAN_EQUAL_TO,
0817: new java.sql.Date(start.getTime().getTime())));
0818:
0819: List opps = delegator.findByAnd("Deal", list, null);
0820: GenericValue oppDetails[] = (GenericValue[]) opps
0821: .toArray(new GenericValue[0]);
0822: GenericValue oppDetail;
0823: for (int i = 0; i < oppDetails.length; i++) {
0824: oppDetail = oppDetails[i];
0825: actual = actual
0826: + oppDetail.getDouble("amount").doubleValue();
0827: }
0828: return actual;
0829: }
0830:
0831: double calculateYearlyExpenses(String ownerId,
0832: GenericDelegator delegator) throws GenericEntityException {
0833: double actual = 0.0;
0834:
0835: Calendar start = Calendar.getInstance();
0836: start.set(Calendar.MONTH, Calendar.JANUARY);
0837: start.set(Calendar.DAY_OF_MONTH, 1);
0838:
0839: Calendar end = Calendar.getInstance();
0840: end.set(Calendar.MONTH, Calendar.DECEMBER);
0841: end.set(Calendar.DAY_OF_MONTH, 31);
0842:
0843: ArrayList list = new ArrayList();
0844: list.add(new EntityExpr("expenseOwnerId",
0845: EntityOperator.EQUALS, ownerId));
0846: list.add(new EntityExpr("expenseDate",
0847: EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date(
0848: end.getTime().getTime())));
0849: list.add(new EntityExpr("expenseDate",
0850: EntityOperator.GREATER_THAN_EQUAL_TO,
0851: new java.sql.Date(start.getTime().getTime())));
0852:
0853: List expenses = delegator.findByAnd("Expense", list, null);
0854: GenericValue expenseDetails[] = (GenericValue[]) expenses
0855: .toArray(new GenericValue[0]);
0856: GenericValue expenseDetail;
0857: for (int i = 0; i < expenseDetails.length; i++) {
0858: expenseDetail = expenseDetails[i];
0859: actual = actual
0860: + expenseDetail.getDouble("expenseAmount")
0861: .doubleValue();
0862: }
0863: return actual;
0864:
0865: }
0866:
0867: int calculateLeadsConverted(String partyId, Calendar start,
0868: Calendar end, GenericDelegator delegator)
0869: throws GenericEntityException {
0870: ArrayList list = new ArrayList();
0871: list.add(new EntityExpr("leadOwnerId", EntityOperator.EQUALS,
0872: partyId));
0873: list
0874: .add(new EntityExpr("statusId", EntityOperator.EQUALS,
0875: "50"));
0876: list.add(new EntityExpr("convertedDate",
0877: EntityOperator.GREATER_THAN_EQUAL_TO,
0878: new java.sql.Date(start.getTime().getTime())));
0879: list.add(new EntityExpr("convertedDate",
0880: EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date(
0881: end.getTime().getTime())));
0882: List leadL = delegator.findByAnd("Lead", list, null);
0883: return leadL.size();
0884: }
0885:
0886: int calculateLeadsAssigned(String partyId, Calendar start,
0887: Calendar end, GenericDelegator delegator)
0888: throws GenericEntityException {
0889: ArrayList list = new ArrayList();
0890: list.add(new EntityExpr("leadOwnerId", EntityOperator.EQUALS,
0891: partyId));
0892: list.add(new EntityExpr("assignedDate",
0893: EntityOperator.GREATER_THAN_EQUAL_TO,
0894: new java.sql.Date(start.getTime().getTime())));
0895: list.add(new EntityExpr("assignedDate",
0896: EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date(
0897: end.getTime().getTime())));
0898: List leadL = delegator.findByAnd("Lead", list, null);
0899:
0900: return leadL.size();
0901: }
0902:
0903: Date getHireDate(String partyId, GenericDelegator delegator)
0904: throws GenericEntityException {
0905: HashMap fields = new HashMap();
0906: fields.put("contactId", partyId);
0907: GenericValue contact = delegator.findByPrimaryKey("Contact",
0908: fields);
0909: Date hireDate = contact.getDate("hireDate");
0910: if (hireDate == null)
0911: hireDate = Calendar.getInstance().getTime();
0912: return hireDate;
0913: }
0914:
0915: GenericValue[] getQuarterlyOpportunities(String ownerId,
0916: GenericDelegator delegator, int fyStartMonth)
0917: throws GenericEntityException {
0918: Calendar cal = Calendar.getInstance();
0919: ArrayList list = new ArrayList();
0920: list.add(new EntityExpr("ownerId", EntityOperator.EQUALS,
0921: ownerId));
0922: list.add(new EntityExpr("projectedCloseDate",
0923: EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date(
0924: CalendarUtil.getMaximumQuarterDate(
0925: (cal.get(Calendar.MONTH) + 1),
0926: cal.get(Calendar.YEAR), fyStartMonth)
0927: .getTime())));
0928: list.add(new EntityExpr("dealStatusId",
0929: EntityOperator.NOT_EQUAL, "70")); // Not lost
0930: ArrayList order = new ArrayList();
0931: order.add("projectedCloseDate");
0932: List dealList = delegator.findByAnd("Deal", list, order);
0933: return (GenericValue[]) dealList.toArray(new GenericValue[0]);
0934: }
0935:
0936: GenericValue[] getRecentLeads(String ownerId,
0937: GenericDelegator delegator) throws GenericEntityException {
0938: Calendar cal = Calendar.getInstance();
0939: ArrayList list = new ArrayList();
0940: list.add(new EntityExpr("leadOwnerId", EntityOperator.EQUALS,
0941: ownerId));
0942: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0943: "50")); // Not converted
0944: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0945: "60")); // Not lost
0946: ArrayList order = new ArrayList();
0947: order.add("createdDate DESC");
0948: List leadList = delegator.findByAnd("Lead", list, order);
0949: return (GenericValue[]) leadList.toArray(new GenericValue[0]);
0950: }
0951:
0952: GenericValue[] getDailyActivities(String ownerId,
0953: Calendar selectedDayCalendar, GenericDelegator delegator)
0954: throws GenericEntityException {
0955: ArrayList list = new ArrayList();
0956: list.add(new EntityExpr("activityOwnerId",
0957: EntityOperator.EQUALS, ownerId));
0958: list.add(new EntityExpr("openDate", EntityOperator.EQUALS,
0959: new java.sql.Date(selectedDayCalendar.getTime()
0960: .getTime())));
0961: ArrayList order = new ArrayList();
0962: order.add("openDate");
0963: order.add("openStartTime");
0964: List activityList = delegator
0965: .findByAnd("Activity", list, order);
0966: return (GenericValue[]) activityList
0967: .toArray(new GenericValue[0]);
0968: }
0969:
0970: GenericValue[] getIncompleteActivities(String ownerId,
0971: GenericDelegator delegator) throws GenericEntityException {
0972: ArrayList list = new ArrayList();
0973: list.add(new EntityExpr("activityOwnerId",
0974: EntityOperator.EQUALS, ownerId));
0975: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0976: "30")); // Not declined
0977: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0978: "50")); // Not On Hold
0979: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0980: "60")); // Not Canceled
0981: list.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL,
0982: "70")); // Not Done
0983: ArrayList order = new ArrayList();
0984: order.add("openDate");
0985: order.add("openStartTime");
0986: List activityList = delegator
0987: .findByAnd("Activity", list, order);
0988: return (GenericValue[]) activityList
0989: .toArray(new GenericValue[0]);
0990: }
0991:
0992: private static java.util.Vector _jspx_includes;
0993:
0994: static {
0995: _jspx_includes = new java.util.Vector(13);
0996: _jspx_includes.add("/includes/header.jsp");
0997: _jspx_includes.add("/includes/oldFunctions.jsp");
0998: _jspx_includes.add("/includes/oldDeclarations.jsp");
0999: _jspx_includes.add("/includes/windowTitle.jsp");
1000: _jspx_includes.add("/includes/userStyle.jsp");
1001: _jspx_includes.add("/includes/uiFunctions.js");
1002: _jspx_includes.add("/includes/onBeforeUnload.jsp");
1003: _jspx_includes.add("/includes/ts_picker.js");
1004: _jspx_includes.add("/includes/errormsg.jsp");
1005: _jspx_includes.add("/includes/simpleActivityList.jsp");
1006: _jspx_includes.add("/includes/simpleActivityList.jsp");
1007: _jspx_includes.add("/includes/loginForm.jsp");
1008: _jspx_includes.add("/includes/footer.jsp");
1009: }
1010:
1011: private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_ofbiz_url;
1012:
1013: public frontPage_jsp() {
1014: _jspx_tagPool_ofbiz_url = new org.apache.jasper.runtime.TagHandlerPool();
1015: }
1016:
1017: public java.util.List getIncludes() {
1018: return _jspx_includes;
1019: }
1020:
1021: public void _jspDestroy() {
1022: _jspx_tagPool_ofbiz_url.release();
1023: }
1024:
1025: public void _jspService(HttpServletRequest request,
1026: HttpServletResponse response) throws java.io.IOException,
1027: ServletException {
1028:
1029: JspFactory _jspxFactory = null;
1030: javax.servlet.jsp.PageContext pageContext = null;
1031: HttpSession session = null;
1032: ServletContext application = null;
1033: ServletConfig config = null;
1034: JspWriter out = null;
1035: Object page = this ;
1036: JspWriter _jspx_out = null;
1037:
1038: try {
1039: _jspxFactory = JspFactory.getDefaultFactory();
1040: response.setContentType("text/html;charset=ISO-8859-1");
1041: pageContext = _jspxFactory.getPageContext(this , request,
1042: response, null, true, 8192, true);
1043: application = pageContext.getServletContext();
1044: config = pageContext.getServletConfig();
1045: session = pageContext.getSession();
1046: out = pageContext.getOut();
1047: _jspx_out = out;
1048:
1049: out.write("\r\n");
1050: out.write("\r\n");
1051: out.write("\r\n");
1052: out.write("\r\n");
1053: out.write("\r\n");
1054: out.write("\r\n");
1055: out.write("\r\n");
1056: out.write("\r\n");
1057: out.write("\r\n");
1058: out.write("\r\n\r\n");
1059: out.write("\r\n");
1060: out.write("\r\n");
1061: out.write("\r\n");
1062: out.write("\r\n");
1063: out.write("\r\n");
1064: out.write("\r\n");
1065: out.write("\r\n");
1066: out.write("\r\n");
1067: out.write("\r\n");
1068: out.write("\r\n\r\n");
1069: out.write("\r\n");
1070: out.write("\r\n");
1071: out.write("\r\n");
1072: out.write("\r\n");
1073: out.write("\r\n");
1074: out.write("\r\n\r\n");
1075: out.write("\r\n");
1076: out.write("\r\n");
1077: out.write("\r\n");
1078: out.write("\r\n");
1079: out.write("\r\n");
1080: out.write("\r\n");
1081: out.write("\r\n");
1082: out.write("\r\n");
1083: out.write("\r\n\r\n");
1084: out.write("\r\n\r\n");
1085: org.ofbiz.security.Security security = null;
1086: synchronized (application) {
1087: security = (org.ofbiz.security.Security) pageContext
1088: .getAttribute("security",
1089: PageContext.APPLICATION_SCOPE);
1090: if (security == null) {
1091: throw new java.lang.InstantiationException(
1092: "bean security not found within scope");
1093: }
1094: }
1095: out.write("\r\n");
1096: org.ofbiz.entity.GenericDelegator delegator = null;
1097: synchronized (application) {
1098: delegator = (org.ofbiz.entity.GenericDelegator) pageContext
1099: .getAttribute("delegator",
1100: PageContext.APPLICATION_SCOPE);
1101: if (delegator == null) {
1102: throw new java.lang.InstantiationException(
1103: "bean delegator not found within scope");
1104: }
1105: }
1106: out.write("\r\n");
1107: com.sourcetap.sfa.event.GenericWebEventProcessor webEventProcessor = null;
1108: synchronized (application) {
1109: webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) pageContext
1110: .getAttribute("webEventProcessor",
1111: PageContext.APPLICATION_SCOPE);
1112: if (webEventProcessor == null) {
1113: try {
1114: webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) java.beans.Beans
1115: .instantiate(this .getClass()
1116: .getClassLoader(),
1117: "com.sourcetap.sfa.event.GenericWebEventProcessor");
1118: } catch (ClassNotFoundException exc) {
1119: throw new InstantiationException(exc
1120: .getMessage());
1121: } catch (Exception exc) {
1122: throw new ServletException(
1123: "Cannot create bean of class "
1124: + "com.sourcetap.sfa.event.GenericWebEventProcessor",
1125: exc);
1126: }
1127: pageContext.setAttribute("webEventProcessor",
1128: webEventProcessor,
1129: PageContext.APPLICATION_SCOPE);
1130: }
1131: }
1132: out.write("\r\n");
1133: com.sourcetap.sfa.event.GenericEventProcessor eventProcessor = null;
1134: synchronized (application) {
1135: eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) pageContext
1136: .getAttribute("eventProcessor",
1137: PageContext.APPLICATION_SCOPE);
1138: if (eventProcessor == null) {
1139: try {
1140: eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) java.beans.Beans
1141: .instantiate(this .getClass()
1142: .getClassLoader(),
1143: "com.sourcetap.sfa.event.GenericEventProcessor");
1144: } catch (ClassNotFoundException exc) {
1145: throw new InstantiationException(exc
1146: .getMessage());
1147: } catch (Exception exc) {
1148: throw new ServletException(
1149: "Cannot create bean of class "
1150: + "com.sourcetap.sfa.event.GenericEventProcessor",
1151: exc);
1152: }
1153: pageContext.setAttribute("eventProcessor",
1154: eventProcessor,
1155: PageContext.APPLICATION_SCOPE);
1156: }
1157: }
1158: out.write("\r\n");
1159: com.sourcetap.sfa.ui.UICache uiCache = null;
1160: synchronized (application) {
1161: uiCache = (com.sourcetap.sfa.ui.UICache) pageContext
1162: .getAttribute("uiCache",
1163: PageContext.APPLICATION_SCOPE);
1164: if (uiCache == null) {
1165: try {
1166: uiCache = (com.sourcetap.sfa.ui.UICache) java.beans.Beans
1167: .instantiate(this .getClass()
1168: .getClassLoader(),
1169: "com.sourcetap.sfa.ui.UICache");
1170: } catch (ClassNotFoundException exc) {
1171: throw new InstantiationException(exc
1172: .getMessage());
1173: } catch (Exception exc) {
1174: throw new ServletException(
1175: "Cannot create bean of class "
1176: + "com.sourcetap.sfa.ui.UICache",
1177: exc);
1178: }
1179: pageContext.setAttribute("uiCache", uiCache,
1180: PageContext.APPLICATION_SCOPE);
1181: }
1182: }
1183: out.write("\r\n\r\n");
1184: out.write("<!-- [oldFunctions.jsp] Begin -->\r\n");
1185: out.write("\r\n");
1186: out.write("<!-- [oldFunctions.jsp] End -->\r\n\r\n");
1187: out.write("\r\n");
1188: out.write("<!-- [oldDeclarations.jsp] Start -->\r\n\r\n");
1189: GenericValue userLogin = (GenericValue) session
1190: .getAttribute("_USER_LOGIN_");
1191: out.write("\r\n");
1192: UserInfo userInfo = (UserInfo) session
1193: .getAttribute("userInfo");
1194: out.write("\r\n\r\n");
1195: String partyId = "";
1196: if (userLogin != null)
1197: partyId = userLogin.getString("partyId");
1198:
1199: out.write("\r\n\r\n");
1200:
1201: DecimalFormat decimalFormat = new DecimalFormat("#,###.##");
1202: SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
1203: "MM/dd/yyyy");
1204: SimpleDateFormat simpleTimeFormat = new SimpleDateFormat(
1205: "K:mm a");
1206:
1207: out.write("\r\n\r\n");
1208: String controlPath = (String) request
1209: .getAttribute("_CONTROL_PATH_");
1210: out.write("\r\n");
1211: String contextRoot = (String) request
1212: .getAttribute("_CONTEXT_ROOT_");
1213: out.write("\r\n\r\n");
1214: String pageName = UtilFormatOut
1215: .checkNull((String) pageContext
1216: .getAttribute("PageName"));
1217: out.write("\r\n\r\n");
1218: String companyName = UtilProperties.getPropertyValue(
1219: contextRoot + "/WEB-INF/sfa.properties",
1220: "company.name");
1221: out.write("\r\n");
1222: String companySubtitle = UtilProperties.getPropertyValue(
1223: contextRoot + "/WEB-INF/sfa.properties",
1224: "company.subtitle");
1225: out.write("\r\n");
1226: String headerImageUrl = UtilProperties.getPropertyValue(
1227: contextRoot + "/WEB-INF/sfa.properties",
1228: "header.image.url");
1229: out.write("\r\n\r\n");
1230: String headerBoxBorderColor = UtilProperties
1231: .getPropertyValue(contextRoot
1232: + "/WEB-INF/sfa.properties",
1233: "header.box.border.color", "black");
1234: out.write("\r\n");
1235: String headerBoxBorderWidth = UtilProperties
1236: .getPropertyValue(contextRoot
1237: + "/WEB-INF/sfa.properties",
1238: "header.box.border.width", "1");
1239: out.write("\r\n");
1240: String headerBoxTopColor = UtilProperties.getPropertyValue(
1241: contextRoot + "/WEB-INF/sfa.properties",
1242: "header.box.top.color", "#336699");
1243: out.write("\r\n");
1244: String headerBoxBottomColor = UtilProperties
1245: .getPropertyValue(contextRoot
1246: + "/WEB-INF/sfa.properties",
1247: "header.box.bottom.color", "#cccc99");
1248: out.write("\r\n");
1249: String headerBoxBottomColorAlt = UtilProperties
1250: .getPropertyValue(contextRoot
1251: + "/WEB-INF/sfa.properties",
1252: "header.box.bottom.alt.color", "#eeeecc");
1253: out.write("\r\n");
1254: String headerBoxTopPadding = UtilProperties
1255: .getPropertyValue(contextRoot
1256: + "/WEB-INF/sfa.properties",
1257: "header.box.top.padding", "4");
1258: out.write("\r\n");
1259: String headerBoxBottomPadding = UtilProperties
1260: .getPropertyValue(contextRoot
1261: + "/WEB-INF/sfa.properties",
1262: "header.box.bottom.padding", "2");
1263: out.write("\r\n\r\n");
1264: String boxBorderColor = UtilProperties.getPropertyValue(
1265: contextRoot + "/WEB-INF/sfa.properties",
1266: "box.border.color", "black");
1267: out.write("\r\n");
1268: String boxBorderWidth = UtilProperties.getPropertyValue(
1269: contextRoot + "/WEB-INF/sfa.properties",
1270: "box.border.width", "1");
1271: out.write("\r\n");
1272: String boxTopColor = UtilProperties.getPropertyValue(
1273: contextRoot + "/WEB-INF/sfa.properties",
1274: "box.top.color", "#336699");
1275: out.write("\r\n");
1276: String boxBottomColor = UtilProperties.getPropertyValue(
1277: contextRoot + "/WEB-INF/sfa.properties",
1278: "box.bottom.color", "white");
1279: out.write("\r\n");
1280: String boxBottomColorAlt = UtilProperties.getPropertyValue(
1281: contextRoot + "/WEB-INF/sfa.properties",
1282: "box.bottom.alt.color", "white");
1283: out.write("\r\n");
1284: String boxTopPadding = UtilProperties.getPropertyValue(
1285: contextRoot + "/WEB-INF/sfa.properties",
1286: "box.top.padding", "4");
1287: out.write("\r\n");
1288: String boxBottomPadding = UtilProperties.getPropertyValue(
1289: contextRoot + "/WEB-INF/sfa.properties",
1290: "box.bottom.padding", "4");
1291: out.write("\r\n");
1292: String userStyleSheet = "/sfa/includes/maincss.css";
1293: out.write("\r\n");
1294: String alphabet[] = { "a", "b", "c", "d", "e", "f", "g",
1295: "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
1296: "r", "s", "t", "u", "v", "w", "x", "y", "z", "*" };
1297: out.write("\r\n\r\n");
1298: out.write("<!-- [oldDeclarations.jsp] End -->\r\n\r\n");
1299: out.write("\r\n\r\n");
1300: out.write("<HTML>\r\n");
1301: out.write("<HEAD>\r\n\r\n");
1302:
1303: String clientRequest = (String) session
1304: .getAttribute("_CLIENT_REQUEST_");
1305: //out.write("Client request: " + clientRequest + "<BR>");
1306: String hostName = "";
1307: if (clientRequest != null
1308: && clientRequest.indexOf("//") > 0) {
1309: int startPos = clientRequest.indexOf("//") + 2;
1310: int endPos = clientRequest.indexOf(":", startPos);
1311: if (endPos < startPos)
1312: endPos = clientRequest.indexOf("/", startPos);
1313: if (endPos < startPos)
1314: hostName = clientRequest.substring(startPos);
1315: else
1316: hostName = clientRequest
1317: .substring(startPos, endPos);
1318: } else {
1319: hostName = "";
1320: }
1321: //out.write("Host name: " + hostName + "<BR>");
1322:
1323: out.write("\r\n\r\n");
1324: out.write("<title>");
1325: out.print(hostName);
1326: out.write(" - Sales Force Automation - ");
1327: out.print(companyName);
1328: out.write("</title>\r\n\r\n");
1329: out.write("\r\n");
1330: out.write("<!-- [userStyle.jsp] Start -->\r\n\r\n");
1331:
1332: //------------ Get the style sheet
1333: String styleSheetId = null;
1334:
1335: ModelEntity entityStyleUser = delegator
1336: .getModelEntity("UiUserTemplate");
1337: HashMap hashMapStyleUser = new HashMap();
1338: if (userLogin != null) {
1339: String ulogin = userLogin.getString("userLoginId");
1340: hashMapStyleUser.put("userLoginId", ulogin);
1341: } else {
1342: hashMapStyleUser.put("userLoginId", "Default");
1343: }
1344: GenericPK stylePk = new GenericPK(entityStyleUser,
1345: hashMapStyleUser);
1346: GenericValue userTemplate = delegator
1347: .findByPrimaryKey(stylePk);
1348: if (userTemplate != null) {
1349: styleSheetId = userTemplate.getString("styleSheetId");
1350: }
1351:
1352: if (styleSheetId == null) {
1353: hashMapStyleUser.put("userLoginId", "Default");
1354: stylePk = new GenericPK(entityStyleUser,
1355: hashMapStyleUser);
1356: userTemplate = delegator.findByPrimaryKey(stylePk);
1357: if (userTemplate != null) {
1358: styleSheetId = userTemplate
1359: .getString("styleSheetId");
1360: }
1361: }
1362:
1363: if (styleSheetId != null) {
1364: ModelEntity entityStyle = delegator
1365: .getModelEntity("UiStyleTemplate");
1366: HashMap hashMapStyle = new HashMap();
1367: hashMapStyle.put("styleSheetId", styleSheetId);
1368: stylePk = new GenericPK(entityStyle, hashMapStyle);
1369: GenericValue styleTemplate = delegator
1370: .findByPrimaryKey(stylePk);
1371: userStyleSheet = styleTemplate
1372: .getString("styleSheetLoc");
1373:
1374: if (userStyleSheet == null) {
1375: userStyleSheet = "/sfa/includes/maincss.css";
1376: }
1377: }
1378:
1379: out.write("\r\n");
1380: out.write("<link rel=\"stylesheet\" href=\"");
1381: out.print(userStyleSheet);
1382: out.write("\" type=\"text/css\">\r\n\r\n");
1383: out.write("<!-- [userStyle.jsp] End -->\r\n\r\n");
1384: out.write("\r\n");
1385: out
1386: .write("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/sfa/css/gridstyles.css\">\r\n");
1387: out
1388: .write("<script language=\"JavaScript\" >\r\n\r\n function sendDropDown(elementName, idName, fieldName, findClass, paramName, paramValue, frm, action)\r\n {\r\n var sUrl = '");
1389: if (_jspx_meth_ofbiz_url_0(pageContext))
1390: return;
1391: out
1392: .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 = '");
1393: if (_jspx_meth_ofbiz_url_1(pageContext))
1394: return;
1395: out
1396: .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");
1397: out
1398: .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");
1399: out
1400: .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");
1401: out
1402: .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");
1403: out
1404: .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");
1405: out
1406: .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");
1407: out
1408: .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");
1409: out
1410: .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] ");
1411: out
1412: .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 ");
1413: out
1414: .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 ");
1415: out
1416: .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 ");
1417: out
1418: .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 ");
1419: out
1420: .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 ");
1421: out
1422: .write("< myRows; i++) {\r\n myArray[i] = new Array(myCols)\r\n for (j=0; j ");
1423: out
1424: .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 ");
1425: out.write("< myRows; i++) {\r\n for (j=0; j ");
1426: out
1427: .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");
1428: out.write("</script>\r\n\r\n\r\n");
1429: out.write("\r\n\r\n");
1430: out.write("</HEAD>\r\n\r\n");
1431: out.write("<BASE TARGET=\"content\">\r\n");
1432: out.write("<!--");
1433: out
1434: .write("<BODY CLASS=\"bodyform\" onbeforeunload=\"verifyClose()\">-->\r\n");
1435: out.write("<BODY CLASS=\"bodyform\"\">\r\n\r\n");
1436: out.write("\r\n");
1437: out.write("<!-- onBeforeUnload.jsp - Start -->\r\n\r\n");
1438: out
1439: .write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\" FOR=window EVENT=onbeforeunload>\r\n return doOnBeforeUnload();\r\n");
1440: out.write("</SCRIPT>\r\n\r\n");
1441: out
1442: .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");
1443: out
1444: .write(" var vFormC = document.forms;\r\n for (var vFormNbr = 0; vFormNbr ");
1445: out
1446: .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==\"");
1447: out.print(UIScreenSection.ACTION_INSERT);
1448: out.write("\" ||\r\n vAction==\"");
1449: out.print(UIScreenSection.ACTION_UPDATE);
1450: out.write("\" ||\r\n vAction==\"");
1451: out.print(UIScreenSection.ACTION_UPDATE_SELECT);
1452: out
1453: .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 ");
1454: out
1455: .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 = \"");
1456: out.print(UIWebUtility.HTML_NAME_PREFIX_ORIGINAL);
1457: out
1458: .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");
1459: out
1460: .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");
1461: out.write("</SCRIPT>\r\n\r\n");
1462: out.write("<!-- onBeforeUnload.jsp - End -->\r\n\r\n\r\n");
1463: out.write("\r\n\r\n");
1464: out
1465: .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 ");
1466: out.write("<denis@softcomplex.com>; ");
1467: out
1468: .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");
1469: out
1470: .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\"");
1471: out.write("<html>\\n\"+\r\n\t\t\" ");
1472: out.write("<head>\\n\"+\r\n\t\t\" ");
1473: out.write("<title>Calendar");
1474: out.write("</title>\\n\"+\r\n\t\t\" ");
1475: out.write("</head>\\n\"+\r\n\t\t\" ");
1476: out.write("<body bgcolor=\\\"White\\\">\\n\"+\r\n\t\t\" ");
1477: out
1478: .write("<table class=\\\"clsOTable\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
1479: out.write("<tr>\\n\" +\r\n\t\t\" ");
1480: out
1481: .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
1482: out
1483: .write("<table cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\" ");
1484: out.write("<tr>\\n\" +\r\n\t\t\" ");
1485: out
1486: .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\" ");
1487: out
1488: .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\" ");
1489: out
1490: .write("<img src=\\\"/sfaimages/prev.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"previous month\\\">\\n\" +\r\n\t\t\" ");
1491: out.write("</a>\\n\" +\r\n\t\t\" ");
1492: out.write("</td>\\n\" +\r\n\t\t\" ");
1493: out
1494: .write("<td bgcolor=\\\"#4682B4\\\" colspan=\\\"5\\\">\\n\" +\r\n\t\t\" ");
1495: out
1496: .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\" ");
1497: out.write("</font>\\n\" +\r\n\t\t\" ");
1498: out.write("</td>\\n\" +\r\n\t\t\" ");
1499: out
1500: .write("<td bgcolor=\\\"#4682B4\\\" align=\\\"right\\\">\\n\" +\r\n\t\t\" ");
1501: out
1502: .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\" ");
1503: out
1504: .write("<img src=\\\"/sfaimages/next.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\" alt=\\\"next month\\\">\\n\" +\r\n\t\t\" ");
1505: out.write("</a>\\n\" +\r\n\t\t\" ");
1506: out.write("</td>\\n\" +\r\n\t\t\" ");
1507: out
1508: .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 += \" ");
1509: out.write("<tr>\\n\";\r\n\tfor (var n=0; n");
1510: out.write("<7; n++)\r\n\t\tstr_buffer += \" ");
1511: out
1512: .write("<td bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
1513: out
1514: .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\" ");
1515: out.write("</font>");
1516: out
1517: .write("</td>\\n\";\r\n\t// print calendar table\r\n\tstr_buffer += \" ");
1518: out
1519: .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 += \" ");
1520: out
1521: .write("<tr>\\n\";\r\n\t\tfor (var n_current_wday=0; n_current_wday");
1522: out
1523: .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 += \" ");
1524: out
1525: .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 += \" ");
1526: out
1527: .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 += \" ");
1528: out
1529: .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 += \" ");
1530: out
1531: .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 += \" ");
1532: out
1533: .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 += \" ");
1534: out
1535: .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 += \" ");
1536: out
1537: .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\" ");
1538: out.write("</font>\\n\" +\r\n\t\t\t\t\" ");
1539: out.write("</a>\\n\" +\r\n\t\t\t\t\" ");
1540: out
1541: .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 += \" ");
1542: out
1543: .write("</tr>\\n\";\r\n\t}\r\n\t// print calendar footer\r\n\tstr_buffer +=\r\n\t\t\" ");
1544: out
1545: .write("<form name=\\\"cal\\\">\\n\" +\r\n\t\t\" ");
1546: out.write("<tr>\\n\" +\r\n\t\t\" ");
1547: out
1548: .write("<td colspan=\\\"7\\\" bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\" ");
1549: out
1550: .write("<font color=\\\"White\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\" Time:\\n\" +\r\n\t\t\" ");
1551: out
1552: .write("<input type=\\\"text\\\" name=\\\"time\\\" value=\\\"\" + dt2tmstr(dt_datetime) +\r\n\t\t\"\\\" size=\\\"8\\\" maxlength=\\\"8\\\">\\n\" +\r\n\t\t\" ");
1553: out.write("</font>\\n\" +\r\n\t\t\" ");
1554: out.write("</td>\\n\" +\r\n\t\t\" ");
1555: out.write("</tr>\\n\" +\r\n\t\t\" ");
1556: out.write("</form>\\n\" +\r\n\t\t\" ");
1557: out.write("</table>\\n\" +\r\n\t\t\" ");
1558: out.write("</tr>\\n\" +\r\n\t\t\" ");
1559: out.write("</td>\\n\" +\r\n\t\t\" ");
1560: out.write("</table>\\n\" +\r\n\t\t\" ");
1561: out.write("</body>\\n\" +\r\n\t\t\"");
1562: out
1563: .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");
1564: out
1565: .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");
1566: out.write("</script>\r\n");
1567: out.write("\r\n\r\n");
1568: out.write("\r\n");
1569: out.write(" \r\n");
1570:
1571: String eventMsgReq = (String) request
1572: .getAttribute("EVENT_MESSAGE");
1573: String errorMsgReqControl = (String) request
1574: .getAttribute("_ERROR_MESSAGE_");
1575: String errorMsgReq = (String) request
1576: .getAttribute("ERROR_MESSAGE");
1577: String errorMsgSes = (String) session
1578: .getAttribute("ERROR_MESSAGE");
1579: if (errorMsgSes != null)
1580: session.removeAttribute("ERROR_MESSAGE");
1581: if (errorMsgReq != null) {
1582: out.write("\r\n");
1583: out.write("<br>\r\n");
1584: out.write("<p>");
1585: out.write("<font color=\"red\">");
1586: out.print(errorMsgReq);
1587: out.write("</font>");
1588: out.write("</p>\r\n");
1589: out.write("<br>\r\n");
1590: }
1591: if (errorMsgSes != null) {
1592: out.write("\r\n");
1593: out.write("<br>\r\n");
1594: out.write("<p>");
1595: out.write("<font color=\"red\">");
1596: out.print(errorMsgSes);
1597: out.write("</font>");
1598: out.write("</p>\r\n");
1599: out.write("<br>\r\n");
1600: }
1601: if (errorMsgReqControl != null) {
1602: out.write("\r\n");
1603: out.write("<br>\r\n");
1604: out.write("<p>");
1605: out.write("<font color=\"red\">");
1606: out.print(errorMsgReqControl);
1607: out.write("</font>");
1608: out.write("</p>\r\n");
1609: out.write("<br>\r\n");
1610: }
1611: if (eventMsgReq != null) {
1612: out.write("\r\n");
1613: out.write("<br>\r\n");
1614: out.write("<p>");
1615: out.write("<font color=\"blue\">");
1616: out.print(eventMsgReq);
1617: out.write("</font>");
1618: out.write("</p>\r\n");
1619: out.write("<br>\r\n");
1620: }
1621: out.write("\r\n\r\n");
1622: out.write("\r\n\r\n");
1623: String mimes = "";
1624: out.write("\r\n\r\n");
1625:
1626: //get the date information
1627: String day = "";
1628: String lsMonth = "";
1629: String module = "frontPage";
1630:
1631: Calendar selectedDayCalendar = Calendar.getInstance();
1632: int month = (selectedDayCalendar.get(Calendar.MONTH) + 1);
1633: int year = selectedDayCalendar.get(Calendar.YEAR);
1634: int iday = selectedDayCalendar.get(Calendar.DATE);
1635:
1636: //if the user has selcted a day
1637: //get the activities for that day
1638: if (request.getParameter("day") != null) {
1639: day = request.getParameter("day");
1640: iday = Long.valueOf(day).intValue();
1641: selectedDayCalendar.set(year, month - 1, iday, 0, 0);
1642: }
1643:
1644: // the user has selected a month then use that month.
1645: if (request.getParameter("month") != null) {
1646: lsMonth = request.getParameter("month");
1647: month = Long.valueOf(lsMonth).intValue();
1648: selectedDayCalendar.set(year, month - 1, iday, 0, 0);
1649: }
1650:
1651: out.write("\r\n\r\n");
1652: out.write("\r\n\r\n");
1653: pageContext.setAttribute("PageName", "Main Page");
1654: out.write("\r\n");
1655: String loginUrl = controlPath
1656: + "/checkLogin/"
1657: + UtilFormatOut.checkNull((String) request
1658: .getAttribute("_CURRENT_VIEW_"));
1659: out.write("\r\n");
1660: pageContext.setAttribute("PageName", "Main Page");
1661: out.write("\r\n\r\n");
1662:
1663: if (session.getAttribute("partyId") != null
1664: && userLogin != null) {
1665:
1666: out.write("\r\n\r\n");
1667: out
1668: .write("<SCRIPT FOR=\"window\" EVENT=\"onload\" LANGUAGE=\"JavaScript\">\r\n\t// Reload the menu to clear the menu items.\r\n\tparent.parent.menu.location.href = parent.parent.menu.location.href;\r\n");
1669: out.write("</SCRIPT>\r\n\r\n");
1670:
1671: int fyStartMonth = CalendarUtil
1672: .getFiscalYearStartMonth(delegator, userInfo);
1673:
1674: // Find out if this is a leads user or leads admin. If so, going to display
1675: // a special leads dashboard.
1676: boolean leadDashBoard = false;
1677: HashMap partyRoleFindMap = new HashMap();
1678: partyRoleFindMap.put("partyId", userInfo.getPartyId());
1679: try {
1680: List partyRoleL = delegator.findByAnd("PartyRole",
1681: partyRoleFindMap);
1682:
1683: Iterator partyRoleI = partyRoleL.iterator();
1684: while (partyRoleI.hasNext()) {
1685: GenericValue partyRoleGV = (GenericValue) partyRoleI
1686: .next();
1687: String roleTypeId = partyRoleGV
1688: .getString("roleTypeId") == null ? ""
1689: : partyRoleGV.getString("roleTypeId");
1690:
1691: if (roleTypeId.equals("SFA_LEADS_ADMIN")
1692: || roleTypeId.equals("SFA_LEADS_USER")) {
1693: leadDashBoard = true;
1694: }
1695: }
1696:
1697: } catch (Exception e) {
1698: Debug.logWarning("Error retrieving user roles: "
1699: + e.getLocalizedMessage(), module);
1700: }
1701:
1702: Calendar cal = Calendar.getInstance();
1703: cal.setTime(getHireDate(partyId, delegator));
1704: int daysFromHire = CalendarUtil.differenceBetweenDates(
1705: cal, Calendar.getInstance(),
1706: Calendar.DAY_OF_YEAR);
1707: //SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/YYYY");
1708:
1709: Calendar allStart = Calendar.getInstance();
1710: allStart.set(Calendar.YEAR, 1990);
1711: allStart.set(Calendar.MONTH, Calendar.JANUARY);
1712: allStart.set(Calendar.DAY_OF_MONTH, 1);
1713:
1714: Calendar yearStart = Calendar.getInstance();
1715: yearStart.set(Calendar.MONTH, Calendar.JANUARY);
1716: yearStart.set(Calendar.DAY_OF_MONTH, 1);
1717:
1718: Calendar yearEnd = Calendar.getInstance();
1719: yearEnd.set(Calendar.MONTH, Calendar.DECEMBER);
1720: yearEnd.set(Calendar.DAY_OF_MONTH, 31);
1721:
1722: int yearLeadsConverted = calculateLeadsConverted(
1723: partyId, yearStart, yearEnd, delegator);
1724: int yearLeadsAssigned = calculateLeadsAssigned(partyId,
1725: yearStart, yearEnd, delegator);
1726: double yearLeadConversionRate = ((yearLeadsAssigned == 0) ? 0.0
1727: : ((yearLeadsConverted * 100) / yearLeadsAssigned));
1728:
1729: int allLeadsConverted = calculateLeadsConverted(
1730: partyId, allStart, yearEnd, delegator);
1731: int allLeadsAssigned = calculateLeadsAssigned(partyId,
1732: allStart, yearEnd, delegator);
1733: double allLeadConversionRate = ((allLeadsAssigned == 0) ? 0.0
1734: : ((allLeadsConverted * 100) / allLeadsAssigned));
1735:
1736: double quota = calculateYearlyQuota(partyId, delegator);
1737: double actual = calculateYearlySales(partyId, delegator);
1738: double quotaPercent = ((quota == 0) || (quota == 0.0) ? 0.0
1739: : ((actual / quota) * 100));
1740: double expenses = calculateYearlyExpenses(partyId,
1741: delegator);
1742:
1743: out.write("\r\n\r\n");
1744: out
1745: .write("<table width=100% class=\"freeFormSectionTitleTable\">\r\n ");
1746: out.write("<tr>\r\n ");
1747: out.write("<td colspan=3>\r\n ");
1748: out.print(userInfo.getUserFullName());
1749: out.write("'s Dashboard\r\n ");
1750: out.write("<td>\r\n ");
1751: out.write("</tr>\r\n");
1752: out.write("</table>\r\n\r\n");
1753: out
1754: .write("<!-- Table to separate the top half of the screen from the bottom half -->\r\n");
1755: out.write("<table border=0>\r\n\r\n ");
1756: out.write("<!-- Start top half of screen. -->\r\n ");
1757: out.write("<tr>\r\n ");
1758: out.write("<td valign=\"top\">\r\n\r\n ");
1759: out
1760: .write("<!-- Table to hold the columns of the top half of the screen -->\r\n ");
1761: out.write("<table border=0>\r\n ");
1762: out.write("<tr>\r\n\r\n ");
1763: out
1764: .write("<!-- Cell for year-to-date and lifetime -->\r\n ");
1765: out.write("<td valign=\"top\">\r\n\r\n ");
1766: out
1767: .write("<!-- Table to separate the year-to-date from the lifetime -->\r\n ");
1768: out.write("<table border=\"0\">\r\n ");
1769: out.write("<tr>\r\n ");
1770: out.write("<td>\r\n\r\n ");
1771: out
1772: .write("<!-- Table for the year-to-date label -->\r\n ");
1773: out
1774: .write("<table class=\"freeFormSectionTitleTable\" width=\"100%\">\r\n ");
1775: out.write("<tr>\r\n ");
1776: out
1777: .write("<td colspan=2>\r\n Year to Date\r\n ");
1778: out.write("</td>\r\n ");
1779: out.write("</tr>\r\n ");
1780: out.write("</table>\r\n\r\n");
1781: if (leadDashBoard) {
1782: out.write("\r\n ");
1783: out
1784: .write("<!-- Table for the year-to-date LEADS info -->\r\n ");
1785: out
1786: .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\">\r\n ");
1787: out.write("<tr>\r\n ");
1788: out
1789: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Leads Assigned:\r\n ");
1790: out.write("</td>\r\n ");
1791: out
1792: .write("<td class=\"freeFormSectionField\">\r\n ");
1793: out.print(String.valueOf(yearLeadsAssigned));
1794: out.write("\r\n ");
1795: out.write("</td>\r\n ");
1796: out.write("</tr>\r\n ");
1797: out.write("<tr>\r\n ");
1798: out
1799: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Leads Converted:\r\n ");
1800: out.write("</td>\r\n ");
1801: out
1802: .write("<td class=\"freeFormSectionField\">\r\n ");
1803: out.print(String.valueOf(yearLeadsConverted));
1804: out.write("\r\n ");
1805: out.write("</td>\r\n ");
1806: out.write("</tr>\r\n ");
1807: out.write("<tr>\r\n ");
1808: out
1809: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Conversion Rate:\r\n ");
1810: out.write("</td>\r\n ");
1811: out
1812: .write("<td class=\"freeFormSectionField\">\r\n %");
1813: out.print(decimalFormat
1814: .format(yearLeadConversionRate));
1815: out.write("\r\n ");
1816: out.write("</td>\r\n ");
1817: out.write("</tr>\r\n ");
1818: out.write("</table>\r\n");
1819: } else {
1820: out.write("\r\n ");
1821: out
1822: .write("<!-- Table for the year-to-date info -->\r\n ");
1823: out
1824: .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\">\r\n ");
1825: out.write("<tr>\r\n ");
1826: out
1827: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Quota:\r\n ");
1828: out.write("</td>\r\n ");
1829: out
1830: .write("<td class=\"freeFormSectionField\">\r\n $");
1831: out.print(decimalFormat.format(quota));
1832: out.write("\r\n ");
1833: out.write("</td>\r\n ");
1834: out.write("</tr>\r\n ");
1835: out.write("<tr>\r\n ");
1836: out
1837: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Total Sales:\r\n ");
1838: out.write("</td>\r\n ");
1839: out
1840: .write("<td class=\"freeFormSectionField\">\r\n $");
1841: out.print(decimalFormat.format(actual));
1842: out.write("\r\n ");
1843: out.write("</td>\r\n ");
1844: out.write("</tr>\r\n ");
1845: out.write("<tr>\r\n ");
1846: out
1847: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Quota Percentage:\r\n ");
1848: out.write("</td>\r\n ");
1849: out
1850: .write("<td class=\"freeFormSectionField\">\r\n %");
1851: out.print(decimalFormat.format(quotaPercent));
1852: out.write("\r\n ");
1853: out.write("</td>\r\n ");
1854: out.write("</tr>\r\n ");
1855: out.write("<tr>\r\n ");
1856: out
1857: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Expenses:\r\n ");
1858: out.write("</td>\r\n ");
1859: out
1860: .write("<td class=\"freeFormSectionField\">\r\n $");
1861: out.print(decimalFormat.format(expenses));
1862: out.write("\r\n ");
1863: out.write("</td>\r\n ");
1864: out.write("</tr>\r\n ");
1865: out.write("</table>\r\n");
1866: }
1867: out.write("\r\n\r\n ");
1868: out.write("</td>\r\n ");
1869: out.write("</tr>\r\n ");
1870: out.write("<tr>\r\n ");
1871: out.write("<td>\r\n\r\n ");
1872: out
1873: .write("<!-- Table for the lifetime title -->\r\n ");
1874: out
1875: .write("<table class=\"freeFormSectionTitleTable\" width=\"100%\">\r\n ");
1876: out.write("<tr>\r\n ");
1877: out
1878: .write("<td colspan=2>\r\n Lifetime\r\n ");
1879: out.write("</td>\r\n ");
1880: out.write("</tr>\r\n ");
1881: out.write("</table>\r\n\r\n");
1882: if (leadDashBoard) {
1883: out.write("\r\n ");
1884: out
1885: .write("<!-- Table for the lifetime LEADS info -->\r\n ");
1886: out
1887: .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\">\r\n ");
1888: out.write("<tr>\r\n ");
1889: out
1890: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Leads Assigned:\r\n ");
1891: out.write("</td>\r\n ");
1892: out
1893: .write("<td class=\"freeFormSectionField\">\r\n ");
1894: out.print(String.valueOf(allLeadsAssigned));
1895: out.write("\r\n ");
1896: out.write("</td>\r\n ");
1897: out.write("</tr>\r\n ");
1898: out.write("<tr>\r\n ");
1899: out
1900: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Leads Converted:\r\n ");
1901: out.write("</td>\r\n ");
1902: out
1903: .write("<td class=\"freeFormSectionField\">\r\n ");
1904: out.print(String.valueOf(allLeadsConverted));
1905: out.write("\r\n ");
1906: out.write("</td>\r\n ");
1907: out.write("</tr>\r\n ");
1908: out.write("<tr>\r\n ");
1909: out
1910: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Conversion Rate:\r\n ");
1911: out.write("</td>\r\n ");
1912: out
1913: .write("<td class=\"freeFormSectionField\">\r\n %");
1914: out.print(decimalFormat
1915: .format(allLeadConversionRate));
1916: out.write("\r\n ");
1917: out.write("</td>\r\n ");
1918: out.write("</tr>\r\n ");
1919: out.write("<tr>\r\n ");
1920: out
1921: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Time since last lead conversion:\r\n ");
1922: out.write("</td>\r\n ");
1923: out
1924: .write("<td class=\"freeFormSectionField\">\r\n ");
1925: out.print(daysSinceLastLeadConversion(partyId,
1926: daysFromHire, delegator));
1927: out.write(" days\r\n ");
1928: out.write("</td>\r\n ");
1929: out.write("</tr>\r\n ");
1930: out.write("<tr>\r\n ");
1931: out
1932: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Tenure:\r\n ");
1933: out.write("</td>\r\n ");
1934: out
1935: .write("<td class=\"freeFormSectionField\">\r\n ");
1936: out.print(daysFromHire);
1937: out.write(" days\r\n ");
1938: out.write("</td>\r\n ");
1939: out.write("</tr>\r\n ");
1940: out.write("</table>\r\n");
1941: } else {
1942: out.write("\r\n ");
1943: out
1944: .write("<!-- Table for the lifetime info -->\r\n ");
1945: out
1946: .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\">\r\n ");
1947: out.write("<tr>\r\n ");
1948: out
1949: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Time since last sale:\r\n ");
1950: out.write("</td>\r\n ");
1951: out
1952: .write("<td class=\"freeFormSectionField\">\r\n ");
1953: out.print(daysSinceLastSale(partyId, daysFromHire,
1954: delegator));
1955: out.write(" days\r\n ");
1956: out.write("</td>\r\n ");
1957: out.write("</tr>\r\n ");
1958: out.write("<tr>\r\n ");
1959: out
1960: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Tenure:\r\n ");
1961: out.write("</td>\r\n ");
1962: out
1963: .write("<td class=\"freeFormSectionField\">\r\n ");
1964: out.print(daysFromHire);
1965: out.write(" days\r\n ");
1966: out.write("</td>\r\n ");
1967: out.write("</tr>\r\n ");
1968: out.write("<tr>\r\n ");
1969: out
1970: .write("<td class=\"freeFormSectionLabelOptional\">\r\n Personal Goal:\r\n ");
1971: out.write("</td>\r\n ");
1972: out
1973: .write("<td class=\"freeFormSectionField\">\r\n \r\n ");
1974: out.write("</td>\r\n ");
1975: out.write("</tr>\r\n ");
1976: out.write("</table>\r\n");
1977: }
1978: out.write("\r\n\r\n ");
1979: out.write("</td>\r\n ");
1980: out.write("</tr>\r\n ");
1981: out.write("</table>\r\n\r\n ");
1982: out.write("</td>\r\n\r\n ");
1983: out
1984: .write("<!-- Cell for quarterly sales chart -->\r\n ");
1985: out.write("<td valign=\"top\">\r\n\r\n ");
1986: out
1987: .write("<!-- Table for the chart title and chart (to make things line up with the\r\n year-to-date and lifetime area, and makes the header the same size as the contents.) -->\r\n ");
1988: out.write("<table border=\"0\">\r\n ");
1989: out.write("<tr>\r\n ");
1990: out.write("<td>\r\n\r\n");
1991: if (leadDashBoard) {
1992: out.write("\r\n ");
1993: out
1994: .write("<!-- Table for the lead chart title -->\r\n ");
1995: out
1996: .write("<table class=\"freeFormSectionTitleTable\" width=\"100%\">\r\n ");
1997: out.write("<tr>\r\n ");
1998: out
1999: .write("<td>\r\n Leads Converted\r\n ");
2000: out.write("</td>\r\n ");
2001: out.write("</tr>\r\n ");
2002: out.write("</table>\r\n\r\n ");
2003: out
2004: .write("<!-- Table for the chart -->\r\n ");
2005: out
2006: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n ");
2007: out.write("<tr>\r\n ");
2008: out.write("<td>\r\n ");
2009: out.write("<img src=\"");
2010: if (_jspx_meth_ofbiz_url_2(pageContext))
2011: return;
2012: out
2013: .write("?report=leadsForQuarter\">\r\n ");
2014: out.write("</td>\r\n ");
2015: out.write("</tr>\r\n ");
2016: out.write("</table>\r\n");
2017: } else {
2018: out.write("\r\n ");
2019: out
2020: .write("<!-- Table for the chart title -->\r\n ");
2021: out
2022: .write("<table class=\"freeFormSectionTitleTable\" width=\"100%\">\r\n ");
2023: out.write("<tr>\r\n ");
2024: out
2025: .write("<td>\r\n Current Quarter Sales\r\n ");
2026: out.write("</td>\r\n ");
2027: out.write("</tr>\r\n ");
2028: out.write("</table>\r\n\r\n ");
2029: out
2030: .write("<!-- Table for the chart -->\r\n ");
2031: out
2032: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n ");
2033: out.write("<tr>\r\n ");
2034: out.write("<td>\r\n ");
2035: out.write("<img src=\"");
2036: if (_jspx_meth_ofbiz_url_3(pageContext))
2037: return;
2038: out
2039: .write("?report=salesForQuarter\">\r\n ");
2040: out.write("</td>\r\n ");
2041: out.write("</tr>\r\n ");
2042: out.write("</table>\r\n");
2043: }
2044: out.write("\r\n ");
2045: out.write("</td>\r\n ");
2046: out.write("</tr>\r\n ");
2047: out.write("</table>\r\n\r\n ");
2048: out.write("</td>\r\n ");
2049: out.write("<td valign=\"top\">\r\n\r\n ");
2050: out
2051: .write("<!-- Table for calendar (to make things line up with the\r\n year-to-date and lifetime area) -->\r\n ");
2052: out.write("<table border=\"0\">\r\n ");
2053: out.write("<tr>\r\n ");
2054: out.write("<td>\r\n\r\n ");
2055: out
2056: .write("<!-- Table for the calendar -->\r\n ");
2057: out.print(CalendarView.getSmallMonthCalendarHTML(year,
2058: month, iday, "frontpage"));
2059: out.write("\r\n\r\n ");
2060: out.write("</td>\r\n ");
2061: out.write("</tr>\r\n ");
2062: out.write("</table>\r\n\r\n ");
2063: out.write("</td>\r\n ");
2064: out.write("</tr>\r\n ");
2065: out.write("</table>\r\n\r\n ");
2066: out.write("</td>\r\n ");
2067: out.write("</tr>\r\n ");
2068: out.write("<!-- End top half of screen. -->\r\n\r\n ");
2069: out.write("<!-- Start bottom half of screen. -->\r\n ");
2070: out.write("<tr>\r\n ");
2071: out.write("<td>\r\n\r\n ");
2072: out
2073: .write("<!-- Table to hold the columns of the bottom half of the screen -->\r\n ");
2074: out.write("<table border=0>\r\n ");
2075: out.write("<tr>\r\n\r\n ");
2076: out
2077: .write("<!-- Cell to hold the opportunity list. -->\r\n ");
2078: out.write("<td valign=\"top\">\r\n\r\n ");
2079: out
2080: .write("<!-- Table for the opportunity list title and contents\r\n (makes the title the same size as the contents.) -->\r\n ");
2081: out.write("<table border=\"0\">\r\n ");
2082: out.write("<tr>\r\n ");
2083: out.write("<td>\r\n\r\n");
2084: if (leadDashBoard) {
2085: out.write("\r\n ");
2086: out
2087: .write("<!-- Table for the LEAD list title -->\r\n ");
2088: out
2089: .write("<table class=\"tabularSectionTitleTable\" width=\"100%\">\r\n ");
2090: out.write("<tr>\r\n ");
2091: out
2092: .write("<td colspan=2>\r\n Most Recent Open Leads\r\n ");
2093: out.write("</td>\r\n ");
2094: out.write("</tr>\r\n ");
2095: out.write("</table>\r\n\r\n ");
2096: out
2097: .write("<!-- Table for the opportunity list header and contents -->\r\n ");
2098: out
2099: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n\r\n ");
2100: out
2101: .write("<!-- Recent Lead List Header -->\r\n ");
2102: out
2103: .write("<tr class=\"tabularSectionLabel\">\r\n ");
2104: out
2105: .write("<td>\r\n Created\r\n ");
2106: out.write("</td>\r\n ");
2107: out
2108: .write("<td>\r\n Lead Name\r\n ");
2109: out.write("</td>\r\n ");
2110: out
2111: .write("<td>\r\n Units\r\n ");
2112: out.write("</td>\r\n ");
2113: out
2114: .write("<td>\r\n Status\r\n ");
2115: out.write("</td>\r\n ");
2116: out.write("</tr>\r\n\r\n");
2117:
2118: GenericValue leadDetails[] = getRecentLeads(
2119: partyId, delegator);
2120: if (leadDetails.length == 0) {
2121:
2122: out.write("\r\n ");
2123: out
2124: .write("<!-- No Opportunities Found Row -->\r\n ");
2125: out
2126: .write("<tr class=\"tabularSectionField1\">\r\n ");
2127: out
2128: .write("<td colspan=\"4\">\r\n No Open Leads Found\r\n ");
2129: out.write("</td>\r\n ");
2130: out.write("</tr>\r\n ");
2131:
2132: } else {
2133: GenericValue leadDetail = null;
2134: String rowClass = "";
2135: for (int i = 0; i < leadDetails.length; i++) {
2136: if (i > 20)
2137: break;
2138: leadDetail = leadDetails[i];
2139: rowClass = (((i % 2) != 0) ? "tabularSectionField2"
2140: : "tabularSectionField1");
2141: String leadId = leadDetail
2142: .getString("leadId") == null ? ""
2143: : leadDetail.getString("leadId");
2144: String firstName = leadDetail
2145: .getString("firstName") == null ? ""
2146: : leadDetail.getString("firstName");
2147: String lastName = leadDetail
2148: .getString("lastName") == null ? ""
2149: : leadDetail.getString("lastName");
2150: String leadCompanyName = leadDetail
2151: .getString("companyName") == null ? ""
2152: : leadDetail
2153: .getString("companyName");
2154: String leadName = firstName + " "
2155: + lastName;
2156: if (!leadCompanyName.equals(""))
2157: leadName += " (" + leadCompanyName
2158: + ")";
2159: String unitsRequired = decimalFormat
2160: .format(leadDetail
2161: .getLong("unitsRequired") == null ? 0
2162: : leadDetail.getLong(
2163: "unitsRequired")
2164: .longValue());
2165: String createdDateString = simpleDateFormat
2166: .format(leadDetail
2167: .get("createdDate"));
2168: String statusId = leadDetail
2169: .getString("statusId") == null ? ""
2170: : leadDetail.getString("statusId");
2171: String statusDescription = CodeHelper
2172: .getCodeValue("LEAD_STATUS",
2173: statusId, delegator);
2174:
2175: out.write("\r\n ");
2176: out
2177: .write("<!-- Opportunity List Row -->\r\n ");
2178: out.write("<tr class=\"");
2179: out.print(rowClass);
2180: out.write("\">\r\n ");
2181: out.write("<td>\r\n ");
2182: out.print(createdDateString);
2183: out.write("\r\n ");
2184: out.write("</td>\r\n ");
2185: out.write("<td>\r\n ");
2186: out.write("<a href=\"");
2187: if (_jspx_meth_ofbiz_url_4(pageContext))
2188: return;
2189: out.write("?leadId=");
2190: out.print(leadId);
2191: out.write("\">");
2192: out.print(leadName);
2193: out.write("</a>\r\n ");
2194: out.write("</td>\r\n ");
2195: out
2196: .write("<td ALIGN=\"right\">\r\n ");
2197: out.print(unitsRequired);
2198: out.write("\r\n ");
2199: out.write("</td>\r\n ");
2200: out.write("<td>\r\n ");
2201: out.print(statusDescription);
2202: out.write("\r\n ");
2203: out.write("</td>\r\n ");
2204: out.write("</tr>\r\n");
2205:
2206: }
2207: }
2208:
2209: out.write("\r\n ");
2210: out.write("</table>\r\n");
2211: } else {
2212: out.write("\r\n ");
2213: out
2214: .write("<!-- Table for the opportunity list title -->\r\n ");
2215: out
2216: .write("<table class=\"tabularSectionTitleTable\" width=\"100%\">\r\n ");
2217: out.write("<tr>\r\n ");
2218: out
2219: .write("<td colspan=2>\r\n Current Quarter Opportunities\r\n ");
2220: out.write("</td>\r\n ");
2221: out.write("</tr>\r\n ");
2222: out.write("</table>\r\n\r\n ");
2223: out
2224: .write("<!-- Table for the opportunity list header and contents -->\r\n ");
2225: out
2226: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n\r\n ");
2227: out
2228: .write("<!-- Opportunity List Header -->\r\n ");
2229: out
2230: .write("<tr class=\"tabularSectionLabel\">\r\n ");
2231: out
2232: .write("<td>\r\n Projected Close\r\n ");
2233: out.write("</td>\r\n ");
2234: out
2235: .write("<td>\r\n Opportunity Name\r\n ");
2236: out.write("</td>\r\n ");
2237: out
2238: .write("<td>\r\n Amount\r\n ");
2239: out.write("</td>\r\n ");
2240: out
2241: .write("<td>\r\n Status\r\n ");
2242: out.write("</td>\r\n ");
2243: out.write("</tr>\r\n\r\n");
2244:
2245: GenericValue dealDetails[] = getQuarterlyOpportunities(
2246: partyId, delegator, fyStartMonth);
2247: if (dealDetails.length == 0) {
2248:
2249: out.write("\r\n ");
2250: out
2251: .write("<!-- No Opportunities Found Row -->\r\n ");
2252: out
2253: .write("<tr class=\"tabularSectionField1\">\r\n ");
2254: out
2255: .write("<td colspan=\"4\">\r\n No Opportunities Found\r\n ");
2256: out.write("</td>\r\n ");
2257: out.write("</tr>\r\n ");
2258:
2259: } else {
2260: GenericValue dealDetail = null;
2261: String rowClass = "";
2262: for (int i = 0; i < dealDetails.length; i++) {
2263: if (i > 20)
2264: break;
2265: dealDetail = dealDetails[i];
2266: rowClass = (((i % 2) != 0) ? "tabularSectionField2"
2267: : "tabularSectionField1");
2268: String dealStatusId = dealDetail
2269: .getString("dealStatusId") == null ? ""
2270: : dealDetail
2271: .getString("dealStatusId");
2272: String dealStatusDescription = CodeHelper
2273: .getCodeValue("OPPORTUNITY_STATUS",
2274: dealStatusId, delegator);
2275: if (dealDetail.getString("dealStatusId")
2276: .equals("10")
2277: && dealDetail
2278: .get("actualCloseDate") != null) {
2279: String actualCloseDateString = simpleDateFormat
2280: .format(dealDetail
2281: .get("actualCloseDate"));
2282: dealStatusDescription += " on "
2283: + actualCloseDateString;
2284: }
2285:
2286: out.write("\r\n ");
2287: out
2288: .write("<!-- Opportunity List Row -->\r\n ");
2289: out.write("<tr class=\"");
2290: out.print(rowClass);
2291: out.write("\">\r\n ");
2292: out.write("<td>\r\n ");
2293: out
2294: .print(simpleDateFormat
2295: .format(dealDetail
2296: .get("projectedCloseDate")));
2297: out.write("\r\n ");
2298: out.write("</td>\r\n ");
2299: out.write("<td>\r\n ");
2300: out.write("<a href=\"");
2301: if (_jspx_meth_ofbiz_url_5(pageContext))
2302: return;
2303: out.write("?dealId=");
2304: out.print(dealDetail.get("dealId"));
2305: out.write("\">");
2306: out.print(dealDetail.get("dealName"));
2307: out.write("</a>\r\n ");
2308: out.write("</td>\r\n ");
2309: out
2310: .write("<td ALIGN=\"right\">\r\n $");
2311: out.print(decimalFormat.format(dealDetail
2312: .get("amount")));
2313: out.write("\r\n ");
2314: out.write("</td>\r\n ");
2315: out.write("<td>\r\n ");
2316: out.print(dealStatusDescription);
2317: out.write("\r\n ");
2318: out.write("</td>\r\n ");
2319: out.write("</tr>\r\n");
2320:
2321: }
2322: }
2323:
2324: out.write("\r\n ");
2325: out.write("</table>\r\n");
2326: }
2327: out.write("\r\n ");
2328: out.write("</td>\r\n ");
2329: out.write("</tr>\r\n ");
2330: out.write("</table>\r\n\r\n ");
2331: out.write("</td>\r\n\r\n ");
2332: out.write("<!-- Cell for activity list -->\r\n ");
2333: out.write("<td valign=\"top\">\r\n\r\n ");
2334: out
2335: .write("<!-- Table to divide the 2 activity lists -->\r\n ");
2336: out.write("<table border=\"0\">\r\n ");
2337: out.write("<tr>\r\n ");
2338: out.write("<td>\r\n\r\n ");
2339: out
2340: .write("<!-- Table for the daily activity list title -->\r\n ");
2341: out
2342: .write("<table class=\"tabularSectionTitleTable\" width=\"100%\">\r\n ");
2343: out.write("<tr>\r\n ");
2344: out
2345: .write("<td colspan=2>\r\n Activities For ");
2346: out.print(month);
2347: out.write("/");
2348: out.print(iday);
2349: out.write("/");
2350: out.print(year);
2351: out.write("\r\n ");
2352: out.write("</td>\r\n ");
2353: out.write("</tr>\r\n ");
2354: out.write("</table>\r\n\r\n");
2355:
2356: GenericValue activityDetails[] = getDailyActivities(
2357: partyId, selectedDayCalendar, delegator);
2358:
2359: out.write("\r\n\r\n ");
2360: out
2361: .write("<!-- Table for daily activity list -->\r\n ");
2362: out.write(" ");
2363: out
2364: .write("<!-- Table for the Activity list header and contents -->\r\n ");
2365: out
2366: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n\r\n ");
2367: out
2368: .write("<!-- Activity List Header -->\r\n ");
2369: out
2370: .write("<tr class=\"tabularSectionLabel\">\r\n ");
2371: out.write("<td>\r\n Type\r\n ");
2372: out.write("</td>\r\n ");
2373: out
2374: .write("<td>\r\n Activity Name\r\n ");
2375: out.write("</td>\r\n ");
2376: out.write("<td>\r\n Date\r\n ");
2377: out.write("</td>\r\n ");
2378: out
2379: .write("<td>\r\n Start Time\r\n ");
2380: out.write("</td>\r\n ");
2381: out
2382: .write("<td>\r\n End Time\r\n ");
2383: out.write("</td>\r\n ");
2384: out.write("<td>\r\n Status\r\n ");
2385: out.write("</td>\r\n ");
2386: out.write("</tr>\r\n\r\n");
2387:
2388: if (activityDetails.length == 0) {
2389:
2390: out.write("\r\n ");
2391: out
2392: .write("<!-- No Activities Found Row -->\r\n ");
2393: out
2394: .write("<tr class=\"tabularSectionField1\">\r\n ");
2395: out
2396: .write("<td colspan=\"5\">\r\n No Activities Found\r\n ");
2397: out.write("</td>\r\n ");
2398: out.write("</tr>\r\n");
2399:
2400: } else {
2401: GenericValue activityDetail = null;
2402: String rowClass = "";
2403: for (int i = 0; i < activityDetails.length; i++) {
2404: if (i > 20)
2405: break;
2406: activityDetail = activityDetails[i];
2407: rowClass = (((i % 2) != 0) ? "tabularSectionField2"
2408: : "tabularSectionField1");
2409:
2410: String activityTypeId = activityDetail
2411: .getString("activityTypeId") == null ? ""
2412: : activityDetail
2413: .getString("activityTypeId");
2414: String activityTypeDesc = CodeHelper
2415: .getCodeValue("ACTIVITY_TYPE",
2416: activityTypeId, delegator);
2417: String statusId = activityDetail
2418: .getString("statusId") == null ? ""
2419: : activityDetail.getString("statusId");
2420: String statusDescription = CodeHelper
2421: .getCodeValue("ACTIVITY_STATUS",
2422: statusId, delegator);
2423:
2424: out.write("\r\n ");
2425: out
2426: .write("<!-- Activity List Row -->\r\n ");
2427: out.write("<tr class=\"");
2428: out.print(rowClass);
2429: out.write("\">\r\n ");
2430: out.write("<td>\r\n ");
2431: out.print(activityTypeDesc);
2432: out.write("\r\n ");
2433: out.write("</td>\r\n ");
2434: out.write("<td>\r\n ");
2435: out.write("<a href=\"");
2436: if (_jspx_meth_ofbiz_url_6(pageContext))
2437: return;
2438: out.write("?activityId=");
2439: out.print(activityDetail.get("activityId"));
2440: out
2441: .write("\" TARGET=\"activityPopup\">\r\n ");
2442: out.print(activityDetail.get("activityName"));
2443: out.write("\r\n ");
2444: out.write("</a>\r\n ");
2445: out.write("</td>\r\n ");
2446: out.write("<td>\r\n ");
2447: out
2448: .print((activityDetail
2449: .getString("openDate") == null
2450: || activityDetail.getString(
2451: "openDate")
2452: .equalsIgnoreCase(
2453: "null") ? "None"
2454: : simpleDateFormat
2455: .format(activityDetail
2456: .get("openDate"))));
2457: out.write("\r\n ");
2458: out.write("</td>\r\n ");
2459: out.write("<td>\r\n ");
2460: out
2461: .print((activityDetail
2462: .getString("openStartTime") == null
2463: || activityDetail.getString(
2464: "openStartTime")
2465: .equalsIgnoreCase(
2466: "null") ? "None"
2467: : simpleTimeFormat
2468: .format(activityDetail
2469: .get("openStartTime"))));
2470: out.write("\r\n ");
2471: out.write("</td>\r\n ");
2472: out.write("<td>\r\n ");
2473: out
2474: .print((activityDetail
2475: .getString("openEndTime") == null
2476: || activityDetail.getString(
2477: "openEndTime")
2478: .equalsIgnoreCase(
2479: "null") ? "None"
2480: : simpleTimeFormat
2481: .format(activityDetail
2482: .get("openEndTime"))));
2483: out.write("\r\n ");
2484: out.write("</td>\r\n ");
2485: out.write("<td>\r\n ");
2486: out.print(statusDescription);
2487: out.write("\r\n ");
2488: out.write("</td>\r\n ");
2489: out.write("</tr>\r\n\r\n");
2490:
2491: }
2492: }
2493:
2494: out.write("\r\n ");
2495: out.write("</table>\r\n\r\n");
2496: out.write("\r\n\r\n ");
2497: out.write("</td>\r\n ");
2498: out.write("</tr>\r\n ");
2499: out.write("<tr>\r\n ");
2500: out.write("<td>\r\n\r\n ");
2501: out
2502: .write("<!-- Table for the daily activity list title -->\r\n ");
2503: out
2504: .write("<table class=\"tabularSectionTitleTable\" width=\"100%\">\r\n ");
2505: out.write("<tr>\r\n ");
2506: out
2507: .write("<td colspan=2>\r\n All Incomplete Activities\r\n ");
2508: out.write("</td>\r\n ");
2509: out.write("</tr>\r\n ");
2510: out.write("</table>\r\n\r\n");
2511:
2512: activityDetails = getIncompleteActivities(partyId,
2513: delegator);
2514:
2515: out.write("\r\n\r\n ");
2516: out
2517: .write("<!-- Table for incomplete activities list -->\r\n ");
2518: out.write(" ");
2519: out
2520: .write("<!-- Table for the Activity list header and contents -->\r\n ");
2521: out
2522: .write("<table class=\"tabularSectionDisplayTable\" width=\"100%\">\r\n\r\n ");
2523: out
2524: .write("<!-- Activity List Header -->\r\n ");
2525: out
2526: .write("<tr class=\"tabularSectionLabel\">\r\n ");
2527: out.write("<td>\r\n Type\r\n ");
2528: out.write("</td>\r\n ");
2529: out
2530: .write("<td>\r\n Activity Name\r\n ");
2531: out.write("</td>\r\n ");
2532: out.write("<td>\r\n Date\r\n ");
2533: out.write("</td>\r\n ");
2534: out
2535: .write("<td>\r\n Start Time\r\n ");
2536: out.write("</td>\r\n ");
2537: out
2538: .write("<td>\r\n End Time\r\n ");
2539: out.write("</td>\r\n ");
2540: out.write("<td>\r\n Status\r\n ");
2541: out.write("</td>\r\n ");
2542: out.write("</tr>\r\n\r\n");
2543:
2544: if (activityDetails.length == 0) {
2545:
2546: out.write("\r\n ");
2547: out
2548: .write("<!-- No Activities Found Row -->\r\n ");
2549: out
2550: .write("<tr class=\"tabularSectionField1\">\r\n ");
2551: out
2552: .write("<td colspan=\"5\">\r\n No Activities Found\r\n ");
2553: out.write("</td>\r\n ");
2554: out.write("</tr>\r\n");
2555:
2556: } else {
2557: GenericValue activityDetail = null;
2558: String rowClass = "";
2559: for (int i = 0; i < activityDetails.length; i++) {
2560: if (i > 20)
2561: break;
2562: activityDetail = activityDetails[i];
2563: rowClass = (((i % 2) != 0) ? "tabularSectionField2"
2564: : "tabularSectionField1");
2565:
2566: String activityTypeId = activityDetail
2567: .getString("activityTypeId") == null ? ""
2568: : activityDetail
2569: .getString("activityTypeId");
2570: String activityTypeDesc = CodeHelper
2571: .getCodeValue("ACTIVITY_TYPE",
2572: activityTypeId, delegator);
2573: String statusId = activityDetail
2574: .getString("statusId") == null ? ""
2575: : activityDetail.getString("statusId");
2576: String statusDescription = CodeHelper
2577: .getCodeValue("ACTIVITY_STATUS",
2578: statusId, delegator);
2579:
2580: out.write("\r\n ");
2581: out
2582: .write("<!-- Activity List Row -->\r\n ");
2583: out.write("<tr class=\"");
2584: out.print(rowClass);
2585: out.write("\">\r\n ");
2586: out.write("<td>\r\n ");
2587: out.print(activityTypeDesc);
2588: out.write("\r\n ");
2589: out.write("</td>\r\n ");
2590: out.write("<td>\r\n ");
2591: out.write("<a href=\"");
2592: if (_jspx_meth_ofbiz_url_7(pageContext))
2593: return;
2594: out.write("?activityId=");
2595: out.print(activityDetail.get("activityId"));
2596: out
2597: .write("\" TARGET=\"activityPopup\">\r\n ");
2598: out.print(activityDetail.get("activityName"));
2599: out.write("\r\n ");
2600: out.write("</a>\r\n ");
2601: out.write("</td>\r\n ");
2602: out.write("<td>\r\n ");
2603: out
2604: .print((activityDetail
2605: .getString("openDate") == null
2606: || activityDetail.getString(
2607: "openDate")
2608: .equalsIgnoreCase(
2609: "null") ? "None"
2610: : simpleDateFormat
2611: .format(activityDetail
2612: .get("openDate"))));
2613: out.write("\r\n ");
2614: out.write("</td>\r\n ");
2615: out.write("<td>\r\n ");
2616: out
2617: .print((activityDetail
2618: .getString("openStartTime") == null
2619: || activityDetail.getString(
2620: "openStartTime")
2621: .equalsIgnoreCase(
2622: "null") ? "None"
2623: : simpleTimeFormat
2624: .format(activityDetail
2625: .get("openStartTime"))));
2626: out.write("\r\n ");
2627: out.write("</td>\r\n ");
2628: out.write("<td>\r\n ");
2629: out
2630: .print((activityDetail
2631: .getString("openEndTime") == null
2632: || activityDetail.getString(
2633: "openEndTime")
2634: .equalsIgnoreCase(
2635: "null") ? "None"
2636: : simpleTimeFormat
2637: .format(activityDetail
2638: .get("openEndTime"))));
2639: out.write("\r\n ");
2640: out.write("</td>\r\n ");
2641: out.write("<td>\r\n ");
2642: out.print(statusDescription);
2643: out.write("\r\n ");
2644: out.write("</td>\r\n ");
2645: out.write("</tr>\r\n\r\n");
2646:
2647: }
2648: }
2649:
2650: out.write("\r\n ");
2651: out.write("</table>\r\n\r\n");
2652: out.write("\r\n\r\n ");
2653: out.write("</td>\r\n ");
2654: out.write("</tr>\r\n ");
2655: out.write("</table>\r\n\r\n ");
2656: out.write("</td>\r\n ");
2657: out.write("</tr>\r\n ");
2658: out.write("</table>\r\n\r\n ");
2659: out.write("</td>\r\n ");
2660: out.write("</tr>\r\n ");
2661: out
2662: .write("<!-- End bottom half of screen. -->\r\n\r\n");
2663: out.write("</table>\r\n");
2664: out.write("</table>\r\n\r\n \t ");
2665: out
2666: .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n\t\t ");
2667: out.write("<tr>\r\n\t\t ");
2668: out.write("<td TD WIDTH=\"453\">\r\n\t\t \t\t");
2669: out.write("<p align=\"Center\">");
2670: out
2671: .write("<img border=\"0\" src=\"/sfaimages/people.jpg\" >");
2672: out.write("</p>\r\n\t\t ");
2673: out.write("</td>\r\n\t\t ");
2674: out.write("<td>\r\n\t\t ");
2675: out.write("</tr>\r\n\t ");
2676: out.write("</TABLE>\r\n\r\n");
2677: } else {
2678: out.write("\r\n\r\n");
2679: String previousParams = (String) session
2680: .getAttribute("_PREVIOUS_PARAMS_");
2681: out.write("\r\n");
2682: String loginFormUrl = controlPath + "/login";
2683: if (previousParams != null)
2684: loginFormUrl = loginFormUrl + "?" + previousParams;
2685: out.write("\r\n\r\n");
2686: out
2687: .write("<SCRIPT FOR=\"window\" EVENT=\"onload\" LANGUAGE=\"JavaScript\">\r\n\t// Reload the menu to clear the menu items.\r\n\tparent.parent.menu.location.href = parent.parent.menu.location.href;\r\n");
2688: out.write("</SCRIPT>\r\n");
2689: out
2690: .write("<SCRIPT FOR=\"window\" EVENT=\"onunload\" LANGUAGE=\"JavaScript\">\r\n\t// Reload the menu to clear the menu items.\r\n\tparent.parent.menu.location.href = parent.parent.menu.location.href;\r\n");
2691: out.write("</SCRIPT>\r\n\r\n \t ");
2692: out
2693: .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n\r\n\t\t ");
2694: out.write("<tr>\r\n\t\t ");
2695: out.write("<td TD WIDTH=\"453\">\r\n\t\t \t\t");
2696: out.write("<p align=\"Center\">");
2697: out
2698: .write("<img border=\"0\" src=\"/sfaimages/Financial-people-shadow.jpg\" >");
2699: out.write("</p>\r\n\t\t ");
2700: out.write("</td>\r\n\t\t ");
2701: out.write("<td>\r\n\r\n ");
2702: out
2703: .write("<TABLE CLASS=\"freeFormSectionDisplayTable\" HEIGHT=\"100%\">\r\n ");
2704: out.write("<TR>\r\n ");
2705: out.write("<TD VALIGN=\"top\">\r\n\r\n ");
2706: out
2707: .write("<TABLE WIDTH=\"100%\" CLASS=\"freeFormSectionTitleTable\">\r\n ");
2708: out.write("<TR>\r\n ");
2709: out.write("<TD WIDTH=\"100%\">\r\n ");
2710: out
2711: .write("<img src=/sfaimages/sf_keys.gif>Registered User Login\r\n ");
2712: out.write("</TD>\r\n ");
2713: out.write("</TR>\r\n ");
2714: out.write("</TABLE>\r\n\r\n\r\n\r\n ");
2715: out
2716: .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n ");
2717: out.write("<form method=\"POST\" action=\"");
2718: out.print(response.encodeURL(loginFormUrl));
2719: out
2720: .write("\" name=\"loginform\" style='margin: 0;'>\r\n\r\n ");
2721: out.write("<tr>\r\n ");
2722: out.write("<td>\r\n \r\n ");
2723: out.write("</td>\r\n ");
2724: out.write("<td>\r\n ");
2725: out.write("</td>\r\n ");
2726: out.write("<td WIDTH=\"*\">\r\n ");
2727: out.write("</td>\r\n ");
2728: out.write("</tr>\r\n\r\n ");
2729: out.write("<TR>\r\n ");
2730: out
2731: .write("<td CLASS=\"head3\" WIDTH=\"100\">\r\n User ID:\r\n ");
2732: out.write("</td>\r\n ");
2733: out
2734: .write("<td CLASS=\"head3\" WIDTH=\"100\">\r\n ");
2735: out
2736: .write("<input type=\"text\" name=\"USERNAME\" value=\"");
2737: out.print(UtilFormatOut.checkNull(request
2738: .getParameter("USERNAME")));
2739: out.write("\" size=\"20\">\r\n ");
2740: out.write("</td>\r\n ");
2741: out.write("<td WIDTH=\"*\">\r\n ");
2742: out.write("</td>\r\n ");
2743: out.write("</tr>\r\n\r\n ");
2744: out.write("<tr>\r\n ");
2745: out
2746: .write("<td CLASS=\"head3\">\r\n Password:\r\n ");
2747: out.write("</td>\r\n ");
2748: out.write("<td CLASS=\"head3\">\r\n ");
2749: out
2750: .write("<input type=\"password\" name=\"PASSWORD\" value=\"\" size=\"20\">\r\n ");
2751: out.write("</td>\r\n ");
2752: out.write("<td WIDTH=\"*\">\r\n ");
2753: out.write("</td>\r\n ");
2754: out.write("</tr>\r\n\r\n ");
2755: out.write("<tr>\r\n ");
2756: out.write("<td>\r\n ");
2757: out.write("</td>\r\n ");
2758: out.write("<td>\r\n ");
2759: out
2760: .write("<input type=\"submit\" value=\"Login\">\r\n ");
2761: out.write("</td>\r\n ");
2762: out.write("<td>\r\n ");
2763: out.write("</td>\r\n ");
2764: out.write("</tr>\r\n ");
2765: out.write("</form>\r\n ");
2766: out.write("</TABLE>\r\n\r\n ");
2767: out.write("<B>");
2768: out.write("<BR>");
2769: out
2770: .write("<RB>If your company is not registered yet, ");
2771: out.write("<a href=\"");
2772: if (_jspx_meth_ofbiz_url_8(pageContext))
2773: return;
2774: out
2775: .write("?action=showInsert\" target='content'> click here to set up a new company.");
2776: out.write("</a>");
2777: out.write("</B>\r\n ");
2778: out.write("<P>\r\n ");
2779: out.write("<B>");
2780: out.write("<BR>");
2781: out
2782: .write("<RB>For instructions on how to use this system, ");
2783: out
2784: .write("<a href=\"/sfaimages/GettingStarted.pdf\" target=_blank_>click here to download the GettingStarted Guide");
2785: out.write("</a>.");
2786: out.write("</B>\r\n\r\n\r\n ");
2787: out.write("</TD>\r\n ");
2788: out.write("</TR>\r\n ");
2789: out.write("<TR HEIGHT=\"*\">\r\n ");
2790: out.write("<TD>\r\n ");
2791: out.write("</TD>\r\n ");
2792: out.write("</TR>\r\n ");
2793: out.write("</TABLE>\r\n \r\n \t\t\t\t");
2794: out.write("</td>\r\n\t\t ");
2795: out.write("</tr>\r\n\t\t ");
2796: out.write("<TR>");
2797: out.write("<TD WIDTH=\"453\">\r\n\t\t \t\t");
2798: out.write("</TD>\r\n\t\t ");
2799: out.write("</tr>\r\n\t");
2800: out.write("</table>\r\n\r\n");
2801: out.write("<script language=\"JavaScript\">\r\n");
2802: out
2803: .write("<!--\r\n document.loginform.USERNAME.focus();\r\n//-->\r\n");
2804: out.write("</script>\r\n\r\n");
2805: out.write("\r\n\r\n");
2806: }
2807: out.write("\r\n\r\n");
2808: out.write(" ");
2809: out.write("<!-- left column table -->\r\n ");
2810: out.write("</td>\r\n ");
2811: out.write("</tr>\r\n");
2812: out.write("</table>\r\n\r\n\r\n");
2813: out
2814: .write("<!-- used to get dynamic information from a server -->\r\n");
2815: out
2816: .write("<A style='visibility:hidden' id='searchA' name='searchA' target=\"searchIFrame\">");
2817: out.write("</A>\r\n");
2818: out
2819: .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();' >");
2820: out.write("</iframe>\r\n");
2821: out.write("<!--");
2822: out
2823: .write("<iframe id='searchIFrame' name='searchIFrame' WIDTH=\"100%\" onload='updateForm();' >");
2824: out.write("</iframe>-->\r\n\r\n\r\n");
2825: out.write("</body>\r\n");
2826: out.write("</html>\r\n");
2827: out.write("\r\n");
2828: } catch (Throwable t) {
2829: out = _jspx_out;
2830: if (out != null && out.getBufferSize() != 0)
2831: out.clearBuffer();
2832: if (pageContext != null)
2833: pageContext.handlePageException(t);
2834: } finally {
2835: if (_jspxFactory != null)
2836: _jspxFactory.releasePageContext(pageContext);
2837: }
2838: }
2839:
2840: private boolean _jspx_meth_ofbiz_url_0(
2841: javax.servlet.jsp.PageContext pageContext) throws Throwable {
2842: JspWriter out = pageContext.getOut();
2843: /* ---- ofbiz:url ---- */
2844: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_0 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2845: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2846: _jspx_th_ofbiz_url_0.setPageContext(pageContext);
2847: _jspx_th_ofbiz_url_0.setParent(null);
2848: int _jspx_eval_ofbiz_url_0 = _jspx_th_ofbiz_url_0.doStartTag();
2849: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2850: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2851: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2852: .pushBody();
2853: out = _bc;
2854: _jspx_th_ofbiz_url_0.setBodyContent(_bc);
2855: _jspx_th_ofbiz_url_0.doInitBody();
2856: }
2857: do {
2858: out.write("/testServer");
2859: int evalDoAfterBody = _jspx_th_ofbiz_url_0
2860: .doAfterBody();
2861: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2862: break;
2863: } while (true);
2864: if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2865: out = pageContext.popBody();
2866: }
2867: if (_jspx_th_ofbiz_url_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2868: return true;
2869: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_0);
2870: return false;
2871: }
2872:
2873: private boolean _jspx_meth_ofbiz_url_1(
2874: javax.servlet.jsp.PageContext pageContext) throws Throwable {
2875: JspWriter out = pageContext.getOut();
2876: /* ---- ofbiz:url ---- */
2877: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_1 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2878: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2879: _jspx_th_ofbiz_url_1.setPageContext(pageContext);
2880: _jspx_th_ofbiz_url_1.setParent(null);
2881: int _jspx_eval_ofbiz_url_1 = _jspx_th_ofbiz_url_1.doStartTag();
2882: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2883: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2884: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2885: .pushBody();
2886: out = _bc;
2887: _jspx_th_ofbiz_url_1.setBodyContent(_bc);
2888: _jspx_th_ofbiz_url_1.doInitBody();
2889: }
2890: do {
2891: out.write("/testServer");
2892: int evalDoAfterBody = _jspx_th_ofbiz_url_1
2893: .doAfterBody();
2894: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2895: break;
2896: } while (true);
2897: if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2898: out = pageContext.popBody();
2899: }
2900: if (_jspx_th_ofbiz_url_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2901: return true;
2902: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_1);
2903: return false;
2904: }
2905:
2906: private boolean _jspx_meth_ofbiz_url_2(
2907: javax.servlet.jsp.PageContext pageContext) throws Throwable {
2908: JspWriter out = pageContext.getOut();
2909: /* ---- ofbiz:url ---- */
2910: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_2 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2911: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2912: _jspx_th_ofbiz_url_2.setPageContext(pageContext);
2913: _jspx_th_ofbiz_url_2.setParent(null);
2914: int _jspx_eval_ofbiz_url_2 = _jspx_th_ofbiz_url_2.doStartTag();
2915: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2916: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2917: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2918: .pushBody();
2919: out = _bc;
2920: _jspx_th_ofbiz_url_2.setBodyContent(_bc);
2921: _jspx_th_ofbiz_url_2.doInitBody();
2922: }
2923: do {
2924: out.write("/ChartServlet");
2925: int evalDoAfterBody = _jspx_th_ofbiz_url_2
2926: .doAfterBody();
2927: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2928: break;
2929: } while (true);
2930: if (_jspx_eval_ofbiz_url_2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2931: out = pageContext.popBody();
2932: }
2933: if (_jspx_th_ofbiz_url_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2934: return true;
2935: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_2);
2936: return false;
2937: }
2938:
2939: private boolean _jspx_meth_ofbiz_url_3(
2940: javax.servlet.jsp.PageContext pageContext) throws Throwable {
2941: JspWriter out = pageContext.getOut();
2942: /* ---- ofbiz:url ---- */
2943: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_3 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2944: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2945: _jspx_th_ofbiz_url_3.setPageContext(pageContext);
2946: _jspx_th_ofbiz_url_3.setParent(null);
2947: int _jspx_eval_ofbiz_url_3 = _jspx_th_ofbiz_url_3.doStartTag();
2948: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2949: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2950: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2951: .pushBody();
2952: out = _bc;
2953: _jspx_th_ofbiz_url_3.setBodyContent(_bc);
2954: _jspx_th_ofbiz_url_3.doInitBody();
2955: }
2956: do {
2957: out.write("/ChartServlet");
2958: int evalDoAfterBody = _jspx_th_ofbiz_url_3
2959: .doAfterBody();
2960: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2961: break;
2962: } while (true);
2963: if (_jspx_eval_ofbiz_url_3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2964: out = pageContext.popBody();
2965: }
2966: if (_jspx_th_ofbiz_url_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2967: return true;
2968: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_3);
2969: return false;
2970: }
2971:
2972: private boolean _jspx_meth_ofbiz_url_4(
2973: javax.servlet.jsp.PageContext pageContext) throws Throwable {
2974: JspWriter out = pageContext.getOut();
2975: /* ---- ofbiz:url ---- */
2976: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_4 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2977: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2978: _jspx_th_ofbiz_url_4.setPageContext(pageContext);
2979: _jspx_th_ofbiz_url_4.setParent(null);
2980: int _jspx_eval_ofbiz_url_4 = _jspx_th_ofbiz_url_4.doStartTag();
2981: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2982: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2983: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2984: .pushBody();
2985: out = _bc;
2986: _jspx_th_ofbiz_url_4.setBodyContent(_bc);
2987: _jspx_th_ofbiz_url_4.doInitBody();
2988: }
2989: do {
2990: out.write("/leads");
2991: int evalDoAfterBody = _jspx_th_ofbiz_url_4
2992: .doAfterBody();
2993: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2994: break;
2995: } while (true);
2996: if (_jspx_eval_ofbiz_url_4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2997: out = pageContext.popBody();
2998: }
2999: if (_jspx_th_ofbiz_url_4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
3000: return true;
3001: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_4);
3002: return false;
3003: }
3004:
3005: private boolean _jspx_meth_ofbiz_url_5(
3006: javax.servlet.jsp.PageContext pageContext) throws Throwable {
3007: JspWriter out = pageContext.getOut();
3008: /* ---- ofbiz:url ---- */
3009: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_5 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
3010: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
3011: _jspx_th_ofbiz_url_5.setPageContext(pageContext);
3012: _jspx_th_ofbiz_url_5.setParent(null);
3013: int _jspx_eval_ofbiz_url_5 = _jspx_th_ofbiz_url_5.doStartTag();
3014: if (_jspx_eval_ofbiz_url_5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
3015: if (_jspx_eval_ofbiz_url_5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
3016: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
3017: .pushBody();
3018: out = _bc;
3019: _jspx_th_ofbiz_url_5.setBodyContent(_bc);
3020: _jspx_th_ofbiz_url_5.doInitBody();
3021: }
3022: do {
3023: out.write("/deals");
3024: int evalDoAfterBody = _jspx_th_ofbiz_url_5
3025: .doAfterBody();
3026: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
3027: break;
3028: } while (true);
3029: if (_jspx_eval_ofbiz_url_5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
3030: out = pageContext.popBody();
3031: }
3032: if (_jspx_th_ofbiz_url_5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
3033: return true;
3034: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_5);
3035: return false;
3036: }
3037:
3038: private boolean _jspx_meth_ofbiz_url_6(
3039: javax.servlet.jsp.PageContext pageContext) throws Throwable {
3040: JspWriter out = pageContext.getOut();
3041: /* ---- ofbiz:url ---- */
3042: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_6 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
3043: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
3044: _jspx_th_ofbiz_url_6.setPageContext(pageContext);
3045: _jspx_th_ofbiz_url_6.setParent(null);
3046: int _jspx_eval_ofbiz_url_6 = _jspx_th_ofbiz_url_6.doStartTag();
3047: if (_jspx_eval_ofbiz_url_6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
3048: if (_jspx_eval_ofbiz_url_6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
3049: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
3050: .pushBody();
3051: out = _bc;
3052: _jspx_th_ofbiz_url_6.setBodyContent(_bc);
3053: _jspx_th_ofbiz_url_6.doInitBody();
3054: }
3055: do {
3056: out.write("/activityPopup");
3057: int evalDoAfterBody = _jspx_th_ofbiz_url_6
3058: .doAfterBody();
3059: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
3060: break;
3061: } while (true);
3062: if (_jspx_eval_ofbiz_url_6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
3063: out = pageContext.popBody();
3064: }
3065: if (_jspx_th_ofbiz_url_6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
3066: return true;
3067: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_6);
3068: return false;
3069: }
3070:
3071: private boolean _jspx_meth_ofbiz_url_7(
3072: javax.servlet.jsp.PageContext pageContext) throws Throwable {
3073: JspWriter out = pageContext.getOut();
3074: /* ---- ofbiz:url ---- */
3075: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_7 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
3076: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
3077: _jspx_th_ofbiz_url_7.setPageContext(pageContext);
3078: _jspx_th_ofbiz_url_7.setParent(null);
3079: int _jspx_eval_ofbiz_url_7 = _jspx_th_ofbiz_url_7.doStartTag();
3080: if (_jspx_eval_ofbiz_url_7 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
3081: if (_jspx_eval_ofbiz_url_7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
3082: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
3083: .pushBody();
3084: out = _bc;
3085: _jspx_th_ofbiz_url_7.setBodyContent(_bc);
3086: _jspx_th_ofbiz_url_7.doInitBody();
3087: }
3088: do {
3089: out.write("/activityPopup");
3090: int evalDoAfterBody = _jspx_th_ofbiz_url_7
3091: .doAfterBody();
3092: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
3093: break;
3094: } while (true);
3095: if (_jspx_eval_ofbiz_url_7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
3096: out = pageContext.popBody();
3097: }
3098: if (_jspx_th_ofbiz_url_7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
3099: return true;
3100: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_7);
3101: return false;
3102: }
3103:
3104: private boolean _jspx_meth_ofbiz_url_8(
3105: javax.servlet.jsp.PageContext pageContext) throws Throwable {
3106: JspWriter out = pageContext.getOut();
3107: /* ---- ofbiz:url ---- */
3108: org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_8 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
3109: .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
3110: _jspx_th_ofbiz_url_8.setPageContext(pageContext);
3111: _jspx_th_ofbiz_url_8.setParent(null);
3112: int _jspx_eval_ofbiz_url_8 = _jspx_th_ofbiz_url_8.doStartTag();
3113: if (_jspx_eval_ofbiz_url_8 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
3114: if (_jspx_eval_ofbiz_url_8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
3115: javax.servlet.jsp.tagext.BodyContent _bc = pageContext
3116: .pushBody();
3117: out = _bc;
3118: _jspx_th_ofbiz_url_8.setBodyContent(_bc);
3119: _jspx_th_ofbiz_url_8.doInitBody();
3120: }
3121: do {
3122: out.write("/createNewAccount");
3123: int evalDoAfterBody = _jspx_th_ofbiz_url_8
3124: .doAfterBody();
3125: if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
3126: break;
3127: } while (true);
3128: if (_jspx_eval_ofbiz_url_8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
3129: out = pageContext.popBody();
3130: }
3131: if (_jspx_th_ofbiz_url_8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
3132: return true;
3133: _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_8);
3134: return false;
3135: }
3136: }
|