--
-- $Id$
--
-- Aanpassingen om DB46c (prod) naar de DB46d te brengen
-- Merk op dat de recreate er nog bij komt die de DB-version bijwerkt
--
-- MOET OOK ZIJN/WORDEN OPGENOMEN IN DB45TO46d.src !!!

DEFINE thisfile = 'DB46cto46d.sql'
DEFINE dbuser   = '*'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
COLUMN fcltcusterr NEW_VALUE fcltcusterr NOPRINT;
WHENEVER SQLERROR CONTINUE;
SELECT adm.getscriptspoolfile('&thisfile') AS fcltlogfile FROM DUAL;
SPOOL &fcltlogfile
WHENEVER SQLERROR EXIT;
SELECT adm.checkscriptcust('&dbuser') AS fcltcusterr FROM DUAL;
WHENEVER SQLERROR CONTINUE;
PROMPT &fcltcusterr
SET DEFINE OFF

------ payload begin ------

-- /////////////////////////////////////////////////////////////////////////////////////////// AAIT#78892

INSERT INTO fac_menuitems (fac_menuitems_groep,
                           fac_menuitems_label,
                           fac_menuitems_oms,
                           fac_menuitems_module,
                           fac_menuitems_url,
                           fac_menuitems_srtdisc,
                           fac_menuitems_disc,
                           fac_functie_key,
                           fac_menuitems_rw,
                           fac_menuitems_default,
                           fac_menuitems_image)
    SELECT 3,
           'lcl_mobile_msg',
           '',
           'MSG',
           'appl/pda/berichten.asp',
           0,
           0,
           fac_functie_key,
           'R',
           '1',
           'fa-circle-y'
      FROM fac_functie
     WHERE fac_functie_code = 'WEB_MSGUSE';

-- Op deze nieuwe LCL kunnen we wel veilig 1 menuitem matchen
INSERT INTO fac_menu (fac_menuitems_key,
                      fac_menu_volgnr,
                      fac_menu_altlabel,
                      fac_menu_alturl,
                      fac_menu_altgroep,
                      fac_menu_image,
                      fac_menu_level,
                      fac_menu_info)
    SELECT fac_menuitems_key,
           fac_menuitems_key * 100,
           fac_menuitems_label,
           fac_menuitems_url,
           fac_menuitems_groep,
           fac_menuitems_image,
           CASE
               WHEN fac_menuitems_groep IN (0, 1, 2) THEN 2
               WHEN fac_menuitems_groep IN (3, 7) THEN 1
               ELSE 0
           END    fac_menu_level,
           fac_menuitems_oms
      FROM fac_menuitems i
     WHERE fac_menuitems_label = 'lcl_mobile_msg';

------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 1); END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile