src-db/database/model/triggers/AD_WINDOW_TRL_TRG.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Wed, 03 Sep 2008 17:55:37 +0000
changeset 1605 8a0fe0193bef
parent 785 8dba91261590
child 1929 ad0353d93b0f
permissions -rw-r--r--
Merge r2.5x intro trunk
adrian@94
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="TRIGGER AD_WINDOW_TRL_TRG">
adrian@94
     3
    <trigger name="AD_WINDOW_TRL_TRG" table="AD_WINDOW_TRL" fires="after" insert="false" update="true" delete="false" foreach="row">
gorkaion@239
     4
      <body><![CDATA[
juanpablo@771
     5
    /*************************************************************************
juanpablo@771
     6
    * The contents of this file are subject to the Compiere Public
juanpablo@771
     7
    * License 1.1 ("License"); You may not use this file except in
juanpablo@771
     8
    * compliance with the License. You may obtain a copy of the License in
juanpablo@771
     9
    * the legal folder of your Openbravo installation.
adrian@94
    10
    * Software distributed under the License is distributed on an
adrian@94
    11
    * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
adrian@94
    12
    * implied. See the License for the specific language governing rights
adrian@94
    13
    * and limitations under the License.
juanpablo@778
    14
    * The Original Code is  Compiere  ERP &  Business Solution
juanpablo@771
    15
    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
adrian@94
    16
    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
adrian@94
    17
    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
adrian@94
    18
    * All Rights Reserved.
adrian@94
    19
    * Contributor(s): Openbravo SL
juanpablo@785
    20
    * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.
juanpablo@771
    21
    *
juanpablo@771
    22
    * Specifically, this derivative work is based upon the following Compiere
juanpablo@771
    23
    * file and version.
adrian@94
    24
    *************************************************************************
adrian@94
    25
    * $Id: AD_Window_Trl_Trg.sql,v 1.4 2003/02/18 03:33:22 jjanke Exp $
adrian@94
    26
    ***
adrian@94
    27
    * Title: Window Trl Changes
adrian@94
    28
    * Description:
adrian@94
    29
    *   - Update Translation in Menu + Workflow
adrian@94
    30
    ************************************************************************/
adrian@94
    31
    BEGIN
carlos@408
    32
      IF UPDATING THEN
carlos@408
    33
       IF(COALESCE(:old.Name, '.') <> COALESCE(:NEW.Name, '.')
carlos@408
    34
       OR COALESCE(:old.Description, '.') <> COALESCE(:NEW.Description, '.')
antonio@737
    35
       OR COALESCE(:old.Help, '.') <> COALESCE(:NEW.Help, '.'))
carlos@408
    36
       THEN
adrian@94
    37
    -- Update Menu
adrian@94
    38
  UPDATE AD_Menu_Trl
adrian@94
    39
    SET Name=:new.Name,
adrian@94
    40
    Description=:new.Description
adrian@94
    41
  WHERE AD_Language=:new.AD_Language
adrian@94
    42
    AND EXISTS
adrian@94
    43
    (
adrian@94
    44
    SELECT *
adrian@94
    45
    FROM AD_Menu m
adrian@94
    46
    WHERE m.AD_Menu_ID=AD_Menu_Trl.AD_Menu_ID
adrian@94
    47
      AND m.AD_Window_ID=:new.AD_Window_ID
adrian@94
    48
    )
adrian@94
    49
    ;
adrian@94
    50
  -- Update Workflow
adrian@94
    51
  UPDATE AD_WF_Node_Trl
adrian@94
    52
    SET Name=:new.Name,
adrian@94
    53
    Description=:new.Description,
adrian@94
    54
    Help=:new.Help
adrian@94
    55
  WHERE AD_Language=:new.AD_Language
adrian@94
    56
    AND EXISTS
adrian@94
    57
    (
adrian@94
    58
    SELECT *
adrian@94
    59
    FROM AD_WF_Node n
adrian@94
    60
    WHERE n.AD_WF_Node_ID=AD_WF_Node_Trl.AD_WF_Node_ID
adrian@94
    61
      AND n.AD_Window_ID=:new.AD_Window_ID
adrian@94
    62
      AND n.IsCentrallyMaintained='Y'
adrian@94
    63
    )
adrian@94
    64
    ;
carlos@408
    65
      END IF;
carlos@408
    66
    END IF;
adrian@94
    67
  --
antonio@735
    68
END AD_WINDOW_TRL_TRG
gorkaion@239
    69
]]></body>
adrian@94
    70
    </trigger>
adrian@94
    71
  </database>