From 30b428465f9fc37ec5f44383e19f3c57139c0a76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl>
Date: Fri, 29 Feb 2008 12:11:43 +0000
Subject: [PATCH] a script for setting standard Polish holidays in Group
 Calendar (only these which occur always on the same date)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19581 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...sencePeriod_setPolishHolidayExceptions.xml | 173 ++++++++++++++++++
 bt5/erp5_accounting_l10n_pl/bt/revision       |   2 +-
 2 files changed, 174 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/GroupPresencePeriod_setPolishHolidayExceptions.xml

diff --git a/bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/GroupPresencePeriod_setPolishHolidayExceptions.xml b/bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/GroupPresencePeriod_setPolishHolidayExceptions.xml
new file mode 100644
index 0000000000..38dea47b73
--- /dev/null
+++ b/bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/GroupPresencePeriod_setPolishHolidayExceptions.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>"""\n
+  This script sets all standard (non-movable) holidays for polish calendar\n
+  on context Group Calendar Period.\n
+  Year defaults to current year.\n
+"""\n
+\n
+part_holiday_list = [\'01-01\',\'05-01\',\'05-03\',\'08-15\',\'11-01\',\'11-11\',\'12-25\',\'12-26\']\n
+holiday_list = [\'-\'.join((str(year),holiday))  for holiday in part_holiday_list]\n
+\n
+for day in holiday_list:\n
+   holiday = DateTime(day)\n
+   context.newContent(portal_type = \'Calendar Exception\',\n
+                      exception_date = holiday)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>year = DateTime().year()</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>year</string>
+                            <string>part_holiday_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>holiday</string>
+                            <string>_getattr_</string>
+                            <string>str</string>
+                            <string>holiday_list</string>
+                            <string>day</string>
+                            <string>DateTime</string>
+                            <string>context</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <int>2008</int>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>GroupPresencePeriod_setPolishHolidayExceptions</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting_l10n_pl/bt/revision b/bt5/erp5_accounting_l10n_pl/bt/revision
index 368f89ceef..d99e90eb96 100644
--- a/bt5/erp5_accounting_l10n_pl/bt/revision
+++ b/bt5/erp5_accounting_l10n_pl/bt/revision
@@ -1 +1 @@
-28
\ No newline at end of file
+29
\ No newline at end of file
-- 
2.30.9