Exemplo n.º 1
0
 public function UpdateLocalPeople()
 {
     foreach ($this->arrPeople as $intKey => $arrResult) {
         // Get the Fields
         $intUserAccountControl = intval($arrResult['useraccountcontrol'][0]);
         $blnActive = !($intUserAccountControl & 2);
         $strUsername = strtolower($arrResult['samaccountname'][0]);
         $strFirstName = $arrResult['givenname'][0];
         $strMiddleInitial = array_key_exists('initials', $arrResult) ? $arrResult['initials'][0] : null;
         $strLastName = array_key_exists('sn', $arrResult) ? $arrResult['sn'][0] : null;
         $strEmail = strtolower(trim(array_key_exists('mail', $arrResult) ? strtolower($arrResult['mail'][0]) : null));
         $strPasswordLastSet = $arrResult['pwdlastset'][0];
         // Set/Update Login Record
         $objLogin = Login::LoadByUsername($strUsername);
         if (!$objLogin) {
             $objLogin = new Login();
             $objLogin->Username = $strUsername;
             if (array_key_exists($strUsername, self::$ChmsAdminArray)) {
                 $objLogin->RoleTypeId = RoleType::ChMSAdministrator;
             } else {
                 $objLogin->RoleTypeId = RoleType::StaffMember;
             }
             if (!$blnActive) {
                 $objLogin->LoginActiveFlag = false;
                 $objLogin->DomainActiveFlag = false;
             } else {
                 $objLogin->LoginActiveFlag = true;
             }
         }
         $objLogin->DomainActiveFlag = $blnActive;
         // Update the PWD Last Set and clear the cache (if applicable)
         if ($objLogin->PasswordLastSet != $strPasswordLastSet) {
             $objLogin->PasswordLastSet = $strPasswordLastSet;
             $objLogin->PasswordCache = null;
         }
         if ($strEmail && strpos($strEmail, '@alcf.net') !== false) {
             $objLoginToCheck = Login::LoadByEmail($strEmail);
             if ($objLoginToCheck && $objLoginToCheck->Id != $objLogin->Id) {
                 throw new Exception('Duplicate Email "' . $strEmail . '" Found while processing ldap user "' . $strUsername . '" -- duplicate is ' . $objLoginToCheck->Username);
             }
             $objLogin->Email = $strEmail;
         } else {
             $objLogin->LoginActiveFlag = false;
             $objLogin->Email = null;
         }
         $objLogin->FirstName = $strFirstName;
         $objLogin->MiddleInitial = $strMiddleInitial;
         $objLogin->LastName = $strLastName;
         // Shortcut
         if ($objLogin->Username == 'mho') {
             $objLogin->PermissionBitmap = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024;
         }
         $objLogin->Save();
         // Group Memberships
         $objLogin->UnassociateAllMinistries();
         if (array_key_exists('memberof', $arrResult)) {
             unset($arrResult['memberof']['count']);
             foreach ($arrResult['memberof'] as $strPath) {
                 $strArray = AlcfLdap::GetValuesFromPath($strPath);
                 $strCn = $strArray['CN'][0];
                 if (substr($strCn, 0, 3) == 'gg_') {
                     $strGroupToken = strtolower(substr($strCn, 3));
                     $objMinistry = Ministry::LoadByToken($strGroupToken);
                     if ($objMinistry) {
                         $objMinistry->AssociateLogin($objLogin);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 protected function Form_Create()
 {
     $this->lblLabel = new QLabel($this);
     $this->lblLabel->HtmlEntities = false;
     $this->lblLabel->Text = "<h2>Generate Volunteers Report for: </h2>";
     $this->btnGenerateReport = new QButton($this);
     $this->btnGenerateReport->Text = "Generate Report";
     $this->btnGenerateReport->CssClass = "primary";
     $this->btnGenerateReport->AddAction(new QClickEvent(), new QAjaxAction('generateReport_Click'));
     $afterArray = explode(",", QApplication::PathInfo(1));
     $this->lstAfterMonth = new QListBox($this);
     $this->lstAfterMonth->AddItem('Jan', 'Jan');
     $this->lstAfterMonth->AddItem('Feb', 'Feb');
     $this->lstAfterMonth->AddItem('Mar', 'Mar');
     $this->lstAfterMonth->AddItem('Apr', 'Apr');
     $this->lstAfterMonth->AddItem('May', 'May');
     $this->lstAfterMonth->AddItem('Jun', 'Jun');
     $this->lstAfterMonth->AddItem('Jul', 'Jul');
     $this->lstAfterMonth->AddItem('Aug', 'Aug');
     $this->lstAfterMonth->AddItem('Sep', 'Sep');
     $this->lstAfterMonth->AddItem('Oct', 'Oct');
     $this->lstAfterMonth->AddItem('Nov', 'Nov');
     $this->lstAfterMonth->AddItem('Dec', 'Dec');
     if (QApplication::PathInfo(1)) {
         $this->lstAfterMonth->SelectedValue = $afterArray[0];
     }
     $this->lstAfterYear = new QListBox($this);
     $this->lstAfterYear->AddItem('2010', '2010');
     $this->lstAfterYear->AddItem('2011', '2011');
     $this->lstAfterYear->AddItem('2012', '2012');
     $this->lstAfterYear->AddItem('2013', '2013');
     $this->lstAfterYear->AddItem('2014', '2014');
     if (QApplication::PathInfo(1)) {
         $this->lstAfterYear->SelectedValue = $afterArray[1];
     }
     $beforeArray = explode(",", QApplication::PathInfo(0));
     $this->lstBeforeMonth = new QListBox($this);
     $this->lstBeforeMonth->AddItem('Jan', 'Jan');
     $this->lstBeforeMonth->AddItem('Feb', 'Feb');
     $this->lstBeforeMonth->AddItem('Mar', 'Mar');
     $this->lstBeforeMonth->AddItem('Apr', 'Apr');
     $this->lstBeforeMonth->AddItem('May', 'May');
     $this->lstBeforeMonth->AddItem('Jun', 'Jun');
     $this->lstBeforeMonth->AddItem('Jul', 'Jul');
     $this->lstBeforeMonth->AddItem('Aug', 'Aug');
     $this->lstBeforeMonth->AddItem('Sep', 'Sep');
     $this->lstBeforeMonth->AddItem('Oct', 'Oct');
     $this->lstBeforeMonth->AddItem('Nov', 'Nov');
     $this->lstBeforeMonth->AddItem('Dec', 'Dec');
     if (QApplication::PathInfo(0)) {
         $this->lstBeforeMonth->SelectedValue = $beforeArray[0];
     }
     $this->lstBeforeYear = new QListBox($this);
     $this->lstBeforeYear->AddItem('2010', '2010');
     $this->lstBeforeYear->AddItem('2011', '2011');
     $this->lstBeforeYear->AddItem('2012', '2012');
     $this->lstBeforeYear->AddItem('2013', '2013');
     $this->lstBeforeYear->AddItem('2014', '2014');
     if (QApplication::PathInfo(0)) {
         $this->lstBeforeYear->SelectedValue = $beforeArray[1];
     }
     $this->lstMinistryDepartments = new QListBox($this);
     QApplication::PathInfo(2) == 'Select' ? $this->lstMinistryDepartments->AddItem('-- Select A Department Or Ministry --', 'Select', true) : $this->lstMinistryDepartments->AddItem('-- Select A Department Or Ministry --', 'Select');
     QApplication::PathInfo(2) == 'All' ? $this->lstMinistryDepartments->AddItem('All', 'All', true) : $this->lstMinistryDepartments->AddItem('All', 'All');
     QApplication::PathInfo(2) == 'OutreachEvangelismCare' ? $this->lstMinistryDepartments->AddItem('Department: Outreach, Evangelism, and Care', 'OutreachEvangelismCare', true) : $this->lstMinistryDepartments->AddItem('Department: Outreach, Evangelism, and Care', 'OutreachEvangelismCare');
     QApplication::PathInfo(2) == 'AdministrativeOperations' ? $this->lstMinistryDepartments->AddItem('Department: Administrative Operations', 'AdministrativeOperations', true) : $this->lstMinistryDepartments->AddItem('Department: Administrative Operations', 'AdministrativeOperations');
     QApplication::PathInfo(2) == 'Discipleship' ? $this->lstMinistryDepartments->AddItem('Department: Discipleship', 'Discipleship', true) : $this->lstMinistryDepartments->AddItem('Department: Discipleship', 'Discipleship');
     QApplication::PathInfo(2) == 'MinistryOperations' ? $this->lstMinistryDepartments->AddItem('Department: Ministry Operations', 'MinistryOperations', true) : $this->lstMinistryDepartments->AddItem('Department: Ministry Operations', 'MinistryOperations');
     QApplication::PathInfo(2) == 'WorshipArts' ? $this->lstMinistryDepartments->AddItem('Department: Worship Arts', 'WorshipArts', true) : $this->lstMinistryDepartments->AddItem('Department: Worship Arts', 'WorshipArts');
     QApplication::PathInfo(2) == 'WorshipService' ? $this->lstMinistryDepartments->AddItem('Department: Worship Service', 'WorshipService', true) : $this->lstMinistryDepartments->AddItem('Department: Worship Service', 'WorshipService');
     foreach (Ministry::LoadAll() as $objMinistry) {
         QApplication::PathInfo(2) == $objMinistry->Token ? $this->lstMinistryDepartments->AddItem('Ministry: ' . $objMinistry->Name, $objMinistry->Token, true) : $this->lstMinistryDepartments->AddItem('Ministry: ' . $objMinistry->Name, $objMinistry->Token);
     }
     // May or may not display a table
     $this->dtgVolunteers = new QDataGrid($this);
     $this->dtgVolunteers->AddColumn(new QDataGridColumn('Month and Year', '<?= $_ITEM->month; ?>', 'Width=270px'));
     $this->dtgVolunteers->AddColumn(new QDataGridColumn('# of Volunteers', '<?= $_ITEM->count; ?>', 'Width=270px'));
     // Extract information based off the selections
     if ($this->lstAfterMonth->SelectedValue && $this->lstAfterYear->SelectedValue && $this->lstBeforeMonth->SelectedValue && $this->lstBeforeYear->SelectedValue) {
         $this->startDate = new QDateTime($this->lstAfterMonth->SelectedIndex + 1 . '/1/' . $this->lstAfterYear->SelectedValue);
         $this->endDate = new QDateTime($this->lstBeforeMonth->SelectedIndex + 1 . '/1/' . $this->lstBeforeYear->SelectedValue);
         // Initialize output values
         $this->objPersonArray = array();
         $this->monthCount = array();
         $this->tempDate = new QDateTime($this->lstAfterMonth->SelectedIndex + 1 . '/1/' . $this->lstAfterYear->SelectedValue);
         while ($this->tempDate->IsEarlierOrEqualTo($this->endDate)) {
             $this->monthCount[$this->tempDate->__toString('MMM YYYY')] = 0;
             $this->objPersonArray[$this->tempDate->__toString('MMM YYYY')] = array();
             $this->tempDate->AddMonths(1);
         }
         // Figure out which groups to search first.
         /*
         +----+------------------+----------------------------+
         | id | token            | name                       |
         +----+------------------+----------------------------+
         |  1 | bc               | Biblical Counseling        |
         |  2 | hr               | HR                         |
         |  3 | appurch          | AP/Purchasing              |
         |  4 | busops           | Business Operations        |
         |  5 | finance          | Finance                    |
         |  6 | officemanagement | Office Management          |
         |  7 | et               | ETM                        |
         |  8 | evangoutreach    | Evangelism and Outreach    |
         |  9 | events           | Events                     |
         | 10 | family           | Family Ministry            |
         | 11 | ibs              | IBS                        |
         | 12 | music            | Music                      |
         | 13 | pp               | Pastor Paul                |
         | 14 | volunteers       | Volunteers                 |
         | 15 | worshiparts      | Worship Arts               |
         | 16 | facilities       | Facilities                 |
         | 17 | growth           | Growth Groups              |
         | 18 | it               | IT                         |
         | 19 | mc               | Member Care                |
         | 20 | mit              | Ministry Involvement       |
         | 21 | prayer           | Prayer and Visitation      |
         | 22 | safari           | Safari Kids                |
         | 23 | services         | Worship Service Ministries |
         | 24 | videoprod        | Video Production           |
         | 25 | website          | Website                    |
         | 26 | sp               | Strategic Partnerships     |
         | 27 | comm             | Communications             |
         | 28 | sm               | Student Ministries         |
         | 29 | payroll          | Payroll                    |
         | 30 | mens             | Men's Fellowship           |
         | 31 | yam              | Young Adult Ministry       |
         | 32 | donations        | Donations and Resources    |
         | 33 | womens           | Women's Ministry           |
         | 34 | gmt              | Global Ministry Team       |
         | 35 | pastors          | Pastoral Board             |
         | 36 | recovery         | Recovery                   |
         | 37 | singles          | Singles                    |
         | 38 | seniors          | Seniors                    |
         | 39 | minops           | Ministry Operations        |
         | 40 | stewardship      | Stewardship                |
         +----+------------------+----------------------------+-
         */
         $objGroupCursor = Group::QueryCursor(QQ::In(QQN::Group()->GroupTypeId, array(GroupType::RegularGroup, GroupType::GrowthGroup)));
         while ($objGroup = Group::InstantiateCursor($objGroupCursor)) {
             switch (QApplication::PathInfo(2)) {
                 case 'All':
                     // increment all the appropriate arrays
                     $this->calculateValues($objGroup);
                     break;
                 case 'OutreachEvangelismCare':
                     // Biblical Counseling, Evangelism and Outreach, Global Ministry Team, Prayer and Visitation, Recovery, Strategic Partnerships
                     if ($objGroup->MinistryId == 1 || $objGroup->MinistryId == 8 || $objGroup->MinistryId == 34 || $objGroup->MinistryId == 21 || $objGroup->MinistryId == 36 || $objGroup->MinistryId == 26) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 case 'AdministrativeOperations':
                     // Communications, IT, Stewardship
                     if ($objGroup->MinistryId == 27 || $objGroup->MinistryId == 18 || $objGroup->MinistryId == 40) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 case 'Discipleship':
                     // Family Ministry, Growth Groups, IBS, Men's Fellowship
                     if ($objGroup->MinistryId == 10 || $objGroup->MinistryId == 17 || $objGroup->MinistryId == 11 || $objGroup->MinistryId == 30) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 case 'MinistryOperations':
                     // Member Care, Ministry Involvement, Ministry Operations, Safari Kids, Seniors, Singles, Student Ministries, Women's Ministry, Young Adult Ministry
                     if ($objGroup->MinistryId == 19 || $objGroup->MinistryId == 20 || $objGroup->MinistryId == 39 || $objGroup->MinistryId == 22 || $objGroup->MinistryId == 38 || $objGroup->MinistryId == 37 || $objGroup->MinistryId == 28 || $objGroup->MinistryId == 33 || $objGroup->MinistryId == 31) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 case 'WorshipArts':
                     // Video Production, Worship Arts
                     if ($objGroup->MinistryId == 24 || $objGroup->MinistryId == 15) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 case 'WorshipService':
                     // Worship Service Ministries
                     if ($objGroup->MinistryId == 23) {
                         $this->calculateValues($objGroup);
                     }
                     break;
                 default:
                     $objMinistry = Ministry::LoadByToken(QApplication::PathInfo(2));
                     if ($objMinistry->Token == $objGroup->MinistryId) {
                         // Get all participants in the group
                         $this->calculateValues($objGroup);
                     }
                     break;
             }
         }
         //print "Finished Processing\n";
         /*	foreach($this->monthCount as $key=>$value) {
         				print "In ".$key.' there were '.$value. " unique volunteers\n";
         				}
         			*/
         /*	foreach($objPersonArray as $key=>$value) {
         			print "In ".$key.' there were '.count($value). " unique volunteers\n";
         			}
         			*/
         $chartArray = array();
         foreach ($this->monthCount as $key => $value) {
             $objItem = new volunteerArray();
             $objItem->month = $key;
             $objItem->count = $value;
             $chartArray[] = $objItem;
         }
         QApplication::ExecuteJavaScript('initializeChart(' . json_encode($chartArray) . ');');
         $this->dtgVolunteers->DataSource = $chartArray;
     }
 }
Exemplo n.º 3
0
<?php

$objParameters = new QCliParameterProcessor('growth-group-import', 'ALCF Growth Group Importer Script');
$objParameters->AddDefaultParameter('server', QCliParameterType::String, 'Server/Host of the MySQL Database');
$objParameters->AddDefaultParameter('dbname', QCliParameterType::String, 'Database Name of the MySQL Database');
$objParameters->AddDefaultParameter('username', QCliParameterType::String, 'Username of the MySQL user');
$objParameters->Run();
$objMySqli = new mysqli($objParameters->GetDefaultValue('server'), $objParameters->GetDefaultValue('username'), null, $objParameters->GetDefaultValue('dbname'));
$objMinistry = Ministry::LoadByToken('growth');
if (!$objMinistry) {
    exit('No GG Ministry Found');
}
$objResult = $objMySqli->Query('SELECT * FROM growth_group_structure order by id;');
while ($objRow = $objResult->fetch_array()) {
    $objStructure = new GrowthGroupStructure();
    $objStructure->Name = $objRow['name'];
    $objStructure->Save();
}
$objResult = $objMySqli->Query('SELECT * FROM growth_group_location order by id;');
$objParentGroupArray = array();
while ($objRow = $objResult->fetch_array()) {
    $objGrowthGroupLocation = new GrowthGroupLocation();
    $objGrowthGroupLocation->Location = $objRow['location'];
    $objGrowthGroupLocation->Longitude = $objRow['longitude'];
    $objGrowthGroupLocation->Latitude = $objRow['latitude'];
    $objGrowthGroupLocation->Zoom = $objRow['zoom'];
    $objGrowthGroupLocation->Save();
    $strTokens = explode('(', $objGrowthGroupLocation->Location);
    $objParentGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GroupCategory, trim($strTokens[0]), 'Growth Groups in ' . $objGrowthGroupLocation->Location);
    $objGroupCategory = new GroupCategory();
    $objGroupCategory->Group = $objParentGroup;
Exemplo n.º 4
0
 public function SetUp()
 {
     $this->objMinistry = Ministry::LoadByToken('ert');
     if (!$this->objMinistry) {
         $this->objMinistry = new Ministry();
         $this->objMinistry->Token = 'ert';
     }
     $this->objMinistry->Name = 'Test Ministry';
     $this->objMinistry->ActiveFlag = true;
     $this->objMinistry->Save();
     if ($objGroupRoleArray = $this->objMinistry->GetGroupRoleArray()) {
         $this->objGroupRole = $objGroupRoleArray[0];
     } else {
         $this->objGroupRole = new GroupRole();
         $this->objGroupRole->Ministry = $this->objMinistry;
         $this->objGroupRole->Name = 'ERT';
         $this->objGroupRole->GroupRoleTypeId = GroupRoleType::Participant;
         $this->objGroupRole->Save();
     }
     $this->objLoginLeader = Login::LoadByUsername('ert1');
     if (!$this->objLoginLeader) {
         $this->objLoginLeader = new Login();
         $this->objLoginLeader->Username = '******';
     } else {
         $this->objLoginLeader->UnassociateAllMinistries();
     }
     $this->objLoginLeader->RoleTypeId = RoleType::StaffMember;
     $this->objLoginLeader->Email = '*****@*****.**';
     $this->objLoginLeader->Save();
     $this->objLoginLeader->AssociateMinistry($this->objMinistry);
     $this->objLoginNonLeader = Login::LoadByUsername('ert2');
     if (!$this->objLoginNonLeader) {
         $this->objLoginNonLeader = new Login();
         $this->objLoginNonLeader->Username = '******';
     } else {
         $this->objLoginNonLeader->UnassociateAllMinistries();
     }
     $this->objLoginNonLeader->RoleTypeId = RoleType::StaffMember;
     $this->objLoginNonLeader->Email = '*****@*****.**';
     $this->objLoginNonLeader->Save();
     $this->objPersonArray = array();
     $this->objPersonArray['ert1'] = Person::CreatePerson('Test', 'E', 'User', true, '*****@*****.**', null, null);
     $this->objPersonArray['ert2'] = Person::CreatePerson('Test', 'E', 'User', true, '*****@*****.**', null, null);
     $this->objPersonArray['ert3'] = Person::CreatePerson('Test', 'E', 'User', true, '*****@*****.**', null, null);
     $objPerson = Person::CreatePerson('Test', 'E', 'User', true, null, null, null);
     $objEmail = new Email();
     $objEmail->Address = '*****@*****.**';
     $objEmail->Person = $objPerson;
     $objEmail->Save();
     $this->objPersonArray['ert4'] = $objPerson;
     $objPerson = Person::CreatePerson('Test', 'E', 'User', true, null, null, null);
     $objEmail = new Email();
     $objEmail->Address = '*****@*****.**';
     $objEmail->Person = $objPerson;
     $objEmail->Save();
     $objEmail = new Email();
     $objEmail->Address = '*****@*****.**';
     $objEmail->Person = $objPerson;
     $objEmail->Save();
     $this->objPersonArray['ert5'] = $objPerson;
     $this->objGroup1 = Group::LoadByToken('ert1');
     if (!$this->objGroup1) {
         $this->objGroup1 = new Group();
         $this->objGroup1->Token = 'ert1';
     }
     $this->objGroup1->GroupTypeId = GroupType::RegularGroup;
     $this->objGroup1->Ministry = $this->objMinistry;
     $this->objGroup1->EmailBroadcastTypeId = EmailBroadcastType::PrivateList;
     $this->objGroup1->Name = 'ERT Test Group 1';
     $this->objGroup1->Save();
     $this->objGroup2 = Group::LoadByToken('ert2');
     if (!$this->objGroup2) {
         $this->objGroup2 = new Group();
         $this->objGroup2->Token = 'ert2';
     }
     $this->objGroup2->GroupTypeId = GroupType::RegularGroup;
     $this->objGroup2->Ministry = $this->objMinistry;
     $this->objGroup2->EmailBroadcastTypeId = EmailBroadcastType::AnnouncementOnly;
     $this->objGroup2->Name = 'ERT Test Group 2';
     $this->objGroup2->Save();
     $this->objGroup1->DeleteAllGroupParticipations();
     $this->objGroup2->DeleteAllGroupParticipations();
     $objParticipation = new GroupParticipation();
     $objParticipation->Person = $this->objPersonArray['ert1'];
     $objParticipation->Group = $this->objGroup1;
     $objParticipation->GroupRole = $this->objGroupRole;
     $objParticipation->DateStart = new QDateTime('2005-01-01');
     $objParticipation->Save();
     $objParticipation = new GroupParticipation();
     $objParticipation->Person = $this->objPersonArray['ert1'];
     $objParticipation->Group = $this->objGroup2;
     $objParticipation->GroupRole = $this->objGroupRole;
     $objParticipation->DateStart = new QDateTime('2005-01-01');
     $objParticipation->Save();
 }
 public function __construct($objParentObject, $objRegistrant, $intPersonId, $strMethodCallBack, $strControlId = null)
 {
     // First, let's call the Parent's __constructor
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->strTemplate = dirname(__FILE__) . '/' . get_class($this) . '.tpl.php';
     // Next, we set the local registrant object
     $this->objRegistrant = $objRegistrant;
     $this->intPersonId = $intPersonId;
     $this->strMethodCallBack = $strMethodCallBack;
     $strGroupTypes = '';
     foreach (GrowthGroupStructure::LoadAll() as $objGroupStructure) {
         if ($this->objRegistrant->IsGrowthGroupStructureAsGroupstructureAssociated($objGroupStructure)) {
             $strGroupTypes .= $objGroupStructure->Name . ', ';
         }
     }
     $strGroupTypes = substr($strGroupTypes, 0, strlen($strGroupTypes) - 1);
     $this->lblRegistrantInfo = new QLabel($this);
     $this->lblRegistrantInfo->HtmlEntities = false;
     $this->lblRegistrantInfo->HtmlBefore = 'For: ';
     $this->lblRegistrantInfo->Text = sprintf('%s %s<br>Requested Group Types: %s<br>Requested Days: %s<br>Preferred Locations: %s, %s', $this->objRegistrant->FirstName, $this->objRegistrant->LastName, $strGroupTypes, $this->objRegistrant->GroupDay, $this->objRegistrant->PreferredLocation1, $this->objRegistrant->PreferredLocation2);
     $this->chkLocation = new QCheckBox($this);
     $this->chkLocation->Text = 'Location';
     $this->chkLocation->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkGroupType = new QCheckBox($this);
     $this->chkGroupType->Text = 'Group Type';
     $this->chkGroupType->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkDayOfWeek = new QCheckBox($this);
     $this->chkDayOfWeek->Text = 'Day Of Week';
     $this->chkDayOfWeek->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkAvailability = new QCheckBox($this);
     $this->chkAvailability->Text = 'Availability';
     $this->chkAvailability->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->rbtnSelectArray = array();
     // Now initialize the controls
     $this->dtgGroups = new GrowthGroupDataGrid($this);
     $this->dtgGroups->Paginator = new QPaginator($this->dtgGroups);
     $this->dtgGroups->AddColumn(new QDataGridColumn('', '<?= $_CONTROL->ParentControl->RenderSelectGroup($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Name', '<?= $_CONTROL->ParentControl->RenderName($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Description', '<?= $_CONTROL->ParentControl->RenderDescription($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Type', '<?= $_CONTROL->ParentControl->RenderGroupStructure($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->MetaAddTypeColumn('GrowthGroupDayTypeId', 'GrowthGroupDayType');
     $this->dtgGroups->AddColumn(new QDataGridColumn('Location Region', '<?= $_CONTROL->ParentControl->RenderLocationRegion($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Facilitator', '<?= $_CONTROL->ParentControl->RenderFacilitator($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->NoDataHtml = 'No results found.  Please use a less-restrictive filter.';
     $this->dtgGroups->SetDataBinder('dtgGroups_Bind', $this);
     $this->btnAssign = new QButton($this);
     $this->btnAssign->Text = 'Assign ' . $this->objRegistrant->FirstName . ' ' . $this->objRegistrant->LastName . ' to the selected groups';
     $this->btnAssign->CssClass = 'primary';
     $this->btnAssign->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnAssign_Click'));
     $this->intFacilitatorRoleId = 0;
     $this->intGroupContactRoleId = 0;
     foreach (GroupRole::LoadAll() as $objGroupRole) {
         if ($objGroupRole->Name == 'Facilitator' && $objGroupRole->MinistryId == Ministry::LoadByToken('growth')->Id) {
             $this->intFacilitatorRoleId = $objGroupRole->Id;
         }
         if ($objGroupRole->Name == 'Group Contact' && $objGroupRole->MinistryId == Ministry::LoadByToken('growth')->Id) {
             $this->intGroupContactRoleId = $objGroupRole->Id;
         }
     }
 }
Exemplo n.º 6
0
            }
            break;
        case 'WorshipArts':
            // Video Production, Worship Arts
            if ($objGroup->MinistryId == 24 || $objGroup->MinistryId == 15) {
                calculateValues($objGroup);
            }
            break;
        case 'WorshipService':
            // Worship Service Ministries
            if ($objGroup->MinistryId == 23) {
                calculateValues($objGroup);
            }
            break;
        default:
            $objMinistry = Ministry::LoadByToken($ministrydepartment);
            if ($objMinistry->Token == $objGroup->MinistryId) {
                // Get all participants in the group
                calculateValues($objGroup);
            }
            break;
    }
}
/**************/
// Disable strict no-cache for IE due to IE issues with downloading no-cache items
if (QApplication::IsBrowser(QBrowserType::InternetExplorer)) {
    header("Pragma:");
    header("Expires:");
}
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename=VolunteerReport.csv');