home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************\
- * *
- * Events.jfm -- Contact Manager Entry Form *
- * *
- * Events.jfm is part of the Contact Manager solution application. It is one *
- * of two data entry forms the user encounters. In this form, the user can *
- * track calls they have made to customers and what they have spoken about. *
- * All calls that are logged are recorded in a Microsoft Access database *
- * called CONTACTS inside of the table called EVENTS. *
- * *
- * The Events.jfm forms also allows the user to navigate to two different *
- * reports, which show contacts made to customers, by using the REPORT BY *
- * graphic located on the form. *
- * *
- * In addition, the user can FILTER-BY-FORM for particular records in the *
- * EVENTS table by clicking on the SEARCH FOR graphic on the form. *
- * *
- * Dependencies: bkgnd.gif *
- * eventlog.gif *
- * start.gif *
- * stop.gif *
- * logo.gif *
- * barsep.gif *
- * recnav.gif *
- * rptnav.gif *
- * homenav.gif *
- * srchnav.gif *
- * srchnav2.gif *
- * *
- * Links to: svr/intrasrv.isv?apps/contacts/events1.jrp *
- * svr/intrasrv.isv?apps/contacts/events2.jrp *
- * ibapps/contacts/index.htm *
- * *
- * Copyright (c) 1996, Borland International, Inc. All rights reserved. *
- * *
- \****************************************************************************/
- // {End Header} Do not remove this comment//
- // Generated on 11/12/96
- //
- var f = new eventsForm();
- f.open();
- class eventsForm extends Form {
- with (this) {
- onServerLoad = class::Form_onServerLoad;
- color = "white";
- height = 13.6667;
- left = 0;
- top = 0;
- width = 70;
- title = "Events Log";
- background = "filename bkgnd.gif";
- }
-
-
- with (this.contactdb = new Database()){
- left = 64;
- top = 0;
- databaseName = "CONTACTS";
- active = true;
- }
-
-
- with (this.peopleQuery = new Query()){
- left = 64;
- top = 3;
- database = parent.contactdb;
- sql = "Select * From People";
-
- active = true;
- }
-
-
- with (this.peopleQuery.rowset) {
-
- }
-
-
- with (this.callTypes = new Query()){
- left = 64;
- top = 2;
- database = parent.contactdb;
- sql = "Select * from Types";
-
- active = true;
- }
-
-
- with (this.callTypes.rowset) {
-
- }
-
-
- with (this.events1 = new Query()){
- left = 64;
- top = 1;
- database = parent.contactdb;
- sql = "SELECT * FROM Events";
-
- active = true;
- }
-
-
- with (this.events1.rowset) {
-
- }
-
-
- with (this.contbyLabel = new HTML(this)){
- height = 1;
- top = 8;
- width = 20;
- color = "blue";
- text = "Contacted By:";
- }
-
-
- with (this.callnotesLabel = new HTML(this)){
- height = 1;
- top = 13;
- width = 25;
- color = "blue";
- text = "Call Notes:";
- }
-
-
- with (this.textArea1 = new TextArea(this)){
- onFocus = class::textArea1_onFocus;
- height = 4;
- top = 14;
- width = 58;
- dataLink = parent.events1.rowset.fields["DESCRIPTION"];
- }
-
-
- with (this.typeofcontactLabel = new HTML(this)){
- height = 1;
- left = 30;
- top = 11;
- width = 30;
- fixed = true;
- color = "blue";
- text = "Type of Contact:";
- }
-
-
- with (this.eventlogImage = new Image(this)){
- height = 1.9167;
- top = 5;
- width = 18.375;
- dataSource = "filename EVENTLOG.GIF";
- alignment = 4;
- }
-
-
- with (this.NavBar = new Image(this)){
- onImageServerClick = class::NavBar_onImageServerClick;
- height = 1.0417;
- top = 20;
- width = 23.5;
- dataSource = "filename RECNAV.GIF";
- alignment = 4;
- }
-
-
- with (this.TypeOfContact = new Select(this)){
- left = 30;
- top = 12;
- width = 30;
- dataLink = parent.events1.rowset.fields["CONTTYPE"];
- }
-
-
- with (this.ContactedBy = new Select(this)){
- top = 12;
- width = 25;
- dataLink = parent.events1.rowset.fields["CONTNAME"];
- }
-
-
- with (this.barsepImage1 = new Image(this)){
- height = 0.4167;
- top = 7;
- width = 62.5;
- dataSource = "filename BARSEP.GIF";
- alignment = 4;
- }
-
-
- with (this.barsepImage2 = new Image(this)){
- height = 0.4167;
- top = 19;
- width = 62.5;
- dataSource = "filename BARSEP.GIF";
- alignment = 4;
- }
-
-
- with (this.starttimeLabel = new HTML(this)){
- height = 1;
- left = 24;
- top = 8;
- width = 14;
- fixed = true;
- color = "blue";
- text = "Start Time:";
- }
-
-
- with (this.Contstart = new Text(this)){
- left = 24;
- top = 9;
- width = 14;
- dataLink = parent.events1.rowset.fields["CONTSTART"];
- }
-
-
- with (this.Contend = new Text(this)){
- left = 44;
- top = 9;
- width = 14;
- dataLink = parent.events1.rowset.fields["CONTEND"];
- }
-
-
- with (this.endtimeLabel = new HTML(this)){
- height = 1;
- left = 44;
- top = 8;
- width = 14;
- fixed = true;
- color = "blue";
- text = "End Time:";
- }
-
-
- with (this.customerNameLabel = new HTML(this)){
- height = 1;
- top = 11;
- width = 25;
- color = "blue";
- text = "Customer Name:";
- }
-
-
- with (this.NavRpt = new Image(this)){
- onImageServerClick = class::NavRpt_onImageServerClick;
- height = 1.0417;
- left = 28;
- top = 20;
- width = 16.375;
- dataSource = "filename RPTNAV.GIF";
- alignment = 4;
- }
-
-
- with (this.NavHome = new Image(this)){
- onImageClick = class::NavHome_onImageClick;
- height = 1.0833;
- left = 59.25;
- top = 5.7917;
- width = 3.25;
- dataSource = "filename HOMENAV.GIF";
- alignment = 4;
- }
-
-
- with (this.ContBy = new Text(this)){
- top = 9;
- width = 20;
- dataLink = parent.events1.rowset.fields["CONTBY"];
- }
-
-
- with (this.NavSrch1 = new Image(this)){
- onDesignLoad = class::NavSrch1_onDesignLoad;
- onImageServerClick = class::NavSrch1_onImageServerClick;
- height = 1.0417;
- left = 54;
- top = 20;
- width = 8.375;
- dataSource = "filename SRCHNAV.GIF";
- alignment = 4;
- }
-
-
- with (this.NavSrch2 = new Image(this)){
- onServerLoad = class::NavSrch2_onServerLoad;
- onImageServerClick = class::NavSrch2_onImageServerClick;
- height = 1.0417;
- left = 46;
- top = 21;
- width = 16.5;
- dataSource = "filename SRCHNAV2.GIF";
- alignment = 4;
- }
-
-
- with (this.startImage = new Image(this)){
- onImageServerClick = class::startImage_onImageServerClick;
- height = 0.5833;
- left = 24;
- top = 10;
- width = 6.125;
- dataSource = "filename START.GIF";
- alignment = 4;
- }
-
-
- with (this.stopImage = new Image(this)){
- onImageServerClick = class::stopImage_onImageServerClick;
- height = 0.5833;
- left = 44;
- top = 10;
- width = 6.125;
- dataSource = "filename STOP.GIF";
- alignment = 4;
- }
-
-
- with (this.logoImage = new Image(this)){
- height = 5;
- width = 62.625;
- dataSource = "filename LOGO.GIF";
- alignment = 4;
- }
-
- this.rowset = this.events1.rowset;
-
- function Form_onServerLoad()
- {
- // Make sure the user doesn't see NavSrch2 yet
- this.NavSrch2.visible = false;
- // Fill in the "Contacted Person" combo-box
- this.contactPeople = new Array();
- while (!form.peopleQuery.rowset.endOfSet)
- {
- var fullName = form.peopleQuery.rowset.fields["FName"].value + " " +
- form.peopleQuery.rowset.fields["LName"].value;
- form.contactPeople.add(fullName);
- form.peopleQuery.rowset.next();
- }
- form.ContactedBy.options = "array form.contactPeople";
- // Are we filtering or not?
- if (form.rowset.state == 4)
- {
- form.ContactedBy.value = "";
- }
- else
- {
- form.ContactedBy.value = form.rowset.fields["ContName"].value;
- }
- // Fill in the "Type of Contact" combo-box
- this.callTypesArray = new Array();
- while (!form.callTypes.rowset.endOfSet)
- {
- form.callTypesArray.add(form.callTypes.rowset.fields["Type"].value);
- form.callTypes.rowset.next();
- }
- form.TypeOfContact.options = "array form.callTypesArray";
- // Are we filtering or not?
- if (form.rowset.state == 4)
- {
- form.TypeOfContact.value = "";
- }
- else
- {
- form.TypeOfContact.value = form.rowset.fields["ContType"].value;
- }
- }
-
- function NavBar_onImageServerClick(nLeft, nTop)
- {
- if (nLeft >= 0 && nLeft <= 25)
- {
- // The user clicked "First"
- form.rowset.first();
- }
- else if (nLeft >= 27 && nLeft <= 52)
- {
- // The user clicked "Previous"
- if (!form.rowset.next(-1))
- form.rowset.next();
- }
- else if (nLeft >= 54 && nLeft <= 79)
- {
- // The user clicked "Next"
- if (!form.rowset.next())
- {
- form.rowset.next(-1);
- form.rowset.beginAppend();
- form.TypeOfContact.value = "";
- form.ContactedBy.value = "";
- }
- }
- else if (nLeft >= 81 && nLeft <= 106)
- {
- // The user clicked "Last"
- form.rowset.last();
- }
- else if (nLeft >= 108 && nLeft <= 133)
- {
- // The user clicked "Add"
- form.rowset.beginAppend();
- }
- else if (nLeft >= 135 && nLeft <= 160)
- {
- // The user clicked "Save" (the floppy disk image)
- var state = form.rowset.state;
- form.rowset.save();
- if (state == 3) {
- form.rowset.parent.requery();
- form.rowset.last();
- }
- }
- else if (nLeft >= 162 && nLeft <= 188)
- {
- // The user clicked "Delete" (the big red X image)
- form.rowset.delete();
- }
- }
-
- function NavHome_onImageClick(nLeft, nTop)
- {
- // The user clicked "Home" (the little blue house image)
- location.href = "/ibapps/contacts/index.htm";
- }
-
- function NavRpt_onImageServerClick(nLeft, nTop)
- {
- if (nLeft >= 0 && nLeft <= 93)
- {
- // The user clicked "Type" on the "Report By" image
- _sys.reports.run( "events1.jrp");
- }
- else if (nLeft >= 95 && nLeft <= 188)
- {
- // The user clicked "Person" on the "Report By" image
- _sys.reports.run( _sys.env.home() + "apps\\contacts\\events2.jrp");
- }
- }
-
- function NavSrch1_onImageServerClick(nLeft, nTop)
- {
- with(this)
- {
- // Make this graphic invisible
- visible = false;
- // Make the search options graphic visible
- form.NavSrch2.visible = true;
- // Start the filter process
- form.rowset.beginFilter();
- }
- }
-
- function NavSrch2_onImageServerClick(nLeft, nTop)
- {
- if (nLeft >= 0 && nLeft <= 64)
- {
- // The user clicked "Find Now", so apply the filter
- form.rowset.applyFilter();
- }
- else if (nLeft >= 66 && nLeft <= 131)
- {
- // The user clicked "CANCEL" so hide this graphic,
- // unhide the "Search for Events" graphic, remove the
- // filter from the rowset and place the user back at
- // the first record in the database.
- this.visible = false;
- form.NavSrch1.visible = true;
- form.rowset.clearFilter();
- form.rowset.first();
- }
- }
-
- function NavSrch2_onServerLoad()
- {
- // Move it up on the form
- this.top -= 1;
- }
-
- function NavSrch1_onDesignLoad()
- {
- // Make sure this image is visible at design time
- this.visible = true;
- }
-
- function startImage_onImageServerClick(nLeft, nTop)
- {
- // Make the "CONTSTART" field the current date/time
- var state = form.events1.rowset.state;
- form.events1.rowset.fields["CONTSTART"].value = new Date();
- form.events1.rowset.save();
- if (state == 3) {
- form.events1.requery();
- form.events1.rowset.last();
- }
- }
-
- function stopImage_onImageServerClick(nLeft, nTop)
- {
- // Make the "CONTEND" field the current date/time
- var state = form.events1.rowset.state;
- form.events1.rowset.fields["CONTEND"].value = new Date();
- form.events1.rowset.save();
- if (state == 3) {
- form.events1.requery();
- form.events1.rowset.last();
- }
- }
-
- function textArea1_onFocus()
- {
- window.status = "Enter your comments about the current event here."
- }
- }
-
-