/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK
CREATE OR REPLACE VIEW XXAS_ADD_TAGS_V
AS
SELECT 'flexible' "type"
       ,v.prompt "line1"
      , null  "line2"
       ,null "line3"
        ,'modal' "target"
       ,lower(f.web_icon) "icon"
     ,  xxas_rslt_cache_pkg.resolve_color_name
                  (xxas_com_sec_pkg.get_parameter_value
                    (f.parameters, 'pColor')) "statusColor"
       ,b.function_id
       ,b.menu_id
       ,b.function_id || '_' || v.function_id "objectId"
       ,v.function_id link_function_id
       ,'block-edit-link' "pageId"
      /* ,CASE WHEN nvl(b.tag_groups,1) = nvl(t.groups,1)
             THEN 'balanced'
             ELSE 'assertive'
        END */
        FROM fnd_menu_entries_vl v
           , fnd_form_functions f 
           , fnd_menus m
           , xxas_block_links_v b
      WHERE  m.menu_name = nvl(xxas_com_sec_pkg.get_function_parameter(b.function_name,'pLinksMenuName')
                                 ,fnd_profile.value('XXAS_COM_REG_ACTIONS_MENU'))
        AND v.menu_id = m.menu_id
        AND f.function_id = v.function_id;
BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_ADD_TAGS_V'
   ,p_description            => 'Applaud Block add tags view');
END;
/
COMMIT;
EXIT;
