This repository has been archived on 2026-03-21. You can view files and clone it, but cannot push or open issues or pull requests.
payfrit-biz/api/admin/_scripts/debugBigDeansDeactivated.cfm
John Mizerek 89ec86c9d2 Move 70 one-off admin scripts to api/admin/_scripts/ (gitignored)
Only quickTasks/ and scheduledTasks/ subdirectories remain tracked
since those are actively used by the portal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:38:49 -08:00

38 lines
1.2 KiB
Text

<cfsetting showdebugoutput="false">
<cfsetting enablecfoutputonly="true">
<cfcontent type="application/json; charset=utf-8" reset="true">
<cfscript>
bizId = 27;
// These are the items that were deactivated by fixBigDeansCategories.cfm
deactivatedIds = [11177, 11180, 11183, 11186, 11190, 11193, 11196, 11199, 11204, 11212, 11220, 11259];
qDeactivated = queryExecute("
SELECT i.ID, i.Name, i.ParentItemID, i.IsActive, i.IsCollapsible,
(SELECT COUNT(*) FROM Items c WHERE c.ParentItemID = i.ID) as ChildCount,
(SELECT GROUP_CONCAT(c.Name) FROM Items c WHERE c.ParentItemID = i.ID) as Children
FROM Items i
WHERE i.ID IN (:ids)
ORDER BY i.ID
", { ids: { value: arrayToList(deactivatedIds), list: true } }, { datasource: "payfrit" });
items = [];
for (row in qDeactivated) {
arrayAppend(items, {
"ItemID": row.ID,
"Name": row.Name,
"ParentID": row.ParentItemID,
"IsActive": row.IsActive,
"IsCollapsible": row.IsCollapsible,
"ChildCount": row.ChildCount,
"Children": row.Children
});
}
writeOutput(serializeJSON({
"OK": true,
"Message": "These items were deactivated thinking they were fake categories",
"DeactivatedItems": items
}));
</cfscript>