Skip to content

Commit

Permalink
MINOR categorized reports, fixed a few translations issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
rixth committed Oct 29, 2009
1 parent 5fbeed4 commit 08124ac
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 24 deletions.
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepMyDeletionRequestsSideReport extends SideReport {
function title() {
return _t('ThreeStepMyDeletionRequestsSideReport.TITLE',"Workflow: my deletion requests");
return _t('ThreeStepMyDeletionRequestsSideReport.TITLE',"Removal requests I have made");
}
function group() {
return "Workflow reports";
}
function sort() {
return -100;
}
function records() {
// Set stage, otherwise, we won't get any results
Expand Down
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepMyPublicationRequestsSideReport extends SideReport {
function title() {
return _t('ThreeStepMyPublicationRequestsSideReport.TITLE',"Workflow: my publication requests");
return _t('ThreeStepMyPublicationRequestsSideReport.TITLE',"Publication requests I have made");
}
function group() {
return "Workflow reports";
}
function sort() {
return -200;
}
function records() {
return WorkflowThreeStepRequest::get_by_author(
Expand Down
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepWorkflowPublicationRequestsNeedingApprovalSideReport extends SideReport {
function title() {
return _t('ThreeStepWorkflowPublicationRequestsNeedingApprovalSideReport.TITLE',"Workflow: publication requests I need to approve");
return _t('ThreeStepWorkflowPublicationRequestsNeedingApprovalSideReport.TITLE',"Publication requests I need to approve");
}
function group() {
return "Workflow reports";
}
function sort() {
return 100;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepWorkflowPublicationRequestsNeedingPublishingSideReport extends SideReport {
function title() {
return _t('ThreeStepWorkflowPublicationRequestsNeedingPublishingSideReport.TITLE',"Workflow: publication requests I need to publish");
return _t('ThreeStepWorkflowPublicationRequestsNeedingPublishingSideReport.TITLE',"Publication requests I need to publish");
}
function group() {
return "Workflow reports";
}
function sort() {
return 300;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepWorkflowRemovalRequestsNeedingApprovalSideReport extends SideReport {
function title() {
return _t('ThreeStepWorkflowRemovalRequestsNeedingApprovalSideReport.TITLE',"Workflow: removal requests I need to approve");
return _t('ThreeStepWorkflowRemovalRequestsNeedingApprovalSideReport.TITLE',"Removal requests I need to approve");
}
function group() {
return "Workflow reports";
}
function sort() {
return 200;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
Expand Up @@ -7,7 +7,13 @@
*/
class ThreeStepWorkflowRemovalRequestsNeedingPublishingSideReport extends SideReport {
function title() {
return _t('ThreeStepWorkflowRemovalRequestsNeedingPublishingSideReport.TITLE',"Workflow: removal requests I need to publish");
return _t('ThreeStepWorkflowRemovalRequestsNeedingPublishingSideReport.TITLE',"Removal requests I need to publish");
}
function group() {
return "Workflow reports";
}
function sort() {
return 400;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
Expand Up @@ -9,6 +9,12 @@ class MyTwoStepDeletionRequestsSideReport extends SideReport {
function title() {
return _t('MyTwoStepDeletionRequestsSideReport.TITLE',"Workflow: Awaiting deletion");
}
function group() {
return "Workflow reports";
}
function sort() {
return -100;
}
function records() {
return WorkflowTwoStepRequest::get_by_publisher(
'WorkflowDeletionRequest',
Expand All @@ -25,6 +31,7 @@ function fieldsToShow() {
);
}
function canView() {
return false;
return Object::has_extension('SiteTree', 'SiteTreeCMSTwoStepWorkflow');
}
}
Expand Down
Expand Up @@ -9,6 +9,12 @@ class MyTwoStepPublicationRequestsSideReport extends SideReport {
function title() {
return _t('MyTwoStepPublicationRequestsSideReport.TITLE',"Workflow: Awaiting publication");
}
function group() {
return "Workflow reports";
}
function sort() {
return -200;
}
function records() {
if(Permission::check("ADMIN")) {
return WorkflowTwoStepRequest::get(
Expand All @@ -32,6 +38,7 @@ function fieldsToShow() {
);
}
function canView() {
return false;
return Object::has_extension('SiteTree', 'SiteTreeCMSTwoStepWorkflow');
}
}
Expand Down
Expand Up @@ -8,6 +8,12 @@ class MyTwoStepWorkflowRequestsSideReport extends SideReport {
function title() {
return _t('MyTwoStepWorkflowRequestsSideReport.TITLE',"Workflow: My requests pending review");
}
function group() {
return "Workflow reports";
}
function sort() {
return 100;
}
function records() {
return WorkflowTwoStepRequest::get_by_author(
'WorkflowRequest',
Expand All @@ -24,6 +30,7 @@ function fieldsToShow() {
);
}
function canView() {
return false;
return Object::has_extension('SiteTree', 'SiteTreeCMSTwoStepWorkflow');
}
}
Expand Down
4 changes: 2 additions & 2 deletions code/batchactions/BatchSetExpiry.php
Expand Up @@ -2,10 +2,10 @@

class BatchSetExpiry extends CMSBatchAction {
function getActionTitle() {
return _t('BatchSetEmbargo.ACTION_TITLE', 'Set expiry date');
return _t('BatchSetExpiry.ACTION_TITLE', 'Set expiry date');
}
function getDoingText() {
return _t('BatchSetEmbargo.DOING_TEXT', 'Setting expiry date');
return _t('BatchSetExpiry.DOING_TEXT', 'Setting expiry date');
}

function run(DataObjectSet $pages) {
Expand Down
28 changes: 24 additions & 4 deletions code/sidereports/PagesDueForReviewSideReport.php
Expand Up @@ -10,7 +10,12 @@ class PagesDueForReviewSideReport extends SideReport {
function title() {
return _t('PagesDueForReviewSideReport.TITLE', 'Pages due for review');
}

function group() {
return "Content reports";
}
function sort() {
return -10;
}
function records() {
$where = array();

Expand All @@ -20,8 +25,16 @@ function records() {
$where[] = 'NextReviewDate <= \'' . SS_Datetime::now()->URLDate() . '\'';
}

if(isset($this->params['Owner']) && $this->params['Owner']) {
$where[] = 'OwnerID = ' . (int) $this->params['Owner'];
if(isset($this->params['OwnerID'])) {
switch($this->params['OwnerID']) {
case 'any-owner':
break;
case 'no-owner':
$where[] = 'OwnerID = 0';
default:
$where[] = 'OwnerID = ' . (int) $this->params['OwnerID'];
break;
}
}

return DataObject::get('SiteTree', $where);
Expand All @@ -47,9 +60,16 @@ function fieldsToShow() {
function getParameterFields() {
$cmsUsers = Permission::get_members_by_permission(array("CMS_ACCESS_CMSMain", "ADMIN"));

$options = array(
'any-owner' => 'Any owner',
'no-owner' => 'No owner'
);

$options = array_merge($options, $cmsUsers->map('ID', 'Title'));

return new FieldSet(
new DateField('ReviewDate', 'Review date (YYYY-MM-DD)'),
new DropdownField("OwnerID", 'Page owner', $cmsUsers->map('ID', 'Title', '(no owner)'))
new DropdownField("OwnerID", 'Page owner', $options)
);
}
}
Expand Down
8 changes: 7 additions & 1 deletion code/sidereports/PagesScheduledForDeletionSideReport.php
Expand Up @@ -7,7 +7,13 @@
*/
class PagesScheduledForDeletionSideReport extends SideReport {
function title() {
return _t('PagesScheduledForDeletionSideReport.TITLE',"Workflow: pages scheduled for deletion");
return _t('PagesScheduledForDeletionSideReport.TITLE',"Pages scheduled for removal");
}
function group() {
return "Workflow reports";
}
function sort() {
return 1000;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
8 changes: 7 additions & 1 deletion code/sidereports/PagesScheduledForPublishingSideReport.php
Expand Up @@ -7,7 +7,13 @@
*/
class PagesScheduledForPublishingSideReport extends SideReport {
function title() {
return _t('PagesScheduledForPublishingSideReport.TITLE',"Workflow: pages scheduled for publishing");
return _t('PagesScheduledForPublishingSideReport.TITLE',"Pages scheduled for publishing");
}
function group() {
return "Workflow reports";
}
function sort() {
return 900;
}
function records() {
if (ClassInfo::exists('Subsite') && isset($this->params['AllSubsites'])) {
Expand Down
22 changes: 12 additions & 10 deletions lang/en_US.php
Expand Up @@ -15,9 +15,11 @@
$lang['en_US']['BatchResetExpiry']['ACTION_TITLE'] = 'Reset expiry date';
$lang['en_US']['BatchResetExpiry']['DOING_TEXT'] = 'Resetting expiry date';
$lang['en_US']['BatchSetEmbargo']['ACTIONED_PAGES'] = 'Set embargo date on %d pages';
$lang['en_US']['BatchSetEmbargo']['ACTION_TITLE'] = 'Set expiry date';
$lang['en_US']['BatchSetEmbargo']['DOING_TEXT'] = 'Setting expiry date';
$lang['en_US']['BatchSetEmbargo']['ACTION_TITLE'] = 'Set embargo date';
$lang['en_US']['BatchSetEmbargo']['DOING_TEXT'] = 'Setting embargo date';
$lang['en_US']['BatchSetExpiry']['ACTIONED_PAGES'] = 'Set expiry date on %d pages';
$lang['en_US']['BatchSetExpiry']['ACTION_TITLE'] = 'Set expiry date';
$lang['en_US']['BatchSetExpiry']['DOING_TEXT'] = 'Setting expiry date';
$lang['en_US']['CMSWorkflowThreeStepFilters_PagesAwaitingApproval']['TITLE'] = 'Pages awaiting approval';
$lang['en_US']['CMSWorkflowThreeStepFilters_PagesAwaitingPublishing']['TITLE'] = 'Pages awaiting publishing';
$lang['en_US']['LeftAndMain']['CHANGEDURL'] = ' Changed URL to \'%s\'';
Expand All @@ -27,8 +29,8 @@
$lang['en_US']['MyTwoStepPublicationRequestsSideReport']['TITLE'] = 'Workflow: Awaiting publication';
$lang['en_US']['MyTwoStepWorkflowRequestsSideReport']['TITLE'] = 'Workflow: My requests pending review';
$lang['en_US']['PagesDueForReviewSideReport']['TITLE'] = 'Pages due for review';
$lang['en_US']['PagesScheduledForDeletionSideReport']['TITLE'] = 'Workflow: pages scheduled for deletion';
$lang['en_US']['PagesScheduledForPublishingSideReport']['TITLE'] = 'Workflow: pages scheduled for publishing';
$lang['en_US']['PagesScheduledForDeletionSideReport']['TITLE'] = 'Pages scheduled for removal';
$lang['en_US']['PagesScheduledForPublishingSideReport']['TITLE'] = 'Pages scheduled for publishing';
$lang['en_US']['SiteTree']['EDITANYONE'] = 'Anyone who can log-in to the CMS';
$lang['en_US']['SiteTree']['EDITINHERIT'] = 'Inherit from parent page';
$lang['en_US']['SiteTree']['EDITONLYTHESE'] = 'Only these people (choose from list)';
Expand Down Expand Up @@ -78,12 +80,12 @@
$lang['en_US']['SiteTreeCMSWorkflow']['WORKFLOW_ACTION_DENY'] = 'Deny';
$lang['en_US']['SiteTreeCMSWorkflow']['WORKFLOW_ACTION_FAILED'] = 'There was an error when processing your workflow request.';
$lang['en_US']['SiteTreeCMSWorkflow']['WORKFLOW_ACTION_RESUBMIT'] = 'Re-submit';
$lang['en_US']['ThreeStepMyDeletionRequestsSideReport']['TITLE'] = 'Workflow: my deletion requests';
$lang['en_US']['ThreeStepMyPublicationRequestsSideReport']['TITLE'] = 'Workflow: my publication requests';
$lang['en_US']['ThreeStepWorkflowPublicationRequestsNeedingApprovalSideReport']['TITLE'] = 'Workflow: publication requests I need to approve';
$lang['en_US']['ThreeStepWorkflowPublicationRequestsNeedingPublishingSideReport']['TITLE'] = 'Workflow: publication requests I need to publish';
$lang['en_US']['ThreeStepWorkflowRemovalRequestsNeedingApprovalSideReport']['TITLE'] = 'Workflow: removal requests I need to approve';
$lang['en_US']['ThreeStepWorkflowRemovalRequestsNeedingPublishingSideReport']['TITLE'] = 'Workflow: removal requests I need to publish';
$lang['en_US']['ThreeStepMyDeletionRequestsSideReport']['TITLE'] = 'Removal requests I have made';
$lang['en_US']['ThreeStepMyPublicationRequestsSideReport']['TITLE'] = 'Publication requests I have made';
$lang['en_US']['ThreeStepWorkflowPublicationRequestsNeedingApprovalSideReport']['TITLE'] = 'Publication requests I need to approve';
$lang['en_US']['ThreeStepWorkflowPublicationRequestsNeedingPublishingSideReport']['TITLE'] = 'Publication requests I need to publish';
$lang['en_US']['ThreeStepWorkflowRemovalRequestsNeedingApprovalSideReport']['TITLE'] = 'Removal requests I need to approve';
$lang['en_US']['ThreeStepWorkflowRemovalRequestsNeedingPublishingSideReport']['TITLE'] = 'Removal requests I need to publish';
$lang['en_US']['WorkflowDeletionRequest']['EMAIL_PARA_APPROVED'] = array(
'%s has approved the request to delete the "%s" page and deleted it from the published site.',
50,
Expand Down

0 comments on commit 08124ac

Please sign in to comment.