-- All Administration Module Permissions;

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BCLIEDT','clients_list_opencli','SCLILST','','','administration/configuration/lists/clients','administration','Visualizzazione tasto "Apri" in sezione clienti.','BUT','fas fa-edit',1,false,false,NULL),
	 ('XMSCDTL','assets_get_list_object','SMISCFN','getDataList','0','0','administration','Permission to get list to populate dropdowns','EXE',NULL,NULL,false,false,NULL),
	 ('BCLISAV','client_save','SCLIEDT','','','administration/configuration/lists/clients','administration','Visualizzazione tasto "Salva" in gestione cliente.','BUT','fas fa-save',1,false,false,NULL),
	 ('BCNFWHA','warehouse_list_addwh','SCNFWRH','warehouse_list_addwh','','administration/configuration/warehouses','administration','Mostra bottone per aggiungere magazzino.','BUT','fas fa-folder-plus',1,false,false,NULL),
	 ('BCNFWHE','warehouse_list_openwh','SCNFWRH','warehouse_list_openwh','','administration/configuration/warehouses','administration','Mostra bottone per modificare magazzino.','BUT','fas fa-folder-open',1,false,false,NULL),
	 ('BMATBCK','materials_back','SMATEDT','','','administration/configuration/lists/materials','administration','Bottone indietro in gestione materiali.','BUT','fas fa-times',1,false,false,NULL),
	 ('BMATCRT','materials_list_addmat','SMATLST','','','administration/configuration/lists/choices','administration','Botton per aggiungere nuovo materiale.','BUT','fas fa-plus',1,false,false,NULL),
	 ('BMATEDT','materials_list_openmat','SMATLST','','','administration/configuration/lists/materials','administration','Botton per modificare materiale.','BUT','fas fa-edit',1,false,false,NULL),
	 ('BMATSAV','materials_save','SMATEDT','','','administration/configuration/lists/materials','administration','Bottone salva materiale.','BUT','fas fa-save',1,false,false,NULL),
	 ('BSUPADD','suppliers_list_addsup','SSUPLST','','','administration/configuration/lists/suppliers','administration','Visualizzazione tasto "Aggiungi" in sezione fornitori.','BUT','fas fa-user-plus',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BSUPBCK','supplier_back','SSUPEDT','','','administration/configuration/lists/suppliers','administration','Visualizzazione tasto "Indietro" in gestione fornitore.','BUT','fas fa-times',1,false,false,NULL),
	 ('BSUPEDT','suppliers_list_opensup','SSUPLST','','','administration/configuration/lists/suppliers','administration','Visualizzazione tasto "Apri" in sezione fornitori.','BUT','fas fa-edit',1,false,false,NULL),
	 ('BSUPSAV','supplier_save','SSUPEDT','','','administration/configuration/lists/suppliers','administration','Visualizzazione tasto "Salva" in gestione fornitore.','BUT','fas fa-save',1,false,false,NULL),
	 ('XMATUPD','material_update','SMATEDT','updateMaterial','','administration/configuration/lists/materials','administration','Permesso di modificare un materiale.','EXE','fas fa-shapes',1,false,false,NULL),
	 ('XMSCIMP','assets_import_data','PADMIMP','importData','','','administration','Permission to upload data.','EXE','fa fa-upload',1,false,false,NULL),
	 ('XMSCIMR','assets_import_data_read_file','PADMIMP','importDataReadFile','','','administration','Permission to upload data - read file.','EXE','',1,false,false,NULL),
	 ('XMSCIMT','assets_import_data_post_record','PADMIMP','importDataPostRecord','','','administration','Permission to upload data - post record.','EXE','',1,false,false,NULL),
	 ('XSUPCRT','administration_create_registry_entity','SSUPEDT','createRegistryEntry','','administration/configuration/lists','administration','Permesso di creare nuova entry in anagrafica.','EXE','fas fa-plus',1,false,false,NULL),
	 ('XSUPLST','get_registry','SSUPLST','getRegistryEntities','','administration/configuration/lists','administration','Estrai elenco da anagrafica.','EXE','fas fa-list',1,false,false,NULL),
	 ('XSUPUPD','administration_update_registry_entity','SSUPEDT','updateRegistryEntity','','administration/configuration/lists','administration','Permesso di aggiornare nuova entry in anagrafica.','EXE','fas fa-save',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XUPDPRM','administration_permissions_update_permission','SADMPME','editPermission',NULL,'administration/permissions','administration','Funzione per aggiornare una permission.','EXE','fa fa-save',10040,false,false,NULL),
	 ('BCDLADD','codelist_row_add','SCDLLST','','','administration/codelists','administration','Button to add codelist row.','BUT','fas fa-clipboard-list',1,false,false,NULL),
	 ('BCDLDEL','codelist_row_del','SCDLLST','','','administration/codelists','administration','Button to delete codelist row.','BUT','fas fa-trash',1,false,false,NULL),
	 ('BCDLEDT','codelist_row_edit','SCDLLST','','','administration/codelists','administration','Button to edit codelist row.','BUT','fas fa-pencil-alt',1,false,false,NULL),
	 ('XADCLGT','administration_get_codelist','PADMCDL','getCodeListOptions','','administration/codelists','administration','Retrieve codelists values.','EXE','',1,false,false,NULL),
	 ('XCDLODL','codelist_option_del','SCDLLST','delCodeListOption','','administration/codelists','administration','API endpoint to delete codelist option.','BUT','',1,false,false,NULL),
	 ('PCNFLST','administration_configuration_lists_tode','PADMCNF','administration_configuration_lists','','administration/configuration/lists','administration','Autorizzazione a visualizzare la sezione elenchi (da cancellare)','WDG','fas fa-clipboard-list',2,false,false,NULL),
	 ('BADCLSV','codelist_row_save','SCDLEDT','','','administration/codelists','administration','Button save on codelists edit','BUT','fas fa-save',1,false,false,NULL),
	 ('BADCLD2','codelist_row_del_2','SCDLEDT','','','administration/codelists','administration','Button delete on codelists edit','BUT','fas fa-trash',1,false,false,NULL),
	 ('BADCLBK','codelist_row_back','SCDLEDT','','','administration/codelists','administration','Button back on codelists edit','BUT','fas fa-arrow-left',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XADCLSV','codelists_option_save','SCDLEDT','updCodeListOption','','administration/codelists','administration','Permission to update codelist option value.','EXE','',1,false,false,NULL),
	 ('XADCLCR','codelists_option_create','SCDLEDT','addCodeListOption','','administration/codelists','administration','Permission to create codelist option value.','EXE','',1,false,false,NULL),
     ('XACDCRT','codelists_option_create_v2','SCDLEDT','addCodeListOptionV2','','administration/codelists','administration','Permission to create codelist option value.','EXE','',1,false,false,NULL),
	 ('SCDLLST','administration_codelist_list','PADMCLE','','','administration/configuration/codelists','administration','Permission to view codelist selection page','SEC','',1,false,false,NULL),
	 ('SCDLEDT','administration_codelist_edit','PADMCLE','','','administration/codelists','administration','Permission to view codelists edit','SEC','',1,false,false,NULL),
	 ('BAMPRBK','administration_roles_list_cancel','SADMRLE','','','administration/roles','administration','Show roles back button','BUT','fas fa-arrow-left',1,false,false,NULL),
	 ('BADRLSV','administration_roles_list_save','SADMRLE','','','administration/roles','administration','Show roles save button','BUT','fas fa-save',1,false,false,NULL),
	 ('BADPRSV','administration_permissions_edit_save','SADMPME','','','administration/permissions','administration','View permission save button','BUT','fas fa-save',1,false,false,NULL),
	 ('BADPRBK','administration_permissions_edit_back','SADMPME','','','administration/permissions','administration','View permission back button','BUT','fas fa-arrow-left',1,false,false,NULL),
	 ('XREGCLS','get_registry_codelist','SREGLW','getRegistryEntitiesList','','administration/configuration/lists','administration','Estrai elenco da anagrafica (codelist).','EXE','',1,false,false,NULL),
	 ('XUTOKGT','administration_users_tokens_get','SADMUSE','getUserTokens','','administration/users','administration','Permission to get user tokens','EXE','',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XGENTOK','administration_generate_token_url','SADMUSE','generateToken','','administration/users','digest','Permission to generate new token','EXE','',1,false,false,NULL),
	 ('XTOKDEL','administraion_users_token_remove','SADMUSE','removeToken','','administration/users','administration','Permission to remove user token','EXE','',1,false,false,NULL),
	 ('PADMCLE','administration_configuration_codelists','PADMCNF','getObjects','','administration/configuration/codelists','administration','Autorizzazione a visualizzare la sezione codelists','PAG','fas fa-list-alt',1,false,false,NULL),
	 ('BADMAFE','administration_assets_forms_list_edit','SADMASF','','','administration/assets/forms','administration','View EDIT button on forms list','BUT','fas fa-edit',10030,true,false,NULL),
	 ('BADMAFS','administration_assets_forms_edit_save','SADMASF','','','administration/assets/forms','administration','View SAVE button on forms list','BUT','fa-solid fa-floppy-disk',10030,true,false,NULL),
	 ('BADMAFB','administration_assets_forms_edit_back','SADMASF','','','administration/assets/forms','administration','View BACK button on forms list','BUT','fa-solid fa-arrow-left',10030,true,false,NULL),
	 ('BADMAAR','administration_assets_forms_edit_add_row','SADMASF','','','administration/assets/forms','administration','View ADD ROW button on forms list','BUT','fa-solid fa-diagram-next',10030,true,false,NULL),
	 ('BADMAAF','administration_assets_forms_edit_add_field','SADMASF','','','administration/assets/forms','administration','View ADD FIELD button on forms list','BUT','fa-solid fa-square-plus',10030,true,false,NULL),
	 ('BADMCLC','administration_assets_import_define_calcfield','SADMIMP','','','administration/assets/import','administration','View calculate button on "data import define" section.','BUT','fa fa-calculator',1,false,false,NULL),
	 ('BADMDLM','administration_assets_import_define_deletemap','SADMIMP','','','administration/assets/import','administration','View dlete maps button on "data import define" section.','BUT','fa fa-trash',1,false,false,NULL),
	 ('BADMAFA','administration_assets_forms_list_add','SADMASF',NULL,'','administration/assets/forms','administration','View ADD button on forms list','BUT','fa fa-plus-circle',10020,true,false,NULL),
	 ('BADMEVA','administration_events_list_newevent','SADMEVL','','','administration/events','administration','Permission to view "add event" button.','BUT','fas fa-plus-square',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMFLO','administration_assets_import_load','SADMIMP','','','administration/assets/import','administration','View upload button on "data import" section.','BUT','fa fa-upload',1,false,false,NULL),
	 ('BADMFOP','administration_assets_import_select','SADMIMP','','','administration/assets/import','administration','View select button on "data import" section.','BUT','fa fa-folder-open',1,false,false,NULL),
	 ('BADMIMC','administration_assets_import_define_cancel','SADMIMP','','','administration/assets/import','administration','View cancel button on "data import define" section.','BUT','fa fa-times',1,false,false,NULL),
	 ('BADMIMD','administration_assets_import_define_importdata','SADMIMP','','','administration/assets/import','administration','View "import data" button on "data import define" section.','BUT','fa fa-database',1,false,false,NULL),
	 ('BADMIOB','administration_assets_import_edit_objects','SADMIMP','','','administration/assets/import','administration','View object editor','BUT','fa fa-puzzle-piece',1,false,false,NULL),
	 ('BADMLDM','administration_assets_import_define_loadmaps','SADMIMP','','','administration/assets/import','administration','View load maps button on "data import define" section.','BUT','fa fa-file-code',1,false,false,NULL),
	 ('BADMLNK','administration_assets_import_define_linkfields','SADMIMP','','','administration/assets/import','administration','View link button on "data import define" section.','BUT','fa fa-link',1,false,false,NULL),
	 ('BADMMPO','administration_assets_import_define_mapoptions','SADMIMP','','','administration/assets/import','administration','View map options button on "data import define" section.','BUT','fa fa-code',1,false,false,NULL),
	 ('BADMOBK','administration_assets_import_edit_objects_back','SADMIMP','','','administration/assets/import','administration','View back button on object editor.','BUT','fa fa-arrow-circle-left',1,false,false,NULL),
	 ('BADMOSV','administration_assets_import_edit_objects_save','SADMIMP','','','administration/assets/import','administration','View save button on object editor.','BUT','fa fa-save',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMPMA','administration_permissions_list_add','SADMPML','','','administration/permissions','administration','{administration_permissions_list_add_description}','BUT','fa fa-puzzle-piece',1315,false,false,NULL),
	 ('BADMPME','administration_permissions_list_edit','SADMPML',NULL,NULL,'administration/permissions','administration','Permission to click on "edit permission" section','BUT','fa fa-tasks',1317,false,false,NULL),
	 ('BADMRLE','administration_roles_list_edit','SADMRLL','','','administration/roles','administration','Autorizzazione a visualizzare il tasto modifica nell elenco dei permessi.','BUT','fa fa-edit',10010,false,false,NULL),
	 ('BADMRLU','administration_roles_list_add','SADMRLL','','','administration/roles','administration','Autorizzazione a visualizzare il tasto aggiungi nell elenco dei permessi.','BUT','fa fa-plus',10010,false,false,NULL),
	 ('BADMSVM','administration_assets_import_define_savemap','SADMIMP','','','administration/assets/import','administration','View save map button on "data import define" section.','BUT','fa fa-save',1,false,false,NULL),
	 ('BADMULE','administration_users_list_edit','SADMUSL','','','administration/users','administration','View edit button on users list','BUT','fas fa-edit',1180,false,false,NULL),
	 ('BADMULR','administration_users_list_roles','SADMUSL',NULL,NULL,'administration/users','administration','Permission to manage roles','BUT','fa fa-id-card',1185,false,false,NULL),
	 ('BADMUNK','administration_assets_import_define_unlinkfields','SADMIMP','','','administration/assets/import','administration','View unlink button on "data import define" section.','BUT','fa fa-unlink',1,false,false,NULL),
	 ('BADMUSA','administration_users_list_add','SADMUSL',NULL,NULL,'administration/users','administration','Permission to access "add user" section','BUT','fa fa-user-plus',1170,false,false,NULL),
	 ('BCATADD','categories_list_addcat','SCATLST','','','administration/configuration/lists/categories','administration','Bottoone "Aggiungi" in elenco categorie.','BUT','fas fa-plus',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BCATBCK','categories_back','SCATEDT','','','administration/configuration/lists/categories','administration','Tasto "indietro" in pagina gestione categoria.','BUT','fas fa-times',1,false,false,NULL),
	 ('BCATEDT','categories_list_opencat','SCATLST','','','administration/configuration/lists/categories','administration','Bottone "Modifica" in elenco categorie.','BUT','fas fa-edit',1,false,false,NULL),
	 ('BCATSAV','categories_save','SCATEDT','','','administration/configuration/lists/categories','administration','Tasto "salva" in pagina gestione categoria.','BUT','fas fa-save',1,false,false,NULL),
	 ('BCFGWHB','warehouse_back','SCNFWRH','warehouse_back','','administration/configuration/warehouses','administration','Mostra bottone per annullare modifica magazzino.','BUT','fas fa-times',1,false,false,NULL),
	 ('BCFGWHS','warehouse_save','SCNFWRH','warehouse_save','','administration/configuration/warehouses','administration','Mostra bottone per salvare magazzino.','BUT','fas fa-save',1,false,false,NULL),
	 ('BCHOBCK','choices_back','SCHOEDT','','','administration/configuration/lists/choices','administration','Bottone indietro in gestione scelte.','BUT','fas fa-times',1,false,false,NULL),
	 ('BCHOCRT','choices_list_addch','SCHOLST','','','administration/configuration/lists/choices','administration','Botton per aggiungere nuova scelta.','BUT','fas fa-plus',1,false,false,NULL),
	 ('BCHOEDT','choices_list_opench','SCHOLST','','','administration/configuration/lists/choices','administration','Botton per modificare scelta.','BUT','fas fa-edit',1,false,false,NULL),
	 ('BCHOSAV','choices_save','SCHOEDT','','','administration/configuration/lists/choices','administration','Bottone salva scelta.','BUT','fas fa-save',1,false,false,NULL),
	 ('BCLIADD','clients_list_addcli','SCLILST','','','administration/configuration/lists/clients','administration','Visualizzazione tasto "Aggiungi" in sezione clienti.','BUT','fas fa-user-plus',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BCLIBCK','client_back','SCLIEDT','','','administration/configuration/lists/clients','administration','Visualizzazione tasto "Indietro" in gestione cliente.','BUT','fas fa-times',1,false,false,NULL),
	 ('XSTATUS','user_status_change','SADMASE','userStatus','','administration','administration','Permission to change user status','EXE','',1,false,false,NULL),
	 ('SADMASE','section_admin_assets','PADMASE','','','administration','administration','Permission to admin assets section','SEC','',1,false,false,NULL),
	 ('MADM','administration',NULL,NULL,NULL,'administration','administration','Permission to access administration module','MOD','fa fa-cogs',2000,false,false,NULL),
	 ('PADMASE','administration_assets','MADM',NULL,NULL,'administration/assets','administration','Permission to access html assets management','PAG','fa fa-code',10001,true,false,NULL),
	 ('PADMASF','administration_assets_forms','PADMASE','renderFormsTable','','administration/assets/forms','administration','Autorizzazione all''accesso dell''editor per le form.','PAG','fa-solid fa-square-poll-horizontal',1,true,false,NULL),
	 ('PADMAST','administration_assets_tables','PADMASE','','','administration/assets/tables','administration','Autorizzazione a visualizzare l''editor per le tabelle.','PAG','fa fa-table',10003,true,false,NULL),
	 ('PADMCNF','administration_configuration','MADM','','','administration/configuration','administration','Permission to access configuration page','PAG','fas fa-sliders-h',40001,false,false,NULL),
	 ('PADMIMP','administration_assets_import','PADMASE','renderUploadPage','','administration/assets/import','administration','Autorizzazione all''accesso per il sistema di importazione dati.','PAG','fa fa-upload',3,false,false,NULL),
	 ('PADMPRM','administration_permissions','MADM','renderModulesTabs','administration_permissions_list','administration/permissions','administration','Permission to access permissions page','PAG','fa fa-list-alt',1300,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('PADMRLS','administration_roles','MADM','renderRolesTable','administration_roles_list','administration/roles','administration','Permission to access roles page','PAG','fa fa-id-badge',1200,false,false,NULL),
	 ('PADMUSR','administration_users','MADM','renderUserTable','administration_users_list','administration/users','administration','Permission to access users section','PAG','fa fa-users',1100,false,false,NULL),
	 ('PCHOLST','administration_choices_list','PCNFLST','renderChoices','','administration/configuration/lists/choices','administration','Permesso gestione elenco scelte.','PAG','fas fa-award',1,false,false,NULL),
	 ('PCNFWRH','administration_configuration_warehouses','PADMCNF','renderWarehouses','','administration/configuration/warehouses','administration','Autorizzazione a visualizzare l''editor per i magazzini','PAG','fas fa-warehouse',400003,false,false,NULL),
	 ('PLSTCAT','administration_categories_list','PCNFLST','renderCategories','','administration/configuration/lists/categories','administration','Permesso gestione elenco categorie (essenze).','PAG','fas fa-eye',1,false,false,NULL),
	 ('PLSTCLI','administration_clients_list','PCNFLST','renderClients','','administration/configuration/lists/clients','administration','Permesso gestione elenco clienti.','PAG','fas fa-shopping-cart',30,false,false,NULL),
	 ('PLSTMAT','administration_materials_list','PCNFLST','renderMaterials','','administration/configuration/lists/materials','administration','Permesso gestione elenco materiali.','PAG','fas fa-shapes',1,false,false,NULL),
	 ('PLSTSUP','administration_suppliers_list','PCNFLST','renderSuppliers','','administration/configuration/lists/suppliers','administration','Permesso gestione elenco fornitori.','PAG','fas fa-truck-moving',1,false,false,NULL),
	 ('SADMASF','administration_assets_forms_list','PADMASF','getForms','','administration/assets/forms','administration','Permission to view forms list','SEC',NULL,10010,true,false,NULL),
	 ('SADMEVE','administration_events_edit','PADMEVN','','','administration/events','administration','Permission to edit and add events.','SEC','',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('SADMEVL','administration_events_list','PADMEVN','','','administration/events','administration','Permission to access events list','SEC','',1,false,false,NULL),
	 ('SADMIMP','administration_assets_import_view','PADMIMP','','','administration/assets/import','administration','Permission to view import section.','SEC','fa fa-import',1,false,false,NULL),
	 ('SADMPME','administration_permissions_edit','PADMPRM','','','administration/permissions','administration','Permission to access permissions edit section.','SEC',NULL,10100,false,false,NULL),
	 ('SADMPML','administration_permissions_list','PADMPRM','getAllPemissions',NULL,'administration/permissions','administration','Permission to access permissions list section.','SEC',NULL,1310,false,false,NULL),
	 ('SADMRLL','administration_roles_list','PADMRLS','renderRolesTable','','administration/roles','administration','Permission to access roles list','SEC',NULL,1210,false,false,NULL),
	 ('SADMUSE','administration_users_edit','PADMUSR',NULL,NULL,'administration/users','administration','Permission to edit users','SEC',NULL,1130,false,false,NULL),
	 ('SADMUSL','administration_users_list','PADMUSR','getUsers',NULL,'administration/users','administration','Permission to access user list','SEC',NULL,1110,false,false,NULL),
	 ('SADMUSN','administration_users_new','PADMUSR',NULL,NULL,'administration/users','administration','Permission to view new user form.','SEC',NULL,1150,false,false,NULL),
	 ('SADMUV','administration_users_view','PADMUSR',NULL,NULL,'administration/users','administration','Permission to view users','SEC',NULL,1120,false,false,NULL),
	 ('SCATEDT','categories_edit','PLSTCAT','','','administration/configuration/lists/categories','administration','Form gestione categoria.','SEC','fas fa-eye',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('SCATLST','categories_list','PLSTCAT','','','administration/configuration/lists/suppliers','administration','Lista categorie','SEC','fas fa-list',1,false,false,NULL),
	 ('SCHOEDT','choices_edit','PCHOLST','','','administration/configuration/lists/choices','administration','Section gestione scelta.','SEC','',1,false,false,NULL),
	 ('SCHOLST','choices_list','PCHOLST','','','administration/configuration/lists/choices','administration','Lista scelte','SEC','fas fa-award',1,false,false,NULL),
	 ('SCLIEDT','clients_edit','PLSTCLI','clients_edit','','administration/configuration/lists/clients','administration','Form gestione cliente.','SEC','fas fa-shopping-cart',1,false,false,NULL),
	 ('SCLILST','clients_list','PLSTCLI','clients_list','','administration/configuration/lists/clients','administration','Lista clienti','SEC','fas fa-shopping-cart',1,false,false,NULL),
	 ('SCNFWRH','warehouses_list','PCNFWRH','','','administration/configuration/warehouses','administration','Visualizzare e gestire magazzini','SEC','fas fa-warehouse',40010,false,false,NULL),
	 ('SMATEDT','materials_edit','PLSTMAT','','','administration/configuration/lists/materials','administration','Form gestione materiale.','SEC','',1,false,false,NULL),
	 ('SMATLST','materials_list','PLSTMAT','','','administration/configuration/lists/materials','administration','Lista materiali','SEC','',1,false,false,NULL),
	 ('SSUPEDT','suppliers_edit','PLSTSUP','suppliers_edit','','administration/configuration/lists/suppliers','administration','Form gestione fornitore.','SEC','fas fa-shopping-cart',1,false,false,NULL),
	 ('SSUPLST','suppliers_list','PLSTSUP','suppliers_list','','administration/configuration/lists/suppliers','administration','Lista fornitori','SEC','fas fa-truck',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XADMAFE','administration_assets_forms_edit_save','SADMASF','saveForm','','administration/assets/forms','administration','Permission to update form html','EXE','fa fa-save',10035,true,false,NULL),
	 ('XADMGOM','assets_import_get_object_maps','PADMIMP','getObjectMaps','','','administration','Permission to load object maps..','EXE','fa fa-map',1,false,false,NULL),
	 ('XADMMPC','assets_import_createmap','PADMIMP','createObjectMap','','','administration','Permission to create new map to import object from external file.','EXE','fa fa-save',1,false,false,NULL),
	 ('XADMMPU','assets_import_updatemap','PADMIMP','updateObjectMap','','','administration','Permission to update map to import object from external file.','EXE','fa fa-pencil-square',1,false,false,NULL),
	 ('XADMOBD','assets_import_getobject','PADMIMP','getObject','','','administration','Permission to load object details.','EXE','fa fa-circle',1,false,false,NULL),
	 ('XADMOBJ','assets_import_getobjects','PADMIMP','getObjects','','','administration','Guest permission to load form layout','EXE','fa fa-circle',1,false,false,NULL),
	 ('XADMOBM','assets_import_get_object_maps','PADMIMP','getObjectMaps','','','administration','Permission to load object maps.','EXE','fa fa-map',1,false,false,NULL),
	 ('XADMOBU','assets_import_updateobject','PADMIMP','updateObject','','','administration','Permission to update object map structure.','EXE','fa fa-save',1,false,false,NULL),
	 ('XADMP4R','administration_role_permissions','SADMRLL','getPermissionsToRole','','administration/roles','administration','Autorizzazione a visualizzare autorizzazioni per un dato ruolo.','EXE','',10010,false,false,NULL),
	 ('XADMPTR','administration_permissions_tree','SADMRLL','getPermissionsTree','','administration/roles','administration','Autorizzazione ad estrarre albero permessi.','EXE',NULL,10010,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XADMRAD','administration_role_add','SADMRLL','addRole','','administration/roles','administration','Autorizzazione ad aggiungere un nuovo ruolo.','EXE','fa fa-plus',10010,false,false,NULL),
	 ('XADMRLL','administration_roles_list_get','SADMRLL','getRoles','','administration/roles','administration','Autorizzazione a vedere lista ruoli.','EXE',NULL,10010,false,false,NULL),
	 ('XADMRUP','administration_role_update','SADMRLL','updateRole','','administration/roles','administration','Autorizzazione a modificare un dato ruolo.','EXE','fa fa-pencil-square',10010,false,false,NULL),
	 ('XADMUES','administration_users_edit_save','SADMUSE','updateUser',NULL,'administration/users','administration','Permission to update user details','EXE','fa fa-save',1135,false,false,NULL),
	 ('XADMULD','administration_users_list_delete','SADMUSL','deleteUser',NULL,'administration/users','administration','Permission to delete users','EXE','fa fa-trash',1165,false,false,NULL),
	 ('XADMUNS','administration_users_new_save','SADMUSN','createUser',NULL,'administration/users','administration','Permission to save new user','EXE','fa fa-save',1160,false,false,NULL),
	 ('XADMURA','administration_users_roles_assign','SADMUSE','assignRolesToUser','','administration/users','administration','Permission to get roles for a given user.','EXE','',1,false,false,NULL),
	 ('XADMURL','administration_users_roles_get','SADMUSE','getUserRoles','','administration/users','administration','Permission to get roles for a given user.','EXE','fa fa-id-badge',10010,false,false,NULL),
	 ('XCATCRT','administration_create_category','SCATEDT','createCategory','','administration/configuration/lists/categories','administration','Creazione nuova categoria.','EXE','fas fa-file',1,false,false,NULL),
	 ('XCATGET','get_categories','SCATLST','getCategories','','administration/configuration/lists/categories','administration','Estrai elenco categorie.','EXE','',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XCATUPD','administration_updaate_category','SCATEDT','updateCategory','','administration/configuration/lists/categories','administration','Creazione nuova categoria.','EXE','fas fa-save',1,false,false,NULL),
	 ('XCHOCRT','choice_create','SCHOEDT','createChoice','','administration/configuration/lists/choices','administration','Permesso di creare nuova scelta.','EXE','fas fa-save',1,false,false,NULL),
	 ('XCHOLST','get_choices','SCHOLST','getChoices','','administration/configuration/lists/choices','administration','Estrazione lista scelte.','EXE','fas fa-award',1,false,false,NULL),
	 ('XCHOUPD','choice_update','SCHOEDT','updateChoice','','administration/configuration/lists/choices','administration','Permesso di modificare una scelta.','EXE','',1,false,false,NULL),
	 ('XCLICRT','administration_create_registry_entity','SCLIEDT','createRegistryEntry','','administration/configuration/lists','administration','Permesso di creare nuova entry in anagrafica.','EXE','fas fa-plus',1,false,false,NULL),
	 ('XCLIUPD','administration_update_registry_entity','SCLIEDT','updateRegistryEntity','','administration/configuration/lists','administration','Permesso di aggiornare entry in anagrafica.','EXE','fas fa-save',1,false,false,NULL),
	 ('XCNFWHG','administration_configuration_warehouses_list','SCNFWRH','getWarehouses','','administration/configuration/warehouses','administration','Permesso di interrogare elenco magazzini.','EXE','fas fa-warehouse',1,false,false,NULL),
	 ('XCNFWRC','administration_configuration_warehouse_create','SCNFWRH','createNewWarehouse','','administration/configuration/warehouses','administration','Permesso creazione nuovo magazzino','EXE','fas fa-plus',1,false,false,NULL),
	 ('XCNFWRU','administration_configuration_warehouse_update','SCNFWRH','updateWarehouse','','administration/configuration/warehouses','administration','Permesso modifica magazzino esistente.','EXE','fas fa-warehouse',1,false,false,NULL),
	 ('XGETMET','administration_get_meta','PADMAST','getMeta','','administration','administration','Permission to get meta form table','EXE','',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XSETMET','administration_set_meta','PADMAST','setMeta','','administration','administration','Permission to set meta to table','EXE','',1,false,false,NULL),
	 ('XINSPRM','administration_permissions_insert_permission','SADMPME','addPermission',NULL,'administration/permissions','administration','Funzione per aggiungere una permission.','EXE','fa fa-save',10045,false,false,NULL),
	 ('XMATCRT','material_create','SMATEDT','createMaterial','','administration/configuration/lists/materials','administration','Permesso di creare nuovo materiale.','EXE','fas fa-shapes',1,false,false,NULL),
	 ('XMATLST','get_materials','SMATLST','getMaterials','','administration/configuration/lists/materials','administration','Estrazione lista materiali.','EXE','fas fa-shapes',1,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XSASPAR','assets_parameters_get','PADMASF','getAssetParameters','','','','Permission to get form asset parameters','EXE','',1,false,false,NULL);

INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMUES','administration_users_edit_save_button','SADMUSE','',NULL,'administration/users','administration','Button to save user details','EXE','fa-solid fa-floppy-disk',1135,false,false,NULL);
INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMUEC','administration_users_edit_cancel','SADMUSE','',NULL,'administration/users','administration','Button cancel in user details','EXE','fa-solid fa-xmark',1135,false,false,NULL);
INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMUET','administration_users_edit_deletetoken','SADMUSE','',NULL,'administration/users','administration','Button to delete user token','EXE','fa-solid fa-trash-can',1135,false,false,NULL);
INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMUCT','administration_users_edit_createtoken','SADMUSE','',NULL,'administration/users','administration','Button to create user token','EXE','fa-solid fa-user-secret',1135,false,false,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XUSRSET','administration_user_settings_get','PADMSTN','getUserSettings','','administration/settings','administration','Permission to get user settings','EXE','',1,false,true,NULL),
	 ('XSVUSSE','administration_save_user_settings','PADMSTN','saveUserSettings','','administration/settings','administration','Permission to save user settings','EXE','',1,false,true,NULL);
-- assets_form permission to access getForm() function;

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	('XADMASF','assets_form','PADMASF','getForm','','','','Guest permission to load form layout','EXE',NULL,90000,false,true,NULL);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	('XADASGT','assets_get_data','PADMASF','getAssetData','','','','Guest permission to load asset data','EXE',NULL,90000,false,true,NULL),
    ('XADASUP','assets_update_data','PADMASF','updAssetData','','','','Permission to update asset record','EXE',NULL,90000,false,false,NULL),
    ('XADASCR','assets_create_new','PADMASF','crtAsset','','','','Permission to add new asset record','EXE',NULL,90000,false,false,NULL),
    ('XADAGBN','assets_get_data_by_name','PADMASF','getAssetDataByName','','','','Permission to get asset data','EXE',NULL,90000,false,false,NULL);

-- adding daemons permissions set
INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,guest,meta,hidden) VALUES
	 ('XADDMLS','get_daemons_list','PADMDMN','getDaemonsList','','administration/daemons','administration','Get daemons list','EXE','',1,false,NULL,false),
	 ('BDAENEW','administration_daemons_new_row','PADMDMN','','','administration/daemons','administration','New row button','BUT','fas fa-plus-square',1,false,NULL,false),
	 ('BDAESAV','administration_daemons_save','PADMDMN','','','administration/daemons','administration','Daemons save button','BUT','fas fa-save',1,false,NULL,false),
	 ('BDAEDEL','administration_daemons_del','PADMDMN','','','administration/daemons','administration','Daemons delete button','BUT','fas fa-trash',1,false,NULL,false),
	 ('XDAEUPD','update_daemon','PADMDMN','updDaemon','','administration/daemons','administration','Update daemon row','EXE','',1,false,NULL,false),
	 ('XDAENEW','add_new_daemon','PADMDMN','addDaemon','','administration/daemons','administration','Add daemon row','EXE','',1,false,NULL,false),
	 ('XDAEDEL','delete_daemon','PADMDMN','delDaemon','','administration/daemons','administration','Delete daemon row','EXE','',1,false,NULL,false),
	 ('BDAEENA','administration_daemons_enable','PADMDMN','','','administration/daemons','administration','Button to enable daemon','BUT','fas fa-toggle-on',1,false,NULL,false),
	 ('BDAEDIS','administration_daemons_disable','PADMDMN','','','administration/daemons','administration','Button to disable daemon','BUT','fas fa-toggle-off',1,false,NULL,false),
	 ('BDAESTR','administration_daemons_start','PADMDMN','','','administration/daemons','administration','Button to start daemon','BUT','fas fa-play-circle',1,false,NULL,false);
INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,guest,meta,hidden) VALUES
	 ('BDAESTP','administration_daemons_stop','PADMDMN','','','administration/daemons','administration','Button to start daemon','BUT','fas fa-stop-circle',1,false,NULL,false),
	 ('PADMDMN','administration_daemons','MADM','getObjects','','administration/daemons','administration','Permission to access daemons page','PAG','fas fa-tasks',5000,false,NULL,false);


INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,guest,meta,hidden) VALUES
	 ('SADMMSC','','MADM','','','','administration','Non GUI section to handle misc execute permissions','SEC','',1,false,NULL,false),
	 ('XDAESTR','misc_daemon_start','SADMMSC','daemonStart','','','administration','Execute daemon start','EXE','',1,false,NULL,false),
	 ('XDAESTP','misc_daemon_stop','SADMMSC','daemonStop','','','administration','Execute daemon stop','EXE','',1,false,NULL,false),
	 ('XDAEENA','misc_daemon_enable','SADMMSC','daemonEnable','','','administration','Execute daemon enable (at system startutp)','EXE','',1,false,NULL,false),
	 ('XDAEDIS','misc_daemon_disable','SADMMSC','daemonDisable','','','administration','Execute daemon disable (at system startutp)','EXE','',1,false,NULL,false),
	 ('XMSCMOD','misc_get_modules','SADMMSC','getModules',NULL,'administration/daemons','administration','Get installed modules list','EXE',NULL,1,false,NULL,false),
	 ('XMSCPLD','misc_get_payloads','SADMMSC','getPayloads',NULL,'administration/daemons','administration','Get installed payloads for all modules.','EXE',NULL,1,false,NULL,false);

-- adding scheduler permissions set
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XSCHJEN','enable_scheduler','PADMSCH','enableSchedulerJob','','administration/scheduler','administration','Enable scheduler row','EXE','',1,false,false,NULL),
	 ('XSCHJDS','disable_scheduler','PADMSCH','disableSchedulerJob','','administration/scheduler','administration','Disable scheduler row','EXE','',1,false,false,NULL),
	 ('XADMSLS','get_scheduler_list','PADMSCH','getSchedulerList','','administration/scheduler','administration','Get scheduler list','EXE','',1,false,false,NULL),
	 ('BSCHNEW','administration_scheduler_new_row','PADMSCH','','','administration/scheduler','administration','New scheduler row button','BUT','fas fa-plus-square',1,false,false,NULL),
	 ('BSCHDEL','administration_scheduler_del','PADMSCH','','','administration/scheduler','administration','Scheduler delete button','BUT','fas fa-trash',1,false,false,NULL),
	 ('BSCHSAV','administration_scheduler_save','PADMSCH','','','administration/scheduler','administration','Scheduler save button','BUT','fas fa-save',1,false,false,NULL),
	 ('BSCHENA','administration_scheduler_enable','PADMSCH','','','administration/shceduler','administration','Button to enable scheduler','BUT','fas fa-toggle-on',1,false,false,NULL),
	 ('XSCHNEW','add_new_scheduler','PADMSCH','addSchedulerJob','','administration/scheduler','administration','Add scheduler row','EXE','',1,false,false,NULL),
	 ('XSCHDEL','delete_scheduler','PADMSCH','delSchedulerJob','','administration/scheduler','administration','Delete scheduler row','EXE','',1,false,false,NULL),
	 ('BSCHDIS','administration_scheduler_disable','PADMSCH','','','administration/scheduler','administration','Button to disable scheduler','BUT','fas fa-toggle-off',1,false,false,NULL),
	 ('XMSCSCJ','misc_get_scheduler_jobs','SADMMSC','getSchedulerJobs',NULL,'administration/scheduler','administration','Get installed scheduler jobs for all modules.','EXE',NULL,1,false,false,NULL),
	 ('PADMSCH','administration_scheduler','MADM','getObjects','','administration/scheduler','administration','Permission to access scheduler page','PAG','fas fa-tasks',5500,false,false,NULL);

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,guest,meta,hidden) VALUES
	 ('XADMSET','update_user_settings','PADMSTN','updateSettings','','administration','administration','Permission to update user settings.','EXE','',1,false,NULL,false);
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('BADMADR','administration_assets_forms_edit_row_delete','SADMASF','','','administration/assets/forms','administration','View DEL ROW button on forms list','BUT','fa-solid fa-trash-can',10030,true,false,NULL);


INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XCHKUSE','administration_checkUserExistance','SADMUSE','checkUserExistance','','administration/users','administration','checkUserExistance','EXE','',1,false,true,NULL);


-- code_list;

INSERT INTO public.code_lists ("table",description,editable,icon,meta) VALUES
	 ('code_list_permission_types','Permission types',false,NULL,NULL);



-- root user entry;
INSERT INTO public.core_users (id, username,"password",registryid,email,socketid,enabled,sessionid,avatar,status,hidden,"language",settings,meta,organization) VALUES
	 (1, 'root','$2y$10$GOmeEOqu/7T8m6FpAXMF6uBovNd9zLeWxsXMOGSiigFs0oqPi026i',NULL,'admin@jivalabs.com',NULL,1,'',NULL,'OFF',1,'it-IT','{}','{}',NULL),
	 (2, 'admin','',NULL,'',NULL,1,'',NULL,'OFF',1,'it-IT','{}','{}',NULL);



-- Superadmin user role entry;
INSERT INTO public.core_user_roles (id, role_name,hidden) VALUES
	(1, 'Superadmin',1),
	(2, 'Administrator',2);



-- root id and Superadmin id
INSERT INTO public.core_user_has_user_role (user_id,role_id) VALUES
(1,1);


-- 16 form entries (9 administration + 7 core);

INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta) VALUES
	 ('form','administration_category','Form to edit or insert category',false,' <form id="administration_category">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="code">{category_code}</label>
                <input type="text" class="form-control" id="code" name="main[code]" required>
            </div>
            <div class="form-group col-md-11">
                <label for="description">{category_description}</label>
                <input type="text" class="form-control" id="description" name="main[description]" placeholder="Descrizione" required>
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_choice','Form per scelta',false,' <form id="administration_choice">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="code">{choice_code}</label>
                <input type="text" class="form-control" id="code" name="main[code]" required>
            </div>
            <div class="form-group col-md-11">
                <label for="description">{choice_description}</label>
                <input type="text" class="form-control" id="description" name="main[description]" placeholder="Descrizione" required>
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_client','Form per clienti.',false,' <form id="administration_client">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="id">{client_id}</label>
                <input type="text" class="form-control" id="id" name="id" value="NULL" readonly>
            </div>
            <div class="form-group col-md-11">
                <label for="entity_name">{client_name}</label>
                <input type="text" class="form-control" id="entity_name" name="main[entity_name]" placeholder="Nome cliente" required>
                <input type="hidden" id="entity_category" name="main[entity_category]" value="CLI">
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_codelist_form','Codelists Form',false,' <form id="administration_codelist_form">
	<div class="row">
		<div class="form-group col-md-2">
			<label for="code">{administration_codelist_code}</label>
			<input class="form-control" type="text" id="code" name="main[code]">
		</div>
		<div class="form-group col-md-5">
			<label for="description">{administration_codelist_description}</label>
			<input class="form-control" type="text" id="description" name="main[description]">
		</div>
		<div class="form-group col-md-3">
			<label for="icon">{administration_codelist_icon}</label>
			<input class="form-control" type="text" id="icon" name="main[icon]">
		</div>
		<div class="form-group col-md-2">
			<label for="ord">{administration_codelist_ord}</label>
			<input class="form-control" type="text" id="ord" name="main[ord]" value="1">
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-6">
			<label for="misc">{administration_codelist_misc}</label>
			<textarea onkeydown="insertTab(this, event);" class="form-control" id="misc" name="main[misc]" rows="10"></textarea>
		</div>
		<div class="form-group col-md-6">
			<label for="properties">Properties</label>
			<textarea onkeydown="insertTab(this, event);" class="form-control" id="properties" name="main[properties]" rows="10"></textarea>
		</div>
	</div>
	<div class="row">

	</div>
</form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_form_import','Form to be used as main file import component.',false,'<form id="administration_form_import" action="#" method="post" class="text-center">
	<input type="file" name="file" id="file" onchange="fileInputChange()" style="display: none;">
	<div style="border: 5px dotted #e5e5e5; padding: 33px; margin: 33px;" id="upload_area" ondrop="uploadFile(event)" onclick="updloadAreaClick()">
		<p id="file_upload_head">{form_import_drag_drop_head}</p>
		<i class="fa fa-file-excel-o fa-5x"></i>
	</div>
<!--
	<p>
		<button type="submit" class="btn btn-sm" name="delete"><i class="icon-remove"></i> Remove</button>
		<button type="submit" class="btn btn-primary btn-sm" id="save" name="save"><i class="icon-ok icon-white"></i> Save</button>
	</p>
-->
</form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_materials','Form gestione materiale',false,' <form id="administration_materials">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="code">{material_code}</label>
                <input type="text" class="form-control" id="code" name="main[code]" required>
            </div>
            <div class="form-group col-md-11">
                <label for="description">{material_description}</label>
                <input type="text" class="form-control" id="description" name="main[description]" placeholder="Descrizione" required>
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_subcodelist_form','Subcodelist form',false,' <form id="administration_subcodelist_form">
	<div class="row">
		<div class="form-group col-md-2">
			<label for="code">{administration_codelist_code}</label>
			<input class="form-control" type="text" id="code" name="main[code]">
		</div>
		<div class="form-group col-md-2">
			<label for="parent_code">{administration_codelist_parent_code}</label>
			<select class="form-control" id="parent_code" name="main[parent_code]" data-list="api/v1/misc/codelists/{parent_codelist}">
			</select>
		</div>
		<div class="form-group col-md-3">
			<label for="description">{administration_codelist_description}</label>
			<input class="form-control" type="text" id="description" name="main[description]">
		</div>
		<div class="form-group col-md-3">
			<label for="icon">{administration_codelist_icon}</label>
			<input class="form-control" type="text" id="icon" name="main[icon]">
		</div>
		<div class="form-group col-md-2">
			<label for="ord">{administration_codelist_ord}</label>
			<input class="form-control" type="text" id="ord" name="main[ord]" value="1">
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="misc">{administration_codelist_misc}</label>
			<input class="form-control" type="text" id="misc" name="main[misc]">
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="properties">Properties</label>
			<textarea class="form-control" id="properties" name="main[properties]"></textarea>
		</div>
	</div>
</form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_supplier','Form to edit and add new supplier.',false,' <form id="administration_supplier">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="id">{supplier_id}</label>
                <input type="text" class="form-control" id="id" name="id" value="NULL" readonly>
            </div>
            <div class="form-group col-md-11">
                <label for="entity_name">{supplier_name}</label>
                <input type="text" class="form-control" id="entity_name" name="main[entity_name]" placeholder="Nome fornitore" required>
                <input type="hidden" id="entity_category" name="main[entity_category]" value="SUP">
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','administration_warehouse','Form to add and edit warehouse.',false,' <form id="administration_warehouse">
        <div class="row">
            <div class="form-group col-md-1">
                <label for="id">{warehouse_id}</label>
                <input type="text" class="form-control" id="id" name="id" value="NULL" readonly>
            </div>
            <div class="form-group col-md-11">
                <label for="warehouse_name">{warehouse_name}</label>
                <input type="text" class="form-control" id="warehouse_name" name="main[warehouse_name]" placeholder="Nome magazzino" required>
            </div>
    </form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	 ('form','core_file_event_form','Form to add events desriptions',false,'<form id="core_file_event_form">
	<div class="row">
		<div class="form-group col-md-4">
			<label for="description">{administration_events_description}</label>
			<input type="text" class="form-control" id="description" name="description" placeholder="Descrizione">
		</div>
		<div class="form-group col-md-4">
            <label for="file_subtype">{administration_events_file_subtype}</label>
			<input type="hidden" id="file_type" name="file_type" value="CALL">
			<select class="form-control" id="file_subtype" name="file_subtype" placeholder="language" data-list="api/v1/misc/codelists/file_subtypes/">
			</select>
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-8">
            <label for="language">{administration_events_rules}</label>
            <textarea class="form-control" id="rules" name="rules" rows="23"></textarea>
		</div>		
	</div>
</form>',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta) VALUES
	 ('form','core_forms_form','Form that handles software forms (and custom ones).',false,'    <form id="core_forms">
        <div class="row">
            <div class="form-group col-md-3">
                <label for="asset_name">Form name</label>
                <input type="text" class="form-control" id="asset_name" name="asset_name" placeholder="Form name">
            </div>
            <div class="form-group col-md-9">
                <label for="description">Description</label>
                <input type="text" class="form-control" name="description" id="description" placeholder="Enter description">
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-12">
                <label for="asset_innerhtml">Form HTML</label>
                <textarea rows="15" class="form-control" id="asset_innerhtml" name="asset_innerhtml" placeholder="Enter form HTML here (id is mandatory)."></textarea>
                <input type="hidden" id="id" name="id">
            </div>
        </div>
    </form>',NULL,NULL,NULL,NULL,0,NULL,NULL),
	 ('form','core_permissions_form','Form to describe each permission.',false,'<form id="core_permissions" >
	<div class="row">
		<div class="form-group col-md-2">
			<label for="module">{core_permissions_form_code}</label>
			<input type="text" class="form-control" name="code" id="code" placeholder="Code">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-4">
			<label for="permission_name">{core_permissions_form_permission_name}</label>
			<input type="text" class="form-control" id="permission_name" name="permission_name" placeholder="Permission name">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-2">
			<label for="module">{core_permissions_form_module}</label>
			<input type="text" class="form-control" name="module" id="module" placeholder="Module">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-4">
			<label for="permission_namespace">{core_permissions_form_permission_namespace}</label>
			<input type="text" class="form-control" name="permission_namespace" id="permission_namespace" placeholder="Permission namespace">
			<div class="help-block with-errors"></div>
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-4">
			<label for="permission_function">{core_permissions_form_permission_function}</label>
			<input type="text" class="form-control" id="permission_function" name="permission_function" placeholder="permission_function">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-4">
			<label for="default_child">{core_permissions_form_default_child}</label>
			<input type="text" class="form-control" id="default_child" name="default_child" placeholder="default_child">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-2">
			<label for="permission_type">{core_permissions_form_permission_type}</label>
			<select class="form-control" id="permission_type" name="permission_type" placeholder="permission_type" data-list="api/v1/misc/codelists/permission_types">
			</select>
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-2">
			<label for="parent">{core_permissions_form_parent}</label>
			<input type="text" class="form-control" id="parent" name="parent" placeholder="parent"  data-error="{core_permissions_parent_validator}" required>
			<div class="help-block with-errors"></div>
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-8">
			<label for="permission_name">{core_permissions_form_permission_description}</label>
			<input type="text" class="form-control" id="permission_description" name="permission_description" placeholder="permission_description">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-2">
			<label for="icon">{core_permissions_form_icon}</label>
			<input type="text" class="form-control" name="icon" id="icon" placeholder="icon">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-1">
			<label for="ord">{core_permissions_form_ord}</label>
			<input type="text" class="form-control" name="ord" id="ord" placeholder="ord" value="1">
			<div class="help-block with-errors"></div>
		</div>
		<div class="form-group col-md-1">
			<label for="guest">{core_permissions_form_guest}</label>
			<input type="guest" class="form-control" name="guest" id="guest" placeholder="guest" value="false">
			<div class="help-block with-errors"></div>
		</div>
	</div>
</form>',NULL,NULL,NULL,NULL,0,NULL,NULL),
	 ('form','core_tables_form','Form that handles software tables and parameters.',false,'    <form id="core_tables">
        <div class="row">
            <div class="form-group col-md-3">
                <label for="asset_name">Table name</label>
                <input type="text" class="form-control" id="asset_name" name="asset_name" placeholder="Table name">
            </div>
            <div class="form-group col-md-9">
                <label for="description">Description</label>
                <input type="text" class="form-control" name="description" id="description" placeholder="Enter description">
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-12">
                <label for="asset_parameters">Table parameters</label>
                <textarea rows="15" class="form-control" id="asset_parameters" name="asset_parameters" placeholder="Enter parameters in json format."></textarea>
                <input type="hidden" id="id" name="id">
            </div>
        </div>
    </form>','',NULL,NULL,NULL,0,NULL,NULL),
	 ('form','core_user_roles_form','Roles definition.',false,' <form id="core_user_roles">
        <div class="row">
            <div class="form-group col-md-12">
                <label for="role_name">Role name</label>
                <input type="text" class="form-control" id="role_name" name="role_name" placeholder="Role name">
                <input type="hidden" id="id" name="id">
            </div>
        </div>
    </form>',NULL,NULL,NULL,NULL,0,NULL,NULL),
	 ('table','core_users_table','Configuration for main user table.',false,NULL,'{
"columns": [{
	"checkbox": "rowid"
},
{
	"field": "id",
	"title": "User ID"
},
{
	"field": "username",
	"title": "Username"
},
{
	"field": "email",
	"title": "Email"
},
{
	"field": "sessionid",
	"title": "Session"
}]}',NULL,NULL,NULL,0,NULL,NULL);


INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta) VALUES
	 ('columns','core_users_fields','Columns for table users',false,NULL,'[{"field": "id", "title": "table_core_users_id", "width": 77, "hozAlign": "center"}, {"field": "username", "title": "table_core_users_username"}, {"field": "email", "title": "table_core_users_email"}, {"field": "language", "title": "table_core_users_language"}, {"field": "organization", "title": "table_core_users_organization"}]',NULL,NULL,NULL,NULL,NULL,NULL);


INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta) VALUES
	 ('form','administration_scheduler_new_job_form','Form to add and edit scheduler jobs',false,'<form id="administration_scheduler_new_job_form"  autocomplete="off">
	
	<div class="row">
	
		<div class="form-group col-md-3">
            <label for="module">{form_new_scheduler_job_module}</label>
            <select id="module" class="form-control" name="module" data-list="/api/v1/misc/moduleslist" onchange="selectJobs(this)"></select>
        </div>
        
		<div class="form-group col-md-3">
            <label for="script">{form_new_scheduler_job_script}</label>
            <select id="script" class="form-control" name="script"></select>
        </div>
        
		<div class="form-group col-md-6">
			<label for="arguments">{form_new_scheduler_job_arguments}</label>
			<input type="text" class="form-control" id="arguments" name="arguments">
		</div>

	</div>
	<div class="row">
		<div class="form-group col-md-3">
			<label for="minutes">{form_new_scheduler_job_minutes}</label>
			<input type="text" class="form-control" id="minutes" name="minutes">
		</div>
		
		<div class="form-group col-md-3">
			<label for="hours">{form_new_scheduler_job_hours}</label>
			<input type="text" class="form-control" id="hours" name="hours">
		</div>

		<div class="form-group col-md-2">
			<label for="daymonth">{form_new_scheduler_job_daymonth}</label>
			<input type="text" class="form-control" id="daymonth" name="daymonth">
		</div>
		
		<div class="form-group col-md-2">
			<label for="months">{form_new_scheduler_job_months}</label>
			<input type="text" class="form-control" id="months" name="months">
		</div>
		
		<div class="form-group col-md-2">
			<label for="dayweek">{form_new_scheduler_job_dayweek}</label>
			<input type="text" class="form-control" id="dayweek" name="dayweek">
		</div>

	</div>
        
</form>','{}',NULL,NULL,NULL,NULL,NULL,NULL);

-- permission_codes for admin user (id = 2);

INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XCATCRT'),
	 (2,'BCHOEDT'),
	 (2,'BCATBCK'),
	 (2,'XCHOLST'),
	 (2,'BMATSAV'),
	 (2,'PCHOLST'),
	 (2,'BCLIEDT');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BMATEDT'),
	 (2,'SCHOLST'),
	 (2,'SCHOEDT'),
	 (2,'XCLICRT'),
	 (2,'XCNFWRU'),
	 (2,'XMATCRT');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XCATGET'),
	 (2,'BSUPEDT'),
	 (2,'SCLILST'),
	 (2,'SMATEDT'),
	 (2,'BCNFWHE'),
	 (2,'XMATLST');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BCFGWHS'),
	 (2,'XCHOUPD'),
	 (2,'BCNFWHA'),
	 (2,'BCLIBCK'),
	 (2,'XCHOCRT'),
	 (2,'XMATUPD'),
	 (2,'SSUPLST');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XCLIUPD'),
	 (2,'BSUPADD'),
	 (2,'XSUPLST'),
	 (2,'BSUPBCK'),
	 (2,'XCNFWRC');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BMATBCK'),
	 (2,'BCHOSAV'),
	 (2,'BCATSAV'),
	 (2,'XSUPCRT'),
	 (2,'SCATEDT'),
	 (2,'BCATADD');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'SCLIEDT'),
	 (2,'BCHOCRT'),
	 (2,'XCNFWHG'),
	 (2,'BCATEDT'),
	 (2,'XADMURA'),
	 (2,'BSUPSAV');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'PLSTCAT'),
	 (2,'XSUPUPD'),
	 (2,'SMATLST'),
	 (2,'SCATLST'),
	 (2,'PLSTSUP'),
	 (2,'BMATCRT');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BCLISAV'),
	 (2,'BCHOBCK'),
	 (2,'PLSTMAT'),
	 (2,'BCLIADD'),
	 (2,'BCFGWHB'),
	 (2,'SSUPEDT');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XCATUPD'),
	 (2,'BCDLADD'),
	 (2,'BCDLDEL'),
	 (2,'BCDLEDT'),
	 (2,'XCDLODL'),
	 (2,'SCDLLST'),
	 (2,'BADCLSV'),
	 (2,'BADCLD2');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BADCLBK'),
	 (2,'XADCLSV'),
	 (2,'XADCLCR'),
	 (2,'XACDCRT'),
	 (2,'SCDLEDT'),
	 (2,'PADMCLE');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'PCNFLST'),
	 (2,'PLSTCLI');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'MADM'),
	 (2,'PADMUSR'),
	 (2,'SADMUSL'),
	 (2,'SADMUV'),
	 (2,'SADMUSE'),
	 (2,'XADMUES'),
	 (2,'SADMUSN'),
	 (2,'XADMUNS'),
	 (2,'XADMULD'),
	 (2,'BADMUSA');
INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BADMULE'),
	 (2,'XADMURL'),
	 (2,'PADMCNF'),
	 (2,'SCNFWRH'),
	 (2,'PCNFWRH'),
	 (2,'XREGCLS');

INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'BADMUES'),
	 (2,'BADMUEC'),
	 (2,'BADMUCT'),
	 (2,'BADMUET');


INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XUSRSET'),
	 (2,'XSVUSSE');

INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (2,'XADAGBN');

INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
	 (14,'XADAGBN');


INSERT INTO public.code_list_permission_types (code,description,ord,icon,misc,properties) VALUES
	 ('BUT','Button',NULL,NULL,NULL,NULL),
	 ('CLI','Client',NULL,NULL,NULL,NULL),
	 ('EXE','Execute',NULL,NULL,NULL,NULL),
	 ('MOD','Module',NULL,NULL,NULL,NULL),
	 ('PAG','Page',NULL,NULL,NULL,NULL),
	 ('SEC','Section',NULL,NULL,NULL,NULL),
	 ('SRV','Server',NULL,NULL,NULL,NULL),
	 ('WDG','Widget',NULL,NULL,NULL,'{}'),
	 ('MOB','Mobile',NULL,NULL,NULL,NULL);





INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta,role_id) VALUES
	 ('form','core_users_form','Main users form.',false,'<form id="core_users">
	<div class="row">
		<div class="form-group col-md-2">
			<label for="username">{core_users_form_username}</label>
			<input type="text" class="form-control" id="username" name="username" placeholder="Username">
		</div>
		<div class="form-group col-md-3">
			<label for="password">{core_users_form_password}</label>
			<input type="password" class="form-control" name="password" id="password" placeholder="Password">
		</div>
		<div class="form-group col-md-3">
			<label for="email">{core_users_form_email}</label>
			<input type="email" class="form-control" id="email" name="email" placeholder="Email">
			<input type="hidden" id="id" name="id">
		</div>
		<div class="form-group col-md-1">
			<label for="language">{core_users_form_language}</label>
			<select class="form-control" id="language" name="language" placeholder="language" data-list="api/v1/misc/translations/">
			</select>
		</div>		
		<div class="form-group col-md-3">
			<label for="organization">{core_users_form_organization}</label>
			<select data-null-first="true" class="form-control" id="organization" name="organization" data-list="api/v1/registry/registrylist/CLI">
			</select>
		</div>
		<div class="form-group col-md-3">
			<label for="department">{core_users_form_department}</label>
			<input data-null-first="true" class="form-control" id="department" type="text" name="meta[department]">
		</div>	
	</div>
	<div class="row">

	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="settings">{core_users_form_settings}</label>
			<div id="settings" data-name="settings" data-type="jsoneditor" class="jc-jsoneditor"></div>
		</div>		
	</div>	
</form>','{"form": [[{"id": "username", "cols": 4, "name": "username", "type": "text", "label": "User", "autofocus": true, "mandatory": true, "relatedHidden": "id", "additionalClass": "form-control-sm"}, {"id": "password", "cols": 4, "name": "password", "type": "text", "label": "Password", "autofocus": true, "mandatory": true, "additionalClass": "form-control-sm"}, {"id": "email", "cols": 4, "name": "email", "type": "text", "label": "Email", "autofocus": true, "additionalClass": "form-control-sm"}], [{"id": "meta.primaryGroup", "key": "id", "cols": 5, "list": "api/v1/user/group/", "name": "meta[primaryGroup]", "type": "dropdown", "label": "Primary group", "values": "group_name", "onchange": "jivaCoreOptions.unsavedData=true;", "createForm": "core_usergroups_form", "createEndpoint": "/api/v1/user/group", "additionalClass": "form-select-sm", "createdEntryFields": "group_name", "createEndpointMethod": "post"}, {"id": "organization", "cols": 5, "list": "api/v1/registry/registrylist/CLI", "name": "organization", "type": "dropdown", "label": "Organization", "values": "entity_name", "onchange": "jivaCoreOptions.unsavedData=true;", "additionalClass": "form-select-sm"}, {"id": "language", "cols": 2, "list": "api/v1/misc/translations/", "name": "language", "type": "dropdown", "label": "Language", "values": "list", "onchange": "jivaCoreOptions.unsavedData=true;", "mandatory": true, "additionalClass": "form-select-sm"}]]}',NULL,NULL,NULL,0,NULL,NULL,NULL);


INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta,role_id) VALUES
	 ('form','core_users_form','Main users form.',false,'<form id="core_users">
	<div class="row">
		<div class="form-group col-md-2">
			<label for="username">{core_users_form_username}</label>
			<input type="text" class="form-control" id="username" name="username" placeholder="Username">
		</div>
		<div class="form-group col-md-3">
			<label for="password">{core_users_form_password}</label>
			<input type="password" class="form-control" name="password" id="password" placeholder="Password">
		</div>
		<div class="form-group col-md-3">
			<label for="email">{core_users_form_email}</label>
			<input type="email" class="form-control" id="email" name="email" placeholder="Email">
			<input type="hidden" id="id" name="id">
		</div>
		<div class="form-group col-md-1">
			<label for="language">{core_users_form_language}</label>
			<select class="form-control" id="language" name="language" placeholder="language" data-list="api/v1/misc/translations/">
			</select>
		</div>		
		<div class="form-group col-md-3">
			<label for="organization">{core_users_form_organization}</label>
			<select data-null-first="true" class="form-control" id="organization" name="organization" data-list="api/v1/registry/registrylist/CLI">
			</select>
		</div>
		<div class="form-group col-md-3">
			<label for="department">{core_users_form_department}</label>
			<input data-null-first="true" class="form-control" id="department" type="text" name="meta[department]">
		</div>	
	</div>
	<div class="row">

	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="settings">{core_users_form_settings}</label>
			<div id="settings" data-name="settings" data-type="jsoneditor" class="jc-jsoneditor"></div>
		</div>		
	</div>	
</form>','{"form": [[{"id": "username", "cols": 4, "name": "username", "type": "text", "label": "User", "autofocus": true, "mandatory": true, "relatedHidden": "id"}, {"id": "password", "cols": 4, "name": "password", "type": "text", "label": "Password", "autofocus": true}, {"id": "email", "cols": 4, "name": "email", "type": "text", "label": "Email", "autofocus": true}], [{"id": "department", "cols": 5, "name": "meta[department]", "type": "text", "label": "Department", "autofocus": true}, {"id": "organization", "cols": 5, "list": "api/v1/registry/registrylist/CLI", "name": "organization", "type": "dropdown", "label": "Organization", "values": "entity_name", "onchange": "jivaCoreOptions.unsavedData=true;", "autofocus": true}, {"id": "language", "cols": 2, "list": "api/v1/misc/translations/", "name": "language", "type": "dropdown", "label": "Language", "values": "list", "onchange": "jivaCoreOptions.unsavedData=true;", "autofocus": true}]]}',NULL,NULL,NULL,0,NULL,NULL,NULL);


INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XACDUPD','codelists_option_upd_v2','SCDLEDT','updCodeListOptionV2','','administration/codelists','administration','Permission to update codelist option value.','EXE','',1,false,false,NULL);

INSERT INTO public.code_lists ("table",description,editable,icon,meta) VALUES
	 ('code_list_duty_type','Duties types',true,NULL,NULL),
	 ('code_list_duties_services','Duties services',true,NULL,NULL),
	 ('code_list_usergroups_types','User Group Types',true,NULL,NULL);


INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XAGRPGT','administration_user_group_get','SADMUSN','getUserGroup',NULL,'administration/users','administration','Permission to get user group','EXE','fa fa-save',1160,false,false,'{"notAvailable": ["free"]}');

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XADUGRP','administration_user_group_add','SADMUSN','addUserGroup',NULL,'administration/users','administration','Permission to add new user group','EXE','fa fa-save',1160,false,false,'{"notAvailable": ["free"]}');

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XAGRPUD','administration_user_group_update','SADMUSN','updateUserGroup',NULL,'administration/users','administration','Permission to update user group','EXE','fa fa-save',1160,false,false,'{"notAvailable": ["free"]}');

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XAGRPDL','administration_user_group_delete','SADMUSN','deleteUserGroup',NULL,'administration/users','administration','Permission to delete user group','EXE','fa fa-save',1160,false,false,'{"notAvailable": ["free"]}');

INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta,role_id) VALUES
	 ('form','core_usergroups_form','Users Group form.',false,'<form id="core_users">
	<div class="row">
		<div class="form-group col-md-2">
			<label for="username">{core_users_form_username}</label>
			<input type="text" class="form-control" id="username" name="username" placeholder="Username">
		</div>
		<div class="form-group col-md-3">
			<label for="password">{core_users_form_password}</label>
			<input type="password" class="form-control" name="password" id="password" placeholder="Password">
		</div>
		<div class="form-group col-md-3">
			<label for="email">{core_users_form_email}</label>
			<input type="email" class="form-control" id="email" name="email" placeholder="Email">
			<input type="hidden" id="id" name="id">
		</div>
		<div class="form-group col-md-1">
			<label for="language">{core_users_form_language}</label>
			<select class="form-control" id="language" name="language" placeholder="language" data-list="api/v1/misc/translations/">
			</select>
		</div>		
		<div class="form-group col-md-3">
			<label for="organization">{core_users_form_organization}</label>
			<select data-null-first="true" class="form-control" id="organization" name="organization" data-list="api/v1/registry/registrylist/CLI">
			</select>
		</div>
		<div class="form-group col-md-3">
			<label for="department">{core_users_form_department}</label>
			<input data-null-first="true" class="form-control" id="department" type="text" name="meta[department]">
		</div>	
	</div>
	<div class="row">

	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="settings">{core_users_form_settings}</label>
			<div id="settings" data-name="settings" data-type="jsoneditor" class="jc-jsoneditor"></div>
		</div>		
	</div>	
</form>','{"form": [[{"id": "group_name", "cols": 6, "name": "group_name", "type": "text", "label": "Group Name", "autofocus": true, "mandatory": true, "relatedHidden": "id", "additionalClass": "form-control-sm"}, {"id": "email", "cols": 6, "name": "email", "type": "text", "label": "Email", "autofocus": true, "additionalClass": "form-control-sm"}], [{"id": "language", "cols": 3, "list": "api/v1/misc/translations/", "name": "language", "type": "dropdown", "label": "Language", "values": "list", "onchange": "jivaCoreOptions.unsavedData=true;", "mandatory": true, "additionalClass": "form-select-sm"}, {"id": "group_type", "cols": 3, "list": "/api/v1/misc/codelists/code_list_usergroups_types", "name": "group_type", "type": "dropdown", "label": "Type", "values": "description", "onchange": "jivaCoreOptions.unsavedData=true;setDutyTaskName();setDutyPrice();", "mandatory": true, "createForm": "admin_usergroups_codelist_form", "defaultValue": "ZZZ", "createEndpoint": "/api/v2/admin/codelists/code_list_usergroups_types", "additionalClass": "form-select-sm", "createdEntryFields": "description", "createEndpointMethod": "post"}, {"id": "group_description", "cols": 6, "name": "group_description", "type": "text", "label": "Description", "onchange": "generateDutyServiceCode(this)", "autofocus": true, "additionalClass": "form-control-sm"}]]}',NULL,NULL,NULL,0,NULL,NULL,NULL);
