Beispiel #1
0
 protected function Form_Create()
 {
     $this->dtgStaff = new LoginDataGrid($this);
     $this->dtgStaff->FontSize = 11;
     $this->dtgStaff->AddColumn(new QDataGridColumn('View', '<?= $_FORM->RenderView($_ITEM); ?>', 'HtmlEntities=false', 'Width=30px'));
     $this->dtgStaff->MetaAddColumn(QQN::Login()->Username, 'Width=75px');
     $this->dtgStaff->MetaAddColumn(QQN::Login()->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Name; ?>', 'Width=110px');
     $this->dtgStaff->AddColumn(new QDataGridColumn('Acct Disabled', '<?= (!$_ITEM->DomainActiveFlag || !$_ITEM->LoginActiveFlag) ? "Disabled":""; ?>', 'Width=60px'));
     $this->dtgStaff->MetaAddTypeColumn('RoleTypeId', 'RoleType', 'Name=Role', 'Width=120px');
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $this->dtgStaff->AddColumn(new QDataGridColumn('<span style="font-size: 10px;">' . $strName . '</span>', '<?= $_FORM->RenderPermission(' . $intId . ', $_ITEM); ?>', 'Width=50px', 'HtmlEntities=false'));
     }
     $this->dtgStaff->SetDataBinder('dtgStaff_Bind');
     $this->dtgStaff->SortColumnIndex = 1;
     $this->dtgStaff->SortDirection = 0;
     $this->dtgStaff->Paginator = new QPaginator($this->dtgStaff);
     $this->dtgStaff->ItemsPerPage = 100;
     $this->lstActiveFlag = new QListBox($this);
     $this->lstActiveFlag->Name = 'Active';
     $this->lstActiveFlag->AddItem('Active', true, true);
     $this->lstActiveFlag->AddItem('Inactive', false);
     $this->lstActiveFlag->AddAction(new QChangeEvent(), new QAjaxAction('dtgStaff_Refresh'));
     $this->lstMinistry = new QListBox($this);
     $this->lstMinistry->Name = 'Ministry';
     $this->lstMinistry->AddItem('- View All -', null);
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $this->lstMinistry->AddItem($objMinistry->Name, $objMinistry->Id);
     }
     $this->lstMinistry->AddAction(new QChangeEvent(), new QAjaxAction('dtgStaff_Refresh'));
 }
Beispiel #2
0
Datei: add.php Projekt: alcf/chms
 protected function Form_Create()
 {
     // Display: Username
     $this->txtUsername = new QTextBox($this);
     $this->txtUsername->Name = 'Username';
     // Display: First Name
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'First Name';
     // Display: Last Name
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Last Name';
     // Display: Email
     $this->txtEmail = new QTextBox($this);
     $this->txtEmail->Name = 'Email';
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
         $rblMinistry->AddItem('No', 0, true);
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     $this->lstRoleType = new QListBox($this);
     $this->lstRoleType->Name = 'Role';
     foreach (RoleType::$NameArray as $intKey => $strName) {
         $this->lstRoleType->AddItem($strName, $intKey, false);
     }
     $this->rblLoginActive = new QRadioButtonList($this);
     $this->rblLoginActive->Name = 'ChMS Login Enabled';
     $this->rblLoginActive->AddItem('Yes', true, true);
     $this->rblLoginActive->AddItem('No', false, false);
     $this->rblLoginActive->RepeatColumns = 2;
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, false);
         $rblPermission->AddItem('No', 0, true);
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->txtNewPassword = new QTextBox($this);
     $this->txtNewPassword->Name = 'Set Password: '******'Update';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CssClass = 'primary';
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel->CssClass = 'cancel';
 }
Beispiel #3
0
Datei: add.php Projekt: alcf/chms
 protected function Form_Create()
 {
     $this->strFirstName = new QTextBox($this);
     $this->strFirstName->Name = "First Name: ";
     $this->strLastName = new QTextBox($this);
     $this->strLastName->Name = "Last Name: ";
     $this->strEmail = new QEmailTextBox($this);
     $this->strEmail->Name = "Email: ";
     $this->strUserName = new QTextBox($this);
     $this->strUserName->Name = "User Name: ";
     $this->strUserName->Required = true;
     $this->strPassword = new QTextBox($this);
     $this->strPassword->Name = 'Password';
     $this->strPassword->TextMode = QTextMode::Password;
     $this->strPassword->Required = true;
     $this->strPassword->CausesValidation = true;
     $this->lstActiveFlag = new QListBox($this);
     $this->lstActiveFlag->Name = 'Active';
     $this->lstActiveFlag->AddItem('Active', true, true);
     $this->lstActiveFlag->AddItem('Inactive', false);
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
         $rblMinistry->AddItem('No', 0, true);
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, false);
         $rblPermission->AddItem('No', 0, true);
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->btnSubmit = new QButton($this);
     $this->btnSubmit->Text = "Submit";
     $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click'));
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = "Cancel";
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
 }
 /**
  * Refresh this MetaControl with Data from the local StewardshipFund object.
  * @param boolean $blnReload reload StewardshipFund from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objStewardshipFund->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objStewardshipFund->Id;
         }
     }
     if ($this->lstMinistry) {
         $this->lstMinistry->RemoveAllItems();
         $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 if ($this->objStewardshipFund->Ministry && $this->objStewardshipFund->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objStewardshipFund->Ministry ? $this->objStewardshipFund->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objStewardshipFund->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objStewardshipFund->Name;
     }
     if ($this->txtExternalName) {
         $this->txtExternalName->Text = $this->objStewardshipFund->ExternalName;
     }
     if ($this->lblExternalName) {
         $this->lblExternalName->Text = $this->objStewardshipFund->ExternalName;
     }
     if ($this->txtAccountNumber) {
         $this->txtAccountNumber->Text = $this->objStewardshipFund->AccountNumber;
     }
     if ($this->lblAccountNumber) {
         $this->lblAccountNumber->Text = $this->objStewardshipFund->AccountNumber;
     }
     if ($this->txtFundNumber) {
         $this->txtFundNumber->Text = $this->objStewardshipFund->FundNumber;
     }
     if ($this->lblFundNumber) {
         $this->lblFundNumber->Text = $this->objStewardshipFund->FundNumber;
     }
     if ($this->chkActiveFlag) {
         $this->chkActiveFlag->Checked = $this->objStewardshipFund->ActiveFlag;
     }
     if ($this->lblActiveFlag) {
         $this->lblActiveFlag->Text = $this->objStewardshipFund->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->chkExternalFlag) {
         $this->chkExternalFlag->Checked = $this->objStewardshipFund->ExternalFlag;
     }
     if ($this->lblExternalFlag) {
         $this->lblExternalFlag->Text = $this->objStewardshipFund->ExternalFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
 }
 /**
  * Refresh this MetaControl with Data from the local GroupRole object.
  * @param boolean $blnReload reload GroupRole from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objGroupRole->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objGroupRole->Id;
         }
     }
     if ($this->lstMinistry) {
         $this->lstMinistry->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 if ($this->objGroupRole->Ministry && $this->objGroupRole->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objGroupRole->Ministry ? $this->objGroupRole->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objGroupRole->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objGroupRole->Name;
     }
     if ($this->lstGroupRoleType) {
         $this->lstGroupRoleType->SelectedValue = $this->objGroupRole->GroupRoleTypeId;
     }
     if ($this->lblGroupRoleTypeId) {
         $this->lblGroupRoleTypeId->Text = $this->objGroupRole->GroupRoleTypeId ? GroupRoleType::$NameArray[$this->objGroupRole->GroupRoleTypeId] : null;
     }
 }
 /**
  * Refresh this MetaControl with Data from the local SignupForm object.
  * @param boolean $blnReload reload SignupForm from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objSignupForm->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objSignupForm->Id;
         }
     }
     if ($this->lstSignupFormType) {
         $this->lstSignupFormType->SelectedValue = $this->objSignupForm->SignupFormTypeId;
     }
     if ($this->lblSignupFormTypeId) {
         $this->lblSignupFormTypeId->Text = $this->objSignupForm->SignupFormTypeId ? SignupFormType::$NameArray[$this->objSignupForm->SignupFormTypeId] : null;
     }
     if ($this->lstMinistry) {
         $this->lstMinistry->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 if ($this->objSignupForm->Ministry && $this->objSignupForm->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objSignupForm->Ministry ? $this->objSignupForm->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objSignupForm->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objSignupForm->Name;
     }
     if ($this->txtToken) {
         $this->txtToken->Text = $this->objSignupForm->Token;
     }
     if ($this->lblToken) {
         $this->lblToken->Text = $this->objSignupForm->Token;
     }
     if ($this->chkActiveFlag) {
         $this->chkActiveFlag->Checked = $this->objSignupForm->ActiveFlag;
     }
     if ($this->lblActiveFlag) {
         $this->lblActiveFlag->Text = $this->objSignupForm->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->chkConfidentialFlag) {
         $this->chkConfidentialFlag->Checked = $this->objSignupForm->ConfidentialFlag;
     }
     if ($this->lblConfidentialFlag) {
         $this->lblConfidentialFlag->Text = $this->objSignupForm->ConfidentialFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->txtDescription) {
         $this->txtDescription->Text = $this->objSignupForm->Description;
     }
     if ($this->lblDescription) {
         $this->lblDescription->Text = $this->objSignupForm->Description;
     }
     if ($this->txtInformationUrl) {
         $this->txtInformationUrl->Text = $this->objSignupForm->InformationUrl;
     }
     if ($this->lblInformationUrl) {
         $this->lblInformationUrl->Text = $this->objSignupForm->InformationUrl;
     }
     if ($this->txtSupportEmail) {
         $this->txtSupportEmail->Text = $this->objSignupForm->SupportEmail;
     }
     if ($this->lblSupportEmail) {
         $this->lblSupportEmail->Text = $this->objSignupForm->SupportEmail;
     }
     if ($this->txtEmailNotification) {
         $this->txtEmailNotification->Text = $this->objSignupForm->EmailNotification;
     }
     if ($this->lblEmailNotification) {
         $this->lblEmailNotification->Text = $this->objSignupForm->EmailNotification;
     }
     if ($this->chkAllowOtherFlag) {
         $this->chkAllowOtherFlag->Checked = $this->objSignupForm->AllowOtherFlag;
     }
     if ($this->lblAllowOtherFlag) {
         $this->lblAllowOtherFlag->Text = $this->objSignupForm->AllowOtherFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->chkAllowMultipleFlag) {
         $this->chkAllowMultipleFlag->Checked = $this->objSignupForm->AllowMultipleFlag;
     }
     if ($this->lblAllowMultipleFlag) {
         $this->lblAllowMultipleFlag->Text = $this->objSignupForm->AllowMultipleFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->txtSignupLimit) {
         $this->txtSignupLimit->Text = $this->objSignupForm->SignupLimit;
     }
     if ($this->lblSignupLimit) {
         $this->lblSignupLimit->Text = $this->objSignupForm->SignupLimit;
     }
     if ($this->txtSignupMaleLimit) {
         $this->txtSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit;
     }
     if ($this->lblSignupMaleLimit) {
         $this->lblSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit;
     }
     if ($this->txtSignupFemaleLimit) {
         $this->txtSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit;
     }
     if ($this->lblSignupFemaleLimit) {
         $this->lblSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit;
     }
     if ($this->txtFundingAccount) {
         $this->txtFundingAccount->Text = $this->objSignupForm->FundingAccount;
     }
     if ($this->lblFundingAccount) {
         $this->lblFundingAccount->Text = $this->objSignupForm->FundingAccount;
     }
     if ($this->lstDonationStewardshipFund) {
         $this->lstDonationStewardshipFund->RemoveAllItems();
         $this->lstDonationStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null);
         $objDonationStewardshipFundArray = StewardshipFund::LoadAll();
         if ($objDonationStewardshipFundArray) {
             foreach ($objDonationStewardshipFundArray as $objDonationStewardshipFund) {
                 $objListItem = new QListItem($objDonationStewardshipFund->__toString(), $objDonationStewardshipFund->Id);
                 if ($this->objSignupForm->DonationStewardshipFund && $this->objSignupForm->DonationStewardshipFund->Id == $objDonationStewardshipFund->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstDonationStewardshipFund->AddItem($objListItem);
             }
         }
     }
     if ($this->lblDonationStewardshipFundId) {
         $this->lblDonationStewardshipFundId->Text = $this->objSignupForm->DonationStewardshipFund ? $this->objSignupForm->DonationStewardshipFund->__toString() : null;
     }
     if ($this->calDateCreated) {
         $this->calDateCreated->DateTime = $this->objSignupForm->DateCreated;
     }
     if ($this->lblDateCreated) {
         $this->lblDateCreated->Text = sprintf($this->objSignupForm->DateCreated) ? $this->objSignupForm->__toString($this->strDateCreatedDateTimeFormat) : null;
     }
     if ($this->chkLoginNotRequiredFlag) {
         $this->chkLoginNotRequiredFlag->Checked = $this->objSignupForm->LoginNotRequiredFlag;
     }
     if ($this->lblLoginNotRequiredFlag) {
         $this->lblLoginNotRequiredFlag->Text = $this->objSignupForm->LoginNotRequiredFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstClassMeeting) {
         $this->lstClassMeeting->RemoveAllItems();
         $this->lstClassMeeting->AddItem(QApplication::Translate('- Select One -'), null);
         $objClassMeetingArray = ClassMeeting::LoadAll();
         if ($objClassMeetingArray) {
             foreach ($objClassMeetingArray as $objClassMeeting) {
                 $objListItem = new QListItem($objClassMeeting->__toString(), $objClassMeeting->SignupFormId);
                 if ($objClassMeeting->SignupFormId == $this->objSignupForm->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstClassMeeting->AddItem($objListItem);
             }
         }
         // Because ClassMeeting's ClassMeeting is not null, if a value is already selected, it cannot be changed.
         if ($this->lstClassMeeting->SelectedValue) {
             $this->lstClassMeeting->Enabled = false;
         } else {
             $this->lstClassMeeting->Enabled = true;
         }
     }
     if ($this->lblClassMeeting) {
         $this->lblClassMeeting->Text = $this->objSignupForm->ClassMeeting ? $this->objSignupForm->ClassMeeting->__toString() : null;
     }
     if ($this->lstEventSignupForm) {
         $this->lstEventSignupForm->RemoveAllItems();
         $this->lstEventSignupForm->AddItem(QApplication::Translate('- Select One -'), null);
         $objEventSignupFormArray = EventSignupForm::LoadAll();
         if ($objEventSignupFormArray) {
             foreach ($objEventSignupFormArray as $objEventSignupForm) {
                 $objListItem = new QListItem($objEventSignupForm->__toString(), $objEventSignupForm->SignupFormId);
                 if ($objEventSignupForm->SignupFormId == $this->objSignupForm->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstEventSignupForm->AddItem($objListItem);
             }
         }
         // Because EventSignupForm's EventSignupForm is not null, if a value is already selected, it cannot be changed.
         if ($this->lstEventSignupForm->SelectedValue) {
             $this->lstEventSignupForm->Enabled = false;
         } else {
             $this->lstEventSignupForm->Enabled = true;
         }
     }
     if ($this->lblEventSignupForm) {
         $this->lblEventSignupForm->Text = $this->objSignupForm->EventSignupForm ? $this->objSignupForm->EventSignupForm->__toString() : null;
     }
 }
Beispiel #7
0
 public static function GenerateMinistries()
 {
     QDataGen::DisplayForEachTaskStart('Generating Minsitries', count(self::$MinistryArray));
     foreach (self::$MinistryArray as $strToken => $strMinistry) {
         QDataGen::DisplayForEachTaskNext('Generating Minsitries');
         $objMinistry = new Ministry();
         $objMinistry->Token = $strToken;
         $objMinistry->Name = $strMinistry;
         $objMinistry->ActiveFlag = true;
         $objMinistry->Save();
         $objFund = new StewardshipFund();
         $objFund->Ministry = $objMinistry;
         $objFund->Name = 'Ministry - ' . $objMinistry->Name;
         $objFund->AccountNumber = rand(100, 999);
         $objFund->Save();
         $strArray = array('Member' => GroupRoleType::Participant, 'Participant' => GroupRoleType::Participant, 'Volunteer' => GroupRoleType::Volunteer, 'Leader' => GroupRoleType::Volunteer);
         foreach ($strArray as $strName => $intGroupRoleTypeId) {
             $objGroupRole = new GroupRole();
             $objGroupRole->Ministry = $objMinistry;
             $objGroupRole->Name = $strName;
             $objGroupRole->GroupRoleTypeId = $intGroupRoleTypeId;
             $objGroupRole->Save();
         }
     }
     self::$MinistryArray = Ministry::LoadAll();
     QDataGen::DisplayForEachTaskEnd('Generating Minsitries');
 }
Beispiel #8
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;
     }
 }
Beispiel #9
0
 protected function Form_Create()
 {
     // Load and validate the Staff Person we're trying to view
     $this->objLogin = Login::Load(QApplication::PathInfo(0));
     if (!$this->objLogin) {
         QApplication::Redirect('/admin/users');
     }
     $this->strPageTitle .= $this->objLogin->Name;
     // Display: Username
     $this->lblUsername = new QLabel($this);
     $this->lblUsername->Name = 'Username';
     $this->lblUsername->Text = $this->objLogin->Username;
     // Display: Email
     $this->lblEmail = new QLabel($this);
     $this->lblEmail->Name = 'Email';
     if ($this->objLogin->Email) {
         $this->lblEmail->Text = $this->objLogin->Email;
     } else {
         $this->lblEmail->Text = 'none';
         $this->lblEmail->CssClass = 'na';
     }
     // Display Ministry Involvement Information
     $this->lblMinistries = new QLabel($this);
     $this->lblMinistries->Name = 'Ministry Involvement';
     $strArray = array();
     foreach ($this->objLogin->GetMinistryArray() as $objMinistry) {
         $strArray[] = QApplication::HtmlEntities($objMinistry->Name);
     }
     $this->lblMinistries->Text = implode(' &nbsp;&bull;&nbsp; ', $strArray);
     if (!$this->lblMinistries->Text) {
         $this->lblMinistries->CssClass = 'na';
         $this->lblMinistries->Text = 'n/a';
     }
     $this->lblMinistries->HtmlEntities = false;
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         if (in_array($objMinistry->Name, $strArray)) {
             $rblMinistry->AddItem('Yes', $objMinistry->Id, true);
             $rblMinistry->AddItem('No', 0, false);
         } else {
             $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
             $rblMinistry->AddItem('No', 0, true);
         }
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, $this->objLogin->IsPermissionAllowed($intId));
         $rblPermission->AddItem('No', 0, !$this->objLogin->IsPermissionAllowed($intId));
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->lblRoleType = new QLabel($this);
     $this->lblRoleType->Name = 'Role';
     $this->lblRoleType->Text = "Volunteer";
     //not going to let this change to anything different
     $this->lblDomainActive = new QLabel($this);
     $this->lblDomainActive->Name = 'Domain Account Active';
     $this->lblDomainActive->Text = $this->objLogin->DomainActiveFlag ? 'Yes' : 'No';
     $this->rblLoginActive = new QRadioButtonList($this);
     $this->rblLoginActive->Name = 'ChMS Login Enabled';
     $this->rblLoginActive->AddItem('Yes', true, $this->objLogin->LoginActiveFlag);
     $this->rblLoginActive->AddItem('No', false, !$this->objLogin->LoginActiveFlag);
     $this->rblLoginActive->RepeatColumns = 2;
     $this->lblDateLastLogin = new QLabel($this);
     $this->lblDateLastLogin->Name = 'Date of Last ChMS Access';
     if ($this->objLogin->DateLastLogin) {
         $this->lblDateLastLogin->Text = $this->objLogin->DateLastLogin->ToString('MMMM D YYYY') . ' at ' . $this->objLogin->DateLastLogin->ToString('h:mmz');
     } else {
         $this->lblDateLastLogin->Text = 'None';
         $this->lblDateLastLogin->CssClass = 'na';
     }
     // Add controls and stuff for Editable pages
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Update';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CssClass = 'primary';
     $this->strPassword = new QTextBox($this);
     $this->strPassword->Name = "Reset Password";
     $this->strConfirmPassword = new QTextBox($this);
     $this->strConfirmPassword->Name = "Confirm Password";
     $this->lblMessage = new QLabel($this);
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel->CssClass = 'cancel';
 }
 /**
  * Refresh this MetaControl with Data from the local CommunicationList object.
  * @param boolean $blnReload reload CommunicationList from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objCommunicationList->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objCommunicationList->Id;
         }
     }
     if ($this->lstEmailBroadcastType) {
         $this->lstEmailBroadcastType->SelectedValue = $this->objCommunicationList->EmailBroadcastTypeId;
     }
     if ($this->lblEmailBroadcastTypeId) {
         $this->lblEmailBroadcastTypeId->Text = $this->objCommunicationList->EmailBroadcastTypeId ? EmailBroadcastType::$NameArray[$this->objCommunicationList->EmailBroadcastTypeId] : null;
     }
     if ($this->lstMinistry) {
         $this->lstMinistry->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 if ($this->objCommunicationList->Ministry && $this->objCommunicationList->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objCommunicationList->Ministry ? $this->objCommunicationList->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objCommunicationList->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objCommunicationList->Name;
     }
     if ($this->txtToken) {
         $this->txtToken->Text = $this->objCommunicationList->Token;
     }
     if ($this->lblToken) {
         $this->lblToken->Text = $this->objCommunicationList->Token;
     }
     if ($this->txtDescription) {
         $this->txtDescription->Text = $this->objCommunicationList->Description;
     }
     if ($this->lblDescription) {
         $this->lblDescription->Text = $this->objCommunicationList->Description;
     }
     if ($this->chkSubscribable) {
         $this->chkSubscribable->Checked = $this->objCommunicationList->Subscribable;
     }
     if ($this->lblSubscribable) {
         $this->lblSubscribable->Text = $this->objCommunicationList->Subscribable ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstCommunicationListEntries) {
         $this->lstCommunicationListEntries->RemoveAllItems();
         $objAssociatedArray = $this->objCommunicationList->GetCommunicationListEntryArray();
         $objCommunicationListEntryArray = CommunicationListEntry::LoadAll();
         if ($objCommunicationListEntryArray) {
             foreach ($objCommunicationListEntryArray as $objCommunicationListEntry) {
                 $objListItem = new QListItem($objCommunicationListEntry->__toString(), $objCommunicationListEntry->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objCommunicationListEntry->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstCommunicationListEntries->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCommunicationListEntries) {
         $objAssociatedArray = $this->objCommunicationList->GetCommunicationListEntryArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblCommunicationListEntries->Text = implode($strGlue, $strItems);
     }
     if ($this->lstPeople) {
         $this->lstPeople->RemoveAllItems();
         $objAssociatedArray = $this->objCommunicationList->GetPersonArray();
         $objPersonArray = Person::LoadAll();
         if ($objPersonArray) {
             foreach ($objPersonArray as $objPerson) {
                 $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objPerson->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstPeople->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPeople) {
         $objAssociatedArray = $this->objCommunicationList->GetPersonArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblPeople->Text = implode($strGlue, $strItems);
     }
 }
 /**
  * Refresh this MetaControl with Data from the local Ministry object.
  * @param boolean $blnReload reload Ministry from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objMinistry->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objMinistry->Id;
         }
     }
     if ($this->txtToken) {
         $this->txtToken->Text = $this->objMinistry->Token;
     }
     if ($this->lblToken) {
         $this->lblToken->Text = $this->objMinistry->Token;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objMinistry->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objMinistry->Name;
     }
     if ($this->lstParentMinistry) {
         $this->lstParentMinistry->RemoveAllItems();
         $this->lstParentMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         $objParentMinistryArray = Ministry::LoadAll();
         if ($objParentMinistryArray) {
             foreach ($objParentMinistryArray as $objParentMinistry) {
                 $objListItem = new QListItem($objParentMinistry->__toString(), $objParentMinistry->Id);
                 if ($this->objMinistry->ParentMinistry && $this->objMinistry->ParentMinistry->Id == $objParentMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstParentMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblParentMinistryId) {
         $this->lblParentMinistryId->Text = $this->objMinistry->ParentMinistry ? $this->objMinistry->ParentMinistry->__toString() : null;
     }
     if ($this->txtGroupTypeBitmap) {
         $this->txtGroupTypeBitmap->Text = $this->objMinistry->GroupTypeBitmap;
     }
     if ($this->lblGroupTypeBitmap) {
         $this->lblGroupTypeBitmap->Text = $this->objMinistry->GroupTypeBitmap;
     }
     if ($this->txtSignupFormTypeBitmap) {
         $this->txtSignupFormTypeBitmap->Text = $this->objMinistry->SignupFormTypeBitmap;
     }
     if ($this->lblSignupFormTypeBitmap) {
         $this->lblSignupFormTypeBitmap->Text = $this->objMinistry->SignupFormTypeBitmap;
     }
     if ($this->chkActiveFlag) {
         $this->chkActiveFlag->Checked = $this->objMinistry->ActiveFlag;
     }
     if ($this->lblActiveFlag) {
         $this->lblActiveFlag->Text = $this->objMinistry->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstLogins) {
         $this->lstLogins->RemoveAllItems();
         $objAssociatedArray = $this->objMinistry->GetLoginArray();
         $objLoginArray = Login::LoadAll();
         if ($objLoginArray) {
             foreach ($objLoginArray as $objLogin) {
                 $objListItem = new QListItem($objLogin->__toString(), $objLogin->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objLogin->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstLogins->AddItem($objListItem);
             }
         }
     }
     if ($this->lblLogins) {
         $objAssociatedArray = $this->objMinistry->GetLoginArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblLogins->Text = implode($strGlue, $strItems);
     }
 }
Beispiel #12
0
 /**
  * Refresh this MetaControl with Data from the local Login object.
  * @param boolean $blnReload reload Login from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objLogin->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objLogin->Id;
         }
     }
     if ($this->lstRoleType) {
         $this->lstRoleType->SelectedValue = $this->objLogin->RoleTypeId;
     }
     if ($this->lblRoleTypeId) {
         $this->lblRoleTypeId->Text = $this->objLogin->RoleTypeId ? RoleType::$NameArray[$this->objLogin->RoleTypeId] : null;
     }
     if ($this->txtPermissionBitmap) {
         $this->txtPermissionBitmap->Text = $this->objLogin->PermissionBitmap;
     }
     if ($this->lblPermissionBitmap) {
         $this->lblPermissionBitmap->Text = $this->objLogin->PermissionBitmap;
     }
     if ($this->txtUsername) {
         $this->txtUsername->Text = $this->objLogin->Username;
     }
     if ($this->lblUsername) {
         $this->lblUsername->Text = $this->objLogin->Username;
     }
     if ($this->txtPasswordCache) {
         $this->txtPasswordCache->Text = $this->objLogin->PasswordCache;
     }
     if ($this->lblPasswordCache) {
         $this->lblPasswordCache->Text = $this->objLogin->PasswordCache;
     }
     if ($this->txtPasswordLastSet) {
         $this->txtPasswordLastSet->Text = $this->objLogin->PasswordLastSet;
     }
     if ($this->lblPasswordLastSet) {
         $this->lblPasswordLastSet->Text = $this->objLogin->PasswordLastSet;
     }
     if ($this->calDateLastLogin) {
         $this->calDateLastLogin->DateTime = $this->objLogin->DateLastLogin;
     }
     if ($this->lblDateLastLogin) {
         $this->lblDateLastLogin->Text = sprintf($this->objLogin->DateLastLogin) ? $this->objLogin->__toString($this->strDateLastLoginDateTimeFormat) : null;
     }
     if ($this->chkDomainActiveFlag) {
         $this->chkDomainActiveFlag->Checked = $this->objLogin->DomainActiveFlag;
     }
     if ($this->lblDomainActiveFlag) {
         $this->lblDomainActiveFlag->Text = $this->objLogin->DomainActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->chkLoginActiveFlag) {
         $this->chkLoginActiveFlag->Checked = $this->objLogin->LoginActiveFlag;
     }
     if ($this->lblLoginActiveFlag) {
         $this->lblLoginActiveFlag->Text = $this->objLogin->LoginActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->txtEmail) {
         $this->txtEmail->Text = $this->objLogin->Email;
     }
     if ($this->lblEmail) {
         $this->lblEmail->Text = $this->objLogin->Email;
     }
     if ($this->txtFirstName) {
         $this->txtFirstName->Text = $this->objLogin->FirstName;
     }
     if ($this->lblFirstName) {
         $this->lblFirstName->Text = $this->objLogin->FirstName;
     }
     if ($this->txtMiddleInitial) {
         $this->txtMiddleInitial->Text = $this->objLogin->MiddleInitial;
     }
     if ($this->lblMiddleInitial) {
         $this->lblMiddleInitial->Text = $this->objLogin->MiddleInitial;
     }
     if ($this->txtLastName) {
         $this->txtLastName->Text = $this->objLogin->LastName;
     }
     if ($this->lblLastName) {
         $this->lblLastName->Text = $this->objLogin->LastName;
     }
     if ($this->lstClassInstructor) {
         $this->lstClassInstructor->RemoveAllItems();
         $this->lstClassInstructor->AddItem(QApplication::Translate('- Select One -'), null);
         $objClassInstructorArray = ClassInstructor::LoadAll();
         if ($objClassInstructorArray) {
             foreach ($objClassInstructorArray as $objClassInstructor) {
                 $objListItem = new QListItem($objClassInstructor->__toString(), $objClassInstructor->Id);
                 if ($objClassInstructor->LoginId == $this->objLogin->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstClassInstructor->AddItem($objListItem);
             }
         }
     }
     if ($this->lblClassInstructor) {
         $this->lblClassInstructor->Text = $this->objLogin->ClassInstructor ? $this->objLogin->ClassInstructor->__toString() : null;
     }
     if ($this->lstMinistries) {
         $this->lstMinistries->RemoveAllItems();
         $objAssociatedArray = $this->objLogin->GetMinistryArray();
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objMinistry->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstMinistries->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistries) {
         $objAssociatedArray = $this->objLogin->GetMinistryArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblMinistries->Text = implode($strGlue, $strItems);
     }
 }
Beispiel #13
0
 /**
  * Refresh this MetaControl with Data from the local Group object.
  * @param boolean $blnReload reload Group from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objGroup->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objGroup->Id;
         }
     }
     if ($this->lstGroupType) {
         $this->lstGroupType->SelectedValue = $this->objGroup->GroupTypeId;
     }
     if ($this->lblGroupTypeId) {
         $this->lblGroupTypeId->Text = $this->objGroup->GroupTypeId ? GroupType::$NameArray[$this->objGroup->GroupTypeId] : null;
     }
     if ($this->lstMinistry) {
         $this->lstMinistry->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objMinistryArray = Ministry::LoadAll();
         if ($objMinistryArray) {
             foreach ($objMinistryArray as $objMinistry) {
                 $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id);
                 if ($this->objGroup->Ministry && $this->objGroup->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objGroup->Ministry ? $this->objGroup->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objGroup->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objGroup->Name;
     }
     if ($this->txtDescription) {
         $this->txtDescription->Text = $this->objGroup->Description;
     }
     if ($this->lblDescription) {
         $this->lblDescription->Text = $this->objGroup->Description;
     }
     if ($this->lstParentGroup) {
         $this->lstParentGroup->RemoveAllItems();
         $this->lstParentGroup->AddItem(QApplication::Translate('- Select One -'), null);
         $objParentGroupArray = Group::LoadAll();
         if ($objParentGroupArray) {
             foreach ($objParentGroupArray as $objParentGroup) {
                 $objListItem = new QListItem($objParentGroup->__toString(), $objParentGroup->Id);
                 if ($this->objGroup->ParentGroup && $this->objGroup->ParentGroup->Id == $objParentGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstParentGroup->AddItem($objListItem);
             }
         }
     }
     if ($this->lblParentGroupId) {
         $this->lblParentGroupId->Text = $this->objGroup->ParentGroup ? $this->objGroup->ParentGroup->__toString() : null;
     }
     if ($this->txtHierarchyLevel) {
         $this->txtHierarchyLevel->Text = $this->objGroup->HierarchyLevel;
     }
     if ($this->lblHierarchyLevel) {
         $this->lblHierarchyLevel->Text = $this->objGroup->HierarchyLevel;
     }
     if ($this->txtHierarchyOrderNumber) {
         $this->txtHierarchyOrderNumber->Text = $this->objGroup->HierarchyOrderNumber;
     }
     if ($this->lblHierarchyOrderNumber) {
         $this->lblHierarchyOrderNumber->Text = $this->objGroup->HierarchyOrderNumber;
     }
     if ($this->chkConfidentialFlag) {
         $this->chkConfidentialFlag->Checked = $this->objGroup->ConfidentialFlag;
     }
     if ($this->lblConfidentialFlag) {
         $this->lblConfidentialFlag->Text = $this->objGroup->ConfidentialFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstEmailBroadcastType) {
         $this->lstEmailBroadcastType->SelectedValue = $this->objGroup->EmailBroadcastTypeId;
     }
     if ($this->lblEmailBroadcastTypeId) {
         $this->lblEmailBroadcastTypeId->Text = $this->objGroup->EmailBroadcastTypeId ? EmailBroadcastType::$NameArray[$this->objGroup->EmailBroadcastTypeId] : null;
     }
     if ($this->txtToken) {
         $this->txtToken->Text = $this->objGroup->Token;
     }
     if ($this->lblToken) {
         $this->lblToken->Text = $this->objGroup->Token;
     }
     if ($this->chkActiveFlag) {
         $this->chkActiveFlag->Checked = $this->objGroup->ActiveFlag;
     }
     if ($this->lblActiveFlag) {
         $this->lblActiveFlag->Text = $this->objGroup->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstStatusObject) {
         $this->lstStatusObject->RemoveAllItems();
         $this->lstStatusObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objStatusObjectArray = AvailabilityStatus::LoadAll();
         if ($objStatusObjectArray) {
             foreach ($objStatusObjectArray as $objStatusObject) {
                 $objListItem = new QListItem($objStatusObject->__toString(), $objStatusObject->Id);
                 if ($this->objGroup->StatusObject && $this->objGroup->StatusObject->Id == $objStatusObject->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstStatusObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblStatus) {
         $this->lblStatus->Text = $this->objGroup->StatusObject ? $this->objGroup->StatusObject->__toString() : null;
     }
     if ($this->lstGroupCategory) {
         $this->lstGroupCategory->RemoveAllItems();
         $this->lstGroupCategory->AddItem(QApplication::Translate('- Select One -'), null);
         $objGroupCategoryArray = GroupCategory::LoadAll();
         if ($objGroupCategoryArray) {
             foreach ($objGroupCategoryArray as $objGroupCategory) {
                 $objListItem = new QListItem($objGroupCategory->__toString(), $objGroupCategory->GroupId);
                 if ($objGroupCategory->GroupId == $this->objGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGroupCategory->AddItem($objListItem);
             }
         }
         // Because GroupCategory's GroupCategory is not null, if a value is already selected, it cannot be changed.
         if ($this->lstGroupCategory->SelectedValue) {
             $this->lstGroupCategory->Enabled = false;
         } else {
             $this->lstGroupCategory->Enabled = true;
         }
     }
     if ($this->lblGroupCategory) {
         $this->lblGroupCategory->Text = $this->objGroup->GroupCategory ? $this->objGroup->GroupCategory->__toString() : null;
     }
     if ($this->lstGrowthGroup) {
         $this->lstGrowthGroup->RemoveAllItems();
         $this->lstGrowthGroup->AddItem(QApplication::Translate('- Select One -'), null);
         $objGrowthGroupArray = GrowthGroup::LoadAll();
         if ($objGrowthGroupArray) {
             foreach ($objGrowthGroupArray as $objGrowthGroup) {
                 $objListItem = new QListItem($objGrowthGroup->__toString(), $objGrowthGroup->GroupId);
                 if ($objGrowthGroup->GroupId == $this->objGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGrowthGroup->AddItem($objListItem);
             }
         }
         // Because GrowthGroup's GrowthGroup is not null, if a value is already selected, it cannot be changed.
         if ($this->lstGrowthGroup->SelectedValue) {
             $this->lstGrowthGroup->Enabled = false;
         } else {
             $this->lstGrowthGroup->Enabled = true;
         }
     }
     if ($this->lblGrowthGroup) {
         $this->lblGrowthGroup->Text = $this->objGroup->GrowthGroup ? $this->objGroup->GrowthGroup->__toString() : null;
     }
     if ($this->lstSmartGroup) {
         $this->lstSmartGroup->RemoveAllItems();
         $this->lstSmartGroup->AddItem(QApplication::Translate('- Select One -'), null);
         $objSmartGroupArray = SmartGroup::LoadAll();
         if ($objSmartGroupArray) {
             foreach ($objSmartGroupArray as $objSmartGroup) {
                 $objListItem = new QListItem($objSmartGroup->__toString(), $objSmartGroup->GroupId);
                 if ($objSmartGroup->GroupId == $this->objGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSmartGroup->AddItem($objListItem);
             }
         }
         // Because SmartGroup's SmartGroup is not null, if a value is already selected, it cannot be changed.
         if ($this->lstSmartGroup->SelectedValue) {
             $this->lstSmartGroup->Enabled = false;
         } else {
             $this->lstSmartGroup->Enabled = true;
         }
     }
     if ($this->lblSmartGroup) {
         $this->lblSmartGroup->Text = $this->objGroup->SmartGroup ? $this->objGroup->SmartGroup->__toString() : null;
     }
 }