extend task_states definition; make type-based state handling fully operational
This commit is contained in:
		
							parent
							
								
									a429f9ca76
								
							
						
					
					
						commit
						e8cb0c94a8
					
				
					 6 changed files with 105 additions and 23 deletions
				
			
		| 
						 | 
				
			
			@ -291,7 +291,8 @@
 | 
			
		|||
                    tal:condition="stTrans"
 | 
			
		||||
                    tal:attributes="name string:state.$stDef">
 | 
			
		||||
              <option i18n:translate="" value="-">No change</option>
 | 
			
		||||
              <option tal:repeat="trans stTrans"
 | 
			
		||||
              <option i18n:translate=""
 | 
			
		||||
                      tal:repeat="trans stTrans"
 | 
			
		||||
                      tal:attributes="value trans/name"
 | 
			
		||||
                      tal:content="trans/title">publish</option>
 | 
			
		||||
            </select>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -368,7 +368,8 @@
 | 
			
		|||
        i18n:translate=""></td>
 | 
			
		||||
    <td colspan="2">
 | 
			
		||||
      <tal:states repeat="state def/states">
 | 
			
		||||
        <tal:state define="name string:state.$deftype.${def/name};
 | 
			
		||||
        <tal:state define="xx_name string:state.$deftype.${def/name};
 | 
			
		||||
                           name string:state.${def/name};
 | 
			
		||||
                           value state/name">
 | 
			
		||||
            <input type="checkbox"
 | 
			
		||||
                   tal:attributes="name string:$name:list;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -196,8 +196,9 @@ class Search(ConceptView):
 | 
			
		|||
 | 
			
		||||
    @Lazy
 | 
			
		||||
    def statesDefinitions(self):
 | 
			
		||||
        return [component.getUtility(IStatesDefinition, name=n)
 | 
			
		||||
                    for n in self.globalOptions('organize.stateful.resource', ())]
 | 
			
		||||
        stdnames = (self.globalOptions('organize.stateful.resource', []) +
 | 
			
		||||
                    self.globalOptions('organize.stateful.special', []))
 | 
			
		||||
        return [component.getUtility(IStatesDefinition, name=n) for n in stdnames]
 | 
			
		||||
 | 
			
		||||
    @Lazy
 | 
			
		||||
    def selectedStates(self):
 | 
			
		||||
| 
						 | 
				
			
			@ -259,6 +260,8 @@ class Search(ConceptView):
 | 
			
		|||
        for std, states in self.selectedStates.items():
 | 
			
		||||
            if std.startswith('state.resource.'):
 | 
			
		||||
                std = std[len('state.resource.'):]
 | 
			
		||||
            elif std.startswith('state.'):
 | 
			
		||||
                std = std[len('state.'):]
 | 
			
		||||
            else:
 | 
			
		||||
                continue
 | 
			
		||||
            stf = component.queryAdapter(obj, IStateful, name=std)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -704,9 +704,6 @@ msgstr "Deckungsgrad"
 | 
			
		|||
msgid "Create loops Note"
 | 
			
		||||
msgstr "loops-Notiz anlegen"
 | 
			
		||||
 | 
			
		||||
msgid "State information for $definition: $title"
 | 
			
		||||
msgstr "Status ($definition): $title"
 | 
			
		||||
 | 
			
		||||
msgid "User ID"
 | 
			
		||||
msgstr "Benutzerkennung"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -885,8 +882,26 @@ msgstr "nach"
 | 
			
		|||
 | 
			
		||||
# state definitions
 | 
			
		||||
 | 
			
		||||
msgid "Restrict to objects with certain states"
 | 
			
		||||
msgstr "Auf Objekte mit bestimmtem Status beschränken"
 | 
			
		||||
 | 
			
		||||
msgid "Workflow"
 | 
			
		||||
msgstr "Statusdefinition/Workflow"
 | 
			
		||||
 | 
			
		||||
msgid "States"
 | 
			
		||||
msgstr "Statuswerte"
 | 
			
		||||
 | 
			
		||||
msgid "State information for $definition: $title"
 | 
			
		||||
msgstr "Status ($definition): $title"
 | 
			
		||||
 | 
			
		||||
msgid "classification_quality"
 | 
			
		||||
msgstr "Klassifizierung"
 | 
			
		||||
 | 
			
		||||
msgid "simple_publishing"
 | 
			
		||||
msgstr "Veröffentlichung"
 | 
			
		||||
 | 
			
		||||
msgid "task_states"
 | 
			
		||||
msgstr "Status"
 | 
			
		||||
msgstr "Aufgabe"
 | 
			
		||||
 | 
			
		||||
# state names
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -896,9 +911,15 @@ msgstr "angenommen"
 | 
			
		|||
msgid "active"
 | 
			
		||||
msgstr "aktiv"
 | 
			
		||||
 | 
			
		||||
msgid "archived"
 | 
			
		||||
msgstr "Archiv"
 | 
			
		||||
 | 
			
		||||
msgid "cancelled"
 | 
			
		||||
msgstr "abgebrochen"
 | 
			
		||||
 | 
			
		||||
msgid "classified"
 | 
			
		||||
msgstr "klassifiziert"
 | 
			
		||||
 | 
			
		||||
msgid "closed"
 | 
			
		||||
msgstr "abgeschlossen"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -923,40 +944,96 @@ msgstr "neu"
 | 
			
		|||
msgid "planned"
 | 
			
		||||
msgstr "geplant"
 | 
			
		||||
 | 
			
		||||
msgid "private"
 | 
			
		||||
msgstr "privat"
 | 
			
		||||
 | 
			
		||||
msgid "published"
 | 
			
		||||
