diff --git a/atlas_collections.py b/atlas_collections.py index 6d0630a..abb72ad 100644 --- a/atlas_collections.py +++ b/atlas_collections.py @@ -100,8 +100,8 @@ def build_doc(collection: SimpleNamespace) -> Dict: , updater.Fullname_calc as modified_by , case when isnull((select Value from app.GlobalSiteSettings where Name = 'collections_search_visibility'),'N') = 'N' or Hidden='Y' then 'N' else 'Y' end as visible -, STUFF((select '~|~' + i.name from app.Initiative i where i.DataInitiativeID=p.datainitiativeid FOR XML PATH('')), 1, 3, '') initiative_name -, STUFF((select '~|~' + i.description from app.Initiative i where i.DataInitiativeID=p.datainitiativeid FOR XML PATH('')), 1, 3, '') initiative_description +, STUFF((select '~|~' + i.name from app.Initiative i where i.DataInitiativeID=p.datainitiativeid and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_name +, STUFF((select '~|~' + i.description from app.Initiative i where i.DataInitiativeID=p.datainitiativeid and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_description , STUFF((select '~|~' + t.name from app.CollectionTerm a inner join app.term t on a.TermId = t.termid where a.DataProjectId=p.DataProjectID FOR XML PATH('')), 1, 3, '') term_name diff --git a/atlas_initiatives.py b/atlas_initiatives.py index f0008e2..3887880 100644 --- a/atlas_initiatives.py +++ b/atlas_initiatives.py @@ -102,7 +102,7 @@ def build_doc(initiative: SimpleNamespace) -> Dict: , s.name as strategic_importance , i.LastUpdateDate as modified_at , updater.Fullname_calc as modified_by -, case when isnull((select Value from app.GlobalSiteSettings where Name = 'initiatives_search_visibility'),'N') = 'N' then 'N' else 'Y' end as visible +, case when isnull((select Value from app.GlobalSiteSettings where Name = 'initiatives_search_visibility'),'N') = 'N' or i.Hidden='Y' then 'N' else 'Y' end as visible , STUFF((select '~|~' + p.name from app.Collection p where i.DataInitiativeID=p.datainitiativeid and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_name , STUFF((select '~|~' + p.Purpose + '~|~' + p.description from app.Collection p where i.DataInitiativeID=p.datainitiativeid and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_description diff --git a/atlas_reports.py b/atlas_reports.py index b526267..4f41f37 100644 --- a/atlas_reports.py +++ b/atlas_reports.py @@ -173,8 +173,8 @@ def build_doc(report: SimpleNamespace) -> Dict: , STUFF((select '~|~' + p.name from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID where a.ReportId = r.ReportObjectID and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_name , STUFF((select '~|~' + p.Description + '~|~' + p.Purpose from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID where a.ReportId = r.ReportObjectID and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_description -, STUFF((select '~|~' + i.name from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.DataInitiativeID where a.ReportId = r.ReportObjectID and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_name -, STUFF((select '~|~' + i.Description + '~|~' + p.Purpose from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.DataInitiativeID where a.ReportId = r.ReportObjectID and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_description +, STUFF((select '~|~' + i.name from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.DataInitiativeID where a.ReportId = r.ReportObjectID and isnull(p.Hidden,'N')='N' and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_name +, STUFF((select '~|~' + i.Description + '~|~' + p.Purpose from app.CollectionReport a inner join app.Collection p on a.DataProjectId = p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.DataInitiativeID where a.ReportId = r.ReportObjectID and isnull(p.Hidden,'N')='N' and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_description diff --git a/atlas_terms.py b/atlas_terms.py index 10567a9..8e6f383 100644 --- a/atlas_terms.py +++ b/atlas_terms.py @@ -107,11 +107,11 @@ def build_doc(term: SimpleNamespace) -> Dict: , t.LastUpdatedDateTime as modified_at , updater.Fullname_calc as modified_by , case when isnull((select Value from app.GlobalSiteSettings where Name = 'terms_search_visibility'),'N') = 'N' then 'N' else 'Y' end as visible -, STUFF((select '~|~' + p.name from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID where a.TermId=t.TermId and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_name -, STUFF((select '~|~' + p.description from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID where a.TermId=t.TermId and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_description +, STUFF((select '~|~' + p.name from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID where a.TermId=t.TermId and isnull(p.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_name +, STUFF((select '~|~' + p.description from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID where a.TermId=t.TermId and isnull(p.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') collection_description -, STUFF((select '~|~' + i.name from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.datainitiativeid where a.TermId=t.TermId and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_name -, STUFF((select '~|~' + i.description from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.datainitiativeid where a.TermId=t.TermId and isnull(Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_description +, STUFF((select '~|~' + i.name from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.datainitiativeid where a.TermId=t.TermId and isnull(p.Hidden,'N')='N' and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_name +, STUFF((select '~|~' + i.description from app.CollectionTerm a inner join app.Collection p on a.DataProjectId=p.DataProjectID inner join app.Initiative i on i.DataInitiativeID=p.datainitiativeid where a.TermId=t.TermId and isnull(p.Hidden,'N')='N' and isnull(i.Hidden,'N')='N' FOR XML PATH('')), 1, 3, '') initiative_description , STUFF((select '~|~' + r.name from app.ReportObjectDocTerms a inner join dbo.ReportObject r on a.ReportObjectID=r.ReportObjectID left outer join app.reportobject_doc d on d.reportobjectid = r.reportobjectid where a.TermId=t.TermId and isnull(d.hidden,'N')='N' FOR XML PATH('')), 1, 3, '') report_name , STUFF((select '~|~' + r.DisplayTitle from app.ReportObjectDocTerms a inner join dbo.ReportObject r on a.ReportObjectID=r.ReportObjectID left outer join app.reportobject_doc d on d.reportobjectid = r.reportobjectid where a.TermId=t.TermId and r.DisplayTitle is not null and isnull(d.hidden,'N')='N' FOR XML PATH('')), 1, 3, '') linked_name