NAME

Liz::ProjectSet::Item - generic module for Item objects


SYNOPSIS

 use xxLINK;
 $xxlink = new xxLINK;
 $projectset = $xxlink->ProjectSet;
 
 $item = $projectset->Item;
 $item = $projectset->Item( $itemID );
 $item = $projectset->Item( $itemID,$orderID );

 $itemID = $item->update;


DESCRIPTION

Provide object oriented access to the Item object of the Liz::ProjectSet module family. Usually not accessed directly, but rather through a client module.


BASIC METHODS


new

Create a new Item object from a Order object.

Input Parameters

 1 Liz::SQL object
 2 ID or description to create Item object with
 3 orderID for which to create Item
Output Parameters

 1 instantiated object
Note

It is not intended to call this method directly, but rather indirectly through a client module.

Example

 $xxlink = new xxLINK;
 $projectset = $xxlink->ProjectSet;
 $item = $projectset->Item;
 $item = $projectset->Item( $itemID,$orderID );


update

Update a Item object in the database.

Output Parameters

 1 ID with which the object was updated (undef = error)
Example

 $item->update;


CONTENT METHODS

The following methods allow you to change the fields associated with the Liz::ProjectSet::Item object.


ClientID

Return the ClientID of the Project of the Order of the Item.

Output Parameters

 1 clientID of the project of the order of the item
Example

 $clientID = $item->ClientID;


ContactID

Return or set the ContactID (of the client's contact of the project when this work was item) of the Item object. Its value can be used to create a new Liz::ProjectSet::Contact object.

Input Parameters

 1 new value of ContactID
   (default: no change)
Output Parameters

 1 current/old value of ContactID
Example

 $item->ContactID( $contactID );
 $contactID = $item->ContactID;


employeeIDs

Return a list of employeeIDs associated with this employee.

Output Parameters

 1 List of associated employees


Created

Return the Created information of the Item object.

Output Parameters

 1 current timestamp of the Created
Example

 $created = $item->Created;


Deadline

Return or set the Deadline information (the timestamp of the date when the work is to be finished) of the Item object.

Input Parameters

 1 new value of Deadline (timestamp)
   (default: no change)
Output Parameters

 1 current/old value of Deadline
Example

 $item->Deadline( $item->Int2Timestamp( $year,$month,$day );
 $deadline = $item->Timestamp2Date( '',$item->Deadline );


Description

Return or set the Description (of the work item) of the Item object.

Input Parameters

 1 new contents of Description
   (default: no change)
Output Parameters

 1 current/old contents of Description
Example

 $item->Description( 'Implementatie van Liz::ProjectSet' );
 $description = $item->Description;


EmployeeIDs

Return or set the EmployeeIDs (list of contactID's from the EmployeeSet) of the Liz::ProjectSet::Item object.

Input Parameters

 1..N new employeeID's
      (default: no change)
Output Parameters

 1..N current/old employeeID's
Example

 $client->EmployeeIDs( @employeeID );
 @employeeID = $client->EmployeeIDs;


TodoIDs

Return a list of itemIDs associated with this employee.

Output Parameters

 1 List of associated projects


TotalDoneTime

Return the total time spent in Dones for this Item. And optionally how much time is left or how much we're short. 'Over budget' is simply indicated by a negative number.

Output Parameters

 1 Total time spent in Dones for this Item
 2 Remaining available time, or how much over budget


TotalTodoTime

Return the total time scheduled in Todos for this Item. And optionally how much time is left or how much we're short. 'Over budget' is simply indicated by a negative number.

Output Parameters

 1 Total time in Todos for this Item
 2 Time scheduled for this Item


InvoiceTypeID

Return or set the InvoiceTypeID information (the categoryID for the type of invoicing to be performed) of the Item object. Use method ParentInvoiceTypeID for the categoryID of the parent category of all InvoiceTypes, which can be used to e.g. create a pulldown.

Input Parameters

 1 new value of InvoiceTypeID
   (default: no change)
Output Parameters

 1 current/old value of InvoiceTypeID
Example

 $item->InvoiceTypeID( $invoicetypeID );
 $invoicetypeID = $item->InvoiceTypeID;


LeaderID

Return the LeaderID of the Project of the Order of the Item.

Output Parameters

 1 leaderID of the project of the order of the item
Example

 $leaderID = $item->LeaderID;


OrderedByID

Return or set the OrderedByID information (contactID or employeeID of the person ordering to do the work) of the Item object.

Input Parameters

 1 new value of OrderedByID
   (default: no change)
Output Parameters

 1 current/old value of OrderedByID
Example

 $item->OrderedByID( $orderedbyID );
 $orderedbyID = $item->OrderedByID;


OrderID

Return or Set the OrderID information (the ID of the Order object to which this item applies) of the Item object.

Input Parameters

 1 new value of OrderID
   (default: no change)
Output Parameters

 1 current/old value of OrderID
Example

 $item->OrderID( $orderID );
 $orderitemID = $item->OrderID;


ParentInvoiceTypeID

Return the ParentInvoiceTypeID (the categoryID of the parent of all possible InvoiceTypes) which can be used to e.g. create a pulldown. Use method InvoiceTypeID to actually set the type of invoice for this object.

Output Parameters

 1 current value of ParentInvoiceTypeID
Example

 $parentinvoicetypeID = $item->ParentInvoiceTypeID;


ParentTariffID

Return the ParentTariffID (the categoryID of the parent of all possible Tariffs) which can be used to e.g. create a pulldown. Use method TariffID to actually set the type of tariff for this object.

Output Parameters

 1 current value of ParentTariffID
Example

 $parenttariffID = $item->ParentTariffID;


ParentWorkTypeID

Return the ParentWorkTypeID (the categoryID of the parent of all possible WorkTypes) which can be used to e.g. create a pulldown. Use method WorkTypeID to actually set the type of work for this object.

Output Parameters

 1 current value of ParentWorkTypeID
Example

 $parentworktypeID = $item->ParentWorkTypeID;


ProjectID

Return the ProjectID (of the project for which this work was item) of the Item object. Its value can be used to create a new Liz::ProjectSet::Project object.

Output Parameters

 1 value of ProjectID
Example

 $projectID = $item->ProjectID;


Status

Return or set the Status information of the Item object.

Input Parameters

 1 new value of the Status
   (default: no change)
Output Parameters

 1 current/old value of the Status
Example

 $item->Status( 1 );
 $status = $item->Status;


TariffID

Return or set the TariffID information (the categoryID for the tariff to be invoiced) of the Liz::ProjectSet::Item object. Use method ParentTariffID for the categoryID of the parent category of all Tariffes, which can be used to e.g. create a pulldown.

Input Parameters

 1 new value of TariffID
   (default: no change)
Output Parameters

 1 current/old value of TariffID
Example

 $item->TariffID( $tariffID );
 $tariffID = $item->TariffID;


TimeToSpend

Return or set the TimeToSpend info (maximum number of minutes of work to be spent on this record) of the Item object.

Input Parameters

 1 new value of TimeToSpend
   (default: no change)
Output Parameters

 1 current/old value of TimeToSpend
Example

 $item->TimeToSpend( 30 );
 $timespent = $item->TimeToSpend;


Updated

Return the Updated information of the Item object.

Output Parameters

 1 current timestamp of the Updated
Example

 $updated = $item->Updated;


URL

Specify or return the URL associated with the Item object.

Input Parameters

 1 new value of the URL
   (default: no change)
Output Parameters

 1 previous/current version of the URL
Example

 $item->URL( $url );
 $url = $item->URL;


URLID

Return the URLID of the Liz::ProjectSet::Item object. This is usually only used internally. It is better to use the more transparant method URL instead.

Input Parameters

 1 new urlID
   (default: no change)
Output Parameters

 1 current/old urlID
Example

 $urlID = $item->URLID;


WorkTypeID

Return or set the WorkTypeID information (the categoryID for the type of work performed) of the Item object. Use method ParentWorkTypeID for the categoryID of the parent category of all WorkTypes, which can be used to e.g. create a range of radio buttons or a pulldown menu.

Input Parameters

 1 new WorkTypeID
   (default: no change)
Output Parameters

 1 current/old WorkTypeID
Example

 $item->WorkTypeID( $worktypeID );
 $worktypeID = $item->WorkTypeID;


LIST METHODS

The following methods return an SQL-statement(-like) handle that allows listing of (a selection of) the objects of a certain type.


Todos

Return an SQL-statement(-like) handle that contains a selection of the Todo records available in the ProjectSet for this Item. The following field names can be specified with the first parameter:

 ID
 The ID of the Todo record.  Can be used as a parameter on the L<Todo> object.

 status
 The status of the Todo record: can be any number between 0 and 255 inclusive.

 deadline
 Timestamp of the deadline to which the Todo record applies.

 employeeID
 The ID of the person that is supposed to perform the work.

 description
 Description of what is to be done.

 timetospend
 Number of minutes that are allowed to spend on this Todo.

 itemID
 The ID of the Order::Item to which this Todo applies.

 doneID
 The ID of the Done record that applies to this Todo record.

 updated
 Timestamp when the Todo record was last updated in the database.

 created
 Timestamp when the Todo record was created in the database.
Input Parameters

 1 fields to return for each Todo record, seperated by comma's
   (default: 'ID,status,deadline,employeeID,description,timetospend,itemID,doneID,updated,created' );
 2 extra SQL condition to apply
   (default: none)
 3 order in which to return the finds
   (default: deadline)
 4 which records should be returned
   (default: all )
Output Parameters

 1 SQL-like statement handle (on which method "fetchrow" can be applied)
Examples

 $result = $projectset->Todos;
 $result = $projectset->Todos( 'employeeID,description',"description LIKE '%extra%" );


AUTHOR

Elizabeth Mattijsen ( lizperl@INC.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

Version 0.16, 1 December 1999

Added methods TotalTodoTime and TotalDoneTime.

Version 0.15, 30 November 1999

Now, update sets the alteredbyID-field to the current user ID. Now inherits the PROJECTSET from the object.

Version 0.14, 29 November 1999

Added stuff for alteredbyID-field.

Version 0.13, 11 November 1999

Added EmployeeIDs.

Version 0.12, 30 September 1999

Now no longer adds Exporter to ISA: it wasn't necessary.

Version 0.11, 20 August 1999

Added support for extra fields to new and update.

Version 0.1, 14 August 1999

First version of this true Perl module.