Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
5a4f8069
Commit
5a4f8069
authored
Jun 17, 2015
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forge: skin folder proxy check, output html instead of text to display links to fields
This makes investigations more convenient
parent
f298c971
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_checkSkinFolderForms.xml
...m/portal_skins/erp5_toolbox/Base_checkSkinFolderForms.xml
+26
-11
No files found.
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_checkSkinFolderForms.xml
View file @
5a4f8069
...
...
@@ -50,16 +50,22 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
skin_folder = getattr(context.portal_skins, original_skin_name)\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
skin_folder = getattr(context.portal_skins, original_skin_name)\n
new_skin_folder = getattr(context.portal_skins, new_skin_name)\n
\n
output_list = []\n
output_append = output_list.append\n
output_append("<html>
")\n
output_append("
<body>
")\n
for original_form in skin_folder.objectValues():\n
if (original_form.meta_type==\'ERP5 Form\' or original_form.meta_type==\'ERP5 Report\') and not original_form.getId().endswith(\'FieldLibrary\'):\n
new_form = getattr(new_skin_folder, original_form.id)\n
for original_field in original_form.objectValues():\n
new_field = getattr(new_form, original_field.id, None)\n
if new_field is None:\n
print "Missing %s in %s" % (original_field.id, new_form
)\n
output_append("Missing %s in %s" % (original_field.id, new_form)
)\n
\n
else:\n
\n
...
...
@@ -69,29 +75,38 @@ for original_form in skin_folder.objectValues():\n
new_value_dict, new_value_tales = context.Base_getFieldData(new_field)\n
except AttributeError:\n
new_value_dict = new_value_tales = None\n
print "Dead proxy field %s %s" % (original_field.id, new_form
)\n
output_append("Dead proxy field %s %s" % (original_field.id, new_form)
)\n
\n
if new_value_dict is not None:\n
\n
if (original_value_dict != new_value_dict) or \\\n
(original_value_tales != new_value_tales):\n
\n
print new_form.id, new_field.id\n
output_append("%s %s
<a
href=
\'%s\'
>
old
</a>
<a
href=
\'%s\'
>
new
</a>
" % (\n
new_form.id, new_field.id,\n
original_field.absolute_url() + \'/manage_main\',\n
new_field.absolute_url() + \'/manage_main\'))\n
output_append("
<blockquote><ul>
")\n
\n
\n
for key, original_value in original_value_dict.items():\n
if original_value != new_value_dict[key]:\n
print " ", key, \'Origin: %s \' % original_value, \'New: %s \' % new_value_dict[key]\n
output_append("
<li>
" + key + \' Origin: %s \' % original_value \\\n
+ \' New: %s
</li>
\' % new_value_dict[key])\n
\n
for key, original_value in original_value_tales.items():\n
if original_value != new_value_tales[key]:\n
print " ", key, \'Origin: %s \' % original_value, \'New: %s \' % new_value_tales[key]
\n
\n
# print \'\\n\'
\n
output_append("
<li>
" + key + \' Origin: %s \' % original_value \\
\n
+ \' New: %s
<br></li>
\' % new_value_tales[key])
\n
output_append("
</ul></blockquote>
")
\n
\n
print \'OK\' \n
return printed\n
</string>
</value>
output_append("Finished
<br>
")\n
output_append("
</body>
")\n
output_append("
</html>
")\n
return "\\n".join(output_list)\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment