-
Notifications
You must be signed in to change notification settings - Fork 19
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 #21 from mmarum-sugarcrm/Issue-19
Fix for Issue-19. Add Student death reporting support.
- Loading branch information
Showing
19 changed files
with
283 additions
and
29 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
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,45 @@ | ||
# Student Vital Tracking | ||
|
||
When doing battle against the forces of evil, it is possible that a coder is incapacitated by carpal tunnel syndrome or even killed in a freak hoverboard accident. Professor M needs to report on the cause of death of any coder who has died in order to prevent the same mistakes from happening again. | ||
|
||
## Implementation Technique | ||
|
||
Sugar Studio was used to add custom fields, add a new drop down list, and to make Record View customizations within a dev instance. Sugar Logic is used with simple manually created custom Dependencies that are applied to conditionally change Record view panel visibility and make fields required. | ||
|
||
Finally, these changes are extracted out of dev instance and included in this package. | ||
|
||
Adding these fields is enough to allow Prof. M to use out of the box functionality to create reports or list view filters to achieve his business goals. | ||
|
||
## Implementation Details | ||
|
||
A custom Vitals dropdown field (`vital_c`) was added to the Students module and the Record view. The following vital statuses are selectable. | ||
|
||
'active' => 'Active' | ||
'injured' => 'Injured' | ||
'comatose' => 'Comatose' | ||
'deceased' => 'Deceased' | ||
|
||
When `deceased` is selected, a new Death Information panel appears on the Record view and users are required to enter a Cause of Death (`cause_of_death_c`). | ||
|
||
Professor M can then build reports based upon vital status and the common causes of death. | ||
|
||
## Extensions | ||
|
||
| Module | Extension | Name | Description | | ||
| :--- | :--- | :---- | :---- | | ||
|Contacts|Vardefs|`vital_c`|Dropdown for tracking vital status of student.| | ||
|Contacts|Vardefs|`cause_of_death_c`|Text field that allows Prof. M to enter cause of death.| | ||
|Contacts|Vardefs|`flowers_sent_c`|Checkbox field that allows Prof M. to track if flowers were ordered.| | ||
|Contacts|Dependencies|`cause_of_death_required`|Makes `cause_of_death_c` a required field when `vital_c` is set to `deceased`.| | ||
|Contacts|Dependencies|`show_death_panel`|Displays the `death_panel` in the Contacts Record View when `vital_c` is set to `deceased`.| | ||
|application|Language|`sugar_vitals_list`|List of supported dropdown values for `vitals_c`. Described above.| | ||
|
||
## View customizations | ||
|
||
| Module | View | Description | | ||
| :--- | :--- | :--- | | ||
|Contacts|Record|Vitals dropdown (`vital_c`) has been added to main business card. A Death Information (`death_panel`) panel was also added that contains custom fields named `cause_of_death_c` and `flowers_sent_c`.| | ||
|
||
|
||
|
||
|
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,30 @@ | ||
## About Professor M's School for Gifted Coders | ||
Professor M aka Professor Marum has created an exclusive not-for-profit school for gifted coders. Coders are a subspecies of human who are born with superhuman capabilities in technology, analysis, and problem solving. | ||
|
||
The Professor M School is gathering the best and brightest to train them to do battle against the forces of evil (specifically bad customer experiences and poor project implementations). It is hazardous and demanding work. | ||
|
||
The Professor M School has deployed Sugar as a platform to help them manage both students and faculty so they can focus on their core organizational goals of developing talented coders and being a force for good. | ||
|
||
## High Level Use Cases | ||
|
||
The Professor M School uses Sugar for the following high level use cases: | ||
- Managing applicants, current students, former students, and professors | ||
- Tracking super groups | ||
- Soliciting donations from alumni and alumni affiliated super groups | ||
|
||
## Modules Summary | ||
|
||
| Professor M Module | Sugar Module | Description | | ||
| :--- | :--- | :---- | | ||
| Super Groups | Accounts | Super Groups are organizations of affiliated coders. | | ||
| Applicants | Leads | Applicants are prospective students that need to be accepted or rejected. | | ||
| Students | Contacts | Students are coders who have been admitted to the Professor M School. | | ||
| Donations | Opportunities | Donations are opportunities to raise funds as charitable contributions. | | ||
| Funding Line Items | Revenue Line Items| Charitable contributions broken down by line item. | | ||
| Professors | *Custom* | Person-type module. School staff that helps Professor M teach student coders. | | ||
|
||
## Implemented Use Cases | ||
|
||
[Student Vital Tracking](StudentVitalTracking.md) | ||
|
||
|
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
7 changes: 7 additions & 0 deletions
7
...om/Extension/application/Ext/Language/en_us.sugar_vitals_list.ProfessorMStudioChanges.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,7 @@ | ||
<?php | ||
$app_list_strings['vitals_list'] = array ( | ||
'active' => 'Active', | ||
'injured' => 'Injured', | ||
'comatose' => 'Comatose', | ||
'deceased' => 'Deceased', | ||
); |
3 changes: 2 additions & 1 deletion
3
package/src/custom/Extension/application/Ext/Platforms/profm.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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
// Copyright 2018 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. | ||
/* | ||
* A valid platform name requires: | ||
* - Max length of 127 characters | ||
* - Valid characters are: a-z, A-Z, 0-9 - (hypen) _ (underscore) | ||
*/ | ||
$platforms[] = 'api'; | ||
$platforms[] = 'profm_import'; | ||
|
22 changes: 22 additions & 0 deletions
22
package/src/custom/Extension/modules/Contacts/Ext/Dependencies/cause_of_death_required.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,22 @@ | ||
<?php | ||
// Copyright 2018 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. | ||
/** | ||
* We use a SetRequired action to make Cause of Death a required field when Student is deceased. | ||
*/ | ||
$dependencies['Contacts']['cause_of_death_required'] = array( | ||
'hooks' => array("edit"), | ||
'trigger' => 'true', | ||
'triggerFields' => array('vitals_c'), // Triggered only when vitals_c changes | ||
'onload' => true, | ||
'actions' => array( | ||
array( | ||
'name' => 'SetRequired', //If formula is true, then we make target field required | ||
'params' => array( | ||
'target' => 'cause_of_death_c', | ||
'value' => 'equal($vitals_c, "deceased")' | ||
) | ||
), | ||
), | ||
//Actions fire if the trigger is false. Optional. | ||
'notActions' => array(), | ||
); |
29 changes: 29 additions & 0 deletions
29
package/src/custom/Extension/modules/Contacts/Ext/Dependencies/show_death_panel.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,29 @@ | ||
<?php | ||
// Copyright 2018 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. | ||
/** | ||
* Show death panel when Student is Dead. :-( | ||
*/ | ||
$dependencies['Contacts']['show_death_panel'] = array( | ||
'hooks' => array("edit"), | ||
'trigger' => 'equal($vitals_c, "deceased")', // Formula to determine if we run actions (true) or notActions (false) | ||
'triggerFields' => array('vitals_c'), | ||
'onload' => true, | ||
'actions' => array( // Shows panel when deceased | ||
array( | ||
'name' => 'SetPanelVisibility', // Action that can set visibility on target panel | ||
'params' => array( | ||
'target' => 'death_panel', | ||
'value' => 'true' | ||
) | ||
), | ||
), | ||
'notActions' => array( // Hides panel when not deceased | ||
array( | ||
'name' => 'SetPanelVisibility', | ||
'params' => array( | ||
'target' => 'death_panel', | ||
'value' => 'false' | ||
) | ||
), | ||
), | ||
); |
6 changes: 6 additions & 0 deletions
6
package/src/custom/Extension/modules/Contacts/Ext/Language/en_us.lang.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,6 @@ | ||
<?php | ||
// WARNING: The contents of this file are auto-generated. | ||
$mod_strings['LBL_CAUSE_OF_DEATH'] = 'Cause of Death'; | ||
$mod_strings['LBL_FLOWERS_SENT'] = 'Flowers sent?'; | ||
$mod_strings['LBL_RECORDVIEW_PANEL1'] = 'Death Information'; | ||
$mod_strings['LBL_VITALS'] = 'Vitals'; |
2 changes: 1 addition & 1 deletion
2
package/src/custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_alias_c.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
12 changes: 12 additions & 0 deletions
12
package/src/custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_cause_of_death_c.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,12 @@ | ||
<?php | ||
// created: 2018-01-31 21:21:45 | ||
$dictionary['Contact']['fields']['cause_of_death_c']['labelValue']='Cause of Death'; | ||
$dictionary['Contact']['fields']['cause_of_death_c']['full_text_search']=array ( | ||
'enabled' => '0', | ||
'boost' => '1', | ||
'searchable' => false, | ||
); | ||
$dictionary['Contact']['fields']['cause_of_death_c']['enforced']=''; | ||
$dictionary['Contact']['fields']['cause_of_death_c']['dependency']=''; | ||
|
||
?> |
7 changes: 7 additions & 0 deletions
7
package/src/custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_flowers_sent_c.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,7 @@ | ||
<?php | ||
// created: 2018-01-31 21:23:14 | ||
$dictionary['Contact']['fields']['flowers_sent_c']['labelValue']='Flowers sent?'; | ||
$dictionary['Contact']['fields']['flowers_sent_c']['enforced']=''; | ||
$dictionary['Contact']['fields']['flowers_sent_c']['dependency']=''; | ||
|
||
?> |
2 changes: 1 addition & 1 deletion
2
package/src/custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_status_c.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
7 changes: 7 additions & 0 deletions
7
package/src/custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_vitals_c.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,7 @@ | ||
<?php | ||
// created: 2018-02-01 21:32:23 | ||
$dictionary['Contact']['fields']['vitals_c']['labelValue']='Vitals'; | ||
$dictionary['Contact']['fields']['vitals_c']['dependency']=''; | ||
$dictionary['Contact']['fields']['vitals_c']['visibility_grid']=''; | ||
|
||
?> |
4 changes: 4 additions & 0 deletions
4
package/src/custom/Extension/modules/Opportunities/Ext/Language/en_us.lang.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,4 @@ | ||
<?php | ||
// WARNING: The contents of this file are auto-generated. | ||
$mod_strings['LBL_CURRENCY_0'] = 'LBL_CURRENCY'; | ||
$mod_strings['LBL_CURRENCY_1'] = 'LBL_CURRENCY'; |
Oops, something went wrong.