[Erp5-report] r43816 luke - in /erp5/trunk/bt5/vifib_web: SkinTemplateItem/portal_skins/vif...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Feb 28 16:10:50 CET 2011


Author: luke
Date: Mon Feb 28 16:10:49 2011
New Revision: 43816

URL: http://svn.erp5.org?rev=43816&view=rev
Log:
 - force user to provide title of each service
 - force unicity of title

Added:
    erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml
Modified:
    erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml
    erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml
    erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml
    erp5/trunk/bt5/vifib_web/bt/revision

Modified: erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml?rev=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml [utf8] (original)
+++ erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_addSelectedSoftwareProductToShoppingCart.xml [utf8] Mon Feb 28 16:10:49 2011
@@ -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>

Modified: erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml?rev=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml [utf8] (original)
+++ erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_setCustomerInformation.xml [utf8] Mon Feb 28 16:10:49 2011
@@ -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_re
                             <string>params</string>
                             <string>_getitem_</string>
                             <string>instance_software_release_uid</string>
+                            <string>service_title</string>
                             <string>software_release</string>
                             <string>message</string>
                           </tuple>

Modified: erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml?rev=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml [utf8] (original)
+++ erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog.xml [utf8] Mon Feb 28 16:10:49 2011
@@ -99,6 +99,7 @@
                     <value>
                       <list>
                         <string>my_description</string>
+                        <string>your_service_title</string>
                       </list>
                     </value>
                 </item>

Added: erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml?rev=43816&view=auto
==============================================================================
--- erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml (added)
+++ erp5/trunk/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewServiceChoiceDialog/your_service_title.xml [utf8] Mon Feb 28 16:10:49 2011
@@ -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>

Modified: erp5/trunk/bt5/vifib_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/vifib_web/bt/revision?rev=43816&r1=43815&r2=43816&view=diff
==============================================================================
--- erp5/trunk/bt5/vifib_web/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/vifib_web/bt/revision [utf8] Mon Feb 28 16:10:49 2011
@@ -1 +1 @@
-278
\ No newline at end of file
+279
\ No newline at end of file



More information about the Erp5-report mailing list