Skip to content

Instantly share code, notes, and snippets.

@sminnee
Created October 9, 2009 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sminnee/205690 to your computer and use it in GitHub Desktop.
Save sminnee/205690 to your computer and use it in GitHub Desktop.
<?php
/**
* Filter the SiteTree by pages awaiting approval
*
* @package cmsworkflow
* @subpackage ThreeStep
*/
class CMSWorkflowThreeStepFilters_PagesAwaitingApproval extends CMSSiteTreeFilter {
static function title() {
return _t('CMSWorkflowThreeStepFilters_PagesAwaitingApproval.TITLE', "Pages awaiting approval");
}
function pagesIncluded() {
return DB::query('SELECT DISTINCT "SiteTree"."ParentID", "SiteTree"."ID" FROM "SiteTree"
INNER JOIN "WorkflowRequest" ON "WorkflowRequest"."PageID" = "SiteTree"."ID"
WHERE "WorkflowRequest"."Status" = \'AwaitingApproval\'');
}
}
/**
* Fitler the SiteTree by pages awaiting publishing
*
* @package cmsworkflow
* @subpackage ThreeStep
*/
class CMSWorkflowThreeStepFilters_PagesAwaitingPublishing extends CMSSiteTreeFilter {
static function title() {
return _t('CMSWorkflowThreeStepFilters_PagesAwaitingPublishing.TITLE', "Pages awaiting publishing");
}
function pagesIncluded() {
return DB::query('SELECT DISTINCT "SiteTree"."ParentID", "SiteTree"."ID" FROM "SiteTree"
INNER JOIN "WorkflowRequest" ON "WorkflowRequest"."PageID" = "SiteTree"."ID"
WHERE "WorkflowRequest"."Status" = \'Approved\'');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment