diff --git a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml index b54a4c1df1c72a9a20c7ac185b8f32ae7e010858..d2c6d44dc133dc23dd68ff66749592e8e4ae509d 100644 --- a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml +++ b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml @@ -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> diff --git a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml index c1eb7c582ad5cb8ad7f2785d6c7339ff660ae812..e3e49744d8a14e6ebcc8066d13b09ddd38e28cc8 100644 --- a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml +++ b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml @@ -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> diff --git a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml index e204c5229f4181dbfe6b56b88b60971b768fcaff..8c90a77a1e3f6609eda733c69ad217302825e5e6 100644 --- a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml +++ b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml @@ -99,6 +99,7 @@ <value> <list> <string>my_description</string> + <string>your_service_title</string> </list> </value> </item> diff --git a/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..542ea1dd764a2ff089b9970afadf7c9171379872 --- /dev/null +++ b/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml @@ -0,0 +1,260 @@ +<?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> diff --git a/bt5/vifib_web/bt/revision b/bt5/vifib_web/bt/revision index c6876402f55fcc4178060d4f0b5d16a8e23a5c96..ac7cd1ac708f39a4800c68c43a53d17b65a2ce07 100644 --- a/bt5/vifib_web/bt/revision +++ b/bt5/vifib_web/bt/revision @@ -1 +1 @@ -278 \ No newline at end of file +279 \ No newline at end of file