Commit 0c8e71bf authored by Łukasz Nowak's avatar Łukasz Nowak

- force user to provide title of each service

 - force unicity of title


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43816 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d74cc9bd
master ERP5Type_no_immediate_reindexation allow_login_change allow_login_change_differentiate_id_and_login allow_login_change_wip arnau arnau-kns arnau-kns-without-property-mapping arnau-merge arnau-poc auto_extend_select_list autoflake backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog boc-interaction-drop cache catalog_fulltext catalog_fulltext_old cedric cedriclen cedriclen-eos cert certificate_authority cherry-pick-4a8e045d ckeditor_update cleanJSByJSLint clean_up_upgrader cmfactivity compact_title_no_reference credential_update_action datetimefield deferred_listbox douglas_forum dream_distributor drop-legacy-simulation echarts_with_event echarts_wrapper eos-dev erp5-component erp5-data-notebook erp5-doc erp5-forum erp5-preference erp5-release erp5-slapos-upgrade erp5-util-testing erp5-vifib erp5-vifib-cleanup erp5_calendar erp5_free_subscription erp5_notebook erp5_notebook_remove erp5_officejs_fixing erp5_tutorial_backup erp5_workflow erp5jsaccesspage fix/accounting_period_constraint_vs_acquired_node fix/change_state_priority fix/login_validate_check_consistency fix_system_processes_ownership for_private_testrunner_1 for_testrunner_1 for_testrunner_2 formbox gabriel gabriel-fix-rounding-in-accounting-generation gabriel-fix-rounding-in-accounting-generation2 gadget-json-value http_cache_fix import_zip_package improve_default_caching_policy_manager interaction-drop isDeletable item_tracking_graph_editor ivan jerome-bt-reference-doc jerome-test jerome_events jerome_graph_editor_renderjs jerome_new_style_solve_divergence jerome_promise_in_tests jerome_user_preference_time_zone jio jm/form-action-guard joblib-activity kns kns-kr lazy_simulation_causality lignan lingnan listbox-generator mame mame-bt5-cleanup mame-erp5_project-cleanup mame-naming-convention mame-naming-convention-list_method mame-test-stock-indexation mame-work mame2 master-erp5-test-result-scalability master-erp5-test-result-scalability-rebase master-test-fix-additionalbt5path master_calendar_wip_patches master_calendar_wip_patches_extend_security master_no_guard_on_workflow_transition master_no_guard_on_workflow_transition_plus_calendar_wip_patchs master_test merge_xhtml_jquery mmariani-inventory mrp new-render-presentation new_notebook_sub nexedi-erp5-jp no_longer_simulated_state notebook_submodule notebook_submodule_backup officejs officejs_clean officejs_mixing_echarts pere portal_callables portal_solver_process_security_configuration presentation pyodide pyodide_backup pyodide_bk pyodide_external pyodide_submodule pyodide_submodule_normal pyodide_webworker rapid_wechat rebased_mrp reindex reindex_calendar_after_change_calendar_exception resursive_clone romain-fulltext scalability-master2 scalability-master2-rebase scalability-rebase shop-box simulation slapos_master slapos_tutorial sms_more_than_140_characters strict_catalog submodule support_request support_request_1 support_request_2 support_request_3 support_request_4 support_request_update syncml test_page testnode_software_link timezones tristan tristan-merge tristan-performance ttr ttrm upgradeSite view-aggregated-amounts vifib-fixup vivekpab_erp5webrenderjs_layoutconfig vivekpab_jabberclient vivekpab_renderjs_interfaces wechat_test wenjie wenjie_branch xiaowu_newui yryr yryr-components-cp yryr-inventory-cache yryr-test yryr-with-components yusei erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -50,24 +50,44 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Add selected product to the cart and continue"""\n
<value> <string encoding="cdata"><![CDATA[
"""Add selected product to the cart and continue"""\n
portal = context.getPortalObject()\n
\n
if len(uids) != 1:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString("Please select one service.")})\n
else:\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
params["instance_software_product_uid"] = uids[0]\n
portal.portal_selections.setSelectionParamsFor(\'vifib_session_id\', params)\n
\n
if not service_title:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString("You have to provide Service Title.")})\n
\n
software_instance_list = context.portal_catalog(\n
portal_type=\'Software Instance\',\n
select_expression=\'title\',\n
title={\'query\': service_title, \'key\': \'ExactMatch\'}\n
)\n
\n
if len(software_instance_list) > 0:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString(\n
"You already have service named ${service_title}. Please choose different unique name.", mapping={\'service_title\': service_title})})\n
\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
params["instance_software_product_uid"] = uids[0]\n
params["service_title"] = service_title\n
portal.portal_selections.setSelectionParamsFor(\'vifib_session_id\', params)\n
\n
if kw.has_key(\'came_from\'):\n
#we override the context to redirect the user to the next web section\n
context = portal.restrictedTraverse(kw[\'came_from\'])\n
\n
context.WebSection_viewNextStep()\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -77,7 +97,7 @@ context.WebSection_viewNextStep()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id, uids=[], quantity = 1, reset_shopping_cart=True, **kw</string> </value>
<value> <string>dialog_id, service_title, uids=[], quantity = 1, reset_shopping_cart=True, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -97,13 +117,14 @@ context.WebSection_viewNextStep()\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>4</int> </value>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>dialog_id</string>
<string>service_title</string>
<string>uids</string>
<string>quantity</string>
<string>reset_shopping_cart</string>
......@@ -112,6 +133,7 @@ context.WebSection_viewNextStep()\n
<string>context</string>
<string>portal</string>
<string>len</string>
<string>software_instance_list</string>
<string>session</string>
<string>params</string>
<string>_getitem_</string>
......
......@@ -71,12 +71,12 @@ person.edit(\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
instance_software_release_uid = params[\'instance_software_release_uid\']\n
\n
service_title = params[\'service_title\']\n
software_release = portal.portal_catalog.getResultValue(uid=instance_software_release_uid)\n
\n
person.requestSoftwareInstance(\n
software_release=software_release.getUrlString(),\n
software_title=software_release.getTitle(), # XXX: This shall be provided by user to allow him have more then one Software Instance of given Software Release\n
software_title=service_title,\n
instance_xml="""<?xml version="1.0" encoding="utf-8"?>\n
<instance>\n
<parameter id="nbd_ip">2a01:e35:2e27:460:e2cb:4eff:fed9:48dc</parameter>\n
......@@ -142,6 +142,7 @@ return context.getWebSiteValue().Base_redirect(keep_items={\'portal_status_messa
<string>params</string>
<string>_getitem_</string>
<string>instance_software_release_uid</string>
<string>service_title</string>
<string>software_release</string>
<string>message</string>
</tuple>
......
......@@ -99,6 +99,7 @@
<value>
<list>
<string>my_description</string>
<string>your_service_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_service_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Service Title</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
278
\ No newline at end of file
279
\ 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