OSDN Git Service

- Add an error message to prevent users from assigning account groups to
authorcs <cs@e1914e07-63f8-0310-9059-d6d858d7cdca>
Wed, 21 Jun 2006 19:35:38 +0000 (19:35 +0000)
committercs <cs@e1914e07-63f8-0310-9059-d6d858d7cdca>
Wed, 21 Jun 2006 19:35:38 +0000 (19:35 +0000)
  tasks.

git-svn-id: https://www.taskjuggler.org/svn/taskjuggler/trunk@1300 e1914e07-63f8-0310-9059-d6d858d7cdca

TestSuite/Syntax/Correct/Reports.tjp
docs/en/ChangeLog.xml
docs/en/PropertyReference.xml
taskjuggler/Task.cpp

index d40340c..18dc455 100644 (file)
@@ -34,7 +34,7 @@ task t2 "FooTask2" {
   start 2000-01-01
   duration 1d
   startcredit 10000.0
-  account a2
+  account a4
 }
 
 task t3 "FooTask3" {
index aa66e5b..1bccb37 100644 (file)
@@ -968,6 +968,9 @@ reports.</para></listitem>
 <listitem><para>XML reports now use the gzip compressed version 2 XML
 format by default.</para></listitem>
 
+<listitem><para>Add check to forbid assigning account groups to
+tasks.</para></listitem>
+
 </itemizedlist></para>
 
 </sect2>
index 70de3dd..dfbc962 100644 (file)
@@ -196,7 +196,8 @@ this type.</para></descr>
  </property>
  <property name="account" id="account_task" inheritable="Yes">
   <descr><para>All amounts associated with the task will be credited
-to the specified account.</para></descr>
+to the specified account. The account must not be an account group.
+</para></descr>
   <attributes>
    <attr name="accountid" type="ID"/>
   </attributes>
index 73596aa..24b23f6 100644 (file)
@@ -2024,6 +2024,15 @@ Task::hasEndDependency() const
 bool
 Task::preScheduleOk(int sc)
 {
+    if (account && !account->isLeaf())
+    {
+        errorMessage(i18n
+                     ("Task '%1' must not have an account group ('%2') "
+                      "assigned to it.")
+                     .arg(id).arg(account->getId()));
+        return false;
+    }
+
     if (hasSubs() && !scenarios[sc].bookedResources.isEmpty())
     {
         errorMessage(i18n