modules/org.openbravo.client.application/src-db/database/model/functions/OBUIAPP_LANGUAGE_CREATE.xml
author RM packaging bot <staff.rm@openbravo.com>
Tue, 28 Mar 2017 14:43:12 +0000
changeset 31747 b8f24f04c24b
parent 27808 04c472ffcb50
permissions -rw-r--r--
CI: update AD_MODULE to version 31744
<?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.1  (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-2015 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);
    -- Process Definition
    INSERT
    INTO OBUIAPP_Process_Trl
      (
        OBUIAPP_Process_Trl_ID, OBUIAPP_Process_ID, AD_Language, Name, Description,
        Help, IsTranslated, Createdby, UpdatedBy,
        AD_Client_ID, AD_Org_ID
      )
    SELECT get_uuid(), OBUIAPP_Process_ID, AD_Language.AD_Language, OBUIAPP_Process.Name, OBUIAPP_Process.Description, OBUIAPP_Process.Help, 'N', '0', '0', '0', '0'
    FROM OBUIAPP_Process, AD_Language, AD_Module M
    WHERE AD_Language.IsActive='Y'  
    AND AD_Language.IsSystemLanguage='Y'  
    AND M.AD_MODULE_ID = OBUIAPP_Process.AD_MODULE_ID
    AND M.AD_LANGUAGE != AD_Language.AD_Language
    AND NOT EXISTS (SELECT 1 FROM OBUIAPP_Process_trl
                 WHERE OBUIAPP_Process_ID = OBUIAPP_Process.OBUIAPP_Process_ID
                   AND AD_LANGUAGE = AD_Language.AD_Language);

    v_rowcount:=SQL%ROWCOUNT;
    DBMS_OUTPUT.PUT_LINE('- OBUIAPP_Process ' || v_rowcount) ;
END OBUIAPP_LANGUAGE_CREATE
]]></body>
    </function>
  </database>