modules/org.openbravo.client.application/src-db/database/model/functions/OBUIAPP_LANGUAGE_CREATE.xml
changeset 10777 379b55d7906e
child 10780 bcc1e52f9ea9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/model/functions/OBUIAPP_LANGUAGE_CREATE.xml	Fri Feb 18 11:36:51 2011 +0100
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION OBUIAPP_LANGUAGE_CREATE">
+    <function name="OBUIAPP_LANGUAGE_CREATE" type="NULL">
+      <parameter name="ep_instance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2010 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+
+  v_rowcount NUMBER;
+
+  BEGIN
+    INSERT INTO OBUIAPP_Parameter_Trl  
+           (OBUIAPP_PARAMETER_TRL_ID, AD_CLIENT_ID, AD_ORG_ID               ,                                             
+            ISACTIVE                , CREATED     , CREATEDBY               ,                                             
+            UPDATED                 , UPDATEDBY   , OBUIAPP_PARAMETER_ID    ,                                             
+            NAME                    , DESCRIPTION , HELP                    ,                                             
+            ISTRANSLATED            , AD_LANGUAGE)
+     SELECT get_uuid()              , p.AD_CLIENT_ID, p.AD_ORG_ID           ,                                             
+            p.ISACTIVE              , now()     , '0'                       ,                                             
+            now()                   , '0'       , p.OBUIAPP_PARAMETER_ID    ,                                             
+            p.NAME                  , p.DESCRIPTION , p.HELP                ,                                             
+            'N'                     , l.AD_LANGUAGE
+       FROM OBUIAPP_Parameter p, AD_Language l, AD_Module m
+      WHERE l.isActive = 'Y'
+        AND l.IsSystemLanguage='Y'
+        AND m.AD_Module_ID = p.AD_Module_ID
+        AND M.AD_Language != l.AD_Language
+        AND NOT EXISTS (SELECT 1
+                          FROM OBUIAPP_Parameter_Trl t
+                         WHERE t.OBUIAPP_Parameter_ID = p.OBUIAPP_Parameter_ID
+                           AND t.AD_Language = l.AD_Language);
+
+    v_rowcount:=SQL%ROWCOUNT;
+    DBMS_OUTPUT.PUT_LINE('- OBUIAPP_LANGUAGE_CREATE: OBUIAPP_Parameter_Trl ' || v_rowcount);
+END OBUIAPP_LANGUAGE_CREATE
+]]></body>
+    </function>
+  </database>