msgstr "veröffentlicht"
 | 
			
		||||
 | 
			
		||||
msgid "removed"
 | 
			
		||||
msgstr "gelöscht"
 | 
			
		||||
 | 
			
		||||
msgid "replaced"
 | 
			
		||||
msgstr "ersetzt"
 | 
			
		||||
 | 
			
		||||
msgid "running"
 | 
			
		||||
msgstr "in Arbeit"
 | 
			
		||||
 | 
			
		||||
# transitions
 | 
			
		||||
msgid "unclassified"
 | 
			
		||||
msgstr "unklassifiziert"
 | 
			
		||||
 | 
			
		||||
msgid "plan"
 | 
			
		||||
msgstr "planen"
 | 
			
		||||
msgid "verified"
 | 
			
		||||
msgstr "verifiziert"
 | 
			
		||||
 | 
			
		||||
# transitions
 | 
			
		||||
 | 
			
		||||
msgid "accept"
 | 
			
		||||
msgstr "annehmen"
 | 
			
		||||
 | 
			
		||||
msgid "start working"
 | 
			
		||||
msgstr "Arbeit beginnen"
 | 
			
		||||
msgid "archive"
 | 
			
		||||
msgstr "archivieren"
 | 
			
		||||
 | 
			
		||||
msgid "work"
 | 
			
		||||
msgstr "bearbeiten"
 | 
			
		||||
msgid "classify"
 | 
			
		||||
msgstr "klassifizieren"
 | 
			
		||||
 | 
			
		||||
msgid "finish"
 | 
			
		||||
msgstr "beenden"
 | 
			
		||||
msgid "change_classification"
 | 
			
		||||
msgstr "Klassifizierung ändern"
 | 
			
		||||
 | 
			
		||||
msgid "cancel"
 | 
			
		||||
msgstr "abbrechen"
 | 
			
		||||
 | 
			
		||||
msgid "close"
 | 
			
		||||
msgstr "abschließen"
 | 
			
		||||
 | 
			
		||||
msgid "delegate"
 | 
			
		||||
msgstr "delegieren"
 | 
			
		||||
 | 
			
		||||
msgid "finish"
 | 
			
		||||
msgstr "beenden"
 | 
			
		||||
 | 
			
		||||
msgid "hide"
 | 
			
		||||
msgstr "verstecken"
 | 
			
		||||
 | 
			
		||||
msgid "move"
 | 
			
		||||
msgstr "verschieben"
 | 
			
		||||
 | 
			
		||||
msgid "close"
 | 
			
		||||
msgstr "abschließen"
 | 
			
		||||
msgid "No change"
 | 
			
		||||
msgstr "keine Änderung"
 | 
			
		||||
 | 
			
		||||
msgid "plan"
 | 
			
		||||
msgstr "planen"
 | 
			
		||||
 | 
			
		||||
msgid "publish"
 | 
			
		||||
msgstr "veröffentlichen"
 | 
			
		||||
 | 
			
		||||
msgid "remove"
 | 
			
		||||
msgstr "entfernen"
 | 
			
		||||
 | 
			
		||||
msgid "release"
 | 
			
		||||
msgstr "freigeben"
 | 
			
		||||
 | 
			
		||||
msgid "re-open"
 | 
			
		||||
msgstr "zurücksetzen"
 | 
			
		||||
 | 
			
		||||
msgid "remove_classification"
 | 
			
		||||
msgstr "Klassifizierung entfernen"
 | 
			
		||||
 | 
			
		||||
msgid "retract"
 | 
			
		||||
msgstr "zurückziehen"
 | 
			
		||||
 | 
			
		||||
msgid "show"
 | 
			
		||||
msgstr "anzeigen"
 | 
			
		||||
 | 
			
		||||
msgid "start working"
 | 
			
		||||
msgstr "Arbeit beginnen"
 | 
			
		||||
 | 
			
		||||
msgid "verify"
 | 
			
		||||
msgstr "verifizieren"
 | 
			
		||||
 | 
			
		||||
msgid "work"
 | 
			
		||||
msgstr "bearbeiten"
 | 
			
		||||
 | 
			
		||||
# calendar
 | 
			
		||||
 | 
			
		||||
msgid "Monday"
 | 
			
		||||
msgstr "Montag"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,17 +35,17 @@ from loops.organize.stateful.base import StatefulLoopsObject
 | 
			
		|||
@implementer(IStatesDefinition)
 | 
			
		||||
def taskStates():
 | 
			
		||||
    return StatesDefinition('task_states',
 | 
			
		||||
        State('draft', 'draft', ('start', 'cancel',),
 | 
			
		||||
              color='yellow'),
 | 
			
		||||
        State('draft', 'draft', ('release', 'cancel',),
 | 
			
		||||
              color='blue'),
 | 
			
		||||
        State('active', 'active', ('finish', 'cancel',),
 | 
			
		||||
              color='yellow'),
 | 
			
		||||
        State('finished', 'finished', ('reopen', 'archive',),
 | 
			
		||||
              color='green'),
 | 
			
		||||
        State('cancelled', 'cancelled', ('reopen',),
 | 
			
		||||
              color='grey'),
 | 
			
		||||
              color='x'),
 | 
			
		||||
        State('archived', 'archived', ('reopen',),
 | 
			
		||||
              color='grey'),
 | 
			
		||||
        Transition('start', 'start', 'active'),
 | 
			
		||||
        Transition('release', 'release', 'active'),
 | 
			
		||||
        Transition('finish', 'finish', 'finished'),
 | 
			
		||||
        Transition('cancel', 'cancel', 'cancelled'),
 | 
			
		||||
        Transition('reopen', 're-open', 'draft'),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue