modules/org.openbravo.client.myob/src-db/database/model/functions/OBKMO_LANGUAGE_CREATE.xml
author Harpreet Singh <harpreet@openbravo.com>
Fri, 10 Dec 2010 19:47:45 +0100
changeset 9076 c4f1a5c7d7c2
child 9216 bbd05fc5a3f8
permissions -rw-r--r--
Added 3.0 modules to modules dir and changed the VERSION number
harpreet@9076
     1
<?xml version="1.0"?>
harpreet@9076
     2
  <database name="FUNCTION OBKMO_LANGUAGE_CREATE">
harpreet@9076
     3
    <function name="OBKMO_LANGUAGE_CREATE" type="NULL">
harpreet@9076
     4
      <parameter name="ep_instance_id" type="VARCHAR" mode="in">
harpreet@9076
     5
        <default/>
harpreet@9076
     6
      </parameter>
harpreet@9076
     7
      <body><![CDATA[/*************************************************************************
harpreet@9076
     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
harpreet@9076
    10
* Version 1.1  with a permitted attribution clause; you may not  use this
harpreet@9076
    11
* file except in compliance with the License. You  may  obtain  a copy of
harpreet@9076
    12
* the License at http://www.openbravo.com/legal/license.html
harpreet@9076
    13
* Software distributed under the License  is  distributed  on  an "AS IS"
harpreet@9076
    14
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
harpreet@9076
    15
* License for the specific  language  governing  rights  and  limitations
harpreet@9076
    16
* under the License.
harpreet@9076
    17
* The Original Code is Openbravo ERP.
harpreet@9076
    18
* The Initial Developer of the Original Code is Openbravo SLU
harpreet@9076
    19
* All portions are Copyright (C) 2010 Openbravo SLU
harpreet@9076
    20
* All Rights Reserved.
harpreet@9076
    21
* Contributor(s):  ______________________________________.
harpreet@9076
    22
************************************************************************/
harpreet@9076
    23
harpreet@9076
    24
  v_rowcount NUMBER;
harpreet@9076
    25
harpreet@9076
    26
  BEGIN
harpreet@9076
    27
  
harpreet@9076
    28
    INSERT INTO OBKMO_Widget_Class_Trl
harpreet@9076
    29
           (OBKMO_WIDGET_CLASS_TRL_ID , OBKMO_WIDGET_CLASS_ID, AD_LANGUAGE,
harpreet@9076
    30
            AD_CLIENT_ID              , AD_ORG_ID            , ISACTIVE   ,                                                                                                                                                                             
harpreet@9076
    31
            CREATED                   , CREATEDBY            , UPDATED    ,                                                                                                                                                                             
harpreet@9076
    32
            UPDATEDBY                 , TITLE                , DESCRIPTION,                                                                                                                                                                             
harpreet@9076
    33
            ISTRANSLATED)
harpreet@9076
    34
     SELECT get_uuid()                , OBKMO_WIDGET_CLASS_ID, l.AD_LANGUAGE,
harpreet@9076
    35
            w.AD_CLIENT_ID            , w.AD_ORG_ID          , w.ISACTIVE   ,                                                                                                                                                                             
harpreet@9076
    36
            now()                     , '0'                  , now()        ,                                                                                                                                                                             
harpreet@9076
    37
            '0'                       , w.TITLE              , w.DESCRIPTION,                                                                                                                                                                             
harpreet@9076
    38
            'N'
harpreet@9076
    39
      FROM OBKMO_Widget_Class w, AD_Language l, AD_Module m
harpreet@9076
    40
     WHERE l.isActive = 'Y'
harpreet@9076
    41
       AND l.IsSystemLanguage='Y'
harpreet@9076
    42
       AND m.AD_Module_ID = w.AD_Module_ID
harpreet@9076
    43
       AND M.AD_Language != l.AD_Language
harpreet@9076
    44
       AND NOT EXISTS (SELECT 1 
harpreet@9076
    45
                         FROM OBKMO_Widget_Class_Trl t
harpreet@9076
    46
                        WHERE t.OBKMO_Widget_Class_ID = w.OBKMO_Widget_Class_ID
harpreet@9076
    47
                          AND t.AD_Language = l.AD_Language);
harpreet@9076
    48
                          
harpreet@9076
    49
    v_rowcount:=SQL%ROWCOUNT;
harpreet@9076
    50
    DBMS_OUTPUT.PUT_LINE('- OBKMO_LANGUAGE_CREATE: OBKMO_Widget_Class_Trl ' || v_rowcount) ;
harpreet@9076
    51
END OBKMO_LANGUAGE_CREATE
harpreet@9076
    52
]]></body>
harpreet@9076
    53
    </function>
harpreet@9076
    54
  </database>