Commit f3c7a7b0 authored by Roque's avatar Roque

erp5_web_project_ui: remove server scripts

parent cbeaa84a
project_title = context.getTitle()
portal_type='Assignment'
n_persons = 0
person_dict = {}
for assignment in context.portal_catalog(portal_type=portal_type,
destination_project_title=project_title):
person_url = assignment.getParentRelativeUrl()
if not person_url in person_dict:
if getCount:
person_dict[person_url] = person_url
n_persons += 1
else:
person_dict[person_url] = context.restrictedTraverse(person_url)
if getCount:
return n_persons
return person_dict
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>getCount=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_assignedPersons</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
project_title = context.getTitle()
portal_type='Bug'
import time
time.sleep(5)
state_list = ['confirmed']
if (closed):
state_list = ['delivered', 'stopped']
from DateTime import DateTime
now = DateTime()
now_minus_7 = now - 7
catalog_kw = {}#{'creation_date': {'query': (now_minus_7, now), 'range': 'minmax'}}
bug_list = [x for x in context.portal_catalog(portal_type=portal_type,
destination_project_title=project_title,
simulation_state=state_list,
**catalog_kw)]
'''
print bug_list
for x in bug_list:
print x.getTitle()
return printed
'''
if not bug_list:
return "0"
count = len(bug_list)
return count
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>closed=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_bugs</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
import time
time.sleep(4)
project_title = context.getTitle()
portal_type='Benchmark Result'
state_list = ['failed', 'stopped', 'public_stopped']
#from DateTime import DateTime
#now = DateTime()
#now_minus_7 = now - 7
#catalog_kw = {'creation_date': {'query': (now_minus_7, now), 'range': 'minmax'}}
catalog_kw = {}
bug_list = [x for x in context.portal_catalog(portal_type=portal_type,
source_project_title=project_title,
#simulation_state=state_list,
**catalog_kw)]
return "PASSED"
print bug_list
for x in bug_list:
print x.getTitle()
print x.getStringIndex()
return printed
if not bug_list:
return "0"
count = len(bug_list)
return count
return last_finished_test.getStringIndex()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>closed=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_lastTestResult</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
project_title = context.getTitle()
portal_type='Task Report'
state_list = ['confirmed']
if (closed):
state_list = ['delivered', 'stopped', 'draft']
from DateTime import DateTime
now = DateTime()
now_minus_7 = now - 7
catalog_kw = {'creation_date': {'query': (now_minus_7, now), 'range': 'minmax'}}
task_list = [x for x in context.portal_catalog(portal_type=portal_type,
source_project_title=project_title,
#simulation_state=state_list,
simulation_state='draft',
**catalog_kw)]
'''
print task_list
for x in task_list:
print x.getTitle()
return printed
'''
if not task_list:
return "0"
count = len(task_list)
return count
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>closed=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_taskReports</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
project_title = context.getTitle()
portal_type='Task'
state_list = ['confirmed']
task_list = [x for x in context.portal_catalog(portal_type=portal_type,
source_project_title=project_title,
simulation_state=state_list)]
if not task_list:
return "0"
count = len(task_list)
return count
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_tasks</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
project_title = context.getTitle()
portal_type='Task'
state_list = ['draft', 'planned', 'ordered', 'confirmed']
from DateTime import DateTime
now = DateTime()
now_minus_7 = now - 7
#catalog_kw = {'creation_date': {'query': (now_minus_7, now), 'range': 'minmax'}}
task_list = [x for x in context.portal_catalog(portal_type=portal_type,
source_project_title=project_title,
simulation_state=state_list) if x.getSourceTitle() == None]
'''
print task_list
for x in task_list:
print x.getTitle()
print x.getSourceTitle()
return printed
'''
if not task_list:
return "0"
count = len(task_list)
return count
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_tasksToAssigne</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment