Commit 8675dc7d authored by Jean-Paul Smets's avatar Jean-Paul Smets

initial check in


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1220 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c327d48
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Active Process Results</title>
<name>ActiveProcess_view</name>
<action></action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Id</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_title</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">40</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Title</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
<field><id>my_error_list_text</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">25</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">1</required>
<title>Errors</title>
<width type="int">80</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "ERP5Site_reindexCurrentMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
folder_id_list = ['mouvement_mp', 'mouvement_pf', 'livraison_achat',
'livraison_vente', 'livraison_fabrication']
for folder in context.portal_url.getPortalObject().objectValues(("ERP5 Folder",)):
if folder.getId() in folder_id_list:
print "#### Indexing contents inside folder %s ####" % folder.id
for o in folder.objectValues():
o.activate(priority=5).recursiveImmediateReindexObject()
return printed
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Validate</title>
<name>base_folder_workflow_action</name>
<action>Folder_workflowStatusModify</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">40</width>
</values>
<tales>
<default>python:''</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>my_workflow_action</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_action</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_workflow_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "LivraisonVente_fixEqualQuantity"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
blist = list(context.LivraisonVente_searchEqualQuantity())
context.portal_simulation.commitTransaction()
for b in blist:
o = b.getObject()
if o is not None:
if o.getQuantity() != o.getRelatedQuantity():
if o.getRelatedQuantity() is None:
print "Not Fixeable %s %s %s" % (o.getRelativeUrl(), o.getQuantity(), o.getRelatedQuantity())
else:
print "Fixed %s %s %s" % (o.getRelativeUrl(), o.getQuantity(), o.getRelatedQuantity())
o.edit(quantity = o.getRelatedQuantity())
return printed
## Script (Python) "LivraisonVente_fixNoneQuantity"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
blist = list(context.LivraisonVente_searchNoneQuantity())
context.portal_simulation.commitTransaction()
for b in blist:
o = b.getObject()
if o is not None:
if o.getQuantity() == o.getRelatedQuantity():
#print "Fixed equal %s %s %s" % (o.getRelativeUrl(), o.getQuantity(), o.getRelatedQuantity())
#o.edit(quantity = o.getQuantity(), force_update = 1)
pass
else:
if o.getRelatedQuantity() is None:
print "Not Fixeable %s %s %s" % (o.getRelativeUrl(), o.getQuantity(), o.getRelatedQuantity())
else:
print "Fixed different %s %s %s" % (o.getRelativeUrl(), o.getQuantity(), o.getRelatedQuantity())
o.edit(quantity = o.getRelatedQuantity())
o.commitTransaction()
return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT
catalog.*
FROM
catalog LEFT JOIN movement ON (catalog.uid = movement.uid)
WHERE
catalog.portal_type = "Sales Packing List Line"
AND movement.is_accountable = 1
AND movement.quantity = movement.target_quantity
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT
catalog.*
FROM
catalog LEFT JOIN movement ON (catalog.uid = movement.uid)
WHERE
catalog.portal_type = "Sales Packing List Line"
AND movement.is_accountable = 1
AND movement.has_cell_content = 0
\ No newline at end of file
## Script (Python) "Movement_resetTargetQuantity"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
movement = context
movement.setProperty(key='target_quantity',value=0)
## Script (Python) "PortalSimulation_updateInventory"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
for b in context.SimulationTool_zGetSortedInventoryList():
print "#### Indexing Inventory %s ####" % b.relative_url
o = b.getObject()
if o is not None: o.activate(priority=4).recursiveImmediateReindexObject()
return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
processing_node
method_id
uid=None</params>
UPDATE message
SET
processing_node=<dtml-sqlvar processing_node type="int">,
processing=0
WHERE
<dtml-if uid>
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
<dtml-else>
path = <dtml-sqlvar path type="string">
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>processing_node
method_id
path</params>
SELECT uid FROM
message
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid:list
priority</params>
UPDATE
message
SET
priority = <dtml-sqlvar priority type="int">,
processing = 0
WHERE
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
processing_node
method_id
uid:int=0</params>
UPDATE message_queue
SET
processing_node=<dtml-sqlvar processing_node type="int">,
processing=0
WHERE
<dtml-if path> path = <dtml-sqlvar path type="string">
<dtml-else> uid = <dtml-sqlvar uid type="int"> </dtml-if>
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE `message_queue` (
`uid` int(11) NOT NULL auto_increment,
`path` VARCHAR(255),
`method_id` VARCHAR(40),
`processing_node` INT DEFAULT -1,
`processing` INT DEFAULT 0,
`priority` INT DEFAULT 0,
`message` BLOB,
PRIMARY KEY (`uid`),
KEY `path` (`path`),
KEY `method_id` (`method_id`),
KEY `processing_node` (`processing_node`),
KEY `processing` (`processing`),
KEY `priority` (`priority`),
) TYPE = InnoDB;
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM
message_queue
WHERE
uid = <dtml-sqlvar uid type="int">
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1
max_cache:100
cache_time:1
class_name:
class_file:
</dtml-comment>
<params>path
method_id</params>
SELECT count(path) as message_count FROM
message_queue
<dtml-if "path or method_id">
WHERE
<dtml-if path> path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
UPDATE message_queue
SET processing=1
WHERE
uid = <dtml-sqlvar uid type="int">
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>processing_node
priority</params>
SELECT * FROM
message_queue
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if priority> AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
method_id
processing_node
priority</params>
SELECT * FROM
message_queue
WHERE
processing <> 1
<dtml-if processing_node>AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if priority>AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
priority</params>
UPDATE
message_queue
SET
priority = <dtml-sqlvar priority type="int">,
processing = 0
WHERE
uid = <dtml-sqlvar uid type="int">
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
method_id
message
priority</params>
INSERT INTO message_queue
SET
path = <dtml-sqlvar path type="string">,
method_id = <dtml-sqlvar method_id type="string">,
processing_node = -1,
processing = -1,
priority = <dtml-sqlvar priority type="int">,
message = <dtml-sqlvar message type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT
catalog.*
FROM
catalog LEFT JOIN movement ON(catalog.uid=movement.uid)
WHERE
catalog.portal_type = "Inventory MP"
OR catalog.portal_type = "Inventory PF"
ORDER BY
movement.start_date
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Validate</title>
<name>base_folder_workflow_action</name>
<action>folder_workflow_status_modify</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">40</width>
</values>
<tales>
<default>python:''</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>my_workflow_action</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_action</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_workflow_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Validate</title>
<name>base_folder_workflow_action</name>
<action>folder_workflow_status_modify_test</action>
<enctype>multipart/form-data</enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">40</width>
</values>
<tales>
<default>python:''</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>my_workflow_action</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_action</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_workflow_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Validate</title>
<name>base_folder_workflow_action</name>
<action>folder_workflow_status_modify</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">40</width>
</values>
<tales>
<default>python:''</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>my_workflow_action</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_action</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_workflow_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.workflow_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "folder_workflow_status_modify_test"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=form_id,dialog_id,selection_name
##title=
##
from Products.Formulator.Errors import ValidationError, FormValidationError
request=context.REQUEST
error_message = ''
return context.REQUEST
try:
# Validate the form
form = getattr(context,dialog_id)
form.validate_all_to_request(request)
kw = {}
for f in form.get_fields():
k = f.id
k = k[3:]
v = getattr(request,k,None)
if v is not None:
kw[k] = v
selection_list = context.portal_selections.callSelectionFor(selection_name, context=context)
for selection_item in selection_list:
o = selection_item.getObject()
workflow_action = kw['workflow_action']
action_list = o.portal_workflow.getActionsFor(o)
action_list = filter(lambda x:x.has_key('id'), action_list )
action_id_list = map(lambda x:x['id'], action_list)
# If the user is not allowed to do this transition, it will not be in action_list
if workflow_action in action_id_list:
o.portal_workflow.doActionFor(
o,
workflow_action,
wf_id=kw['workflow_id'],
**kw)
# We will check if there's an error_message
history_data = None
try:
history_data = o.portal_workflow.getInfoFor(ob=o, name='history')
except:
pass
redirect_url = None
if history_data is not None:
last_history_data = history_data[len(history_data)-1]
this_error = last_history_data.get('error_message')
if this_error != None and this_error != '':
error_message += this_error + "-"
except FormValidationError, validation_errors:
# Pack errors into the request
field_errors = form.ErrorFields(validation_errors)
request.set('field_errors', field_errors)
return form(request)
except ValueError, value_error:
# Pack errors into the request
redirect_url = '%s/%s?%s%s' % ( context.absolute_url(), form_id
, 'portal_status_message=',value_error
)
context.REQUEST[ 'RESPONSE' ].redirect( redirect_url )
else:
if error_message != None and error_message != '':
redirect_url = '%s/%s?%s' % ( context.absolute_url(), form_id
, 'portal_status_message=%s' % error_message
)
pass
if redirect_url is None:
redirect_url = '%s/%s?%s' % ( context.absolute_url(), form_id
, 'portal_status_message=Status+changed.'
)
context.REQUEST[ 'RESPONSE' ].redirect( redirect_url )
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>category_uid</params>
SELECT DISTINCT
catalog.uid, catalog.path
FROM
catalog, category
WHERE
catalog.uid = category.uid
AND category.category_uid = <dtml-sqlvar category_uid type="int">
\ No newline at end of file
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