Work in progress:
-- 'allowoffhours' attribute for bookings
- less verbose booking syntax
- Split toolbar with zoom and scheduling icons.
--- /dev/null
+project prj "Project" "1.0" 2006-02-18-0:00-GMT +2m {
+ timezone "GMT"
+ scenario plan "Plan" { projection }
+}
+
+resource r1 "Resource 1" {
+ vacation 2006-02-19
+}
+
+task t1 "Task 1" {
+ start 2006-02-18
+ effort 2d
+ allocate r1
+}
+
+supplement resource r1 {
+ booking t1 2006-02-18-8:00 +8h { overtime 1 }
+ booking t1 2006-02-19-8:00 +8h { overtime 2 }
+}
+
+taskreport "Tasks" {
+ columns no, name, start, end, chart
+}
-project prj "Project" "1.0" 2003-06-05 2003-07-05 {
+project prj "Project" "1.0" 2003-06-05 +1m {
# The baseline date for the projection.
now 2003-06-15
scenario plan "Plan" {
supplement resource r1 {
# This is the work that has been done up until now by r1.
- booking 2003-06-06 2003-06-07 t1 { sloppy 2 }
- booking 2003-06-08 2003-06-09 t1 { sloppy 2 }
- booking 2003-06-11 2003-06-12 t1 { sloppy 2 }
+ booking t1 2003-06-06 +8h { sloppy 2 }
+ booking t1 2003-06-08 +8h { sloppy 2 }
+ # Book interval that extends into off-hours.
+ booking t1 2003-06-11-8:00 +10h { overtime 1 }
}
<listitem><para>Generate propper warning when bookings are assigned to
container tasks or milestones.</para></listitem>
+<listitem><para>It is now possible to book off-hour and vacation time
+slots with 'booking' when the <link
+linkend="PROPERTY_overtime">overtime</link> attribute is
+used.</para></listitem>
+
</itemizedlist></para>
</sect2>
given, all bookings must only cover working time for the
resource.</para></descr>
<attributes>
- <attr name="start" type="DATE"/>
- <attr name="end" type="DATE"/>
<attr name="task" type="ID"/>
+ <attr name="period" type="DATEINTERVAL"/>
</attributes>
<optattributes>
+ <optattr>overtime</optattr>
<optattr>sloppy</optattr>
</optattributes>
<seealso>
</attributes>
<example>&example_numberformat;</example>
</property>
+ <property name="overtime" id="overtime" inheritable="No">
+ <descr><para>This attribute enables bookings to override working
+ hours and vacations.</para></descr>
+ <attributes>
+ <attr name="value" type="INTEGER">
+ <para>Number between 0 and 2. See table below.</para>
+ </attr>
+ </attributes>
+ <freestyle>
+ <para><simplelist type="horiz" columns="2">
+
+ <member><varname>overtime 0:</varname></member>
+ <member>You can only book available working hours. (Default)</member>
+
+ <member><varname>overtime 1:</varname></member>
+ <member>You can book off-hours as well.</member>
+
+ <member><varname>overtime 2:</varname></member>
+ <member>You can book normal working hours, off-hours and vacations.</member>
+
+ </simplelist></para>
+ </freestyle>
+ <example>&example_booking;</example>
+ </property>
<property name="persistent" id="persistent" inheritable="No">
<descr><para>Specifies that once a resource is picked from the list
of alternatives this resource is used for the whole task.
<para>The version of the project file. This could be a revision
number from a revision control system.</para>
</attr>
- <attr name="start" type="DATE">
- <para>All task must start after this date.</para>
- </attr>
- <attr name="end" type="DATE">
- <para>All task must end before this date.</para>
+ <attr name="period" type="DATEINTERVAL">
+ <para>The expected interval of the project. It may be larger than
+ necessary, but it needs to be large enough to fit all tasks.</para>
</attr>
</attributes>
<optattributes>
<member><varname>sloppy 0:</varname></member>
<member>Period may not contain any off-duty hours, vacation or
- other task assignments.</member>
+ other task assignments. (Default)</member>
<member><varname>sloppy 1:</varname></member>
<member>Period may contain off-duty hours, but not vacation or
is followed by a plus character. The plus character must be separated
from the start date by a space or newline character. The plus must be
followed by a number and a <link linkend="TYPE_UNIT">UNIT</link>.</para>
+
+<para><screen>2006-02-18 - 2006-02-19
+2006-02-18
+2006-02-18 +1d
+</screen></para>
+
</sect2>
<sect2 id="TYPE_GLOBAL_ID"><title>GLOBAL_ID</title>
flagBar are declared flags, the following example is a correct
expression:</para>
-<para><screen>
-(flagFoo | flagFooBar) & ˜flagBar
+<para><screen>(flagFoo | flagFooBar) & ˜flagBar
</screen></para>
<para>The following functions can be used in logical expressions:
</author>
</authorgroup>
<copyright>
- <year>2001, 2002, 2003, 2004, 2005</year>
+ <year>2001, 2002, 2003, 2004, 2005, 2006</year>
<holder>Chris Schläger</holder>
</copyright>
<date>Version @VERSION@</date>
int sloppy = 0;
+ int overtime = 0;
if ((tt = nextToken(token)) == LBRACE)
{
while ((tt = nextToken(token)) != RBRACE)
{
- if (token == "sloppy")
+ if (token == KW("sloppy"))
{
if (nextToken(token) != INTEGER ||
token.toInt() < 0 || token.toInt() > 3)
}
sloppy = token.toInt();
}
+ else if (token == KW("overtime"))
+ {
+ if (nextToken(token) != INTEGER ||
+ token.toInt() < 0 || token.toInt() > 2)
+ {
+ errorMessage(i18n("Number between 0 and 2 expected"));
+ return 0;
+ }
+ overtime = token.toInt();
+ }
else
{
errorMessage(i18n("Attribute ID expected"));
returnToken(tt, token);
Booking* b = new Booking(iv, task);
- if (!resource->addBooking(sc, b, sloppy))
+ if (!resource->addBooking(sc, b, sloppy, overtime))
return false;
return true;
{
uint idx = sbIndex(nb->getStart());
- return bookSlot(idx, nb);
+ return bookSlot(idx, nb, 0);
}
bool
-Resource::bookSlot(uint idx, SbBooking* nb)
+Resource::bookSlot(uint idx, SbBooking* nb, int overtime)
{
// Make sure that the time slot is still available.
- if (scoreboard[idx] != 0)
+ if (scoreboard[idx] > (SbBooking*) overtime)
{
delete nb;
return FALSE;
}
bool
-Resource::bookInterval(Booking* nb, int sc, int sloppy)
+Resource::bookInterval(Booking* nb, int sc, int sloppy, int overtime)
{
uint sIdx = sbIndex(nb->getStart());
uint eIdx = sbIndex(nb->getEnd());
bool conflict = FALSE;
for (uint i = sIdx; i <= eIdx; i++)
- if (scoreboard[i])
+ if (scoreboard[i] > (SbBooking*) overtime)
{
uint j;
for (j = i + 1 ; j <= eIdx &&
return FALSE;
for (uint i = sIdx; i <= eIdx; i++)
- bookSlot(i, new SbBooking(*nb));
+ if (scoreboard[i] <= (SbBooking*) overtime)
+ bookSlot(i, new SbBooking(*nb), overtime);
return TRUE;
}
bool
-Resource::addBooking(int sc, Booking* nb, int sloppy)
+Resource::addBooking(int sc, Booking* nb, int sloppy, int overtime)
{
SbBooking** tmp = scoreboard;
scoreboard = scoreboards[sc];
else
initScoreboard();
- bool retVal = bookInterval(nb, sc, sloppy);
+ bool retVal = bookInterval(nb, sc, sloppy, overtime);
// Cross register booking with task.
if (retVal && nb->getTask())
nb->getTask()->addBookedResource(sc, this);
bool book(Booking* b);
- bool bookSlot(uint idx, SbBooking* nb);
- bool bookInterval(Booking* b, int sc, int sloppy = 0);
- bool addBooking(int sc, Booking* b, int sloppy = 0);
+ bool bookSlot(uint idx, SbBooking* nb, int overtime = 0);
+ bool bookInterval(Booking* b, int sc, int sloppy = 0, int overtime = 0);
+ bool addBooking(int sc, Booking* b, int sloppy = 0, int overtime = 0);
double getCurrentLoad(const Interval& i, const Task* task = 0) const;