Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);

namespace HistoricPetitionViewer;

use Cake\Console\CommandCollection;
use Cake\Core\BasePlugin;
use Cake\Core\ContainerInterface;
use Cake\Core\PluginApplicationInterface;
use Cake\Http\MiddlewareQueue;
use Cake\Routing\RouteBuilder;

/**
* Plugin for CoreEnroller
*/
class HistoricPetitionViewerPlugin extends BasePlugin
{
/**
* Load all the plugin configuration and bootstrap logic.
*
* The host application is provided as an argument. This allows you to load
* additional plugin dependencies, or attach events.
*
* @param \Cake\Core\PluginApplicationInterface $app The host application
* @return void
*/
public function bootstrap(PluginApplicationInterface $app): void
{
}

/**
* Add routes for the plugin.
*
* If your plugin has many routes and you would like to isolate them into a separate file,
* you can create `$plugin/config/routes.php` and delete this method.
*
* @param \Cake\Routing\RouteBuilder $routes The route builder to update.
* @return void
*/
public function routes(RouteBuilder $routes): void
{
$routes->plugin(
'HistoricPetitionViewer',
['path' => '/historic-petition-viewer'],
function (RouteBuilder $builder) {
// Your snippet goes here, using $builder instead of $routes
$builder->setRouteClass(DashedRoute::class);

// Add your plugin routes here if needed, then:
$builder->fallbacks(DashedRoute::class);
}
);
parent::routes($routes);
}

/**
* Add middleware for the plugin.
*
* @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update.
* @return \Cake\Http\MiddlewareQueue
*/
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
// Add your middlewares here

return $middlewareQueue;
}

/**
* Add commands for the plugin.
*
* @param \Cake\Console\CommandCollection $commands The command collection to update.
* @return \Cake\Console\CommandCollection
*/
public function console(CommandCollection $commands): CommandCollection
{
// Add your commands here

$commands = parent::console($commands);

return $commands;
}

/**
* Register application container services.
*
* @param \Cake\Core\ContainerInterface $container The Container to update.
* @return void
* @link https://book.cakephp.org/4/en/development/dependency-injection.html#dependency-injection
*/
public function services(ContainerInterface $container): void
{
// Add your services here
}
}
72 changes: 72 additions & 0 deletions app/availableplugins/HistoricPetitionViewer/config/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"types": {},
"schema": {
"tables": {
"petition_hist_attrs": {
"comment": "Transmogrified from cm_co_petition_attributes",
"columns": {
"id": {},
"petition_id": {},
"historic_petition_viewer_id": {
"type": "integer",
"foreignkey": { "table": "historic_petition_viewers", "column": "id" },
"notnull": false
},
"attribute": { "type": "string", "size": 128 },
"value": { "type": "text" }
},
"indexes": {
"petition_hist_attrs_i1": { "columns": [ "petition_id" ] },
"petition_hist_attrs_i2": { "columns": [ "attribute" ] }
}
},
"petition_meta_hist_recs": {
"comment": "Transmogrified from cm_co_petitions fields that no longer map to petitions",
"columns": {
"id": {},
"petition_id": {},
"enrollment_flow_id": {
"type": "integer",
"foreignkey": { "table": "enrollment_flows", "column": "id" }
},
"historic_petition_viewer_id": {
"type": "integer",
"foreignkey": { "table": "historic_petition_viewers", "column": "id" }
},

"enrollee_org_identity_id": { "type": "integer" },
"archived_org_identity_id": { "type": "integer" },
"enrollee_person_role_id": {
"type": "integer",
"foreignkey": { "table": "person_roles", "column": "id" }
},
"sponsor_person_id": {
"type": "integer",
"foreignkey": { "table": "people", "column": "id" }
},
"approver_person_id": {
"type": "integer",
"foreignkey": { "table": "people", "column": "id" }
},
"approver_comment": { "type": "string", "size": 256 }
},
"indexes": {
"petition_meta_hist_recs_i1": { "columns": [ "petition_id" ] },
"petition_meta_hist_recs_i2": { "columns": [ "enrollee_person_role_id" ] },
"petition_meta_hist_recs_i3": { "columns": [ "sponsor_person_id" ] },
"petition_meta_hist_recs_i4": { "columns": [ "approver_person_id" ] }
}
},
"historic_petition_viewers": {
"comment": "Enrollment Flow Step for historic petition data",
"columns": {
"id": {},
"enrollment_flow_step_id": {}
},
"indexes": {
"historic_petition_step_links_i1": { "columns": [ "enrollment_flow_step_id" ] }
}
}
}
}
}
39 changes: 39 additions & 0 deletions app/availableplugins/HistoricPetitionViewer/config/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/**
* Historic Petition Viewer plugin specific routes.
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

use Cake\Routing\Route\DashedRoute;

$routes->plugin(
'HistoricPetitionViewer',
['path' => '/historic-petition-viewer/'],
function ($routes) {
$routes->setRouteClass(DashedRoute::class);
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# COmanage Registry Localizations (historic_petition_viewer domain)
#
# Portions licensed to the University Corporation for Advanced Internet
# Development, Inc. ("UCAID") under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# UCAID licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @link https://www.internet2.edu/comanage COmanage Project
# @package registry-plugins
# @since COmanage Registry v5.2.0
# @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)


msgid "attributes"
msgstr "Attributes"

msgid "attributes.none"
msgstr "No historic attributes recorded for this petition."

msgid "historic.petition"
msgstr "Historic Petition #{0}"

msgid "metadata"
msgstr "Metadata"

msgid "metadata.none"
msgstr "No historic metadata recorded for this petition."
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);

namespace HistoricPetitionViewer\Controller;

use App\Controller\AppController as BaseController;

class AppController extends BaseController
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* COmanage Registry Historic Petition Viewers Controller
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

namespace HistoricPetitionViewer\Controller;

use App\Controller\StandardPluginController;

class HistoricPetitionViewersController extends StandardPluginController {
protected array $paginate = [
'order' => [
'HistoricPetitionViewers.id' => 'asc'
]
];
}
Loading