Skip to content

Commit

Permalink
Merge pull request #391 from compucorp/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
davialexandre authored Jul 18, 2018
2 parents cc108c0 + 743e16c commit d104453
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ public function upgrade_0008() {
return TRUE;
}

public function upgrade_0009() {
$this->executeCustomDataFile('xml/probation.xml');

return TRUE;
}

/*
* Enable CiviTask and CiviDocument components.
*/
Expand Down Expand Up @@ -882,36 +888,6 @@ public function upgrade_1039() {
return TRUE;
}

/**
* Deletes or disables "Probation" custom group
*
* @return bool
*/
public function upgrade_1040() {
$result = civicrm_api3('CustomGroup', 'get', [
'name' => 'Probation',
]);
if ($result['count'] == 0) {
return TRUE;
}

$customGroupTable = $result['values'][$result['id']]['table_name'];
$sql = "SELECT * FROM `" . $customGroupTable . "`";
$sqlResult = CRM_Core_DAO::executeQuery($sql);

if ($sqlResult->N == 0) {
civicrm_api3('CustomGroup', 'delete', ['id' => $result['id']]);
}
else {
civicrm_api3('CustomGroup', 'create', [
'id' => $result['id'],
'is_active' => 0
]);
}

return TRUE;
}

public function uninstall() {
CRM_Core_DAO::executeQuery("DELETE FROM `civicrm_navigation` WHERE name IN ('tasksassignments', 'ta_dashboard_tasks', 'ta_dashboard_documents', 'ta_dashboard_calendar', 'ta_dashboard_keydates', 'tasksassignments_administer', 'ta_settings')");
CRM_Core_BAO_Navigation::resetNavigation();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ define([
obj: {
period_start_date: 'Contract Start Date',
period_end_date: 'Contract End Date',
birth_date: 'Birthday'
birth_date: 'Birthday',
probation_end_date: 'Probation End Date'
},
arr: []
},
Expand Down
41 changes: 41 additions & 0 deletions uk.co.compucorp.civicrm.tasksassignments/xml/probation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<CustomData>
<CustomGroups>
<CustomGroup>
<name>Probation</name>
<title>Probation</title>
<extends>Individual</extends>
<style>Inline</style>
<collapse_display>0</collapse_display>
<help_pre></help_pre>
<help_post></help_post>
<weight>13</weight>
<is_active>1</is_active>
<table_name>civicrm_value_probation_12</table_name>
<is_multiple>0</is_multiple>
<collapse_adv_display>0</collapse_adv_display>
<is_reserved>0</is_reserved>
</CustomGroup>
</CustomGroups>
<CustomFields>
<CustomField>
<name>Probation_End_Date</name>
<label>Probation End Date</label>
<data_type>Date</data_type>
<html_type>Select Date</html_type>
<is_required>0</is_required>
<is_searchable>1</is_searchable>
<is_search_range>1</is_search_range>
<weight>1</weight>
<is_active>1</is_active>
<is_view>0</is_view>
<text_length>255</text_length>
<date_format>yy-mm-dd</date_format>
<note_columns>60</note_columns>
<note_rows>4</note_rows>
<column_name>probation_end_date</column_name>
<custom_group_name>Probation</custom_group_name>
</CustomField>
</CustomFields>
</CustomData>

0 comments on commit d104453

Please sign in to comment.