Commit 51a3455e by Roque

erp5_web_project_ui: new skin folder with project quick view form, scripts and gadgets

1 parent afb7b189
Showing 26 changed files with 1497 additions and 5 deletions
......@@ -18,16 +18,16 @@
.declareMethod("render", function (options) {
var gadget = this;
return gadget.redirect({
'command': 'display',
'command': 'display_with_history',
'options': {
'page': 'form',
'editable': 1,
'editable': 0,
'jio_key': 'project_module',
'view': 'view',
'field_listbox_sort_list:json': [["title", "ascending"]],
'field_listbox_column_list:json': ["title",
"default_destination_section_title"],
'extended_search': 'translated_validation_state_title: "Started"'
'extended_search': 'selection_domain_state_project_domain: "started"'
}
});
});
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.3070.57073.63914</string> </value>
<value> <string>979.17630.57336.31863</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1570796095.48</float>
<float>1571669928.81</float>
<string>UTC</string>
</tuple>
</state>
......
project_title = context.getTitle()
portal_type='Person'
person_list = [x for x in context.portal_catalog(portal_type=portal_type,
destination_project_title=project_title)]
person_list = [line for line in context.objectValues(portal_type="Person")]
'''
print person_list
for x in person_list:
print x.getTitle()
return printed
'''
if not person_list:
return "0"
count = len(person_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_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>
from Products.ERP5Type.Log import log
request = context.REQUEST
if url_dict:
jio_key = context.getRelativeUrl()
return {
'command': 'display',
'options': {
'jio_key': jio_key,
'editable': True
},
'view_kw': {
'view': 'Project_viewQuickOverview',
'jio_key': jio_key,
}
}
else:
return {}
<?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>brain, url_dict=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_getQuickViewUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Return parameters to correctly display the RenderJS gadget
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
# context_url: relative url of the context calling this script
from Products.ERP5Type.Log import log
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
reference = context.getReference() + "-Home.Page"
home_page = portal_catalog.getResultValue(
portal_type = 'Web Page',
reference = reference)
if home_page:
content = home_page.getTextContent()
else:
content = ""
return [('project_title', context.getTitle()), ('jio_key', context.getRelativeUrl()), ('home_page_content', content)]
<?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_getRenderJSExtraInfoParameterList</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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>