Commit 7591e7f6 authored by Mayoro Diagne's avatar Mayoro Diagne

2010-06-02 mayoro

* rename extension for egov security
* remove some word added by mistakes
* remove unused extension SetUpInstance

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35892 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ce0f6d61
##############################################################################
#
# Copyright (c) 2008 Nexedi SARL and Contributors. All Rights Reserved.
# Fabien Morin <fabien@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Testing import ZopeTestCase
from Products import ERP5Security
from Products import PluggableAuthService
def setUpEGovPas(self):
'''use safi PAS to be able to login organisation'''
portal = self.getPortalObject()
def getAclUsers(self):
return getattr(self.getPortalObject(), 'acl_users', None)
acl_users = getAclUsers(self)
# Add SAFIUserManager
ZopeTestCase.installProduct('SAFISecurity')
erp5security_dispatcher = acl_users.manage_addProduct['SAFISecurity']
# don't add it if it's already here
if {'meta_type': 'SAFI User Manager', 'id': 'safi_users'} not in \
erp5security_dispatcher._d._objects:
erp5security_dispatcher.addSAFIUserManager('safi_users')
if {'meta_type': 'SAFI Group Manager', 'id': 'safi_groups'} not in \
erp5security_dispatcher._d._objects :
erp5security_dispatcher.addSAFIGroupManager('safi_groups')
# Register ERP5UserManager Interface
acl_users.safi_users.manage_activateInterfaces(('IAuthenticationPlugin',
'IUserEnumerationPlugin',))
acl_users.safi_groups.manage_activateInterfaces(('IGroupsPlugin',))
# desactivate the erp5 plugin
plugins = acl_users.safi_groups.plugins
interface = plugins._getInterfaceFromName('IGroupsPlugin')
if 'erp5_groups' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_groups')
plugins = acl_users.safi_users.plugins
interface = plugins._getInterfaceFromName('IAuthenticationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
interface = plugins._getInterfaceFromName('IUserEnumerationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
# set properties to enable the login on Person and Organisation
acl_users.safi_users.manage_changeProperties(portal_type_list=[
'Person',
'Organisation',
'Subscription Form'],)
acl_users.safi_groups.manage_changeProperties(portal_type_list=[
'Person',
'Organisation',
'Subscription Form'],)
return '- PAS security set up completed'
def setUpIdGenerator(self):
'''set up id generator '_generatePerDayId' on all application wich need it'''
portal = self.getPortalObject()
portal_type_list = ['Subscription Form', 'Declaration TVA']
module_set_list = []
for portal_type in portal_type_list:
# get module
module = self.getDefaultModule(portal_type=portal_type, default=None)
if module is not None:
# set id generator on module
module.setIdGenerator('_generatePerDayId')
module_set_list.append(module.getId())
if len(module_set_list):
return '- ID Generator set on modules :\n * %s' \
% '\n * '.join(module_set_list)
return 'No module have been set with ID Generator !'
def setUpInstance(self):
'''call all other set up method to prepare the site for SAFI project'''
message_list = []
message_list.append(self.setUpEGovPas())
message_list.append(self.setUpIdGenerator())
message_list.append(self.publishAllWebPages())
message_list.append('')
message_list.append('Set Up sequence completed')
return '\n'.join(message_list)
def publishAllWebPages(self):
'''web pages are accessible by anonymous users only if they are published'''
web_page_module = self.getPortalObject().web_page_module
for web_page in web_page_module.contentValues():
web_page.publish()
return '- All Web pages are published'
......@@ -15,7 +15,7 @@
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SAFISecurity</string> </value>
<value> <string>EGovSecurity</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -83,8 +83,8 @@ if len(result) == 0:\n
organisation = result[0]\n
\n
# Build the message and translate it\n
subject = translateString("Your credential for ${site_address}", mapping=dict(site_address=\'www.safi.sn\'))\n
msg = """Thanks for registrering to SAFI. Now you can connect in on ${site_address} with this credentials : \n
subject = translateString("Your credential for ${site_address}", mapping=dict(site_address=\'www.erp5.org\'))\n
msg = """Thanks for registrering to ERP5. Now you can connect in on ${site_address} with this credentials : \n
\n
Login : ${login}\n
Password : ${password}\n
......@@ -92,7 +92,7 @@ Password : ${password}\n
This credentials are usefull to track your application and more. Please visit ${site_address} for more information.\n
"""\n
msg = translateString(msg,\n
mapping=dict(site_address=\'www.safi.sn\',\n
mapping=dict(site_address=\'www.erp5.org\',\n
login=organisation.getReference(),\n
password=organisation.getPassword())\n
)\n
......
......@@ -87,8 +87,8 @@ if len(result) == 0:\n
person = result[0]\n
\n
# Build the message and translate it\n
subject = translateString("Your credential for ${site_address}", mapping=dict(site_address=\'www.safi.sn\'))\n
msg = """Thanks for registrering to SAFI. Now you can connect in on ${site_address} with this credentials : \n
subject = translateString("Your credential for ${site_address}", mapping=dict(site_address=\'www.erp5.org\'))\n
msg = """Thanks for registrering to ERP5 EGov. Now you can connect in on ${site_address} with this credentials : \n
\n
Login : ${login}\n
Password : ${password}\n
......@@ -96,7 +96,7 @@ Password : ${password}\n
This credentials are usefull to track your application and more. Please visit ${site_address} for more information.\n
"""\n
msg = translateString(msg,\n
mapping=dict(site_address=\'www.safi.sn\',\n
mapping=dict(site_address=\'www.erp5.org\',\n
login=person.getReference(),\n
password=not_encrypt_password)\n
)\n
......
......@@ -55,7 +55,7 @@
</tal:bloc>\n
</div>\n
<div class="site_address">\n
<a href="http://www.safi.sn">http://www.safi.sn</a>\n
<a href="http://www.erp5.org">http://www.erp5.org</a>\n
</div>\n
<tal:bloc tal:condition="python: here.getPortalType() == \'Subscription Form\'">\n
<div class="login_and_password">\n
......
......@@ -66,14 +66,7 @@ except AttributeError:\n
my_group = None\n
\n
\n
\n
# XXX very bad but I don\'t know where workflow_id=egov_universal_workflow is hardcoded\n
#if context.getPortalType() == "Subscription Form":\n
# workflow_id = "egov_safi_tva_anonymous_workflow"\n
#elif context.getPortalType() == "Declaration TVA" or context.getPortalType() == "Declaration TVA Empty" or context.getPortalType() == "Declaration TVA Amendment":\n
# workflow_id = "egov_safi_tva_universal_workflow"\n
\n
workflow_id = "egov_universal_workflow"\n
#workflow_id = "egov_universal_workflow"\n
\n
my_group = context.getTypeInfo().getOrganisationDirectionService()\n
\n
......
......@@ -57,13 +57,13 @@ Description:\n
</div>\n
<div class="become_vip_explanations">\n
<tal:block i18n:domain="ui" i18n:translate="">\n
Safi is a major Internet portal for performing administrative formalities\n
ERP5 EGov is a major Internet portal for performing administrative formalities\n
online. It is a quick and easy way to make a statement, or a application for\n
jutificatif,... without having to move or to queue. For more\n
information, please click\n
</tal:block>\n
<a href="help/registerInformations" onclick="window.open(this.href,\n
\'safi_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\');\n
\'egov_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\');\n
return false;" i18n:translate="" i18n:domain="ui">here</a>\n
</div>\n
<tal:block metal:use-macro="here/WebSite_viewRegisterButton/macros/main"/>\n
......
......@@ -56,7 +56,7 @@
<a class="print" href="PDFDocument_viewAsPdf"\n
tal:attributes="href python: context.getPrintFormUrl()" i18n:translate="" i18n:domain="ui">Print</a>\n
</tal:block> \n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'safi_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'egov_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
</span>\n
</div>\n
</div>\n
......
......@@ -62,9 +62,9 @@
<a class="preferences" href="./preferences" i18n:translate="" i18n:domain="ui">Preferences</a>\n
</tal:block>\n
-->\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'safi_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'egov_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
</span><br /><br />\n
<span class="site_title" i18n:translate="" i18n:domain="ui">SAFI - Online Procedures</span>\n
<span class="site_title" i18n:translate="" i18n:domain="ui">EGov - Online Procedures</span>\n
\n
<hr/>\n
\n
......
......@@ -61,7 +61,7 @@
tal:attributes="href python: context.getPrintFormUrl()" i18n:translate="" i18n:domain="ui">Print</a>\n
</tal:block>\n
<!--<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" i18n:translate="" i18n:domain="ui">Help</a>-->\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'safi_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'egov_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
</span><hr/>\n
\n
</div>\n
......
......@@ -62,10 +62,10 @@
<a class="preferences" href="./preferences" i18n:translate="" i18n:domain="ui">Preferences</a>\n
</tal:block>\n
-->\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'safi_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
<a class="help" href="EGov_helpWithContext" tal:attributes="href python:\'help/\' + here.EGov_helpWithContext()" onclick="window.open(this.href, \'egov_help\',\'width=800,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes\'); return false;" i18n:translate="" i18n:domain="ui">Help</a>\n
\n
</span><br /><br />\n
<span class="site_title" i18n:translate="" i18n:domain="ui">SAFI - Online Procedures</span>\n
<span class="site_title" i18n:translate="" i18n:domain="ui">EGov - Online Procedures</span>\n
\n
<hr/>\n
\n
......
......@@ -78,7 +78,7 @@ form_id = form.getId()\n
procedure=translateString(form.getPortalType())\n
\n
\n
wf_info=form.Egov_getProcedureWorkflowStateInfo(\'egov_safi_tva_universal_workflow\',\'submitted\')\n
wf_info=form.Egov_getProcedureWorkflowStateInfo(\'egov_universal_workflow\',\'submitted\')\n
date_of_submission=wf_info[\'time\'].strftime(\'%d/%m/%y %H:%M\')\n
\n
subject = translateString("[SAFI] Your ${procedure} document number: ${form_id} has been submitted", \n
......
2010-06-02 mayoro
* rename extension for egov security
* remove some word added by mistakes
* remove unused extension SetUpInstance
2010-06-01 mayoro
* remove safi_egov
* remove portal_skins added by mistake
2010-06-01 mayoro
* New version of ERP5 egov based on dynamic form generated from sla and pdf files defined on portal_types
2009-09-07 yusuke
* Replace ERP5Report to ERP5Form and ReportBox
......
512
\ No newline at end of file
521
\ No newline at end of file
Captcha
ERP5EGov_Extensions
SetUpInstance
SAFISecurity
\ No newline at end of file
EGovSecurity
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment