Commit b1c425de authored by ErikHommel's avatar ErikHommel
Browse files

completed issue 6028

parent 6127a282
......@@ -12,24 +12,13 @@ use CRM_Nbrprojectvolunteerlist_ExtensionUtil as E;
class CRM_Nbrprojectvolunteerlist_CaseActivity {
/**
* Method to create the a case activity for a status change
* Method to create the a case activity for a study status change
*
* @param $caseIds
*/
public static function addStatusChangeActivities($type, $newStatusLabel, $caseIds) {
switch ($type) {
case 'study':
$activityTypeId = CRM_Nihrbackbone_BackboneConfig::singleton()->getChangedStudyStatusActivityTypeId();
$optionGroupId = CRM_Nihrbackbone_BackboneConfig::singleton()->getStudyParticipationStatusOptionGroupId();
break;
case 'project':
$activityTypeId = CRM_Nihrbackbone_BackboneConfig::singleton()->getChangeProjectStatusActivityTypeId();
$optionGroupId = CRM_Nihrbackbone_BackboneConfig::singleton()->getProjectParticipationStatusOptionGroupId();
break;
default:
$activityTypeId = NULL;
$optionGroupId = NULL;
}
public static function addStatusChangeActivities($newStatusLabel, $caseIds) {
$activityTypeId = CRM_Nihrbackbone_BackboneConfig::singleton()->getChangedStudyStatusActivityTypeId();
$optionGroupId = CRM_Nihrbackbone_BackboneConfig::singleton()->getStudyParticipationStatusOptionGroupId();
foreach ($caseIds as $caseId => $caseStatus) {
if ($activityTypeId) {
$currentStatusLabel = CRM_Nihrbackbone_Utils::getOptionValueLabel($caseStatus, $optionGroupId);
......
......@@ -99,17 +99,15 @@ class CRM_Nbrprojectvolunteerlist_Form_Search_VolunteerList extends CRM_Contact_
// return by reference
$columns = [
E::ts('Name') => 'sort_name',
E::ts('Bioresource ID') => 'nva_bioresource_id',
E::ts('Participant ID') => 'nva_participant_id',
E::ts('Study/Part ID') => 'nvpd_study_participant_id',
E::ts('Gender') => 'gender',
E::ts('Gndr') => 'gender',
E::ts('Age') => 'birth_date',
E::ts('Ethnicity') => 'ethnicity',
E::ts('Location') => 'volunteer_address',
E::ts('Ethn.') => 'ethnicity',
E::ts('Loc.') => 'volunteer_address',
E::ts('Eligibility') => 'nvpd_eligible_status_id',
E::ts('Recall Group') => 'nvpd_recall_group',
E::ts('Study Status') => 'study_status',
E::ts('Invite Date') => 'nvpd_date_invited',
E::ts('Status') => 'study_status',
E::ts('Inv. Date') => 'nvpd_date_invited',
E::ts('Distance') => 'nvpd_distance_volunteer_to_study_centre',
];
return $columns;
......@@ -140,14 +138,12 @@ class CRM_Nbrprojectvolunteerlist_Form_Search_VolunteerList extends CRM_Contact_
$studyParticipantIDColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participant_id', 'column_name');
$dateInvitedColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_date_invited', 'column_name');
$distanceColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_distance_volunteer_to_study_centre', 'column_name');
$bioresourceIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_bioresource_id', 'column_name');
$participantIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_participant_id', 'column_name');
$recallColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_recall_group', 'column_name');
return "
DISTINCT(contact_a.id) AS contact_id, contact_a.sort_name, contact_a.birth_date, genderov.label AS gender,
ethnicov.label AS ethnicity, adr.city AS volunteer_address, nvpd." . $eligibleColumn . ", nvpd.". $studyParticipantIDColumn
. ", nvpd." . $recallColumn . ", stustatus.label AS study_status, nvpd."
. $dateInvitedColumn . ", nvpd." . $distanceColumn .", nvi." . $bioresourceIdColumn . ", nvi." . $participantIdColumn;
. $dateInvitedColumn . ", nvpd." . $distanceColumn;
}
/**
......@@ -310,6 +306,15 @@ class CRM_Nbrprojectvolunteerlist_Form_Search_VolunteerList extends CRM_Contact_
$row[$fieldName] = implode(', ', CRM_Nihrbackbone_NbrVolunteerCase::getEligibleDescriptions($row[$fieldName]));
}
break;
case 'gender':
$row['gender'] = substr($row['gender'],0,1);
break;
case 'ethnicity':
$parts = explode('(', $row['ethnicity']);
$row['ethnicity'] = trim($parts[0]);
break;
}
}
}
......
......@@ -3,17 +3,17 @@
use CRM_Nbrprojectvolunteerlist_ExtensionUtil as E;
/**
* Class to process the change status on project for volunteer
* Class to process the change status on study for volunteer
*
* @author Erik Hommel (CiviCooP) <erik.hommel@civicoop.org>
* @date 6 Nov 2019
* @license AGPL-3.0
*/
class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus extends CRM_Contact_Form_Task {
class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeStudyStatus extends CRM_Contact_Form_Task {
private $_countSelected = NULL;
private $_selected = [];
private $_projectId = NULL;
private $_studyId = NULL;
/**
* Method to get the data for the selected contact IDs
......@@ -21,28 +21,23 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus extends CRM_Cont
*/
private function getSelectedData() {
$this->_selected = [];
$nviTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomGroup('table_name');
$studyParticipantColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participant_id', 'column_name');
$eligiblesColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_eligible_status_id', 'column_name');
$projectColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_id', 'column_name');
$statusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_participation_status', 'column_name');
$studyColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_id', 'column_name');
$statusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participation_status', 'column_name');
$participantTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationDataCustomGroup('table_name');
$ovpsOptionGroupId = CRM_Nihrbackbone_BackboneConfig::singleton()->getProjectParticipationStatusOptionGroupId();
$bioresourceIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_bioresource_id', 'column_name');
$participantIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_participant_id', 'column_name');
$ovsOptionGroupId = CRM_Nihrbackbone_BackboneConfig::singleton()->getStudyParticipationStatusOptionGroupId();
$query = "
SELECT vol.id AS contact_id, vol.display_name, cvnpd." . $studyParticipantColumn . " AS study_participant_id,
cvnpd." . $eligiblesColumn . " AS eligible_status_id, ovps.label AS project_status, nvi." . $bioresourceIdColumn
. " AS bioresource_id, nvi." . $participantIdColumn. " AS participant_id
SELECT vol.id AS contact_id, vol.display_name, cvnpd." . $studyParticipantColumn . " AS study_participant_id,
cvnpd." . $eligiblesColumn . " AS eligible_status_id, ovs.label AS study_status
FROM " . $participantTable . " AS cvnpd
JOIN civicrm_case_contact AS ccc ON cvnpd.entity_id = ccc.case_id
JOIN civicrm_case AS cas ON ccc.case_id = cas.id
JOIN civicrm_contact AS vol ON ccc.contact_id = vol.id
LEFT JOIN " . $nviTable . " AS nvi ON ccc.contact_id = nvi.entity_id
LEFT JOIN civicrm_option_value AS ovps ON cvnpd." . $statusColumn. " = ovps.value AND ovps.option_group_id = " . $ovpsOptionGroupId . "
WHERE cvnpd." . $projectColumn. " = %1 AND cas.is_deleted = %2 AND vol.id IN (";
LEFT JOIN civicrm_option_value AS ovs ON cvnpd." . $statusColumn. " = ovs.value AND ovs.option_group_id = " . $ovsOptionGroupId . "
WHERE cvnpd." . $studyColumn. " = %1 AND cas.is_deleted = %2 AND vol.id IN (";
$queryParams = [
1 => [(int)$this->_projectId, "Integer"],
1 => [(int)$this->_studyId, "Integer"],
2 => [0, "Integer"],
];
$i = 2;
......@@ -57,10 +52,8 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus extends CRM_Cont
while ($dao->fetch()) {
$volunteer = [
'display_name' => $dao->display_name,
'bioresource_id' => $dao->bioresource_id,
'participant_id' => $dao->participant_id,
'study_participant_id' => $dao->study_participant_id,
'project_status' => $dao->project_status,
'study_status' => $dao->study_status,
];
$eligibleStatus = implode(', ', CRM_Nihrbackbone_NbrVolunteerCase::getEligibleDescriptions($dao->eligible_status_id));
if (!empty($eligibleStatus)) {
......@@ -77,60 +70,37 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus extends CRM_Cont
* Overridden parent method om formulier op te bouwen
*/
public function buildQuickForm() {
if (isset(self::$_searchFormValues['project_id'])) {
$this->_projectId = self::$_searchFormValues['project_id'];
if (isset(self::$_searchFormValues['study_id'])) {
$this->_studyId = self::$_searchFormValues['study_id'];
}
$this->add('select', 'nbr_project_status_id', E::ts('Change status on project to'), $this->getProjectStatusList(),
$this->add('select', 'nbr_study_status_id', E::ts('Change status on study to'), CRM_Nihrbackbone_Utils::getOptionValueList('nbr_study_participation_status'),
TRUE, ['class' => 'crm-select2']);
$this->assign('status_txt', E::ts('New status for selected volunteers:'));
$this->assign('selected_txt', E::ts('Volunteers for which the status will be changed:'));
$this->assign('count_selected_txt', E::ts('Number of volunteers whose status will be changed: ') . $this->_countSelected);
$this->getSelectedData();
$this->assign('selected', $this->_selected);
$this->addDefaultButtons(ts('Change Project Status'));
}
/**
* Method to get all potential project statuses
*
* @return array
*/
private function getProjectStatusList() {
$status = [];
try {
$result = civicrm_api3('OptionValue', 'get', [
'return' => ["label", "value"],
'option_group_id' => "nbr_project_participation_status",
'options' => ['limit' => 0],
'is_active' => 1,
]);
foreach ($result['values'] as $optionValueId => $optionValue) {
$status[$optionValue['value']] = $optionValue['label'];
}
}
catch (CiviCRM_API3_Exception $ex) {
}
return $status;
$this->addDefaultButtons(ts('Change Study Status'));
}
/**
* Overridden parent method
*/
public function postProcess() {
if (isset($this->_submitValues['nbr_project_status_id'])) {
$statusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_participation_status', 'column_name');
if (isset($this->_submitValues['nbr_study_status_id'])) {
$statusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participation_status', 'column_name');
$updateParams = [];
$update = "";
$caseIds = $this->getRelevantCaseIds();
$elements = CRM_Nbrprojectvolunteerlist_Utils::setUpdateParams($caseIds, $statusColumn, $this->_submitValues['nbr_project_status_id'], $updateParams, $update);
$elements = CRM_Nbrprojectvolunteerlist_Utils::setUpdateParams($caseIds, $statusColumn, $this->_submitValues['nbr_study_status_id'], $updateParams, $update);
if (!empty($elements)) {
$update .= implode(',', $elements) . ")";
CRM_Core_DAO::executeQuery($update, $updateParams);
$newStatusLabel = CRM_Nihrbackbone_Utils::getOptionValueLabel($this->_submitValues['nbr_project_status_id'], CRM_Nihrbackbone_BackboneConfig::singleton()->getProjectParticipationStatusOptionGroupId());
CRM_Nbrprojectvolunteerlist_CaseActivity::addStatusChangeActivities('project', $newStatusLabel, $caseIds);
CRM_Core_Session::setStatus(E::ts('Updated status of selected volunteers on project ') . $this->_projectId
. E::ts(' to ' . CRM_Nihrbackbone_Utils::getOptionValueLabel($this->_submitValues['nbr_project_status_id'],
CRM_Nihrbackbone_BackboneConfig::singleton()->getProjectParticipationStatusOptionGroupId())), E::ts('Successfully changed status on project'), 'success');
$newStatusLabel = CRM_Nihrbackbone_Utils::getOptionValueLabel($this->_submitValues['nbr_study_status_id'], CRM_Nihrbackbone_BackboneConfig::singleton()->getStudyParticipationStatusOptionGroupId());
CRM_Nbrprojectvolunteerlist_CaseActivity::addStatusChangeActivities($newStatusLabel, $caseIds);
CRM_Core_Session::setStatus(E::ts('Updated status of selected volunteers on study ') . CRM_Nihrbackbone_NbrStudy::getStudyNumberWithId($this->_studyId)
. E::ts(' to ' . CRM_Nihrbackbone_Utils::getOptionValueLabel($this->_submitValues['nbr_study_status_id'],
CRM_Nihrbackbone_BackboneConfig::singleton()->getStudyParticipationStatusOptionGroupId())), E::ts('Successfully changed status on study'), 'success');
}
}
}
......@@ -143,19 +113,19 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus extends CRM_Cont
private function getRelevantCaseIds() {
$caseIds = [];
$participationTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationDataCustomGroup('table_name');
$projectStatusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_participation_status', 'column_name');
$projectColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_id', 'column_name');
$query = "SELECT ccc.case_id, cvnpd. " . $projectStatusColumn . " AS project_status_id
$studyStatusColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participation_status', 'column_name');
$studyColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_id', 'column_name');
$query = "SELECT ccc.case_id, cvnpd. " . $studyStatusColumn . " AS study_status_id
FROM " . $participationTable. " AS cvnpd
LEFT JOIN civicrm_case_contact AS ccc ON cvnpd.entity_id = ccc.case_id
WHERE cvnpd." . $projectColumn . " = %1 AND ccc.contact_id IN (";
$queryParams = [1 => [$this->_projectId, "Integer"]];
WHERE cvnpd." . $studyColumn . " = %1 AND ccc.contact_id IN (";
$queryParams = [1 => [$this->_studyId, "Integer"]];
$i = 1;
$elements = CRM_Nbrprojectvolunteerlist_Utils::processContactQueryElements($this->_contactIds, $i, $queryParams);
$query .= implode("," , $elements) . ")";
$dao = CRM_Core_DAO::executeQuery($query, $queryParams);
while ($dao->fetch()) {
$caseIds[$dao->case_id] = $dao->project_status_id;
$caseIds[$dao->case_id] = $dao->study_status_id;
}
return $caseIds;
}
......
......@@ -15,7 +15,7 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
private $_countInvalid = NULL;
private $_invited = [];
private $_invalids = [];
private $_projectId = NULL;
private $_studyId = NULL;
/**
* Method to get the invited data for the selected contact IDs
......@@ -28,25 +28,21 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
$this->_countInvalid = 0;
$studyParticipantColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participant_id', 'column_name');
$eligiblesColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_eligible_status_id', 'column_name');
$projectColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_id', 'column_name');
$studyColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_id', 'column_name');
$participantTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationDataCustomGroup('table_name');
$bioresourceIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_bioresource_id', 'column_name');
$participantIdColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomField('nva_participant_id', 'column_name');
$nviTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getVolunteerIdsCustomGroup('table_name');
$query = "
SELECT vol.id AS contact_id, vol.display_name, nvi." . $bioresourceIdColumn . " AS bioresource_id,
nvi." . $participantIdColumn . " AS participant_id, cvnpd." . $studyParticipantColumn . " AS study_participant_id, cvnpd. "
. $eligiblesColumn. " AS eligible_status_id, ce.email
SELECT vol.id AS contact_id, vol.display_name, cvnpd." . $studyParticipantColumn
. " AS study_participant_id, cvnpd." . $eligiblesColumn. " AS eligible_status_id,
ce.email
FROM " . $participantTable . " AS cvnpd
JOIN civicrm_case_contact AS ccc ON cvnpd.entity_id = ccc.case_id
JOIN civicrm_case AS cas ON ccc.case_id = cas.id
JOIN civicrm_contact AS vol ON ccc.contact_id = vol.id
LEFT JOIN civicrm_email AS ce ON vol.id = ce.contact_id AND ce.is_primary = %1
LEFT JOIN " . $nviTable . " AS nvi ON vol.id = nvi.entity_id
WHERE cvnpd." . $projectColumn . " = %2 AND cas.is_deleted = %3 AND vol.id IN (";
WHERE cvnpd." . $studyColumn . " = %2 AND cas.is_deleted = %3 AND vol.id IN (";
$queryParams = [
1 => [1, "Integer"],
2 => [(int)$this->_projectId, "Integer"],
2 => [(int)$this->_studyId, "Integer"],
3 => [0, "Integer"],
];
$i = 3;
......@@ -61,8 +57,6 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
while ($dao->fetch()) {
$volunteer = [
'display_name' => $dao->display_name,
'bioresource_id' => $dao->bioresource_id,
'participant_id' => $dao->participant_id,
'study_participant_id' => $dao->study_participant_id,
'email' => $dao->email,
];
......@@ -89,8 +83,8 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
* Overridden parent method om formulier op te bouwen
*/
public function buildQuickForm() {
if (isset(self::$_searchFormValues['project_id'])) {
$this->_projectId = self::$_searchFormValues['project_id'];
if (isset(self::$_searchFormValues['study_id'])) {
$this->_studyId = self::$_searchFormValues['study_id'];
}
$this->add('select', 'template_id', E::ts('Message template for email'), $this->getTemplateList(),
TRUE, ['class' => 'crm-select2']);
......@@ -133,7 +127,7 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
*/
public function postProcess() {
// only if we have a project, contactIds and a template
if (isset($this->_projectId) && !empty($this->_contactIds) && !empty($this->_submitValues['template_id'])) {
if (isset($this->_studyId) && !empty($this->_contactIds) && !empty($this->_submitValues['template_id'])) {
// first find all relevant cases
$caseIds = $this->getRelevantCaseIds();
// then send email (include case_id so the activity is recorded) and add an invited activity
......@@ -145,17 +139,17 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
'case_id' => $caseId,
]);
// now add the invite activity
CRM_Nihrbackbone_NbrVolunteerCase::addInviteActivity($caseId, $contactId, $this->_projectId);
// change status on project to invited
$statusCustomField = "custom_" . CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_participation_status', 'id');
CRM_Nihrbackbone_NbrVolunteerCase::addInviteActivity($caseId, $contactId, $this->_studyId);
// change status on study to invited
$statusCustomField = "custom_" . CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_participation_status', 'id');
civicrm_api3('Case', 'create', [
'contact_id' => $contactId,
'id' => $caseId,
$statusCustomField => "project_participation_status_invited",
$statusCustomField => "study_participation_status_invited",
]);
}
catch (CiviCRM_API3_Exception $ex) {
Civi::log()->warning(E::ts("Could not send invitation to project with ID ") . $this->_projectId
Civi::log()->warning(E::ts("Could not send invitation to study ") . CRM_Nihrbackbone_NbrStudy::getStudyNumberWithId($this->_studyId)
. E::ts(" in ") . __METHOD__ . E::ts(", error from API Email Send: ") . $ex->getMessage());
}
}
......@@ -170,14 +164,14 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
private function getRelevantCaseIds() {
$caseIds = [];
$participationTable = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationDataCustomGroup('table_name');
$projectColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_project_id', 'column_name');
$studyColumn = CRM_Nihrbackbone_BackboneConfig::singleton()->getParticipationCustomField('nvpd_study_id', 'column_name');
$query = "SELECT ccc.case_id, ccc.contact_id
FROM " . $participationTable. " AS cvnpd
LEFT JOIN civicrm_case_contact AS ccc ON cvnpd.entity_id = ccc.case_id
WHERE cvnpd." . $projectColumn . " = %2 AND ccc.contact_id IN (";
WHERE cvnpd." . $studyColumn . " = %2 AND ccc.contact_id IN (";
$queryParams = [
1 => [1, "Integer"],
2 => [$this->_projectId, "Integer"],
2 => [$this->_studyId, "Integer"],
];
$i = 2;
$elements = CRM_Nbrprojectvolunteerlist_Utils::processContactQueryElements($this->_contactIds, $i, $queryParams);
......
......@@ -86,7 +86,7 @@ class CRM_Nbrprojectvolunteerlist_SearchTasks {
}
}
// if one of specific actions, return TRUE
$taskClasses = ['InviteByEmail', 'InviteByPdf', 'ChangeProjectStatus'];
$taskClasses = ['InviteByEmail', 'InviteByPdf', 'ChangeStudyStatus'];
foreach ($taskClasses as $taskClass) {
$checkDisplay = CRM_Utils_Request::retrieveValue('_qf_' . $taskClass . '_display', 'String');
$checkNext = CRM_Utils_Request::retrieveValue('_qf_' . $taskClass . '_next', 'String');
......@@ -114,8 +114,8 @@ class CRM_Nbrprojectvolunteerlist_SearchTasks {
'class' => "CRM_Nbrprojectvolunteerlist_Form_Task_InviteByPdf",
],
[
'title' => "Change Status on Project for Volunteer(s)",
'class' => "CRM_Nbrprojectvolunteerlist_Form_Task_ChangeProjectStatus",
'title' => "Change Status on Study for Volunteer(s)",
'class' => "CRM_Nbrprojectvolunteerlist_Form_Task_ChangeStudyStatus",
],
];
foreach ($nbrTasks as $nbrTask) {
......
......@@ -14,8 +14,8 @@
<url desc="Support">https://civicoop.org</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-15</releaseDate>
<version>1.4</version>
<releaseDate>2020-02-26</releaseDate>
<version>1.5</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.7</ver>
......
{*
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{* Default template custom searches. This template is used automatically if templateFile() function not defined in
custom search .php file. If you want a different layout, clone and customize this file and point to new file using
templateFile() function.*}
<div class="crm-block crm-form-block crm-contact-custom-search-form-block">
<div class="crm-accordion-wrapper crm-custom_search_form-accordion {if $rows}collapsed{/if}">
<div class="crm-accordion-header crm-master-accordion-header">
{ts}Edit pipo Criteria{/ts}
</div><!-- /.crm-accordion-header -->
<div class="crm-accordion-body">
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
{* Loop through all defined search criteria fields (defined in the buildForm() function). *}
{foreach from=$elements item=element}
<tr class="crm-contact-custom-search-form-row-{$element}">
<td class="label">{$form.$element.label}</td>
<td>{$form.$element.html}</td>
</tr>
{/foreach}
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
</div><!-- /.crm-form-block -->
{if $rowsEmpty || $rows}
<div class="crm-content-block">
{if $rowsEmpty}
{include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
{/if}
{if $summary}
{$summary.summary}: {$summary.total}
{/if}
{if $rows}
<div class="crm-results-block">
{* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
{* This section handles form elements for action task select and submit *}
<div class="crm-search-tasks">
{include file="CRM/Contact/Form/Search/ResultTasks.tpl"}
</div>
{* This section displays the rows along and includes the paging controls *}
<div class="crm-search-results">
{include file="CRM/common/pager.tpl" location="top"}
{* Include alpha pager if defined. *}
{if $atoZ}
{include file="CRM/common/pagerAToZ.tpl"}
{/if}
{strip}
<table class="selector row-highlight" summary="{ts}Search results listings.{/ts}">
<thead class="sticky">
<tr>
<th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th>
{foreach from=$columnHeaders item=header}
<th scope="col">
{if $header.sort}
{assign var='key' value=$header.sort}
{$sort->_response.$key.link}
{else}
{$header.name}
{/if}
</th>
{/foreach}
<th>&nbsp;</th>
</tr>
</thead>
{counter start=0 skip=1 print=false}
{foreach from=$rows item=row}
<tr id='rowid{$row.contact_id}' class="{cycle values="odd-row,even-row"}">
{assign var=cbName value=$row.checkbox}
<td>{$form.$cbName.html}</td>
{foreach from=$columnHeaders item=header}
{assign var=fName value=$header.sort}
{if $fName eq 'sort_name'}
<td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`&context=custom"}">{$row.sort_name}</a></td>
{else}
<td>{$row.$fName}</td>
{/if}
{/foreach}
<td>{$row.action}</td>
</tr>
{/foreach}
</table>
{/strip}
{include file="CRM/common/pager.tpl" location="bottom"}
</p>
{* END Actions/Results section *}
</div>
</div>
{/if}
</div>
{/if}
{* Confirm contacts and change project status *}
<h2>{ts}Change Project Status{/ts}</h2>
{* Confirm contacts and change study status *}
<h2>{ts}Change Study Status{/ts}</h2>
<div class="messages status no-popup">
<div class="crm-form-block">
<h3>{$status_txt}</h3>
<div class="crm-section">
<div class="label">{$form.nbr_project_status_id.label}</div>
<div class="content">{$form.nbr_project_status_id.html}</div>
<div class="label">{$form.nbr_study_status_id.label}</div>
<div class="content">{$form.nbr_study_status_id.html}</div>
<div class="clear"></div>
</div>
</div>
......@@ -14,20 +14,16 @@
<table>
<tr>
<th>{ts}Name{/ts}</th>
<th>{ts}BioResource ID{/ts}</th>
<th>{ts}Participant ID{/ts}</th>
<th>{ts}Study/Participant ID{/ts}</th>
<th>{ts}Eligibility{/ts}</th>
<th>{ts}Current Project Status{/ts}</th>
<th>{ts}Current Study Status{/ts}</th>
</tr>
{foreach from=$selected key=contact_id item=volunteer}
<tr id='contactid{$contact_id}' class="{cycle values="odd-row,even-row"}">
<td>{$volunteer.display_name}</td>
<td>{$volunteer.bioresource_id}</td>
<td>{$volunteer.participant_id}</td>
<td>{$volunteer.study_participant_id}</td>
<td>{$volunteer.eligible_status}</td>
<td>{$volunteer.project_status}</td>
<td>{$volunteer.study_status}</td>
</tr>
{/foreach}
</table>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment