Skip to content

spring_semester2024 #8

Merged
merged 7 commits into from
Feb 20, 2024
Merged
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
Empty file removed Config/Schema/empty
Empty file.
6 changes: 4 additions & 2 deletions Config/Schema/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
must be specified in raw SQL, which needs the prefixed table name.
-->
<schema version="0.3">
<table name="co_grouper_lites">
<table name="co_grouper_lite_widgets">
<field name="id" type="I">
<key />
<autoincrement />
Expand All @@ -34,8 +34,10 @@
<constraint>REFERENCES cm_co_dashboard_widgets(id)</constraint>
</field>
<field name="conn_url" type="C" size="256" />
<field name="identifier_type" type="C" size="32" />
<field name="conn_ver" type="C" size="256" />
<field name="grouper_url" type="C" size="256" />
<field name="act_as_grp_name" type="C" size="512" />
<field name="conn_user" type="C" size="64" />
<field name="conn_pass" type="C" size="64" />
<field name="adhoc_heading" type="C" size="64" />
Expand All @@ -44,7 +46,7 @@
<field name="created" type="T" />
<field name="modified" type="T" />

<index name="co_grouper_lites_i1">
<index name="co_grouper_lite_widgets_i1">
<col>co_dashboard_widget_id</col>
<unique />
</index>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

App::uses("SDWController", "Controller");

class CoGrouperLitesController extends SDWController {
class CoGrouperLiteWidgetsController extends SDWController {

public $helpers = array('Html', 'Form', 'Flash');
public $components = array('Flash');

// Class name, used by Cake
public $name = "CoGrouperLites";
public $name = "CoGrouperLiteWidgets";

public $uses = array(
"GrouperLite.CoGrouperLite"
'GrouperLiteWidget.CoGrouperLiteWidget',
'Identifier',
'Co',
);

/**
Expand All @@ -21,13 +23,26 @@ class CoGrouperLitesController extends SDWController {
*/

function beforeRender() {
parent::beforeRender();

$this->set('title_for_layout', _txt('pl.grouperlite.config.edit.title'));

parent::beforeRender();
// Gather the available identifier address types for the config form
$this->set('vv_available_types', $this->Identifier->types($this->cur_co['Co']['id'], 'type'));
// Pass the config
$cfg = $this->CoGrouperLiteWidget->getConfig();
$this->set('vv_config', $cfg);
}


/**
* Render the widget according to the requested user and current configuration.
*
* @since COmanage Registry v4.4.0
* @param Integer $id CO Grouper Lite Widget ID
*/
public function display($id) {
$cfg = $this->CoGrouperLite->getConfig();
$cfg = $this->CoGrouperLiteWidget->getConfig();

$this->set('pl_grouperlite_index_url', Router::url([
'plugin' => "grouper_lite",
Expand All @@ -43,6 +58,14 @@ public function display($id) {

// Pass the config so we know which div to overwrite
$this->set('vv_config', $cfg);

// Pass the Dashboard Widget configuration
$args = array();
$args['conditions']['CoGrouperLiteWidget.id'] = $id;
$args['contain']['CoDashboardWidget'][] = 'CoDashboard';

$codw = $this->CoGrouperLiteWidget->find('first', $args);
$this->set('vv_codw', $codw);
}


Expand Down
Loading