-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from SlateFoundation/develop
Release: slate v2.1.11
- Loading branch information
Showing
7 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Slate\Progress; | ||
|
||
use Slate\People\Student; | ||
|
||
|
||
abstract class AbstractReport extends \VersionedRecord | ||
{ | ||
// ActiveRecord configuration | ||
public static $singularNoun = 'report'; | ||
public static $pluralNoun = 'reports'; | ||
public static $updateOnDuplicateKey = true; | ||
|
||
public static $fields = [ | ||
'StudentID' => [ | ||
'type' => 'uint', | ||
'index' => true | ||
], | ||
'Status' => [ | ||
'type' => 'enum', | ||
'values' => ['draft', 'published'], | ||
'default' => 'draft' | ||
], | ||
]; | ||
|
||
public static $relationships = [ | ||
'Student' => [ | ||
'type' => 'one-one', | ||
'class' => Student::class | ||
] | ||
]; | ||
|
||
public static $searchConditions = [ | ||
'StudentID' => [ | ||
'qualifiers' => ['student-id'], | ||
'points' => 2, | ||
'sql' => 'StudentID=%u' | ||
] | ||
]; | ||
|
||
public static $dynamicFields = [ | ||
'Student' | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace Slate\Progress; | ||
|
||
use Slate\Courses\Section; | ||
use Slate\Term; | ||
|
||
|
||
abstract class AbstractSectionTermReport extends AbstractReport | ||
{ | ||
// ActiveRecord configuration | ||
public static $singularNoun = 'section term report'; | ||
public static $pluralNoun = 'section term reports'; | ||
|
||
public static $fields = [ | ||
'SectionID' => [ | ||
'type' => 'uint', | ||
'index' => true | ||
], | ||
'TermID' => [ | ||
'type' => 'uint', | ||
'index' => true | ||
] | ||
]; | ||
|
||
public static $relationships = [ | ||
'Section' => [ | ||
'type' => 'one-one', | ||
'class' => Section::class | ||
], | ||
'Term' => [ | ||
'type' => 'one-one', | ||
'class' => Term::class | ||
] | ||
]; | ||
|
||
public static $searchConditions = [ | ||
'SectionID' => [ | ||
'qualifiers' => ['narrative-id'], | ||
'points' => 2, | ||
'sql' => 'ID=%u' | ||
], | ||
'TermID' => [ | ||
'qualifiers' => ['term-id'], | ||
'points' => 2, | ||
'sql' => 'TermID=%u' | ||
] | ||
]; | ||
|
||
public static $dynamicFields = [ | ||
'Section', | ||
'Term' | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Slate\Progress; | ||
|
||
|
||
class SectionInterimReport extends AbstractSectionTermReport | ||
{ | ||
public static $tableName = 'section_interim_reports'; | ||
public static $singularNoun = 'section interim report'; | ||
public static $pluralNoun = 'section interim reports'; | ||
public static $collectionRoute = '/progress/section-interim-reports'; | ||
|
||
public static $defaultClass = __CLASS__; | ||
public static $subClasses = [__CLASS__]; | ||
|
||
public static $fields = [ | ||
'Notes' => [ | ||
'type' => 'clob', | ||
'default' => null | ||
] | ||
]; | ||
|
||
public static $indexes = [ | ||
'StudentSectionTerm' => [ | ||
'fields' => ['StudentID', 'SectionID', 'TermID'], | ||
'unique' => true | ||
] | ||
]; | ||
} |
9 changes: 9 additions & 0 deletions
9
php-classes/Slate/Progress/SectionInterimReportsRequestHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Slate\Progress; | ||
|
||
|
||
class SectionInterimReportsRequestHandler extends \RecordsRequestHandler | ||
{ | ||
public static $recordClass = SectionInterimReport::class; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Slate\Progress; | ||
|
||
|
||
/** | ||
* TODO: Refactor narratives into SectionTermReport | ||
*/ | ||
class SectionTermReport extends AbstractSectionTermReport | ||
{ | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
Slate\Progress\SectionInterimReportsRequestHandler::handleRequest(); |