|
@@ -85,9 +85,10 @@ class PBNodeStatus(object):
|
85
|
85
|
|
86
|
86
|
StatusList = dict()
|
87
|
87
|
StatusList['immortal'] = PBNodeStatusItem('immortal', 'Information', 'normal', 'icon-g-circle-info', 'pod-status-grey-light')
|
88
|
|
- StatusList['new'] = PBNodeStatusItem('new', 'New', 'open', 'icon-g-lightbulb icon-g-white', 'btn-info')
|
89
|
|
- StatusList['inprogress'] = PBNodeStatusItem('inprogress', 'In progress', 'open', ' icon-g-roundabout icon-g-white', 'btn-success')
|
90
|
|
- StatusList['standby'] = PBNodeStatusItem('standby', 'In Standby', 'open', 'icon-g-clock icon-g-white', 'btn-warning')
|
|
88
|
+ StatusList['new'] = PBNodeStatusItem('new', 'New', 'open', 'icon-g-lightbulb icon-g-white', 'btn-success')
|
|
89
|
+ StatusList['inprogress'] = PBNodeStatusItem('inprogress', 'In progress', 'open', ' icon-g-roundabout icon-g-white', 'btn-info')
|
|
90
|
+ StatusList['actiontodo'] = PBNodeStatusItem('actiontodo', 'Waiting for action', 'open', 'icon-g-clock icon-g-white', 'btn-info')
|
|
91
|
+ StatusList['standby'] = PBNodeStatusItem('standby', 'Waiting for answer', 'open', 'icon-g-clock icon-g-white', 'btn-warning')
|
91
|
92
|
StatusList['hot'] = PBNodeStatusItem('hot', 'Hot', 'open', 'icon-g-warning-sign icon-g-white', 'btn-danger')
|
92
|
93
|
StatusList['done'] = PBNodeStatusItem('done', 'Done', 'closed', 'icon-g-ok-2', 'pod-status-grey-light')
|
93
|
94
|
StatusList['closed'] = PBNodeStatusItem('closed', 'Closed', 'closed', 'icon-g-lightbulb', 'pod-status-grey-middle')
|
|
@@ -99,6 +100,7 @@ class PBNodeStatus(object):
|
99
|
100
|
return [
|
100
|
101
|
PBNodeStatus.StatusList['immortal'],
|
101
|
102
|
PBNodeStatus.StatusList['new'],
|
|
103
|
+ PBNodeStatus.StatusList['actiontodo'],
|
102
|
104
|
PBNodeStatus.StatusList['inprogress'],
|
103
|
105
|
PBNodeStatus.StatusList['standby'],
|
104
|
106
|
PBNodeStatus.StatusList['hot'],
|
|
@@ -112,8 +114,6 @@ class PBNodeStatus(object):
|
112
|
114
|
|
113
|
115
|
@classmethod
|
114
|
116
|
def getStatusItem(cls, psStatusId):
|
115
|
|
- print "====> ID=", psStatusId
|
116
|
|
- print "====> ITEM=", PBNodeStatus.StatusList[psStatusId]
|
117
|
117
|
return PBNodeStatus.StatusList[psStatusId]
|
118
|
118
|
|
119
|
119
|
class PBNodeType(object):
|
|
@@ -130,18 +130,11 @@ class PBNode(object):
|
130
|
130
|
|
131
|
131
|
def getChildrenOfType(self, plNodeTypeList, plSortingCriteria):
|
132
|
132
|
"""return all children nodes of type 'data' or 'node' or 'folder'"""
|
133
|
|
- print "NODE = ", self.node_id
|
134
|
|
- print "######"
|
135
|
|
- print plNodeTypeList
|
136
|
|
- print "######"
|
137
|
|
- print "######"
|
138
|
|
-
|
139
|
133
|
return DBSession.query(PBNode).filter(PBNode.parent_id==self.node_id).filter(PBNode.node_type.in_(plNodeTypeList)).order_by(plSortingCriteria).all()
|
140
|
134
|
|
141
|
135
|
|
142
|
136
|
def getChildNb(self):
|
143
|
137
|
liChildNb = DBSession.query(PBNode).filter(PBNode.parent_id==self.node_id).filter(PBNode.node_type==PBNodeType.Data).count()
|
144
|
|
- print "CHILDREN of ", self.node_id, " are ", liChildNb
|
145
|
138
|
return liChildNb
|
146
|
139
|
|
147
|
140
|
def getChildren(self):
|
|
@@ -153,12 +146,6 @@ class PBNode(object):
|
153
|
146
|
return self.getChildrenOfType([PBNodeType.Contact], PBNode.data_label.asc())
|
154
|
147
|
|
155
|
148
|
def getEvents(self):
|
156
|
|
- """print "---------------------------"
|
157
|
|
- print self.getChildrenOfType((PBNodeType.Event,), PBNode.data_datetime.desc())
|
158
|
|
- print "---------------------------"
|
159
|
|
- print "---------------------------"
|
160
|
|
- return self.getChildrenOfType((PBNodeType.Event,), PBNode.data_datetime.desc())
|
161
|
|
- """
|
162
|
149
|
return DBSession.query(PBNode).filter(PBNode.parent_id==self.node_id).filter(PBNode.node_type==PBNodeType.Event).order_by(PBNode.data_datetime.desc()).all()
|
163
|
150
|
return []
|
164
|
151
|
|