[gen] Bugfix: do not show the Calendar widget (search and edit layouts) if field.calendar is False.

This commit is contained in:
Gaetan Delannay 2013-04-30 11:45:31 +02:00
parent 049ddb20b4
commit 97ddf7a2c4
2 changed files with 15 additions and 10 deletions

View file

@ -373,7 +373,6 @@ class ToolMixin(BaseMixin):
params['UID'] = getattr(refObject, refField.name).data params['UID'] = getattr(refObject, refField.name).data
# Use index "Allowed" if noSecurity is False # Use index "Allowed" if noSecurity is False
if not noSecurity: params['Allowed'] = self.getAllowedValue() if not noSecurity: params['Allowed'] = self.getAllowedValue()
print params
brains = self.getPath("/catalog")(**params) brains = self.getPath("/catalog")(**params)
if brainsOnly: if brainsOnly:
# Return brains only. # Return brains only.

View file

@ -40,9 +40,11 @@
tal:content="year"></option> tal:content="year"></option>
</select> </select>
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment> <tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<tal:calendar condition="widget/calendar">
<input type="hidden" tal:attributes="id name; name name"/> <input type="hidden" tal:attributes="id name; name name"/>
<img tal:attributes="id string:${name}_img; src string: $appUrl/ui/calendar.gif"/> <img tal:attributes="id string:${name}_img; src string: $appUrl/ui/calendar.gif"/>
<script type="text/javascript" tal:content="python: contextObj.getCalendarInit(name, years)"></script> <script type="text/javascript" tal:content="python: contextObj.getCalendarInit(name, years)"></script>
</tal:calendar>
<tal:hour condition="python: widget['format'] == 0"> <tal:hour condition="python: widget['format'] == 0">
<select tal:define="hours python:range(0,24);" <select tal:define="hours python:range(0,24);"
@ -107,9 +109,11 @@
tal:content="value" tal:attributes="value value"></option> tal:content="value" tal:attributes="value value"></option>
</select> </select>
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment> <tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<tal:calendar condition="widget/calendar">
<input type="hidden" tal:attributes="id fromName; name fromName"/> <input type="hidden" tal:attributes="id fromName; name fromName"/>
<img tal:attributes="id string:${fromName}_img; src string: $appUrl/ui/calendar.gif"/> <img tal:attributes="id string:${fromName}_img; src string: $appUrl/ui/calendar.gif"/>
<script type="text/javascript" tal:content="python: tool.getCalendarInit(fromName, years)"></script> <script type="text/javascript" tal:content="python: tool.getCalendarInit(fromName, years)"></script>
</tal:calendar>
</td> </td>
</tr> </tr>
<tal:comment replace="nothing">To</tal:comment> <tal:comment replace="nothing">To</tal:comment>
@ -138,9 +142,11 @@
tal:content="value" tal:attributes="value value"></option> tal:content="value" tal:attributes="value value"></option>
</select> </select>
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment> <tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
<tal:calendar condition="widget/calendar">
<input type="hidden" tal:attributes="id toName; name toName"/> <input type="hidden" tal:attributes="id toName; name toName"/>
<img tal:attributes="id string:${toName}_img; src string: $appUrl/ui/calendar.gif"/> <img tal:attributes="id string:${toName}_img; src string: $appUrl/ui/calendar.gif"/>
<script type="text/javascript" tal:content="python: tool.getCalendarInit(toName, years)"></script> <script type="text/javascript" tal:content="python: tool.getCalendarInit(toName, years)"></script>
</tal:calendar>
</td> </td>
</tr> </tr>
</table> </table>