-- Customer specific once-script NYBU.
--
-- Support: +31 53 4800700

SET ECHO ON
SPOOL xNYBU13.lst
SET DEFINE OFF


-- NYBU#30053: Kolom toevoegen aan CRM-import
ALTER TABLE nybu_imp_crm ADD (
   san_nr      VARCHAR2(256)
);

-- NYBU#29355: Real-Time Monitors
-- usrgraphs
INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_orderby,
                          fac_usrgraph_maxrows)
    VALUES ('Te behandelen',
            'FAC_V_GRAPH_TODOXDISCIPLINE',
            1,
            '1',
            20);

INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_orderby,
                          fac_usrgraph_maxrows)
    VALUES ('In behandeling',
            'FAC_V_GRAPH_BUSYXDISCIPLINE',
            1,
            '1',
            20);

INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_limiet0,
                          fac_usrgraph_limiet1,
                          fac_usrgraph_limiet2,
                          fac_usrgraph_limiet3)
    VALUES ('Nog op tijd accepteerbaar',
            'FAC_V_GRAPH_MLD_PPI_ACCEPT',
            2,
            0,
            30,
            70,
            100);


CREATE OR REPLACE VIEW nybu_v_graph_mld_ppi_uitv AS SELECT 'x' x FROM DUAL;
INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_limiet0,
                          fac_usrgraph_limiet1,
                          fac_usrgraph_limiet2,
                          fac_usrgraph_limiet3)
    VALUES ('Nog op tijd uitvoerbaar',
            'NYBU_V_GRAPH_MLD_PPI_UITV',
            2,
            0,
            30,
            70,
            100);

CREATE OR REPLACE VIEW nybu_v_graph_aanaf_vandaag AS SELECT 'x' x FROM DUAL;
INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_orderby)
    VALUES ('Vandaag aangemeld / afgemeld',
            'NYBU_V_GRAPH_AANAF_VANDAAG',
            1,
            '1');

INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_orderby)
    VALUES ('Tijdstip ingediend',
            'FAC_V_GRAPH_MLDNIEUW_VERLOOP',
            4,
            '1');

CREATE OR REPLACE VIEW nybu_v_graph_aanafgemeld AS SELECT 'x' x FROM DUAL;
INSERT INTO fac_usrgraph (fac_usrgraph_omschrijving,
                          fac_usrgraph_view_name,
                          fac_usrgraph_type,
                          fac_usrgraph_orderby,
                          fac_usrgraph_maxrows)
    VALUES ('Deze maand aangemeld / afgemeld',
            'NYBU_V_GRAPH_AANAFGEMELD',
            4,
            '4',
            31);

-- widgets
INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 2,
            300, 49,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'FAC_V_GRAPH_TODOXDISCIPLINE'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 8,
            300, 49,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'FAC_V_GRAPH_BUSYXDISCIPLINE'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 12,
            300, 32,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'FAC_V_GRAPH_MLD_PPI_ACCEPT'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 15,
            300, 32,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'NYBU_V_GRAPH_MLD_PPI_UITV'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 18,
            300, 32,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'NYBU_V_GRAPH_AANAF_VANDAAG'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 22,
            300, 49,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'FAC_V_GRAPH_MLDNIEUW_VERLOOP'),
            300);

INSERT INTO FAC_WIDGET (FAC_WIDGET_GROEP, FAC_WIDGET_VOLGNR,
                        FAC_WIDGET_HEIGHT, FAC_WIDGET_WIDTH,
                        FAC_WIDGET_URL,
                        FAC_WIDGET_REFRESHTIME)
    VALUES ('monitorICT', 28,
            300, 49,
            '../../appl/fac/fac_usrgraph.asp?usrgraph_key='||
            (SELECT fac_usrgraph_key FROM fac_usrgraph
              WHERE fac_usrgraph_view_name = 'NYBU_V_GRAPH_AANAFGEMELD'),
            300);

-- Kleur grafiek
UPDATE fac_setting
   SET fac_setting_pvalue = '[''blue'',''green'']'
 WHERE fac_setting_name = 'fac_graph_colors2';

-- menu-item
INSERT INTO fac_menu (fac_menu_volgnr,
                      fac_menu_altlabel,
                      fac_menu_alturl,
                      fac_menu_altgroep)
    VALUES (6110,
            'Real-time Monitors',
            'appl/fac/fac_widgetspage.asp?wgrp=monitorICT',
            1);

COMMIT;

-- En nog wat opruimen
DROP VIEW nybu_v_rap_stdmelding;

BEGIN adm.systrackscriptId('$Id$'); END;
/

COMMIT;

SPOOL OFF

@nybu.sql