Source Code Cross Referenced for leadHome_jsp.java in  » ERP-CRM-Financial » SourceTap-CRM » org » apache » jsp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » SourceTap CRM » org.apache.jsp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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 java.util.Date;
0008:        import java.util.List;
0009:        import java.util.Map;
0010:        import java.util.Vector;
0011:        import java.util.ArrayList;
0012:        import java.util.Enumeration;
0013:        import java.util.Iterator;
0014:        import java.util.HashMap;
0015:        import java.util.Calendar;
0016:        import java.util.StringTokenizer;
0017:        import java.text.SimpleDateFormat;
0018:        import java.text.DecimalFormat;
0019:        import java.text.ParseException;
0020:        import java.sql.Timestamp;
0021:        import java.sql.Time;
0022:        import java.sql.*;
0023:        import org.ofbiz.entity.util.SequenceUtil;
0024:        import org.ofbiz.security.*;
0025:        import org.ofbiz.entity.*;
0026:        import org.ofbiz.entity.condition.*;
0027:        import org.ofbiz.entity.model.*;
0028:        import org.ofbiz.base.util.*;
0029:        import com.sourcetap.sfa.ui.*;
0030:        import com.sourcetap.sfa.event.*;
0031:        import com.sourcetap.sfa.util.UserInfo;
0032:        import com.sourcetap.sfa.lead.*;
0033:        import com.sourcetap.sfa.ui.UIQuery;
0034:
0035:        public class leadHome_jsp extends HttpJspBase {
0036:
0037:            /*
0038:             *  Takes a string in the following format:
0039:             *    formatString
0040:             *  Where the first letter is lowercase, and
0041:             *  subsequent unique words begin with an upper case.
0042:             *  The function will convert a java string to a regular
0043:             *  string in title case format.
0044:             */
0045:            String formatJavaString(String s) {
0046:                char ca[] = s.toCharArray();
0047:                StringBuffer sb = new StringBuffer();
0048:                int previous = 0;
0049:                for (int i = 0; i < ca.length; i++) {
0050:                    if (i == s.length() - 1) {
0051:                        sb.append(s.substring(previous, previous + 1)
0052:                                .toUpperCase());
0053:                        sb.append(s.substring(previous + 1, s.length()));
0054:                    }
0055:                    if (Character.isUpperCase(ca[i])) {
0056:                        sb.append(s.substring(previous, previous + 1)
0057:                                .toUpperCase());
0058:                        sb.append(s.substring(previous + 1, i));
0059:                        sb.append(" ");
0060:                        previous = i;
0061:                    }
0062:                }
0063:                return sb.toString();
0064:            }
0065:
0066:            /**
0067:             Properties must include:
0068:              NAME-name of the select used in name-value form submit.
0069:              VALUE_FIELD-the value sent in form submit.
0070:              DISPLAY_FIELD-the field used in the display of the drop-down. use a
0071:              Properties can include:
0072:              Selected-The value to test for, and set selected on the drop-down
0073:              EMPTY_FIRST: if just a blank field use "{field display vaalue}, else if value supplied use "{field value}, {field value display name}"
0074:             */
0075:            String buildDropDown(List l, Map properties) {
0076:                StringBuffer returnString = new StringBuffer();
0077:                GenericValue genericValue = null;
0078:                Iterator i = l.iterator();
0079:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0080:                        .get("SELECTED")
0081:                        : ""));
0082:                String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0083:                        .get("DISPLAY_FIELD")
0084:                        : ""));
0085:                String selectJavaScript = ((String) (properties
0086:                        .get("SELECT_JAVASCRIPT") != null ? properties
0087:                        .get("SELECT_JAVASCRIPT") : ""));
0088:                returnString.append("<select name=\"" + properties.get("NAME")
0089:                        + "\" " + selectJavaScript + " >");
0090:                if (properties.get("EMPTY_FIRST") != null) {
0091:                    String empty = (String) properties.get("EMPTY_FIRST");
0092:                    if (empty.indexOf(",") != -1) {
0093:                        StringTokenizer tok = new StringTokenizer(empty, ",");
0094:                        returnString.append("<option value=\""
0095:                                + ((String) tok.nextElement()).trim() + "\">"
0096:                                + ((String) tok.nextElement()).trim());
0097:                    } else {
0098:                        returnString.append("<option value=\"\">" + empty);
0099:                    }
0100:                }
0101:                try {
0102:                    while (i.hasNext()) {
0103:                        genericValue = (GenericValue) i.next();
0104:                        returnString.append("<option value=\""
0105:                                + String.valueOf(genericValue
0106:                                        .get((String) properties
0107:                                                .get("VALUE_FIELD"))) + "\"");
0108:                        if (String.valueOf(
0109:                                genericValue.get((String) properties
0110:                                        .get("VALUE_FIELD"))).equals(selected)) {
0111:                            returnString.append(" SELECTED ");
0112:                        }
0113:                        returnString.append(" >");
0114:                        if (display.indexOf(",") != -1) {
0115:                            StringTokenizer tok = new StringTokenizer(display,
0116:                                    ",");
0117:                            while (tok.hasMoreElements()) {
0118:                                String elem = (String) tok.nextElement();
0119:                                returnString.append(String.valueOf(genericValue
0120:                                        .get(elem.trim())));
0121:                                returnString.append(" ");
0122:                            }
0123:                        } else {
0124:                            returnString.append(genericValue.get(display));
0125:                        }
0126:                    }
0127:                } catch (Exception e) {
0128:                    e.printStackTrace();
0129:                }
0130:                returnString.append("</select>");
0131:                return returnString.toString();
0132:            }
0133:
0134:            String buildStringDropDown(List l, Map properties) {
0135:                StringBuffer returnString = new StringBuffer();
0136:                String value = "";
0137:                Iterator i = l.iterator();
0138:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0139:                        .get("SELECTED")
0140:                        : ""));
0141:                String display = ((String) (properties.get("DISPLAY_FIELD") != null ? properties
0142:                        .get("DISPLAY_FIELD")
0143:                        : ""));
0144:                String selectJavaScript = ((String) (properties
0145:                        .get("SELECT_JAVASCRIPT") != null ? properties
0146:                        .get("SELECT_JAVASCRIPT") : ""));
0147:                returnString.append("<select name=\"" + properties.get("NAME")
0148:                        + "\" " + selectJavaScript + " >");
0149:                if (properties.get("EMPTY_FIRST") != null) {
0150:                    String empty = (String) properties.get("EMPTY_FIRST");
0151:                    if (empty.indexOf(",") != -1) {
0152:                        StringTokenizer tok = new StringTokenizer(empty, ",");
0153:                        returnString.append("<option value=\""
0154:                                + ((String) tok.nextElement()).trim() + "\">"
0155:                                + ((String) tok.nextElement()).trim());
0156:                    } else {
0157:                        returnString.append("<option value=\"\">" + empty);
0158:                    }
0159:                }
0160:                while (i.hasNext()) {
0161:                    value = (String) i.next();
0162:                    returnString.append("<option value=\"" + value + "\"");
0163:                    if (value.equals(selected)) {
0164:                        returnString.append(" SELECTED ");
0165:                    }
0166:                    returnString.append(" >");
0167:                    if (display.indexOf(",") != -1) {
0168:                        StringTokenizer tok = new StringTokenizer(display, ",");
0169:                        while (tok.hasMoreElements()) {
0170:                            String elem = (String) tok.nextElement();
0171:                            returnString.append(value);
0172:                            returnString.append(" ");
0173:                        }
0174:                    } else {
0175:                        returnString.append(value);
0176:                    }
0177:                }
0178:                returnString.append("</select>");
0179:                return returnString.toString();
0180:            }
0181:
0182:            String buildFieldDropDown(Vector fields, String entityName,
0183:                    HashMap properties) {
0184:                if (properties == null)
0185:                    properties = new HashMap();
0186:                StringBuffer returnString = new StringBuffer();
0187:                ModelField modelField = null;
0188:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0189:                        .get("SELECTED")
0190:                        : ""));
0191:                returnString.append("<select name=\"" + entityName + "\" >");
0192:                if (properties.get("EMPTY_FIRST") != null)
0193:                    returnString.append("<option value=\"\">"
0194:                            + properties.get("EMPTY_FIRST"));
0195:                for (int i = 0; i < fields.size(); i++) {
0196:                    modelField = (ModelField) fields.get(i);
0197:                    returnString.append("<option value=\""
0198:                            + modelField.getName() + "\"");
0199:                    if ((modelField.getName()).equals(selected)) {
0200:                        returnString.append(" SELECTED ");
0201:                    }
0202:                    returnString.append(" >"
0203:                            + formatJavaString(modelField.getName()));
0204:                }
0205:                returnString.append("</select>");
0206:                return returnString.toString();
0207:            }
0208:
0209:            /**
0210:             * Checks a List of fields to see if the string
0211:             * that is passed in exists in the vector.  If so,
0212:             * it returns the ModelField for the named field, else
0213:             * it returns null.
0214:             */
0215:            ModelField contains(List v, String s) {
0216:                ModelField field;
0217:                for (int i = 0; i < v.size(); i++) {
0218:                    field = (ModelField) v.get(i);
0219:                    if (field.getName().equals(s))
0220:                        return field;
0221:                }
0222:                return null;
0223:            }
0224:
0225:            String buildUIFieldDropDown(String sectionName, List fields,
0226:                    String entityName, HashMap properties) {
0227:                if (properties == null)
0228:                    properties = new HashMap();
0229:                StringBuffer returnString = new StringBuffer();
0230:                UIFieldInfo fieldInfo = null;
0231:                String selected = ((String) (properties.get("SELECTED") != null ? properties
0232:                        .get("SELECTED")
0233:                        : ""));
0234:                returnString.append("<select name=\"" + entityName + "\" >");
0235:                if (properties.get("EMPTY_FIRST") != null)
0236:                    returnString.append("<option value=\"\">"
0237:                            + properties.get("EMPTY_FIRST"));
0238:                for (int i = 0; i < fields.size(); i++) {
0239:                    fieldInfo = (UIFieldInfo) fields.get(i);
0240:                    if (fieldInfo.getIsVisible() && !fieldInfo.getIsReadOnly()) {
0241:                        String attrId = UIWebUtility.getHtmlName(sectionName,
0242:                                fieldInfo, 0);
0243:                        String attrName = fieldInfo.getDisplayLabel();
0244:                        returnString.append("<option value=\"" + attrId + "\"");
0245:                        if (attrName.equals(selected)) {
0246:                            returnString.append(" SELECTED ");
0247:                        }
0248:                        returnString.append(" >" + attrName);
0249:                    }
0250:                }
0251:                returnString.append("</select>");
0252:                return returnString.toString();
0253:            }
0254:
0255:            /**
0256:             * Given a ModelField and a value, this function checks the datatype for the field, and
0257:             * converts the value to the correct datatype.
0258:             */
0259:            GenericValue setCorrectDataType(GenericValue entity,
0260:                    ModelField curField, String value) {
0261:                ModelFieldTypeReader modelFieldTypeReader = new ModelFieldTypeReader(
0262:                        "mysql");
0263:                ModelFieldType mft = modelFieldTypeReader
0264:                        .getModelFieldType(curField.getType());
0265:                String fieldType = mft.getJavaType();
0266:                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
0267:                SimpleDateFormat timeFormat = new SimpleDateFormat(
0268:                        "yyyy-MM-dd hh:mm a");
0269:
0270:                if (fieldType.equals("java.lang.String")
0271:                        || fieldType.equals("String")) {
0272:                    if (mft.getType().equals("indicator")) {
0273:                        if (value.equals("on"))
0274:                            entity.set(curField.getName(), "Y");
0275:                        else if (value.equals("off"))
0276:                            entity.set(curField.getName(), "N");
0277:                        else
0278:                            entity.set(curField.getName(), value);
0279:                    } else
0280:                        entity.set(curField.getName(), value);
0281:                } else if (fieldType.equals("java.sql.Timestamp")
0282:                        || fieldType.equals("Timestamp")) {
0283:                    if (value.trim().length() == 0) {
0284:                        entity.set(curField.getName(), null);
0285:                    } else {
0286:                        try {
0287:                            entity.set(curField.getName(), new Timestamp(
0288:                                    timeFormat.parse(value).getTime()));
0289:                        } catch (ParseException e) {
0290:                            e.printStackTrace();
0291:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0292:                    }
0293:                } else if (fieldType.equals("java.sql.Time")
0294:                        || fieldType.equals("Time")) {
0295:                    if (value.trim().length() == 0) {
0296:                        entity.set(curField.getName(), null);
0297:                    } else {
0298:                        try {
0299:                            entity.set(curField.getName(), new Time(timeFormat
0300:                                    .parse(value).getTime()));
0301:                        } catch (ParseException e) {
0302:                            e.printStackTrace();
0303:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0304:                    }
0305:                } else if (fieldType.equals("java.util.Date")) {
0306:                    if (value.trim().length() == 0) {
0307:                        entity.set(curField.getName(), null);
0308:                    } else {
0309:                        try {
0310:                            entity.set(curField.getName(), new java.sql.Date(
0311:                                    dateFormat.parse(value).getTime()));
0312:                        } catch (ParseException e) {
0313:                            e.printStackTrace();
0314:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0315:                    }
0316:                } else if (fieldType.equals("java.sql.Date")
0317:                        || fieldType.equals("Date")) {
0318:                    if (value.trim().length() == 0) {
0319:                        entity.set(curField.getName(), null);
0320:                    } else {
0321:                        try {
0322:                            entity.set(curField.getName(), new java.sql.Date(
0323:                                    dateFormat.parse(value).getTime()));
0324:                        } catch (ParseException e) {
0325:                            e.printStackTrace();
0326:                        } //WTD: Implement error processing for ParseException.  i.e. get rid of the printStackTrace()
0327:                    }
0328:                } else if (fieldType.equals("java.lang.Integer")
0329:                        || fieldType.equals("Integer")) {
0330:                    if (value.trim().length() == 0)
0331:                        value = "0";
0332:                    entity.set(curField.getName(), Integer.valueOf(value));
0333:                } else if (fieldType.equals("java.lang.Long")
0334:                        || fieldType.equals("Long")) {
0335:                    if (value.trim().length() == 0)
0336:                        value = "0";
0337:                    entity.set(curField.getName(), Long.valueOf(value));
0338:                } else if (fieldType.equals("java.lang.Float")
0339:                        || fieldType.equals("Float")) {
0340:                    if (value.trim().length() == 0)
0341:                        value = "0.0";
0342:                    entity.set(curField.getName(), Float.valueOf(value));
0343:                } else if (fieldType.equals("java.lang.Double")
0344:                        || fieldType.equals("Double")) {
0345:                    if (value.trim().length() == 0 || value == null)
0346:                        value = "0";
0347:                    entity.set(curField.getName(), Double.valueOf(value));
0348:                }
0349:                return entity;
0350:            }
0351:
0352:            String getFieldValue(List l, String fieldName, String equalsValue,
0353:                    String returnFieldName) {
0354:                Iterator i = l.iterator();
0355:                GenericEntity genericEntity = null;
0356:                String retVal = "";
0357:                //TODO: add StringTokenizer to parse multiple fields.
0358:                while (i.hasNext()) {
0359:                    genericEntity = (GenericValue) i.next();
0360:                    if (String.valueOf(genericEntity.get(fieldName)).equals(
0361:                            equalsValue))
0362:                        retVal = String.valueOf(genericEntity
0363:                                .get(returnFieldName));
0364:                }
0365:                return retVal;
0366:            }
0367:
0368:            String getFieldValue(HttpServletRequest request, String fieldName) {
0369:                return (request.getParameter(fieldName) != null ? request
0370:                        .getParameter(fieldName) : "");
0371:            }
0372:
0373:            Vector getGenericValue(List l, String fieldName, String equalsValue) {
0374:                Vector returnVector = new Vector();
0375:                GenericValue genericValue = null;
0376:                GenericValue genericValues[] = (GenericValue[]) l
0377:                        .toArray(new GenericValue[0]);
0378:                for (int i = 0; i < genericValues.length; i++) {
0379:                    genericValue = (GenericValue) genericValues[i];
0380:                    if (String.valueOf(genericValue.get(fieldName)).equals(
0381:                            equalsValue))
0382:                        returnVector.add(genericValue);
0383:                }
0384:                return returnVector;
0385:            }
0386:
0387:            String getDateTimeFieldValue(List l, String fieldName,
0388:                    String equalsValue, String returnFieldName,
0389:                    String dateFormatString) {
0390:                GenericValue genericValue = null;
0391:                GenericValue genericValues[] = (GenericValue[]) l
0392:                        .toArray(new GenericValue[0]);
0393:                String retVal = "";
0394:                SimpleDateFormat dateFormat = new SimpleDateFormat(
0395:                        dateFormatString);
0396:                for (int i = 0; i < genericValues.length; i++) {
0397:                    genericValue = genericValues[i];
0398:                    try {
0399:                        if (dateFormat.parse(genericValue.getString(fieldName))
0400:                                .equals(dateFormat.parse(equalsValue)))
0401:                            retVal = String.valueOf(genericValue
0402:                                    .get(returnFieldName));
0403:                    } catch (ParseException e) {
0404:                        e.printStackTrace();
0405:                    }
0406:                }
0407:                return retVal;
0408:            }
0409:
0410:            Vector getDateTimeGenericValue(List l, String fieldName,
0411:                    String equalsValue, String dateFormatString) {
0412:                Vector returnVector = new Vector();
0413:                GenericValue genericValue = null;
0414:                GenericValue genericValues[] = (GenericValue[]) l
0415:                        .toArray(new GenericValue[0]);
0416:                String retVal = "";
0417:                SimpleDateFormat dateFormat = new SimpleDateFormat(
0418:                        dateFormatString);
0419:                for (int i = 0; i < genericValues.length; i++) {
0420:                    genericValue = genericValues[i];
0421:                    try {
0422:                        if (dateFormat.parse(genericValue.getString(fieldName))
0423:                                .equals(dateFormat.parse(equalsValue)))
0424:                            returnVector.add(genericValue);
0425:                    } catch (ParseException e) {
0426:                        e.printStackTrace();
0427:                    }
0428:                }
0429:                return returnVector;
0430:            }
0431:
0432:            String getStatesDropDown(String name, String selected) {
0433:                if (name == null)
0434:                    return null;
0435:                StringBuffer returnString = new StringBuffer();
0436:                returnString.append("<select class=\"\" name=\"" + name
0437:                        + "\" >");
0438:                returnString.append("<option "
0439:                        + (selected == null || selected.equals("") ? "selected"
0440:                                : "") + " >");
0441:                returnString
0442:                        .append("<option "
0443:                                + (selected != null && selected.equals("AK") ? "selected"
0444:                                        : "") + " >AK");
0445:                returnString
0446:                        .append("<option"
0447:                                + (selected != null
0448:                                        && selected.equalsIgnoreCase("AL") ? " selected"
0449:                                        : "") + ">AL");
0450:                returnString
0451:                        .append("<option"
0452:                                + (selected != null
0453:                                        && selected.equalsIgnoreCase("AR") ? " selected"
0454:                                        : "") + ">AR");
0455:                returnString
0456:                        .append("<option"
0457:                                + (selected != null
0458:                                        && selected.equalsIgnoreCase("AZ") ? " selected"
0459:                                        : "") + ">AZ");
0460:                returnString
0461:                        .append("<option"
0462:                                + (selected != null
0463:                                        && selected.equalsIgnoreCase("CA") ? " selected"
0464:                                        : "") + ">CA");
0465:                returnString
0466:                        .append("<option"
0467:                                + (selected != null
0468:                                        && selected.equalsIgnoreCase("CO") ? " selected"
0469:                                        : "") + ">CO");
0470:                returnString
0471:                        .append("<option"
0472:                                + (selected != null
0473:                                        && selected.equalsIgnoreCase("CT") ? " selected"
0474:                                        : "") + ">CT");
0475:                returnString
0476:                        .append("<option"
0477:                                + (selected != null
0478:                                        && selected.equalsIgnoreCase("DC") ? " selected"
0479:                                        : "") + ">DC");
0480:                returnString
0481:                        .append("<option"
0482:                                + (selected != null
0483:                                        && selected.equalsIgnoreCase("DE") ? " selected"
0484:                                        : "") + ">DE");
0485:                returnString
0486:                        .append("<option"
0487:                                + (selected != null
0488:                                        && selected.equalsIgnoreCase("FL") ? " selected"
0489:                                        : "") + ">FL");
0490:                returnString
0491:                        .append("<option"
0492:                                + (selected != null
0493:                                        && selected.equalsIgnoreCase("GA") ? " selected"
0494:                                        : "") + ">GA");
0495:                returnString
0496:                        .append("<option"
0497:                                + (selected != null
0498:                                        && selected.equalsIgnoreCase("GU") ? " selected"
0499:                                        : "") + ">GU");
0500:                returnString
0501:                        .append("<option"
0502:                                + (selected != null
0503:                                        && selected.equalsIgnoreCase("HI") ? " selected"
0504:                                        : "") + ">HI");
0505:                returnString
0506:                        .append("<option"
0507:                                + (selected != null
0508:                                        && selected.equalsIgnoreCase("IA") ? " selected"
0509:                                        : "") + ">IA");
0510:                returnString
0511:                        .append("<option"
0512:                                + (selected != null
0513:                                        && selected.equalsIgnoreCase("ID") ? " selected"
0514:                                        : "") + ">ID");
0515:                returnString
0516:                        .append("<option"
0517:                                + (selected != null
0518:                                        && selected.equalsIgnoreCase("IL") ? " selected"
0519:                                        : "") + ">IL");
0520:                returnString
0521:                        .append("<option"
0522:                                + (selected != null
0523:                                        && selected.equalsIgnoreCase("IN") ? " selected"
0524:                                        : "") + ">IN");
0525:                returnString
0526:                        .append("<option"
0527:                                + (selected != null
0528:                                        && selected.equalsIgnoreCase("KS") ? " selected"
0529:                                        : "") + ">KS");
0530:                returnString
0531:                        .append("<option"
0532:                                + (selected != null
0533:                                        && selected.equalsIgnoreCase("KY") ? " selected"
0534:                                        : "") + ">KY");
0535:                returnString
0536:                        .append("<option"
0537:                                + (selected != null
0538:                                        && selected.equalsIgnoreCase("LA") ? " selected"
0539:                                        : "") + ">LA");
0540:                returnString
0541:                        .append("<option"
0542:                                + (selected != null
0543:                                        && selected.equalsIgnoreCase("MA") ? " selected"
0544:                                        : "") + ">MA");
0545:                returnString
0546:                        .append("<option"
0547:                                + (selected != null
0548:                                        && selected.equalsIgnoreCase("MD") ? " selected"
0549:                                        : "") + ">MD");
0550:                returnString
0551:                        .append("<option"
0552:                                + (selected != null
0553:                                        && selected.equalsIgnoreCase("ME") ? " selected"
0554:                                        : "") + ">ME");
0555:                returnString
0556:                        .append("<option"
0557:                                + (selected != null
0558:                                        && selected.equalsIgnoreCase("MI") ? " selected"
0559:                                        : "") + ">MI");
0560:                returnString
0561:                        .append("<option"
0562:                                + (selected != null
0563:                                        && selected.equalsIgnoreCase("MN") ? " selected"
0564:                                        : "") + ">MN");
0565:                returnString
0566:                        .append("<option"
0567:                                + (selected != null
0568:                                        && selected.equalsIgnoreCase("MO") ? " selected"
0569:                                        : "") + ">MO");
0570:                returnString
0571:                        .append("<option"
0572:                                + (selected != null
0573:                                        && selected.equalsIgnoreCase("MS") ? " selected"
0574:                                        : "") + ">MS");
0575:                returnString
0576:                        .append("<option"
0577:                                + (selected != null
0578:                                        && selected.equalsIgnoreCase("MT") ? " selected"
0579:                                        : "") + ">MT");
0580:                returnString
0581:                        .append("<option"
0582:                                + (selected != null
0583:                                        && selected.equalsIgnoreCase("NC") ? " selected"
0584:                                        : "") + ">NC");
0585:                returnString
0586:                        .append("<option"
0587:                                + (selected != null
0588:                                        && selected.equalsIgnoreCase("ND") ? " selected"
0589:                                        : "") + ">ND");
0590:                returnString
0591:                        .append("<option"
0592:                                + (selected != null
0593:                                        && selected.equalsIgnoreCase("NE") ? " selected"
0594:                                        : "") + ">NE");
0595:                returnString
0596:                        .append("<option"
0597:                                + (selected != null
0598:                                        && selected.equalsIgnoreCase("NH") ? " selected"
0599:                                        : "") + ">NH");
0600:                returnString
0601:                        .append("<option"
0602:                                + (selected != null
0603:                                        && selected.equalsIgnoreCase("NJ") ? " selected"
0604:                                        : "") + ">NJ");
0605:                returnString
0606:                        .append("<option"
0607:                                + (selected != null
0608:                                        && selected.equalsIgnoreCase("NM") ? " selected"
0609:                                        : "") + ">NM");
0610:                returnString
0611:                        .append("<option"
0612:                                + (selected != null
0613:                                        && selected.equalsIgnoreCase("NV") ? " selected"
0614:                                        : "") + ">NV");
0615:                returnString
0616:                        .append("<option"
0617:                                + (selected != null
0618:                                        && selected.equalsIgnoreCase("NY") ? " selected"
0619:                                        : "") + ">NY");
0620:                returnString
0621:                        .append("<option"
0622:                                + (selected != null
0623:                                        && selected.equalsIgnoreCase("OH") ? " selected"
0624:                                        : "") + ">OH");
0625:                returnString
0626:                        .append("<option"
0627:                                + (selected != null
0628:                                        && selected.equalsIgnoreCase("OK") ? " selected"
0629:                                        : "") + ">OK");
0630:                returnString
0631:                        .append("<option"
0632:                                + (selected != null
0633:                                        && selected.equalsIgnoreCase("OR") ? " selected"
0634:                                        : "") + ">OR");
0635:                returnString
0636:                        .append("<option"
0637:                                + (selected != null
0638:                                        && selected.equalsIgnoreCase("PA") ? " selected"
0639:                                        : "") + ">PA");
0640:                returnString
0641:                        .append("<option"
0642:                                + (selected != null
0643:                                        && selected.equalsIgnoreCase("PR") ? " selected"
0644:                                        : "") + ">PR");
0645:                returnString
0646:                        .append("<option"
0647:                                + (selected != null
0648:                                        && selected.equalsIgnoreCase("RI") ? " selected"
0649:                                        : "") + ">RI");
0650:                returnString
0651:                        .append("<option"
0652:                                + (selected != null
0653:                                        && selected.equalsIgnoreCase("SC") ? " selected"
0654:                                        : "") + ">SC");
0655:                returnString
0656:                        .append("<option"
0657:                                + (selected != null
0658:                                        && selected.equalsIgnoreCase("SD") ? " selected"
0659:                                        : "") + ">SD");
0660:                returnString
0661:                        .append("<option"
0662:                                + (selected != null
0663:                                        && selected.equalsIgnoreCase("TN") ? " selected"
0664:                                        : "") + ">TN");
0665:                returnString
0666:                        .append("<option"
0667:                                + (selected != null
0668:                                        && selected.equalsIgnoreCase("TX") ? " selected"
0669:                                        : "") + ">TX");
0670:                returnString
0671:                        .append("<option"
0672:                                + (selected != null
0673:                                        && selected.equalsIgnoreCase("UT") ? " selected"
0674:                                        : "") + ">UT");
0675:                returnString
0676:                        .append("<option"
0677:                                + (selected != null
0678:                                        && selected.equalsIgnoreCase("VA") ? " selected"
0679:                                        : "") + ">VA");
0680:                returnString
0681:                        .append("<option"
0682:                                + (selected != null
0683:                                        && selected.equalsIgnoreCase("VI") ? " selected"
0684:                                        : "") + ">VI");
0685:                returnString
0686:                        .append("<option"
0687:                                + (selected != null
0688:                                        && selected.equalsIgnoreCase("VT") ? " selected"
0689:                                        : "") + ">VT");
0690:                returnString
0691:                        .append("<option"
0692:                                + (selected != null
0693:                                        && selected.equalsIgnoreCase("WA") ? " selected"
0694:                                        : "") + ">WA");
0695:                returnString
0696:                        .append("<option"
0697:                                + (selected != null
0698:                                        && selected.equalsIgnoreCase("WI") ? " selected"
0699:                                        : "") + ">WI");
0700:                returnString
0701:                        .append("<option"
0702:                                + (selected != null
0703:                                        && selected.equalsIgnoreCase("WV") ? " selected"
0704:                                        : "") + ">WV");
0705:                returnString
0706:                        .append("<option"
0707:                                + (selected != null
0708:                                        && selected.equalsIgnoreCase("WY") ? " selected"
0709:                                        : "") + ">WY");
0710:                returnString.append("</select>");
0711:                return returnString.toString();
0712:            }
0713:
0714:            private static java.util.Vector _jspx_includes;
0715:
0716:            static {
0717:                _jspx_includes = new java.util.Vector(12);
0718:                _jspx_includes.add("/includes/header.jsp");
0719:                _jspx_includes.add("/includes/oldFunctions.jsp");
0720:                _jspx_includes.add("/includes/oldDeclarations.jsp");
0721:                _jspx_includes.add("/includes/windowTitle.jsp");
0722:                _jspx_includes.add("/includes/userStyle.jsp");
0723:                _jspx_includes.add("/includes/uiFunctions.js");
0724:                _jspx_includes.add("/includes/onBeforeUnload.jsp");
0725:                _jspx_includes.add("/includes/ts_picker.js");
0726:                _jspx_includes.add("/includes/historyDropListScripts.jsp");
0727:                _jspx_includes.add("/leads/includes/leadLeftSide.jsp");
0728:                _jspx_includes.add("/leads/includes/leadRightSideHeader.jsp");
0729:                _jspx_includes.add("/includes/footer.jsp");
0730:            }
0731:
0732:            private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_ofbiz_url;
0733:
0734:            public leadHome_jsp() {
0735:                _jspx_tagPool_ofbiz_url = new org.apache.jasper.runtime.TagHandlerPool();
0736:            }
0737:
0738:            public java.util.List getIncludes() {
0739:                return _jspx_includes;
0740:            }
0741:
0742:            public void _jspDestroy() {
0743:                _jspx_tagPool_ofbiz_url.release();
0744:            }
0745:
0746:            public void _jspService(HttpServletRequest request,
0747:                    HttpServletResponse response) throws java.io.IOException,
0748:                    ServletException {
0749:
0750:                JspFactory _jspxFactory = null;
0751:                javax.servlet.jsp.PageContext pageContext = null;
0752:                HttpSession session = null;
0753:                ServletContext application = null;
0754:                ServletConfig config = null;
0755:                JspWriter out = null;
0756:                Object page = this ;
0757:                JspWriter _jspx_out = null;
0758:
0759:                try {
0760:                    _jspxFactory = JspFactory.getDefaultFactory();
0761:                    response.setContentType("text/html;charset=ISO-8859-1");
0762:                    pageContext = _jspxFactory.getPageContext(this , request,
0763:                            response, null, true, 8192, true);
0764:                    application = pageContext.getServletContext();
0765:                    config = pageContext.getServletConfig();
0766:                    session = pageContext.getSession();
0767:                    out = pageContext.getOut();
0768:                    _jspx_out = out;
0769:
0770:                    out.write("\r\n");
0771:                    out.write("\r\n");
0772:                    out.write("\r\n");
0773:                    out.write("\r\n");
0774:                    out.write("\r\n");
0775:                    out.write("\r\n");
0776:                    out.write("\r\n");
0777:                    out.write("\r\n");
0778:                    out.write("\r\n");
0779:                    out.write("\r\n\r\n");
0780:                    out.write("\r\n");
0781:                    out.write("\r\n");
0782:                    out.write("\r\n");
0783:                    out.write("\r\n");
0784:                    out.write("\r\n");
0785:                    out.write("\r\n\r\n");
0786:                    out.write("\r\n");
0787:                    out.write("\r\n");
0788:                    out.write("\r\n");
0789:                    out.write("\r\n");
0790:                    out.write("\r\n");
0791:                    out.write("\r\n");
0792:                    out.write("\r\n");
0793:                    out.write("\r\n");
0794:                    out.write("\r\n\r\n");
0795:                    out.write("\r\n\r\n");
0796:                    org.ofbiz.security.Security security = null;
0797:                    synchronized (application) {
0798:                        security = (org.ofbiz.security.Security) pageContext
0799:                                .getAttribute("security",
0800:                                        PageContext.APPLICATION_SCOPE);
0801:                        if (security == null) {
0802:                            throw new java.lang.InstantiationException(
0803:                                    "bean security not found within scope");
0804:                        }
0805:                    }
0806:                    out.write("\r\n");
0807:                    org.ofbiz.entity.GenericDelegator delegator = null;
0808:                    synchronized (application) {
0809:                        delegator = (org.ofbiz.entity.GenericDelegator) pageContext
0810:                                .getAttribute("delegator",
0811:                                        PageContext.APPLICATION_SCOPE);
0812:                        if (delegator == null) {
0813:                            throw new java.lang.InstantiationException(
0814:                                    "bean delegator not found within scope");
0815:                        }
0816:                    }
0817:                    out.write("\r\n");
0818:                    com.sourcetap.sfa.event.GenericWebEventProcessor webEventProcessor = null;
0819:                    synchronized (application) {
0820:                        webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) pageContext
0821:                                .getAttribute("webEventProcessor",
0822:                                        PageContext.APPLICATION_SCOPE);
0823:                        if (webEventProcessor == null) {
0824:                            try {
0825:                                webEventProcessor = (com.sourcetap.sfa.event.GenericWebEventProcessor) java.beans.Beans
0826:                                        .instantiate(this .getClass()
0827:                                                .getClassLoader(),
0828:                                                "com.sourcetap.sfa.event.GenericWebEventProcessor");
0829:                            } catch (ClassNotFoundException exc) {
0830:                                throw new InstantiationException(exc
0831:                                        .getMessage());
0832:                            } catch (Exception exc) {
0833:                                throw new ServletException(
0834:                                        "Cannot create bean of class "
0835:                                                + "com.sourcetap.sfa.event.GenericWebEventProcessor",
0836:                                        exc);
0837:                            }
0838:                            pageContext.setAttribute("webEventProcessor",
0839:                                    webEventProcessor,
0840:                                    PageContext.APPLICATION_SCOPE);
0841:                        }
0842:                    }
0843:                    out.write("\r\n");
0844:                    com.sourcetap.sfa.event.GenericEventProcessor eventProcessor = null;
0845:                    synchronized (application) {
0846:                        eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) pageContext
0847:                                .getAttribute("eventProcessor",
0848:                                        PageContext.APPLICATION_SCOPE);
0849:                        if (eventProcessor == null) {
0850:                            try {
0851:                                eventProcessor = (com.sourcetap.sfa.event.GenericEventProcessor) java.beans.Beans
0852:                                        .instantiate(this .getClass()
0853:                                                .getClassLoader(),
0854:                                                "com.sourcetap.sfa.event.GenericEventProcessor");
0855:                            } catch (ClassNotFoundException exc) {
0856:                                throw new InstantiationException(exc
0857:                                        .getMessage());
0858:                            } catch (Exception exc) {
0859:                                throw new ServletException(
0860:                                        "Cannot create bean of class "
0861:                                                + "com.sourcetap.sfa.event.GenericEventProcessor",
0862:                                        exc);
0863:                            }
0864:                            pageContext.setAttribute("eventProcessor",
0865:                                    eventProcessor,
0866:                                    PageContext.APPLICATION_SCOPE);
0867:                        }
0868:                    }
0869:                    out.write("\r\n");
0870:                    com.sourcetap.sfa.ui.UICache uiCache = null;
0871:                    synchronized (application) {
0872:                        uiCache = (com.sourcetap.sfa.ui.UICache) pageContext
0873:                                .getAttribute("uiCache",
0874:                                        PageContext.APPLICATION_SCOPE);
0875:                        if (uiCache == null) {
0876:                            try {
0877:                                uiCache = (com.sourcetap.sfa.ui.UICache) java.beans.Beans
0878:                                        .instantiate(this .getClass()
0879:                                                .getClassLoader(),
0880:                                                "com.sourcetap.sfa.ui.UICache");
0881:                            } catch (ClassNotFoundException exc) {
0882:                                throw new InstantiationException(exc
0883:                                        .getMessage());
0884:                            } catch (Exception exc) {
0885:                                throw new ServletException(
0886:                                        "Cannot create bean of class "
0887:                                                + "com.sourcetap.sfa.ui.UICache",
0888:                                        exc);
0889:                            }
0890:                            pageContext.setAttribute("uiCache", uiCache,
0891:                                    PageContext.APPLICATION_SCOPE);
0892:                        }
0893:                    }
0894:                    out.write("\r\n\r\n");
0895:                    out.write("<!-- [oldFunctions.jsp] Begin -->\r\n");
0896:                    out.write("\r\n");
0897:                    out.write("<!-- [oldFunctions.jsp] End -->\r\n\r\n");
0898:                    out.write("\r\n");
0899:                    out.write("<!-- [oldDeclarations.jsp] Start -->\r\n\r\n");
0900:                    GenericValue userLogin = (GenericValue) session
0901:                            .getAttribute("_USER_LOGIN_");
0902:                    out.write("\r\n");
0903:                    UserInfo userInfo = (UserInfo) session
0904:                            .getAttribute("userInfo");
0905:                    out.write("\r\n\r\n");
0906:                    String partyId = "";
0907:                    if (userLogin != null)
0908:                        partyId = userLogin.getString("partyId");
0909:
0910:                    out.write("\r\n\r\n");
0911:
0912:                    DecimalFormat decimalFormat = new DecimalFormat("#,###.##");
0913:                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
0914:                            "MM/dd/yyyy");
0915:                    SimpleDateFormat simpleTimeFormat = new SimpleDateFormat(
0916:                            "K:mm a");
0917:
0918:                    out.write("\r\n\r\n");
0919:                    String controlPath = (String) request
0920:                            .getAttribute("_CONTROL_PATH_");
0921:                    out.write("\r\n");
0922:                    String contextRoot = (String) request
0923:                            .getAttribute("_CONTEXT_ROOT_");
0924:                    out.write("\r\n\r\n");
0925:                    String pageName = UtilFormatOut
0926:                            .checkNull((String) pageContext
0927:                                    .getAttribute("PageName"));
0928:                    out.write("\r\n\r\n");
0929:                    String companyName = UtilProperties.getPropertyValue(
0930:                            contextRoot + "/WEB-INF/sfa.properties",
0931:                            "company.name");
0932:                    out.write("\r\n");
0933:                    String companySubtitle = UtilProperties.getPropertyValue(
0934:                            contextRoot + "/WEB-INF/sfa.properties",
0935:                            "company.subtitle");
0936:                    out.write("\r\n");
0937:                    String headerImageUrl = UtilProperties.getPropertyValue(
0938:                            contextRoot + "/WEB-INF/sfa.properties",
0939:                            "header.image.url");
0940:                    out.write("\r\n\r\n");
0941:                    String headerBoxBorderColor = UtilProperties
0942:                            .getPropertyValue(contextRoot
0943:                                    + "/WEB-INF/sfa.properties",
0944:                                    "header.box.border.color", "black");
0945:                    out.write("\r\n");
0946:                    String headerBoxBorderWidth = UtilProperties
0947:                            .getPropertyValue(contextRoot
0948:                                    + "/WEB-INF/sfa.properties",
0949:                                    "header.box.border.width", "1");
0950:                    out.write("\r\n");
0951:                    String headerBoxTopColor = UtilProperties.getPropertyValue(
0952:                            contextRoot + "/WEB-INF/sfa.properties",
0953:                            "header.box.top.color", "#336699");
0954:                    out.write("\r\n");
0955:                    String headerBoxBottomColor = UtilProperties
0956:                            .getPropertyValue(contextRoot
0957:                                    + "/WEB-INF/sfa.properties",
0958:                                    "header.box.bottom.color", "#cccc99");
0959:                    out.write("\r\n");
0960:                    String headerBoxBottomColorAlt = UtilProperties
0961:                            .getPropertyValue(contextRoot
0962:                                    + "/WEB-INF/sfa.properties",
0963:                                    "header.box.bottom.alt.color", "#eeeecc");
0964:                    out.write("\r\n");
0965:                    String headerBoxTopPadding = UtilProperties
0966:                            .getPropertyValue(contextRoot
0967:                                    + "/WEB-INF/sfa.properties",
0968:                                    "header.box.top.padding", "4");
0969:                    out.write("\r\n");
0970:                    String headerBoxBottomPadding = UtilProperties
0971:                            .getPropertyValue(contextRoot
0972:                                    + "/WEB-INF/sfa.properties",
0973:                                    "header.box.bottom.padding", "2");
0974:                    out.write("\r\n\r\n");
0975:                    String boxBorderColor = UtilProperties.getPropertyValue(
0976:                            contextRoot + "/WEB-INF/sfa.properties",
0977:                            "box.border.color", "black");
0978:                    out.write("\r\n");
0979:                    String boxBorderWidth = UtilProperties.getPropertyValue(
0980:                            contextRoot + "/WEB-INF/sfa.properties",
0981:                            "box.border.width", "1");
0982:                    out.write("\r\n");
0983:                    String boxTopColor = UtilProperties.getPropertyValue(
0984:                            contextRoot + "/WEB-INF/sfa.properties",
0985:                            "box.top.color", "#336699");
0986:                    out.write("\r\n");
0987:                    String boxBottomColor = UtilProperties.getPropertyValue(
0988:                            contextRoot + "/WEB-INF/sfa.properties",
0989:                            "box.bottom.color", "white");
0990:                    out.write("\r\n");
0991:                    String boxBottomColorAlt = UtilProperties.getPropertyValue(
0992:                            contextRoot + "/WEB-INF/sfa.properties",
0993:                            "box.bottom.alt.color", "white");
0994:                    out.write("\r\n");
0995:                    String boxTopPadding = UtilProperties.getPropertyValue(
0996:                            contextRoot + "/WEB-INF/sfa.properties",
0997:                            "box.top.padding", "4");
0998:                    out.write("\r\n");
0999:                    String boxBottomPadding = UtilProperties.getPropertyValue(
1000:                            contextRoot + "/WEB-INF/sfa.properties",
1001:                            "box.bottom.padding", "4");
1002:                    out.write("\r\n");
1003:                    String userStyleSheet = "/sfa/includes/maincss.css";
1004:                    out.write("\r\n");
1005:                    String alphabet[] = { "a", "b", "c", "d", "e", "f", "g",
1006:                            "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
1007:                            "r", "s", "t", "u", "v", "w", "x", "y", "z", "*" };
1008:                    out.write("\r\n\r\n");
1009:                    out.write("<!-- [oldDeclarations.jsp] End -->\r\n\r\n");
1010:                    out.write("\r\n\r\n");
1011:                    out.write("<HTML>\r\n");
1012:                    out.write("<HEAD>\r\n\r\n");
1013:
1014:                    String clientRequest = (String) session
1015:                            .getAttribute("_CLIENT_REQUEST_");
1016:                    //out.write("Client request: " + clientRequest + "<BR>");
1017:                    String hostName = "";
1018:                    if (clientRequest != null
1019:                            && clientRequest.indexOf("//") > 0) {
1020:                        int startPos = clientRequest.indexOf("//") + 2;
1021:                        int endPos = clientRequest.indexOf(":", startPos);
1022:                        if (endPos < startPos)
1023:                            endPos = clientRequest.indexOf("/", startPos);
1024:                        if (endPos < startPos)
1025:                            hostName = clientRequest.substring(startPos);
1026:                        else
1027:                            hostName = clientRequest
1028:                                    .substring(startPos, endPos);
1029:                    } else {
1030:                        hostName = "";
1031:                    }
1032:                    //out.write("Host name: " + hostName + "<BR>");
1033:
1034:                    out.write("\r\n\r\n");
1035:                    out.write("<title>");
1036:                    out.print(hostName);
1037:                    out.write(" - Sales Force Automation - ");
1038:                    out.print(companyName);
1039:                    out.write("</title>\r\n\r\n");
1040:                    out.write("\r\n");
1041:                    out.write("<!-- [userStyle.jsp] Start -->\r\n\r\n");
1042:
1043:                    //------------ Get the style sheet
1044:                    String styleSheetId = null;
1045:
1046:                    ModelEntity entityStyleUser = delegator
1047:                            .getModelEntity("UiUserTemplate");
1048:                    HashMap hashMapStyleUser = new HashMap();
1049:                    if (userLogin != null) {
1050:                        String ulogin = userLogin.getString("userLoginId");
1051:                        hashMapStyleUser.put("userLoginId", ulogin);
1052:                    } else {
1053:                        hashMapStyleUser.put("userLoginId", "Default");
1054:                    }
1055:                    GenericPK stylePk = new GenericPK(entityStyleUser,
1056:                            hashMapStyleUser);
1057:                    GenericValue userTemplate = delegator
1058:                            .findByPrimaryKey(stylePk);
1059:                    if (userTemplate != null) {
1060:                        styleSheetId = userTemplate.getString("styleSheetId");
1061:                    }
1062:
1063:                    if (styleSheetId == null) {
1064:                        hashMapStyleUser.put("userLoginId", "Default");
1065:                        stylePk = new GenericPK(entityStyleUser,
1066:                                hashMapStyleUser);
1067:                        userTemplate = delegator.findByPrimaryKey(stylePk);
1068:                        if (userTemplate != null) {
1069:                            styleSheetId = userTemplate
1070:                                    .getString("styleSheetId");
1071:                        }
1072:                    }
1073:
1074:                    if (styleSheetId != null) {
1075:                        ModelEntity entityStyle = delegator
1076:                                .getModelEntity("UiStyleTemplate");
1077:                        HashMap hashMapStyle = new HashMap();
1078:                        hashMapStyle.put("styleSheetId", styleSheetId);
1079:                        stylePk = new GenericPK(entityStyle, hashMapStyle);
1080:                        GenericValue styleTemplate = delegator
1081:                                .findByPrimaryKey(stylePk);
1082:                        userStyleSheet = styleTemplate
1083:                                .getString("styleSheetLoc");
1084:
1085:                        if (userStyleSheet == null) {
1086:                            userStyleSheet = "/sfa/includes/maincss.css";
1087:                        }
1088:                    }
1089:
1090:                    out.write("\r\n");
1091:                    out.write("<link rel=\"stylesheet\" href=\"");
1092:                    out.print(userStyleSheet);
1093:                    out.write("\" type=\"text/css\">\r\n\r\n");
1094:                    out.write("<!-- [userStyle.jsp] End -->\r\n\r\n");
1095:                    out.write("\r\n");
1096:                    out
1097:                            .write("<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/sfa/css/gridstyles.css\">\r\n");
1098:                    out
1099:                            .write("<script language=\"JavaScript\" >\r\n\r\n  function sendDropDown(elementName, idName, fieldName, findClass, paramName, paramValue, frm, action)\r\n  {\r\n        var sUrl = '");
1100:                    if (_jspx_meth_ofbiz_url_0(pageContext))
1101:                        return;
1102:                    out
1103:                            .write("?findMode=filter&fieldName=' +\r\n\t\t\tfieldName + '&idName=' + idName + '&param_' + 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 = '");
1104:                    if (_jspx_meth_ofbiz_url_1(pageContext))
1105:                        return;
1106:                    out
1107:                            .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");
1108:                    out
1109:                            .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");
1110:                    out
1111:                            .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");
1112:                    out
1113:                            .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");
1114:                    out
1115:                            .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");
1116:                    out
1117:                            .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");
1118:                    out
1119:                            .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");
1120:                    out
1121:                            .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] ");
1122:                    out
1123:                            .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 ");
1124:                    out
1125:                            .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 ");
1126:                    out
1127:                            .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 ");
1128:                    out
1129:                            .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 ");
1130:                    out
1131:                            .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 ");
1132:                    out
1133:                            .write("< myRows; i++) {\r\n    myArray[i] = new Array(myCols)\r\n    for (j=0; j ");
1134:                    out
1135:                            .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 ");
1136:                    out.write("< myRows; i++) {\r\n    for (j=0; j ");
1137:                    out
1138:                            .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");
1139:                    out.write("</script>\r\n\r\n\r\n");
1140:                    out.write("\r\n\r\n");
1141:                    out.write("</HEAD>\r\n\r\n");
1142:                    out.write("<BASE TARGET=\"content\">\r\n");
1143:                    out.write("<!--");
1144:                    out
1145:                            .write("<BODY CLASS=\"bodyform\" onbeforeunload=\"verifyClose()\">-->\r\n");
1146:                    out.write("<BODY CLASS=\"bodyform\"\">\r\n\r\n");
1147:                    out.write("\r\n");
1148:                    out.write("<!-- onBeforeUnload.jsp - Start -->\r\n\r\n");
1149:                    out
1150:                            .write("<SCRIPT LANGUAGE=\"JScript\" TYPE=\"text/javascript\" FOR=window EVENT=onbeforeunload>\r\n return doOnBeforeUnload();\r\n");
1151:                    out.write("</SCRIPT>\r\n\r\n");
1152:                    out
1153:                            .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");
1154:                    out
1155:                            .write("  var vFormC = document.forms;\r\n  for (var vFormNbr = 0; vFormNbr ");
1156:                    out
1157:                            .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==\"");
1158:                    out.print(UIScreenSection.ACTION_INSERT);
1159:                    out.write("\" ||\r\n         vAction==\"");
1160:                    out.print(UIScreenSection.ACTION_UPDATE);
1161:                    out.write("\" ||\r\n         vAction==\"");
1162:                    out.print(UIScreenSection.ACTION_UPDATE_SELECT);
1163:                    out
1164:                            .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 ");
1165:                    out
1166:                            .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 = \"");
1167:                    out.print(UIWebUtility.HTML_NAME_PREFIX_ORIGINAL);
1168:                    out
1169:                            .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");
1170:                    out
1171:                            .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");
1172:                    out.write("</SCRIPT>\r\n\r\n");
1173:                    out.write("<!-- onBeforeUnload.jsp - End -->\r\n\r\n\r\n");
1174:                    out.write("\r\n\r\n");
1175:                    out
1176:                            .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 ");
1177:                    out.write("<denis@softcomplex.com>; ");
1178:                    out
1179:                            .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");
1180:                    out
1181:                            .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\"");
1182:                    out.write("<html>\\n\"+\r\n\t\t\" ");
1183:                    out.write("<head>\\n\"+\r\n\t\t\"  ");
1184:                    out.write("<title>Calendar");
1185:                    out.write("</title>\\n\"+\r\n\t\t\" ");
1186:                    out.write("</head>\\n\"+\r\n\t\t\" ");
1187:                    out.write("<body bgcolor=\\\"White\\\">\\n\"+\r\n\t\t\"  ");
1188:                    out
1189:                            .write("<table class=\\\"clsOTable\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\"   ");
1190:                    out.write("<tr>\\n\" +\r\n\t\t\"    ");
1191:                    out
1192:                            .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\"     ");
1193:                    out
1194:                            .write("<table cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" border=\\\"0\\\" width=\\\"100%\\\">\\n\" +\r\n\t\t\"      ");
1195:                    out.write("<tr>\\n\" +\r\n\t\t\"       ");
1196:                    out
1197:                            .write("<td bgcolor=\\\"#4682B4\\\">\\n\" +\r\n\t\t\"        ");
1198:                    out
1199:                            .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\"         ");
1200:                    out
1201:                            .write("<img src=\\\"/sfaimages/prev.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\"           alt=\\\"previous month\\\">\\n\" +\r\n\t\t\"        ");
1202:                    out.write("</a>\\n\" +\r\n\t\t\"       ");
1203:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1204:                    out
1205:                            .write("<td bgcolor=\\\"#4682B4\\\" colspan=\\\"5\\\">\\n\" +\r\n\t\t\"        ");
1206:                    out
1207:                            .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\"        ");
1208:                    out.write("</font>\\n\" +\r\n\t\t\"       ");
1209:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1210:                    out
1211:                            .write("<td bgcolor=\\\"#4682B4\\\" align=\\\"right\\\">\\n\" +\r\n\t\t\"        ");
1212:                    out
1213:                            .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\"         ");
1214:                    out
1215:                            .write("<img src=\\\"/sfaimages/next.gif\\\" width=\\\"16\\\" height=\\\"16\\\" border=\\\"0\\\"\" +\r\n\t\t\"           alt=\\\"next month\\\">\\n\" +\r\n\t\t\"        ");
1216:                    out.write("</a>\\n\" +\r\n\t\t\"       ");
1217:                    out.write("</td>\\n\" +\r\n\t\t\"      ");
1218:                    out
1219:                            .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 += \"      ");
1220:                    out.write("<tr>\\n\";\r\n\tfor (var n=0; n");
1221:                    out.write("<7; n++)\r\n\t\tstr_buffer += \"       ");
1222:                    out
1223:                            .write("<td bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\"       ");
1224:                    out
1225:                            .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\"       ");
1226:                    out.write("</font>");
1227:                    out
1228:                            .write("</td>\\n\";\r\n\t// print calendar table\r\n\tstr_buffer += \"      ");
1229:                    out
1230:                            .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 += \"      ");
1231:                    out
1232:                            .write("<tr>\\n\";\r\n\t\tfor (var n_current_wday=0; n_current_wday");
1233:                    out
1234:                            .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 += \"       ");
1235:                    out
1236:                            .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 += \"       ");
1237:                    out
1238:                            .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 += \"       ");
1239:                    out
1240:                            .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 += \"        ");
1241:                    out
1242:                            .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 += \"        ");
1243:                    out
1244:                            .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 += \"         ");
1245:                    out
1246:                            .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 += \"         ");
1247:                    out
1248:                            .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\"         ");
1249:                    out.write("</font>\\n\" +\r\n\t\t\t\t\"        ");
1250:                    out.write("</a>\\n\" +\r\n\t\t\t\t\"       ");
1251:                    out
1252:                            .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 += \"      ");
1253:                    out
1254:                            .write("</tr>\\n\";\r\n\t}\r\n\t// print calendar footer\r\n\tstr_buffer +=\r\n\t\t\"      ");
1255:                    out
1256:                            .write("<form name=\\\"cal\\\">\\n\" +\r\n\t\t\"       ");
1257:                    out.write("<tr>\\n\" +\r\n\t\t\"        ");
1258:                    out
1259:                            .write("<td colspan=\\\"7\\\" bgcolor=\\\"#87CEFA\\\">\\n\" +\r\n\t\t\"         ");
1260:                    out
1261:                            .write("<font color=\\\"White\\\" face=\\\"tahoma, verdana\\\" size=\\\"2\\\">\\n\" +\r\n\t\t\"          Time:\\n\" +\r\n\t\t\"          ");
1262:                    out
1263:                            .write("<input type=\\\"text\\\" name=\\\"time\\\" value=\\\"\" + dt2tmstr(dt_datetime) +\r\n\t\t\"\\\" size=\\\"8\\\" maxlength=\\\"8\\\">\\n\" +\r\n\t\t\"         ");
1264:                    out.write("</font>\\n\" +\r\n\t\t\"        ");
1265:                    out.write("</td>\\n\" +\r\n\t\t\"       ");
1266:                    out.write("</tr>\\n\" +\r\n\t\t\"      ");
1267:                    out.write("</form>\\n\" +\r\n\t\t\"     ");
1268:                    out.write("</table>\\n\" +\r\n\t\t\"    ");
1269:                    out.write("</tr>\\n\" +\r\n\t\t\"   ");
1270:                    out.write("</td>\\n\" +\r\n\t\t\"  ");
1271:                    out.write("</table>\\n\" +\r\n\t\t\" ");
1272:                    out.write("</body>\\n\" +\r\n\t\t\"");
1273:                    out
1274:                            .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");
1275:                    out
1276:                            .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");
1277:                    out.write("</script>\r\n");
1278:                    out.write("\r\n\r\n");
1279:                    out.write("\r\n");
1280:                    out
1281:                            .write("<!-- Use the hidden iFrame to  update the Assigned To dropdown based on the account selected.-->\r\n");
1282:                    out
1283:                            .write("<script for='historySelect' event='onfocus()' language='JavaScript'>\r\n\tsendDropDown(\r\n\t\t'historySelect',\r\n\t\t'url',\r\n\t\t'description',\r\n\t\t'com.sourcetap.sfa.ui.UIHistoryDropDown',\r\n\t\t'',\r\n\t\t'',\r\n\t\tthis.form,\r\n\t\t'');\r\n");
1284:                    out.write("</script>\r\n");
1285:                    out
1286:                            .write("<script for='historySelect' event='onchange()' language='JavaScript'>\r\n\tloadHistoryUrl();\r\n");
1287:                    out.write("</script>\r\n\r\n");
1288:                    out
1289:                            .write("<SCRIPT LANGUAGE=\"javascript\">\r\n\tfunction loadHistoryUrl() {\r\n\t\tvar vSelectObj = document.all(\"historySelect\");\r\n\t\tvar vSelectedIndex = vSelectObj.selectedIndex;\r\n\t\tvar vSelectedOptionObj = vSelectObj.item(vSelectedIndex);\r\n\t\tvar vSelectedValue = vSelectedOptionObj.value;\r\n\r\n\t\tif ((vSelectedValue != null)&&(vSelectedValue != \"\"))  {\r\n\t\t\t// Submit the form to the appropriate jsp page.\r\n\t\t\tvar vFormObj = document.forms(\"historyForm\");\r\n\t\t\tvFormObj.action = vSelectedValue;\r\n\r\n\t\t\tif (vSelectedValue.indexOf(\"activityPopup\") > 0) {\r\n\t\t\t\tvFormObj.target = \"activityPopup\";\r\n\t\t\t} else {\r\n\t\t\t\tvFormObj.target = \"content\";\r\n\t\t\t}\r\n\r\n\t\t\tvFormObj.submit();\r\n\t\t}\r\n\t}\r\n");
1290:                    out.write("</script>\r\n\r\n");
1291:                    out.write("\r\n");
1292:                    out.write("\r\n\r\n");
1293:                    com.sourcetap.sfa.lead.LeadWebEventProcessor leadWebEventProcessor = null;
1294:                    synchronized (application) {
1295:                        leadWebEventProcessor = (com.sourcetap.sfa.lead.LeadWebEventProcessor) pageContext
1296:                                .getAttribute("leadWebEventProcessor",
1297:                                        PageContext.APPLICATION_SCOPE);
1298:                        if (leadWebEventProcessor == null) {
1299:                            try {
1300:                                leadWebEventProcessor = (com.sourcetap.sfa.lead.LeadWebEventProcessor) java.beans.Beans
1301:                                        .instantiate(this .getClass()
1302:                                                .getClassLoader(),
1303:                                                "com.sourcetap.sfa.lead.LeadWebEventProcessor");
1304:                            } catch (ClassNotFoundException exc) {
1305:                                throw new InstantiationException(exc
1306:                                        .getMessage());
1307:                            } catch (Exception exc) {
1308:                                throw new ServletException(
1309:                                        "Cannot create bean of class "
1310:                                                + "com.sourcetap.sfa.lead.LeadWebEventProcessor",
1311:                                        exc);
1312:                            }
1313:                            pageContext.setAttribute("leadWebEventProcessor",
1314:                                    leadWebEventProcessor,
1315:                                    PageContext.APPLICATION_SCOPE);
1316:                        }
1317:                    }
1318:                    out.write("\r\n");
1319:                    com.sourcetap.sfa.lead.LeadEventProcessor leadEventProcessor = null;
1320:                    synchronized (application) {
1321:                        leadEventProcessor = (com.sourcetap.sfa.lead.LeadEventProcessor) pageContext
1322:                                .getAttribute("leadEventProcessor",
1323:                                        PageContext.APPLICATION_SCOPE);
1324:                        if (leadEventProcessor == null) {
1325:                            try {
1326:                                leadEventProcessor = (com.sourcetap.sfa.lead.LeadEventProcessor) java.beans.Beans
1327:                                        .instantiate(this .getClass()
1328:                                                .getClassLoader(),
1329:                                                "com.sourcetap.sfa.lead.LeadEventProcessor");
1330:                            } catch (ClassNotFoundException exc) {
1331:                                throw new InstantiationException(exc
1332:                                        .getMessage());
1333:                            } catch (Exception exc) {
1334:                                throw new ServletException(
1335:                                        "Cannot create bean of class "
1336:                                                + "com.sourcetap.sfa.lead.LeadEventProcessor",
1337:                                        exc);
1338:                            }
1339:                            pageContext.setAttribute("leadEventProcessor",
1340:                                    leadEventProcessor,
1341:                                    PageContext.APPLICATION_SCOPE);
1342:                        }
1343:                    }
1344:                    out.write("\r\n\r\n");
1345:                    out.write("<!-- Draw the screen -->\r\n");
1346:                    out
1347:                            .write("<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>\r\n ");
1348:                    out.write("<TR>\r\n  ");
1349:                    out.write("<TD WIDTH=10 ROWSPAN=2>\r\n   ");
1350:                    out
1351:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=10>\r\n  ");
1352:                    out.write("</TD>\r\n  ");
1353:                    out.write("<TD>\r\n   ");
1354:                    out.write("<IMG SRC=\"/sfaimages/space.gif\">\r\n  ");
1355:                    out.write("</TD>\r\n  ");
1356:                    out.write("<TD WIDTH=10 ROWSPAN=2>\r\n   ");
1357:                    out
1358:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=10>\r\n  ");
1359:                    out.write("</TD>\r\n  ");
1360:                    out
1361:                            .write("<TD WIDTH=1 ROWSPAN=2 BGCOLOR=\"#CCCCCC\">\r\n   ");
1362:                    out.write("<IMG SRC=\"/sfaimages/space.gif\">\r\n  ");
1363:                    out.write("</TD>\r\n  ");
1364:                    out.write("<TD WIDTH=10 ROWSPAN=2>\r\n   ");
1365:                    out
1366:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=10>\r\n  ");
1367:                    out.write("</TD>\r\n  ");
1368:                    out.write("<TD>\r\n   ");
1369:                    out.write("<IMG SRC=\"/sfaimages/space.gif\">\r\n  ");
1370:                    out.write("</TD>\r\n  ");
1371:                    out.write("<TD WIDTH=10 ROWSPAN=\"2\">\r\n   ");
1372:                    out
1373:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=10>\r\n  ");
1374:                    out.write("</TD>\r\n ");
1375:                    out.write("</TR>\r\n\r\n\r\n ");
1376:                    out.write("<TR>\r\n  ");
1377:                    out.write("<TD width=\"30%\" valign=top>\r\n   ");
1378:                    String quickCreateAction = "/sfa/control/leadHome";
1379:                    out.write("\r\n   ");
1380:                    out.write("\r\n\r\n");
1381:                    out.write("<TABLE>\r\n");
1382:                    out.write("<TR>");
1383:                    out.write("<TD CLASS=\"freeFormSectionTitleTable\">");
1384:                    out
1385:                            .write("<img src=/sfaimages/sf_person_magnify.gif>Lead Search");
1386:                    out.write("</TD>");
1387:                    out.write("</TR>\r\n");
1388:                    out.write("<TR>");
1389:                    out.write("<TD CLASS=\"moduleLine\">");
1390:                    out
1391:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=\"1\" HEIGHT=\"2\">");
1392:                    out.write("</td>");
1393:                    out.write("</tr>\r\n");
1394:                    out
1395:                            .write("<form method=\"post\" name=\"leadSearchForm\" action=\"/sfa/control/leadHome\">\r\n ");
1396:                    out
1397:                            .write("<INPUT TYPE=\"hidden\" NAME=\"action\" VALUE=\"");
1398:                    out.print(UIScreenSection.ACTION_QUERY);
1399:                    out.write("\">\r\n ");
1400:                    out.write("<TR>");
1401:                    out.write("<TD>\r\n   ");
1402:                    out
1403:                            .write("<TABLE class=\"freeFormSectionDisplayTable\" >\r\n    ");
1404:                    out.write("<TR>\r\n     ");
1405:                    out
1406:                            .write("<TD COLSPAN=2>Enter one or more values to search for leads.");
1407:                    out.write("</TD>\r\n    ");
1408:                    out.write("</tr>\r\n    ");
1409:                    out.write("<TR>\r\n     ");
1410:                    out
1411:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">First Name:");
1412:                    out.write("</TD>\r\n     ");
1413:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1414:                    out
1415:                            .write("<input CLASS=\"freeFormInputBox\" name=\"LeadHome_Lead_firstName_0\" type=\"text\" value='");
1416:                    out.print(UtilFormatOut.checkNull(request
1417:                            .getParameter("LeadHome_Lead_firstName_0")));
1418:                    out.write("'>");
1419:                    out.write("</TD>\r\n    ");
1420:                    out.write("</TR>\r\n    ");
1421:                    out.write("<TR>\r\n     ");
1422:                    out
1423:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">Last Name:");
1424:                    out.write("</TD>\r\n     ");
1425:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1426:                    out
1427:                            .write("<input CLASS=\"freeFormInputBox\" name=\"LeadHome_Lead_lastName_0\" type=\"text\" value='");
1428:                    out.print(UtilFormatOut.checkNull(request
1429:                            .getParameter("LeadHome_Lead_lastName_0")));
1430:                    out.write("'>");
1431:                    out.write("</TD>\r\n    ");
1432:                    out.write("</TR>\r\n    ");
1433:                    out.write("<TR>\r\n     ");
1434:                    out
1435:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">Company:");
1436:                    out.write("</TD>\r\n     ");
1437:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1438:                    out
1439:                            .write("<input CLASS=\"freeFormInputBox\" name=\"LeadHome_Lead_companyName_0\" type=\"text\" value='");
1440:                    out.print(UtilFormatOut.checkNull(request
1441:                            .getParameter("LeadHome_Lead_companyName_0")));
1442:                    out.write("'>");
1443:                    out.write("</TD>\r\n    ");
1444:                    out.write("</TR>\r\n    ");
1445:                    out.write("<TR>\r\n     ");
1446:                    out.write("<TD CLASS=\"freeFormSectionLabelOptional\">");
1447:                    out.write("<NOBR>Bus. Phone:");
1448:                    out.write("</NOBR>");
1449:                    out.write("</TD>\r\n     ");
1450:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1451:                    out
1452:                            .write("<input CLASS=\"freeFormInputBox\" name=\"LeadHome_Lead_businessPhone_0\" type=\"text\" value='");
1453:                    out.print(UtilFormatOut.checkNull(request
1454:                            .getParameter("LeadHome_Lead_businessPhone_0")));
1455:                    out.write("'>");
1456:                    out.write("</TD>\r\n    ");
1457:                    out.write("</TR>\r\n    ");
1458:                    out.write("<TR>\r\n     ");
1459:                    out
1460:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">City:");
1461:                    out.write("</TD>\r\n     ");
1462:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1463:                    out
1464:                            .write("<input CLASS=\"freeFormInputBox\" name=\"LeadHome_Address_city_0\" type=\"text\" value='");
1465:                    out.print(UtilFormatOut.checkNull(request
1466:                            .getParameter("LeadHome_Address_city_0")));
1467:                    out.write("'>");
1468:                    out.write("</TD>\r\n    ");
1469:                    out.write("</TR>\r\n    ");
1470:                    out.write("<TR>\r\n     ");
1471:                    out
1472:                            .write("<TD COLSPAN=2>Enter a name if you want to save the query.");
1473:                    out.write("</TD>\r\n    ");
1474:                    out.write("</tr>\r\n    ");
1475:                    out.write("<TR>\r\n     ");
1476:                    out
1477:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">Save As:");
1478:                    out.write("</TD>\r\n     ");
1479:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1480:                    out
1481:                            .write("<input CLASS=\"freeFormInputBox\" name=\"queryName\" type=\"text\">");
1482:                    out.write("</TD>\r\n    ");
1483:                    out.write("</TR>\r\n   ");
1484:                    out.write("</TABLE>\r\n   ");
1485:                    out
1486:                            .write("<TABLE WIDTH=\"100%\" class=\"freeFormSectionDisplayTable\" >\r\n    ");
1487:                    out.write("<TR>\r\n     ");
1488:                    out.write("<TD ALIGN=\"left\">\r\n      ");
1489:                    out.write("<a href=\"/sfa/control/leads?action=");
1490:                    out.print(UIScreenSection.ACTION_SHOW_QUERY);
1491:                    out.write("\">Advanced");
1492:                    out.write("</a>\r\n     ");
1493:                    out.write("</TD>\r\n     ");
1494:                    out
1495:                            .write("<TD class=\"freeFormSectionSaveButtonArea\">\r\n      ");
1496:                    out
1497:                            .write("<input type=\"submit\" name=\"go\" value=\"Run/Save Query\">\r\n     ");
1498:                    out.write("</TD>\r\n    ");
1499:                    out.write("</TR>\r\n   ");
1500:                    out.write("</TABLE>\r\n ");
1501:                    out.write("</TD>");
1502:                    out.write("</TR>\r\n");
1503:                    out.write("</FORM>\r\n\r\n");
1504:                    out.write("<TR>");
1505:                    out.write("<TD>");
1506:                    out.write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=10>");
1507:                    out.write("</TD>");
1508:                    out.write("</TR>\r\n\r\n");
1509:                    out.write("<TR>");
1510:                    out.write("<TD CLASS=\"freeFormSectionTitleTable\">");
1511:                    out.write("<img src=/sfaimages/sf_pen.gif>Quick Create");
1512:                    out.write("</TD>");
1513:                    out.write("</TR>\r\n\r\n");
1514:                    out.write("<!-- Process quick-create -->\r\n");
1515:                    out.write("<TR>");
1516:                    out.write("<TD CLASS=\"freeFormSectionDisplayTable\">\r\n");
1517:
1518:                    StringBuffer errorHtml = new StringBuffer();
1519:                    String module = "leadLeftSide";
1520:                    if (request.getParameter("quickCreate") != null) {
1521:
1522:                        // Check required fields.
1523:                        if (request.getParameter("leadTypeId").equals("")) {
1524:                            errorHtml.append("Lead Type is required.<BR>");
1525:                        }
1526:                        if (request.getParameter("firstName").equals("")) {
1527:                            errorHtml.append("First Name is required.<BR>");
1528:                        }
1529:                        if (request.getParameter("lastName").equals("")) {
1530:                            errorHtml.append("Last Name is required.<BR>");
1531:                        }
1532:                        if (request.getParameter("businessPhone").equals("")) {
1533:                            errorHtml.append("Business Phone is required.<BR>");
1534:                        }
1535:                        if (request.getParameter("mailingAddress").equals("")) {
1536:                            errorHtml.append("Address is required.<BR>");
1537:                        }
1538:                        if (request.getParameter("city").equals("")) {
1539:                            errorHtml.append("City is required.<BR>");
1540:                        }
1541:                        if (request.getParameter("state").equals("")) {
1542:                            errorHtml.append("State is required.<BR>");
1543:                        }
1544:                        if (request.getParameter("zip").equals("")) {
1545:                            errorHtml.append("Zip is required.<BR>");
1546:                        }
1547:
1548:                        if (errorHtml.length() > 0) {
1549:                            out.write("<font color=ff0000>"
1550:                                    + errorHtml.toString() + "</font><BR>");
1551:                        } else {
1552:                            // User clicked the quick-create Save button.
1553:                            boolean result = leadEventProcessor.QuickInsert(
1554:                                    userInfo, delegator, request
1555:                                            .getParameter("firstName"), request
1556:                                            .getParameter("lastName"), request
1557:                                            .getParameter("title"), request
1558:                                            .getParameter("companyName"),
1559:                                    request.getParameter("businessPhone"),
1560:                                    request.getParameter("mailingAddress"),
1561:                                    request.getParameter("city"), request
1562:                                            .getParameter("state"), request
1563:                                            .getParameter("zip"), request
1564:                                            .getParameter("country"), request
1565:                                            .getParameter("statusId"), request
1566:                                            .getParameter("leadTypeId"),
1567:                                    request.getParameter("activeFlag"), request
1568:                                            .getParameter("validatedFlag"));
1569:
1570:                            if (result) {
1571:                                out.write("\r\n            ");
1572:                                out.write("<font color=ff0000>Lead Created");
1573:                                out.write("</font>");
1574:                                out.write("<p>\r\n        ");
1575:                            } else {
1576:                                out.write("\r\n            ");
1577:                                out
1578:                                        .write("<font color=ff0000>Error creating user please contact your system administrator");
1579:                                out.write("</font>");
1580:                                out.write("<p>\r\n        ");
1581:                            }
1582:                        }
1583:                    }
1584:
1585:                    out.write("\r\n");
1586:                    out.write("</TD>");
1587:                    out.write("</TR>\r\n\r\n");
1588:                    out
1589:                            .write("<FORM METHOD=\"POST\" name=\"quickCreateLeadForm\" action=\"");
1590:                    out.print(quickCreateAction);
1591:                    out.write("\">\r\n ");
1592:                    out
1593:                            .write("<INPUT TYPE=\"hidden\" NAME=\"action\" VALUE=\"");
1594:                    out.print(request.getParameter("action"));
1595:                    out.write("\">\r\n ");
1596:                    out
1597:                            .write("<INPUT TYPE=\"hidden\" NAME=\"savedQueryName\" VALUE=\"");
1598:                    out.print(UIQuery.LAST_QUERY_NAME);
1599:                    out.write("\">\r\n ");
1600:                    out
1601:                            .write("<INPUT TYPE=\"hidden\" NAME=\"leadId\" VALUE=\"");
1602:                    out.print(request.getParameter("leadId"));
1603:                    out.write("\">\r\n ");
1604:                    out.write("<TR>");
1605:                    out.write("<TD>\r\n   ");
1606:                    out
1607:                            .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n    ");
1608:                    out.write("<TR>\r\n     ");
1609:                    if (errorHtml.length() > 0) {
1610:                        out.write("\r\n      ");
1611:                        out.write("<TD COLSPAN=2>Make changes and try again.");
1612:                        out.write("</TD>\r\n     ");
1613:                    } else {
1614:                        out.write("\r\n      ");
1615:                        out.write("<TD COLSPAN=2>Add a new lead here.");
1616:                        out.write("</TD>\r\n     ");
1617:                    }
1618:                    out.write("\r\n    ");
1619:                    out.write("</TR>\r\n    ");
1620:                    out.write("<TR>\r\n     ");
1621:                    out.write("<TD CLASS=\"freeFormSectionLabel\">Lead Type:");
1622:                    out.write("</TD>\r\n     ");
1623:                    out.write("<TD CLASS=\"freeFormSectionField\">\r\n       ");
1624:
1625:                    String leadTypeId = "";
1626:                    if (errorHtml.length() > 0)
1627:                        leadTypeId = request.getParameter("leadTypeId");
1628:
1629:                    // Get the codes for lead type.
1630:                    HashMap leadTypeFindMap = new HashMap();
1631:                    leadTypeFindMap.put("codeTypeId", "LEAD_TYPE");
1632:                    ArrayList orderList = new ArrayList();
1633:                    orderList.add("codeValue");
1634:                    try {
1635:                        List leadTypeL = delegator.findByAndCache("Code",
1636:                                leadTypeFindMap, orderList);
1637:                        out.write(UIDropDown.getSelectHtml("leadTypeId", 10,
1638:                                "", "N", "stateSelectBox", "Y", "", UIDropDown
1639:                                        .decodeValueArray("codeId",
1640:                                                "codeValue", "leadTypeId",
1641:                                                leadTypeL), leadTypeId, false));
1642:                    } catch (GenericEntityException e) {
1643:                        Debug
1644:                                .logError(
1645:                                        "[leadLeftSide.jsp] Error retrieving lead type codes.",
1646:                                        module);
1647:                        out
1648:                                .write("<input CLASS=\"freeFormInputBox\" name=\"leadTypeId\" type=\"text\""
1649:                                        + " VALUE=\"" + leadTypeId + "\"");
1650:                    }
1651:
1652:                    out.write("\r\n     ");
1653:                    out.write("</TD>\r\n    ");
1654:                    out.write("</TR>\r\n    ");
1655:                    out.write("<TR>\r\n     ");
1656:                    out.write("<TD CLASS=\"freeFormSectionLabel\">First Name:");
1657:                    out.write("</TD>\r\n     ");
1658:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1659:                    out
1660:                            .write("<input CLASS=\"freeFormInputBox\" name=\"firstName\" type=\"text\"\r\n       ");
1661:                    if (errorHtml.length() > 0)
1662:                        out.write(" VALUE=\""
1663:                                + request.getParameter("firstName") + "\"");
1664:                    out.write("\r\n     >");
1665:                    out.write("</TD>\r\n    ");
1666:                    out.write("</TR>\r\n    ");
1667:                    out.write("<TR>\r\n     ");
1668:                    out.write("<TD CLASS=\"freeFormSectionLabel\">Last Name:");
1669:                    out.write("</TD>\r\n     ");
1670:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1671:                    out
1672:                            .write("<input CLASS=\"freeFormInputBox\" name=\"lastName\" type=\"text\"\r\n       ");
1673:                    if (errorHtml.length() > 0)
1674:                        out.write(" VALUE=\""
1675:                                + request.getParameter("lastName") + "\"");
1676:                    out.write("\r\n     >");
1677:                    out.write("</TD>\r\n    ");
1678:                    out.write("</TR>\r\n    ");
1679:                    out.write("<TR>\r\n     ");
1680:                    out
1681:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">Title:");
1682:                    out.write("</TD>\r\n     ");
1683:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1684:                    out
1685:                            .write("<input CLASS=\"freeFormInputBox\" name=\"title\" type=\"text\"\r\n       ");
1686:                    if (errorHtml.length() > 0)
1687:                        out.write(" VALUE=\"" + request.getParameter("title")
1688:                                + "\"");
1689:                    out.write("\r\n     >");
1690:                    out.write("</TD>\r\n    ");
1691:                    out.write("</TR>\r\n    ");
1692:                    out.write("<TR>\r\n     ");
1693:                    out
1694:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\">Company:");
1695:                    out.write("</TD>\r\n     ");
1696:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1697:                    out
1698:                            .write("<input CLASS=\"freeFormInputBox\" name=\"companyName\" type=\"text\"\r\n       ");
1699:                    if (errorHtml.length() > 0)
1700:                        out.write(" VALUE=\""
1701:                                + request.getParameter("companyName") + "\"");
1702:                    out.write("\r\n     >");
1703:                    out.write("</TD>\r\n    ");
1704:                    out.write("</TR>\r\n    ");
1705:                    out.write("<TR>\r\n     ");
1706:                    out.write("<TD CLASS=\"freeFormSectionLabel\">Bus. Phone:");
1707:                    out.write("</TD>\r\n     ");
1708:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1709:                    out
1710:                            .write("<input CLASS=\"freeFormInputBox\" name=\"businessPhone\" type=\"text\"\r\n       ");
1711:                    if (errorHtml.length() > 0)
1712:                        out.write(" VALUE=\""
1713:                                + request.getParameter("businessPhone") + "\"");
1714:                    out.write("\r\n     >");
1715:                    out.write("</TD>\r\n    ");
1716:                    out.write("</TR>\r\n    ");
1717:                    out.write("<TR>\r\n     ");
1718:                    out.write("<TD CLASS=\"freeFormSectionLabel\">Address:");
1719:                    out.write("</TD>\r\n     ");
1720:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1721:                    out
1722:                            .write("<input CLASS=\"freeFormInputBox\" name=\"mailingAddress\" type=\"text\"\r\n       ");
1723:                    if (errorHtml.length() > 0)
1724:                        out
1725:                                .write(" VALUE=\""
1726:                                        + request
1727:                                                .getParameter("mailingAddress")
1728:                                        + "\"");
1729:                    out.write("\r\n     >");
1730:                    out.write("</TD>\r\n    ");
1731:                    out.write("</TR>\r\n    ");
1732:                    out.write("<TR>\r\n     ");
1733:                    out.write("<TD CLASS=\"freeFormSectionLabel\">City:");
1734:                    out.write("</TD>\r\n     ");
1735:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1736:                    out
1737:                            .write("<input CLASS=\"freeFormInputBox\" name=\"city\" type=\"text\"\r\n       ");
1738:                    if (errorHtml.length() > 0)
1739:                        out.write(" VALUE=\"" + request.getParameter("city")
1740:                                + "\"");
1741:                    out.write("\r\n     >");
1742:                    out.write("</TD>\r\n    ");
1743:                    out.write("</TR>\r\n    ");
1744:                    out.write("<TR>\r\n     ");
1745:                    out.write("<TD CLASS=\"freeFormSectionLabel\">State:");
1746:                    out.write("</TD>\r\n     ");
1747:                    out.write("<TD CLASS=\"freeFormSectionField\">\r\n      ");
1748:
1749:                    if (errorHtml.length() > 0) {
1750:                        out.write(getStatesDropDown("state", request
1751:                                .getParameter("state")));
1752:                    } else {
1753:                        out.write(getStatesDropDown("state", ""));
1754:                    }
1755:
1756:                    out.write("\r\n     ");
1757:                    out.write("</TD>\r\n    ");
1758:                    out.write("</TR>\r\n    ");
1759:                    out.write("<TR>\r\n     ");
1760:                    out.write("<TD CLASS=\"freeFormSectionLabel\">Zip:");
1761:                    out.write("</TD>\r\n     ");
1762:                    out.write("<TD CLASS=\"freeFormSectionField\">");
1763:                    out
1764:                            .write("<input CLASS=\"freeFormInputBox\" name=\"zip\" type=\"text\"\r\n       ");
1765:                    if (errorHtml.length() > 0)
1766:                        out.write(" VALUE=\"" + request.getParameter("zip")
1767:                                + "\"");
1768:                    out.write("\r\n     >");
1769:                    out.write("</TD>\r\n    ");
1770:                    out.write("</TR>\r\n    ");
1771:                    out
1772:                            .write("<INPUT TYPE=\"hidden\" NAME=\"country\" VALUE=\"USA\">\r\n    ");
1773:                    out
1774:                            .write("<INPUT TYPE=\"hidden\" NAME=\"statusId\" VALUE=\"10\">\r\n    ");
1775:                    out
1776:                            .write("<INPUT TYPE=\"hidden\" NAME=\"activeFlag\" VALUE=\"Y\">\r\n    ");
1777:                    out
1778:                            .write("<INPUT TYPE=\"hidden\" NAME=\"validatedFlag\" VALUE=\"Y\">\r\n   ");
1779:                    out.write("</TABLE>\r\n ");
1780:                    out.write("</TD>");
1781:                    out.write("</TR>\r\n ");
1782:                    out.write("<TR>");
1783:                    out
1784:                            .write("<TD class=\"freeFormSectionSaveButtonArea\">\r\n  ");
1785:                    out
1786:                            .write("<input type=\"submit\" name=\"quickCreate\" value=\"Save\">\r\n ");
1787:                    out.write("</TD>");
1788:                    out.write("</TR>\r\n");
1789:                    out.write("</FORM>\r\n\r\n");
1790:                    out.write("<TR>");
1791:                    out.write("<TD>&nbsp;");
1792:                    out.write("</TD>");
1793:                    out.write("</TR>\r\n\r\n");
1794:                    out.write("</TABLE>\r\n\r\n");
1795:                    out.write("\r\n  ");
1796:                    out.write("</TD>\r\n\r\n  ");
1797:                    out.write("<TD WIDTH=\"100%\" VALIGN=TOP>\r\n   ");
1798:                    String rightSideTitle = "LEADS HOME";
1799:                    out.write("\r\n   ");
1800:                    out.write("   ");
1801:                    out
1802:                            .write("<TABLE WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0 BORDER=0>\r\n\r\n    ");
1803:                    out.write("<TR>\r\n\t ");
1804:                    out.write("<TD>\r\n\r\n      ");
1805:                    out
1806:                            .write("<TABLE  CLASS=\"tabularSectionTitleTable\" WIDTH=\"100%\">\r\n       ");
1807:                    out.write("<TR>\r\n        ");
1808:                    out.write("<TD NOWRAP WIDTH=\"100%\">\r\n\t\t ");
1809:                    out.write("<img src=/sfaimages/sf_person_cell.gif>");
1810:                    out.write("<big>");
1811:                    out.write("<big>");
1812:                    out.print(rightSideTitle);
1813:                    out.write("</big>");
1814:                    out.write("</big>\r\n\t\t");
1815:                    out.write("</TD>\r\n       ");
1816:                    out.write("</TR>\r\n      ");
1817:                    out.write("</TABLE>\r\n\r\n     ");
1818:                    out.write("</TD>\r\n\t");
1819:                    out.write("</TR>\r\n\r\n    ");
1820:                    out.write("<TR>\r\n\t ");
1821:                    out.write("<TD>\r\n\t  ");
1822:                    out.write("<IMG SRC=\"/sfaimages/space.gif\">\r\n\t ");
1823:                    out.write("</TD>\r\n\t");
1824:                    out.write("</TR>\r\n\r\n    ");
1825:                    out.write("<TR>\r\n\t ");
1826:                    out
1827:                            .write("<TD CLASS=\"freeFormSectionLabelOptional\" HEIGHT=15>\r\n\t  &nbsp;\r\n\t ");
1828:                    out.write("</TD>\r\n\t");
1829:                    out.write("</TR>\r\n\r\n    ");
1830:                    out.write("<TR>\r\n\t ");
1831:                    out.write("<TD>\r\n\t  &nbsp;\r\n\t ");
1832:                    out.write("</TD>\r\n\t");
1833:                    out.write("</TR>\r\n\r\n   ");
1834:                    out.write("</TABLE>\r\n\r\n");
1835:                    out.write("\r\n\r\n");
1836:                    out
1837:                            .write("<!-- Display the Section and process events. -->\r\n");
1838:
1839:                    try {
1840:                        out.write(leadWebEventProcessor.processEvents("LEAD",
1841:                                "LeadList", userInfo, request, response,
1842:                                delegator, leadEventProcessor, uiCache, false));
1843:                    } catch (Exception e) {
1844:                        e.printStackTrace();
1845:                    }
1846:
1847:                    out.write("\r\n\r\n   ");
1848:                    out
1849:                            .write("<TABLE WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=0 BORDER=0>\r\n\r\n    ");
1850:                    out.write("<TR>\r\n     ");
1851:                    out.write("<TD>\r\n\t  &nbsp;\r\n\t ");
1852:                    out.write("</TD>\r\n     ");
1853:                    out.write("<TD>\r\n\t ");
1854:                    out.write("</TD>\r\n    ");
1855:                    out.write("</TR>\r\n    ");
1856:                    out.write("<TR>\r\n     ");
1857:                    out.write("<TD VALIGN=\"TOP\">\r\n      ");
1858:                    out
1859:                            .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\" cellpadding=0 cellspacing=0 border=0>\r\n       ");
1860:                    out.write("<TR>\r\n        ");
1861:                    out
1862:                            .write("<TD ALIGN=\"LEFT\" CLASS=\"tabularSectionTitleTable\">\r\n         ");
1863:                    out
1864:                            .write("<img src=/sfaimages/sf_paper_2gear.gif>Lead Tools\r\n        ");
1865:                    out.write("</TD>\r\n       ");
1866:                    out.write("</TR>\r\n       ");
1867:                    out.write("<tr>\r\n        ");
1868:                    out.write("<td>\r\n         ");
1869:                    out
1870:                            .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n          ");
1871:                    out.write("<TR>\r\n           ");
1872:                    out
1873:                            .write("<TD>\r\n            Use these tools to manage your leads.\r\n           ");
1874:                    out.write("</td>\r\n          ");
1875:                    out.write("</tr>\r\n          ");
1876:                    out.write("<tr>\r\n           ");
1877:                    out.write("<td>\r\n            ");
1878:                    out.write("<BR>\r\n            ");
1879:                    out
1880:                            .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\" border=0 cellspacing=0 cellpadding=0>\r\n             ");
1881:                    out.write("<tr>\r\n              ");
1882:                    out
1883:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1884:                    out
1885:                            .write("<a href=\"/sfa/control/fileImport?screen=LEAD&screenSection=LeadHeader\">Import Leads");
1886:                    out.write("</a>\r\n              ");
1887:                    out.write("</td>\r\n             ");
1888:                    out.write("</tr>\r\n             ");
1889:                    out.write("<tr>\r\n              ");
1890:                    out
1891:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1892:                    out
1893:                            .write("<a href=\"/sfa/reports/uiReport.jsp?action=start\">Export Leads");
1894:                    out.write("</a>\r\n              ");
1895:                    out.write("</td>\r\n             ");
1896:                    out.write("</tr>\r\n             ");
1897:                    out.write("<tr>\r\n              ");
1898:                    out
1899:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1900:                    out.write("<a href=\"/sfa/control/emailList\">Email Leads");
1901:                    out.write("</a>\r\n              ");
1902:                    out.write("</td>\r\n             ");
1903:                    out.write("</tr>\r\n             ");
1904:                    out.write("<tr>\r\n              ");
1905:                    out
1906:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1907:                    out
1908:                            .write("<a href=\"/sfa/control/leadListConverter?action=start\">Mass Convert Leads to Accounts and Contacts");
1909:                    out.write("</a>\r\n              ");
1910:                    out.write("</td>\r\n             ");
1911:                    out.write("</tr>\r\n             ");
1912:                    out.write("<tr>\r\n              ");
1913:                    out
1914:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1915:                    out
1916:                            .write("<a href=\"/sfa/control/leadCaptureSetup?action=start\">Generate form to capture leads from your website");
1917:                    out.write("</a>\r\n              ");
1918:                    out.write("</td>\r\n             ");
1919:                    out.write("</tr>\r\n            ");
1920:                    out.write("</table>\r\n\r\n           ");
1921:                    out.write("</td>\r\n          ");
1922:                    out.write("</tr>\r\n          ");
1923:                    out.write("<TR>\r\n           ");
1924:                    out.write("<TD>\r\n            &nbsp;\r\n           ");
1925:                    out.write("</TD>\r\n          ");
1926:                    out.write("</TR>\r\n         ");
1927:                    out.write("</table>\r\n        ");
1928:                    out.write("</TD>\r\n       ");
1929:                    out.write("</TR>\r\n      ");
1930:                    out.write("</table>\r\n     ");
1931:                    out.write("</TD>\r\n     ");
1932:                    out.write("<TD>\r\n      ");
1933:                    out
1934:                            .write("<IMG SRC=\"/sfaimages/space.gif\" WIDTH=\"10\" HEIGHT=\"1\">\r\n     ");
1935:                    out.write("</TD>\r\n\r\n     ");
1936:                    out.write("<TD VALIGN=\"TOP\">\r\n      ");
1937:                    out
1938:                            .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\" cellpadding=0 cellspacing=0 border=0>\r\n       ");
1939:                    out.write("<TR>\r\n        ");
1940:                    out
1941:                            .write("<TD ALIGN=\"LEFT\" CLASS=\"tabularSectionTitleTable\">");
1942:                    out.write("<img src=/sfaimages/sf_chart_1.gif>Reports");
1943:                    out.write("</TD>\r\n        ");
1944:                    out.write("<TD ALIGN=\"RIGHT\">");
1945:                    out.write("</TD>\r\n       ");
1946:                    out.write("</TR>\r\n       ");
1947:                    out.write("<tr>\r\n        ");
1948:                    out.write("<td>\r\n         ");
1949:                    out
1950:                            .write("<TABLE CLASS=\"freeFormSectionDisplayTable\">\r\n          ");
1951:                    out.write("<TR>\r\n           ");
1952:                    out
1953:                            .write("<TD>\r\n            Select a Lead report below to view that report.");
1954:                    out.write("</TD>\r\n           ");
1955:                    out.write("</td>\r\n          ");
1956:                    out.write("</tr>\r\n          ");
1957:                    out.write("<tr>\r\n           ");
1958:                    out.write("<td colspan=2>\r\n            ");
1959:                    out.write("<BR>\r\n            ");
1960:                    out
1961:                            .write("<table class=\"freeFormSectionDisplayTable\" width=\"100%\" border=0 cellspacing=0 cellpadding=0>\r\n             ");
1962:                    out.write("<tr>\r\n              ");
1963:                    out
1964:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1965:                    out
1966:                            .write("<a href=\"/sfa/control/leadReport?groupName=owner\">\r\n                Lead Details\r\n               ");
1967:                    out.write("</a>\r\n              ");
1968:                    out.write("</td>\r\n             ");
1969:                    out.write("</tr>\r\n             ");
1970:                    out.write("<tr>\r\n              ");
1971:                    out
1972:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1973:                    out
1974:                            .write("<a href=\"/sfa/control/leadReport?groupName=source\">\r\n                Leads by Source\r\n               ");
1975:                    out.write("</a>\r\n              ");
1976:                    out.write("</td>\r\n             ");
1977:                    out.write("</tr>\r\n             ");
1978:                    out.write("<tr>\r\n              ");
1979:                    out
1980:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1981:                    out
1982:                            .write("<a href=\"/sfa/control/leadReport?groupName=status\">\r\n                Leads by Status\r\n               ");
1983:                    out.write("</a>\r\n              ");
1984:                    out.write("</td>\r\n             ");
1985:                    out.write("</tr>\r\n             ");
1986:                    out.write("<tr>\r\n              ");
1987:                    out
1988:                            .write("<td>\r\n               &nbsp;&#8226;&nbsp;\r\n               ");
1989:                    out
1990:                            .write("<a href=\"/sfa/control/leadReport?groupName=type\">\r\n                Leads by Lead Type\r\n               ");
1991:                    out.write("</a>\r\n              ");
1992:                    out.write("</td>\r\n             ");
1993:                    out.write("</tr>\r\n            ");
1994:                    out.write("</table>\r\n           ");
1995:                    out.write("</td>\r\n          ");
1996:                    out.write("</tr>\r\n          ");
1997:                    out.write("<TR>\r\n           ");
1998:                    out.write("<TD>&nbsp;");
1999:                    out.write("</TD>\r\n          ");
2000:                    out.write("</TR>\r\n         ");
2001:                    out.write("</table>\r\n        ");
2002:                    out.write("</td>\r\n       ");
2003:                    out.write("</tr>\r\n      ");
2004:                    out.write("</table>\r\n     ");
2005:                    out.write("</TD>\r\n    ");
2006:                    out.write("</TR>\r\n   ");
2007:                    out.write("</TABLE>\r\n\r\n  ");
2008:                    out.write("</td>\r\n ");
2009:                    out.write("</tr>\r\n");
2010:                    out.write("</table>\r\n\r\n");
2011:                    out.write("  ");
2012:                    out.write("<!-- left column table -->\r\n  ");
2013:                    out.write("</td>\r\n ");
2014:                    out.write("</tr>\r\n");
2015:                    out.write("</table>\r\n\r\n\r\n");
2016:                    out
2017:                            .write("<!-- used to get dynamic information from a server -->\r\n");
2018:                    out
2019:                            .write("<A style='visibility:hidden' id='searchA' name='searchA' target=\"searchIFrame\">");
2020:                    out.write("</A>\r\n");
2021:                    out
2022:                            .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();' >");
2023:                    out.write("</iframe>\r\n");
2024:                    out.write("<!--");
2025:                    out
2026:                            .write("<iframe id='searchIFrame' name='searchIFrame' WIDTH=\"100%\" onload='updateForm();' >");
2027:                    out.write("</iframe>-->\r\n\r\n\r\n");
2028:                    out.write("</body>\r\n");
2029:                    out.write("</html>\r\n");
2030:                    out.write("\r\n\r\n");
2031:                } catch (Throwable t) {
2032:                    out = _jspx_out;
2033:                    if (out != null && out.getBufferSize() != 0)
2034:                        out.clearBuffer();
2035:                    if (pageContext != null)
2036:                        pageContext.handlePageException(t);
2037:                } finally {
2038:                    if (_jspxFactory != null)
2039:                        _jspxFactory.releasePageContext(pageContext);
2040:                }
2041:            }
2042:
2043:            private boolean _jspx_meth_ofbiz_url_0(
2044:                    javax.servlet.jsp.PageContext pageContext) throws Throwable {
2045:                JspWriter out = pageContext.getOut();
2046:                /* ----  ofbiz:url ---- */
2047:                org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_0 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2048:                        .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2049:                _jspx_th_ofbiz_url_0.setPageContext(pageContext);
2050:                _jspx_th_ofbiz_url_0.setParent(null);
2051:                int _jspx_eval_ofbiz_url_0 = _jspx_th_ofbiz_url_0.doStartTag();
2052:                if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2053:                    if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2054:                        javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2055:                                .pushBody();
2056:                        out = _bc;
2057:                        _jspx_th_ofbiz_url_0.setBodyContent(_bc);
2058:                        _jspx_th_ofbiz_url_0.doInitBody();
2059:                    }
2060:                    do {
2061:                        out.write("/testServer");
2062:                        int evalDoAfterBody = _jspx_th_ofbiz_url_0
2063:                                .doAfterBody();
2064:                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2065:                            break;
2066:                    } while (true);
2067:                    if (_jspx_eval_ofbiz_url_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2068:                        out = pageContext.popBody();
2069:                }
2070:                if (_jspx_th_ofbiz_url_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2071:                    return true;
2072:                _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_0);
2073:                return false;
2074:            }
2075:
2076:            private boolean _jspx_meth_ofbiz_url_1(
2077:                    javax.servlet.jsp.PageContext pageContext) throws Throwable {
2078:                JspWriter out = pageContext.getOut();
2079:                /* ----  ofbiz:url ---- */
2080:                org.ofbiz.content.webapp.taglib.UrlTag _jspx_th_ofbiz_url_1 = (org.ofbiz.content.webapp.taglib.UrlTag) _jspx_tagPool_ofbiz_url
2081:                        .get(org.ofbiz.content.webapp.taglib.UrlTag.class);
2082:                _jspx_th_ofbiz_url_1.setPageContext(pageContext);
2083:                _jspx_th_ofbiz_url_1.setParent(null);
2084:                int _jspx_eval_ofbiz_url_1 = _jspx_th_ofbiz_url_1.doStartTag();
2085:                if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
2086:                    if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
2087:                        javax.servlet.jsp.tagext.BodyContent _bc = pageContext
2088:                                .pushBody();
2089:                        out = _bc;
2090:                        _jspx_th_ofbiz_url_1.setBodyContent(_bc);
2091:                        _jspx_th_ofbiz_url_1.doInitBody();
2092:                    }
2093:                    do {
2094:                        out.write("/testServer");
2095:                        int evalDoAfterBody = _jspx_th_ofbiz_url_1
2096:                                .doAfterBody();
2097:                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
2098:                            break;
2099:                    } while (true);
2100:                    if (_jspx_eval_ofbiz_url_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
2101:                        out = pageContext.popBody();
2102:                }
2103:                if (_jspx_th_ofbiz_url_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
2104:                    return true;
2105:                _jspx_tagPool_ofbiz_url.reuse(_jspx_th_ofbiz_url_1);
2106:                return false;
2107:            }
2108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.