From 0531c7fbc4a638e87bb66addfd48b8b2d7a59a8e Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Tue, 22 May 2018 16:16:01 -0500 Subject: [PATCH 1/4] Fixes #65: Submit online application to Prof M School - Add new fields for the application form - Update the Applicant record view layout - Create Online Application Form - Create page that is displayed when user submits application form - Update Postman Collection to create campaigns - Update Postman sample data to include application data - Add unit tests - Add acceptance tests - Add documentation --- docs/AcceptanceTests.md | 14 + docs/OnlineApplications.md | 38 ++ docs/UseCases.md | 4 + package/pack.php | 97 ++++++ .../Ext/EntryPointRegistry/getCampaign.php | 6 + .../ar_SA.sugar_languages.leadscustomized.php | 11 + .../bg_BG.sugar_languages.leadscustomized.php | 11 + .../ca_ES.sugar_languages.leadscustomized.php | 11 + .../cs_CZ.sugar_languages.leadscustomized.php | 11 + .../da_DK.sugar_languages.leadscustomized.php | 11 + .../de_DE.sugar_languages.leadscustomized.php | 11 + .../el_EL.sugar_languages.leadscustomized.php | 11 + .../en_UK.sugar_languages.leadscustomized.php | 11 + .../en_us.sugar_languages.leadscustomized.php | 11 + .../es_ES.sugar_languages.leadscustomized.php | 11 + .../es_LA.sugar_languages.leadscustomized.php | 11 + .../et_EE.sugar_languages.leadscustomized.php | 11 + .../fi_FI.sugar_languages.leadscustomized.php | 11 + .../fr_FR.sugar_languages.leadscustomized.php | 11 + .../he_IL.sugar_languages.leadscustomized.php | 11 + .../hr_HR.sugar_languages.leadscustomized.php | 11 + .../hu_HU.sugar_languages.leadscustomized.php | 11 + .../it_it.sugar_languages.leadscustomized.php | 11 + .../ja_JP.sugar_languages.leadscustomized.php | 11 + .../ko_KR.sugar_languages.leadscustomized.php | 11 + .../lt_LT.sugar_languages.leadscustomized.php | 11 + .../lv_LV.sugar_languages.leadscustomized.php | 11 + .../nb_NO.sugar_languages.leadscustomized.php | 11 + .../nl_NL.sugar_languages.leadscustomized.php | 11 + .../pl_PL.sugar_languages.leadscustomized.php | 11 + .../pt_BR.sugar_languages.leadscustomized.php | 11 + .../pt_PT.sugar_languages.leadscustomized.php | 11 + .../ro_RO.sugar_languages.leadscustomized.php | 11 + .../ru_RU.sugar_languages.leadscustomized.php | 11 + .../sk_SK.sugar_languages.leadscustomized.php | 11 + .../sq_AL.sugar_languages.leadscustomized.php | 11 + .../sr_RS.sugar_languages.leadscustomized.php | 11 + .../sv_SE.sugar_languages.leadscustomized.php | 11 + .../th_TH.sugar_languages.leadscustomized.php | 11 + .../tr_TR.sugar_languages.leadscustomized.php | 11 + .../uk_UA.sugar_languages.leadscustomized.php | 11 + .../zh_CN.sugar_languages.leadscustomized.php | 11 + .../zh_TW.sugar_languages.leadscustomized.php | 11 + .../en_us.ProfessorMStudioChanges.lang.php | 5 + .../Leads/Ext/Vardefs/sugarfield_gpa_c.php | 7 + .../Ext/Vardefs/sugarfield_highschool_c.php | 12 + .../sugarfield_programminglanguages_c.php | 7 + .../Ext/Vardefs/sugarfield_transcript_c.php | 12 + .../clients/base/views/record/record.php | 36 +- .../online_application_form/ApplyOnline.html | 327 ++++++++++++++++++ .../ApplyOnlineSuccess.html | 18 + .../ApplicationCampaignManager.php | 61 ++++ .../GetCampaignEntrypoint.php | 9 + .../ApplicationCampaignManagerTest.php | 70 ++++ 54 files changed, 1140 insertions(+), 1 deletion(-) create mode 100644 docs/AcceptanceTests.md create mode 100644 docs/OnlineApplications.md create mode 100644 package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ar_SA.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/bg_BG.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ca_ES.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/cs_CZ.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/da_DK.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/de_DE.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/el_EL.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/en_UK.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/en_us.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/es_ES.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/es_LA.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/et_EE.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/fi_FI.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/fr_FR.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/he_IL.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/hr_HR.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/hu_HU.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/it_it.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ja_JP.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ko_KR.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/lt_LT.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/lv_LV.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/nb_NO.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/nl_NL.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/pl_PL.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/pt_BR.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/pt_PT.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ro_RO.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/ru_RU.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/sk_SK.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/sq_AL.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/sr_RS.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/sv_SE.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/th_TH.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/tr_TR.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/uk_UA.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/zh_CN.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/application/Ext/Language/zh_TW.sugar_languages.leadscustomized.php create mode 100644 package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_gpa_c.php create mode 100644 package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_highschool_c.php create mode 100644 package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_programminglanguages_c.php create mode 100644 package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_transcript_c.php create mode 100644 package/src/custom/online_application_form/ApplyOnline.html create mode 100644 package/src/custom/online_application_form/ApplyOnlineSuccess.html create mode 100644 package/src/custom/src/application_campaign/ApplicationCampaignManager.php create mode 100644 package/src/custom/src/application_campaign/GetCampaignEntrypoint.php create mode 100644 package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php diff --git a/docs/AcceptanceTests.md b/docs/AcceptanceTests.md new file mode 100644 index 00000000..16bd6432 --- /dev/null +++ b/docs/AcceptanceTests.md @@ -0,0 +1,14 @@ +## Acceptance Test Plan ## + +This test plan represents high-level acceptance tests for features implemented in the Professor M's School for Gifted +Coders package. These tests are not automated and should be executed manually. + +Before executing these tests, ensure you have done the following: +1. Installed Sugar. +1. Created an Admin user. +1. Installed the Professor M Module Loadable Package. +1. [Installed the Professor M sample data using the Professor M Postman Collection](https://github.com/sugarcrm/school#use-the-sugar-rest-api-to-create-the-professor-m-sample-data). + +| Use case | Test steps | Expected Results | +| --- | --- | ---| +| [Online Applications](OnlineApplications.md) |
  1. Navigate to http://{site_url}/
    custom/online_application_form/ApplyOnline.html.
  2. Input the following information:
    **First Name:** Joe
    **Last Name:** Morwasky
    **Email Address:** joetheweatherman@example.com
    **Street Address:** 222 Lightning Lane
    **City:** Monroe
    **State:** CT
    **Zip:** 06468
    **Country:** USA
    **High School:** Monroe High
    **Grade Point Average (GPA):** 3.85
    **Programming Languages:** PHP, Java
    **Transcript:** Meteorology A+
    Math: A-
    English: B+
    Agility: A+
  3. Click **Submit**.
  4. |
    1. A "Thank you!" page is displayed.
    2. A new Applicant (Lead) record has been created with the following data:
      **Name:** Joe Morwasky
      **High School:** Monroe High
      **Grade Point Average (GPA):** 3.85000000
      **Programming Languages:** PHP, Java
      **Transcript:**
      Meteorology A+
      Math: A-
      English: B+
      Agility: A+
      **Email Address:** joetheweatherman@example.com
      **Primary Address:**
      222 Lightning Lane
      Monroe, CT 06468
      USA
    3. The new Applicant (Lead) has a link to the **Online Applications** campaign in the Campaign Log.
    4. \ No newline at end of file diff --git a/docs/OnlineApplications.md b/docs/OnlineApplications.md new file mode 100644 index 00000000..17ff6549 --- /dev/null +++ b/docs/OnlineApplications.md @@ -0,0 +1,38 @@ +## Online Applications ## + +Professor M wants to ensure he has a quality pipeline of students for his school. He has decided to allow prospective +students to apply online. + +### Implementation Technique ### + +A [Web to Lead Form](http://support.sugarcrm.com/Knowledge_Base/Campaigns_Target_Lists/Creating_a_Web-to-Lead_Form/) was +created in Sugar and then customized to become the online application for the school. + +### Implementation Details ### + +[ApplyOnline.html](../package/src/custom/online_application_form/ApplyOnline.html) is a +customized Web to Lead Form. This form is the online application that students can complete. When students submit +the form, they are redirected to +[ApplyOnlineSuccess.html](../package/src/custom/online_application_form/ApplyOnlineSuccess.html), a static html file. + +Note that these two files are stored in the +[custom/online_application_form](../package/src/custom/online_application_form) directory for simplicity of deploying +this example. You could host these two files on any server. + +When the form is submitted, a new Applicant (Lead) record is automatically created in the system. + +### Extensions ### + +| Module | Extension | Name | Description | +| --- | --- | ---| ---| +| Leads | Vardefs | `highschool_c` | Varchar that displays the applicant's high school. | +| Leads | Vardefs | `transcript_c` | Text field that displays the applicant's transcript. | +| Leads | Vardefs | `gpa_c` | Decimal field that displays the applicant's grade point average (GPA). | +| Leads | Vardefs | `programminglanguages_c` | Multienum field that displays the applicant's programming languages based on the options stored in the `languages` drop down list.| + + +### View Customizations ### +| Module | View | Description | +| --- | --- | ---| +| Leads | Record | A new panel (Application) has been added to the record view below the Business Card. The panel displays the new custom fields for the application. | + diff --git a/docs/UseCases.md b/docs/UseCases.md index 848d6fa2..ab5e4bce 100644 --- a/docs/UseCases.md +++ b/docs/UseCases.md @@ -27,3 +27,7 @@ The Professor M School uses Sugar for the following high level use cases: - [Student Health Tracking](StudentHealthTracking.md) - [Gradebook Integration](Gradebook.md) + +## Acceptance Tests ## + +Acceptance tests for the use cases can be found in [AcceptanceTests.md](AcceptanceTests.md). diff --git a/package/pack.php b/package/pack.php index 0a5d0109..db804ad3 100755 --- a/package/pack.php +++ b/package/pack.php @@ -290,6 +290,103 @@ 'ext3' => NULL, 'ext4' => NULL, ), + 'Leadshighschool_c' => + array ( + 'id' => 'Leadshighschool_c', + 'name' => 'highschool_c', + 'label' => 'LBL_HIGHSCHOOL', + 'comments' => NULL, + 'help' => NULL, + 'module' => 'Leads', + 'type' => 'varchar', + 'max_size' => '255', + 'require_option' => '0', + 'default_value' => NULL, + 'date_modified' => '2018-05-10 22:50:43', + 'deleted' => '0', + 'audited' => '1', + 'mass_update' => '0', + 'duplicate_merge' => '1', + 'reportable' => '1', + 'importable' => 'true', + 'ext1' => NULL, + 'ext2' => NULL, + 'ext3' => NULL, + 'ext4' => NULL, + ), + 'Leadstranscript_c' => + array ( + 'id' => 'Leadstranscript_c', + 'name' => 'transcript_c', + 'label' => 'LBL_TRANSCRIPT', + 'comments' => NULL, + 'help' => NULL, + 'module' => 'Leads', + 'type' => 'text', + 'max_size' => NULL, + 'require_option' => '0', + 'default_value' => NULL, + 'date_modified' => '2018-05-10 22:50:43', + 'deleted' => '0', + 'audited' => '1', + 'mass_update' => '0', + 'duplicate_merge' => '1', + 'reportable' => '1', + 'importable' => 'true', + 'ext1' => NULL, + 'ext2' => 6, + 'ext3' => 80, + 'ext4' => NULL, + ), + 'Leadsgpa_c' => + array ( + 'id' => 'Leadsgpa_c', + 'name' => 'gpa_c', + 'label' => 'LBL_GPA', + 'comments' => NULL, + 'help' => NULL, + 'module' => 'Leads', + 'type' => 'decimal', + 'max_size' => '18', + 'precision' => '3', + 'require_option' => '0', + 'default_value' => NULL, + 'date_modified' => '2018-05-10 22:50:43', + 'deleted' => '0', + 'audited' => '1', + 'mass_update' => '0', + 'duplicate_merge' => '1', + 'reportable' => '1', + 'importable' => 'true', + 'ext1' => NULL, + 'ext2' => NULL, + 'ext3' => NULL, + 'ext4' => NULL, + ), + 'Leadsprogramminglanguages_c' => + array ( + 'id' => 'Leadsprogramminglanguages_c', + 'name' => 'programminglanguages_c', + 'label' => 'LBL_PROGRAMMINGLANGUAGES', + 'comments' => NULL, + 'help' => NULL, + 'module' => 'Leads', + 'type' => 'multienum', + 'max_size' => '100', + 'require_option' => '0', + 'default_value' => NULL, + 'date_modified' => '2018-05-10 14:05:09', + 'deleted' => '0', + 'audited' => '0', + 'mass_update' => '1', + 'duplicate_merge' => '1', + 'reportable' => '1', + 'importable' => 'true', + 'ext1' => 'languages', + 'ext2' => NULL, + 'ext3' => NULL, + 'ext4' => NULL, + ), ), ); diff --git a/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php b/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php new file mode 100644 index 00000000..d255696c --- /dev/null +++ b/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php @@ -0,0 +1,6 @@ + 'custom/src/application_campaign/GetCampaignEntrypoint.php', + 'auth' => false +); diff --git a/package/src/custom/Extension/application/Ext/Language/ar_SA.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ar_SA.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ar_SA.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/bg_BG.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/bg_BG.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/bg_BG.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/ca_ES.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ca_ES.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ca_ES.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/cs_CZ.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/cs_CZ.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/cs_CZ.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/da_DK.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/da_DK.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/da_DK.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/de_DE.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/de_DE.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/de_DE.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/el_EL.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/el_EL.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/el_EL.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/en_UK.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/en_UK.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/en_UK.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/en_us.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/en_us.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/en_us.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/es_ES.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/es_ES.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/es_ES.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/es_LA.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/es_LA.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/es_LA.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/et_EE.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/et_EE.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/et_EE.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/fi_FI.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/fi_FI.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/fi_FI.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/fr_FR.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/fr_FR.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/fr_FR.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/he_IL.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/he_IL.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/he_IL.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/hr_HR.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/hr_HR.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/hr_HR.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/hu_HU.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/hu_HU.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/hu_HU.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/it_it.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/it_it.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/it_it.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/ja_JP.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ja_JP.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ja_JP.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/ko_KR.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ko_KR.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ko_KR.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/lt_LT.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/lt_LT.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/lt_LT.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/lv_LV.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/lv_LV.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/lv_LV.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/nb_NO.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/nb_NO.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/nb_NO.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/nl_NL.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/nl_NL.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/nl_NL.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/pl_PL.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/pl_PL.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/pl_PL.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/pt_BR.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/pt_BR.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/pt_BR.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/pt_PT.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/pt_PT.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/pt_PT.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/ro_RO.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ro_RO.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ro_RO.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/ru_RU.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/ru_RU.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/ru_RU.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/sk_SK.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/sk_SK.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/sk_SK.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/sq_AL.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/sq_AL.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/sq_AL.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/sr_RS.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/sr_RS.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/sr_RS.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/sv_SE.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/sv_SE.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/sv_SE.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/th_TH.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/th_TH.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/th_TH.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/tr_TR.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/tr_TR.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/tr_TR.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/uk_UA.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/uk_UA.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/uk_UA.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/zh_CN.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/zh_CN.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/zh_CN.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/application/Ext/Language/zh_TW.sugar_languages.leadscustomized.php b/package/src/custom/Extension/application/Ext/Language/zh_TW.sugar_languages.leadscustomized.php new file mode 100644 index 00000000..c62b144b --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/zh_TW.sugar_languages.leadscustomized.php @@ -0,0 +1,11 @@ + 'PHP', + 'javascript' => 'JavaScript', + 'net' => '.NET', + 'java' => 'Java', + 'c' => 'C/C++', + 'go' => 'Go', + 'python' => 'Python', + 'ruby' => 'Ruby', +); \ No newline at end of file diff --git a/package/src/custom/Extension/modules/Leads/Ext/Language/en_us.ProfessorMStudioChanges.lang.php b/package/src/custom/Extension/modules/Leads/Ext/Language/en_us.ProfessorMStudioChanges.lang.php index bc9ee6dc..ebd34387 100644 --- a/package/src/custom/Extension/modules/Leads/Ext/Language/en_us.ProfessorMStudioChanges.lang.php +++ b/package/src/custom/Extension/modules/Leads/Ext/Language/en_us.ProfessorMStudioChanges.lang.php @@ -28,3 +28,8 @@ $mod_strings['LBL_LEAD_SOURCE_DESCRIPTION'] = 'Applicant Source Description:'; $mod_strings['LBL_ALIAS'] = 'Alias'; $mod_strings['LBL_DESCRIPTION'] = 'Origin Story'; +$mod_strings['LBL_PROGRAMMINGLANGUAGES'] = 'Programming Languages'; +$mod_strings['LBL_TRANSCRIPT'] = 'Transcript'; +$mod_strings['LBL_HIGHSCHOOL'] = 'High School'; +$mod_strings['LBL_GPA'] = 'Grade Point Average (GPA)'; +$mod_strings['LBL_RECORDVIEW_PANEL1'] = 'Application'; diff --git a/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_gpa_c.php b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_gpa_c.php new file mode 100644 index 00000000..2aa06763 --- /dev/null +++ b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_gpa_c.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_highschool_c.php b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_highschool_c.php new file mode 100644 index 00000000..75771fc1 --- /dev/null +++ b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_highschool_c.php @@ -0,0 +1,12 @@ + '0', + 'boost' => '1', + 'searchable' => false, +); +$dictionary['Lead']['fields']['highschool_c']['enforced']=''; +$dictionary['Lead']['fields']['highschool_c']['dependency']=''; + + ?> \ No newline at end of file diff --git a/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_programminglanguages_c.php b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_programminglanguages_c.php new file mode 100644 index 00000000..b135e510 --- /dev/null +++ b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_programminglanguages_c.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_transcript_c.php b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_transcript_c.php new file mode 100644 index 00000000..dd31d909 --- /dev/null +++ b/package/src/custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_transcript_c.php @@ -0,0 +1,12 @@ + '0', + 'boost' => '1', + 'searchable' => false, +); +$dictionary['Lead']['fields']['transcript_c']['enforced']=''; +$dictionary['Lead']['fields']['transcript_c']['dependency']=''; + + ?> \ No newline at end of file diff --git a/package/src/custom/modules/Leads/clients/base/views/record/record.php b/package/src/custom/modules/Leads/clients/base/views/record/record.php index ae1cdfed..cb628042 100644 --- a/package/src/custom/modules/Leads/clients/base/views/record/record.php +++ b/package/src/custom/modules/Leads/clients/base/views/record/record.php @@ -259,7 +259,41 @@ ), ), ), - 2 => + 2 => + array ( + 'newTab' => false, + 'panelDefault' => 'expanded', + 'name' => 'LBL_RECORDVIEW_PANEL1', + 'label' => 'LBL_RECORDVIEW_PANEL1', + 'columns' => 2, + 'labelsOnTop' => 1, + 'placeholders' => 1, + 'fields' => + array ( + 0 => + array ( + 'name' => 'highschool_c', + 'label' => 'LBL_HIGHSCHOOL', + ), + 1 => + array ( + 'name' => 'gpa_c', + 'label' => 'LBL_GPA', + ), + 2 => + array ( + 'name' => 'programminglanguages_c', + 'label' => 'LBL_PROGRAMMINGLANGUAGES', + ), + 3 => + array ( + 'name' => 'transcript_c', + 'studio' => 'visible', + 'label' => 'LBL_TRANSCRIPT', + ), + ), + ), + 3 => array ( 'name' => 'panel_hidden', 'label' => 'LBL_RECORD_SHOWMORE', diff --git a/package/src/custom/online_application_form/ApplyOnline.html b/package/src/custom/online_application_form/ApplyOnline.html new file mode 100644 index 00000000..886d52df --- /dev/null +++ b/package/src/custom/online_application_form/ApplyOnline.html @@ -0,0 +1,327 @@ + + + + +

      + +

      +
      + + +
      + Professor M's School for Gifted Coders Logo +

      Application for Admission

      +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      + +
      + +
      + +
      + + + + + + + +
      +

      + +

      diff --git a/package/src/custom/online_application_form/ApplyOnlineSuccess.html b/package/src/custom/online_application_form/ApplyOnlineSuccess.html new file mode 100644 index 00000000..d0fcd71e --- /dev/null +++ b/package/src/custom/online_application_form/ApplyOnlineSuccess.html @@ -0,0 +1,18 @@ + + + + + + + +
      + Professor M's School for Gifted Coders Logo +

      Thank you!

      +

      We appreciate your interest in attending our school! We'll get back to you soon.

      +
      + + diff --git a/package/src/custom/src/application_campaign/ApplicationCampaignManager.php b/package/src/custom/src/application_campaign/ApplicationCampaignManager.php new file mode 100644 index 00000000..b0f1e1c4 --- /dev/null +++ b/package/src/custom/src/application_campaign/ApplicationCampaignManager.php @@ -0,0 +1,61 @@ +getSugarQuery(); + $q->select(array('id', 'name')); + $q->from($this->getNewCampaignBean(), array('team_security' => false)); + $q->where()->equals('name', 'Online Applications'); + $q->orderBy('date_modified', 'desc'); + $q->limit(1); + + $results = $q->execute(); + + if(sizeof($results) != 1 || !$results[0]['id']){ + throw new \Exception("Unable to find ID for the Campaign named Online Applications"); + } + return $results[0]['id']; + } + + /** + * Get Sugar Query. + * + * @return \SugarQuery + */ + protected function getSugarQuery() + { + return new \SugarQuery(); + } + + /** + * Get a new Campaign Bean + * + * @return null|\SugarBean + */ + protected function getNewCampaignBean() + { + return \BeanFactory::newBean('Campaigns'); + } + +} diff --git a/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php b/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php new file mode 100644 index 00000000..121f1d62 --- /dev/null +++ b/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php @@ -0,0 +1,9 @@ +getOnlineApplicationsCampaignId(); diff --git a/package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php b/package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php new file mode 100644 index 00000000..af6e5ce3 --- /dev/null +++ b/package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php @@ -0,0 +1,70 @@ +where = $this->createMock('SugarQuery_Builder_Where'); + $this->sugarQuery = $this->createMock('SugarQuery'); + $this->sugarQuery->method('where')->willReturn($this->where); + + $this->campaignBean = $this->createMock('SugarBean'); + + $this->acm = TestMockHelper::createPartialMock($this, + '\\Sugarcrm\\Sugarcrm\\custom\\application_campaign\\ApplicationCampaignManager', + ['getSugarQuery', 'getNewCampaignBean']); + $this->acm->method('getSugarQuery')->willReturn($this->sugarQuery); + $this->acm->method('getNewCampaignBean')->willReturn($this->campaignBean); + } + + /** + * @covers ::getOnlineApplicationsCampaignId + */ + public function testGetOnlineApplicationsCampaignIdWithResults() + { + $this->campaignId = "57f5a666-70c3-11e8-bbb3-34363bc46900"; + $this->queryResults = array( + 0 => array( + "id" => $this->campaignId, + "name" => "Online Applications", + "campaigns__date_modified" => "2018-06-15 17:41:32" + ) + ); + $this->sugarQuery->method('execute')->willReturn($this->queryResults); + + $this->sugarQuery->expects($this->once())->method('execute'); + $this->assertEquals($this->campaignId, $this->acm->getOnlineApplicationsCampaignId()); + } + + /** + * @covers ::getOnlineApplicationsCampaignId + */ + public function testGetOnlineApplicationsCampaignIdWithNoResults() + { + $this->queryResults = array(); + $this->sugarQuery->method('execute')->willReturn($this->queryResults); + + $this->sugarQuery->expects($this->once())->method('execute'); + $this->expectException(Exception::class, "Unable to find ID for the Campaign named Online Applications"); + $this->acm->getOnlineApplicationsCampaignId(); + } + +} From a34a0b45dae4b15dc74b42a352eee8c180495dc8 Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Wed, 27 Jun 2018 15:47:56 -0400 Subject: [PATCH 2/4] Fixes #65: Update error handling and add phpdoc --- .../online_application_form/ApplyOnline.html | 19 +++++++++++-------- .../ApplicationCampaignManager.php | 4 +++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package/src/custom/online_application_form/ApplyOnline.html b/package/src/custom/online_application_form/ApplyOnline.html index 886d52df..118bbf1a 100644 --- a/package/src/custom/online_application_form/ApplyOnline.html +++ b/package/src/custom/online_application_form/ApplyOnline.html @@ -248,17 +248,20 @@

      Application for Admission

      xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { + if(xhr.responseText) { + document.getElementById('WebToLeadForm').action = urlBase + "//index.php?entryPoint=WebToLeadCapture"; - document.getElementById('WebToLeadForm').action = urlBase + "//index.php?entryPoint=WebToLeadCapture"; + document.getElementById('campaign_id').value = xhr.responseText; - document.getElementById('campaign_id').value = xhr.responseText; + document.getElementById('redirect_url').value = urlBase + "/custom/online_application_form/ApplyOnlineSuccess.html"; - document.getElementById('redirect_url').value = urlBase + "/custom/online_application_form/ApplyOnlineSuccess.html"; - - if(typeof(validateCaptchaAndSubmit)!='undefined'){ - validateCaptchaAndSubmit(); - }else{ - check_webtolead_fields(); + if (typeof(validateCaptchaAndSubmit) != 'undefined') { + validateCaptchaAndSubmit(); + } else { + check_webtolead_fields(); + } + } else { + alert('We were unable to process your request, because we could not find a Campaign in Sugar with the name Online Applications.'); } } }); diff --git a/package/src/custom/src/application_campaign/ApplicationCampaignManager.php b/package/src/custom/src/application_campaign/ApplicationCampaignManager.php index b0f1e1c4..cca759fd 100644 --- a/package/src/custom/src/application_campaign/ApplicationCampaignManager.php +++ b/package/src/custom/src/application_campaign/ApplicationCampaignManager.php @@ -40,6 +40,7 @@ public function getOnlineApplicationsCampaignId(): string /** * Get Sugar Query. + * This function exists so we can mock the SugarQuery in automated tests. * * @return \SugarQuery */ @@ -49,7 +50,8 @@ protected function getSugarQuery() } /** - * Get a new Campaign Bean + * Get a new Campaign Bean. + * This function exists so we can mock the Campaigns Bean in automated tests. * * @return null|\SugarBean */ From 68f3840a0340c0e311eb7315b3fa5a04edbd9e03 Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Thu, 28 Jun 2018 08:09:39 -0400 Subject: [PATCH 3/4] Fixes #65: Fix merge mistakes --- data/ProfessorM_PostmanCollection.json | 80 +++++++++++++++++++++----- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/data/ProfessorM_PostmanCollection.json b/data/ProfessorM_PostmanCollection.json index 6a831802..cafadbeb 100644 --- a/data/ProfessorM_PostmanCollection.json +++ b/data/ProfessorM_PostmanCollection.json @@ -3,7 +3,7 @@ "info": { "name": "ProfessorM Sample Data", "_postman_id": "fc375495-ded0-309d-599e-fa5c27b17910", - "description": "This collection is associated with the tutorial posted at XXXX and the environment posted at YYYYY.", + "description": "See https://github.com/sugarcrm/school for more information.", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ @@ -1709,7 +1709,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Firebird\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Janice\",\n\t\"last_name\":\"Beige\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Employee\",\n\t\"birthdate\":\"1975-05-22\",\n\t\"status_description\":\"Beware: potentially volatile\",\n\t\"pr_prof_leadspr_prof_ida\":\"{{Professor_Beige}}\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_Firebird}}\"\n}" + "raw": "{\n\t\"alias_c\":\"Firebird\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Janice\",\n\t\"last_name\":\"Beige\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Employee\",\n\t\"birthdate\":\"1975-05-22\",\n\t\"status_description\":\"Beware: potentially volatile\",\n\t\"pr_prof_leadspr_prof_ida\":\"{{Professor_Beige}}\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_Firebird}}\",\n\t\"highschool_c\":\"Superhero Academy\",\n\t\"gpa_c\": \"3.22\",\n\t\"programminglanguages_c\": [\"php\"],\n\t\"transcript_c\": \"Math: A-\\nEnglish: A\\nScience: B+\\nAgility: A+\"\n}" }, "description": "" }, @@ -1747,7 +1747,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Glamour\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Symone\",\n\t\"last_name\":\"Lighthome\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1961-07-11\",\n\t\"status_description\":\"Shifty, but highly skilled.\",\n\t\"account_name\":\"Brotherhood of Deviants\",\n\t\"account_id\":\"{{SuperGroup_Brotherhood}}\",\n\t\"contact_id\":\"{{Student_Glamour}}\"\n}" + "raw": "{\n\t\"alias_c\":\"Glamour\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Symone\",\n\t\"last_name\":\"Lighthome\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1961-07-11\",\n\t\"status_description\":\"Shifty, but highly skilled.\",\n\t\"account_name\":\"Brotherhood of Deviants\",\n\t\"account_id\":\"{{SuperGroup_Brotherhood}}\",\n\t\"contact_id\":\"{{Student_Glamour}}\",\n\t\"highschool_c\":\"School of Superheroes\",\n\t\"gpa_c\": \"3.47\",\n\t\"programminglanguages_c\": [\"java\",\"go\"],\n\t\"transcript_c\": \"Math: B\\nEnglish: A\\nScience: A-\\nEthics of Superpowers: B\"\n}" }, "description": "" }, @@ -1785,7 +1785,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Attracto\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Val\",\n\t\"last_name\":\"Eisenhower\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Self Generated\",\n\t\"birthdate\":\"1928-08-05\",\n\t\"status_description\":\"Shows great potential. Anger issues.\",\n\t\"account_name\":\"Brotherhood of Deviants\",\n\t\"account_id\":\"{{SuperGroup_Brotherhood}}\",\n\t\"contact_id\":\"{{Student_Attracto}}\"\n}" + "raw": "{\n\t\"alias_c\":\"Attracto\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Val\",\n\t\"last_name\":\"Eisenhower\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Self Generated\",\n\t\"birthdate\":\"1928-08-05\",\n\t\"status_description\":\"Shows great potential. Anger issues.\",\n\t\"account_name\":\"Brotherhood of Deviants\",\n\t\"account_id\":\"{{SuperGroup_Brotherhood}}\",\n\t\"contact_id\":\"{{Student_Attracto}}\",\n\t\"highschool_c\":\"School of Superheroes\",\n\t\"gpa_c\": \"2.95\",\n\t\"programminglanguages_c\": [\"java\",\"python\"],\n\t\"transcript_c\": \"Math: B\\nEnglish: B-\\nScience: B+\\nEthics of Superpowers: B\"\n}" }, "description": "" }, @@ -1823,7 +1823,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Honey Badger\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Jimmy\",\n\t\"last_name\":\"Harwit\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Cold Call\",\n\t\"birthdate\":\"1887-05-08\",\n\t\"status_description\":\"Does not play nicely with others.\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_HoneyBadger}}\",\n\t\"primary_address_city\":\"Whitehorse\",\n\t\"primary_address_state\":\"YT\",\n\t\"primary_address_country\":\"Canada\"\n}" + "raw": "{\n\t\"alias_c\":\"Honey Badger\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Jimmy\",\n\t\"last_name\":\"Harwit\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Cold Call\",\n\t\"birthdate\":\"1887-05-08\",\n\t\"status_description\":\"Does not play nicely with others.\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_HoneyBadger}}\",\n\t\"primary_address_city\":\"Whitehorse\",\n\t\"primary_address_state\":\"YT\",\n\t\"primary_address_country\":\"Canada\",\n\t\"highschool_c\":\"Whitehorse High School\",\n\t\"gpa_c\": \"3.10\",\n\t\"programminglanguages_c\": [\"python\",\"go\"],\n\t\"transcript_c\": \"Math: A\\nEnglish: B-\\nScience: B+\\nDon't Care: A+\"\n}" }, "description": "" }, @@ -1861,7 +1861,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Rascal\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Annette\",\n\t\"last_name\":\"Mary\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1989-12-26\",\n\t\"status_description\":\"Former Brotherhood member. Trust issues.\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_Rascal}}\",\n\t\"primary_address_city\":\"Caldecott\",\n\t\"primary_address_state\":\"MS\",\n\t\"primary_address_country\":\"USA\"\n}" + "raw": "{\n\t\"alias_c\":\"Rascal\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Annette\",\n\t\"last_name\":\"Mary\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1989-12-26\",\n\t\"status_description\":\"Former Brotherhood member. Trust issues.\",\n\t\"account_name\":\"M-Men\",\n\t\"account_id\":\"{{SuperGroup_M-Men}}\",\n\t\"contact_id\":\"{{Student_Rascal}}\",\n\t\"primary_address_city\":\"Caldecott\",\n\t\"primary_address_state\":\"MS\",\n\t\"primary_address_country\":\"USA\",\n\t\"highschool_c\":\"Caldecott Academy\",\n\t\"gpa_c\": \"3.61\",\n\t\"programminglanguages_c\": [\"php\"],\n\t\"transcript_c\": \"Math: A-\\nEnglish: A\\nScience: A-\\nSucceeding as a Superhero: A\"\n}" }, "description": "" }, @@ -1899,7 +1899,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Shadylynx\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Cate\",\n\t\"last_name\":\"Purry\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1992-01-24\",\n\t\"status_description\":\"Very apt student.\",\n\t\"account_name\":\"Young M-Men\",\n\t\"account_id\":\"{{SuperGroup_Young}}\",\n\t\"contact_id\":\"{{Student_Shadylynx}}\",\n\t\"primary_address_city\":\"Deerfield\",\n\t\"primary_address_state\":\"IL\",\n\t\"primary_address_country\":\"USA\"\n}" + "raw": "{\n\t\"alias_c\":\"Shadylynx\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Cate\",\n\t\"last_name\":\"Purry\",\n\t\"converted\":true,\n\t\"status\":\"Converted\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Partner\",\n\t\"birthdate\":\"1992-01-24\",\n\t\"status_description\":\"Very apt student.\",\n\t\"account_name\":\"Young M-Men\",\n\t\"account_id\":\"{{SuperGroup_Young}}\",\n\t\"contact_id\":\"{{Student_Shadylynx}}\",\n\t\"primary_address_city\":\"Deerfield\",\n\t\"primary_address_state\":\"IL\",\n\t\"primary_address_country\":\"USA\",\n\t\"highschool_c\":\"Deerfield School for the Gifted\",\n\t\"gpa_c\": \"4.00\",\n\t\"programminglanguages_c\": [\"php\",\"java\"],\n\t\"transcript_c\": \"Math: A+\\nEnglish: A+\\nScience: A+\\nHistory of Superheroes: A+\"\n}" }, "description": "" }, @@ -1937,7 +1937,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Deathpond\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Wayne\",\n\t\"last_name\":\"Williams\",\n\t\"converted\":false,\n\t\"status\":\"Dead\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Word of mouth\",\n\t\"birthdate\":\"1986-03-18\",\n\t\"status_description\":\"DO NOT ALLOW ANYWHERE NEAR STUDENTS.\",\n\t\"primary_address_city\":\"Clare\",\n\t\"primary_address_state\":\"SK\",\n\t\"primary_address_country\":\"Canada\"\n}" + "raw": "{\n\t\"alias_c\":\"Deathpond\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Wayne\",\n\t\"last_name\":\"Williams\",\n\t\"converted\":false,\n\t\"status\":\"Dead\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Word of mouth\",\n\t\"birthdate\":\"1986-03-18\",\n\t\"status_description\":\"DO NOT ALLOW ANYWHERE NEAR STUDENTS.\",\n\t\"primary_address_city\":\"Clare\",\n\t\"primary_address_state\":\"SK\",\n\t\"primary_address_country\":\"Canada\",\n\t\"highschool_c\":\"Clare High School\",\n\t\"gpa_c\": \"2.5\",\n\t\"programminglanguages_c\": [\"php\"],\n\t\"transcript_c\": \"Math: C\\nEnglish: B\\nScience: B+\\nEthics: C\"\n}" }, "description": "" }, @@ -1975,7 +1975,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Mr. Fabulous\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Roy\",\n\t\"last_name\":\"Rogers\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Genius\", \"Human\"],\n\t\"birthdate\":\"1969-02-12\"\n}" + "raw": "{\n\t\"alias_c\":\"Mr. Fabulous\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Roy\",\n\t\"last_name\":\"Rogers\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Genius\", \"Human\"],\n\t\"birthdate\":\"1969-02-12\",\n\t\"highschool_c\":\"School of Superheroes\",\n\t\"gpa_c\": \"3.80\",\n\t\"programminglanguages_c\": [\"java\",\"go\"],\n\t\"transcript_c\": \"Math: A+\\nEnglish: A\\nScience: A+\\nEthics of Superpowers: A+\"\n}" }, "description": "" }, @@ -2013,7 +2013,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Steel Man\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Tony\",\n\t\"last_name\":\"Stork\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genius\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1972-04-02\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Long Island\",\n\t\"primary_address_state\":\"NY\",\n\t\"primary_address_country\":\"USA\"\n}" + "raw": "{\n\t\"alias_c\":\"Steel Man\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Tony\",\n\t\"last_name\":\"Stork\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genius\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1972-04-02\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Long Island\",\n\t\"primary_address_state\":\"NY\",\n\t\"primary_address_country\":\"USA\",\n\t\"highschool_c\":\"Long Island Academy\",\n\t\"gpa_c\": \"3.62\",\n\t\"programminglanguages_c\": [\"java\",\"go\"],\n\t\"transcript_c\": \"Math: A\\nEnglish: A+\\nScience: A\\nSuperpowers in the Modern World: A+\"\n}" }, "description": "" }, @@ -2051,7 +2051,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"The Hunk\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Brian\",\n\t\"last_name\":\"Pennant\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Genius\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1980-11-03\",\n\t\"account_name\":\"Revengers\"\n}" + "raw": "{\n\t\"alias_c\":\"The Hunk\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Brian\",\n\t\"last_name\":\"Pennant\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Genius\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1980-11-03\",\n\t\"account_name\":\"Revengers\",\n\t\"highschool_c\":\"Superhero Academy\",\n\t\"gpa_c\": \"3.00\",\n\t\"programminglanguages_c\": [\"go\",\"python\"],\n\t\"transcript_c\": \"Math: B\\nEnglish: A\\nScience: B\\nAgility: A\"\n}" }, "description": "" }, @@ -2089,7 +2089,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Blonde Tarantula\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Iggy\",\n\t\"last_name\":\"Ora\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Assassin\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1982-06-06\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Volgograd\",\n\t\"primary_address_country\":\"Russia\"\n}" + "raw": "{\n\t\"alias_c\":\"Blonde Tarantula\",\n\t\"salutation\":\"Ms.\",\n\t\"first_name\":\"Iggy\",\n\t\"last_name\":\"Ora\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Assassin\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1982-06-06\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Volgograd\",\n\t\"primary_address_country\":\"Russia\",\n\t\"highschool_c\":\"Volgograd Academy\",\n\t\"gpa_c\": \"3.44\",\n\t\"programminglanguages_c\": [\"java\",\"javascript\"],\n\t\"transcript_c\": \"Math: A+\\nLiterature: A\\nScience: A-\\nHistory of Superheroes: A+\"\n}" }, "description": "" }, @@ -2127,7 +2127,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Chance\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Ronny\",\n\t\"last_name\":\"LeFlame\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Web Site\",\n\t\"birthdate\":\"1984-09-09\",\n\t\"account_name\":\"M-Men\",\n\t\"primary_address_city\":\"New Orleans\",\n\t\"primary_address_state\":\"LA\",\n\t\"primary_address_country\":\"USA\"\n}" + "raw": "{\n\t\"alias_c\":\"Chance\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Ronny\",\n\t\"last_name\":\"LeFlame\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Mutants\"],\n\t\"lead_source\":\"Web Site\",\n\t\"birthdate\":\"1984-09-09\",\n\t\"account_name\":\"M-Men\",\n\t\"primary_address_city\":\"New Orleans\",\n\t\"primary_address_state\":\"LA\",\n\t\"primary_address_country\":\"USA\",\n\t\"highschool_c\":\"New Orleans High School\",\n\t\"gpa_c\": \"3.22\",\n\t\"programminglanguages_c\": [\"python\"],\n\t\"transcript_c\": \"Math: B\\nEnglish: A\\nScience: B+\\nSuperhero Skills: A+\"\n}" }, "description": "" }, @@ -2165,7 +2165,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"alias_c\":\"Captain USA\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Jamie\",\n\t\"last_name\":\"Rahn\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1925-10-20\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Bronx\",\n\t\"primary_address_state\":\"NY\",\n\t\"primary_address_country\":\"USA\"\n}" + "raw": "{\n\t\"alias_c\":\"Captain USA\",\n\t\"salutation\":\"Mr.\",\n\t\"first_name\":\"Jamie\",\n\t\"last_name\":\"Rahn\",\n\t\"converted\":false,\n\t\"status\":\"New\",\n\t\"tag\":[\"Genetically Enhanced\", \"Human\"],\n\t\"lead_source\":\"Campaign\",\n\t\"birthdate\":\"1925-10-20\",\n\t\"account_name\":\"Revengers\",\n\t\"primary_address_city\":\"Bronx\",\n\t\"primary_address_state\":\"NY\",\n\t\"primary_address_country\":\"USA\",\n\t\"highschool_c\":\"Ninja Academy\",\n\t\"gpa_c\": \"3.75\",\n\t\"programminglanguages_c\": [\"javascript\",\"java\"],\n\t\"transcript_c\": \"Math: B+\\nEnglish: A+\\nBalance: A\\nAgility: A+\\nGrip strength: B+\"\n}" }, "description": "" }, @@ -2590,6 +2590,58 @@ "response": [] } ] + }, + { + "name": "Create Campaigns", + "description": "", + "item": [ + { + "name": "Create Online Applications Campaign", + "event": [ + { + "listen": "test", + "script": { + "id": "23a0541a-2487-4e76-84db-5aca2dd77723", + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var idOfCampaign = jsonData.id;", + "", + "tests[\"Successful POST request\"] = responseCode.code === 200;", + "tests[\"id exists\"] = idOfCampaign !== null || idOfCampaign !== \"\";" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "OAuth-Token", + "value": "{{access_token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": " {\n \"name\": \"Online Applications\",\n \"status\": \"Active\",\n \"campaign_type\": \"Web\",\n \"module\": \"Campaigns\",\n \"end_date\": \"2020-05-18\",\n \"assigned_user_name\": \"Administrator\",\n \"assigned_user_id\": \"1\",\n \"team_name_collection_0\": \"Global\"\n }" + }, + "url": { + "raw": "{{url}}{{rest_endpoint}}/Campaigns", + "host": [ + "{{url}}{{rest_endpoint}}" + ], + "path": [ + "Campaigns" + ] + } + }, + "response": [] + } + ] } ] } From 2b32eb83f2840b435dd8f3645fbe0bbbb2af319e Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Mon, 2 Jul 2018 17:43:46 -0400 Subject: [PATCH 4/4] Fixes #65: Add custom endpoint to get Online Applications Campaign Remove entrypoint code and add tests Update Application Form to use REST endpoint Update Exception type Remove closing tag --- .../Ext/EntryPointRegistry/getCampaign.php | 6 - .../base/api/OnlineApplicationsAPI.php | 85 ++++ .../help/GetOnlineApplicationsCampaignId.html | 35 ++ .../online_application_form/ApplyOnline.html | 366 +++++++++--------- .../ApplicationCampaignManager.php | 63 --- .../GetCampaignEntrypoint.php | 9 - .../base/api/OnlineApplicationsAPITest.php} | 18 +- 7 files changed, 314 insertions(+), 268 deletions(-) delete mode 100644 package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php create mode 100644 package/src/custom/modules/Campaigns/clients/base/api/OnlineApplicationsAPI.php create mode 100644 package/src/custom/modules/Campaigns/clients/base/api/help/GetOnlineApplicationsCampaignId.html delete mode 100644 package/src/custom/src/application_campaign/ApplicationCampaignManager.php delete mode 100644 package/src/custom/src/application_campaign/GetCampaignEntrypoint.php rename package/src/custom/tests/School/unit-php/{src/application_campaign/ApplicationCampaignManagerTest.php => modules/Campaigns/clients/base/api/OnlineApplicationsAPITest.php} (77%) diff --git a/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php b/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php deleted file mode 100644 index d255696c..00000000 --- a/package/src/custom/Extension/application/Ext/EntryPointRegistry/getCampaign.php +++ /dev/null @@ -1,6 +0,0 @@ - 'custom/src/application_campaign/GetCampaignEntrypoint.php', - 'auth' => false -); diff --git a/package/src/custom/modules/Campaigns/clients/base/api/OnlineApplicationsAPI.php b/package/src/custom/modules/Campaigns/clients/base/api/OnlineApplicationsAPI.php new file mode 100644 index 00000000..f85b0ac0 --- /dev/null +++ b/package/src/custom/modules/Campaigns/clients/base/api/OnlineApplicationsAPI.php @@ -0,0 +1,85 @@ + array( + + //request type + 'reqType' => 'GET', + + //set authentication + 'noLoginRequired' => true, + + //endpoint path + 'path' => array('Campaigns', 'getOnlineApplicationsCampaignId'), + + //method to call + 'method' => 'getOnlineApplicationsCampaignId', + + //short help string to be displayed in the help documentation + 'shortHelp' => 'Get the ID of the most recently updated Campaign with the name \'Online Applications\'', + + //long help to be displayed in the help documentation + 'longHelp' => 'custom/modules/Campaigns/clients/base/api/help/GetOnlineApplicationsCampaignId.html', + ), + ); + } + + /** + * Get the ID of the most recently updated Campaign with the name 'Online Applications' + * + * @return an array containing the ID of the most recently updated Campaign with the name 'Online Applications' + */ + public function getOnlineApplicationsCampaignId() + { + // Get the most recently updated Campaign with the name 'Online Applications' + $q = $this->getSugarQuery(); + $q->select(array('id', 'name')); + $q->from($this->getNewCampaignBean(), array('team_security' => false)); + $q->where()->equals('name', 'Online Applications'); + $q->orderBy('date_modified', 'desc'); + $q->limit(1); + + $results = $q->execute(); + + if(sizeof($results) != 1 || !$results[0]['id']){ + throw new \SugarApiExceptionError("Unable to find ID for the Campaign named Online Applications"); + } + + return array('id' => $results[0]['id']); + } + + /** + * Get Sugar Query. + * This function exists so we can mock the SugarQuery in automated tests. + * + * @return \SugarQuery + */ + protected function getSugarQuery() + { + return new \SugarQuery(); + } + + /** + * Get a new Campaign Bean. + * This function exists so we can mock the Campaigns Bean in automated tests. + * + * @return null|\SugarBean + */ + protected function getNewCampaignBean() + { + return \BeanFactory::newBean('Campaigns'); + } + +} diff --git a/package/src/custom/modules/Campaigns/clients/base/api/help/GetOnlineApplicationsCampaignId.html b/package/src/custom/modules/Campaigns/clients/base/api/help/GetOnlineApplicationsCampaignId.html new file mode 100644 index 00000000..339d3b39 --- /dev/null +++ b/package/src/custom/modules/Campaigns/clients/base/api/help/GetOnlineApplicationsCampaignId.html @@ -0,0 +1,35 @@ +

      Overview

      + + A custom GET endpoint. Returns the ID of the most recently updated Campaign with the name 'Online Applications'. + + +

      Result

      + + + + + + + + + + + + + + + +
      NameTypeDescription
      + id + + String + + The ID of the most recently updated Campaign with the name 'Online Applications'. +
      + +

      Output Example

      +
      +{
      +    "id": "f56b6d18-52e1-11e8-a080-34363bc46900"
      +}
      +
      diff --git a/package/src/custom/online_application_form/ApplyOnline.html b/package/src/custom/online_application_form/ApplyOnline.html index 118bbf1a..0ef7d092 100644 --- a/package/src/custom/online_application_form/ApplyOnline.html +++ b/package/src/custom/online_application_form/ApplyOnline.html @@ -52,223 +52,227 @@

      -

      -
      - - -
      - Professor M's School for Gifted Coders Logo -

      Application for Admission

      -
      - -
      -
      -
      -
      - -
      -
      - -
      +

      + + + +
      + Professor M's School for Gifted Coders Logo +

      Application for Admission

      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      -
      -
      -
      -
      -
      - -
      -
      - -
      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      -
      -
      -
      -
      -
      - -
      -
      - -
      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      +
      -
      -
      -
      - -
      -
      - -
      +
      +
      +
      + +
      +
      +
      -
      -
      -
      -
      -
      - -
      -
      - -
      +
      + +
      +
      +
      +
      + +
      +
      +
      -
      -
      - -
      +
      - - - - - - - -

      +

      + +
      + + + + + + + + +

      -

      + alert('Not a valid email address'); + } + } + if(document.getElementById('email2') && document.getElementById('email2').value.length >0) { + if(document.getElementById('email2').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){ + alert('Not a valid email address'); + } + } + } + // ]]> +

      diff --git a/package/src/custom/src/application_campaign/ApplicationCampaignManager.php b/package/src/custom/src/application_campaign/ApplicationCampaignManager.php deleted file mode 100644 index cca759fd..00000000 --- a/package/src/custom/src/application_campaign/ApplicationCampaignManager.php +++ /dev/null @@ -1,63 +0,0 @@ -getSugarQuery(); - $q->select(array('id', 'name')); - $q->from($this->getNewCampaignBean(), array('team_security' => false)); - $q->where()->equals('name', 'Online Applications'); - $q->orderBy('date_modified', 'desc'); - $q->limit(1); - - $results = $q->execute(); - - if(sizeof($results) != 1 || !$results[0]['id']){ - throw new \Exception("Unable to find ID for the Campaign named Online Applications"); - } - return $results[0]['id']; - } - - /** - * Get Sugar Query. - * This function exists so we can mock the SugarQuery in automated tests. - * - * @return \SugarQuery - */ - protected function getSugarQuery() - { - return new \SugarQuery(); - } - - /** - * Get a new Campaign Bean. - * This function exists so we can mock the Campaigns Bean in automated tests. - * - * @return null|\SugarBean - */ - protected function getNewCampaignBean() - { - return \BeanFactory::newBean('Campaigns'); - } - -} diff --git a/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php b/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php deleted file mode 100644 index 121f1d62..00000000 --- a/package/src/custom/src/application_campaign/GetCampaignEntrypoint.php +++ /dev/null @@ -1,9 +0,0 @@ -getOnlineApplicationsCampaignId(); diff --git a/package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php b/package/src/custom/tests/School/unit-php/modules/Campaigns/clients/base/api/OnlineApplicationsAPITest.php similarity index 77% rename from package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php rename to package/src/custom/tests/School/unit-php/modules/Campaigns/clients/base/api/OnlineApplicationsAPITest.php index af6e5ce3..94e8be6a 100644 --- a/package/src/custom/tests/School/unit-php/src/application_campaign/ApplicationCampaignManagerTest.php +++ b/package/src/custom/tests/School/unit-php/modules/Campaigns/clients/base/api/OnlineApplicationsAPITest.php @@ -3,15 +3,15 @@ use Sugarcrm\SugarcrmTestsUnit\TestMockHelper; /** - * @coversDefaultClass \ApplicationCampaignManager + * @coversDefaultClass \OnlineApplicationsAPI */ -class ApplicationCampaignManagerTest extends \PHPUnit\Framework\TestCase +class OnlineApplicationsAPI extends \PHPUnit\Framework\TestCase { /** - * A partial mock of ApplicationCampaignManager + * A partial mock of OnlineApplicationsAPI */ - private $acm; + private $api; /** * @var a partial mock of a SugarQuery @@ -28,11 +28,11 @@ protected function setUp() $this->campaignBean = $this->createMock('SugarBean'); - $this->acm = TestMockHelper::createPartialMock($this, + $this->api = TestMockHelper::createPartialMock($this, '\\Sugarcrm\\Sugarcrm\\custom\\application_campaign\\ApplicationCampaignManager', ['getSugarQuery', 'getNewCampaignBean']); - $this->acm->method('getSugarQuery')->willReturn($this->sugarQuery); - $this->acm->method('getNewCampaignBean')->willReturn($this->campaignBean); + $this->api->method('getSugarQuery')->willReturn($this->sugarQuery); + $this->api->method('getNewCampaignBean')->willReturn($this->campaignBean); } /** @@ -51,7 +51,7 @@ public function testGetOnlineApplicationsCampaignIdWithResults() $this->sugarQuery->method('execute')->willReturn($this->queryResults); $this->sugarQuery->expects($this->once())->method('execute'); - $this->assertEquals($this->campaignId, $this->acm->getOnlineApplicationsCampaignId()); + $this->assertEquals($this->campaignId, $this->api->getOnlineApplicationsCampaignId()); } /** @@ -64,7 +64,7 @@ public function testGetOnlineApplicationsCampaignIdWithNoResults() $this->sugarQuery->expects($this->once())->method('execute'); $this->expectException(Exception::class, "Unable to find ID for the Campaign named Online Applications"); - $this->acm->getOnlineApplicationsCampaignId(); + $this->api->getOnlineApplicationsCampaignId(); } }