From 93415096755d32188bbadb6a0de4ca753102ff29 Mon Sep 17 00:00:00 2001
From: Jonathan Loriette <john@nexedi.com>
Date: Mon, 27 Jun 2005 16:17:15 +0000
Subject: [PATCH] add setZoom function used by PlanningBox

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3360 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/SelectionTool.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/product/ERP5Form/SelectionTool.py b/product/ERP5Form/SelectionTool.py
index d468252cc7..cfe2ffc336 100755
--- a/product/ERP5Form/SelectionTool.py
+++ b/product/ERP5Form/SelectionTool.py
@@ -521,6 +521,28 @@ class SelectionTool( UniqueObject, SimpleItem ):
       self.uncheckAll(selection_name, listbox_uid)
       return self.checkAll(selection_name, uids, REQUEST=REQUEST)
 
+    
+    security.declareProtected(ERP5Permissions.View, 'setZoom')
+    
+    def setZoom(self, uids=None, REQUEST=None):
+      """
+      Set graphic zoom in PlanningBox
+      """  
+      if uids is None: uids = []
+      request = REQUEST  
+      zoom=request.get('zoom')
+      selection_name=request.list_selection_name
+      selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
+      if selection is not None:
+        params = selection.getParams()
+        params['zoom'] = zoom
+        selection.edit(params= params)
+      referer = request['HTTP_REFERER']
+      referer = referer.replace('reset=', 'noreset=')
+      referer = referer.replace('reset:int=', 'noreset:int=')
+      return request.RESPONSE.redirect(referer) 
+    
+    
     security.declareProtected(ERP5Permissions.View, 'setDomainRoot')
     def setDomainRoot(self, REQUEST):
       """
-- 
2.30.9