Instructions for Creating Charts

Charts provide a graphic display of scheduled tasks. They consist of four principal elements:

·  Time range

·  Employees/resources

·  Tasks[*]

·  Task dependencies (applicable only in an industrial setting)

The GANTT program supports three different kinds of charts:

·  Gantt: The X-axis is a variable timeline; the Y-axis consists of employees/resources.

·  Calendar: The X-axis is a 24-hour timeline; the Y-axis consists of a main scale displaying days, and a sub-scale displaying employees/resources.

·  Journal: The X-axis is a 24-hour timeline; the Y-axis consists of a main scale displaying employees/resources, and a sub-scale displaying days.

The user can perform the following operations in a chart:

·  Add new tasks

·  Update/delete existing tasks

·  Display task details

·  Display employee details

·  Toggle between the 3 chart types (Gantt/Calendar/Journal)

·  Vary the timeline

·  Zoom to a task in Priority

·  Zoom to an employee in Priority

To create a new chart, you need to define a procedure that activates the GANTT program. You must also define an interface to the appropriate form, to be driven by the GANTT program when updating or adding fields.

A procedure for building charts consists of two distinct sections, separated by an END step:

·  Section One: Begins with INPUT and/or SQLI steps and ends with the activation of the GANTT program.

·  Section Two: Query steps for data retrieval.

Section One of the Procedure: User Input and Activation of the GANTT Program

As in other procedures, this section requires user input, to determine which resources to display and during what time period. When run by Direct Activation, there is no INPUT step, so you need to initialize the necessary parameters (e.g., display mode, time range) in an SQLI step. Where applicable (e.g., when running the procedure from the Tasks form), you can pass the data in the open record to the GANTT program, which will then display the current record as selected. In this case it is recommended to define a distinct color for the selected record.

Whether the GANTT program is run by Direct Activation or from the menu, a LINK table must be defined, for the purpose of executing queries against the required tables.

Parameters that must be defined for the GANTT program:

·  The name of the current procedure (in order to retrieve queries from the second section).

·  From Date: The date from which chart data should be displayed.

·  To Date: The date until which chart data should be displayed

·  LINK file: Usually the employee/resource table from the procedure’s INPUT step. You can also execute calculations before running the GANTT program, and link the table containing the calculation results.

·  The name of the LINK table.

·  The name of the interface that updates/adds tasks.

·  The name of the form to which the user can zoom for task details.

·  The name of the form to which the user can zoom for employee details.

·  The flag permitting/preventing revisions to the chart (0/1).

·  The flag permitting/preventing additions to the chart (0/1).

·  The maximum title length (i.e., number of characters) when adding new tasks.

·  The default display option (1=Resource Chart, 2=Calendar, 3=Journal). If you designate the value 0, the GANTT program will open to the last display viewed by the current user.

·  Identifier of the selected task.

·  Identifier of the employee/resource assigned to the selected task.

·  Start Time (when running in Calendar or Journal Mode).

·  End Time (when running in Calendar or Journal Mode).

·  The default time range when new tasks are opened (in minutes).

·  The display resolution of the time scale (in minutes).

Section Two of the Procedure: Defining Parameters

The following is the list of parameters to be defined in the second section of the procedure (all steps are Type C; their order is not important):

Name of the Step: / Returns:
RESOURCE / The list of employees to display
RESOURCE_DETAILS / The details of a specific employee
TASKS / The list of tasks to display
TASK_DETAILS / The details of a specific task
TASK_TEXT / The text of a specific text
TASK_REFRESH / Updated display of task details
WORKHOURS / Work hours for every day of the week
DAYSOFF / Non-working days
RESOURCE_WORKHOURS / Work hours per employee (instead of the previous two steps)
RELATIONS / Task dependencies (applicable only to an industrial setting)

The RESOURCE Step: Employees to Display

·  Fields to retrieve: employee identifier, employee name, zoom value, a sorting column

·  Query variables (optional): FROMDATE, TODATE.

Notes:

§  Always retrieve values for all four fields.

§  You may choose not to use the sorting column; its purpose is to allow you to sort records by something other than the employee name.

Example:

SELECT USER,USERNAME,USERLOGIN,1

FROM USERS

WHERE USER>0
ORDER BY USERLOGIN;

The RESOURCE_DETAILS Step: Employee Details to Display

·  Fields to retrieve: Any desired employee details from the USERS or USERSB form.

·  Query variables (required): RESOURCEID.

Note: You can dynamically define procedure messages to serve as field titles for the returned values by using the # symbol for each field, followed by a message number.

Example:

SELECT USERLOGIN,SNAME,EMAIL,ADDRESS,SQL.DATES AS ‘#20’

FROM USERS,USERSB

WHERE USERS.USER = :RESOURCEID

AND USERS.USER = USERSB.USER;

The TASKS Step: Tasks to Display

·  Fields to retrieve: task identifier, employee identifier, task description, from date/time, to date/time, zoom value, display color

·  Query variables

§  (required): FROMDATE, TODATE

§  (optional): SELECTEDID

Notes:

§  Retrieve values for all of the above fields.

§  The date field must also include the time (DATE 14).

§  The display color is a value from the COLORS table. To avoid defining a color, use the value 0.

Example:

SELECT DIARY,USER,TEXT

(CUSTNOTE > 0 ? ITOA(CUSTNOTE,0,USECOMMA): ‘’),

CURDATE+STIME,CURDATE+ETIME,(DIARY = :SELECTEDID ? 1 : 0)

FROM DIARIES

WHERE CURDATE BETWEEN :FROMDATE AND :TODATE

AND USER = (SELECT USER FROM USERS !);

The TASK_DETAILS Step: Task Details to Display

·  Fields to retrieve: Any desired task or employee details from the DIARIES or USERS form.

·  Query variables (required): TASKID

Note: You can dynamically define procedure messages to serve as field titles for the returned values by using the # symbol for each field, followed by a message number.

Example:

SELECT DIARIES.TEXT AS ‘#19’,USERS.USERNAME,

DIARIES.CURDATE,DIARIES.STIME,DIARIES.ETIME

FROM DIARIES,USERS

WHERE DIARIES.DIARY = :TASKID

AND DIARIES.USER = USERS.USER;

The TASK_TEXT Step: Task Text to Display

·  Fields to retrieve: Text, line order (ORD)

·  Query variables (required): TASKID

Example:

SELECT TEXT, TEXTORD FROM CUSTNOTESTEXT

WHERE CUSTNOTE = :TASKID

AND TEXTLINE > 0

ORDER BY TEXTORD;

The TASK_REFRESH Step: Updating the Display

·  Fields to retrieve: task description, zoom value, from date/hour, to date/hour, color.

·  Query variables (required): RESOURCEID, TASKID

Example:

SELECT D.TEXT,ITOA(CUSTNOTES.CUSTNOTE,0,USECOMMA),

D.CURDATE+D.STIME,D.CURDATE+D.ETIME,0

FROM DIARIES D,CUSTNOTES

WHERE CN.CUSTNOTE = :TASKID

AND D.CUSTNOTE = CN.CUSTNOTE

AND D.USER IN (-9999,:RESOURCEID);

The WORKHOURS Step: Official Work Hours

·  Fields to retrieve: from hour, to hour

·  Query variables (required): DAY

Notes:

§  The query acts separately on each day of the week.

§  The query should fail on holidays (e.g., Sunday).

Example:

SELECT 08:30,(:DAY = 6 ? 12:00 : 17:30) FROM DUMMY

WHERE :DAY BETWEEN 1 AND 6;

The DAYSOFF Step: Holidays

·  Fields to retrieve: from hour

·  Query variables (required): CURDATE

Notes:

§  The query acts separately on each day within the designated date range.

§  On holidays the query should return 0.

§  On days preceding holidays the query should return the time work ends.

§  On a regular workday the query should fail.

Example:

SELECT FROMTIME FROM OFFICECLOSED

WHERE CURDATE = :CURDATE;

The RESOURCE_WORKHOURS Step: Employee Work Hours

·  Fields to retrieve: from date/hour, to date/hour

·  Query variables (required): RESOURCEID, FROMDATE, TODATE

Notes:

§  The query acts separately on each employee.

§  The query returns all work hours performed by the employee in the desired date range (i.e., more than one record).

§  The date field must also include the time (DATE 14).

Example:

SELECT WDATE+FROMTIME,WDATE+TOTIME FROM WORKHOURS

WHERE USER = :RESOURCEID

AND WDATE BETWEEN :FROMDATE AND :TODATE;

The RELATIONS Step: Task Dependencies

·  Fields to retrieve: parent task identifier, child task identifier, display color

·  Query variables (required): FROMDATE, TODATE

Note: This step is only applicable in an industrial setting.

Procedure Messages

As mentioned previously, you can dynamically define procedure messages to serve as field titles for retrieved task or employee details. However, such messages should only be assigned numbers greater than 9.

Messages 1 through 9 are already used by the GANTT program for various display titles. Consequently, when defining a new procedure you should always start by filling in the first nine messages. The following table explains how these messages are used:

No. / Explanation / Example
1 / Chart name / Appointment Chart
2 / Chart title / Appointment Chart
3 / Title while initializing employees / Loading employees…
4 / Title while initializing tasks / Loading tasks…
5 / Title while initializing dependencies / Loading dependencies…
6 / Title for adding a task / New Appointment
7 / Title for updating a task / Update Appointment
8 / Title for the subject field when updating/adding a task / Subject
9 / Title for employees/resources / Employees

Defining the Interface for Updating/Adding Tasks

The interface is defined against the GENERALLOAD table. Define an interface for any form, against this table, and record the name of the interface as an argument in the call to the GANTT program. The interface will always run when the table contains a single record whose code is 1 (in the Form Load Designer).

The values for adding/updating a task appear in the table in the following fields:

Field / Value
INT1 / task identifier
INT2 / employee/resource identifier
INT3 / from hour
INT4 / to hour
INT5 / original employee/resource identifier (before update)
DATE1 / from date (DATE 8)
DATE2 / to date (DATE 8)
DATE3 / from date/hour (DATE 14)
DATE4 / to date/hour (DATE 14)
TEXT / task title

Notes:

·  You can use either separate fields for date and time, or a single field for both.

·  When the user adds a new task to the chart, the interface runs with task identifier 0.

Creating Charts in Priority 4 11/02/03

[*] The term “task” is used throughout to represent any kind of operation (e.g., work order) that can be displayed in a chart.