Module: TaskJuggler::TjpSyntaxRules
- Included in:
- ProjectFileParser
- Defined in:
- lib/taskjuggler/TjpSyntaxRules.rb
Overview
This module contains the rule definition for the TJP syntax. Every rule is put in a function who's name must start with rule_. The functions are not necessary but make the file more readable and receptable to syntax folding.
Instance Method Summary collapse
- #rule_absoluteTaskId ⇒ Object
- #rule_account ⇒ Object
- #rule_accountAttributes ⇒ Object
- #rule_accountBody ⇒ Object
- #rule_accountCredit ⇒ Object
- #rule_accountCredits ⇒ Object
- #rule_accountHeader ⇒ Object
- #rule_accountId ⇒ Object
- #rule_accountReport ⇒ Object
- #rule_accountReportHeader ⇒ Object
- #rule_accountScenarioAttributes ⇒ Object
- #rule_aggregate ⇒ Object
- #rule_alertLevel ⇒ Object
- #rule_alertLevelDefinition ⇒ Object
- #rule_alertLevelDefinitions ⇒ Object
- #rule_allocate ⇒ Object
- #rule_allocateShiftAssignments ⇒ Object
- #rule_allocateShiftsAssignments ⇒ Object
- #rule_allocation ⇒ Object
- #rule_allocationAttributes ⇒ Object
- #rule_allocationBody ⇒ Object
- #rule_allocationHeader ⇒ Object
- #rule_allocations ⇒ Object
- #rule_allocationSelectionMode ⇒ Object
- #rule_allOrNone ⇒ Object
- #rule_argument ⇒ Object
- #rule_argumentList ⇒ Object
- #rule_argumentListBody ⇒ Object
- #rule_author ⇒ Object
- #rule_balance ⇒ Object
- #rule_balanceAccounts ⇒ Object
- #rule_bookingAttributes ⇒ Object
- #rule_bookingBody ⇒ Object
- #rule_calendarDuration ⇒ Object
- #rule_chargeMode ⇒ Object
- #rule_chargeset ⇒ Object
- #rule_chargeSetItem ⇒ Object
- #rule_chartScale ⇒ Object
- #rule_color ⇒ Object
- #rule_columnBody ⇒ Object
- #rule_columnDef ⇒ Object
- #rule_columnId ⇒ Object
- #rule_columnOptions ⇒ Object
- #rule_currencyFormat ⇒ Object
- #rule_date ⇒ Object
- #rule_dateCalcedOrNot ⇒ Object
- #rule_declareFlagList ⇒ Object
- #rule_details ⇒ Object
- #rule_durationUnit ⇒ Object
- #rule_durationUnitOrPercent ⇒ Object
- #rule_export ⇒ Object
- #rule_exportAttributes ⇒ Object
- #rule_exportBody ⇒ Object
- #rule_exportFormat ⇒ Object
- #rule_exportFormats ⇒ Object
- #rule_exportHeader ⇒ Object
- #rule_extendAttributes ⇒ Object
- #rule_extendBody ⇒ Object
- #rule_extendId ⇒ Object
- #rule_extendOptions ⇒ Object
- #rule_extendOptionsBody ⇒ Object
- #rule_extendProperty ⇒ Object
- #rule_extendPropertyId ⇒ Object
- #rule_fail ⇒ Object
- #rule_flag ⇒ Object
- #rule_flagList ⇒ Object
- #rule_flagLogicalExpression ⇒ Object
- #rule_flagOperand ⇒ Object
- #rule_flagOperation ⇒ Object
- #rule_flagOperationChain ⇒ Object
- #rule_flagOperator ⇒ Object
- #rule_flagOperatorAndOperand ⇒ Object
- #rule_flags ⇒ Object
- #rule_formats ⇒ Object
- #rule_functionPatterns ⇒ Object
- #rule_functions ⇒ Object
- #rule_functionsBody ⇒ Object
- #rule_hAlignment ⇒ Object
- #rule_headline ⇒ Object
- #rule_hideaccount ⇒ Object
- #rule_hidejournalentry ⇒ Object
- #rule_hideresource ⇒ Object
- #rule_hidetask ⇒ Object
- #rule_iCalReport ⇒ Object
- #rule_iCalReportAttributes ⇒ Object
- #rule_iCalReportBody ⇒ Object
- #rule_iCalReportHeader ⇒ Object
- #rule_idOrAbsoluteId ⇒ Object
- #rule_includeAttributes ⇒ Object
- #rule_includeAttributesBody ⇒ Object
- #rule_includeFile ⇒ Object
- #rule_includeFileName ⇒ Object
- #rule_includeProperties ⇒ Object
- #rule_interval ⇒ Object
- #rule_intervalDuration ⇒ Object
- #rule_intervalEnd ⇒ Object
- #rule_intervalOptional ⇒ Object
- #rule_intervalOptionalEnd ⇒ Object
- #rule_intervalOrDate ⇒ Object
- #rule_intervals ⇒ Object
- #rule_intervalsOptional ⇒ Object
- #rule_journalEntry ⇒ Object
- #rule_journalEntryAttributes ⇒ Object
- #rule_journalEntryBody ⇒ Object
- #rule_journalEntryHeader ⇒ Object
- #rule_journalReportAttributes ⇒ Object
- #rule_journalReportMode ⇒ Object
- #rule_journalSortCriteria ⇒ Object
- #rule_journalSortCriterium ⇒ Object
- #rule_leafResourceId ⇒ Object
- #rule_leave ⇒ Object
- #rule_leaveAllowance ⇒ Object
- #rule_leaveAllowanceList ⇒ Object
- #rule_leaveAllowances ⇒ Object
- #rule_leaveList ⇒ Object
- #rule_leaveName ⇒ Object
- #rule_leaves ⇒ Object
- #rule_leaveType ⇒ Object
- #rule_limitAttributes ⇒ Object
- #rule_limitAttributesBody ⇒ Object
- #rule_limits ⇒ Object
- #rule_limitsAttributes ⇒ Object
- #rule_limitsBody ⇒ Object
- #rule_limitsHeader ⇒ Object
- #rule_limitValue ⇒ Object
- #rule_listOfDays ⇒ Object
- #rule_listOfTimes ⇒ Object
- #rule_listType ⇒ Object
- #rule_loadunit ⇒ Object
- #rule_loadunitName ⇒ Object
- #rule_logicalExpression ⇒ Object
- #rule_macro ⇒ Object
- #rule_moreAlternatives ⇒ Object
- #rule_moreArguments ⇒ Object
- #rule_moreBangs ⇒ Object
- #rule_moreChargeSetItems ⇒ Object
- #rule_moreColumnDef ⇒ Object
- #rule_moreDepTasks ⇒ Object
- #rule_moreExportFormats ⇒ Object
- #rule_moreJournalSortCriteria ⇒ Object
- #rule_moreListOfDays ⇒ Object
- #rule_moreOutputFormats ⇒ Object
- #rule_morePredTasks ⇒ Object
- #rule_moreProjectIDs ⇒ Object
- #rule_moreSortCriteria ⇒ Object
- #rule_moreTimeIntervals ⇒ Object
- #rule_navigator ⇒ Object
- #rule_navigatorAttributes ⇒ Object
- #rule_navigatorBody ⇒ Object
- #rule_navigatorHeader ⇒ Object
- #rule_nikuReport ⇒ Object
- #rule_nikuReportAttributes ⇒ Object
- #rule_nikuReportBody ⇒ Object
- #rule_nikuReportHeader ⇒ Object
- #rule_nodeId ⇒ Object
- #rule_nodeIdList ⇒ Object
- #rule_number ⇒ Object
- #rule_numberFormat ⇒ Object
- #rule_operand ⇒ Object
- #rule_operation ⇒ Object
- #rule_operationChain ⇒ Object
- #rule_operator ⇒ Object
- #rule_operatorAndOperand ⇒ Object
- #rule_optionalID ⇒ Object
- #rule_optionalMinus ⇒ Object
- #rule_optionalPercent ⇒ Object
- #rule_optionalScenarioIdCol ⇒ Object
- #rule_optionalVersion ⇒ Object
- #rule_outputFormat ⇒ Object
- #rule_outputFormats ⇒ Object
- #rule_plusOrMinus ⇒ Object
- #rule_project ⇒ Object
- #rule_projectBody ⇒ Object
- #rule_projectBodyAttributes ⇒ Object
- #rule_projectBodyInclude ⇒ Object
- #rule_projectDeclaration ⇒ Object
- #rule_projectHeader ⇒ Object
- #rule_projectIDs ⇒ Object
- #rule_projection ⇒ Object
- #rule_projectionAttributes ⇒ Object
- #rule_projectProlog ⇒ Object
- #rule_projectProperties ⇒ Object
- #rule_projectPropertiesBody ⇒ Object
- #rule_prologInclude ⇒ Object
- #rule_properties ⇒ Object
- #rule_propertiesBody ⇒ Object
- #rule_propertiesFile ⇒ Object
- #rule_propertiesInclude ⇒ Object
- #rule_purge ⇒ Object
- #rule_referenceAttributes ⇒ Object
- #rule_referenceBody ⇒ Object
- #rule_relativeId ⇒ Object
- #rule_reportableAttributes ⇒ Object
- #rule_reportAttributes ⇒ Object
- #rule_reportBody ⇒ Object
- #rule_reportEnd ⇒ Object
- #rule_reportId ⇒ Object
- #rule_reportIdUnverifd ⇒ Object
- #rule_reportName ⇒ Object
- #rule_reportPeriod ⇒ Object
- #rule_reportProperties ⇒ Object
- #rule_reportPropertiesBody ⇒ Object
- #rule_reportPropertiesFile ⇒ Object
- #rule_reports ⇒ Object
- #rule_reportStart ⇒ Object
- #rule_reportTitle ⇒ Object
- #rule_resource ⇒ Object
- #rule_resourceAttributes ⇒ Object
- #rule_resourceBody ⇒ Object
- #rule_resourceBooking ⇒ Object
- #rule_resourceBookingHeader ⇒ Object
- #rule_resourceHeader ⇒ Object
- #rule_resourceId ⇒ Object
- #rule_resourceLeafList ⇒ Object
- #rule_resourceList ⇒ Object
- #rule_resourceReport ⇒ Object
- #rule_resourceReportHeader ⇒ Object
- #rule_resourceScenarioAttributes ⇒ Object
- #rule_resourceShiftAssignments ⇒ Object
- #rule_resourceShiftsAssignments ⇒ Object
- #rule_rollupaccount ⇒ Object
- #rule_rollupresource ⇒ Object
- #rule_rolluptask ⇒ Object
- #rule_scenario ⇒ Object
- #rule_scenarioAttributes ⇒ Object
- #rule_scenarioBody ⇒ Object
- #rule_scenarioHeader ⇒ Object
- #rule_scenarioId ⇒ Object
- #rule_scenarioIdCol ⇒ Object
- #rule_scenarioIdList ⇒ Object
- #rule_scenarioIdx ⇒ Object
- #rule_schedulingDirection ⇒ Object
- #rule_shift ⇒ Object
- #rule_shiftAssignment ⇒ Object
- #rule_shiftAssignments ⇒ Object
- #rule_shiftAttributes ⇒ Object
- #rule_shiftBody ⇒ Object
- #rule_shiftHeader ⇒ Object
- #rule_shiftId ⇒ Object
- #rule_shiftScenarioAttributes ⇒ Object
- #rule_sortAccounts ⇒ Object
- #rule_sortCriteria ⇒ Object
- #rule_sortCriterium ⇒ Object
- #rule_sortJournalEntries ⇒ Object
- #rule_sortNonTree ⇒ Object
- #rule_sortResources ⇒ Object
- #rule_sortTasks ⇒ Object
- #rule_sortTree ⇒ Object
- #rule_ssReportAttributes ⇒ Object
- #rule_ssReportBody ⇒ Object
- #rule_ssReportHeader ⇒ Object
- #rule_ssStatus ⇒ Object
- #rule_ssStatusAttributes ⇒ Object
- #rule_ssStatusBody ⇒ Object
- #rule_ssStatusHeader ⇒ Object
- #rule_statusSheet ⇒ Object
- #rule_statusSheetAttributes ⇒ Object
- #rule_statusSheetBody ⇒ Object
- #rule_statusSheetFile ⇒ Object
- #rule_statusSheetHeader ⇒ Object
- #rule_statusSheetReport ⇒ Object
- #rule_statusSheetTask ⇒ Object
- #rule_statusSheetTaskAttributes ⇒ Object
- #rule_statusSheetTaskBody ⇒ Object
- #rule_statusSheetTaskHeader ⇒ Object
- #rule_subNodeId ⇒ Object
- #rule_summary ⇒ Object
- #rule_supplement ⇒ Object
- #rule_supplementAccount ⇒ Object
- #rule_supplementReport ⇒ Object
- #rule_supplementResource ⇒ Object
- #rule_supplementTask ⇒ Object
- #rule_tagfile ⇒ Object
- #rule_tagfileAttributes ⇒ Object
- #rule_tagfileBody ⇒ Object
- #rule_tagfileHeader ⇒ Object
- #rule_task ⇒ Object
- #rule_taskAttributes ⇒ Object
- #rule_taskBody ⇒ Object
- #rule_taskBooking ⇒ Object
- #rule_taskBookingHeader ⇒ Object
- #rule_taskDep ⇒ Object
- #rule_taskDepAttributes ⇒ Object
- #rule_taskDepBody ⇒ Object
- #rule_taskDepHeader ⇒ Object
- #rule_taskDepId ⇒ Object
- #rule_taskDepList ⇒ Object
- #rule_taskHeader ⇒ Object
- #rule_taskId ⇒ Object
- #rule_taskIdUnverifd ⇒ Object
- #rule_taskList ⇒ Object
- #rule_taskPeriod ⇒ Object
- #rule_taskPred ⇒ Object
- #rule_taskPredHeader ⇒ Object
- #rule_taskPredList ⇒ Object
- #rule_taskReport ⇒ Object
- #rule_taskReportHeader ⇒ Object
- #rule_taskScenarioAttributes ⇒ Object
- #rule_taskShiftAssignments ⇒ Object
- #rule_taskShiftsAssignments ⇒ Object
- #rule_textReport ⇒ Object
- #rule_textReportHeader ⇒ Object
- #rule_timeformat ⇒ Object
- #rule_timeInterval ⇒ Object
- #rule_timeSheet ⇒ Object
- #rule_timeSheetAttributes ⇒ Object
- #rule_timeSheetBody ⇒ Object
- #rule_timeSheetFile ⇒ Object
- #rule_timeSheetHeader ⇒ Object
- #rule_timeSheetReport ⇒ Object
- #rule_timezone ⇒ Object
- #rule_traceReport ⇒ Object
- #rule_traceReportHeader ⇒ Object
- #rule_tsNewTaskHeader ⇒ Object
- #rule_tsReportAttributes ⇒ Object
- #rule_tsReportBody ⇒ Object
- #rule_tsReportHeader ⇒ Object
- #rule_tsStatus ⇒ Object
- #rule_tsStatusAttributes ⇒ Object
- #rule_tsStatusBody ⇒ Object
- #rule_tsStatusHeader ⇒ Object
- #rule_tsTaskAttributes ⇒ Object
- #rule_tsTaskBody ⇒ Object
- #rule_tsTaskHeader ⇒ Object
- #rule_vacationName ⇒ Object
- #rule_valDate ⇒ Object
- #rule_validTimeZone ⇒ Object
- #rule_valInterval ⇒ Object
- #rule_valIntervalOrDate ⇒ Object
- #rule_valIntervals ⇒ Object
- #rule_warn ⇒ Object
- #rule_weekday ⇒ Object
- #rule_weekDayInterval ⇒ Object
- #rule_weekDayIntervalEnd ⇒ Object
- #rule_workingDuration ⇒ Object
- #rule_workingDurationPercent ⇒ Object
- #rule_workinghours ⇒ Object
- #rule_workinghoursProject ⇒ Object
- #rule_workinghoursResource ⇒ Object
- #rule_workinghoursShift ⇒ Object
- #rule_yesNo ⇒ Object
Instance Method Details
#rule_absoluteTaskId ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 21 def rule_absoluteTaskId pattern(%w( !taskIdUnverifd ), lambda { id = (@taskprefix.empty? ? '' : @taskprefix + '.') + @val[0] if (task = @project.task(id)).nil? error('unknown_abs_task', "Unknown task #{id}", @sourceFileInfo[0]) end task }) end |
#rule_account ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 31 def rule_account pattern(%w( !accountHeader !accountBody ), lambda { @property = @property.parent }) doc('account', "Declares an account. Accounts can be used to calculate costs of tasks or the\nwhole project. Account declaration may be nested, but only leaf accounts may\nbe used to track turnover. When the cost of a task is split over multiple\naccounts they all must have the same top-level group account. Top-level\naccounts can be used for profit/loss calculations. The sub-account structure\nof a top-level account should be organized accordingly.\n\nAccounts have a global name space. All IDs must be unique within the accounts of the project.\n" ) example('Account', '1') end |
#rule_accountAttributes ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 49 def rule_accountAttributes repeatable optional pattern(%w( !account)) pattern(%w( !accountScenarioAttributes )) pattern(%w( !scenarioIdCol !accountScenarioAttributes ), lambda { @scenarioIdx = 0 }) # Other attributes will be added automatically. end |
#rule_accountBody ⇒ Object
60 61 62 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 60 def rule_accountBody ('accountAttributes') end |
#rule_accountCredit ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 64 def rule_accountCredit pattern(%w( !valDate $STRING !number ), lambda { AccountCredit.new(@val[0], @val[1], @val[2]) }) arg(1, 'description', 'Short description of the transaction') arg(2, 'amount', 'Amount to be booked.') end |
#rule_accountCredits ⇒ Object
72 73 74 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 72 def rule_accountCredits listRule('moreAccountCredits', '!accountCredit') end |
#rule_accountHeader ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 76 def rule_accountHeader pattern(%w( _account !optionalID $STRING ), lambda { if @property.nil? && !@accountprefix.empty? @property = @project.accout(@accountprefix) end if @val[1] && @project.account(@val[1]) error('account_exists', "Account #{@val[1]} has already been defined.", @sourceFileInfo[1], @property) end @property = Account.new(@project, @val[1], @val[2], @property) @property.sourceFileInfo = @sourceFileInfo[0] @property.inheritAttributes @scenarioIdx = 0 }) arg(2, 'name', 'A name or short description of the account') end |
#rule_accountId ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 93 def rule_accountId pattern(%w( $ID ), lambda { id = @val[0] id = @accountprefix + '.' + id unless @accountprefix.empty? # In case we have a nested supplement, we need to prepend the parent ID. id = @property.fullId + '.' + id if @property && @property.is_a?(Account) if (account = @project.account(id)).nil? error('unknown_account', "Unknown account #{id}", @sourceFileInfo[0]) end account }) end |
#rule_accountReport ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 106 def rule_accountReport pattern(%w( !accountReportHeader !reportBody ), lambda { @property = @property.parent }) level(:beta) doc('accountreport', "The report lists accounts and their respective values in a table. The report\ncan operate in two modes:\n\n# Balance mode: If a [[balance]] has been set, the report will include the\ndefined cost and revenue accounts as well as all their sub accounts. To reduce\nthe list of included accounts, you can use the [[hideaccount]],\n[[rollupaccount]] or [[accountroot]] attributes. The order of the task can\nbe controlled with [[sortaccounts]]. If the first sorting criteria is tree\nsorting, the parent accounts will always be included to form the tree.\nTree sorting is the default. You need to change it if you do not want certain\nparent accounts to be included in the report. Additionally, it will contain a line at the end that lists the balance (revenue - cost).\n\n# Normal mode: All reports are listed in the order and completeness as defined\nby the other report attributes. No balance line will be included.\n" ) example('AccountReport') end |
#rule_accountReportHeader ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 131 def rule_accountReportHeader pattern(%w( _accountreport !optionalID !reportName ), lambda { newReport(@val[1], @val[2], :accountreport, @sourceFileInfo[0]) do unless @property.modified?('columns') # Set the default columns for this report. %w( bsi name monthly ).each do |col| @property.get('columns') << TableColumnDefinition.new(col, columnTitle(col)) end end # Show all accounts, sorted by tree, seqno-up. unless @property.modified?('hideAccount') @property.set('hideAccount', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortAccounts') @property.set('sortAccounts', [ [ 'tree', true, -1 ], [ 'seqno', true, -1 ] ]) end end }) end |
#rule_accountScenarioAttributes ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 155 def rule_accountScenarioAttributes pattern(%w( _aggregate !aggregate ), lambda { @property.set('aggregate', @val[1]) }) doc('aggregate', "Specifies whether the account is used to track task or resource specific\namounts. The default is to track tasks.\n" ) example('AccountReport') pattern(%w( _credits !accountCredits ), lambda { @property['credits', @scenarioIdx] += @val[1] }) doc('credits', "Book the specified amounts to the account at the specified date. The\ndesciptions are just used for documentary purposes.\n" ) example('Account', '1') pattern(%w( !flags )) doc('flags.account', "Attach a set of flags. The flags can be used in logical expressions to filter\nproperties from the reports.\n" ) # Other attributes will be added automatically. end |
#rule_aggregate ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 186 def rule_aggregate pattern(%w( _resources ), lambda { :resources }) descr('Aggregate resources') pattern(%w( _tasks ), lambda { :tasks }) descr('Aggregate tasks') end |
#rule_alertLevel ⇒ Object
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 198 def rule_alertLevel pattern(%w( $ID ), lambda { level = @project['alertLevels'].indexById(@val[0]) unless level levels = @project['alertLevels'].map { |l| l.id } error('bad_alert', "Unknown alert level #{@val[0]}. Must be " + "one of #{levels.join(', ')}", @sourceFileInfo[0]) end level }) arg(0, 'alert level', "By default supported values are ''''green'''', ''''yellow'''' and ''''red''''.\nThe default value is ''''green''''. You can define your own levels with\n[[alertlevels]].\n" ) end |
#rule_alertLevelDefinition ⇒ Object
216 217 218 219 220 221 222 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 216 def rule_alertLevelDefinition pattern(%w( $ID $STRING !color ), lambda { [ @val[0], @val[1], @val[2] ] }) arg(0, 'ID', "A unique ID for the alert level") arg(1, 'color name', 'A unique name of the alert level color') end |
#rule_alertLevelDefinitions ⇒ Object
224 225 226 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 224 def rule_alertLevelDefinitions listRule('moreAlertLevelDefinitions', '!alertLevelDefinition') end |
#rule_allocate ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 228 def rule_allocate pattern(%w( _allocate !allocations ), lambda { checkContainer('allocate') @property['allocate', @scenarioIdx] += @val[1] }) doc('allocate', "Specify which resources should be allocated to the task. The\nattributes provide numerous ways to control which resource is used and when\nexactly it will be assigned to the task. Shifts and limits can be used to\nrestrict the allocation to certain time intervals or to limit them to a\ncertain maximum per time period. The purge statement can be used to remove\ninherited allocations or flags.\n\nFor effort-based tasks the task duration is clipped to only extend from the\nbegining of the first allocation to the end of the last allocation. This is\ndone to optimize for an overall minimum project duration as dependent tasks\ncan potentially use the unallocated, clipped slots.\n" ) example('Allocate-1', '1') end |
#rule_allocateShiftAssignments ⇒ Object
403 404 405 406 407 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 403 def rule_allocateShiftAssignments pattern(%w( _shift ), lambda { @shiftAssignments = @allocate.shifts }) end |
#rule_allocateShiftsAssignments ⇒ Object
409 410 411 412 413 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 409 def rule_allocateShiftsAssignments pattern(%w( _shifts ), lambda { @shiftAssignments = @allocate.shifts }) end |
#rule_allocation ⇒ Object
250 251 252 253 254 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 250 def rule_allocation pattern(%w( !allocationHeader !allocationBody ), lambda { @val[0] }) end |
#rule_allocationAttributes ⇒ Object
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 256 def rule_allocationAttributes optional repeatable pattern(%w( _alternative !resourceId !moreAlternatives ), lambda { ([ @val[1] ] + (@val[2] ? @val[2] : [])).each do |candidate| @allocate.addCandidate(candidate) end }) doc('alternative', "Specify which resources should be allocated to the task. The optional\nattributes provide numerous ways to control which resource is used and when\nexactly it will be assigned to the task. Shifts and limits can be used to\nrestrict the allocation to certain time intervals or to limit them to a\ncertain maximum per time period.\n" ) example('Alternative', '1') pattern(%w( !limits ), lambda { limits = @property['limits', @scenarioIdx] = @val[0] @allocate.candidates.each do |resource| limits.limits.each do |l| l.resource = resource if resource.leaf? end end }) level(:removed) doc('limits.allocate', '') pattern(%w( _select !allocationSelectionMode ), lambda { @allocate.setSelectionMode(@val[1]) }) doc('select', "The select functions controls which resource is picked from an allocation and\nit's alternatives. The selection is re-evaluated each time the resource used\nin the previous time slot becomes unavailable.\n\nEven for non-persistent allocations a change in the resource selection only\nhappens if the resource used in the previous (or next for ASAP tasks) time\nslot has become unavailable.\n" ) pattern(%w( _persistent ), lambda { @allocate.persistent = true }) doc('persistent', "Specifies that once a resource is picked from the list of alternatives this\nresource is used for the whole task. This is useful when several alternative\nresources have been specified. Normally the selected resource can change after\neach break. A break is an interval of at least one timeslot where no resources\nwere available.\n" ) pattern(%w( _mandatory ), lambda { @allocate.mandatory = true }) doc('mandatory', "Makes a resource allocation mandatory. This means, that for each time slot\nonly then resources are allocated when all mandatory resources are available.\nSo either all mandatory resources can be allocated for the time slot, or no\nresource will be allocated.\n" ) pattern(%w( !allocateShiftAssignments !shiftAssignment ), lambda { begin @allocate.shifts = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) level(:deprecated) also('shifts.allocate') doc('shift.allocate', "Limits the allocations of resources during the specified interval to the\nspecified shift. Multiple shifts can be defined, but shift intervals may not\noverlap. Allocation shifts are an additional restriction to the\n[[shifts.task|task shifts]] and [[shifts.resource|resource shifts]] or\n[[workinghours.resource|resource working hours]]. Allocations will only be\nmade for time slots that are specified as duty time in all relevant shifts.\nThe restriction to the shift is only active during the specified time\ninterval. Outside of this interval, no restrictions apply.\n" ) pattern(%w( !allocateShiftsAssignments !shiftAssignments ), lambda { begin @allocate.shifts = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) doc('shifts.allocate', "Limits the allocations of resources during the specified interval to the\nspecified shift. Multiple shifts can be defined, but shift intervals may not\noverlap. Allocation shifts are an additional restriction to the\n[[shifts.task|task shifts]] and [[shifts.resource|resource shifts]] or\n[[workinghours.resource|resource working hours]]. Allocations will only be\nmade for time slots that are specified as duty time in all relevant shifts.\nThe restriction to the shift is only active during the specified time\ninterval. Outside of this interval, no restrictions apply.\n" ) end |
#rule_allocationBody ⇒ Object
367 368 369 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 367 def rule_allocationBody ('allocationAttributes') end |
#rule_allocationHeader ⇒ Object
371 372 373 374 375 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 371 def rule_allocationHeader pattern(%w( !resourceId ), lambda { @allocate = Allocation.new([ @val[0] ]) }) end |
#rule_allocations ⇒ Object
377 378 379 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 377 def rule_allocations listRule('moreAllocations', '!allocation') end |
#rule_allocationSelectionMode ⇒ Object
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 381 def rule_allocationSelectionMode singlePattern('_maxloaded') descr('Pick the available resource that has been used the most so far.') singlePattern('_minloaded') descr('Pick the available resource that has been used the least so far.') singlePattern('_minallocated') descr("Pick the resource that has the smallest allocation factor. The\nallocation factor is calculated from the various allocations of the resource\nacross the tasks. This is the default setting.)\n" ) singlePattern('_order') descr('Pick the first available resource from the list.') singlePattern('_random') descr('Pick a random resource from the list.') end |
#rule_allOrNone ⇒ Object
415 416 417 418 419 420 421 422 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 415 def rule_allOrNone pattern(%w( _all ), lambda { 1 }) pattern(%w( _none ), lambda { 0 }) end |
#rule_argument ⇒ Object
424 425 426 427 428 429 430 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 424 def rule_argument singlePattern('$ABSOLUTE_ID') singlePattern('!date') singlePattern('$ID') singlePattern('$INTEGER') singlePattern('$FLOAT') end |
#rule_argumentList ⇒ Object
432 433 434 435 436 437 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 432 def rule_argumentList optional pattern(%w( _( !argumentListBody _) ), lambda { @val[1].nil? ? [] : @val[1] }) end |
#rule_argumentListBody ⇒ Object
439 440 441 442 443 444 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 439 def rule_argumentListBody optional pattern(%w( !argument !moreArguments ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_author ⇒ Object
446 447 448 449 450 451 452 453 454 455 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 446 def pattern(%w( _author !resourceId ), lambda { @journalEntry. = @val[1] }) doc('author', "This attribute can be used to capture the authorship or source of the\ninformation.\n" ) end |
#rule_balance ⇒ Object
457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 457 def rule_balance pattern(%w( _balance !balanceAccounts ), lambda { @val[1] }) doc('balance', "During report generation, TaskJuggler can consider some accounts to be revenue accounts, while other can be considered cost accounts. By using the balance attribute, two top-level accounts can be designated for a profit-loss-analysis. This analysis includes all sub accounts of these two top-level accounts.\n\nTo clear a previously set balance, just use a ''''-''''.\n" ) example('AccountReport') end |
#rule_balanceAccounts ⇒ Object
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 470 def rule_balanceAccounts pattern(%w( !accountId !accountId ), lambda { if @val[0].parent error('cost_acct_no_top', "The cost account #{@val[0].fullId} is not a top-level account.", @sourceFileInfo[0]) end if @val[1].parent error('rev_acct_no_top', "The revenue account #{@val[1].fullId} is not a top-level " + "account.", @sourceFileInfo[1]) end if @val[0] == @val[1] error('cost_rev_same', 'The cost and revenue accounts may not be the same.', @sourceFileInfo[0]) end [ @val[0], @val[1] ] }) arg(0, 'cost account', "The top-level account that is used for all cost related charges.\n" ) arg(2, 'revenue account', "The top-level account that is used for all revenue related charges.\n" ) pattern([ '_-' ], lambda { [ nil, nil ] }) end |
#rule_bookingAttributes ⇒ Object
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 503 def rule_bookingAttributes optional repeatable pattern(%w( _overtime $INTEGER ), lambda { if @val[1] < 0 || @val[1] > 2 error('overtime_range', "Overtime value #{@val[1]} out of range (0 - 2).", @sourceFileInfo[1], @property) end @booking.overtime = @val[1] }) doc('overtime.booking', "This attribute enables bookings during off-hours and leaves. It implicitly\nsets the [[sloppy.booking|sloppy]] attribute accordingly.\n" ) arg(1, 'value', "* '''0''': You can only book available working time. (Default)\n\n* '''1''': You can book off-hours as well.\n\n* '''2''': You can book working time, off-hours and vacation time.\n" ) pattern(%w( _sloppy $INTEGER ), lambda { if @val[1] < 0 || @val[1] > 2 error('sloppy_range', "Sloppyness value #{@val[1]} out of range (0 - 2).", @sourceFileInfo[1], @property) end @booking.sloppy = @val[1] }) doc('sloppy.booking', "Controls how strict TaskJuggler checks booking intervals for conflicts with\nworking periods and leaves. This attribute only affects the check for\nconflicts. No assignments will be made unless the [[overtime.booking|\novertime]] attribute is set accordingly.\n" ) arg(1, 'sloppyness', "* '''0''': Period may not contain any off-duty hours, vacation or other task\nassignments. (default)\n\n* '''1''': Period may contain off-duty hours, but no vacation time or other\ntask assignments.\n\n* '''2''': Period may contain off-duty hours and vacation time, but no other\ntask assignments.\n" ) end |
#rule_bookingBody ⇒ Object
557 558 559 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 557 def rule_bookingBody ('bookingAttributes') end |
#rule_calendarDuration ⇒ Object
561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 561 def rule_calendarDuration pattern(%w( !number !durationUnit ), lambda { convFactors = [ 60.0, # minutes 60.0 * 60, # hours 60.0 * 60 * 24, # days 60.0 * 60 * 24 * 7, # weeks 60.0 * 60 * 24 * 30.4167, # months 60.0 * 60 * 24 * 365 # years ] ((@val[0] * convFactors[@val[1]]) / @project['scheduleGranularity']).to_i }) arg(0, 'value', 'A floating point or integer number') end |
#rule_chargeMode ⇒ Object
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 614 def rule_chargeMode singlePattern('_onstart') descr('Charge the amount on starting the task.') singlePattern('_onend') descr('Charge the amount on finishing the task.') singlePattern('_perhour') descr('Charge the amount for every hour the task lasts.') singlePattern('_perday') descr('Charge the amount for every day the task lasts.') singlePattern('_perweek') descr('Charge the amount for every week the task lasts.') end |
#rule_chargeset ⇒ Object
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 575 def rule_chargeset pattern(%w( _chargeset !chargeSetItem !moreChargeSetItems ), lambda { checkContainer('chargeset') items = [ @val[1] ] items += @val[2] if @val[2] chargeSet = ChargeSet.new begin items.each do |item| chargeSet.addAccount(item[0], item[1]) end chargeSet.complete rescue TjException error('chargeset', $!., @sourceFileInfo[0], @property) end masterAccounts = [] @property['chargeset', @scenarioIdx].each do |set| masterAccounts << set.master end if masterAccounts.include?(chargeSet.master) error('chargeset_master', "All charge sets for this property must have different " + "top-level accounts.", @sourceFileInfo[0], @property) end @property['chargeset', @scenarioIdx] = @property['chargeset', @scenarioIdx] + [ chargeSet ] }) doc('chargeset', "A chargeset defines how the turnover associated with the property will be\ncharged to one or more accounts. A property may have any number of charge sets,\nbut each chargeset must deal with a different top-level account. A charge set\nconsists of one or more accounts. Each account must be a leaf account. The\naccount ID may be followed by a percentage value that determines the share for\nthis account. The total percentage of all accounts must be exactly 100%. If\nsome accounts don't have a percentage specification, the remainder to 100% is\ndistributed evenly between them.\n" ) end |
#rule_chargeSetItem ⇒ Object
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 631 def rule_chargeSetItem pattern(%w( !accountId !optionalPercent ), lambda { if @property.is_a?(Task) aggregate = :tasks elsif @property.is_a?(Resource) aggregate = :resources else raise "Unknown property type #{@property.class}" end if @val[0].get('aggregate') != aggregate error('account_bad_aggregate', "The account #{@val[0].fullId} cannot aggregate amounts " + "related to #{aggregate}.") end [ @val[0], @val[1] ] }) arg(0, 'account', 'The ID of a previously defined leaf account.') arg(1, 'share', 'A percentage between 0 and 100%') end |
#rule_chartScale ⇒ Object
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 653 def rule_chartScale singlePattern('_hour') descr('Set chart resolution to 1 hour.') singlePattern('_day') descr('Set chart resolution to 1 day.') singlePattern('_week') descr('Set chart resolution to 1 week.') singlePattern('_month') descr('Set chart resolution to 1 month.') singlePattern('_quarter') descr('Set chart resolution to 1 quarter.') singlePattern('_year') descr('Set chart resolution to 1 year.') end |
#rule_color ⇒ Object
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 673 def rule_color pattern(%w( $STRING ), lambda { col = @val[0] unless /#[0-9A-Fa-f]{3}/ =~ col || /#[0-9A-Fa-f]{3}/ =~ col error('bad_color', "Color values must be specified as '#RGB' or '#RRGGBB' values", @sourceFileInfo[0]) end col }) arg(0, 'color', "The RGB color values of the color. The following formats are supported: #RGB\nand #RRGGBB. Where R, G, B are hexadecimal values. See\n[http://en.wikipedia.org/wiki/Web_colors Wikipedia] for more details.\n" ) end |
#rule_columnBody ⇒ Object
691 692 693 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 691 def rule_columnBody ('columnOptions') end |
#rule_columnDef ⇒ Object
695 696 697 698 699 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 695 def rule_columnDef pattern(%w( !columnId !columnBody ), lambda { @val[0] }) end |
#rule_columnId ⇒ Object
701 702 703 704 705 706 707 708 709 710 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 701 def rule_columnId pattern(%w( !reportableAttributes ), lambda { @column = TableColumnDefinition.new(@val[0], columnTitle(@val[0])) }) doc('columnid', "This is a comprehensive list of all pre-defined [[columns]]. In addition to\nthe listed IDs all user defined attributes can be used as column IDs.\n" ) end |
#rule_columnOptions ⇒ Object
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 712 def rule_columnOptions optional repeatable pattern(%w( _celltext !logicalExpression $STRING ), lambda { @column.cellText.addPattern( CellSettingPattern.new(newRichText(@val[2], @sourceFileInfo[2]), @val[1])) }) doc('celltext.column', "Specifies an alternative content that is used for the cells of the column.\nUsually such a text contains a query function. Otherwise all cells of the\ncolumn will have the same fixed value. The logical expression specifies for\nwhich cells the text should be used. If multiple celltext patterns are\nprovided for a column, the first matching one is taken for each cell.\n" ) arg(2, 'text', 'Alterntive cell text specified as [[Rich_Text_Attributes|Rich Text]]') pattern(%w( _cellcolor !logicalExpression !color ), lambda { @column.cellColor.addPattern( CellSettingPattern.new(@val[2], @val[1])) }) doc('cellcolor.column', "Specifies an alternative background color for the cells of this column. The\n[[logicalexpression|logical expression]] specifies for which cells the color\nshould be used. If multiple cellcolor patterns are provided for a column, the\nfirst matching one is used for each cell.\n" ) pattern(%w( _end !date ), lambda { @column.end = @val[1] }) doc('end.column', "Normally, columns with calculated values take the specified report period into\naccount when calculating their values. With this attribute, the user can\nspecify an end date for the period that should be used when calculating the\nvalues of this column. It does not have an impact on column with time\ninvariant values.\n" ) pattern(%w( _fontcolor !logicalExpression !color ), lambda { @column.fontColor.addPattern( CellSettingPattern.new(@val[2], @val[1])) }) doc('fontcolor.column', "Specifies an alternative font color for the cells of this column. The\n[[logicalexpression|logical expression]] specifies for which cells the color\nshould be used. If multiple fontcolor patterns are provided for a column, the\nfirst matching one is used for each cell.\n" ) pattern(%w( _halign !logicalExpression !hAlignment ), lambda { @column.hAlign.addPattern( CellSettingPattern.new(@val[2], @val[1])) }) doc('halign.column', "Specifies the horizontal alignment of the cell content. The\n[[logicalexpression|logical expression]] specifies for which cells the alignment\nsetting should be used. If multiple halign patterns are provided for a column,\nthe first matching one is used for each cell.\n" ) pattern(%w( _listitem $STRING ), lambda { @column.listItem = @val[1] }) doc('listitem.column', "Specifies a RichText pattern that is used to generate the text for the list\nitems. The pattern should contain at least one ''''<nowiki><</nowiki>-query\nattribute='XXX'->'''' element that will be replaced with the value of\nattribute XXX. For the replacement, the property of the query will be the list\nitem.\n" ) pattern(%w( _listtype !listType ), lambda { @column.listType = @val[1] }) also(%w( listitem.column )) doc('listtype.column', "Specifies what type of list should be used. This attribute only affects\ncolumns that contain a list of items.\n" ) pattern(%w( _period !interval ), lambda { @column.start = @val[1].start @column.end = @val[1].end }) doc('period.column', "This property is a shortcut for setting the [[start.column|start]] and\n[[end.column|end]] property at the same time.\n" ) pattern(%w( _scale !chartScale ), lambda { @column.scale = @val[1] }) doc('scale.column', "Specifies the scale that should be used for a chart column. This value is ignored for all other columns.\n" ) pattern(%w( _start !date ), lambda { @column.start = @val[1] }) doc('start.column', "Normally, columns with calculated values take the specified report period into\naccount when calculating their values. With this attribute, the user can\nspecify a start date for the period that should be used when calculating the\nvalues of this column. It does not have an impact on column with time\ninvariant values.\n" ) pattern(%w( _timeformat1 $STRING ), lambda { @column.timeformat1 = @val[1] }) doc('timeformat1', "Specify an alternative format for the upper header line of calendar or Gantt\nchart columns.\n" ) arg(1, 'format', 'See [[timeformat]] for details.') pattern(%w( _timeformat2 $STRING ), lambda { @column.timeformat2 = @val[1] }) doc('timeformat2', "Specify an alternative format for the lower header line of calendar or Gantt\nchart columns.\n" ) arg(1, 'format', 'See [[timeformat]] for details.') pattern(%w( _title $STRING ), lambda { @column.title = @val[1] }) doc('title.column', "Specifies an alternative title for a report column.\n" ) arg(1, 'text', 'The new column title.') pattern(%w( _tooltip !logicalExpression $STRING ), lambda { @column.tooltip.addPattern( CellSettingPattern.new(newRichText(@val[2], @sourceFileInfo[2]), @val[1])) }) doc('tooltip.column', "Specifies an alternative content for the tooltip. This will replace the\noriginal content of the tooltip that would be available for columns with text\nthat does not fit the column with. The [[logicalexpression|logical expression]]\nspecifies for which cells the text should be used. If multiple tooltip\npatterns are provided for a column, the first matching one is taken for each\ncell.\n" ) arg(2, 'text', "The content of the tooltip. The text is interpreted as [[Rich_Text_Attributes|\nRich Text]].\n" ) pattern(%w( _width !number ), lambda { @column.width = @val[1] }) doc('width.column', "Specifies the maximum width of the column in screen pixels. If the content of\nthe column does not fit into this width, it will be cut off. In some cases a\nscrollbar is added or a tooltip window with the complete content is shown when\nthe mouse is moved over the column. The latter is only supported in\ninteractive output formats. The resulting column width may be smaller if the\ncolumn has a fixed width (e. g. the chart column).\n" ) end |
#rule_currencyFormat ⇒ Object
895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 895 def rule_currencyFormat pattern(%w( _currencyformat $STRING $STRING $STRING $STRING $INTEGER ), lambda { RealFormat.new(@val.slice(1, 5)) }) doc('currencyformat', 'These values specify the default format used for all currency ' + 'values.') example('Currencyformat') arg(1, 'negativeprefix', 'Prefix for negative numbers') arg(2, 'negativesuffix', 'Suffix for negative numbers') arg(3, 'thousandsep', 'Separator used for every 3rd digit') arg(4, 'fractionsep', 'Separator used to separate the fraction digits') arg(5, 'fractiondigits', 'Number of fraction digits to show') end |
#rule_date ⇒ Object
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 911 def rule_date pattern(%w( !dateCalcedOrNot ), lambda { resolution = @project.nil? ? Project.maxScheduleGranularity : @project['scheduleGranularity'] if @val[0] % resolution != 0 error('misaligned_date', "The date must be aligned to the timing resolution (" + "#{resolution / 60} min) of the project.", @sourceFileInfo[0]) end @val[0] }) doc('date', "A DATE is date and time specification similar to the ISO 8601 date format.\nInstead of the hard to read ISO notation with a ''''T'''' between the date and\ntime sections, we simply use the more intuitive and easier to read dash:\n''''<nowiki>YYYY-MM-DD[-hh:mm[:ss]][-TIMEZONE]</nowiki>''''. Hour, minutes,\nseconds, and the ''''TIMEZONE'''' are optional. If not specified, the values\nare set to 0. ''''TIMEZONE'''' must be an offset to GMT or UTC, specified as\n''''+HHMM'''' or ''''-HHMM''''. Dates must always be aligned with the\n[[timingresolution]].\n\nTaskJuggler also supports simple date calculations. You can add or substract a\ngiven interval from a fixed date.\n\n %{2009-11-01 + 8m}\n\nThis will result in an actual date of around 2009-07-01. Keep in mind that due\nto the varying lengths of months TaskJuggler cannot add exactly 8 calendar\nmonths. The date calculation functionality makes most sense when used with\nmacros.\n\n %{${now} - 2w}\n\nThis is result in a date 2 weeks earlier than the current (or specified) date.\nSee [[duration]] for a complete list of supported time intervals. Don't forget\nto put at least one space character after the date to prevent TaskJuggler from\ninterpreting the interval as an hour.\n\nDate attributes may be invalid in some cases. This needs special care in\n[[logicalexpression|logical expressions]].\n" ) end |
#rule_dateCalcedOrNot ⇒ Object
956 957 958 959 960 961 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 956 def rule_dateCalcedOrNot singlePattern('$DATE') pattern(%w( _% _{ $DATE !plusOrMinus !intervalDuration _} ), lambda { @val[2] + ((@val[3] == '+' ? 1 : -1) * @val[4]) }) end |
#rule_declareFlagList ⇒ Object
963 964 965 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 963 def rule_declareFlagList listRule('moreDeclareFlagList', '$ID') end |
#rule_details ⇒ Object
967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 967 def rule_details pattern(%w( _details $STRING ), lambda { return if @val[1].empty? rtTokenSetMore = [ :LINEBREAK, :SPACE, :WORD, :BOLD, :ITALIC, :CODE, :BOLDITALIC, :PRE, :HREF, :HREFEND, :REF, :REFEND, :HLINE, :TITLE2, :TITLE3, :TITLE4, :TITLE2END, :TITLE3END, :TITLE4END, :BULLET1, :BULLET2, :BULLET3, :BULLET4, :NUMBER1, :NUMBER2, :NUMBER3, :NUMBER4 ] if @val[1] == "Some more details\n" error('ts_default_details', "'Some more details' is not a valid value", @sourceFileInfo[1]) end @journalEntry.details = newRichText(@val[1], @sourceFileInfo[1], rtTokenSetMore) }) doc('details', "This is a continuation of the [[summary]] of the journal or status entry. It\ncan be several paragraphs long.\n" ) arg(1, 'text', "The text will be interpreted as [[Rich_Text_Attributes|Rich Text]]. Only a\nsubset of the markup is supported for this attribute. You can use word\nformatting, paragraphs, hyperlinks, lists, section and subsection\nheaders.\n" ) end |
#rule_durationUnit ⇒ Object
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 999 def rule_durationUnit pattern(%w( _min ), lambda { 0 }) descr('minutes') pattern(%w( _h ), lambda { 1 }) descr('hours') pattern(%w( _d ), lambda { 2 }) descr('days') pattern(%w( _w ), lambda { 3 }) descr('weeks') pattern(%w( _m ), lambda { 4 }) descr('months') pattern(%w( _y ), lambda { 5 }) descr('years') end |
#rule_durationUnitOrPercent ⇒ Object
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1019 def rule_durationUnitOrPercent pattern(%w( _% ), lambda { -1 }) descr('percentage of reported period') pattern(%w( _min ), lambda { 0 }) descr('minutes') pattern(%w( _h ), lambda { 1 }) descr('hours') pattern(%w( _d ), lambda { 2 }) descr('days') end |
#rule_export ⇒ Object
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1033 def rule_export pattern(%w( !exportHeader !exportBody ), lambda { @property = @property.parent }) doc('export', "The export report looks like a regular TaskJuggler file with the provided\ninput data complemented by the results of the scheduling process. The content\nof the report can be controlled with the [[definitions]] attribute. In case\nthe file contains the project header, a ''''.tjp'''' extension is added to the\nfile name. Otherwise, a ''''.tji'''' extension is used.\n\nThe [[resourceattributes]] and [[taskattributes]] attributes provide even more\ncontrol over the content of the file.\n\nThe export report can be used to share certain tasks or milestones with other\nprojects or to save past resource allocations as immutable part for future\nscheduling runs. When an export report is included the project IDs of the\nincluded tasks must be declared first with the project id property.\n" ) example('Export') end |
#rule_exportAttributes ⇒ Object
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1056 def rule_exportAttributes optional repeatable pattern(%w( _definitions !exportDefinitions ), lambda { @property.set('definitions', @val[1]) }) doc('definitions', "This attributes controls what definitions will be contained in the report. If\nthe list includes ''project'', the generated file will have a ''''.tjp''''\nextension. Otherwise it will have a ''''.tji'''' extension.\n\nBy default, the report contains everything and the generated files has a ''''.tjp'''' extension.\n" ) allOrNothingListRule('exportDefinitions', { 'flags' => 'Include flag definitions', 'project' => 'Include project header', 'projecids' => 'Include project IDs', 'tasks' => 'Include task definitions', 'resources' => 'Include resource definitions' }) pattern(%w( _formats !exportFormats ), lambda { @property.set('formats', @val[1]) }) level(:beta) doc('formats.export', "This attribute defines for which output formats the export report should be\ngenerated. By default, the TJP format will be used.\n" ) pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( !loadunit )) pattern(%w( !purge )) pattern(%w( !reportEnd )) pattern(%w( !reportPeriod )) pattern(%w( !reports )) pattern(%w( !reportStart )) pattern(%w( _resourceattributes !exportableResourceAttributes ), lambda { @property.set('resourceAttributes', @val[1]) }) doc('resourceattributes', "Define a list of resource attributes that should be included in the report.\n" ) allOrNothingListRule('exportableResourceAttributes', { 'booking' => 'Include bookings', 'leaves' => 'Include leaves', 'workinghours' => 'Include working hours' }) pattern(%w( !rollupresource )) pattern(%w( !rolluptask )) pattern(%w( _scenarios !scenarioIdList ), lambda { # Don't include disabled scenarios in the report @val[1].delete_if { |sc| !@project.scenario(sc).get('active') } @property.set('scenarios', @val[1]) }) doc('scenarios.export', "List of scenarios that should be included in the report. By default, all\nscenarios will be included. This attribute can be used to limit the included\nscenarios to a defined list.\n" ) pattern(%w( _taskattributes !exportableTaskAttributes ), lambda { @property.set('taskAttributes', @val[1]) }) doc('taskattributes', "Define a list of task attributes that should be included in the report.\n" ) allOrNothingListRule('exportableTaskAttributes', { 'booking' => 'Include bookings', 'complete' => 'Include completion values', 'depends' => 'Include dependencies', 'flags' => 'Include flags', 'maxend' => 'Include maximum end dates', 'maxstart' => 'Include maximum start dates', 'minend' => 'Include minimum end dates', 'minstart' => 'Include minimum start dates', 'note' => 'Include notes', 'priority' => 'Include priorities', 'responsible' => 'Include responsible resource' }) pattern(%w( _taskroot !taskId), lambda { if @val[1].leaf? error('taskroot_leaf', "#{@val[1].fullId} is not a container task", @sourceFileInfo[1]) end @property.set('taskroot', @val[1]) }) level(:experimental) doc('taskroot.export', "Only tasks below the specified root-level tasks are exported. The exported\ntasks will have the ID of the root-level task stripped from their ID, so that\nthe sub-tasks of the root-level task become top-level tasks in the report\nfile.\n" ) example('TaskRoot') pattern(%w( _timezone !validTimeZone ), lambda { @property.set('timezone', @val[1]) }) doc('timezone.export', "Set the time zone to be used for all dates in the report.") end |
#rule_exportBody ⇒ Object
1171 1172 1173 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1171 def rule_exportBody ('exportAttributes') end |
#rule_exportFormat ⇒ Object
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1175 def rule_exportFormat pattern(%w( _tjp ), lambda { :tjp }) descr('Export of the scheduled project in TJP syntax.') pattern(%w( _mspxml ), lambda { :mspxml }) descr("Export of the scheduled project in Microsoft Project XML format. This will\nexport the data of the fully scheduled project. The exported data include the\ntasks, resources and the assignments of resources to task. This is only a\nsmall subset of the data that TaskJuggler can manage. This export is intended\nto share resource assignment data with other teams using Microsoft Project.\nTaskJuggler manages assignments with a larger accuracy than the Microsft\nProject XML format can represent. This will inevitably lead to some rounding\nerrors and different interpretation of the data. The numbers you will see in\nProject are not necessarily an exact match of the numbers you see in\nTaskJuggler.\n" ) end |
#rule_exportFormats ⇒ Object
1199 1200 1201 1202 1203 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1199 def rule_exportFormats pattern(%w( !exportFormat !moreExportFormats ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_exportHeader ⇒ Object
1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1205 def rule_exportHeader pattern(%w( _export !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :export, @sourceFileInfo[0]) do unless @property.modified?('formats') @property.set('formats', [ :tjp ]) end # By default, we export all scenarios. unless @property.modified?('scenarios') scenarios = Array.new(@project.scenarios.items) { |i| i } scenarios.delete_if { |sc| !@project.scenario(sc).get('active') } @property.set('scenarios', scenarios) end # Show all tasks, sorted by seqno-up. unless @property.modified?('hideTask') @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortTasks') @property.set('sortTasks', [ [ 'seqno', true, -1 ] ]) end # Show all resources, sorted by seqno-up. unless @property.modified?('hideResource') @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortResources') @property.set('sortResources', [ [ 'seqno', true, -1 ] ]) end end }) arg(2, 'file name', "The name of the report file to generate. It must end with a .tjp or .tji\nextension, or use . to use the standard output channel.\n" ) end |
#rule_extendAttributes ⇒ Object
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1243 def rule_extendAttributes optional repeatable pattern(%w( _date !extendId $STRING !extendOptionsBody ), lambda { # Extend the propertySet definition and parser rules if extendPropertySetDefinition(DateAttribute, nil) @ruleToExtendWithScenario.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '!date' ], lambda { @property[@val[0], @scenarioIdx] = @val[1] })) else @ruleToExtend.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '!date' ], lambda { @property.set(@val[0], @val[1]) })) end }) doc('date.extend', "Extend the property with a new attribute of type date.\n" ) arg(2, 'name', 'The name of the new attribute. It is used as header ' + 'in report columns and the like.') pattern(%w( _number !extendId $STRING !extendOptionsBody ), lambda { # Extend the propertySet definition and parser rules if extendPropertySetDefinition(FloatAttribute, nil) @ruleToExtendWithScenario.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '!number' ], lambda { @property[@val[0], @scenarioIdx] = @val[1] })) else @ruleToExtend.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '!number' ], lambda { @property.set(@val[0], @val[1]) })) end }) doc('number.extend', "Extend the property with a new attribute of type number. Possible values for\nthis attribute could be integer or floating point numbers.\n" ) arg(2, 'name', 'The name of the new attribute. It is used as header ' + 'in report columns and the like.') pattern(%w( _reference !extendId $STRING !extendOptionsBody ), lambda { # Extend the propertySet definition and parser rules if extendPropertySetDefinition(ReferenceAttribute, nil) @ruleToExtendWithScenario.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING', '!referenceBody' ], lambda { @property[@val[0], @scenarioIdx] = [ @val[1], @val[2] ] })) else @ruleToExtend.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING', '!referenceBody' ], lambda { @property.set(@val[0], [ @val[1], @val[2] ]) })) end }) doc('reference.extend', "Extend the property with a new attribute of type reference. A reference is a\nURL and an optional text that will be shown instead of the URL if needed.\n" ) arg(2, 'name', 'The name of the new attribute. It is used as header ' + 'in report columns and the like.') pattern(%w( _richtext !extendId $STRING !extendOptionsBody ), lambda { # Extend the propertySet definition and parser rules if extendPropertySetDefinition(RichTextAttribute, nil) @ruleToExtendWithScenario.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING' ], lambda { @property[@val[0], @scenarioIdx] = newRichText(@val[1], @sourceFileInfo[1]) })) else @ruleToExtend.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING' ], lambda { @property.set(@val[0], newRichText(@val[1], @sourceFileInfo[1])) })) end }) doc('richtext.extend', "Extend the property with a new attribute of type [[Rich_Text_Attributes|Rich\nText]].\n" ) arg(2, 'name', 'The name of the new attribute. It is used as header ' + 'in report columns and the like.') pattern(%w( _text !extendId $STRING !extendOptionsBody ), lambda { # Extend the propertySet definition and parser rules if extendPropertySetDefinition(StringAttribute, nil) @ruleToExtendWithScenario.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING' ], lambda { @property[@val[0], @scenarioIdx] = @val[1] })) else @ruleToExtend.addPattern(TextParser::Pattern.new( [ '_' + @val[1], '$STRING' ], lambda { @property.set(@val[0], @val[1]) })) end }) doc('text.extend', "Extend the property with a new attribute of type text. A text is a character\nsequence enclosed in single or double quotes.\n" ) arg(2, 'name', 'The name of the new attribute. It is used as header ' + 'in report columns and the like.') end |
#rule_extendBody ⇒ Object
1359 1360 1361 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1359 def rule_extendBody ('extendAttributes') end |
#rule_extendId ⇒ Object
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1363 def rule_extendId pattern(%w( $ID ), lambda { unless (?A..?Z) === @val[0][0] error('extend_id_cap', "User defined attributes IDs must start with a capital letter", @sourceFileInfo[0]) end @val[0] }) arg(0, 'id', 'The ID of the new attribute. It can be used like the ' + 'built-in IDs.') end |
#rule_extendOptions ⇒ Object
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1376 def rule_extendOptions optional repeatable singlePattern('_inherit') doc('inherit.extend', "If the this attribute is used, the property extension will be inherited by\nchild properties from their parent property.\n" ) singlePattern('_scenariospecific') doc('scenariospecific.extend', "If this attribute is used, the property extension is scenario specific. A\ndifferent value can be set for each scenario.\n" ) end |
#rule_extendOptionsBody ⇒ Object
1395 1396 1397 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1395 def rule_extendOptionsBody ('extendOptions') end |
#rule_extendProperty ⇒ Object
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1399 def rule_extendProperty pattern(%w( !extendPropertyId ), lambda { case @val[0] when 'task' @ruleToExtend = @rules[:taskAttributes] @ruleToExtendWithScenario = @rules[:taskScenarioAttributes] @propertySet = @project.tasks when 'resource' @ruleToExtend = @rules[:resourceAttributes] @ruleToExtendWithScenario = @rules[:resourceScenarioAttributes] @propertySet = @project.resources end }) end |
#rule_extendPropertyId ⇒ Object
1414 1415 1416 1417 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1414 def rule_extendPropertyId singlePattern('_task') singlePattern('_resource') end |
#rule_fail ⇒ Object
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1419 def rule_fail pattern(%w( _fail !logicalExpression ), lambda { begin @property.set('fail', @property.get('fail') + [ @val[1] ]) rescue AttributeOverwrite end }) doc('fail', "The fail attribute adds a [[logicalexpression|logical expression]] to the\nproperty. The condition described by the logical expression is checked after\nthe scheduling and an error is raised if the condition evaluates to true. This\nattribute is primarily intended for testing purposes.\n" ) end |
#rule_flag ⇒ Object
1435 1436 1437 1438 1439 1440 1441 1442 1443 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1435 def rule_flag pattern(%w( $ID ), lambda { unless @project['flags'].include?(@val[0]) error('undecl_flag', "Undeclared flag '#{@val[0]}'", @sourceFileInfo[0]) end @val[0] }) end |
#rule_flagList ⇒ Object
1549 1550 1551 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1549 def rule_flagList listRule('moreFlagList', '!flag') end |
#rule_flagLogicalExpression ⇒ Object
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1445 def rule_flagLogicalExpression pattern(%w( !flagOperation ), lambda { LogicalExpression.new(@val[0], sourceFileInfo) }) doc('logicalflagexpression', "A logical flag expression is a combination of operands and mathematical\noperations. The final result of a logical expression is always true or false.\nLogical expressions are used the reduce the properties in a report to a\ncertain subset or to select alternatives for the cell content of a table. When\nused with attributes like [[hidejournalentry]] the logical expression\nevaluates to true for a certain property, this property is hidden or rolled-up\nin the report.\n\nOperands must be previously declared flags or another logical expression.\nWhen you combine logical operations to a more complex expression, the\noperators are evaluated from left to right. '''a | b & c''' is identical to\n'''(a | b) & c'''. It's highly recommended that you always use brackets to\ncontrol the evaluation sequence. Currently, TaskJuggler does not support the\nconcept of operator precedence or right-left associativity. This may change in\nthe future.\n" ) also(%w( functions )) end |
#rule_flagOperand ⇒ Object
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1470 def rule_flagOperand pattern(%w( _( !flagOperation _) ), lambda { @val[1] }) pattern(%w( _~ !flagOperand ), lambda { operation = LogicalOperation.new(@val[1]) operation.operator = '~' operation }) pattern(%w( $ID ), lambda { unless @project['flags'].include?(@val[0]) error('operand_unkn_flag', "Undeclared flag '#{@val[0]}'", @sourceFileInfo[0]) end LogicalFlag.new(@val[0]) }) end |
#rule_flagOperation ⇒ Object
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1489 def rule_flagOperation pattern(%w( !flagOperand !flagOperationChain ), lambda { operation = LogicalOperation.new(@val[0]) if @val[1] # Further operators/operands create an operation tree. @val[1].each do |ops| operation = LogicalOperation.new(operation) operation.operator = ops[0] operation.operand2 = ops[1] end end operation }) arg(0, 'operand', "An operand is a declared flag. An operand can be a negated operand by\nprefixing a ~ charater or it can be another logical expression enclosed in\nbraces.\n" ) end |
#rule_flagOperationChain ⇒ Object
1510 1511 1512 1513 1514 1515 1516 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1510 def rule_flagOperationChain optional repeatable pattern(%w( !flagOperatorAndOperand), lambda { @val[0] }) end |
#rule_flagOperator ⇒ Object
1530 1531 1532 1533 1534 1535 1536 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1530 def rule_flagOperator singlePattern('_|') descr('The \'or\' operator') singlePattern('_&') descr('The \'and\' operator') end |
#rule_flagOperatorAndOperand ⇒ Object
1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1518 def rule_flagOperatorAndOperand pattern(%w( !flagOperator !flagOperand), lambda{ [ @val[0], @val[1] ] }) arg(1, 'operand', "An operand is a declared flag. An operand can be a negated operand by\nprefixing a ~ charater or it can be another logical expression enclosed in\nbraces.\n" ) end |
#rule_flags ⇒ Object
1539 1540 1541 1542 1543 1544 1545 1546 1547 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1539 def rule_flags pattern(%w( _flags !flagList ), lambda { @val[1].each do |flag| next if @property['flags', @scenarioIdx].include?(flag) @property['flags', @scenarioIdx] += [ flag ] end }) end |
#rule_formats ⇒ Object
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1553 def rule_formats pattern(%w( _formats !outputFormats ), lambda { @property.set('formats', @val[1]) }) doc('formats', "This attribute defines for which output formats the report should be\ngenerated. By default, this list is empty. Unless a formats attribute was\nadded to a report definition, no output will be generated for this report.\n\nAs reports are composable, a report may include other report definitions. A\nformat definition is only needed for the outermost report that includes the\nothers.\n" ) end |
#rule_functionPatterns ⇒ Object
1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1614 def rule_functionPatterns # This rule is not used by the parser. It's only for the documentation. pattern(%w( _hasalert _( $INTEGER _, !date _) )) doc('hasalert', "Will evaluate to true if the current property has a current alert message within the report time frame and with at least the provided alert level.\n" ) arg(2, 'Level', 'The minimum required alert level to be considered.') pattern(%w( _isactive _( $ID _) )) doc('isactive', "Will evaluate to true for tasks and resources if they have bookings in\nthe scenario during the report time frame.\n" ) arg(2, 'ID', 'A scenario ID') pattern(%w( _ischildof _( $ID _) )) doc('ischildof', "Will evaluate to true for tasks and resources if current property is a child\nof the provided parent property.\n" ) arg(2, 'ID', 'The ID of the parent') pattern(%w( _isdependencyof _( $ID _, $ID _, $INTEGER _) )) doc('isdependencyof', "Will evaluate to true for tasks that depend on the specified task in\nthe specified scenario and are no more than distance tasks away. If\ndistance is 0, all dependencies are considered independent of their\ndistance.\n" ) arg(2, 'Task ID', 'The ID of a defined task') arg(4, 'Scenario ID', 'A scenario ID') arg(6, 'Distance', 'The maximum task distance to be considered') pattern(%w( _isdutyof _( $ID _, $ID _) )) doc('isdutyof', "Will evaluate to true for tasks that have the specified resource\nassigned to it in the specified scenario.\n" ) arg(2, 'Resource ID', 'The ID of a defined resource') arg(4, 'Scenario ID', 'A scenario ID') pattern(%w( _isfeatureof _( $ID _, $ID _) )) doc('isfeatureof', "If the provided task or any of its sub-tasks depend on this task or any of its\nsub-tasks, we call this task a feature of the provided task.\n" ) arg(2, 'Task ID', 'The ID of a defined task') arg(4, 'Scenario ID', 'A scenario ID') pattern(['_isleaf', '_(', '_)' ]) doc('isleaf', 'The result is true if the property is not a container.') pattern(%w( _ismilestone _( $ID _) )) doc('ismilestone', "The result is true if the property is a milestone in the provided scenario.\n" ) arg(2, 'Scenario ID', 'A scenario ID') pattern(%w( _isongoing _( $ID _) )) doc('isongoing', "Will evaluate to true for tasks that overlap with the report period in given\nscenario.\n" ) arg(2, 'ID', 'A scenario ID') pattern(['_isresource', '_(', '_)' ]) doc('isresource', 'The result is true if the property is a resource.') pattern(%w( _isresponsibilityof _( $ID _, $ID _) )) doc('isresponsibilityof', "Will evaluate to true for tasks that have the specified resource\nassigned as [[responsible]] in the specified scenario.\n" ) arg(2, 'Resource ID', 'The ID of a defined resource') arg(4, 'Scenario ID', 'A scenario ID') pattern(['_istask', '_(', '_)' ]) doc('istask', 'The result is true if the property is a task.') pattern(%w( _isvalid _( $ID _) )) doc('isvalid', 'Returns false if argument is not an assigned or ' + 'properly computed value.') pattern(%w( _treelevel _( _) )) doc('treelevel', "Returns the nesting level of a property in the property tree.\nTop level properties have a level of 1, their children 2 and so on.\n" ) end |
#rule_functions ⇒ Object
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1569 def rule_functions # This rule is not used by the parser. It's only for the documentation. pattern(%w( !functionsBody )) doc('functions', "The following functions are supported in logical expressions. These functions\nare evaluated in logical conditions such as hidetask or rollupresource. For\nthe evaluation, implicit and explicit parameters are used.\n\nAll functions may operate on the current property and the scope property. The\nscope property is the enclosing property in reports with nested properties.\nImagine e. g a task report with nested resources. When the function is called\nfor a task line, the task is the property and we don't have a scope property.\nWhen the function is called for a resource line, the resource is the property\nand the enclosing task is the scope property.\n\nThese number of arguments that are passed in brackets to the function depends\non the specific function. See the reference for details on each function.\n\nAll functions can be suffixed with an underscore character. In that case, the\nfunction is operating on the scope property as if it were the property. The\noriginal property is ignored in that case. In our task report example from\nabove, calling a function with an appended dash would mean that a task\nline would be evaluated for the enclosing resource.\n\nIn the example below you can see how this can be used. To generate a task\nreport that lists all assigned leaf resources for leaf task lines only we use\nthe expression\n\n hideresource ~(isleaf() & isleaf_())\n\nThe tilde in front of the bracketed expression means not that expression. In\nother words: show resources that are leaf resources and show them for leaf\ntasks only. The regular form isleaf() (without the appended underscore)\noperates on the resource. The isleaf_() variant operates on the\nenclosing task.\n" ) example('LogicalFunction', '1') end |
#rule_functionsBody ⇒ Object
1609 1610 1611 1612 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1609 def rule_functionsBody # This rule is not used by the parser. It's only for the documentation. ('functionPatterns') end |
#rule_hAlignment ⇒ Object
1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1714 def rule_hAlignment pattern(%w( _center ), lambda { :center }) doc('halign.center', 'Center the cell content') pattern(%w( _left ), lambda { :left }) doc('halign.left', 'Left align the cell content') pattern(%w( _right ), lambda { :right }) doc('halign.right', 'Right align the cell content') end |
#rule_headline ⇒ Object
1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1731 def rule_headline pattern(%w( _headline $STRING ), lambda { @property.set('headline', newRichText(@val[1], @sourceFileInfo[1])) }) doc('headline', "Specifies the headline for a report.\n" ) arg(1, 'text', "The text used for the headline. It is interpreted as\n[[Rich_Text_Attributes|Rich Text]].\n" ) end |
#rule_hideaccount ⇒ Object
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1746 def rule_hideaccount pattern(%w( _hideaccount !logicalExpression ), lambda { @property.set('hideAccount', @val[1]) }) doc('hideaccount', "Do not include accounts that match the specified [[logicalexpression|logical\nexpression]]. If the report is sorted in ''''tree'''' mode (default) then\nenclosing accounts are\nlisted even if the expression matches the account.\n" ) also(%w( sortaccounts )) end |
#rule_hidejournalentry ⇒ Object
1760 1761 1762 1763 1764 1765 1766 1767 1768 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1760 def rule_hidejournalentry pattern(%w( _hidejournalentry !flagLogicalExpression ), lambda { @property.set('hideJournalEntry', @val[1]) }) doc('hidejournalentry', "Do not include journal entries that match the specified logical expression.\n" ) end |
#rule_hideresource ⇒ Object
1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1770 def rule_hideresource pattern(%w( _hideresource !logicalExpression ), lambda { @property.set('hideResource', @val[1]) }) doc('hideresource', "Do not include resources that match the specified [[logicalexpression|logical\nexpression]]. If the report is sorted in ''''tree'''' mode (default) then\nenclosing resources are listed even if the expression matches the resource.\n" ) also(%w( sortresources )) end |
#rule_hidetask ⇒ Object
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1783 def rule_hidetask pattern(%w( _hidetask !logicalExpression ), lambda { @property.set('hideTask', @val[1]) }) doc('hidetask', "Do not include tasks that match the specified [[logicalexpression|logical\nexpression]]. If the report is sorted in ''''tree'''' mode (default) then\nenclosing tasks are listed even if the expression matches the task.\n" ) also(%w( sorttasks )) end |
#rule_iCalReport ⇒ Object
1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1795 def rule_iCalReport pattern(%w( !iCalReportHeader !iCalReportBody ), lambda { @property = nil }) doc('icalreport', "Generates an RFC5545 compliant iCalendar file. This file can be used to export\ntask information to calendar applications or other tools that read iCalendar\nfiles.\n" ) end |
#rule_iCalReportAttributes ⇒ Object
1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1810 def rule_iCalReportAttributes optional repeatable pattern(%w( !hideresource )) pattern(%w( !hidejournalentry )) pattern(%w( !hidetask )) pattern(%w( !reportEnd )) pattern(%w( !reportPeriod )) pattern(%w( !reportStart )) pattern(%w( !rollupresource )) pattern(%w( !rolluptask )) pattern(%w( _scenario !scenarioId ), lambda { # Don't include disabled scenarios in the report sc = @val[1] unless @project.scenario(sc).get('active') warning('ical_sc_disabled', "Scenario #{sc} has been disabled") else @property.set('scenarios', [ @val[1] ]) end }) doc('scenario.ical', "Id of the scenario that should be included in the report. By default, the\ntop-level scenario will be included. This attribute can be used select another\nscenario.\n" ) end |
#rule_iCalReportBody ⇒ Object
1806 1807 1808 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1806 def rule_iCalReportBody ('iCalReportAttributes') end |
#rule_iCalReportHeader ⇒ Object
1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1841 def rule_iCalReportHeader pattern(%w( _icalreport !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :iCal, @sourceFileInfo[0]) do @property.set('formats', [ :iCal ]) # By default, we export only the first scenario. unless @project.scenario(0).get('active') @property.set('scenarios', [ 0 ]) end # Show all tasks, sorted by seqno-up. @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortTasks', [ [ 'seqno', true, -1 ] ]) # Show all resources, sorted by seqno-up. @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortResources', [ [ 'seqno', true, -1 ] ]) # Show all journal entries. @property.set('hideJournalEntry', LogicalExpression.new(LogicalOperation.new(0))) end }) arg(1, 'file name', "The name of the report file to generate without an extension. Use . to use\nthe standard output channel.\n" ) end |
#rule_idOrAbsoluteId ⇒ Object
1869 1870 1871 1872 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1869 def rule_idOrAbsoluteId singlePattern('$ID') singlePattern('$ABSOLUTE_ID') end |
#rule_includeAttributes ⇒ Object
1874 1875 1876 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1874 def rule_includeAttributes ('includeAttributesBody') end |
#rule_includeAttributesBody ⇒ Object
1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1878 def rule_includeAttributesBody optional repeatable pattern(%w( _accountprefix !accountId ), lambda { @accountprefix = @val[1].fullId }) doc('accountprefix', "This attribute can be used to insert the accounts of the included file as\nsub-account of the account specified by ID. The parent account must already be\ndefined.\n" ) arg(1, 'account ID', 'The absolute ID of an already defined account') pattern(%w( _reportprefix !reportId ), lambda { @reportprefix = @val[1].fullId }) doc('reportprefix', "This attribute can be used to insert the reports of the included file as\nsub-report of the report specified by ID. The parent report must already\nbe defined.\n" ) arg(1, 'report ID', 'The absolute ID of an already defined report.') pattern(%w( _resourceprefix !resourceId ), lambda { @resourceprefix = @val[1].fullId }) doc('resourceprefix', "This attribute can be used to insert the resources of the included file as\nsub-resource of the resource specified by ID. The parent resource must already\nbe defined.\n" ) arg(1, 'resource ID', 'The ID of an already defined resource') pattern(%w( _taskprefix !taskId ), lambda { @taskprefix = @val[1].fullId }) doc('taskprefix', "This attribute can be used to insert the tasks of the included file as\nsub-task of the task specified by ID. The parent task must already be defined.\n" ) arg(1, 'task ID', 'The absolute ID of an already defined task.') end |
#rule_includeFile ⇒ Object
1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1926 def rule_includeFile pattern(%w( !includeFileName ), lambda { unless @project error('include_before_project', "You must declare the project header before you include other " + "files.") end @project.inputFiles << @scanner.include(@val[0], @sourceFileInfo[0]) do popFileStack end }) end |
#rule_includeFileName ⇒ Object
1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1939 def rule_includeFileName pattern(%w( $STRING ), lambda { unless @val[0][-4, 4] == '.tji' error('bad_include_suffix', "Included files must have a '.tji'" + "extension: '#{@val[0]}'", @sourceFileInfo[0]) end pushFileStack @val[0] }) arg(0, 'filename', "Name of the file to include. This must have a ''''.tji'''' extension. The name\nmay have an absolute or relative path. You need to use ''''/'''' characters to\nseparate directories.\n" ) end |
#rule_includeProperties ⇒ Object
1957 1958 1959 1960 1961 1962 1963 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1957 def rule_includeProperties pattern(%w( !includeFileName !includeAttributes ), lambda { @project.inputFiles << @scanner.include(@val[0], @sourceFileInfo[0]) do popFileStack end }) end |
#rule_interval ⇒ Object
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1997 def rule_interval pattern(%w( !date !intervalEnd ), lambda { mode = @val[1][0] endSpec = @val[1][1] if mode == 0 unless @val[0] < endSpec error('start_before_end', "The end date (#{endSpec}) must be after " + "the start date (#{@val[0]}).", @sourceFileInfo[0]) end TimeInterval.new(@val[0], endSpec) else TimeInterval.new(@val[0], @val[0] + endSpec) end }) doc('interval2', "There are two ways to specify a date interval. The first is the most\nobvious. A date interval consists of a start and end DATE. Watch out for end\ndates without a time specification! Date specifications are 0 extended. An\nend date without a time is expanded to midnight that day. So the day of the\nend date is not included in the interval! The start and end dates must be separated by a hyphen character.\n\nIn the second form specifies the start date and an interval duration. The\nduration must be prefixed by a plus character.\n" ) end |
#rule_intervalDuration ⇒ Object
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2024 def rule_intervalDuration pattern(%w( !number !durationUnit ), lambda { convFactors = [ 60, # minutes 60 * 60, # hours 60 * 60 * 24, # days 60 * 60 * 24 * 7, # weeks 60 * 60 * 24 * 30.4167, # months 60 * 60 * 24 * 365 # years ] if @val[0] == 0.0 error('zero_duration', "The interval duration may not be 0.", @sourceFileInfo[1]) end duration = (@val[0] * convFactors[@val[1]]).to_i resolution = @project.nil? ? 60 * 60 : @project['scheduleGranularity'] if @val[1] == 4 # If the duration unit is months, we have to align the duration with # the timing resolution of the project. duration = (duration / resolution).to_i * resolution end # Make sure the interval aligns with the timing resolution. if duration % resolution != 0 error('iv_duration_not_aligned', "The interval duration must be a multiple of the specified " + "timing resolution (#{resolution / 60} min) of the project.") end duration }) arg(0, 'duration', 'The duration of the interval. May not be 0 and must ' + 'be a multiple of [[timingresolution]].') end |
#rule_intervalEnd ⇒ Object
2056 2057 2058 2059 2060 2061 2062 2063 2064 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2056 def rule_intervalEnd pattern([ '_-', '!date' ], lambda { [ 0, @val[1] ] }) pattern(%w( _+ !intervalDuration ), lambda { [ 1, @val[1] ] }) end |
#rule_intervalOptional ⇒ Object
2081 2082 2083 2084 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2081 def rule_intervalOptional optional singlePattern('!interval') end |
#rule_intervalOptionalEnd ⇒ Object
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2066 def rule_intervalOptionalEnd optional pattern([ '_-', '!date' ], lambda { [ 0, @val[1] ] }) pattern(%w( _+ !intervalDuration ), lambda { [ 1, @val[1] ] }) end |
#rule_intervalOrDate ⇒ Object
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 1965 def rule_intervalOrDate pattern(%w( !date !intervalOptionalEnd ), lambda { if @val[1] mode = @val[1][0] endSpec = @val[1][1] if mode == 0 unless @val[0] < endSpec error('start_before_end', "The end date (#{endSpec}) must be " + "after the start date (#{@val[0]}).", @sourceFileInfo[0]) end TimeInterval.new(@val[0], endSpec) else TimeInterval.new(@val[0], @val[0] + endSpec) end else TimeInterval.new(@val[0], @val[0].sameTimeNextDay) end }) doc('interval3', "There are three ways to specify a date interval. The first is the most\nobvious. A date interval consists of a start and end DATE. Watch out for end\ndates without a time specification! Date specifications are 0 extended. An\nend date without a time is expanded to midnight that day. So the day of the\nend date is not included in the interval! The start and end dates must be separated by a hyphen character.\n\nIn the second form, the end date is omitted. A 24 hour interval is assumed.\n\nThe third form specifies the start date and an interval duration. The duration must be prefixed by a plus character.\n" ) end |
#rule_intervals ⇒ Object
2077 2078 2079 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2077 def rule_intervals listRule('moreIntervals', '!intervalOrDate') end |
#rule_intervalsOptional ⇒ Object
2086 2087 2088 2089 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2086 def rule_intervalsOptional optional singlePattern('!intervals') end |
#rule_journalEntry ⇒ Object
2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2177 def rule_journalEntry pattern(%w( !journalEntryHeader !journalEntryBody ), lambda { @val[0] }) doc('journalentry', "This attribute adds an entry to the journal of the project. A journal can be\nused to record events, decisions or news that happened at a particular moment\nduring the project. Depending on the context, a journal entry may or may not\nbe associated with a specific property or author.\n\nA journal entry can consists of up to three parts. The headline is mandatory\nand should be only 5 to 10 words long. The introduction is optional and should\nbe only one or two sentences long. All other details should be put into the\nthird part.\n\nDepending on the context, journal entries are listed with headlines only, as\nheadlines plus introduction or in full.\n" ) end |
#rule_journalEntryAttributes ⇒ Object
2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2198 def rule_journalEntryAttributes optional repeatable pattern(%w( _alert !alertLevel ), lambda { @journalEntry.alertLevel = @val[1] }) doc('alert', "Specify the alert level for this entry. This attribute is inteded to be used for\nstatus reporting. When used for a journal entry that is associated with a\nproperty, the value can be reported in the alert column. When multiple entries\nhave been specified for the property, the entry with the date closest to the\nreport end date will be used. Container properties will inherit the highest\nalert level of all its sub properties unless it has an own journal entry dated\ncloser to the report end than all of its sub properties.\n" ) pattern(%w( !author )) pattern(%w( _flags !flagList ), lambda { @val[1].each do |flag| next if @journalEntry.flags.include?(flag) @journalEntry.flags << flag end }) doc('flags.journalentry', "Journal entries can have flags attached to them. These can be used to\ninclude only entries in a report that have a certain flag.\n" ) pattern(%w( !summary )) pattern(%w( !details )) end |
#rule_journalEntryBody ⇒ Object
2236 2237 2238 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2236 def rule_journalEntryBody ('journalEntryAttributes') end |
#rule_journalEntryHeader ⇒ Object
2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2240 def rule_journalEntryHeader pattern(%w( _journalentry !valDate $STRING ), lambda { @journalEntry = JournalEntry.new(@project['journal'], @val[1], @val[2], @property, @sourceFileInfo[0]) }) arg(2, 'headline', "The headline of the journal entry. It will be interpreted as\n[[Rich_Text_Attributes|Rich Text]].\n" ) end |
#rule_journalReportAttributes ⇒ Object
2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2091 def rule_journalReportAttributes pattern(%w( _journalattributes !journalReportAttributesList ), lambda { @property.set('journalAttributes', @val[1]) }) doc('journalattributes', "A list that determines which of the journal attributes should be included in\nthe journal report.\n" ) allOrNothingListRule('journalReportAttributesList', { 'alert' => 'Include the alert status', 'author' => 'Include the author if known', 'date' => 'Include the date', 'details' => 'Include the details', 'flags' => 'Include the flags', 'headline' => 'Include the headline', 'property' => 'Include the task or resource name', 'propertyid' => 'Include the property ID. ' + 'Requires \'property\'.', 'summary' => 'Include the summary', 'timesheet' => 'Include the timesheet information.' + ' Requires \'property\'.'}) end |
#rule_journalReportMode ⇒ Object
2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2115 def rule_journalReportMode pattern(%w( _journal ), lambda { :journal }) descr("This is the regular journal. It contains all journal entries that are dated in\nthe query interval. If a property is given, only entries of this property are\nincluded. Without a property context, all the project entries are included\nunless hidden by other attributes like [[hidejournalentry]].\n" ) pattern(%w( _journal_sub ), lambda { :journal_sub }) descr("This mode only yields entries if used in the context of a task. It contains\nall journal entries that are dated in the query interval for the task and all\nits sub tasks.\n" ) pattern(%w( _status_dep ), lambda { :status_dep }) descr("In this mode only the last entries before the report end date for each\nproperty and all its sub-properties and their dependencies are included. If\nthere are multiple entries at the exact same date, then all these entries are\nincluded.\n" ) pattern(%w( _status_down ), lambda { :status_down }) descr("In this mode only the last entries before the report end date for each\nproperty and all its sub-properties are included. If there are multiple entries\nat the exact same date, then all these entries are included.\n" ) pattern(%w( _status_up ), lambda { :status_up }) descr("In this mode only the last entries before the report end date for each\nproperty are included. If there are multiple entries at the exact same date,\nthen all these entries are included. If any of the parent properties has a\nmore recent entry that is still before the report end date, no entries will be\nincluded.\n" ) pattern(%w( _alerts_dep ), lambda { :alerts_dep }) descr("In this mode only the last entries before the report end date for the context\nproperty and all its sub-properties and their dependencies is included. If\nthere are multiple entries at the exact same date, then all these entries are\nincluded. In contrast to the ''''status_down'''' mode, only entries with an\nalert level above the default level, and only those with the highest overall\nalert level are included.\n" ) pattern(%w( _alerts_down ), lambda { :alerts_down }) descr("In this mode only the last entries before the report end date for the context\nproperty and all its sub-properties is included. If there are multiple entries\nat the exact same date, then all these entries are included. In contrast to\nthe ''''status_down'''' mode, only entries with an alert level above the\ndefault level, and only those with the highest overall alert level are\nincluded.\n" ) end |
#rule_journalSortCriteria ⇒ Object
2252 2253 2254 2255 2256 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2252 def rule_journalSortCriteria pattern(%w( !journalSortCriterium !moreJournalSortCriteria ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_journalSortCriterium ⇒ Object
2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2258 def rule_journalSortCriterium pattern(%w( $ABSOLUTE_ID ), lambda { supported = [] JournalEntryList::SortingAttributes.each do |attr| supported << "#{attr}.up" supported << "#{attr}.down" end unless supported.include?(@val[0]) error('bad_journal_sort_criterium', "Unsupported sorting criterium #{@val[0]}. Must be one of " + "#{supported.join(', ')}.") end attr, direction = @val[0].split('.') [ attr.intern, direction == 'up' ? 1 : -1 ] }) end |
#rule_leafResourceId ⇒ Object
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2275 def rule_leafResourceId pattern(%w( !resourceId ), lambda { resource = @val[0] unless resource.leaf? error('leaf_resource_id_expected', "#{resource.id} is not a leaf resource.", @sourceFileInfo[0]) end resource }) arg(0, 'resource', 'The ID of a leaf resource') end |
#rule_leave ⇒ Object
2287 2288 2289 2290 2291 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2287 def rule_leave pattern(%w( !leaveType !vacationName !intervalOrDate ), lambda { Leave.new(@val[0].intern, @val[2], @val[1]) }) end |
#rule_leaveAllowance ⇒ Object
2305 2306 2307 2308 2309 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2305 def rule_leaveAllowance pattern(%w( _annual !valDate !optionalMinus !workingDuration ), lambda { LeaveAllowance.new(:annual, @val[1], (@val[2] ? -1 : 1) * @val[3]) }) end |
#rule_leaveAllowanceList ⇒ Object
2311 2312 2313 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2311 def rule_leaveAllowanceList listRule('moreLeaveAllowanceList', '!leaveAllowance') end |
#rule_leaveAllowances ⇒ Object
2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2315 def rule_leaveAllowances pattern(%w( _leaveallowances !leaveAllowanceList ), lambda { appendScListAttribute('leaveallowances', @val[1]) }) doc('leaveallowance', "Add or subtract leave allowances. Currently, only allowances for the annual\nleaves are supported. Allowances can be negative to deal with expired\nallowances. The ''''leaveallowancebalance'''' report [[columns|column]] can be\nused to report the current annual leave balance.\n\nLeaves outside of the project period are silently ignored and will not be\nconsidered in the leave balance calculation. Therefor, leave allowances are\nonly allowed within the project period.\n" ) level(:beta) example('Leave') end |
#rule_leaveList ⇒ Object
2293 2294 2295 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2293 def rule_leaveList listRule('moreLeaveList', '!leave') end |
#rule_leaveName ⇒ Object
2297 2298 2299 2300 2301 2302 2303 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2297 def rule_leaveName optional pattern(%w( $STRING ), lambda { @val[0] }) arg(0, 'name', 'An optional name or reason for the leave') end |
#rule_leaves ⇒ Object
2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2334 def rule_leaves pattern(%w( _leaves !leaveList ), lambda { LeaveList.new(@val[1]) }) doc('leaves', "Describe a list of leave periods. A leave can be due to a public holiday,\npersonal or sick leave. At global scope, the leaves determine which day is\nconsidered a working day. Subsequent resource definitions will inherit the\nleave list.\n\nLeaves can be defined at global level, at resource level and at shift level\nand intervals may overlap. The leave types have different priorities. A higher\npriority leave type can overwrite a lower priority type. This means that\nresource level leaves can overwrite global leaves when they have a higher\npriority. A sub resource can overwrite a leave of a enclosing resource.\n\nLeave periods outside of the project interval are silently ignored. For leave\nperiods that are partially outside of the project period only the part inside\nthe project period will be considered.\n" ) example('Leave') end |
#rule_leaveType ⇒ Object
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2358 def rule_leaveType singlePattern('_project') descr('Assignment to another project (lowest priority)') singlePattern('_annual') descr('Personal leave based on annual allowance') singlePattern('_special') descr('Personal leave based on a special occasion') singlePattern('_sick') descr('Sick leave') singlePattern('_unpaid') descr('Unpaid leave') singlePattern('_holiday') descr('Public or bank holiday (highest priority)') end |
#rule_limitAttributes ⇒ Object
2378 2379 2380 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2378 def rule_limitAttributes ('limitAttributesBody') end |
#rule_limitAttributesBody ⇒ Object
2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2382 def rule_limitAttributesBody optional repeatable pattern(%w( _end !valDate ), lambda { @limitInterval.end = @val[1] }) doc('end.limit', "The end date of the limit interval. It must be within the project time frame.\n" ) pattern(%w( _period !valInterval ), lambda { @limitInterval = ScoreboardInterval.new(@project['start'], @project['scheduleGranularity'], @val[1].start, @val[1].end) }) doc('period.limit', "This property is a shortcut for setting the start and end dates of the limit\ninterval. Both dates must be within the project time frame.\n" ) pattern(%w( _resources !resourceLeafList ), lambda { @limitResources = @val[1] }) doc('resources.limit', "When [[limits]] are used in a [[task]] context, the limits can be restricted\nto a list of resources that are allocated to the task. In that case each\nlisted resource will not be allocated more than the specified upper limit.\nLower limits have no impact on the scheduler but do generate a warning when\nnot met. All specified resources must be leaf resources.\n" ) example('Limits-1', '5') pattern(%w( _start !valDate ), lambda { @limitInterval.start = @val[1] }) doc('start.limit', "The start date of the limit interval. It must be within the project time frame.\n" ) end |
#rule_limits ⇒ Object
2437 2438 2439 2440 2441 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2437 def rule_limits pattern(%w( !limitsHeader !limitsBody ), lambda { @val[0] }) end |
#rule_limitsAttributes ⇒ Object
2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2443 def rule_limitsAttributes optional repeatable pattern(%w( _dailymax !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('dailymax', "Set a maximum limit for each calendar day.\n" ) example('Limits-1', '1') pattern(%w( _dailymin !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('dailymin', "Minimum required effort for any calendar day. This value cannot be guaranteed by\nthe scheduler. It is only checked after the schedule is complete. In case the\nminium required amount has not been reached, a warning will be generated.\n" ) example('Limits-1', '4') pattern(%w( _maximum !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('maximum', "Set a maximum limit for the specified period. You must ensure that the overall\neffort can be achieved!\n" ) pattern(%w( _minimum !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('minimum', "Set a minim limit for each calendar month. This will only result in a warning\nif not met.\n" ) pattern(%w( _monthlymax !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('monthlymax', "Set a maximum limit for each calendar month.\n" ) pattern(%w( _monthlymin !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('monthlymin', "Minimum required effort for any calendar month. This value cannot be\nguaranteed by the scheduler. It is only checked after the schedule is\ncomplete. In case the minium required amount has not been reached, a warning\nwill be generated.\n" ) pattern(%w( _weeklymax !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('weeklymax', "Set a maximum limit for each calendar week.\n" ) pattern(%w( _weeklymin !limitValue !limitAttributes), lambda { setLimit(@val[0], @val[1], @limitInterval) }) doc('weeklymin', "Minimum required effort for any calendar week. This value cannot be guaranteed by\nthe scheduler. It is only checked after the schedule is complete. In case the\nminium required amount has not been reached, a warning will be generated.\n" ) end |
#rule_limitsBody ⇒ Object
2523 2524 2525 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2523 def rule_limitsBody ('limitsAttributes') end |
#rule_limitsHeader ⇒ Object
2527 2528 2529 2530 2531 2532 2533 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2527 def rule_limitsHeader pattern(%w( _limits ), lambda { @limits = Limits.new @limits.setProject(@project) @limits }) end |
#rule_limitValue ⇒ Object
2427 2428 2429 2430 2431 2432 2433 2434 2435 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2427 def rule_limitValue pattern([ '!workingDuration' ], lambda { @limitInterval = ScoreboardInterval.new(@project['start'], @project['scheduleGranularity'], @project['start'], @project['end']) @limitResources = [] @val[0] }) end |
#rule_listOfDays ⇒ Object
2535 2536 2537 2538 2539 2540 2541 2542 2543 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2535 def rule_listOfDays pattern(%w( !weekDayInterval !moreListOfDays), lambda { weekDays = Array.new(7, false) ([ @val[0] ] + (@val[1] ? @val[1] : [])).each do |dayList| 7.times { |i| weekDays[i] = true if dayList[i] } end weekDays }) end |
#rule_listOfTimes ⇒ Object
2545 2546 2547 2548 2549 2550 2551 2552 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2545 def rule_listOfTimes pattern(%w( _off ), lambda { [ ] }) pattern(%w( !timeInterval !moreTimeIntervals ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_listType ⇒ Object
2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2554 def rule_listType pattern([ '_bullets' ], lambda { :bullets }) descr('List items as bullet list') pattern([ '_comma' ], lambda { :comma }) descr('List items as comma separated list') pattern([ '_numbered' ], lambda { :numbered }) descr('List items as numbered list') end |
#rule_loadunit ⇒ Object
2565 2566 2567 2568 2569 2570 2571 2572 2573 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2565 def rule_loadunit pattern(%w( _loadunit !loadunitName ), lambda { @property.set('loadUnit', @val[1]) }) doc('loadunit', "Determines what unit should be used to display all load values in this report.\n" ) end |
#rule_loadunitName ⇒ Object
2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2575 def rule_loadunitName pattern([ '_days' ], lambda { :days }) descr('Display all load and duration values as days.') pattern([ '_hours' ], lambda { :hours }) descr('Display all load and duration values as hours.') pattern([ '_longauto'] , lambda { :longauto }) descr("Automatically select the unit that produces the shortest and most readable\nvalue. The unit name will not be abbreviated. It will not use quarters since\nit is not common.\n" ) pattern([ '_minutes' ], lambda { :minutes }) descr('Display all load and duration values as minutes.') pattern([ '_months' ], lambda { :months }) descr('Display all load and duration values as months.') pattern([ '_quarters' ], lambda { :quarters }) descr('Display all load and duration values as quarters.') pattern([ '_shortauto' ], lambda { :shortauto }) descr("Automatically select the unit that produces the shortest and most readable\nvalue. The unit name will be abbreviated. It will not use quarters since it is\nnot common.\n" ) pattern([ '_weeks' ], lambda { :weeks }) descr('Display all load and duration values as weeks.') pattern([ '_years' ], lambda { :years }) descr('Display all load and duration values as years.') end |
#rule_logicalExpression ⇒ Object
2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2614 def rule_logicalExpression pattern(%w( !operation ), lambda { LogicalExpression.new(@val[0], sourceFileInfo) }) pattern(%w( _@ !allOrNone ), lambda { LogicalExpression.new(LogicalOperation.new(@val[1]), sourceFileInfo) }) doc('logicalexpression', "A logical expression is a combination of operands and mathematical operations.\nThe final result of a logical expression is always true or false. Logical\nexpressions are used the reduce the properties in a report to a certain subset\nor to select alternatives for the cell content of a table. When used with\nattributes like [[hidetask]] or [[hideresource]] the logical expression\nevaluates to true for a certain property, this property is hidden or rolled-up\nin the report.\n\nOperands can be previously declared flags, built-in [[functions]], property\nattributes (specified as scenario.attribute) or another logical expression.\nWhen you combine logical operations to a more complex expression, the\noperators are evaluated from left to right. ''''a | b & c'''' is identical to\n''''(a | b) & c''''. It's highly recommended that you always use brackets to\ncontrol the evaluation sequence. Currently, TaskJuggler does not support the\nconcept of operator precedence or right-left associativity. This may change in\nthe future.\n\nAn operand can also be just a number. 0 evaluates to false, all other numbers\nto true. The logical expression can also be the special constants ''''@all''''\nor ''''@none''''. The first always evaluates to true, the latter to false.\n\nDate attributes needs special attention. Attributes like [[maxend]] can\nbe undefined. To use such an attribute in a comparison, you need to test for\nthe validity first. E. g. to compare the end date of the ''''plan''''\nscenario with the ''''maxend'''' value use ''''isvalid(plan.maxend) &\n(plan.end > plan.maxend)''''. The ''''&'''' and ''''|'''' operators are lazy.\nIf the result is already known after evaluation the first operand, the second\noperand will not be evaluated any more.\n" ) also(%w( functions )) example('LogicalExpression', '1') end |
#rule_macro ⇒ Object
2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2656 def rule_macro pattern(%w( _macro $ID $MACRO ), lambda { if @scanner.macroDefined?(@val[1]) warning('marco_redefinition', "Redefining macro #{@val[1]}") end @scanner.addMacro(TextParser::Macro.new(@val[1], @val[2], @sourceFileInfo[0])) }) doc('macro', "Defines a text fragment that can later be inserted by using the specified ID.\nTo insert the text fragment anywhere in the text you need to write ${ID}.The\nbody is not optional. It must be enclosed in square brackets. Macros can be\ndeclared like this:\n\n macro FOO [ This text ]\n\nIf later ''''${FOO}'''' is found in the project file, it is expanded to\n''''This text''''.\n\nMacros may have arguments. Arguments are accessed with special macros with\nnumbers as names. The number specifies the index of the argument.\n\n macro FOO [ This ${1} text ]\n\nwill expand to ''''This stupid text'''' if called as ''''${FOO \"stupid\"}''''.\nMacros may call other macros. All macro arguments must be enclosed by double\nquotes. In case the argument contains a double quote, it must be escaped by a\nslash (''''/'''').\n\nUser defined macro IDs must have at least one uppercase letter as all\nlowercase letter IDs are reserved for built-in macros.\n\nTo terminate the macro definition, the ''''<nowiki>]</nowiki>'''' must be the\nlast character in the line. If there are any other characters trailing it\n(even spaces or comments) the ''''<nowiki>]</nowiki>'''' will not be\nconsidered the end of the macro definition.\n\nIn macro calls the macro names can be prefixed by a question mark. In this\ncase the macro will expand to nothing if the macro is not defined. Otherwise\nthe undefined macro would be flagged with an error message.\n\nThe macro call\n\n ${?foo}\n\nwill expand to nothing if foo is undefined.\n" ) example('Macro-1') end |
#rule_moreAlternatives ⇒ Object
2713 2714 2715 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2713 def rule_moreAlternatives commaListRule('!resourceId') end |
#rule_moreArguments ⇒ Object
2717 2718 2719 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2717 def rule_moreArguments commaListRule('!argument') end |
#rule_moreBangs ⇒ Object
2707 2708 2709 2710 2711 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2707 def rule_moreBangs optional repeatable singlePattern('_!') end |
#rule_moreChargeSetItems ⇒ Object
2721 2722 2723 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2721 def rule_moreChargeSetItems commaListRule('!chargeSetItem') end |
#rule_moreColumnDef ⇒ Object
2725 2726 2727 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2725 def rule_moreColumnDef commaListRule('!columnDef') end |
#rule_moreDepTasks ⇒ Object
2729 2730 2731 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2729 def rule_moreDepTasks commaListRule('!taskDep') end |
#rule_moreExportFormats ⇒ Object
2733 2734 2735 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2733 def rule_moreExportFormats commaListRule('!exportFormat') end |
#rule_moreJournalSortCriteria ⇒ Object
2737 2738 2739 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2737 def rule_moreJournalSortCriteria commaListRule('!journalSortCriterium') end |
#rule_moreListOfDays ⇒ Object
2741 2742 2743 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2741 def rule_moreListOfDays commaListRule('!weekDayInterval') end |
#rule_moreOutputFormats ⇒ Object
2745 2746 2747 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2745 def rule_moreOutputFormats commaListRule('!outputFormat') end |
#rule_morePredTasks ⇒ Object
2753 2754 2755 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2753 def rule_morePredTasks commaListRule('!taskPred') end |
#rule_moreProjectIDs ⇒ Object
2749 2750 2751 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2749 def rule_moreProjectIDs commaListRule('$ID') end |
#rule_moreSortCriteria ⇒ Object
2757 2758 2759 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2757 def rule_moreSortCriteria commaListRule('!sortNonTree') end |
#rule_moreTimeIntervals ⇒ Object
2761 2762 2763 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2761 def rule_moreTimeIntervals commaListRule('!timeInterval') end |
#rule_navigator ⇒ Object
2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2765 def rule_navigator pattern(%w( !navigatorHeader !navigatorBody ), lambda { @project['navigators'][@navigator.id] = @navigator }) doc('navigator', "Defines a navigator object with the specified ID. This object can be used in\nreports to include a navigation bar with references to other reports.\n" ) example('navigator') end |
#rule_navigatorAttributes ⇒ Object
2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2777 def rule_navigatorAttributes optional repeatable pattern(%w( _hidereport !logicalExpression ), lambda { @navigator.hideReport = @val[1] }) doc('hidereport', "This attribute can be used to exclude the reports that match the specified\n[[logicalexpression|logical expression]] from the navigation bar.\n" ) end |
#rule_navigatorBody ⇒ Object
2790 2791 2792 2793 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2790 def rule_navigatorBody optional pattern(%w( _{ !navigatorAttributes _} )) end |
#rule_navigatorHeader ⇒ Object
2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2795 def rule_navigatorHeader pattern(%w( _navigator $ID ), lambda { if @project['navigators'][@val[1]] error('navigator_exists', "The navigator #{@val[1]} has already been defined.", @sourceFileInfo[0]) end @navigator = Navigator.new(@val[1], @project) }) end |
#rule_nikuReport ⇒ Object
2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2855 def rule_nikuReport pattern(%w( !nikuReportHeader !nikuReportBody ), lambda { @property = nil }) doc('nikureport', "This report generates an XML file to be imported into the enterprise resource\nmanagement software Clarity(R) from Computer Associates(R). The files contains\nallocation curves for the specified resources. All tasks with identical user\ndefined attributes ''''ClarityPID'''' and ''''ClarityPNAME'''' are bundled\ninto a Clarity project. The resulting XML file can be imported into Clarity\nwith the xog-in tool.\n" ) example('Niku') end |
#rule_nikuReportAttributes ⇒ Object
2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2806 def rule_nikuReportAttributes optional repeatable pattern(%w( !formats )) pattern(%w( !headline )) pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( !numberFormat ), lambda { @property.set('numberFormat', @val[0]) }) pattern(%w( !reportEnd )) pattern(%w( !reportPeriod )) pattern(%w( !reportStart )) pattern(%w( !reportTitle )) pattern(%w( _timeoff $STRING $STRING ), lambda { @property.set('timeOffId', @val[1]) @property.set('timeOffName', @val[2]) }) doc('timeoff.nikureport', "Set the Clarity project ID and name that the vacation time will be reported to.\n" ) arg(1, 'ID', 'The Clarity project ID') arg(2, 'Name', 'The Clarity project name') end |
#rule_nikuReportBody ⇒ Object
2836 2837 2838 2839 2840 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2836 def rule_nikuReportBody pattern(%w( _{ !nikuReportAttributes _} ), lambda { }) end |
#rule_nikuReportHeader ⇒ Object
2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2842 def rule_nikuReportHeader pattern(%w( _nikureport !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :niku, @sourceFileInfo[0]) do @property.set('numberFormat', RealFormat.new(['-', '', '', '.', 2])) end }) arg(1, 'file name', "The name of the time sheet report file to generate. It must end with a .tji\nextension, or use . to use the standard output channel.\n" ) end |
#rule_nodeId ⇒ Object
2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2871 def rule_nodeId pattern(%w( !idOrAbsoluteId !subNodeId ), lambda { case @property.typeSpec when :taskreport if (p1 = @project.task(@val[0])).nil? error('unknown_main_node', "Unknown task ID #{@val[0]}", @sourceFileInfo[0]) end if @val[1] if (p2 = @project.resource(@val[1])).nil? error('unknown_sub_node', "Unknown resource ID #{@val[0]}", @sourceFileInfo[0]) end return [ p2, p1 ] end return [ p1, nil ] when :resourcereport if (p1 = @project.task(@val[0])).nil? error('unknown_main_node', "Unknown task ID #{@val[0]}", @sourceFileInfo[0]) end if @val[1] if (p2 = @project.resource(@val[1])).nil? error('unknown_sub_node', "Unknown resource ID #{@val[0]}", @sourceFileInfo[0]) end return [ p2, p1 ] end return [ p1, nil ] end raise "Node list is not supported for this report type: " + "#{@property.typeSpec}" }) end |
#rule_nodeIdList ⇒ Object
2907 2908 2909 2910 2911 2912 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2907 def rule_nodeIdList listRule('moreNodeIdList', '!nodeId') pattern([ '_-' ], lambda { [] }) end |
#rule_number ⇒ Object
2914 2915 2916 2917 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2914 def rule_number singlePattern('$INTEGER') singlePattern('$FLOAT') end |
#rule_numberFormat ⇒ Object
2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2919 def rule_numberFormat pattern(%w( _numberformat $STRING $STRING $STRING $STRING $INTEGER ), lambda { RealFormat.new(@val.slice(1, 5)) }) doc('numberformat', 'These values specify the default format used for all numerical ' + 'real values.') arg(1, 'negativeprefix', 'Prefix for negative numbers') arg(2, 'negativesuffix', 'Suffix for negative numbers') arg(3, 'thousandsep', 'Separator used for every 3rd digit') arg(4, 'fractionsep', 'Separator used to separate the fraction digits') arg(5, 'fractiondigits', 'Number of fraction digits to show') end |
#rule_operand ⇒ Object
2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2934 def rule_operand pattern(%w( _( !operation _) ), lambda { @val[1] }) pattern(%w( _~ !operand ), lambda { operation = LogicalOperation.new(@val[1]) operation.operator = '~' operation }) pattern(%w( $ABSOLUTE_ID ), lambda { if @val[0].count('.') > 1 error('operand_attribute', 'Attributes must be specified as <scenarioID>.<attribute>', @sourceFileInfo[0]) end scenario, attribute = @val[0].split('.') if (scenarioIdx = @project.scenarioIdx(scenario)).nil? error('operand_unkn_scen', "Unknown scenario ID #{scenario}", @sourceFileInfo[0]) end # TODO: Do at least some basic sanity checks of the attribute is valid. LogicalAttribute.new(attribute, @project.scenario(scenarioIdx)) }) pattern(%w( !date ), lambda { LogicalOperation.new(@val[0]) }) pattern(%w( $ID !argumentList ), lambda { if @val[1].nil? unless @project['flags'].include?(@val[0]) error('operand_unkn_flag', "Undeclared flag '#{@val[0]}'", @sourceFileInfo[0]) end LogicalFlag.new(@val[0]) else func = LogicalFunction.new(@val[0]) res = func.setArgumentsAndCheck(@val[1]) unless res.nil? error(*res) end func end }) pattern(%w( $INTEGER ), lambda { LogicalOperation.new(@val[0]) }) pattern(%w( $FLOAT ), lambda { LogicalOperation.new(@val[0]) }) pattern(%w( $STRING ), lambda { LogicalOperation.new(@val[0]) }) end |
#rule_operation ⇒ Object
2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 2988 def rule_operation pattern(%w( !operand !operationChain ), lambda { operation = LogicalOperation.new(@val[0]) if @val[1] # Further operators/operands create an operation tree. @val[1].each do |ops| operation = LogicalOperation.new(operation) operation.operator = ops[0] operation.operand2 = ops[1] end end operation }) arg(0, 'operand', "An operand can consist of a date, a text string, a [[functions|function]], a\nproperty attribute or a numerical value. It can also be the name of a declared\nflag. Use the ''''scenario_id.attribute'''' notation to use an attribute of\nthe currently evaluated property. The scenario ID always has to be specified,\nalso for non-scenario specific attributes. This is necessary to distinguish\nthem from flags. See [[columnid]] for a list of available attributes. The use\nof list attributes is not recommended. User defined attributes are available\nas well.\n\nAn operand can be a negated operand by prefixing a ~ charater or it can be\nanother logical expression enclosed in braces.\n" ) end |
#rule_operationChain ⇒ Object
3017 3018 3019 3020 3021 3022 3023 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3017 def rule_operationChain optional repeatable pattern(%w( !operatorAndOperand), lambda { @val[0] }) end |
#rule_operator ⇒ Object
3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3035 def rule_operator singlePattern('_|') descr('The \'or\' operator') singlePattern('_&') descr('The \'and\' operator') singlePattern('_>') descr('The \'greater than\' operator') singlePattern('_<') descr('The \'smaller than\' operator') singlePattern('_=') descr('The \'equal\' operator') singlePattern('_>=') descr('The \'greater-or-equal\' operator') singlePattern('_<=') descr('The \'smaller-or-equal\' operator') singlePattern('_!=') descr('The \'not-equal\' operator') end |
#rule_operatorAndOperand ⇒ Object
3025 3026 3027 3028 3029 3030 3031 3032 3033 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3025 def rule_operatorAndOperand pattern(%w( !operator !operand), lambda{ [ @val[0], @val[1] ] }) arg(1, 'operand', "An operand can consist of a date, a text string or a numerical value. It can also be the name of a declared flag. Finally, an operand can be a negated operand by prefixing a ~ charater or it can be another operation enclosed in braces.\n" ) end |
#rule_optionalID ⇒ Object
3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3061 def rule_optionalID optional pattern(%w( $ID ), lambda { @val[0] }) arg(0, 'id', "An optional ID. If you ever want to reference this property, you must specify\nyour own unique ID. If no ID is specified one will be automatically generated.\nThese IDs may become visible in reports, but may change at any time. You may\nnever rely on automatically generated IDs.\n" ) end |
#rule_optionalMinus ⇒ Object
3075 3076 3077 3078 3079 3080 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3075 def rule_optionalMinus optional pattern(%w( _- ), lambda { true }) end |
#rule_optionalPercent ⇒ Object
3082 3083 3084 3085 3086 3087 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3082 def rule_optionalPercent optional pattern(%w( !number _% ), lambda { @val[0] / 100.0 }) end |
#rule_optionalScenarioIdCol ⇒ Object
3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3088 def rule_optionalScenarioIdCol optional pattern(%w( $ID_WITH_COLON ), lambda { if (@scenarioIdx = @project.scenarioIdx(@val[0])).nil? error('unknown_scenario_id', "Unknown scenario: #{@val[0]}", @sourceFileInfo[0]) end @scenarioIdx }) end |
#rule_optionalVersion ⇒ Object
3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3100 def rule_optionalVersion optional pattern(%w( $STRING ), lambda { @val[0] }) arg(0, 'version', "An optional version ID. This can be something simple as \"4.2\" or an ID tag of\na revision control system. If not specified, it defaults to \"1.0\".\n" ) end |
#rule_outputFormat ⇒ Object
3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3112 def rule_outputFormat pattern(%w( _csv ), lambda { :csv }) descr("The report lists the resources and their respective values as\ncolon-separated-value (CSV) format. Due to the very simple nature of the CSV\nformat, only a small subset of features will be supported for CSV output.\nIncluding tasks or listing multiple scenarios will result in very difficult to\nread reports.\n" ) pattern(%w( _html ), lambda { :html }) descr('Generate a web page (HTML file)') pattern(%w( _niku ), lambda { :niku }) descr('Generate a XOG XML file to be used with Clarity.') end |
#rule_outputFormats ⇒ Object
3136 3137 3138 3139 3140 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3136 def rule_outputFormats pattern(%w( !outputFormat !moreOutputFormats ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_plusOrMinus ⇒ Object
3142 3143 3144 3145 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3142 def rule_plusOrMinus singlePattern('_+') singlePattern('_-') end |
#rule_project ⇒ Object
3147 3148 3149 3150 3151 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3147 def rule_project pattern(%w( !projectProlog !projectDeclaration !properties . ), lambda { @val[1] }) end |
#rule_projectBody ⇒ Object
3153 3154 3155 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3153 def rule_projectBody ('projectBodyAttributes') end |
#rule_projectBodyAttributes ⇒ Object
3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3157 def rule_projectBodyAttributes repeatable optional pattern(%w( _alertlevels !alertLevelDefinitions ), lambda { if @val[1].length < 2 error('too_few_alert_levels', 'You must specify at least 2 different alert levels.', @sourceFileInfo[1]) end levels = @project['alertLevels'] levels.clear @val[1].each do |level| if levels.indexById(level[0]) error('alert_level_redef', "Alert level '#{level[0]}' has been defined multiple times.", @sourceFileInfo[1]) end if levels.indexByName(level[1]) error('alert_name_redef', "Alert level name '#{level[1]}' has been defined multiple " + "times.", @sourceFileInfo[1]) end @project['alertLevels'].add(AlertLevelDefinition.new(*level)) end }) level(:beta) doc('alertlevels', "By default TaskJuggler supports the pre-defined alert levels: green, yellow\nand red. This attribute can be used to replace them with your own set of alert\nlevels. You can define any number of levels, but you need to define at least\ntwo and they must be specified in ascending order from the least severity to\nhighest severity. Additionally, you need to provide a 15x15 pixel image file\nwith the name ''''flag-X.png'''' for each level where ''''X'''' matches the ID\nof the alert level. These files need to be in the ''''icons'''' directory to\nbe found by the browser when showing HTML reports.\n" ) example('AlertLevels') pattern(%w( !currencyFormat ), lambda { @project['currencyFormat'] = @val[0] }) pattern(%w( _currency $STRING ), lambda { @project['currency'] = @val[1] }) doc('currency', 'The default currency unit.') example('Account') arg(1, 'symbol', 'Currency symbol') pattern(%w( _dailyworkinghours !number ), lambda { @project['dailyworkinghours'] = @val[1] }) doc('dailyworkinghours', "Set the average number of working hours per day. This is used as\nthe base to convert working hours into working days. This affects\nfor example the length task attribute. The default value is 8 hours\nand should work for most Western countries. The value you specify should match\nthe settings you specified as your default [[workinghours.project|working\nhours]].\n" ) example('Project') arg(1, 'hours', 'Average number of working hours per working day') pattern(%w( _extend !extendProperty !extendBody ), lambda { updateParserTables }) doc('extend', "Often it is desirable to collect more information in the project file than is\nnecessary for task scheduling and resource allocation. To add such information\nto tasks, resources or accounts the user can extend these properties with\nuser-defined attributes. The new attributes can be of various types such as\ntext, date or reference to capture various types of data. Optionally the user\ncan specify if the attribute value should be inherited from the enclosing\nproperty.\n" ) example('CustomAttributes') pattern(%w( !projectBodyInclude )) pattern(%w( !journalEntry )) pattern(%w( _now !date ), lambda { @project['now'] = @val[1] @scanner.addMacro(TextParser::Macro.new('now', @val[1].to_s, @sourceFileInfo[0])) @scanner.addMacro(TextParser::Macro.new( 'today', @val[1].to_s(@project['timeFormat']), @sourceFileInfo[0])) }) doc('now', "Specify the date that TaskJuggler uses for calculation as current\ndate. If no value is specified, the current value of the system\nclock is used.\n" ) arg(1, 'date', 'Alternative date to be used as current date for all ' + 'computations') pattern(%w( !numberFormat ), lambda { @project['numberFormat'] = @val[0] }) pattern(%w( _outputdir $STRING ), lambda { # Directory name must be terminated by a slash. if @val[1].empty? error('outdir_empty', 'Output directory may not be empty.') end if !File.directory?(@val[1]) error('outdir_missing', "Output directory '#{@val[1]}' does not exist or is not " + "a directory!") end @project.outputDir = @val[1] + (@val[1][-1] == ?/ ? '' : '/') }) doc('outputdir', 'Specifies the directory into which the reports should be generated. ' + 'This will not affect reports whos name start with a slash. This ' + 'setting can be overwritten by the command line option.') arg(1, 'directory', 'Path to an existing directory') pattern(%w( !scenario )) pattern(%w( _shorttimeformat $STRING ), lambda { @project['shortTimeFormat'] = @val[1] }) doc('shorttimeformat', 'Specifies time format for time short specifications. This is normal' + 'just the hour and minutes.') arg(1, 'format', 'strftime like format string') pattern(%w( !timeformat ), lambda { @project['timeFormat'] = @val[0] }) pattern(%w( !timezone ), lambda { @val[0] }) pattern(%w( _timingresolution $INTEGER _min ), lambda { goodValues = [ 5, 10, 15, 20, 30, 60 ] unless goodValues.include?(@val[1]) error('bad_timing_res', "Timing resolution must be one of #{goodValues.join(', ')} min.", @sourceFileInfo[1]) end if @val[1] > (Project.maxScheduleGranularity / 60) error('too_large_timing_res', 'The maximum allowed timing resolution for the timezone is ' + "#{Project.maxScheduleGranularity / 60} minutes.", @sourceFileInfo[1]) end @project['scheduleGranularity'] = @val[1] * 60 }) doc('timingresolution', "Sets the minimum timing resolution. The smaller the value, the longer the\nscheduling process lasts and the more memory the application needs. The\ndefault and maximum value is 1 hour. The smallest value is 5 min.\nThis value is a pretty fundamental setting of TaskJuggler. It has a severe\nimpact on memory usage and scheduling performance. You should set this value\nto the minimum required resolution. Make sure that all values that you specify\nare aligned with the resolution.\n\nChanging the timing resolution will reset the [[workinghours.project|working\nhours]] to the default times. It's recommended that this is the very first\noption in the project header section.\n\nDo not use this option after you've set the time zone!\n" ) pattern(%w( _trackingscenario !scenarioId ), lambda { @project['trackingScenarioIdx'] = @val[1] # The tracking scenario and all child scenarios will always be scheduled # in projection mode. @project.scenario(@val[1]).all.each do |scenario| scenario.set('projection', true) end }) doc('trackingscenario', "Specifies which scenario is used to capture what actually has happened with\nthe project. All sub-scenarios of this scenario inherit the bookings of the\ntracking scenario and may not have any bookings of their own. The tracking\nscenario must also be specified to use time and status sheet reports.\n\nThe tracking scenario must be defined after all scenario have been defined.\n\nThe tracking scenario and all scenarios derived from it will be scheduled in\nprojection mode. This means that the scheduler will only add bookings after\nthe current date or the date specified by [[now]]. It is assumed that all\nallocations prior to this date have been provided as [[booking.task|\ntask bookings]] or [[booking.resource|resource bookings]].\n" ) example('TimeSheet1', '2') pattern(%w( _weekstartsmonday ), lambda { @project['weekStartsMonday'] = true }) doc('weekstartsmonday', 'Specify that you want to base all week calculation on weeks ' + 'starting on Monday. This is common in many European countries.') pattern(%w( _weekstartssunday ), lambda { @project['weekStartsMonday'] = false }) doc('weekstartssunday', 'Specify that you want to base all week calculation on weeks ' + 'starting on Sunday. This is common in the United States of America.') pattern(%w( !workinghoursProject )) pattern(%w( _yearlyworkingdays !number ), lambda { @project['yearlyworkingdays'] = @val[1] }) doc('yearlyworkingdays', "Specifies the number of average working days per year. This should correlate\nto the specified workinghours and vacation. It affects the conversion of\nworking hours, working days, working weeks, working months and working years\ninto each other.\n\nWhen public holidays and leaves are disregarded, this value should be equal\nto the number of working days per week times 52.1428 (the average number of\nweeks per year). E. g. for a culture with 5 working days it is 260.714 (the\ndefault), for 6 working days it is 312.8568 and for 7 working days it is\n365.\n" ) arg(1, 'days', 'Number of average working days for a year') end |
#rule_projectBodyInclude ⇒ Object
3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3476 def rule_projectBodyInclude pattern(%w( _include !includeFile !projectBodyAttributes . )) lastSyntaxToken(1) doc('include.project', "Includes the specified file name as if its contents would be written\ninstead of the include property. When the included files contains other\ninclude statements or report definitions, the filenames are relative to file\nwhere they are defined in.\n\nThis version of the include directive may only be used inside the [[project]]\nheader section. The included files must only contain content that may be\npresent in a project header section.\n" ) end |
#rule_projectDeclaration ⇒ Object
3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3390 def rule_projectDeclaration pattern(%w( !projectHeader !projectBody ), lambda { # If the user has specified a tracking scenario, we mark all children of # that scenario to disallow own bookings. These scenarios will inherit # their bookings from the tracking scenario. if (idx = @project['trackingScenarioIdx']) @project.scenario(idx).allLeaves(true).each do |scenario| scenario.set('ownbookings', false) end end @val[0] }) doc('project', "The project property is mandatory and should be the first property\nin a project file. It is used to capture basic attributes such as\nthe project id, name and the expected time frame.\n\nBe aware that the dates for the project period default to UTC times. See [[interval2]] for details.\n" ) end |
#rule_projectHeader ⇒ Object
3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3412 def rule_projectHeader pattern(%w( _project !optionalID $STRING !optionalVersion !interval ), lambda { @project = Project.new(@val[1], @val[2], @val[3]) @project['start'] = @val[4].start @project['end'] = @val[4].end @projectId = @val[1] setGlobalMacros @property = nil @reportCounter = 0 @project }) arg(2, 'name', 'The name of the project') end |
#rule_projectIDs ⇒ Object
3426 3427 3428 3429 3430 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3426 def rule_projectIDs pattern(%w( $ID !moreProjectIDs ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_projection ⇒ Object
3432 3433 3434 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3432 def rule_projection ('projectionAttributes') end |
#rule_projectionAttributes ⇒ Object
3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3436 def rule_projectionAttributes optional repeatable pattern(%w( _sloppy )) level(:deprecated) also('trackingscenario') doc('sloppy.projection', '') pattern(%w( _strict ), lambda { warning('projection_strict', 'The strict mode is now always used.') }) level(:deprecated) also('trackingscenario') doc('strict.projection', '') end |
#rule_projectProlog ⇒ Object
3453 3454 3455 3456 3457 3458 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3453 def rule_projectProlog optional repeatable pattern(%w( !prologInclude )) pattern(%w( !macro )) end |
#rule_projectProperties ⇒ Object
3460 3461 3462 3463 3464 3465 3466 3467 3468 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3460 def rule_projectProperties # This rule is not defining actual syntax. It's only used for the # documentation. pattern(%w( !projectPropertiesBody )) doc('properties', "The project properties. Every project must consists of at least one task. The other properties are optional. To save the scheduled data at least one output generating property should be used.\n" ) end |
#rule_projectPropertiesBody ⇒ Object
3470 3471 3472 3473 3474 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3470 def rule_projectPropertiesBody # This rule is not defining actual syntax. It's only used for the # documentation. ('properties') end |
#rule_prologInclude ⇒ Object
3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3492 def rule_prologInclude pattern(%w( _include !includeFile !projectProlog . )) lastSyntaxToken(1) doc('include.macro', "Includes the specified file name as if its contents would be written\ninstead of the include property. The only exception is the include\nstatement itself. When the included files contains other include\nstatements or report definitions, the filenames are relative to file\nwhere they are defined in.\n\nThe included file may only contain macro definitions. This version of the\ninclude directive can only be used before the [[project]] header.\n" ) end |
#rule_properties ⇒ Object
3508 3509 3510 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3508 def rule_properties pattern(%w( !propertiesBody )) end |
#rule_propertiesBody ⇒ Object
3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3512 def rule_propertiesBody repeatable optional pattern(%w( !account )) pattern(%w( _auxdir $STRING ), lambda { auxdir = @val[1] # Ensure that the directory always ends with a '/'. auxdir += '/' unless auxdir[-1] == ?/ @project['auxdir'] = auxdir }) level(:beta) doc('auxdir', "Specifies an alternative directory for the auxiliary report files such as CSS,\nJavaScript and icon files. This setting will affect all subsequent report\ndefinitions unless it gets overridden. If this attribute is not set, the\ndirectory and its contents will be generated automatically. If this attribute\nis provided, the user has to ensure that the directory exists and is filled\nwith the proper data. The specified path can be absolute or relative to the\ngenerated report file.\n" ) pattern(%w( _copyright $STRING ), lambda { @project['copyright'] = @val[1] }) doc('copyright', "Set a copyright notice for the project file and its content. This copyright notice will be added to all reports that can support it.\n" ) example('Caption', '2') pattern(%w( !balance ), lambda { @project['costaccount'] = @val[0][0] @project['revenueaccount'] = @val[0][1] }) pattern(%w( _flags !declareFlagList ), lambda { unless @project['flags'].include?(@val[1]) @project['flags'] += @val[1] end }) doc('flags', "Declare one or more flag for later use. Flags can be used to mark tasks, resources or other properties to filter them in reports.\n" ) pattern(%w( !propertiesInclude )) pattern(%w( !leaves ), lambda { @val[0].each do |v| @project['leaves'] << v end }) pattern(%w( !limits ), lambda { @project['limits'] = @val[0] }) doc('limits', "Set per-interval allocation limits for the following resource definitions.\nThe limits can be overwritten in each resource definition and the global\nlimits can be changed later.\n" ) pattern(%w( !macro )) pattern(%w( !navigator )) pattern(%w( _projectid $ID ), lambda { @project['projectids'] << @val[1] @project['projectids'].uniq! @project['projectid'] = @projectId = @val[1] }) doc('projectid', "This declares a new project id and activates it. All subsequent\ntask definitions will inherit this ID. The tasks of a project can have\ndifferent IDs. This is particularly helpful if the project is merged from\nseveral sub projects that each have their own ID.\n" ) pattern(%w( _projectids !projectIDs ), lambda { @project['projectids'] += @val[1] @project['projectids'].uniq! }) doc('projectids', "Declares a list of project IDs. When an include file that was generated from another project brings different project IDs, these need to be declared first.\n" ) pattern(%w( _rate !number ), lambda { @project['rate'] = @val[1].to_f }) doc('rate', "Set the default rate for all subsequently defined resources. The rate describes the daily cost of a resource.\n" ) pattern(%w( !reportProperties )) pattern(%w( !resource )) pattern(%w( !shift )) pattern(%w( !statusSheet )) pattern(%w( _supplement !supplement )) doc('supplement', "The supplement keyword provides a mechanism to add more attributes to already\ndefined accounts, tasks or resources. The additional attributes must obey the\nsame rules as in regular task or resource definitions and must be enclosed by\ncurly braces.\n\nThis construct is primarily meant for situations where the information about a\ntask or resource is split over several files. E. g. the vacation dates for the\nresources may be in a separate file that was generated by some other tool.\n" ) example('Supplement') pattern(%w( !task )) pattern(%w( !timeSheet )) pattern(%w( _vacation !vacationName !intervals ), lambda { @val[2].each do |interval| @project['leaves'] << Leave.new(:holiday, interval) end }) doc('vacation', "Specify a global vacation period for all subsequently defined resources. A\nvacation can also be used to block out the time before a resource joined or\nafter it left. For employees changing their work schedule from full-time to\npart-time, or vice versa, please refer to the 'Shift' property.\n" ) arg(1, 'name', 'Name or purpose of the vacation') end |
#rule_propertiesFile ⇒ Object
3648 3649 3650 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3648 def rule_propertiesFile pattern(%w( !propertiesBody . )) end |
#rule_propertiesInclude ⇒ Object
3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3652 def rule_propertiesInclude pattern(%w( _include !includeProperties !properties . ), lambda { }) lastSyntaxToken(1) doc('include.properties', "Includes the specified file name as if its contents would be written\ninstead of the include property. The only exception is the include\nstatement itself. When the included files contains other include\nstatements or report definitions, the filenames are relative to file\nwhere they are defined in. include commands can be used in the project\nheader, at global scope or between property declarations of tasks,\nresources, and accounts.\n\nFor technical reasons you have to supply the optional pair of curly\nbrackets if the include is followed immediately by a macro call that\nis defined within the included file.\n" ) end |
#rule_purge ⇒ Object
3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3672 def rule_purge pattern(%w( _purge !optionalScenarioIdCol $ID ), lambda { attrId = @val[2] if (attributeDefinition = @property.attributeDefinition(attrId)).nil? error('purge_unknown_id', "#{attrId} is not a known attribute for this property", @sourceFileInfo[2]) end if attributeDefinition.scenarioSpecific @scenarioIdx = 0 unless @val[1] attr = @property[attrId, 0] else if @val[1] error('purge_non_sc_spec_attr', 'Scenario specified for a non-scenario specific attribute') end attr = @property.get(attrId) end if @property.attributeDefinition(attrId).scenarioSpecific @property.getAttribute(attrId, @scenarioIdx).reset else @property.getAttribute(attrId).reset end }) doc('purge', "Many attributes inherit their values from the enclosing property or the global\nscope. In certain circumstances, this is not desirable, e. g. for list\nattributes. A list attribute is any attribute that takes a comma separated\nlist of values as argument. [[allocate]] and [[flags.task]] are\ngood examples of commonly used list attributes. By defining values for\nsuch a list attribute in a nested property, the new values will be appended to\nthe list that was inherited from the enclosing property. The purge\nattribute resets any attribute to its default value. A subsequent definition\nfor the attribute within the property will then add their values to an empty\nlist. The value of the enclosing property is not affected by purge.\n\nFor scenario specific attributes, an optional scenario ID can be specified\nbefore the attribute ID. If it's missing, the default (first) scenario will be\nused.\n" ) arg(1, 'attribute', 'Any name of a list attribute') end |
#rule_referenceAttributes ⇒ Object
3716 3717 3718 3719 3720 3721 3722 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3716 def rule_referenceAttributes optional repeatable pattern(%w( _label $STRING ), lambda { @val[1] }) end |
#rule_referenceBody ⇒ Object
3724 3725 3726 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3724 def rule_referenceBody ('referenceAttributes') end |
#rule_relativeId ⇒ Object
3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3728 def rule_relativeId pattern(%w( _! !moreBangs !idOrAbsoluteId ), lambda { str = '!' if @val[1] @val[1].each { |bang| str += bang } end str += @val[2] str }) end |
#rule_reportableAttributes ⇒ Object
3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3749 def rule_reportableAttributes singlePattern('_activetasks') descr("The number of sub-tasks (including the current task) that are active in the\nreported time period. Active means that they are ongoing at the current time\nor [[now]] date.\n" ) singlePattern('_annualleave') descr("The number of annual leave units within the reported time period. The unit\ncan be adjusted with [[loadunit]].\n" ) singlePattern('_annualleavebalance') descr("The balance of the annual leave at the end of the reporting interval. The unit\ncan be adjusted with [[loadunit]].\n" ) singlePattern('_alert') descr("The alert level of the property that was reported with the date closest to the\nend date of the report. Container properties that don't have their own alert\nlevel reported with a date equal or newer than the alert levels of all their\nsub properties will get the highest alert level of their direct sub\nproperties.\n" ) singlePattern('_alertmessages') level(:deprecated) also('journal') descr('Deprecated. Please use ''''journal'''' instead') singlePattern('_alertsummaries') level(:deprecated) also('journal') descr('Deprecated. Please use ''''journal'''' instead') singlePattern('_alerttrend') descr("Shows how the alert level at the end of the report period compares to the\nalert level at the begining of the report period. Possible values are\n''''Up'''', ''''Down'''' or ''''Flat''''.\n" ) singlePattern('_balance') descr("The account balance at the beginning of the reported period. This is the\nbalance before any transactions of the reported period have been credited.\n" ) singlePattern('_bsi') descr('The hierarchical or work breakdown structure index (i. e. 1.2.3)') singlePattern('_chart') descr("A Gantt chart. This column type requires all lines to have the same fixed\nheight. This does not work well with rich text columns in some browsers. Some\nshow a scrollbar for the compressed table cells, others don't. It is\nrecommended, that you don't use rich text columns in conjuction with the chart\ncolumn.\n" ) singlePattern('_closedtasks') descr("The number of sub-tasks (including the current task) that have been closed\nduring the reported time period. Closed means that they have and end date\nbefore the current time or [[now]] date.\n" ) singlePattern('_competitorcount') descr("The number of tasks that have successfully competed for the same resources and\nhave potentially delayed the completion of this task.\n" ) singlePattern('_competitors') descr("A list of tasks that have successfully competed for the same resources and\nhave potentially delayed the completion of this task.\n" ) singlePattern('_complete') descr("The completion degree of a task. Unless a completion degree is manually\nprovided, this is a computed value relative the [[now]] date of the project. A\ntask that has ended before the now date is always 100% complete. A task that\nstarts at or after the now date is always 0%. For [[effort]] based task the\ncomputation degree is the percentage of done effort of the overall effort. For\nother leaf task, the completion degree is the percentage of the already passed\nduration of the overall task duration. For container task, it's always the\naverage of the direct sub tasks. If the sub tasks consist of a mixture of\neffort and non-effort tasks, the completion value is only of limited value.\n" ) pattern([ '_completed' ], lambda { 'complete' }) level(:deprecated) also('complete') descr('Deprecated alias for complete') singlePattern('_criticalness') descr('A measure for how much effort the resource is allocated for, or' + 'how strained the allocated resources of a task are') singlePattern('_cost') descr("The cost of the task or resource. The use of this column requires that a cost\naccount has been set for the report using the [[balance]] attribute.\n" ) singlePattern('_daily') descr('A group of columns with one column for each day') singlePattern('_directreports') descr("The resources that have this resource assigned as manager.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_duration') descr('The duration of a task') singlePattern('_duties') descr('List of tasks that the resource is allocated to') singlePattern('_efficiency') descr('Measure for how efficient a resource can perform tasks') singlePattern('_effort') descr('The allocated effort during the reporting period') singlePattern('_effortdone') descr('The already completed effort as of now') singlePattern('_effortleft') descr('The remaining allocated effort as of now') singlePattern('_email') descr('The email address of a resource') singlePattern('_end') descr('The end date of a task') singlePattern('_flags') descr('List of attached flags') singlePattern('_followers') descr("A list of tasks that depend on the current task. The list contains the names,\nthe IDs, the date and the type of dependency. For the type the following\nsymbols are used for <nowiki><dep></nowiki>.\n\n* '''<nowiki>]->[</nowiki>''': End-to-Start dependency\n* '''<nowiki>[->[</nowiki>''': Start-to-Start dependency\n* '''<nowiki>]->]</nowiki>''': End-to-End dependency\n* '''<nowiki>[->]</nowiki>''': Start-to-End dependency\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\nThe dependency symbol can be generated via the ''''dependency'''' attribute\ninthe query, the target date via the ''''date'''' attribute.\n" ) singlePattern('_freetime') descr("The amount of unallocated work time of a resource during the reporting period.\n" ) singlePattern('_freework') descr("The amount of unallocated work capacity of a resource during the reporting\nperiod. This is the product of unallocated work time times the efficiency of\nthe resource.\n" ) singlePattern('_fte') descr("The Full-Time-Equivalent of a resource or group. This is the ratio of the\nresource working time and the global working time. Working time is defined by\nworking hours and leaves. The FTE value can vary over time and is\ncalculated for the report interval or the user specified interval.\n" ) singlePattern('_gauge') descr("When [[complete]] values have been provided to capture the actual progress on\ntasks, the gauge column will list whether the task is ahead of, behind or on\nschedule.\n" ) singlePattern('_headcount') descr("For resources this is the headcount number of the resource or resource group.\nFor a single resource this is the [[efficiency]] rounded to the next integer.\nFor a group it is the sum of the sub resources headcount.\n\nFor tasks it's the number of different resources allocated to the task during\nthe report interval. Resources are weighted with their rounded efficiencies.\n" ) pattern([ '_hierarchindex' ], lambda { 'bsi' }) level(:deprecated) also('bsi') descr('Deprecated alias for bsi') singlePattern('_hourly') descr('A group of columns with one column for each hour') singlePattern('_id') descr('The id of the item') singlePattern('_index') descr('The index of the item based on the nesting hierachy') singlePattern('_inputs') descr("A list of milestones that are a prerequiste for the current task. For\ncontainer tasks it will also include the inputs of the child tasks. Inputs may\nnot have any predecessors.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_journal') descr("The journal entries for the task or resource for the reported interval. The\ngenerated text can be customized with the [[journalmode]],\n[[journalattributes]], [[hidejournalentry]] and [[sortjournalentries]]. If\nused in queries without a property context, the journal for the complete\nproject is generated.\n" ) singlePattern('_journal_sub') level(:deprecated) also('journal') descr('Deprecated. Please use ''''journal'''' instead') singlePattern('_journalmessages') level(:deprecated) also('journal') descr('Deprecated. Please use ''''journal'''' instead') singlePattern('_journalsummaries') level(:deprecated) also('journal') descr('Deprecated. Please use ''''journal'''' instead') singlePattern('_line') descr('The line number in the report') singlePattern('_managers') descr("A list of managers that the resource reports to.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_maxend') descr('The latest allowed end of a task') singlePattern('_maxstart') descr('The lastest allowed start of a task') singlePattern('_minend') descr('The earliest allowed end of a task') singlePattern('_minstart') descr('The earliest allowed start of a task') singlePattern('_monthly') descr('A group of columns with one column for each month') singlePattern('_no') descr('The object line number in the report (Cannot be used for sorting!)') singlePattern('_name') descr('The name or description of the item') singlePattern('_note') descr('The note attached to a task') singlePattern('_opentasks') descr("The number of sub-tasks (including the current task) that have not yet been\nclosed during the reported time period. Closed means that they have and end\ndate before the current time or [[now]] date.\n" ) singlePattern('_pathcriticalness') descr('The criticalness of the task with respect to all the paths that ' + 'it is a part of.') singlePattern('_precursors') descr("A list of tasks the current task depends on. The list contains the names, the\nIDs, the date and the type of dependency. For the type the following symbols\nare used\n\n* '''<nowiki>]->[</nowiki>''': End-to-Start dependency\n* '''<nowiki>[->[</nowiki>''': Start-to-Start dependency\n* '''<nowiki>]->]</nowiki>''': End-to-End dependency\n* '''<nowiki>[->]</nowiki>''': Start-to-End dependency\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\nThe dependency symbol can be generated via the ''''dependency'''' attribute\ninthe query, the target date via the ''''date'''' attribute.\n" ) singlePattern('_priority') descr('The priority of a task') singlePattern('_quarterly') descr('A group of columns with one column for each quarter') singlePattern('_rate') descr('The daily cost of a resource.') singlePattern('_reports') descr("All resources that have this resource assigned as a direct or indirect manager.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_resources') descr("A list of resources that are assigned to the task in the report time frame.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_responsible') descr("The responsible people for this task.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_revenue') descr("The revenue of the task or resource. The use of this column requires that a\nrevenue account has been set for the report using the [[balance]] attribute.\n" ) singlePattern('_scenario') descr('The name of the scenario') singlePattern('_scheduling') descr("The scheduling mode of the leaf tasks. ASAP tasks are scheduled start to end while ALAP tasks are scheduled end to start.\n" ) singlePattern('_seqno') descr('The index of the item based on the declaration order') singlePattern('_sickleave') descr("The number of sick leave units within the reported time period. The unit can\nbe adjusted with [[loadunit]].\n" ) singlePattern('_specialleave') descr("The number of special leave units within the reported time period. The unit\ncan be adjusted with [[loadunit]].\n" ) singlePattern('_start') descr('The start date of the task') singlePattern('_status') descr("The status of a task. It is determined based on the current date or the date\nspecified by [[now]].\n" ) singlePattern('_targets') descr("A list of milestones that depend on the current task. For container tasks it\nwill also include the targets of the child tasks. Targets may not have any\nfollower tasks.\n\nThe list can be customized by the [[listitem.column|listitem]] attribute.\n" ) singlePattern('_turnover') descr("The financial turnover of an account during the reporting interval.\n" ) pattern([ '_wbs' ], lambda { 'bsi' }) level(:deprecated) also('bsi') descr('Deprecated alias for bsi.') singlePattern('_unpaidleave') descr("The number of unpaid leave units within the reported time period. The unit\ncan be adjusted with [[loadunit]].\n" ) singlePattern('_weekly') descr('A group of columns with one column for each week') singlePattern('_yearly') descr('A group of columns with one column for each year') end |
#rule_reportAttributes ⇒ Object
4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4199 def rule_reportAttributes optional repeatable pattern(%w( _accountroot !accountId), lambda { if @val[1].leaf? error('accountroot_leaf', "#{@val[1].fullId} is not a container account", @sourceFileInfo[1]) end @property.set('accountroot', @val[1]) }) doc('accountroot', "Only accounts below the specified root-level accounts are exported. The exported\naccounts will have the ID of the root-level account stripped from their ID, so that\nthe sub-accounts of the root-level account become top-level accounts in the report\nfile.\n" ) example('AccountReport') pattern(%w( _auxdir $STRING ), lambda { auxdir = @val[1] # Ensure that the directory always ends with a '/'. auxdir += '/' unless auxdir[-1] == ?/ @property.set('auxdir', auxdir) }) level(:beta) doc('auxdir.report', "Specifies an alternative directory for the auxiliary report files such as CSS,\nJavaScript and icon files. If this attribute is not set, the directory will be\ngenerated automatically. If this attribute is provided, the user has to ensure\nthat the directory exists and is filled with the proper data. The specified\npath can be absolute or relative to the generated report file.\n" ) pattern(%w( !balance ), lambda { @property.set('costaccount', @val[0][0]) @property.set('revenueaccount', @val[0][1]) }) pattern(%w( _caption $STRING ), lambda { @property.set('caption', newRichText(@val[1], @sourceFileInfo[1])) }) doc('caption', "The caption will be embedded in the footer of the table or data segment. The\ntext will be interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) arg(1, 'text', 'The caption text.') example('Caption', '1') pattern(%w( _center $STRING ), lambda { @property.set('center', newRichText(@val[1], @sourceFileInfo[1])) }) doc('center', "This attribute defines the center section of the [[textreport]]. The text will\nbe interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) arg(1, 'text', 'The text') example('textreport') pattern(%w( _columns !columnDef !moreColumnDef ), lambda { columns = [ @val[1] ] columns += @val[2] if @val[2] @property.set('columns', columns) }) doc('columns', "Specifies which columns shall be included in a report. Some columns show\nvalues that are constant over the course of the project. Other columns show\ncalculated values that depend on the time period that was chosen for the\nreport.\n" ) pattern(%w( !currencyFormat ), lambda { @property.set('currencyFormat', @val[0]) }) pattern(%w( !reportEnd )) pattern(%w( _epilog $STRING ), lambda { @property.set('epilog', newRichText(@val[1], @sourceFileInfo[1])) }) doc('epilog', "Define a text section that is printed right after the actual report data. The\ntext will be interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) also(%w( footer header prolog )) pattern(%w( !flags )) doc('flags.report', "Attach a set of flags. The flags can be used in logical expressions to filter\nproperties from the reports.\n" ) pattern(%w( _footer $STRING ), lambda { @property.set('footer', newRichText(@val[1], @sourceFileInfo[1])) }) doc('footer', "Define a text section that is put at the bottom of the report. The\ntext will be interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) example('textreport') also(%w( epilog header prolog )) pattern(%w( !formats )) pattern(%w( _header $STRING ), lambda { @property.set('header', newRichText(@val[1], @sourceFileInfo[1])) }) doc('header', "Define a text section that is put at the top of the report. The\ntext will be interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) example('textreport') also(%w( epilog footer prolog )) pattern(%w( !headline )) pattern(%w( !hidejournalentry )) pattern(%w( !hideaccount )) pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( _height $INTEGER ), lambda { if @val[1] < 200 error('min_report_height', "The report must have a minimum height of 200 pixels.") end @property.set('height', @val[1]) }) doc('height', "Set the height of the report in pixels. This attribute is only used for\nreports that cannot determine the height based on the content. Such report can\nbe freely resized to fit in. The vast majority of reports can determine their\nheight based on the provided content. These reports will simply ignore this\nsetting.\n" ) also('width') pattern(%w( !journalReportAttributes )) pattern(%w( _journalmode !journalReportMode ), lambda { @property.set('journalMode', @val[1]) }) doc('journalmode', "This attribute controls what journal entries are aggregated into the report.\n" ) pattern(%w( _left $STRING ), lambda { @property.set('left', newRichText(@val[1], @sourceFileInfo[1])) }) doc('left', "This attribute defines the left margin section of the [[textreport]]. The text\nwill be interpreted as [[Rich_Text_Attributes|Rich Text]]. The margin will not\nspan the [[header]] or [[footer]] sections.\n" ) example('textreport') pattern(%w( !loadunit )) pattern(%w( !numberFormat ), lambda { @property.set('numberFormat', @val[0]) }) pattern(%w( _opennodes !nodeIdList ), lambda { @property.set('openNodes', @val[1]) }) doc('opennodes', 'For internal use only!') pattern(%w( !reportPeriod )) pattern(%w( _prolog $STRING ), lambda { @property.set('prolog', newRichText(@val[1], @sourceFileInfo[1])) }) doc('prolog', "Define a text section that is printed right before the actual report data. The\ntext will be interpreted as [[Rich_Text_Attributes|Rich Text]].\n" ) also(%w( epilog footer header )) pattern(%w( !purge )) pattern(%w( _rawhtmlhead $STRING ), lambda { @property.set('rawHtmlHead', @val[1]) }) doc('rawhtmlhead', "Define a HTML fragment that will be inserted at the end of the HTML head\nsection.\n" ) pattern(%w( !reports )) pattern(%w( _right $STRING ), lambda { @property.set('right', newRichText(@val[1], @sourceFileInfo[1])) }) doc('right', "This attribute defines the right margin section of the [[textreport]]. The text\nwill be interpreted as [[Rich_Text_Attributes|Rich Text]]. The margin will not\nspan the [[header]] or [[footer]] sections.\n" ) example('textreport') pattern(%w( !rollupaccount )) pattern(%w( !rollupresource )) pattern(%w( !rolluptask )) pattern(%w( _scenarios !scenarioIdList ), lambda { # Don't include disabled scenarios in the report @val[1].delete_if { |sc| !@project.scenario(sc).get('active') } @property.set('scenarios', @val[1]) }) doc('scenarios', "List of scenarios that should be included in the report. By default, only the\ntop-level scenario will be included. You can use this attribute to include\ndata from the defined set of scenarios. Not all reports support reporting data\nfrom multiple scenarios. They will only include data from the first one in the\nlist.\n" ) pattern(%w( _selfcontained !yesNo ), lambda { @property.set('selfcontained', @val[1]) }) doc('selfcontained', "Try to generate selfcontained output files when the format supports this. E.\ng. for HTML reports, the style sheet will be included and no icons will be\nused.\n" ) pattern(%w( !sortAccounts )) pattern(%w( !sortJournalEntries )) pattern(%w( !sortResources )) pattern(%w( !sortTasks )) pattern(%w( !reportStart )) pattern(%w( _resourceroot !resourceId), lambda { if @val[1].leaf? error('resourceroot_leaf', "#{@val[1].fullId} is not a group resource", @sourceFileInfo[1]) end @property.set('resourceroot', @val[1]) }) doc('resourceroot', "Only resources below the specified root-level resources are exported. The\nexported resources will have the ID of the root-level resource stripped from\ntheir ID, so that the sub-resourcess of the root-level resource become\ntop-level resources in the report file.\n" ) example('ResourceRoot') pattern(%w( _taskroot !taskId), lambda { if @val[1].leaf? error('taskroot_leaf', "#{@val[1].fullId} is not a container task", @sourceFileInfo[1]) end @property.set('taskroot', @val[1]) }) doc('taskroot', "Only tasks below the specified root-level tasks are exported. The exported\ntasks will have the ID of the root-level task stripped from their ID, so that\nthe sub-tasks of the root-level task become top-level tasks in the report\nfile.\n" ) example('TaskRoot') pattern(%w( !timeformat ), lambda { @property.set('timeFormat', @val[0]) }) pattern(%w( _timezone !validTimeZone ), lambda { @property.set('timezone', @val[1]) }) doc('timezone.report', "Sets the time zone used for all dates in the report. This setting is ignored\nif the report is embedded into another report. Embedded in this context means\nthe report is part of another generated report. It does not mean that the\nreport definition is a sub report of another report definition.\n" ) pattern(%w( !reportTitle )) pattern(%w( _width $INTEGER ), lambda { if @val[1] < 400 error('min_report_width', "The report must have a minimum width of 400 pixels.") end @property.set('width', @val[1]) }) doc('width', "Set the width of the report in pixels. This attribute is only used for\nreports that cannot determine the width based on the content. Such report can\nbe freely resized to fit in. The vast majority of reports can determine their\nwidth based on the provided content. These reports will simply ignore this\nsetting.\n" ) also('height') end |
#rule_reportBody ⇒ Object
4630 4631 4632 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4630 def rule_reportBody ('reportAttributes') end |
#rule_reportEnd ⇒ Object
4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4517 def rule_reportEnd pattern(%w( _end !date ), lambda { if @val[1] < @property.get('start') error('report_end', "End date must be before start date #{@property.get('start')}", @sourceFileInfo[1]) end @property.set('end', @val[1]) }) doc('end.report', "Specifies the end date of the report. In task reports only tasks that start\nbefore this end date are listed.\n" ) example('Export', '2') end |
#rule_reportId ⇒ Object
4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4533 def rule_reportId pattern(%w( !reportIdUnverifd ), lambda { id = @val[0] if @property && @property.is_a?(Report) id = @property.fullId + '.' + id else id = @reportprefix + '.' + id unless @reportprefix.empty? end # In case we have a nested supplement, we need to prepend the parent ID. if (report = @project.report(id)).nil? error('report_id_expected', "#{id} is not a defined report.", @sourceFileInfo[0]) end report }) arg(0, 'report', 'The ID of a defined report') end |
#rule_reportIdUnverifd ⇒ Object
4551 4552 4553 4554 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4551 def rule_reportIdUnverifd singlePattern('$ABSOLUTE_ID') singlePattern('$ID') end |
#rule_reportName ⇒ Object
4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4556 def rule_reportName pattern(%w( $STRING ), lambda { @val[0] }) arg(0, 'name', "The name of the report. This will be the base name for generated output files.\nThe suffix will depend on the specified [[formats]]. It will also be used in\nnavigation bars.\n\nBy default, report definitions do not generate any files. With more complex\nprojects, most report definitions will be used to describe elements of\ncomposed reports. If you want to generate a file from this report, you must\nspecify the list of [[formats]] that you want to generate. The report name\nwill then be used as a base name to create the file. The suffix will be\nappended based on the generated format.\n\nReports have a local name space. All IDs and file names must be unique within\nthe reports that belong to the same enclosing report. To reference a report\nfor inclusion into another report, you need to specify the full report ID.\nThis is composed of the report ID, prefixed by a dot-separated list of all\nparent report IDs.\n" ) end |
#rule_reportPeriod ⇒ Object
4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4581 def rule_reportPeriod pattern(%w( _period !interval ), lambda { @property.set('start', @val[1].start) @property.set('end', @val[1].end) }) doc('period.report', "This property is a shortcut for setting the start and end property at the\nsame time.\n" ) end |
#rule_reportProperties ⇒ Object
4593 4594 4595 4596 4597 4598 4599 4600 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4593 def rule_reportProperties pattern(%w( !iCalReport )) pattern(%w( !nikuReport )) pattern(%w( !reports )) pattern(%w( !tagfile )) pattern(%w( !statusSheetReport )) pattern(%w( !timeSheetReport )) end |
#rule_reportPropertiesBody ⇒ Object
4602 4603 4604 4605 4606 4607 4608 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4602 def rule_reportPropertiesBody optional repeatable pattern(%w( !macro )) pattern(%w( !reportProperties )) end |
#rule_reportPropertiesFile ⇒ Object
4610 4611 4612 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4610 def rule_reportPropertiesFile pattern(%w( !reportPropertiesBody . )) end |
#rule_reports ⇒ Object
3740 3741 3742 3743 3744 3745 3746 3747 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 3740 def rule_reports pattern(%w( !accountReport )) pattern(%w( !export )) pattern(%w( !resourceReport )) pattern(%w( !taskReport )) pattern(%w( !textReport )) pattern(%w( !traceReport )) end |
#rule_reportStart ⇒ Object
4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4614 def rule_reportStart pattern(%w( _start !date ), lambda { if @val[1] > @property.get('end') error('report_start', "Start date must be before end date #{@property.get('end')}", @sourceFileInfo[1]) end @property.set('start', @val[1]) }) doc('start.report', "Specifies the start date of the report. In task reports only tasks that end\nafter this end date are listed.\n" ) end |
#rule_reportTitle ⇒ Object
4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4634 def rule_reportTitle pattern(%w( _title $STRING ), lambda { @property.set('title', @val[1]) }) doc('title', "The title of the report will be used in external references to the report. It\nwill not show up in the reports directly. It's used e. g. by [[navigator]].\n" ) end |
#rule_resource ⇒ Object
4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4645 def rule_resource pattern(%w( !resourceHeader !resourceBody ), lambda { @property = @property.parent }) doc('resource', "Tasks that have an effort specification need to have at least one resource\nassigned to do the work. Use this property to define resources or groups of\nresources.\n\nResources have a global name space. All IDs must be unique within the resources\nof the project.\n" ) end |
#rule_resourceAttributes ⇒ Object
4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4660 def rule_resourceAttributes repeatable optional pattern(%w( _email $STRING ), lambda { @property.set('email', @val[1]) }) doc('email', 'The email address of the resource.') pattern(%w( !journalEntry )) pattern(%w( !purge )) pattern(%w( !resource )) pattern(%w( !resourceScenarioAttributes )) pattern(%w( !scenarioIdCol !resourceScenarioAttributes ), lambda { @scenarioIdx = 0 }) pattern(%w( _supplement !resourceId !resourceBody ), lambda { @property = @idStack.pop }) doc('supplement.resource', "The supplement keyword provides a mechanism to add more attributes to already\ndefined resources. The additional attributes must obey the same rules as in\nregular resource definitions and must be enclosed by curly braces.\n\nThis construct is primarily meant for situations where the information about a\nresource is split over several files. E. g. the vacation dates for the\nresources may be in a separate file that was generated by some other tool.\n" ) example('Supplement', 'resource') # Other attributes will be added automatically. end |
#rule_resourceBody ⇒ Object
4695 4696 4697 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4695 def rule_resourceBody ('resourceAttributes') end |
#rule_resourceBooking ⇒ Object
4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4699 def rule_resourceBooking pattern(%w( !resourceBookingHeader !bookingBody ), lambda { unless @project.scenario(@scenarioIdx).get('ownbookings') error('no_own_resource_booking', "The scenario #{@project.scenario(@scenarioIdx).fullId} " + 'inherits its bookings from the tracking ' + 'scenario. You cannot specificy additional bookings for it.') end @val[0].task.addBooking(@scenarioIdx, @val[0]) }) end |
#rule_resourceBookingHeader ⇒ Object
4711 4712 4713 4714 4715 4716 4717 4718 4719 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4711 def rule_resourceBookingHeader pattern(%w( !taskId !valIntervals ), lambda { checkBooking(@val[0], @property) @booking = Booking.new(@property, @val[0], @val[1]) @booking.sourceFileInfo = @sourceFileInfo[0] @booking }) arg(0, 'id', 'Absolute ID of a defined task') end |
#rule_resourceHeader ⇒ Object
4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4733 def rule_resourceHeader pattern(%w( _resource !optionalID $STRING ), lambda { if @property.nil? && !@resourceprefix.empty? @property = @project.resource(@resourceprefix) end if @val[1] && @project.resource(@val[1]) error('resource_exists', "Resource #{@val[1]} has already been defined.", @sourceFileInfo[1], @property) end @property = Resource.new(@project, @val[1], @val[2], @property) @property.sourceFileInfo = @sourceFileInfo[0] @property.inheritAttributes @scenarioIdx = 0 }) # arg(1, 'id', <<'EOT' #The ID of the resource. Resources have a global name space. The ID must be #unique within the whole project. #EOT # ) arg(2, 'name', 'The name of the resource') end |
#rule_resourceId ⇒ Object
4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4721 def rule_resourceId pattern(%w( $ID ), lambda { id = (@resourceprefix.empty? ? '' : @resourceprefix + '.') + @val[0] if (resource = @project.resource(id)).nil? error('resource_id_expected', "#{id} is not a defined resource.", @sourceFileInfo[0]) end resource }) arg(0, 'resource', 'The ID of a defined resource') end |
#rule_resourceLeafList ⇒ Object
4756 4757 4758 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4756 def rule_resourceLeafList listRule('moreResourceLeafList', '!leafResourceId') end |
#rule_resourceList ⇒ Object
4760 4761 4762 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4760 def rule_resourceList listRule('moreResources', '!resourceId') end |
#rule_resourceReport ⇒ Object
4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4764 def rule_resourceReport pattern(%w( !resourceReportHeader !reportBody ), lambda { @property = @property.parent }) doc('resourcereport', "The report lists resources and their respective values in a table. The task\nthat are the resources are allocated to can be listed as well. To reduce the\nlist of included resources, you can use the [[hideresource]],\n[[rollupresource]] or [[resourceroot]] attributes. The order of the task can\nbe controlled with [[sortresources]]. If the first sorting criteria is tree\nsorting, the parent resources will always be included to form the tree.\nTree sorting is the default. You need to change it if you do not want certain\nparent resources to be included in the report.\n\nBy default, all the tasks that the resources are allocated to are hidden, but\nthey can be listed as well. Use the [[hidetask]] attribute to select which\ntasks should be included.\n" ) end |
#rule_resourceReportHeader ⇒ Object
4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4785 def rule_resourceReportHeader pattern(%w( _resourcereport !optionalID !reportName ), lambda { newReport(@val[1], @val[2], :resourcereport, @sourceFileInfo[0]) do unless @property.modified?('columns') # Set the default columns for this report. %w( no name ).each do |col| @property.get('columns') << TableColumnDefinition.new(col, columnTitle(col)) end end # Show all resources, sorted by tree and id-up. unless @property.modified?('hideResource') @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortResources') @property.set('sortResources', [ [ 'tree', true, -1 ], [ 'id', true, -1 ] ]) end # Hide all resources, but set sorting to tree, start-up, seqno-up. unless @property.modified?('hideTask') @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(1))) end unless @property.modified?('sortTasks') @property.set('sortTasks', [ [ 'tree', true, -1 ], [ 'start', true, 0 ], [ 'seqno', true, -1 ] ]) end end }) end |
#rule_resourceScenarioAttributes ⇒ Object
4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4819 def rule_resourceScenarioAttributes pattern(%w( !chargeset )) pattern(%w( _efficiency !number ), lambda { @property['efficiency', @scenarioIdx] = @val[1] }) doc('efficiency', "The efficiency of a resource can be used for two purposes. First you can use\nit as a crude way to model a team. A team of 5 people should have an\nefficiency of 5.0. Keep in mind that you cannot track the members of the team\nindividually if you use this feature. They always act as a group.\n\nThe other use is to model performance variations between your resources. Again, this is a fairly crude mechanism and should be used with care. A resource that isn't every good at some task might be pretty good at another. This can't be taken into account as the resource efficiency can only set globally for all tasks.\n\nAll resources that do not contribute effort to the task, should have an\nefficiency of 0.0. A typical example would be a conference room. It's necessary for a meeting, but it does not contribute any work.\n" ) example('Efficiency') pattern(%w( !flags )) doc('flags.resource', "Attach a set of flags. The flags can be used in logical expressions to filter\nproperties from the reports.\n" ) pattern(%w( _booking !resourceBooking )) doc('booking.resource', "The booking attribute can be used to report actually completed work. A task\nwith bookings must be [[scheduling|scheduled]] in ''''asap'''' mode. If the\nscenario is not the [[trackingscenario|tracking scenario]] or derived from it,\nthe scheduler will not allocate resources prior to the current date or the\ndate specified with [[now]] when a task has at least one booking.\n\nBookings are only valid in the scenario they have been defined in. They will\nin general not be passed to any other scenario. If you have defined a\n[[trackingscenario|tracking scenario]], the bookings of this scenario will be\npassed to all the derived scenarios of the tracking scenario.\n\nThe sloppy attribute can be used when you want to skip non-working time or\nother allocations automatically. If it's not given, all bookings must only\ncover working time for the resource.\n\nThe booking attributes is designed to capture the exact amount of completed\nwork. This attribute is not really intended to specify completed effort by\nhand. Usually, booking statements are generated by [[export]] reports. The\n[[sloppy.booking|sloppy]] and [[overtime.booking|overtime]] attributes are\nonly kludge for users who want to write them manually.\nBookings can be used to report already completed work by specifying the exact\ntime intervals a certain resource has worked on this task.\n\nBookings can be defined in the task or resource context. If you move tasks\naround very often, put your bookings in the task context.\n" ) also(%w( scheduling booking.task )) example('Booking') pattern(%w( !fail )) pattern(%w( !leaveAllowances )) pattern(%w( !leaves ), lambda { @property['leaves', @scenarioIdx] += @val[0] }) pattern(%w( !limits ), lambda { @property['limits', @scenarioIdx] = @val[0] }) doc('limits.resource', "Set per-interval usage limits for the resource.\n" ) example('Limits-1', '6') pattern(%w( _managers !resourceList ), lambda { @property['managers', @scenarioIdx] = @property['managers', @scenarioIdx] + @val[1] }) doc('managers', "Defines one or more resources to be the manager who is responsible for this\nresource. Managers must be leaf resources. This attribute does not impact the\nscheduling. It can only be used for documentation purposes.\n\nYou must only specify direct managers here. Do not list higher level managers\nhere. If necessary, use the [[purge]] attribute to clear\ninherited managers. For most use cases, there should be only one manager. But\nTaskJuggler is not limited to just one manager. Dotted reporting lines can be\ncaptured as well as long as the managers are not reporting to each other.\n" ) also(%w( statussheet )) example('Manager') pattern(%w( _rate !number ), lambda { @property['rate', @scenarioIdx] = @val[1] }) doc('rate.resource', "The rate specifies the daily cost of the resource.\n" ) pattern(%w( !resourceShiftAssignments !shiftAssignments ), lambda { checkContainer('shifts') # Set same value again to set the 'provided' state for the attribute. begin @property['shifts', @scenarioIdx] = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) level(:deprecated) also('shift.resource') doc('shift.resource', "This keyword has been deprecated. Please use [[shifts.resource|shifts\n(resource)]] instead.\n" ) pattern(%w( !resourceShiftsAssignments !shiftAssignments ), lambda { checkContainer('shifts') # Set same value again to set the 'provided' state for the attribute. begin @property['shifts', @scenarioIdx] = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) doc('shifts.resource', "Limits the working time of a resource to a defined shift during the specified\ninterval. Multiple shifts can be defined, but shift intervals may not overlap.\nIn case a shift is defined for a certain interval, the shift working hours\nreplace the standard resource working hours for this interval.\n" ) pattern(%w( _vacation !vacationName !intervals ), lambda { @val[2].each do |interval| # We map the old 'vacation' attribute to public holidays. @property['leaves', @scenarioIdx] += [ Leave.new(:holiday, interval) ] end }) doc('vacation.resource', "Specify a vacation period for the resource. It can also be used to block out\nthe time before a resource joined or after it left. For employees changing\ntheir work schedule from full-time to part-time, or vice versa, please refer\nto the 'Shift' property.\n" ) pattern(%w( !warn )) pattern(%w( !workinghoursResource )) # Other attributes will be added automatically. end |
#rule_resourceShiftAssignments ⇒ Object
4980 4981 4982 4983 4984 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4980 def rule_resourceShiftAssignments pattern(%w( _shift ), lambda { @shiftAssignments = @property['shifts', @scenarioIdx] }) end |
#rule_resourceShiftsAssignments ⇒ Object
4986 4987 4988 4989 4990 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4986 def rule_resourceShiftsAssignments pattern(%w( _shifts ), lambda { @shiftAssignments = @property['shifts', @scenarioIdx] }) end |
#rule_rollupaccount ⇒ Object
4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 4992 def rule_rollupaccount pattern(%w( _rollupaccount !logicalExpression ), lambda { @property.set('rollupAccount', @val[1]) }) doc('rollupaccount', "Do not show sub-accounts of accounts that match the specified\n[[logicalexpression|logical expression]].\n" ) end |
#rule_rollupresource ⇒ Object
5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5003 def rule_rollupresource pattern(%w( _rollupresource !logicalExpression ), lambda { @property.set('rollupResource', @val[1]) }) doc('rollupresource', "Do not show sub-resources of resources that match the specified\n[[logicalexpression|logical expression]].\n" ) example('RollupResource') end |
#rule_rolluptask ⇒ Object
5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5015 def rule_rolluptask pattern(%w( _rolluptask !logicalExpression ), lambda { @property.set('rollupTask', @val[1]) }) doc('rolluptask', "Do not show sub-tasks of tasks that match the specified\n[[logicalexpression|logical expression]].\n" ) end |
#rule_scenario ⇒ Object
5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5027 def rule_scenario pattern(%w( !scenarioHeader !scenarioBody ), lambda { @property = @property.parent }) doc('scenario', "Defines a new project scenario. By default, the project has only one scenario\ncalled ''''plan''''. To do plan vs. actual comparisons or to do a\nwhat-if-analysis, you can define a set of scenarios. There can only be one\ntop-level scenario. Additional scenarios are either derived from this\ntop-level scenario or other scenarios.\n\nEach nested scenario is a variation of the enclosing scenario. All scenarios\nshare the same set of properties (task, resources, etc.) but the attributes\nthat are listed as scenario specific may differ between the various\nscenarios. A nested scenario uses all attributes from the enclosing scenario\nunless the user has specified a different value for this attribute.\n\nBy default, the scheduler assigns resources to task beginning with the project\nstart date. If the scenario is switched to projection mode, no assignments\nwill be made prior to the current date or the date specified by [[now]]. In\nthis case, TaskJuggler assumes, that all assignements prior to the\ncurrent date have been provided by [[booking.task]] statements.\n" ) end |
#rule_scenarioAttributes ⇒ Object
5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5053 def rule_scenarioAttributes optional repeatable pattern(%w( _active !yesNo), lambda { @property.set('active', @val[1]) }) doc('active', "Enable the scenario to be scheduled or not. By default, all scenarios will be\nscheduled. If a scenario is marked as inactive, it not be scheduled and will\nbe ignored in the reports.\n" ) pattern(%w( _disabled ), lambda { @property.set('active', false) }) level(:deprecated) also('active') doc('disabled', "This attribute is deprecated. Please use [active] instead.\n\nDisable the scenario for scheduling. The default for the top-level\nscenario is to be enabled.\n" ) example('Scenario') pattern(%w( _enabled ), lambda { @property.set('active', true) }) level(:deprecated) also('active') doc('enabled', "This attribute is deprecated. Please use [active] instead.\n\nEnable the scenario for scheduling. This is the default for the top-level\nscenario.\n" ) pattern(%w( _projection !projection )) level(:deprecated) also('booking.task') doc('projection', "This keyword has been deprecated! Don't use it anymore!\n\nProjection mode is now automatically enabled as soon as a scenario has\nbookings.\n" ) pattern(%w( !scenario )) end |
#rule_scenarioBody ⇒ Object
5106 5107 5108 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5106 def rule_scenarioBody ('scenarioAttributes') end |
#rule_scenarioHeader ⇒ Object
5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5110 def rule_scenarioHeader pattern(%w( _scenario $ID $STRING ), lambda { # If this is the top-level scenario, we must delete the default scenario # first. @project.scenarios.each do |scenario| if scenario.get('projection') error('scenario_after_tracking', 'Scenarios must be defined before a tracking scenario is set.') end end @project.scenarios.clearProperties if @property.nil? if @project.scenario(@val[1]) error('scenario_exists', "Scenario #{@val[1]} has already been defined.", @sourceFileInfo[1]) end @property = Scenario.new(@project, @val[1], @val[2], @property) @property.inheritAttributes if @project.scenarios.length > 1 MessageHandlerInstance.instance.hideScenario = false end }) arg(1, 'id', 'The ID of the scenario') arg(2, 'name', 'The name of the scenario') end |
#rule_scenarioId ⇒ Object
5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5138 def rule_scenarioId pattern(%w( $ID ), lambda { if (@scenarioIdx = @project.scenarioIdx(@val[0])).nil? error('unknown_scenario_id', "Unknown scenario: #{@val[0]}", @sourceFileInfo[0]) end @scenarioIdx }) arg(0, 'scenario', 'ID of a defined scenario') end |
#rule_scenarioIdCol ⇒ Object
5149 5150 5151 5152 5153 5154 5155 5156 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5149 def rule_scenarioIdCol pattern(%w( $ID_WITH_COLON ), lambda { if (@scenarioIdx = @project.scenarioIdx(@val[0])).nil? error('unknown_scenario_id', "Unknown scenario: #{@val[0]}", @sourceFileInfo[0]) end }) end |
#rule_scenarioIdList ⇒ Object
5158 5159 5160 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5158 def rule_scenarioIdList listRule('moreScnarioIdList', '!scenarioIdx') end |
#rule_scenarioIdx ⇒ Object
5162 5163 5164 5165 5166 5167 5168 5169 5170 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5162 def rule_scenarioIdx pattern(%w( $ID ), lambda { if (scenarioIdx = @project.scenarioIdx(@val[0])).nil? error('unknown_scenario_idx', "Unknown scenario #{@val[0]}", @sourceFileInfo[0]) end scenarioIdx }) end |
#rule_schedulingDirection ⇒ Object
5172 5173 5174 5175 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5172 def rule_schedulingDirection singlePattern('_alap') singlePattern('_asap') end |
#rule_shift ⇒ Object
5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5177 def rule_shift pattern(%w( !shiftHeader !shiftBody ), lambda { @property = @property.parent }) doc('shift', "A shift combines several workhours related settings in a reusable entity.\nBesides the weekly working hours it can also hold information such as leaves\nand a time zone. It lets you create a work time calendar that can be used to\nlimit the working time for resources or tasks.\n\nShifts have a global name space. All IDs must be unique within the shifts of\nthe project.\n" ) also(%w( shifts.task shifts.resource )) end |
#rule_shiftAssignment ⇒ Object
5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5194 def rule_shiftAssignment pattern(%w( !shiftId !intervalOptional ), lambda { # Make sure we have a ShiftAssignment for the property. unless @shiftAssignments @shiftAssignments = ShiftAssignments.new @shiftAssignments.project = @project end if @val[1].nil? interval = TimeInterval.new(@project['start'], @project['end']) else interval = @val[1] end if !@shiftAssignments.addAssignment( ShiftAssignment.new(@val[0].scenario(@scenarioIdx), interval)) error('shift_assignment_overlap', 'Shifts may not overlap each other.', @sourceFileInfo[0], @property) end @shiftAssignments.assignments.last }) end |
#rule_shiftAssignments ⇒ Object
5217 5218 5219 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5217 def rule_shiftAssignments listRule('moreShiftAssignments', '!shiftAssignment') end |
#rule_shiftAttributes ⇒ Object
5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5221 def rule_shiftAttributes optional repeatable pattern(%w( !shift )) pattern(%w( !shiftScenarioAttributes )) pattern(%w( !scenarioIdCol !shiftScenarioAttributes ), lambda { @scenarioIdx = 0 }) end |
#rule_shiftBody ⇒ Object
5232 5233 5234 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5232 def rule_shiftBody ('shiftAttributes') end |
#rule_shiftHeader ⇒ Object
5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5236 def rule_shiftHeader pattern(%w( _shift !optionalID $STRING ), lambda { if @val[1] && @project.shift(@val[1]) error('shift_exists', "Shift #{@val[1]} has already been defined.", @sourceFileInfo[1]) end @property = Shift.new(@project, @val[1], @val[2], @property) @property.sourceFileInfo = @sourceFileInfo[0] @property.inheritAttributes @scenarioIdx = 0 }) arg(2, 'name', 'The name of the shift') end |
#rule_shiftId ⇒ Object
5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5250 def rule_shiftId pattern(%w( $ID ), lambda { if (shift = @project.shift(@val[0])).nil? error('shift_id_expected', "#{@val[0]} is not a defined shift.", @sourceFileInfo[0]) end shift }) arg(0, 'shift', 'The ID of a defined shift') end |
#rule_shiftScenarioAttributes ⇒ Object
5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5261 def rule_shiftScenarioAttributes pattern(%w( !leaves ), lambda { @property['leaves', @scenarioIdx] += @val[0] }) pattern(%w( _replace ), lambda { @property['replace', @scenarioIdx] = true }) doc('replace', "This replace mode is only effective for shifts that are assigned to resources\ndirectly. When replace mode is activated the leave definitions of the shift\nwill replace all the leave definitions of the resource for the given period.\n\nThe mode is not effective for shifts that are assigned to tasks or allocations.\n" ) pattern(%w( _timezone !validTimeZone ), lambda { @property['timezone', @scenarioIdx] = @val[1] }) doc('timezone.shift', "Sets the time zone of the shift. The working hours of the shift are assumed to\nbe within the specified time zone. The time zone does not effect the vaction\ninterval. The latter is assumed to be within the project time zone.\n\nTaskJuggler stores all dates internally as UTC. Since all events must align\nwith the [[timingresolution|timing resolution]] for time zones you may have to\nchange the timing resolution appropriately. The time zone difference compared\nto UTC must be a multiple of the used timing resolution.\n" ) arg(1, 'zone', "Time zone to use. E. g. 'Europe/Berlin' or 'America/Denver'. Don't use the 3\nletter acronyms. See\n[http://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones Wikipedia] for\npossible values.\n" ) pattern(%w( _vacation !vacationName !intervalsOptional ), lambda { @val[2].each do |interval| # We map the old 'vacation' attribute to public holidays. @property['leaves', @scenarioIdx] += [ Leave.new(:holiday, interval) ] end }) doc('vacation.shift', "Specify a vacation period associated with this shift.\n" ) pattern(%w( !workinghoursShift )) end |
#rule_sortAccounts ⇒ Object
5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5399 def rule_sortAccounts pattern(%w( _sortaccounts !sortCriteria ), lambda { @property.set('sortAccounts', @val[1]) }) doc('sortaccounts', "Determines how the accounts are sorted in the report. Multiple criteria can be\nspecified as a comma separated list. If one criteria is not sufficient to sort\na group of accounts, the next criteria will be used to sort the accounts in\nthis group.\n" ) end |
#rule_sortCriteria ⇒ Object
5314 5315 5316 5317 5318 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5314 def rule_sortCriteria pattern([ "!sortCriterium", "!moreSortCriteria" ], lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_sortCriterium ⇒ Object
5320 5321 5322 5323 5324 5325 5326 5327 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5320 def rule_sortCriterium pattern(%w( !sortTree ), lambda { @val[0] }) pattern(%w( !sortNonTree ), lambda { @val[0] }) end |
#rule_sortJournalEntries ⇒ Object
5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5374 def rule_sortJournalEntries pattern(%w( _sortjournalentries !journalSortCriteria ), lambda { @property.set('sortJournalEntries', @val[1]) }) doc('sortjournalentries', "Determines how the entries in a journal are sorted. Multiple criteria can be\nspecified as a comma separated list. If one criteria is not sufficient to sort\na group of journal entries, the next criteria will be used to sort the entries\nin this group.\n\nThe following values are supported:\n* ''''date.down'''': Sort descending order by the date of the journal entry\n* ''''date.up'''': Sort ascending order by the date of the journal entry\n* ''''alert.down'''': Sort in descending order by the alert level of the\njournal entry\n* ''''alert.up'''': Sort in ascending order by the alert level of the\njournal entry\n ''''property.down'''': Sort in descending order by the task or resource\nthe journal entry is associated with\n* ''''property.up'''': Sort in ascending order by the task or resource the\njournal entry is associated with\n" ) end |
#rule_sortNonTree ⇒ Object
5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5329 def rule_sortNonTree pattern(%w( $ABSOLUTE_ID ), lambda { args = @val[0].split('.') case args.length when 2 # <attribute>.<up|down> scenario = -1 direction = args[1] == 'up' attribute = args[0] when 3 # <scenario>.<attribute>.<up|down> if (scenario = @project.scenarioIdx(args[0])).nil? error('sort_unknown_scen', "Unknown scenario #{args[0]} in sorting criterium", @sourceFileInfo[0]) end attribute = args[1] if args[2] != 'up' && args[2] != 'down' error('sort_direction', "Sorting direction must be 'up' or 'down'", @sourceFileInfo[0]) end direction = args[2] == 'up' else error('sorting_crit_exptd1', "Sorting criterium expected (e.g. tree, start.up or " + "plan.end.down).", @sourceFileInfo[0]) end if attribute == 'bsi' error('sorting_bsi', "Sorting by bsi is not supported. Please use 'tree' " + '(without appended .up or .down) instead.', @sourceFileInfo[0]) end [ attribute, direction, scenario ] }) arg(0, 'criteria', "The sorting criteria must consist of a property attribute ID. See [[columnid]]\nfor a complete list of available attributes. The ID must be suffixed by '.up'\nor '.down' to determine the sorting direction. Optionally the ID may be\nprefixed with a scenario ID and a dot to determine the scenario that should be\nused for sorting. So, possible values are 'plan.start.up' or 'priority.down'.\n" ) end |
#rule_sortResources ⇒ Object
5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5412 def rule_sortResources pattern(%w( _sortresources !sortCriteria ), lambda { @property.set('sortResources', @val[1]) }) doc('sortresources', "Determines how the resources are sorted in the report. Multiple criteria can be\nspecified as a comma separated list. If one criteria is not sufficient to sort\na group of resources, the next criteria will be used to sort the resources in\nthis group.\n" ) end |
#rule_sortTasks ⇒ Object
5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5425 def rule_sortTasks pattern(%w( _sorttasks !sortCriteria ), lambda { @property.set('sortTasks', @val[1]) }) doc('sorttasks', "Determines how the tasks are sorted in the report. Multiple criteria can be\nspecified as comma separated list. If one criteria is not sufficient to sort a\ngroup of tasks, the next criteria will be used to sort the tasks within\nthis group.\n" ) end |
#rule_sortTree ⇒ Object
5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5438 def rule_sortTree pattern(%w( $ID ), lambda { if @val[0] != 'tree' error('sorting_crit_exptd2', "Sorting criterium expected (e.g. tree, start.up or " + "plan.end.down).", @sourceFileInfo[0]) end [ 'tree', true, -1 ] }) arg(0, 'tree', 'Use \'tree\' as first criteria to keep the breakdown structure.') end |
#rule_ssReportAttributes ⇒ Object
5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5477 def rule_ssReportAttributes optional repeatable pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( !reportEnd )) pattern(%w( !reportPeriod )) pattern(%w( !reportStart )) pattern(%w( !sortResources )) pattern(%w( !sortTasks )) end |
#rule_ssReportBody ⇒ Object
5490 5491 5492 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5490 def rule_ssReportBody ('ssReportAttributes') end |
#rule_ssReportHeader ⇒ Object
5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5450 def rule_ssReportHeader pattern(%w( _statussheetreport !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :statusSheet, @sourceFileInfo[0]) do @property.set('formats', [ :tjp ]) unless (@project['trackingScenarioIdx']) error('ss_no_tracking_scenario', 'You must have a tracking scenario defined to use status sheets.') end # Show all tasks, sorted by id-up. @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortTasks', [ [ 'id', true, -1 ] ]) # Show all resources, sorted by seqno-up. @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortResources', [ [ 'seqno', true, -1 ] ]) @property.set('loadUnit', :hours) @property.set('definitions', []) end }) arg(2, 'file name', "The name of the status sheet report file to generate. It must end with a .tji\nextension, or use . to use the standard output channel.\n" ) end |
#rule_ssStatus ⇒ Object
5533 5534 5535 5536 5537 5538 5539 5540 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5533 def rule_ssStatus pattern(%w( !ssStatusHeader !ssStatusBody )) doc('status.statussheet', "The status attribute can be used to describe the current status of the task or\nresource. The content of the status messages is added to the project journal.\n" ) end |
#rule_ssStatusAttributes ⇒ Object
5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5494 def rule_ssStatusAttributes optional repeatable pattern(%w( !author )) pattern(%w( !details )) pattern(%w( _flags !flagList ), lambda { @val[1].each do |flag| next if @journalEntry.flags.include?(flag) @journalEntry.flags << flag end }) doc('flags.statussheet', "Status sheet entries can have flags attached to them. These can be used to\ninclude only entries in a report that have a certain flag.\n" ) pattern(%w( !summary )) end |
#rule_ssStatusBody ⇒ Object
5517 5518 5519 5520 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5517 def rule_ssStatusBody optional pattern(%w( _{ !ssStatusAttributes _} )) end |
#rule_ssStatusHeader ⇒ Object
5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5522 def rule_ssStatusHeader pattern(%w( _status !alertLevel $STRING ), lambda { @journalEntry = JournalEntry.new(@project['journal'], @sheetEnd, @val[2], @property, @sourceFileInfo[0]) @journalEntry.alertLevel = @val[1] @journalEntry. = @sheetAuthor @journalEntry.moderators << @sheetModerator }) end |
#rule_statusSheet ⇒ Object
5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5542 def rule_statusSheet pattern(%w( !statusSheetHeader !statusSheetBody ), lambda { [ @sheetAuthor, @sheetStart, @sheetEnd ] }) doc('statussheet', "A status sheet can be used to capture the status of various tasks outside of\nthe regular task tree definition. It is intended for use by managers that\ndon't directly work with the full project plan, but need to report the current\nstatus of each task or task-tree that they are responsible for.\n" ) example('StatusSheet') end |
#rule_statusSheetAttributes ⇒ Object
5556 5557 5558 5559 5560 5561 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5556 def rule_statusSheetAttributes optional repeatable pattern(%w( !statusSheetTask )) end |
#rule_statusSheetBody ⇒ Object
5563 5564 5565 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5563 def rule_statusSheetBody ('statusSheetAttributes') end |
#rule_statusSheetFile ⇒ Object
5567 5568 5569 5570 5571 5572 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5567 def rule_statusSheetFile pattern(%w( !statusSheet . ), lambda { @val[0] }) lastSyntaxToken(1) end |
#rule_statusSheetHeader ⇒ Object
5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5575 def rule_statusSheetHeader pattern(%w( _statussheet !resourceId !valIntervalOrDate ), lambda { unless @project['trackingScenarioIdx'] error('ss_no_tracking_scenario', 'No trackingscenario defined.') end @sheetAuthor = @val[1] @sheetModerator = @val[1] @sheetStart = @val[2].start @sheetEnd = @val[2].end # Make sure that we don't have any status sheet entries from the same # author for the same report period. There may have been a previous # submission of the same report and this is an update to it. All old # entries must be removed before we process the sheet. @project['journal'].delete_if do |e| # Journal entries from status sheets have the sheet end date as entry # date. e.moderators.include?(@sheetModerator) && e.date == @sheetEnd end }) arg(1, 'reporter', "The ID of a defined resource. This identifies the status reporter. Unless the\nstatus entries provide a different author, the sheet author will be used as\nstatus entry author.\n" ) end |
#rule_statusSheetReport ⇒ Object
5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5603 def rule_statusSheetReport pattern(%w( !ssReportHeader !ssReportBody ), lambda { @property = nil }) doc('statussheetreport', "A status sheet report is a template for a status sheet. It collects all the\nstatus information of the top-level task that a resource is responsible for.\nThis report is typically used by managers or team leads to review the time\nsheet status information and destill it down to a summary that can be\nforwarded to the next person in the reporting chain. The report will be for\nthe specified [trackingscenario].\n" ) end |
#rule_statusSheetTask ⇒ Object
5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5618 def rule_statusSheetTask pattern(%w( !statusSheetTaskHeader !statusSheetTaskBody), lambda { @property = @propertyStack.pop }) doc('task.statussheet', "Opens the task with the specified ID to add a status report. Child task can be\nopened inside this context by specifying their relative ID to this parent.\n" ) end |
#rule_statusSheetTaskAttributes ⇒ Object
5629 5630 5631 5632 5633 5634 5635 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5629 def rule_statusSheetTaskAttributes optional repeatable pattern(%w( !ssStatus )) pattern(%w( !statusSheetTask ), lambda { }) end |
#rule_statusSheetTaskBody ⇒ Object
5637 5638 5639 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5637 def rule_statusSheetTaskBody ('statusSheetTaskAttributes') end |
#rule_statusSheetTaskHeader ⇒ Object
5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5641 def rule_statusSheetTaskHeader pattern(%w( _task !taskId ), lambda { if @property @propertyStack.push(@property) else @propertyStack = [] end @property = @val[1] }) end |
#rule_subNodeId ⇒ Object
5652 5653 5654 5655 5656 5657 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5652 def rule_subNodeId optional pattern(%w( _: !idOrAbsoluteId ), lambda { @val[1] }) end |
#rule_summary ⇒ Object
5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5659 def rule_summary pattern(%w( _summary $STRING ), lambda { return if @val[1].empty? if @val[1].length > 480 error('ts_summary_too_long', "The summary text must be 480 characters long or shorter. " + "This text has #{@val[1].length} characters.", @sourceFileInfo[1]) end if @val[1] == "A summary text\n" error('ts_default_summary', "'A summary text' is not a valid summary", @sourceFileInfo[1]) end rtTokenSetIntro = [ :LINEBREAK, :SPACE, :WORD, :BOLD, :ITALIC, :CODE, :BOLDITALIC, :HREF, :HREFEND ] @journalEntry.summary = newRichText(@val[1], @sourceFileInfo[1], rtTokenSetIntro) }) doc('summary', "This is the introductory part of the journal or status entry. It should\nonly summarize the full entry but should contain more details than the\nheadline. The text including formatting characters must be 240 characters long\nor less.\n" ) arg(1, 'text', "The text will be interpreted as [[Rich_Text_Attributes|Rich Text]]. Only a\nsmall subset of the markup is supported for this attribute. You can use word\nformatting, hyperlinks and paragraphs.\n" ) end |
#rule_supplement ⇒ Object
5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5695 def rule_supplement pattern(%w( !supplementAccount !accountBody ), lambda { @property = @idStack.pop }) pattern(%w( !supplementReport !reportBody ), lambda { @property = @idStack.pop }) pattern(%w( !supplementResource !resourceBody ), lambda { @property = @idStack.pop }) pattern(%w( !supplementTask !taskBody ), lambda { @property = @idStack.pop }) end |
#rule_supplementAccount ⇒ Object
5710 5711 5712 5713 5714 5715 5716 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5710 def rule_supplementAccount pattern(%w( _account !accountId ), lambda { @idStack.push(@property) @property = @val[1] }) arg(1, 'account ID', 'The ID of an already defined account.') end |
#rule_supplementReport ⇒ Object
5718 5719 5720 5721 5722 5723 5724 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5718 def rule_supplementReport pattern(%w( _report !reportId ), lambda { @idStack.push(@property) @property = @val[1] }) arg(1, 'report ID', 'The absolute ID of an already defined report.') end |
#rule_supplementResource ⇒ Object
5726 5727 5728 5729 5730 5731 5732 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5726 def rule_supplementResource pattern(%w( _resource !resourceId ), lambda { @idStack.push(@property) @property = @val[1] }) arg(1, 'resource ID', 'The ID of an already defined resource.') end |
#rule_supplementTask ⇒ Object
5734 5735 5736 5737 5738 5739 5740 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5734 def rule_supplementTask pattern(%w( _task !taskId ), lambda { @idStack.push(@property) @property = @val[1] }) arg(1, 'task ID', 'The absolute ID of an already defined task.') end |
#rule_tagfile ⇒ Object
5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5742 def rule_tagfile pattern(%w( !tagfileHeader !tagfileBody ), lambda { @property = nil }) doc('tagfile', "The tagfile report generates a file that maps properties to source file\nlocations. This can be used by editors to quickly jump to a certain task or\nresource definition. Currently only the ctags format is supported that is used\nby editors like [http://www.vim.org|vim].\n" ) end |
#rule_tagfileAttributes ⇒ Object
5776 5777 5778 5779 5780 5781 5782 5783 5784 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5776 def rule_tagfileAttributes optional repeatable pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( !rollupresource )) pattern(%w( !rolluptask )) end |
#rule_tagfileBody ⇒ Object
5786 5787 5788 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5786 def rule_tagfileBody ('tagfileAttributes') end |
#rule_tagfileHeader ⇒ Object
5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5755 def rule_tagfileHeader pattern(%w( _tagfile !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :tagfile, @sourceFileInfo[0]) do @property.set('formats', [ :ctags ]) # Include all tasks. @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortTasks', [ [ 'seqno', true, -1 ] ]) # Include all resources. @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortResources', [ [ 'seqno', true, -1 ] ]) end }) arg(2, 'file name', "The name of the tagfile to generate. Use ''''tags'''' if you want vim and\nother tools to find it automatically.\n" ) end |
#rule_task ⇒ Object
5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5791 def rule_task pattern(%w( !taskHeader !taskBody ), lambda { @property = @property.parent }) doc('task', "Tasks are the central elements of a project plan. Use a task to specify the\nvarious steps and phases of the project. Depending on the attributes of that\ntask, a task can be a container task, a milestone or a regular leaf task. The\nlatter may have resources assigned. By specifying dependencies the user can\nforce a certain sequence of tasks.\n\nTasks have a local name space. All IDs must be unique within the tasks\nthat belong to the same enclosing task.\n" ) end |
#rule_taskAttributes ⇒ Object
5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5808 def rule_taskAttributes repeatable optional pattern(%w( _adopt !taskList ), lambda { @val[1].each do |task| @property.adopt(task) end }) level(:experimental) doc('adopt.task', "Add a previously defined task and its sub-tasks to this task. This can be used\nto create virtual projects that contain task (sub-)trees that are originally\ndefined in another task context. Adopted tasks don't inherit anything from\ntheir step parents. However, the adopting task is scheduled to fit all adopted\nsub-tasks.\n\nA top-level task and all its sub-tasks must never contain the same task more\nthan once. All reports must use appropriate filters by setting [[taskroot]],\n[[hidetask]] or [[rolluptask]] to ensure that no tasks are contained more than\nonce in the report.\n" ) pattern(%w( !journalEntry )) pattern(%w( _note $STRING ), lambda { @property.set('note', newRichText(@val[1], @sourceFileInfo[1])) }) doc('note.task', "Attach a note to the task. This is usually a more detailed specification of\nwhat the task is about.\n" ) pattern(%w( !purge )) pattern(%w( _supplement !supplementTask !taskBody ), lambda { @property = @idStack.pop }) doc('supplement.task', "The supplement keyword provides a mechanism to add more attributes to already\ndefined tasks. The additional attributes must obey the same rules as in\nregular task definitions and must be enclosed by curly braces.\n\nThis construct is primarily meant for situations where the information about a\ntask is split over several files. E. g. the vacation dates for the\nresources may be in a separate file that was generated by some other tool.\n" ) example('Supplement', 'task') pattern(%w( !task )) pattern(%w( !taskScenarioAttributes )) pattern(%w( !scenarioIdCol !taskScenarioAttributes ), lambda { @scenarioIdx = 0 }) # Other attributes will be added automatically. end |
#rule_taskBody ⇒ Object
5868 5869 5870 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5868 def rule_taskBody ('taskAttributes') end |
#rule_taskBooking ⇒ Object
5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5872 def rule_taskBooking pattern(%w( !taskBookingHeader !bookingBody ), lambda { unless @project.scenario(@scenarioIdx).get('ownbookings') error('no_own_task_booking', "The scenario #{@project.scenario(@scenarioIdx).fullId} " + 'inherits its bookings from the tracking ' + 'scenario. You cannot specificy additional bookings for it.') end @val[0].task.addBooking(@scenarioIdx, @val[0]) }) end |
#rule_taskBookingHeader ⇒ Object
5884 5885 5886 5887 5888 5889 5890 5891 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5884 def rule_taskBookingHeader pattern(%w( !resourceId !valIntervals ), lambda { checkBooking(@property, @val[0]) @booking = Booking.new(@val[0], @property, @val[1]) @booking.sourceFileInfo = @sourceFileInfo[0] @booking }) end |
#rule_taskDep ⇒ Object
5893 5894 5895 5896 5897 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5893 def rule_taskDep pattern(%w( !taskDepHeader !taskDepBody ), lambda { @val[0] }) end |
#rule_taskDepAttributes ⇒ Object
5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5899 def rule_taskDepAttributes optional repeatable pattern(%w( _gapduration !intervalDuration ), lambda { @taskDependency.gapDuration = @val[1] }) doc('gapduration', "Specifies the minimum required gap between the end of a preceding task and the\nstart of this task, or the start of a following task and the end of this task.\nThis is calendar time, not working time. 7d means one week.\n" ) pattern(%w( _gaplength !workingDuration ), lambda { @taskDependency.gapLength = @val[1] }) doc('gaplength', "Specifies the minimum required gap between the end of a preceding task and the\nstart of this task, or the start of a following task and the end of this task.\nThis is working time, not calendar time. 7d means 7 working days, not one\nweek. Whether a day is considered a working day or not depends on the defined\nworking hours and global leaves.\n" ) pattern(%w( _onend ), lambda { @taskDependency.onEnd = true }) doc('onend', "The target of the dependency is the end of the task.\n" ) pattern(%w( _onstart ), lambda { @taskDependency.onEnd = false }) doc('onstart', "The target of the dependency is the start of the task.\n" ) end |
#rule_taskDepBody ⇒ Object
5942 5943 5944 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5942 def rule_taskDepBody ('taskDepAttributes') end |
#rule_taskDepHeader ⇒ Object
5946 5947 5948 5949 5950 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5946 def rule_taskDepHeader pattern(%w( !taskDepId ), lambda { @taskDependency = TaskDependency.new(@val[0], true) }) end |
#rule_taskDepId ⇒ Object
5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5952 def rule_taskDepId singlePattern('$ABSOLUTE_ID') arg(0, 'ABSOLUTE ID', "A reference using the full qualified ID of a task. The IDs of all enclosing\nparent tasks must be prepended to the task ID and separated with a dot, e.g.\n''''proj.plan.doc''''.\n" ) singlePattern('$ID') arg(0, 'ID', 'Just the ID of the task without and parent IDs.') pattern(%w( !relativeId ), lambda { task = @property id = @val[0] while task && id[0] == ?! id = id.slice(1, id.length) task = task.parent end error('too_many_bangs', "Too many '!' for relative task in this context.", @sourceFileInfo[0], @property) if id[0] == ?! if task task.fullId + '.' + id else id end }) arg(0, 'RELATIVE ID', "A relative task ID always starts with one or more exclamation marks and is\nfollowed by a task ID. Each exclamation mark lifts the scope where the ID is\nlooked for to the enclosing task. The ID may contain some of the parent IDs\nseparated by dots, e. g. ''''!!plan.doc''''.\n" ) end |
#rule_taskDepList ⇒ Object
5989 5990 5991 5992 5993 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5989 def rule_taskDepList pattern(%w( !taskDep !moreDepTasks ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_taskHeader ⇒ Object
5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 5995 def rule_taskHeader pattern(%w( _task !optionalID $STRING ), lambda { if @property.nil? && !@taskprefix.empty? @property = @project.task(@taskprefix) end if @val[1] id = (@property ? @property.fullId + '.' : '') + @val[1] if @project.task(id) error('task_exists', "Task #{id} has already been defined.", @sourceFileInfo[0]) end end @property = Task.new(@project, @val[1], @val[2], @property) @property['projectid', 0] = @projectId @property.sourceFileInfo = @sourceFileInfo[0] @property.inheritAttributes @scenarioIdx = 0 }) arg(2, 'name', 'The name of the task') end |
#rule_taskId ⇒ Object
6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6016 def rule_taskId pattern(%w( !taskIdUnverifd ), lambda { id = @val[0] if @property && @property.is_a?(Task) # In case we have a nested supplement, we need to prepend the parent ID. id = @property.fullId + '.' + id else id = @taskprefix + '.' + id unless @taskprefix.empty? end if (task = @project.task(id)).nil? error('unknown_task', "Unknown task #{id}", @sourceFileInfo[0]) end task }) end |
#rule_taskIdUnverifd ⇒ Object
6032 6033 6034 6035 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6032 def rule_taskIdUnverifd singlePattern('$ABSOLUTE_ID') singlePattern('$ID') end |
#rule_taskList ⇒ Object
6037 6038 6039 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6037 def rule_taskList listRule('moreTasks', '!absoluteTaskId') end |
#rule_taskPeriod ⇒ Object
6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6041 def rule_taskPeriod pattern(%w( _period !valInterval), lambda { @property['start', @scenarioIdx] = @val[1].start @property['end', @scenarioIdx] = @val[1].end }) doc('period.task', "This property is a shortcut for setting the start and end property at the same\ntime. In contrast to using these, it does not change the scheduling direction.\n" ) end |
#rule_taskPred ⇒ Object
6053 6054 6055 6056 6057 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6053 def rule_taskPred pattern(%w( !taskPredHeader !taskDepBody ), lambda { @val[0] }) end |
#rule_taskPredHeader ⇒ Object
6059 6060 6061 6062 6063 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6059 def rule_taskPredHeader pattern(%w( !taskDepId ), lambda { @taskDependency = TaskDependency.new(@val[0], false) }) end |
#rule_taskPredList ⇒ Object
6065 6066 6067 6068 6069 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6065 def rule_taskPredList pattern(%w( !taskPred !morePredTasks ), lambda { [ @val[0] ] + (@val[1].nil? ? [] : @val[1]) }) end |
#rule_taskReport ⇒ Object
6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6071 def rule_taskReport pattern(%w( !taskReportHeader !reportBody ), lambda { @property = @property.parent }) doc('taskreport', "The report lists tasks and their respective values in a table. To reduce the\nlist of included tasks, you can use the [[hidetask]], [[rolluptask]] or\n[[taskroot]] attributes. The order of the task can be controlled with\n[[sorttasks]]. If the first sorting criteria is tree sorting, the parent tasks\nwill always be included to form the tree. Tree sorting is the default. You\nneed to change it if you do not want certain parent tasks to be included in\nthe report.\n\nBy default, all the resources that are allocated to each task are hidden, but\nthey can be listed as well. Use the [[hideresource]] attribute to select which\nresources should be included.\n" ) example('HtmlTaskReport') end |
#rule_taskReportHeader ⇒ Object
6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6092 def rule_taskReportHeader pattern(%w( _taskreport !optionalID !reportName ), lambda { newReport(@val[1], @val[2], :taskreport, @sourceFileInfo[0]) do unless @property.modified?('columns') # Set the default columns for this report. %w( bsi name start end effort chart ).each do |col| @property.get('columns') << TableColumnDefinition.new(col, columnTitle(col)) end end # Show all tasks, sorted by tree, start-up, seqno-up. unless @property.modified?('hideTask') @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortTasks') @property.set('sortTasks', [ [ 'tree', true, -1 ], [ 'start', true, 0 ], [ 'seqno', true, -1 ] ]) end # Show no resources, but set sorting to id-up. unless @property.modified?('hideResource') @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(1))) end unless @property.modified?('sortResources') @property.set('sortResources', [ [ 'id', true, -1 ] ]) end end }) end |
#rule_taskScenarioAttributes ⇒ Object
6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6125 def rule_taskScenarioAttributes pattern(%w( _account $ID )) level(:removed) also('chargeset') doc('account.task', '') pattern(%w( !allocate )) pattern(%w( _booking !taskBooking )) doc('booking.task', "The booking attribute can be used to report actually completed work. A task\nwith bookings must be [[scheduling|scheduled]] in ''''asap'''' mode. If the\nscenario is not the [[trackingscenario|tracking scenario]] or derived from it,\nthe scheduler will not allocate resources prior to the current date or the\ndate specified with [[now]] when a task has at least one booking.\n\nBookings are only valid in the scenario they have been defined in. They will\nin general not be passed to any other scenario. If you have defined a\n[[trackingscenario|tracking scenario]], the bookings of this scenario will be\npassed to all the derived scenarios of the tracking scenario.\n\nThe sloppy attribute can be used when you want to skip non-working time or\nother allocations automatically. If it's not given, all bookings must only\ncover working time for the resource.\n\nThe booking attributes is designed to capture the exact amount of completed\nwork. This attribute is not really intended to specify completed effort by\nhand. Usually, booking statements are generated by [[export]] reports. The\n[[sloppy.booking|sloppy]] and [[overtime.booking|overtime]] attributes are\nonly kludge for users who want to write them manually.\nBookings can be used to report already completed work by specifying the exact\ntime intervals a certain resource has worked on this task.\n\nBookings can be defined in the task or resource context. If you move tasks\naround very often, put your bookings in the task context.\n" ) also(%w( booking.resource )) example('Booking') pattern(%w( _charge !number !chargeMode ), lambda { checkContainer('charge') if @property['chargeset', @scenarioIdx].empty? error('task_without_chargeset', 'The task does not have a chargeset defined.', @sourceFileInfo[0], @property) end case @val[2] when 'onstart' mode = :onStart amount = @val[1] when 'onend' mode = :onEnd amount = @val[1] when 'perhour' mode = :perDiem amount = @val[1] * 24 when 'perday' mode = :perDiem amount = @val[1] when 'perweek' mode = :perDiem amount = @val[1] / 7.0 end @property['charge', @scenarioIdx] += [ Charge.new(amount, mode, @property, @scenarioIdx) ] }) doc('charge', "Specify a one-time or per-period charge to a certain account. The charge can\noccur at the start of the task, at the end of it, or continuously over the\nduration of the task. The accounts to be charged are determined by the\n[[chargeset]] setting of the task.\n" ) arg(1, 'amount', 'The amount to charge') pattern(%w( !chargeset )) pattern(%w( _complete !number), lambda { if @val[1] < 0.0 || @val[1] > 100.0 error('task_complete', "Complete value must be between 0 and 100", @sourceFileInfo[1], @property) end @property['complete', @scenarioIdx] = @val[1] }) doc('complete', "Specifies what percentage of the task is already completed. This can be useful\nfor simple progress tracking like in a TODO list. The provided completion\ndegree is used for the ''''complete'''' and ''''gauge'''' columns in reports.\nReports with calendar elements may show the completed part of the task in a\ndifferent color.\n\nThe completion percentage has no impact on the scheduler. It's meant for\ndocumentation purposes only.\n" ) example('Complete', '1') arg(1, 'percent', 'The percent value. It must be between 0 and 100.') pattern(%w( _depends !taskDepList ), lambda { checkContainer('depends') @property['depends', @scenarioIdx] += @val[1] begin @property['forward', @scenarioIdx] = true rescue AttributeOverwrite end }) doc('depends', "Specifies that the task cannot start before the specified tasks have been\nfinished.\n\nBy using the 'depends' attribute, the scheduling policy is automatically set\nto asap. If both depends and precedes are used, the last policy counts.\n" ) example('Depends1') pattern(%w( _duration !calendarDuration ), lambda { setDurationAttribute('duration', @val[1]) }) doc('duration', "Specifies the time the task should last. This is calendar time, not working\ntime. 7d means one week. If resources are specified they are allocated when\navailable. Availability of resources has no impact on the duration of the\ntask. It will always be the specified duration.\n\nTasks may not have subtasks if this attribute is used. Setting this attribute\nwill reset the [[effort]] and [[length]] attributes.\n" ) example('Durations') also(%w( effort length )) pattern(%w( _effort !workingDuration ), lambda { if @val[1] <= 0 error('effort_zero', "Effort value must at least as large as the " + "timing resolution " + "(#{@project['scheduleGranularity'] / 60}min).", @sourceFileInfo[1], @property) end setDurationAttribute('effort', @val[1]) }) doc('effort', "Specifies the effort needed to complete the task. An effort of ''''6d'''' (6\nresource-days) can be done with 2 full-time resources in 3 working days. The\ntask will not finish before the allocated resources have contributed the\nspecified effort. Hence the duration of the task will depend on the\navailability of the allocated resources. The specified effort value must be at\nleast as large as the [[timingresolution]].\n\nWARNING: In almost all real world projects effort is not the product of time\nand resources. This is only true if the task can be partitioned without adding\nany overhead. For more information about this read ''The Mythical Man-Month'' by\nFrederick P. Brooks, Jr.\n\nTasks may not have subtasks if this attribute is used. Setting this attribute\nwill reset the [[duration]] and [[length]] attributes. A task with an effort\nvalue cannot be a [[milestone]].\n" ) example('Durations') also(%w( duration length )) pattern(%w( _end !valDate ), lambda { @property['end', @scenarioIdx] = @val[1] begin @property['forward', @scenarioIdx] = false rescue AttributeOverwrite end }) doc('end', "The end attribute provides a guideline to the scheduler when the task should\nend. It will never end later, but it may end earlier when allocated\nresources are not available that long. When an end date is provided for a\ncontainer task, it will be passed down to ALAP task that don't have a well\ndefined end criteria.\n\nSetting an end date will implicitely set the scheduling policy for this task\nto ALAP.\n" ) example('Export', '1') pattern(%w( _endcredit !number ), lambda { @property['charge', @scenarioIdx] = @property['charge', @scenarioIdx] + [ Charge.new(@val[1], :onEnd, @property, @scenarioIdx) ] }) level(:deprecated) doc('endcredit', "Specifies an amount that is credited to the accounts specified by the\n[[chargeset]] attributes at the moment the tasks ends.\n" ) also('charge') example('Account', '1') pattern(%w( !flags )) doc('flags.task', "Attach a set of flags. The flags can be used in logical expressions to filter\nproperties from the reports.\n" ) pattern(%w( !fail )) pattern(%w( _length !workingDuration ), lambda { setDurationAttribute('length', @val[1]) }) doc('length', "Specifies the duration of this task as working time, not calendar time. 7d\nmeans 7 working days, or 7 times 8 hours (assuming default settings), not one\nweek.\n\nA task with a length specification may have resource allocations. Resources\nare allocated when they are available. There is no guarantee that the task\nwill get any resources allocated. The availability of resources has no impact\non the duration of the task. A time slot where none of the specified resources\nis available is still considered working time, if there is no global vacation\nand global working hours are defined accordingly.\n\nFor the length calculation, the global working hours and the global leaves\nmatter unless the task has [[shifts.task|shifts]] assigned. In the latter case\nthe working hours and leaves of the shift apply for the specified period to\ndetermine if a slot is working time or not. If a resource has additinal\nworking hours defined, it's quite possible that a task with a length of 5d\nwill have an allocated effort larger than 40 hours. Resource working hours\nonly have an impact on whether an allocation is made or not for a particular\ntime slot. They don't effect the resulting duration of the task.\n\nTasks may not have subtasks if this attribute is used. Setting this attribute\nwill reset the [[duration]], [[effort]] and [[milestone]] attributes.\n" ) also(%w( duration effort )) pattern(%w( !limits ), lambda { checkContainer('limits') @property['limits', @scenarioIdx] = @val[0] }) doc('limits.task', "Set per-interval allocation limits for the task. This setting affects all allocations for this task.\n" ) example('Limits-1', '2') pattern(%w( _maxend !valDate ), lambda { @property['maxend', @scenarioIdx] = @val[1] }) doc('maxend', "Specifies the maximum wanted end time of the task. The value is not used\nduring scheduling, but is checked after all tasks have been scheduled. If the\nend of the task is later than the specified value, then an error is reported.\n" ) pattern(%w( _maxstart !valDate ), lambda { @property['maxstart', @scenarioIdx] = @val[1] }) doc('maxstart', "Specifies the maximum wanted start time of the task. The value is not used\nduring scheduling, but is checked after all tasks have been scheduled. If the\nstart of the task is later than the specified value, then an error is\nreported.\n" ) pattern(%w( _milestone ), lambda { setDurationAttribute('milestone') }) doc('milestone', "Turns the task into a special task that has no duration. You may not specify a\nduration, length, effort or subtasks for a milestone task.\n\nA task that only has a start or an end specification and no duration\nspecification, inherited start or end dates, no dependencies or sub tasks,\nwill be recognized as milestone automatically.\n" ) pattern(%w( _minend !valDate ), lambda { @property['minend', @scenarioIdx] = @val[1] }) doc('minend', "Specifies the minimum wanted end time of the task. The value is not used\nduring scheduling, but is checked after all tasks have been scheduled. If the\nend of the task is earlier than the specified value, then an error is\nreported.\n" ) pattern(%w( _minstart !valDate ), lambda { @property['minstart', @scenarioIdx] = @val[1] }) doc('minstart', "Specifies the minimum wanted start time of the task. The value is not used\nduring scheduling, but is checked after all tasks have been scheduled. If the\nstart of the task is earlier than the specified value, then an error is\nreported.\n" ) pattern(%w( _startcredit !number ), lambda { @property['charge', @scenarioIdx] += [ Charge.new(@val[1], :onStart, @property, @scenarioIdx) ] }) level(:deprecated) doc('startcredit', "Specifies an amount that is credited to the account specified by the\n[[chargeset]] attributes at the moment the tasks starts.\n" ) also('charge') pattern(%w( !taskPeriod )) pattern(%w( _precedes !taskPredList ), lambda { checkContainer('precedes') @property['precedes', @scenarioIdx] += @val[1] begin @property['forward', @scenarioIdx] = false rescue AttributeOverwrite end }) doc('precedes', "Specifies that the tasks with the specified IDs cannot start before the task\nhas been finished. If multiple IDs are specified, they must be separated by\ncommas. IDs must be either global or relative. A relative ID starts with a\nnumber of '!'. Each '!' moves the scope to the parent task. Global IDs do not\ncontain '!', but have IDs separated by dots.\n\nBy using the 'precedes' attribute, the scheduling policy is automatically set\nto alap. If both depends and precedes are used within a task, the last policy\ncounts.\n" ) pattern(%w( _priority $INTEGER ), lambda { if @val[1] < 0 || @val[1] > 1000 error('task_priority', "Priority must have a value between 0 and 1000", @sourceFileInfo[1], @property) end @property['priority', @scenarioIdx] = @val[1] }) doc('priority', "Specifies the priority of the task. A task with higher priority is more\nlikely to get the requested resources. The default priority value of all tasks\nis 500. Don't confuse the priority of a tasks with the importance or urgency\nof a task. It only increases the chances that the tasks gets the requested\nresources. It does not mean that the task happens earlier, though that is\nusually the effect you will see. It also does not have any effect on tasks\nthat don't have any resources assigned (e.g. milestones).\n\nFor milestones it will raise or lower the chances that task leading up the\nmilestone will get their resources over task with equal priority that compete\nfor the same resources.\n\nThis attribute is inherited by subtasks if specified prior to the definition\nof the subtask.\n" ) arg(1, 'value', 'Priority value (1 - 1000)') example('Priority') pattern(%w( _projectid $ID ), lambda { unless @project['projectids'].include?(@val[1]) error('unknown_projectid', "Unknown project ID #{@val[1]}", @sourceFileInfo[1]) end begin @property['projectid', @scenarioIdx] = @val[1] rescue AttributeOverwrite # This attribute always overwrites the implicitely provided ID. end }) doc('projectid.task', "In larger projects it may be desireable to work with different project IDs for\nparts of the project. This attribute assignes a new project ID to this task an\nall subsequently defined sub tasks. The project ID needs to be declared first using [[projectid]] or [[projectids]].\n" ) pattern(%w( _responsible !resourceList ), lambda { @property['responsible', @scenarioIdx] += @val[1] @property['responsible', @scenarioIdx].uniq! }) doc('responsible', "The ID of the resource that is responsible for this task. This value is for\ndocumentation purposes only. It's not used by the scheduler.\n" ) pattern(%w( _scheduled ), lambda { if (@property['milestone', @scenarioIdx] && @property['start', @scenarioIdx].nil? && @property['end', @scenarioIdx].nil?) || (!@property['milestone', @scenarioIdx] && (@property['start', @scenarioIdx].nil? || @property['end', @scenarioIdx].nil?)) error('not_scheduled', "Task #{@property.fullId} is marked as scheduled but does not " + 'have a fixed start and end date.', @sourceFileInfo[0], @property) end @property['scheduled', @scenarioIdx] = true }) doc('scheduled', "This is mostly for internal use. It specifies that the task should be ignored\nfor scheduling in the scenario. This option only makes sense if you provide\nall resource [[booking.resource|bookings]] manually. Without booking\nstatements, the task will be reported with 0 effort and no resources assigned.\n" ) pattern(%w( _scheduling !schedulingDirection ), lambda { if @val[1] == 'alap' begin @property['forward', @scenarioIdx] = false rescue AttributeOverwrite end elsif @val[1] == 'asap' begin @property['forward', @scenarioIdx] = true rescue AttributeOverwrite end end }) doc('scheduling', "Specifies the scheduling policy for the task. A task can be scheduled from\nstart to end (As Soon As Possible, asap) or from end to start (As Late As\nPossible, alap).\n\nA task can be scheduled from start to end (ASAP mode) when it has a hard\n(start) or soft (depends) criteria for the start time. A task can be scheduled\nfrom end to start (ALAP mode) when it has a hard (end) or soft (precedes)\ncriteria for the end time.\n\nSome task attributes set the scheduling policy implicitly. This attribute can\nbe used to explicitly set the scheduling policy of the task to a certain\ndirection. To avoid it being overwritten again by an implicit attribute this\nattribute should always be the last attribute of the task.\n\nA random mixture of ASAP and ALAP tasks can have unexpected side effects on\nthe scheduling of the project. It increases significantly the scheduling\ncomplexity and results in much longer scheduling times. Especially in projects\nwith many hundreds of tasks the scheduling time of a project with a mixture of\nASAP and ALAP times can be 2 to 10 times longer. When the projects contains\nchains of ALAP and ASAP tasks the tasks further down the dependency chain will\nbe served much later than other non-chained task even when they have a much\nhigher priority. This can result in situations where high priority tasks do\nnot get their resources even though the parallel competing tasks have a much\nlower priority.\n\nALAP tasks may not have [[booking.task|bookings]] since the first booked slot\ndetermines the start date of the task and prevents it from being scheduled\nfrom end to start.\n\nAs a general rule, try to avoid ALAP tasks whenever possible. Have a close\neye on tasks that have been switched implicitly to ALAP mode because the\nend attribute comes after the start attribute.\n" ) pattern(%w( !taskShiftAssignments !shiftAssignments ), lambda { checkContainer('shift') # Set same value again to set the 'provided' state for the attribute. begin @property['shifts', @scenarioIdx] = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) level(:deprecated) doc('shift.task', "This keyword has been deprecated. Please use [[shifts.task|shifts\n(task)]] instead.\n" ) also('shifts.task') pattern(%w( !taskShiftsAssignments !shiftAssignments ), lambda { checkContainer('shifts') begin @property['shifts', @scenarioIdx] = @shiftAssignments rescue AttributeOverwrite # Multiple shift assignments are a common idiom, so don't warn about # them. end @shiftAssignments = nil }) doc('shifts.task', "Limits the working time for this task during the during the specified interval\nto the working hours of the given shift. Multiple shifts can be defined, but\nshift intervals may not overlap. This is an additional working time\nrestriction ontop of the working hours of the allocated resources. It does not\nreplace the resource working hour restrictions. For a resource to be assigned\nto a time slot, both the respective task shift as well as the resource working\nhours must declare the time slot as duty slot.\n" ) pattern(%w( _start !valDate), lambda { @property['start', @scenarioIdx] = @val[1] begin @property['forward', @scenarioIdx] = true rescue AttributeOverwrite end }) doc('start', "The start attribute provides a guideline to the scheduler when the task should\nstart. It will never start earlier, but it may start later when allocated\nresources are not available immediately. When a start date is provided for a\ncontainer task, it will be passed down to ASAP task that don't have a well\ndefined start criteria.\n\nSetting a start date will implicitely set the scheduling policy for this task\nto ASAP.\n" ) also(%w( end period.task maxstart minstart scheduling )) pattern(%w( !warn )) # Other attributes will be added automatically. end |
#rule_taskShiftAssignments ⇒ Object
6652 6653 6654 6655 6656 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6652 def rule_taskShiftAssignments pattern(%w( _shift ), lambda { @shiftAssignments = @property['shifts', @scenarioIdx] }) end |
#rule_taskShiftsAssignments ⇒ Object
6658 6659 6660 6661 6662 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6658 def rule_taskShiftsAssignments pattern(%w( _shifts ), lambda { @shiftAssignments = @property['shifts', @scenarioIdx] }) end |
#rule_textReport ⇒ Object
6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6664 def rule_textReport pattern(%w( !textReportHeader !reportBody ), lambda { @property = @property.parent }) doc('textreport', "This report consists of 5 RichText sections, a header, a center section with a\nleft and right margin and a footer. The sections may contain the output of\nother defined reports.\n" ) example('textreport') end |
#rule_textReportHeader ⇒ Object
6677 6678 6679 6680 6681 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6677 def rule_textReportHeader pattern(%w( _textreport !optionalID !reportName ), lambda { newReport(@val[1], @val[2], :textreport, @sourceFileInfo[0]) }) end |
#rule_timeformat ⇒ Object
6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6683 def rule_timeformat pattern(%w( _timeformat $STRING ), lambda { @val[1] }) doc('timeformat', "Determines how time specifications in reports look like.\n" ) arg(1, 'format', "Ordinary characters placed in the format string are copied without\nconversion. Conversion specifiers are introduced by a `%' character, and are\nreplaced in s as follows:\n\n* ''''%a'''' The abbreviated weekday name according to the current locale.\n\n* ''''%A'''' The full weekday name according to the current locale.\n\n* ''''%b'''' The abbreviated month name according to the current locale.\n\n* ''''%B'''' The full month name according to the current locale.\n\n* ''''%c'''' The preferred date and time representation for the current locale.\n\n* ''''%C'''' The century number (year/100) as a 2-digit integer. (SU)\n\n* ''''%d'''' The day of the month as a decimal number (range 01 to 31).\n\n* ''''%e'''' Like ''''%d'''', the day of the month as a decimal number, but a\nleading zero is replaced by a space. (SU)\n\n* ''''%E'''' Modifier: use alternative format, see below. (SU)\n\n* ''''%F'''' Equivalent to ''''%Y-%m-%d'''' (the ISO 8601 date format). (C99)\n\n* ''''%G'''' The ISO 8601 year with century as a decimal number. The 4-digit\nyear corresponding to the ISO week number (see %V). This has the same format\nand value as ''''%y'''', except that if the ISO week number belongs to the\nprevious or next year, that year is used instead. (TZ)\n\n* ''''%g'''' Like %G, but without century, i.e., with a 2-digit year (00-99).\n(TZ)\n\n* ''''%h'''' Equivalent to ''''%b''''. (SU)\n\n* ''''%H'''' The hour as a decimal number using a 24-hour clock (range 00 to\n23).\n\n* ''''%I'''' The hour as a decimal number using a 12-hour clock (range 01 to\n12).\n\n* ''''%j'''' The day of the year as a decimal number (range 001 to 366).\n\n* ''''%k'''' The hour (24-hour clock) as a decimal number (range 0 to 23);\nsingle digits are preceded by a blank. (See also ''''%H''''.) (TZ)\n\n* ''''%l'''' The hour (12-hour clock) as a decimal number (range 1 to 12);\nsingle digits are preceded by a blank. (See also ''''%I''''.) (TZ)\n\n* ''''%m'''' The month as a decimal number (range 01 to 12).\n\n* ''''%M'''' The minute as a decimal number (range 00 to 59).\n\n* ''''%n'''' A newline character. (SU)\n\n* ''''%O'''' Modifier: use alternative format, see below. (SU)\n\n* ''''%p'''' Either 'AM' or 'PM' according to the given time value, or the\ncorresponding strings for the current locale. Noon is treated as `pm' and\nmidnight as 'am'.\n\n* ''''%P'''' Like %p but in lowercase: 'am' or 'pm' or ''''%a''''\ncorresponding string for the current locale. (GNU)\n\n* ''''%r'''' The time in a.m. or p.m. notation. In the POSIX locale this is\nequivalent to ''''%I:%M:%S %p''''. (SU)\n\n* ''''%R'''' The time in 24-hour notation (%H:%M). (SU) For a version\nincluding the seconds, see ''''%T'''' below.\n\n* ''''%s'''' The number of seconds since the Epoch, i.e., since 1970-01-01\n00:00:00 UTC. (TZ)\n\n* ''''%S'''' The second as a decimal number (range 00 to 61).\n\n* ''''%t'''' A tab character. (SU)\n\n* ''''%T'''' The time in 24-hour notation (%H:%M:%S). (SU)\n\n* ''''%u'''' The day of the week as a decimal, range 1 to 7, Monday being 1.\nSee also ''''%w''''. (SU)\n\n* ''''%U'''' The week number of the current year as a decimal number, range\n00 to 53, starting with the first Sunday as the first day of week 01. See also\n''''%V'''' and ''''%W''''.\n\n* ''''%V'''' The ISO 8601:1988 week number of the current year as a decimal\nnumber, range 01 to 53, where week 1 is the first week that has at least 4\ndays in the current year, and with Monday as the first day of the week. See\nalso ''''%U'''' and ''''%W''''. %(SU)\n\n* ''''%w'''' The day of the week as a decimal, range 0 to 6, Sunday being 0. See also ''''%u''''.\n\n* ''''%W'''' The week number of the current %year as a decimal number, range\n00 to 53, starting with the first Monday as the first day of week 01.\n\n* ''''%x'''' The preferred date representation for the current locale without\nthe time.\n\n* ''''%X'''' The preferred time representation for the current locale without\nthe date.\n\n* ''''%y'''' The year as a decimal number without a century (range 00 to 99).\n\n* ''''%Y'''' The year as a decimal number including the century.\n\n* ''''%z'''' The time zone as hour offset from GMT. Required to emit\nRFC822-conformant dates (using ''''%a, %d %%b %Y %H:%M:%S %%z''''). (GNU)\n\n* ''''%Z'''' The time zone or name or abbreviation.\n\n* ''''%+'''' The date and time in date(1) format. (TZ)\n\n* ''''%%'''' A literal ''''%'''' character.\n\nSome conversion specifiers can be modified by preceding them by the E or O\nmodifier to indicate that an alternative format should be used. If the\nalternative format or specification does not exist for the current locale, the\nbehavior will be as if the unmodified conversion specification were used.\n\n(SU) The Single Unix Specification mentions %Ec, %EC, %Ex, %%EX, %Ry, %EY,\n%Od, %Oe, %OH, %OI, %Om, %OM, %OS, %Ou, %OU, %OV, %Ow, %OW, %Oy, where the\neffect of the O modifier is to use alternative numeric symbols (say, Roman\nnumerals), and that of the E modifier is to use a locale-dependent alternative\nrepresentation.\n\nThis documentation of the timeformat attribute has been taken from the man page\nof the GNU strftime function.\n" ) end |
#rule_timeInterval ⇒ Object
6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6825 def rule_timeInterval pattern([ '$TIME', '_-', '$TIME' ], lambda { if @val[0] >= @val[2] error('time_interval', "End time of interval must be larger than start time", @sourceFileInfo[0]) end [ @val[0], @val[2] ] }) end |
#rule_timeSheet ⇒ Object
6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6836 def rule_timeSheet pattern(%w( !timeSheetHeader !timeSheetBody ), lambda { @timeSheet }) doc('timesheet', "A time sheet record can be used to capture the current status of the tasks\nassigned to a specific resource and the achieved progress for a given period\nof time. The status is assumed to be for the end of this time period. There\nmust be a separate time sheet record for each resource per period. Different\nresources can use different reporting periods and reports for the same\nresource may have different reporting periods as long as they don't overlap.\nFor the time after the last time sheet, TaskJuggler will project the result\nbased on the plan data. For periods without a time sheet record prior to the\nlast record for this resource, TaskJuggler assumes that no work has been done.\nThe work is booked for the scenario specified by [[trackingscenario]].\n\nThe intended use for time sheets is to have all resources report a time sheet\nevery day, week or month. All time sheets can be added to the project plan.\nThe status information is always used to determin the current status of the\nproject. The [[work]], [[remaining]] and [[end.timesheet|end]] attributes are\nignored if there are also [[booking.task|bookings]] for the resource in the\ntime sheet period. The non-ignored attributes of the time sheets will be\nconverted into [[booking.task|booking]] statements internally. These bookings\ncan then be [[export|exported]] into a file which can then be added to the\nproject again. This way, you can use time sheets to incrementally record\nprogress of your project. There is a possibility that time sheets conflict\nwith other data in the plan. In case TaskJuggler cannot automatically resolve\nthem, these conflicts have to be manually resolved by either changing the plan\nor the time sheet.\n\nThe status messages are interpreted as [[journalentry|journal entries]]. The\nalert level will be evaluated and the current state of the project can be put\ninto a dashboard using the ''''alert'''' and ''''alertmessage'''' [[columnid|\ncolumns]].\n\nCurrently, the provided effort values and dates are not yet used to\nautomatically update the plan data. This feature will be added in future\nversions.\n" ) example('TimeSheet1', '1') end |
#rule_timeSheetAttributes ⇒ Object
6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6879 def rule_timeSheetAttributes optional repeatable pattern(%w( !tsNewTaskHeader !tsTaskBody ), lambda { @property = nil @timeSheetRecord = nil }) doc('newtask', "The keyword can be used to request a new task to the project. If the task ID\nrequires further parent task that don't exist yet, these tasks will be\nrequested as well. If the task exists already, an error will be generated. The\nnewly requested task can be used immediately to report progress and status\nagainst it. These tasks will not automatically be added to the project plan.\nThe project manager has to manually create them after reviewing the request\nduring the time sheet reviews.\n" ) example('TimeSheet1', '3') pattern(%w( _shift !shiftId ), lambda { #TODO }) doc('shift.timesheet', "Specifies an alternative [[shift]] for the time sheet period. This shift will\noverride any existing working hour definitions for the resource. It will not\noverride already declared [[leaves]] though.\n\nThe primary use of this feature is to let the resources report different total\nwork time for the report period.\n" ) pattern(%w( !tsStatus )) pattern(%w( !tsTaskHeader !tsTaskBody ), lambda { @property = nil @timeSheetRecord = nil }) doc('task.timesheet', "Specifies an existing task that progress and status should be reported\nagainst.\n" ) example('TimeSheet1', '4') end |
#rule_timeSheetBody ⇒ Object
6933 6934 6935 6936 6937 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6933 def rule_timeSheetBody pattern(%w( _{ !timeSheetAttributes _} ), lambda { }) end |
#rule_timeSheetFile ⇒ Object
6926 6927 6928 6929 6930 6931 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6926 def rule_timeSheetFile pattern(%w( !timeSheet . ), lambda { @val[0] }) lastSyntaxToken(1) end |
#rule_timeSheetHeader ⇒ Object
6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6939 def rule_timeSheetHeader pattern(%w( _timesheet !resourceId !valIntervalOrDate ), lambda { @sheetAuthor = @val[1] @property = nil unless @sheetAuthor.leaf? error('ts_group_author', 'A resource group cannot file a time sheet', @sourceFileInfo[1]) end unless (scenarioIdx = @project['trackingScenarioIdx']) error('ts_no_tracking_scenario', 'No trackingscenario defined.') end # Currently time sheets are hardcoded for scenario 0. @timeSheet = TimeSheet.new(@sheetAuthor, @val[2], scenarioIdx) @timeSheet.sourceFileInfo = @sourceFileInfo[0] @project.timeSheets << @timeSheet }) end |
#rule_timeSheetReport ⇒ Object
6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6959 def rule_timeSheetReport pattern(%w( !tsReportHeader !tsReportBody ), lambda { @property = nil }) doc('timesheetreport', "For projects that flow mostly according to plan, TaskJuggler already knows\nmuch of the information that should be contained in the time sheets. With this\nproperty, you can generate a report that contains drafts of the time sheets\nfor one or more resources. The time sheet drafts will be for the\nspecified report period and the specified [trackingscenario].\n" ) end |
#rule_timezone ⇒ Object
6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 6973 def rule_timezone pattern(%w( _timezone !validTimeZone ), lambda{ TjTime.setTimeZone(@val[1]) @project['timezone'] = @val[1] }) doc('timezone', "Sets the default time zone of the project. All dates and times that have no\ntime zones specified will be assumed to be in this time zone. If no time zone\nis specified for the project, UTC is assumed.\n\nThe project start and end time are not affected by this setting. They are\nalways considered to be UTC unless specified differently.\n\nIn case the specified time zone is not hour-aligned with UTC, the\n[[timingresolution]] will automatically be decreased accordingly. Do not\nchange the timingresolution after you've set the time zone!\n\nChanging the time zone will reset the [[workinghours.project|working hours]]\nto the default times. It's recommended that you declare your working hours\nafter the time zone.\n" ) arg(1, 'zone', "Time zone to use. E. g. 'Europe/Berlin' or 'America/Denver'. Don't use the 3\nletter acronyms. See\n[http://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones Wikipedia] for\npossible values.\n" ) end |
#rule_traceReport ⇒ Object
7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7004 def rule_traceReport pattern(%w( !traceReportHeader !reportBody ), lambda { @property = @property.parent }) doc('tracereport', "The trace report works noticeably different than all other TaskJuggler\nreports. It uses a CSV file to track the values of the selected attributes.\nEach time ''''tj3'''' is run with the ''''--add-trace'''' option, a new set of\nvalues is appended to the CSV file. The first column of the CSV file holds the\ndate when the snapshot was taken. This is either the current date or the\n''''now'''' date if provided. There is no need to specify CSV as output format\nfor the report. You can either use these tracked values directly by specifying other report formats or by importing the CSV file into another program.\n\nThe first column always contains the current date when that\ntable row was added. All subsequent columns can be defined by the user with\nthe [[columns]] attribute. This column set is then repeated for all properties\nthat are not hidden by [[hideaccount]], [[hideresource]] and [[hidetask]]. By\ndefault, all properties are excluded. You must provide at least one of the\n''''hide...'''' attributes to select the properties you want to have included\nin the report. Please be aware that total number of columns is the product of\nattributes defined with [[columns]] times the number of included properties.\nSelect you values carefully or you will end up with very large reports.\n\nThe column headers can be customized by using the [[title.column|title]]\nattribute. When you include multiple properties, these headers are not unique\nunless you include mini-queries to modify them based on the property they\ncolum is represeting. You can use the queries\n''''<nowiki><-id-></nowiki>'''', ''''<nowiki><-name-></nowiki>'''',\n''''<nowiki><-scenario-></nowiki>'''' and\n''''<nowiki><-attribute-></nowiki>''''. ''''<nowiki><-id-></nowiki>'''' is\nreplaced with the ID of the property, ''''<nowiki><-name-></nowiki>'''' with\nthe name and so on.\n\nYou can change the set of tracked values over time. Old values will be\npreserved and the corresponding columns will be the last ones in the CSV file.\n\nWhen other formats are requested, the CSV file is read in and a report that\nshows the tracked values over time will be generated. The CSV file may contain\nall kinds of values that are being tracked. Report formats that don't support\na mix of different values will just show the values of the second column.\n\nThe HTML version generates SVG graphs that are embedded in the HTML page.\nThese graphs are only visble if the web browser supports HTML5. This is true\nfor the latest generation of browsers, but older browsers may not support this\nformat.\n" ) example('TraceReport') end |
#rule_traceReportHeader ⇒ Object
7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7054 def rule_traceReportHeader pattern(%w( _tracereport !optionalID !reportName ), lambda { newReport(@val[1], @val[2], :tracereport, @sourceFileInfo[0]) do # The top-level always inherits the global timeFormat setting. This is # not desireable in this case, so we ignore this. if (@property.level == 0 && !@property.provided('timeFormat')) || (@property.level > 0 && !@property.modified?('timeFormat')) # CSV readers such of Libre-/OpenOffice can't deal with time zones. We # probably also don't need seconds. @property.set('timeFormat', '%Y-%m-%d-%H:%M') end unless @property.modified?('columns') # Set the default columns for this report. %w( end ).each do |col| @property.get('columns') << TableColumnDefinition.new(col, columnTitle(col)) end end # Hide all accounts. unless @property.modified?('hideAccount') @property.set('hideAccount', LogicalExpression.new(LogicalOperation.new(1))) end unless @property.modified?('sortAccounts') @property.set('sortAccounts', [ [ 'tree', true, -1 ], [ 'seqno', true, -1 ] ]) end # Show all tasks, sorted by tree, start-up, seqno-up. unless @property.modified?('hideTask') @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) end unless @property.modified?('sortTasks') @property.set('sortTasks', [ [ 'tree', true, -1 ], [ 'start', true, 0 ], [ 'seqno', true, -1 ] ]) end # Show no resources, but set sorting to id-up. unless @property.modified?('hideResource') @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(1))) end unless @property.modified?('sortResources') @property.set('sortResources', [ [ 'id', true, -1 ] ]) end end }) end |
#rule_tsNewTaskHeader ⇒ Object
7105 7106 7107 7108 7109 7110 7111 7112 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7105 def rule_tsNewTaskHeader pattern(%w( _newtask !taskIdUnverifd $STRING ), lambda { @timeSheetRecord = TimeSheetRecord.new(@timeSheet, @val[1]) @timeSheetRecord.name = @val[2] @timeSheetRecord.sourceFileInfo = @sourceFileInfo[0] }) arg(1, 'task', 'ID of the new task') end |
#rule_tsReportAttributes ⇒ Object
7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7141 def rule_tsReportAttributes optional repeatable pattern(%w( !hideresource )) pattern(%w( !hidetask )) pattern(%w( !reportEnd )) pattern(%w( !reportPeriod )) pattern(%w( !reportStart )) pattern(%w( !sortResources )) pattern(%w( !sortTasks )) end |
#rule_tsReportBody ⇒ Object
7154 7155 7156 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7154 def rule_tsReportBody ('tsReportAttributes') end |
#rule_tsReportHeader ⇒ Object
7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7113 def rule_tsReportHeader pattern(%w( _timesheetreport !optionalID $STRING ), lambda { newReport(@val[1], @val[2], :timeSheet, @sourceFileInfo[0]) do @property.set('formats', [ :tjp ]) unless (scenarioIdx = @project['trackingScenarioIdx']) error('ts_no_tracking_scenario', 'You must have a tracking scenario defined to use time sheets.') end @property.set('scenarios', [ scenarioIdx ]) # Show all tasks, sorted by seqno-up. @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortTasks', [ [ 'seqno', true, -1 ] ]) # Show all resources, sorted by seqno-up. @property.set('hideResource', LogicalExpression.new(LogicalOperation.new(0))) @property.set('sortResources', [ [ 'seqno', true, -1 ] ]) @property.set('loadUnit', :hours) @property.set('definitions', []) end }) arg(2, 'file name', "The name of the time sheet report file to generate. It must end with a .tji\nextension, or use . to use the standard output channel.\n" ) end |
#rule_tsStatus ⇒ Object
7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7209 def rule_tsStatus pattern(%w( !tsStatusHeader !tsStatusBody )) doc('status.timesheet', "The status attribute can be used to describe the current status of the task or\nresource. The content of the status messages is added to the project journal.\nThe status section is optional for tasks that have been worked on less than\none day during the report interval.\n" ) arg(2, 'headline', "A short headline for the status. Must be 60 characters or shorter.\n" ) example('TimeSheet1', '4') end |
#rule_tsStatusAttributes ⇒ Object
7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7158 def rule_tsStatusAttributes optional repeatable pattern(%w( !details )) pattern(%w( _flags !flagList ), lambda { @val[1].each do |flag| next if @journalEntry.flags.include?(flag) @journalEntry.flags << flag end }) doc('flags.timesheet', "Time sheet entries can have flags attached to them. These can be used to\ninclude only entries in a report that have a certain flag.\n" ) pattern(%w( !summary )) end |
#rule_tsStatusBody ⇒ Object
7180 7181 7182 7183 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7180 def rule_tsStatusBody optional pattern(%w( _{ !tsStatusAttributes _} )) end |
#rule_tsStatusHeader ⇒ Object
7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7185 def rule_tsStatusHeader pattern(%w( _status !alertLevel $STRING ), lambda { if @val[2].length > 120 error('ts_headline_too_long', "The headline must be 120 or less characters long. This one " + "has #{@val[2].length} characters.", @sourceFileInfo[2]) end if @val[2] == 'Your headline here!' error('ts_no_headline', "'Your headline here!' is not a valid headline", @sourceFileInfo[2]) end @journalEntry = JournalEntry.new(@project['journal'], @timeSheet.interval.end, @val[2], @property || @timeSheet.resource, @sourceFileInfo[0]) @journalEntry.alertLevel = @val[1] @journalEntry.timeSheetRecord = @timeSheetRecord @journalEntry. = @sheetAuthor @timeSheetRecord.status = @journalEntry if @timeSheetRecord }) end |
#rule_tsTaskAttributes ⇒ Object
7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7225 def rule_tsTaskAttributes optional repeatable pattern(%w( _end !valDate ), lambda { if @val[1] < @timeSheet.interval.start error('ts_end_too_early', "The expected task end date must be after the start date of " + "this time sheet report.", @sourceFileInfo[1]) end @timeSheetRecord.expectedEnd = @val[1] }) doc('end.timesheet', "The expected end date for the task. This can only be used for duration based\ntask. For effort based task [[remaining]] has to be used.\n" ) example('TimeSheet1', '5') pattern(%w( _priority $INTEGER ), lambda { priority = @val[1] if priority < 1 || priority > 1000 error('ts_bad_priority', "Priority value #{priority} must be between 1 and 1000.", @sourceFileInfo[1]) end @timeSheetRecord.priority = priority }) doc('priority.timesheet', "The priority is a value between 1 and 1000. It is used to determine the\nsequence of task when converting [[work]] to [[booking.task|bookings]]. Tasks\nthat need to finish earlier in the period should have a high priority, tasks\nthat end later in the period should have a low priority. For tasks that don't\nget finished in the reported period the priority should be set to 1.\n" ) pattern(%w( _remaining !workingDuration ), lambda { @timeSheetRecord.remaining = @val[1] }) doc('remaining', "The remaining effort for the task. This value is ignored if there are\n[[booking.task|bookings]] for the resource that overlap with the time sheet\nperiod. If there are no bookings, the value is compared with the [[effort]]\nspecification of the task. If there a mismatch between the accumulated effort\nspecified with bookings, [[work]] and [[remaining]] on one side and the\nspecified [[effort]] on the other, a warning is generated.\n\nThis attribute can only be used with tasks that are effort based. Duration\nbased tasks need to have an [[end.timesheet|end]] attribute.\n" ) example('TimeSheet1', '6') pattern(%w( !tsStatus )) pattern(%w( _work !workingDurationPercent ), lambda { @timeSheetRecord.work = @val[1] }) doc('work', "The amount of time that the resource has spend with the task during the\nreported period. This value is ignored when there are\n[[booking.task|bookings]] for the resource overlapping with the time sheet\nperiod. If there are no bookings, TaskJuggler will try to convert the work\nspecification into bookings internally before the actual scheduling is\nstarted.\n\nEvery task listed in the time sheet needs to have a work attribute. The total\naccumulated work time that is reported must match exactly the total working\nhours for the resource for that period.\n\nIf a resource has no vacation during the week that is reported and it has a\nregular 40 hour work week, exactly 40 hours total or 5 working days have to be\nreported.\n" ) example('TimeSheet1', '4') end |
#rule_tsTaskBody ⇒ Object
7304 7305 7306 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7304 def rule_tsTaskBody pattern(%w( _{ !tsTaskAttributes _} )) end |
#rule_tsTaskHeader ⇒ Object
7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7308 def rule_tsTaskHeader pattern(%w( _task !taskId ), lambda { @property = @val[1] unless @property.leaf? error('ts_task_not_leaf', 'You cannot specify a task that has sub tasks here.', @sourceFileInfo[1], @property) end @timeSheetRecord = TimeSheetRecord.new(@timeSheet, @property) @timeSheetRecord.sourceFileInfo = @sourceFileInfo[0] }) arg(1, 'task', 'ID of an already existing task') end |
#rule_vacationName ⇒ Object
7323 7324 7325 7326 7327 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7323 def rule_vacationName optional pattern(%w( $STRING )) # We just throw the name away arg(0, 'name', 'An optional name or reason for the leave') end |
#rule_valDate ⇒ Object
7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7329 def rule_valDate pattern(%w( !date ), lambda { if @val[0] < @project['start'] || @val[0] > @project['end'] error('date_in_range', "Date #{@val[0]} must be within the project time frame " + "#{@project['start']} - #{@project['end']}", @sourceFileInfo[0]) end @val[0] }) end |
#rule_validTimeZone ⇒ Object
7341 7342 7343 7344 7345 7346 7347 7348 7349 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7341 def rule_validTimeZone pattern(%w( $STRING ), lambda { unless TjTime.checkTimeZone(@val[0]) error('bad_time_zone', "#{@val[0]} is not a known time zone", @sourceFileInfo[0]) end @val[0] }) end |
#rule_valInterval ⇒ Object
7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7389 def rule_valInterval pattern(%w( !date !intervalEnd ), lambda { mode = @val[1][0] endSpec = @val[1][1] if mode == 0 unless @val[0] < endSpec error('start_before_end', "The end date (#{endSpec}) must be after " + "the start date (#{@val[0]}).", @sourceFileInfo[1]) end iv = TimeInterval.new(@val[0], endSpec) else iv = TimeInterval.new(@val[0], @val[0] + endSpec) end checkInterval(iv) iv }) doc('interval1', "There are two ways to specify a date interval. The start and end date must lie within the specified project period.\n\nThe first is the most obvious. A date interval consists of a start and end\nDATE. Watch out for end dates without a time specification! Date\nspecifications are 0 extended. An end date without a time is expanded to\nmidnight that day. So the day of the end date is not included in the interval!\nThe start and end dates must be separated by a hyphen character.\n\nIn the second form specifies the start date and an interval duration. The\nduration must be prefixed by a plus character.\n" ) end |
#rule_valIntervalOrDate ⇒ Object
7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7351 def rule_valIntervalOrDate pattern(%w( !date !intervalOptionalEnd ), lambda { if @val[1] mode = @val[1][0] endSpec = @val[1][1] if mode == 0 unless @val[0] < endSpec error('start_before_end', "The end date (#{endSpec}) must be " + "after the start date (#{@val[0]}).", @sourceFileInfo[1]) end iv = TimeInterval.new(@val[0], endSpec) else iv = TimeInterval.new(@val[0], @val[0] + endSpec) end else iv = TimeInterval.new(@val[0], @val[0].sameTimeNextDay) end checkInterval(iv) iv }) doc('interval4', "There are three ways to specify a date interval. The first is the most\nobvious. A date interval consists of a start and end DATE. Watch out for end\ndates without a time specification! Date specifications are 0 extended. An\nend date without a time is expanded to midnight that day. So the day of the\nend date is not included in the interval! The start and end dates must be separated by a hyphen character.\n\nIn the second form, the end date is omitted. A 24 hour interval is assumed.\n\nThe third form specifies the start date and an interval duration. The duration must be prefixed by a plus character.\n\nThe start and end date of the interval must be within the specified project\ntime frame.\n" ) end |
#rule_valIntervals ⇒ Object
7420 7421 7422 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7420 def rule_valIntervals listRule('moreValIntervals', '!valIntervalOrDate') end |
#rule_warn ⇒ Object
7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7424 def rule_warn pattern(%w( _warn !logicalExpression ), lambda { begin @property.set('warn', @property.get('warn') + [ @val[1] ]) rescue AttributeOverwrite end }) doc('warn', "The warn attribute adds a [[logicalexpression|logical expression]] to the\nproperty. The condition described by the logical expression is checked after\nthe scheduling and an warning is generated if the condition evaluates to true.\nThis attribute is primarily intended for testing purposes.\n" ) end |
#rule_weekday ⇒ Object
7441 7442 7443 7444 7445 7446 7447 7448 7449 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7441 def rule_weekday pattern(%w( _sun ), lambda { 0 }) pattern(%w( _mon ), lambda { 1 }) pattern(%w( _tue ), lambda { 2 }) pattern(%w( _wed ), lambda { 3 }) pattern(%w( _thu ), lambda { 4 }) pattern(%w( _fri ), lambda { 5 }) pattern(%w( _sat ), lambda { 6 }) end |
#rule_weekDayInterval ⇒ Object
7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7451 def rule_weekDayInterval pattern(%w( !weekday !weekDayIntervalEnd ), lambda { weekdays = Array.new(7, false) if @val[1].nil? weekdays[@val[0]] = true else d = @val[0] loop do weekdays[d] = true break if d == @val[1] d = (d + 1) % 7 end end weekdays }) arg(0, 'weekday', 'Weekday (sun - sat)') end |
#rule_weekDayIntervalEnd ⇒ Object
7470 7471 7472 7473 7474 7475 7476 7477 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7470 def rule_weekDayIntervalEnd optional pattern([ '_-', '!weekday' ], lambda { @val[1] }) arg(1, 'end weekday', 'Weekday (sun - sat). It is included in the interval.') end |
#rule_workingDuration ⇒ Object
7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7479 def rule_workingDuration pattern(%w( !number !durationUnit ), lambda { convFactors = [ 60, # minutes 60 * 60, # hours 60 * 60 * @project['dailyworkinghours'], # days 60 * 60 * @project['dailyworkinghours'] * (@project.weeklyWorkingDays), # weeks 60 * 60 * @project['dailyworkinghours'] * (@project['yearlyworkingdays'] / 12), # months 60 * 60 * @project['dailyworkinghours'] * @project['yearlyworkingdays'] # years ] # The result will always be in number of time slots. (@val[0] * convFactors[@val[1]] / @project['scheduleGranularity']).round.to_i }) arg(0, 'value', 'A floating point or integer number') end |
#rule_workingDurationPercent ⇒ Object
7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7498 def rule_workingDurationPercent pattern(%w( !number !durationUnitOrPercent ), lambda { if @val[1] >= 0 # Absolute value in minutes, hours or days. convFactors = [ 60, # minutes 60 * 60, # hours 60 * 60 * @project['dailyworkinghours'] # days ] # The result will always be in number of time slots. (@val[0] * convFactors[@val[1]] / @project['scheduleGranularity']).round.to_i else # Percentage values are always returned as Float in the rage of 0.0 to # 1.0. if @val[0] < 0.0 || @val[0] > 100.0 error('illegal_percentage', "Percentage values must be between 0 and 100%.", @sourceFileInfo[1]) end @val[0] / 100.0 end }) arg(0, 'value', 'A floating point or integer number') end |
#rule_workinghours ⇒ Object
7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7523 def rule_workinghours pattern(%w( _workinghours !listOfDays !listOfTimes), lambda { if @property.nil? # We are changing global working hours. wh = @project['workinghours'] else unless (wh = @property['workinghours', @scenarioIdx]) # The property does not have it's own WorkingHours yet. wh = WorkingHours.new(@project['workinghours']) end end wh.timezone = @project['timezone'] begin 7.times { |i| wh.setWorkingHours(i, @val[2]) if @val[1][i] } rescue error('bad_workinghours', $!.) end if @property # Make sure we actually assign something so the attribute is marked as # set by the user. begin @property['workinghours', @scenarioIdx] = wh rescue AttributeOverwrite # Working hours can be set multiple times. end end }) end |
#rule_workinghoursProject ⇒ Object
7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7553 def rule_workinghoursProject pattern(%w( !workinghours )) doc('workinghours.project', "Set the default working hours for all subsequent resource definitions. The\nstandard working hours are 9:00am - 12:00am, 1:00pm - 18:00pm, Monday to\nFriday. The working hours specification limits the availability of resources\nto certain time slots of week days.\n\nThese default working hours can be replaced with other working hours for\nindividual resources.\n" ) also(%w( dailyworkinghours workinghours.resource workinghours.shift )) example('Project') end |
#rule_workinghoursResource ⇒ Object
7569 7570 7571 7572 7573 7574 7575 7576 7577 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7569 def rule_workinghoursResource pattern(%w( !workinghours )) doc('workinghours.resource', "Set the working hours for a specific resource. The working hours specification\nlimits the availability of resources to certain time slots of week days.\n" ) also(%w( workinghours.project workinghours.shift )) end |
#rule_workinghoursShift ⇒ Object
7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7579 def rule_workinghoursShift pattern(%w( !workinghours )) doc('workinghours.shift', "Set the working hours for the shift. The working hours specification limits\nthe availability of resources or the activity on a task to certain time\nslots of week days.\n\nThe shift working hours will replace the default or resource working hours for\nthe specified time frame when assigning the shift to a resource.\n\nIn case the shift is used for a task, resources are only assigned during the\nworking hours of this shift and during the working hours of the allocated\nresource. Allocations only happen when both the task shift and the resource\nwork hours allow work to happen.\n" ) also(%w( workinghours.project workinghours.resource )) end |
#rule_yesNo ⇒ Object
7598 7599 7600 7601 7602 7603 7604 7605 |
# File 'lib/taskjuggler/TjpSyntaxRules.rb', line 7598 def rule_yesNo pattern(%w( _yes ), lambda { true }) pattern(%w( _no ), lambda { false }) end |