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
staff@10777
     1
<?xml version="1.0"?>
staff@10777
     2
  <database name="FUNCTION OBUIAPP_LANGUAGE_CREATE">
staff@10777
     3
    <function name="OBUIAPP_LANGUAGE_CREATE" type="NULL">
staff@10777
     4
      <parameter name="ep_instance_id" type="VARCHAR" mode="in">
staff@10777
     5
        <default/>
staff@10777
     6
      </parameter>
staff@10777
     7
      <body><![CDATA[/*************************************************************************
staff@10777
     8
* The contents of this file are subject to the Openbravo  Public  License
harpreet@9076
     9
* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
staff@10777
    10
* Version 1.1  with a permitted attribution clause; you may not  use this
staff@10777
    11
* file except in compliance with the License. You  may  obtain  a copy of
staff@10777
    12
* the License at http://www.openbravo.com/legal/license.html
staff@10777
    13
* Software distributed under the License  is  distributed  on  an "AS IS"
staff@10777
    14
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
staff@10777
    15
* License for the specific  language  governing  rights  and  limitations
staff@10777
    16
* under the License.
staff@10777
    17
* The Original Code is Openbravo ERP.
staff@10777
    18
* The Initial Developer of the Original Code is Openbravo SLU
inigo@27808
    19
* All portions are Copyright (C) 2010-2015 Openbravo SLU
staff@10777
    20
* All Rights Reserved.
staff@10777
    21
* Contributor(s):  ______________________________________.
staff@10777
    22
************************************************************************/
staff@10777
    23
staff@10777
    24
  v_rowcount NUMBER;
staff@10777
    25
staff@10777
    26
  BEGIN
staff@10777
    27
    INSERT INTO OBUIAPP_Parameter_Trl  
staff@10777
    28
           (OBUIAPP_PARAMETER_TRL_ID, AD_CLIENT_ID, AD_ORG_ID               ,                                             
staff@10777
    29
            ISACTIVE                , CREATED     , CREATEDBY               ,                                             
staff@10777
    30
            UPDATED                 , UPDATEDBY   , OBUIAPP_PARAMETER_ID    ,                                             
staff@10777
    31
            NAME                    , DESCRIPTION , HELP                    ,                                             
staff@10777
    32
            ISTRANSLATED            , AD_LANGUAGE)
staff@10777
    33
     SELECT get_uuid()              , p.AD_CLIENT_ID, p.AD_ORG_ID           ,                                             
staff@10777
    34
            p.ISACTIVE              , now()     , '0'                       ,                                             
staff@10777
    35
            now()                   , '0'       , p.OBUIAPP_PARAMETER_ID    ,                                             
staff@10777
    36
            p.NAME                  , p.DESCRIPTION , p.HELP                ,                                             
staff@10777
    37
            'N'                     , l.AD_LANGUAGE
staff@10777
    38
       FROM OBUIAPP_Parameter p, AD_Language l, AD_Module m
staff@10777
    39
      WHERE l.isActive = 'Y'
staff@10777
    40
        AND l.IsSystemLanguage='Y'
staff@10777
    41
        AND m.AD_Module_ID = p.AD_Module_ID
staff@10777
    42
        AND M.AD_Language != l.AD_Language
staff@10777
    43
        AND NOT EXISTS (SELECT 1
staff@10777
    44
                          FROM OBUIAPP_Parameter_Trl t
staff@10777
    45
                         WHERE t.OBUIAPP_Parameter_ID = p.OBUIAPP_Parameter_ID
staff@10777
    46
                           AND t.AD_Language = l.AD_Language);
staff@10777
    47
staff@10777
    48
    v_rowcount:=SQL%ROWCOUNT;
staff@10777
    49
    DBMS_OUTPUT.PUT_LINE('- OBUIAPP_LANGUAGE_CREATE: OBUIAPP_Parameter_Trl ' || v_rowcount);
inigo@27808
    50
    -- Process Definition
inigo@27808
    51
    INSERT
inigo@27808
    52
    INTO OBUIAPP_Process_Trl
inigo@27808
    53
      (
inigo@27808
    54
        OBUIAPP_Process_Trl_ID, OBUIAPP_Process_ID, AD_Language, Name, Description,
inigo@27808
    55
        Help, IsTranslated, Createdby, UpdatedBy,
inigo@27808
    56
        AD_Client_ID, AD_Org_ID
inigo@27808
    57
      )
inigo@27808
    58
    SELECT get_uuid(), OBUIAPP_Process_ID, AD_Language.AD_Language, OBUIAPP_Process.Name, OBUIAPP_Process.Description, OBUIAPP_Process.Help, 'N', '0', '0', '0', '0'
inigo@27808
    59
    FROM OBUIAPP_Process, AD_Language, AD_Module M
inigo@27808
    60
    WHERE AD_Language.IsActive='Y'  
inigo@27808
    61
    AND AD_Language.IsSystemLanguage='Y'  
inigo@27808
    62
    AND M.AD_MODULE_ID = OBUIAPP_Process.AD_MODULE_ID
inigo@27808
    63
    AND M.AD_LANGUAGE != AD_Language.AD_Language
inigo@27808
    64
    AND NOT EXISTS (SELECT 1 FROM OBUIAPP_Process_trl
inigo@27808
    65
                 WHERE OBUIAPP_Process_ID = OBUIAPP_Process.OBUIAPP_Process_ID
inigo@27808
    66
                   AND AD_LANGUAGE = AD_Language.AD_Language);
inigo@27808
    67
inigo@27808
    68
    v_rowcount:=SQL%ROWCOUNT;
inigo@27808
    69
    DBMS_OUTPUT.PUT_LINE('- OBUIAPP_Process ' || v_rowcount) ;
staff@10777
    70
END OBUIAPP_LANGUAGE_CREATE
staff@10777
    71
]]></body>
staff@10777
    72
    </function>
staff@10777
    73
  </database>