Exemplo n.º 1
0
Arquivo: index.php Projeto: alcf/chms
 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'));
 }
Exemplo n.º 2
0
Arquivo: add.php Projeto: 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';
 }
Exemplo n.º 3
0
Arquivo: edit.php Projeto: alcf/chms
 protected function Form_Create()
 {
     // Load the MetaControl and Ensure Edit Permissions
     $this->mctList = CommunicationListMetaControl::Create($this, QApplication::PathInfo(0), QMetaControlCreateType::CreateOnRecordNotFound);
     if ($this->mctList->EditMode) {
         if (!$this->mctList->CommunicationList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
             $this->RedirectToView();
         }
     }
     $this->txtName = $this->mctList->txtName_Create();
     $this->txtName->Required = true;
     $this->txtDescription = $this->mctList->txtDescription_Create();
     $this->txtDescription->Required = false;
     $this->txtDescription->TextMode = QTextMode::MultiLine;
     $this->txtDescription->Height = '50px';
     $this->txtToken = $this->mctList->txtToken_Create();
     $this->txtToken->Name = 'Email Address';
     $this->txtToken->HtmlAfter = '<span> @ groups.alcf.net</span>';
     $this->lstType = $this->mctList->lstEmailBroadcastType_Create();
     $this->lstType->Instructions = '<span class="help" onclick="displayHelp(\'helpEmailBroadcastType\')"><img src="/assets/images/icons/help.png" alt="help"></span>';
     $this->chkSubscribable = $this->mctList->chkSubscribable_Create();
     if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) {
         $this->lstMinistry = $this->mctList->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name));
     } else {
         $intMinistryIdArray = array();
         foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) {
             $intMinistryIdArray[] = $objMinistry->Id;
         }
         $this->lstMinistry = $this->mctList->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name));
     }
     if ($this->mctList->EditMode) {
         $this->lstMinistry->Enabled = false;
     }
     $this->strPageTitle = 'Email List - ' . ($this->mctList->EditMode ? 'Edit' : 'Create New');
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     if ($this->mctList->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to permanently DELETE this Email List?  This will also delete ALL the messages as well!'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
Exemplo n.º 4
0
Arquivo: index.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->pnlMinistries = new QPanel($this);
     $this->pnlMinistries->TagName = 'ul';
     $this->pnlMinistries->CssClass = 'subnavSide subnavSideSmall';
     $this->pnlMinistries->AutoRenderChildren = true;
     $this->pxyMinistry = new QControlProxy($this);
     $this->pxyMinistry->AddAction(new QClickEvent(), new QAjaxAction('pxyMinistry_Click'));
     $this->pxyMinistry->AddAction(new QClickEvent(), new QTerminateAction());
     $blnFirst = true;
     foreach (Ministry::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         if ($objMinistry->IsLoginCanViewMinistry(QApplication::$Login)) {
             $pnlMinistry = new QPanel($this->pnlMinistries, 'pnlMinistry' . $objMinistry->Id);
             $pnlMinistry->TagName = 'li';
             $pnlMinistry->ActionParameter = $objMinistry->Id;
             if ($blnFirst) {
                 $blnFirst = false;
                 $pnlMinistry->CssClass = 'first';
             }
             $this->pnlMinistry_Refresh($objMinistry);
         }
     }
     // Last
     if ($blnFirst != true) {
         // only set if non-empty panel variable
         $pnlMinistry->CssClass = 'last';
     }
     $this->lstSignupFormType = new QListBox($this);
     $this->lstSignupFormType->AddAction(new QChangeEvent(), new QAjaxAction('lstSignupFormType_Change'));
     $this->lstSignupFormType->Visible = false;
     $this->chkViewAll = new QCheckBox($this);
     $this->chkViewAll->Text = 'View "Inactive" Signup Forms as well';
     $this->chkViewAll->AddAction(new QClickEvent(), new QAjaxAction('chkViewAll_Click'));
     $this->chkViewAll->Visible = false;
     $this->lblMinistry = new QLabel($this);
     $this->lblMinistry->TagName = 'h3';
     $this->lblMinistry_Refresh();
     $this->dtgSignupForms = new QDataGrid($this);
     $this->dtgSignupForms->CssClass = 'datagrid';
     $this->dtgSignupForms->AddColumn(new QDataGridColumn('Form Name', '<?= $_FORM->RenderName($_ITEM); ?>', 'HtmlEntities=false', 'Width=440px'));
     $this->dtgSignupForms->AddColumn(new QDataGridColumn('Signups', '<?= SignupEntry::CountBySignupFormIdSignupEntryStatusTypeId($_ITEM->Id, SignupEntryStatusType::Complete); ?>', 'Width=60px'));
     $this->dtgSignupForms->AddColumn(new QDataGridColumn('Type', '<?= $_ITEM->Type; ?>', 'Width=80px'));
     $this->dtgSignupForms->AddColumn(new QDataGridColumn('Date Created', '<?= $_ITEM->DateCreated->ToString("DDD, MMM D, YYYY"); ?>', 'Width=140px'));
     $this->dtgSignupForms->SetDataBinder('dtgSignupForms_Bind');
     $this->lblStartText = new QLabel($this);
     $this->lblStartText->Text = '<h3>Events and Signup Forms</h3><p>Please select a ministry from the list on the right.</p>';
     $this->lblStartText->HtmlEntities = false;
     $this->SetUrlHashProcessor('Form_ProcessHash');
 }
Exemplo n.º 5
0
 protected function SetupPanel()
 {
     $this->lstMinistries = new QListBox($this);
     $this->lstMinistries->Name = 'Select a Ministry';
     $this->lstMinistries->AddItem('- Select One -');
     foreach (Ministry::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         if ($objMinistry->IsLoginCanAdminMinistry(QApplication::$Login)) {
             $this->lstMinistries->AddItem($objMinistry->Name, $objMinistry->Id);
         }
     }
     $this->dtgGroups = new QDataGrid($this);
     $this->dtgGroups->Name = '&nbsp;';
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Name', '<?= $_CONTROL->ParentControl->RenderName($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Type', '<?= $_ITEM->Type; ?>'));
     $this->dtgGroups->SetDataBinder('dtgGroups_Bind', $this);
     $this->lstMinistries->AddAction(new QChangeEvent(), new QAjaxControlAction($this->dtgGroups, 'Refresh'));
 }
Exemplo n.º 6
0
Arquivo: add.php Projeto: 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'));
 }
Exemplo n.º 7
0
Arquivo: index.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->pnlMinistries = new QPanel($this);
     $this->pnlMinistries->TagName = 'ul';
     $this->pnlMinistries->CssClass = 'subnavSide subnavSideSmall';
     $this->pnlMinistries->AutoRenderChildren = true;
     $this->pxyMinistry = new QControlProxy($this);
     $this->pxyMinistry->AddAction(new QClickEvent(), new QAjaxAction('pxyMinistry_Click'));
     $this->pxyMinistry->AddAction(new QClickEvent(), new QTerminateAction());
     $blnFirst = true;
     foreach (Ministry::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         if ($objMinistry->IsLoginCanViewMinistry(QApplication::$Login)) {
             $pnlMinistry = new QPanel($this->pnlMinistries, 'pnlMinistry' . $objMinistry->Id);
             $pnlMinistry->TagName = 'li';
             $pnlMinistry->ActionParameter = $objMinistry->Id;
             if ($blnFirst) {
                 $blnFirst = false;
                 $pnlMinistry->CssClass = 'first';
             }
             $this->pnlMinistry_Refresh($objMinistry);
         }
     }
     // Last
     if ($blnFirst != true) {
         // only set if non-empty panel variable
         $pnlMinistry->CssClass = 'last';
     }
     $this->lblMinistry = new QLabel($this);
     $this->lblMinistry->TagName = 'h3';
     $this->lblMinistry_Refresh();
     $this->dtgCommLists = new CommunicationListDataGrid($this);
     $this->dtgCommLists->MetaAddColumn('Name', 'Name=List Name', 'Html=<?= $_FORM->RenderName($_ITEM); ?>', 'HtmlEntities=false', 'Width=260px');
     $this->dtgCommLists->MetaAddTypeColumn('EmailBroadcastTypeId', 'EmailBroadcastType', 'Name=List Type', 'Width=120px');
     $this->dtgCommLists->MetaAddColumn('Token', 'Name=Email', 'Html=<?= $_FORM->RenderEmail($_ITEM); ?>', 'HtmlEntities=false', 'Width=350px');
     $this->dtgCommLists->SetDataBinder('dtgCommLists_Bind');
     $this->dtgCommLists->NoDataHtml = '<p>There are no Email Lists for this ministry.</p>';
     $this->lblStartText = new QLabel($this);
     $this->lblStartText->Text = '<h3>Email Lists in Ministries</h3><p>Please select an ministry from the list on the right.</p>';
     $this->lblStartText->HtmlEntities = false;
 }
Exemplo n.º 8
0
 public function UpdateLocalGroupsHierarchy()
 {
     // Groups Sync -- Second Pass, update the hierarchy
     foreach ($this->arrGroups as $intKey => $arrResult) {
         $strArray = AlcfLdap::GetValuesFromPath($arrResult["distinguishedname"][0]);
         $strHierarchyArray = $strArray['OU'];
         $strGroupName = $strHierarchyArray[0];
         $strToken = substr(strtolower($arrResult['samaccountname'][0]), 3);
         $objMinistry = Ministry::LoadByToken($strToken);
         $strParentGroupName = $strHierarchyArray[1];
         if ($strParentGroupName != 'People') {
             $objParentMinistryArray = Ministry::QueryArray(QQ::Equal(QQN::Ministry()->Name, $strParentGroupName));
             if (count($objParentMinistryArray) != 1) {
                 throw new Exception('Found more than one ministry with the same name');
             }
             $objMinistry->ParentMinistry = $objParentMinistryArray[0];
             $objMinistry->Save();
         }
     }
 }
Exemplo n.º 9
0
Arquivo: edit.php Projeto: alcf/chms
 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';
 }
Exemplo n.º 10
0
Arquivo: edit.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->lblHeading = new QLabel($this);
     if (QApplication::PathInfo(0)) {
         $objSignupForm = SignupForm::Load(QApplication::PathInfo(0));
         if (!$objSignupForm) {
             QApplication::Redirect('/events/');
         }
         if (!$objSignupForm->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
             QApplication::Redirect('/events/');
         }
         $this->strPageTitle .= 'Edit Form';
         $this->lblHeading->Text = 'Edit ' . $objSignupForm->Type . ' Form';
         switch ($objSignupForm->SignupFormTypeId) {
             case SignupFormType::Event:
                 $objChild = $objSignupForm->EventSignupForm;
                 break;
             case SignupFormType::Course:
                 $objChild = $objSignupForm->ClassMeeting;
                 break;
             default:
                 throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
         }
     } else {
         if (!QApplication::PathInfo(1)) {
             QApplication::Redirect('/events/');
         }
         $objSignupForm = new SignupForm();
         $objSignupForm->SignupFormTypeId = QApplication::PathInfo(1);
         $objSignupForm->DateCreated = QDateTime::Now();
         $objSignupForm->ActiveFlag = true;
         $this->strPageTitle .= 'Create New Form';
         $this->lblHeading->Text = 'Create New ' . $objSignupForm->Type . ' Form';
         switch ($objSignupForm->SignupFormTypeId) {
             case SignupFormType::Event:
                 $objChild = new EventSignupForm();
                 break;
             case SignupFormType::Course:
                 $objChild = new ClassMeeting();
                 break;
             default:
                 throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
         }
     }
     // Setup MCTs for Signup and Child
     $this->mctSignupForm = new SignupFormMetaControl($this, $objSignupForm);
     switch ($objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->mctSignupChild = new EventSignupFormMetaControl($this, $objChild);
             break;
         case SignupFormType::Course:
             $this->mctSignupChild = new ClassMeetingMetaControl($this, $objChild);
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
     }
     $this->txtName = $this->mctSignupForm->txtName_Create();
     $this->txtName->Select();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtName->Required = true;
     $this->txtDescription = $this->mctSignupForm->txtDescription_Create();
     $this->txtInformationUrl = $this->mctSignupForm->txtInformationUrl_Create();
     $this->chkAllowMultipleFlag = $this->mctSignupForm->chkAllowMultipleFlag_Create();
     $this->chkAllowMultipleFlag->Name = 'Allow Multiple Registrations?';
     $this->chkAllowMultipleFlag->Text = 'Check if people are allowed to be registered multiple times.';
     $this->chkAllowOtherFlag = $this->mctSignupForm->chkAllowOtherFlag_Create();
     $this->chkAllowOtherFlag->Name = 'Allow Registering for Others?';
     $this->chkAllowOtherFlag->Text = 'Check if people are allowed to register on behalf of someone else.';
     $this->chkAllowOtherFlag->Visible = false;
     $this->chkActiveFlag = $this->mctSignupForm->chkActiveFlag_Create();
     $this->chkActiveFlag->Name = 'Active?';
     $this->chkActiveFlag->Text = 'Check if this is an "Active" form.';
     $this->txtToken = $this->mctSignupForm->txtToken_Create();
     $this->txtToken->Name = 'Custom Signup Web Address';
     $this->txtToken->HtmlBefore = '<span>https://my.alcf.net/signup/event.php / </span>';
     $this->chkConfidentialFlag = $this->mctSignupForm->chkConfidentialFlag_Create();
     $this->chkConfidentialFlag->Name = 'Confidential?';
     $this->chkConfidentialFlag->Text = 'Check if this form is considered a "Confidential" form.';
     $this->chkNoLoginSupportFlag = $this->mctSignupForm->chkLoginNotRequiredFlag_Create();
     $this->chkNoLoginSupportFlag->Name = 'Support No Login?';
     $this->chkNoLoginSupportFlag->Text = 'Check if you would like to allow users to signup without having to log in.';
     $this->txtFundingAccount = $this->mctSignupForm->txtFundingAccount_Create();
     if ($this->mctSignupForm->SignupForm->CountFormProducts()) {
         $this->txtFundingAccount->Required = true;
     }
     $this->lstDonationStewardshipFund = $this->mctSignupForm->lstDonationStewardshipFund_Create(null, QQ::Equal(QQN::StewardshipFund()->ActiveFlag, true), QQ::OrderBy(QQN::StewardshipFund()->Name));
     $this->lstDonationStewardshipFund->Name = 'Funding Account for Donations';
     if ($this->mctSignupForm->SignupForm->IsDonationAccepted()) {
         $this->lstDonationStewardshipFund->Required = true;
     }
     // Setup Ministry with Rules
     if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) {
         $this->lstMinistry = $this->mctSignupForm->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name));
     } else {
         $intMinistryIdArray = array();
         foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) {
             $intMinistryIdArray[] = $objMinistry->Id;
         }
         $this->lstMinistry = $this->mctSignupForm->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name));
     }
     if ($this->mctSignupForm->EditMode) {
         $this->lstMinistry->Enabled = false;
     }
     // Communciation
     $this->txtSupportEmail = $this->mctSignupForm->txtSupportEmail_Create();
     $this->txtEmailNotification = $this->mctSignupForm->txtEmailNotification_Create();
     // Setup Limit
     $this->txtSignupLimit = $this->mctSignupForm->txtSignupLimit_Create();
     $this->txtSignupLimit->Minimum = 0;
     // TODO: Implement Gender-Specific Limits
     $this->txtSignupMaleLimit = $this->mctSignupForm->txtSignupMaleLimit_Create();
     $this->txtSignupMaleLimit->Visible = false;
     $this->txtSignupMaleLimit->Minimum = 0;
     $this->txtSignupFemaleLimit = $this->mctSignupForm->txtSignupFemaleLimit_Create();
     $this->txtSignupFemaleLimit->Minimum = 0;
     $this->txtSignupFemaleLimit->Visible = false;
     // Setup Controls for Child
     switch ($objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->dtxDateStart = $this->mctSignupChild->dtxDateStart_Create();
             $this->calDateStart = $this->mctSignupChild->calDateStart_Create();
             $this->dtxDateEnd = $this->mctSignupChild->dtxDateEnd_Create();
             $this->calDateEnd = $this->mctSignupChild->calDateEnd_Create();
             $this->txtLocation = $this->mctSignupChild->txtLocation_Create();
             break;
         case SignupFormType::Course:
             $this->lstClassTerm = $this->mctSignupChild->lstClassTerm_Create(null, QQ::OrCondition(QQ::Equal(QQN::ClassTerm()->ActiveFlag, true), QQ::Equal(QQN::ClassTerm()->Id, $this->mctSignupChild->ClassMeeting->ClassTermId)));
             $this->lstClassCourse = $this->mctSignupChild->lstClassCourse_Create(null, null, QQ::OrderBy(QQN::ClassCourse()->Code));
             $this->lstClassInstructor = $this->mctSignupChild->lstClassInstructor_Create(null, null, QQ::OrderBy(QQN::ClassInstructor()->DisplayName));
             $this->calDateStart = $this->mctSignupChild->calDateStart_Create();
             $this->calDateEnd = $this->mctSignupChild->calDateEnd_Create();
             $this->txtLocation = $this->mctSignupChild->txtLocation_Create();
             $this->lstMeetingDay = $this->mctSignupChild->lstMeetingDay_Create();
             $this->lstMeetingStartTime = $this->mctSignupChild->lstMeetingStartTime_Create();
             $this->lstMeetingEndTime = $this->mctSignupChild->lstMeetingEndTime_Create();
             // Make some upates to the default fields
             $this->txtName->Enabled = false;
             $this->lstClassCourse->AddAction(new QChangeEvent(), new QAjaxAction('lstClassCourse_Change'));
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
     }
     // Buttons
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->CausesValidation = true;
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     // Delete?
     if ($this->mctSignupForm->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         if ($this->mctSignupForm->SignupForm->CountSignupEntries()) {
             $this->btnDelete->AddAction(new QClickEvent(), new QAlertAction('This signup form already has signup entries and therefore cannot be deleted.  An alternative option would be to simply mark this form as "Inactive".'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         } else {
             $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this Signup Form?  This cannot be undone.'));
             $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         }
     }
 }
Exemplo n.º 11
0
 /**
  * Basic setup of edit-related QControls for a Group to be used for all group types
  * @return void
  */
 protected function SetupEditControls()
 {
     $this->mctGroup = new GroupMetaControl($this, $this->objGroup);
     $this->txtName = $this->mctGroup->txtName_Create();
     $this->txtName->Select();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtName->Required = true;
     $this->chkActiveFlag = $this->mctGroup->chkActiveFlag_Create();
     $this->chkActiveFlag->Name = 'Active?';
     $this->chkActiveFlag->Text = 'Check if this is an "Active" group.';
     $this->lstParentGroup = $this->mctGroup->lstParentGroup_Create();
     $this->lstParentGroup->Name = 'In Group Category';
     $this->lstEmailBroadcastType = $this->mctGroup->lstEmailBroadcastType_Create();
     $this->lstEmailBroadcastType->Instructions = '<span class="help" onclick="displayHelp(\'helpEmailBroadcastType\')"><img src="/assets/images/icons/help.png" alt="help"></span>';
     $this->txtToken = $this->mctGroup->txtToken_Create();
     $this->txtToken->Name = 'Email Address';
     $this->txtToken->HtmlAfter = '<span> @ groups.alcf.net</span>';
     $this->chkConfidentialFlag = $this->mctGroup->chkConfidentialFlag_Create();
     $this->chkConfidentialFlag->Name = 'Confidential?';
     $this->chkConfidentialFlag->Text = 'Check if this group is considered a "Confidential" group';
     // Confidentiality not for Group Categories
     if ($this->mctGroup->Group->GroupTypeId == GroupType::GroupCategory) {
         $this->chkConfidentialFlag->Visible = false;
         $this->chkConfidentialFlag->Checked = false;
     }
     // Setup Ministry with Rules
     if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) {
         $this->lstMinistry = $this->mctGroup->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name));
     } else {
         $intMinistryIdArray = array();
         foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) {
             $intMinistryIdArray[] = $objMinistry->Id;
         }
         $this->lstMinistry = $this->mctGroup->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name));
     }
     if ($this->mctGroup->EditMode) {
         $this->lstMinistry->Enabled = false;
     }
     // Setup EmailBroadcast-related controls
     $this->lstEmailBroadcastType->GetItem(0)->Name = '- None -';
     $this->lstEmailBroadcastType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'txtToken_Refresh'));
     $this->txtToken_Refresh();
     // Delete?
     if ($this->mctGroup->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         if ($this->mctGroup->Group->CountChildGroups()) {
             $this->btnDelete->AddAction(new QClickEvent(), new QAlertAction('This Group Category has child groups.  You must first move or delete those child groups before you can delete this Group Category.'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         } else {
             if ($this->mctGroup->Group->GroupTypeId == GroupType::GroupCategory) {
                 $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this group?  This will also delete all participation records and archived messages and cannot be undone.'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
             } else {
                 $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this group?  This will also delete all participation records and archived messages and cannot be undone.\\n\\nA better option would be to simply mark this group as "Inactive".'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
             }
         }
     }
 }
Exemplo n.º 12
0
 /**
  * Checks to see if an association exists with a specific Login
  * @param Login $objLogin
  * @return bool
  */
 public function IsLoginAssociated(Login $objLogin)
 {
     if (is_null($this->intId)) {
         throw new QUndefinedPrimaryKeyException('Unable to call IsLoginAssociated on this unsaved Ministry.');
     }
     if (is_null($objLogin->Id)) {
         throw new QUndefinedPrimaryKeyException('Unable to call IsLoginAssociated on this Ministry with an unsaved Login.');
     }
     $intRowCount = Ministry::QueryCount(QQ::AndCondition(QQ::Equal(QQN::Ministry()->Id, $this->intId), QQ::Equal(QQN::Ministry()->Login->LoginId, $objLogin->Id)));
     return $intRowCount > 0;
 }
Exemplo n.º 13
0
    ?>
		<br clear="all"/>
<?php 
}
?>
	</div>


<?php 
if (QApplication::$Login) {
    ?>
	<div class="navbar" style="background-color: #766; width: 100%; border-top: 2px solid #766; border-bottom: 2px solid #766; height: 19px;">
		<div style="width: 980px; margin: auto; font-size: 11px;">
			<div id="ministryMenu" onmouseout="mmTimer = setTimeout('ToggleMinistryMenu();', 350);" onmouseover="clearTimeout(mmTimer);">
<?php 
    foreach (Ministry::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
        $strCssClass = null;
        if (QApplication::$Ministry && QApplication::$Ministry->Id == $objMinistry->Id) {
            $strCssClass = ' class="selected"';
        }
        printf('<a href="/%s"%s>%s</a>', $objMinistry->Token, $strCssClass, $objMinistry->Name);
    }
    if (QApplication::$Ministry) {
        $strLabel = 'Ministry: ' . QApplication::$Ministry->Name;
    } else {
        $strLabel = 'Ministries & Depts';
    }
    ?>
			</div>
			<ul>
				<li id="ministryTab"><a href="#" onclick="return ToggleMinistryMenu();" id="ministryTabLink" <?php 
Exemplo n.º 14
0
 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a Ministry-based QQNode.
  * It will also verify that it is a proper Ministry-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'ministry') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "ministry".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::Ministry()->Id;
                 case 'Token':
                     return QQN::Ministry()->Token;
                 case 'Name':
                     return QQN::Ministry()->Name;
                 case 'ParentMinistryId':
                     return QQN::Ministry()->ParentMinistryId;
                 case 'ParentMinistry':
                     return QQN::Ministry()->ParentMinistry;
                 case 'GroupTypeBitmap':
                     return QQN::Ministry()->GroupTypeBitmap;
                 case 'SignupFormTypeBitmap':
                     return QQN::Ministry()->SignupFormTypeBitmap;
                 case 'ActiveFlag':
                     return QQN::Ministry()->ActiveFlag;
                 default:
                     throw new QCallerException('Simple Property not found in MinistryDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
Exemplo n.º 15
0
Arquivo: index.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->pnlMinistries = new QPanel($this);
     $this->pnlMinistries->TagName = 'ul';
     $this->pnlMinistries->CssClass = 'subnavSide subnavSideSmall';
     $this->pnlMinistries->AutoRenderChildren = true;
     $this->pxyMinistry = new QControlProxy($this);
     $this->pxyMinistry->AddAction(new QClickEvent(), new QAjaxAction('pxyMinistry_Click'));
     $this->pxyMinistry->AddAction(new QClickEvent(), new QTerminateAction());
     $blnFirst = true;
     foreach (Ministry::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         if ($objMinistry->IsLoginCanViewMinistry(QApplication::$Login)) {
             $pnlMinistry = new QPanel($this->pnlMinistries, 'pnlMinistry' . $objMinistry->Id);
             $pnlMinistry->TagName = 'li';
             $pnlMinistry->ActionParameter = $objMinistry->Id;
             if ($blnFirst) {
                 $blnFirst = false;
                 $pnlMinistry->CssClass = 'first';
             }
             $this->pnlMinistry_Refresh($objMinistry);
         }
     }
     // Last
     if ($blnFirst != true) {
         // only set if non-empty panel variable
         $pnlMinistry->CssClass = 'last';
     }
     $this->lstGroupType = new QListBox($this);
     $this->lstGroupType->AddAction(new QChangeEvent(), new QAjaxAction('lstGroupType_Change'));
     $this->lstGroupType->Visible = false;
     $this->chkViewAll = new QCheckBox($this);
     $this->chkViewAll->Text = 'View "Inactive" Groups as well';
     $this->chkViewAll->AddAction(new QClickEvent(), new QAjaxAction('chkViewAll_Click'));
     $this->chkViewAll->Visible = false;
     $this->lblMinistry = new QLabel($this);
     $this->lblMinistry->TagName = 'h3';
     $this->lblMinistry_Refresh();
     $this->dtgGroups = new QDataGrid($this);
     $this->dtgGroups->CssClass = 'datagrid';
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Name', '<?= $_FORM->RenderName($_ITEM); ?>', 'HtmlEntities=false', 'Width=260px'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Type', '<?= $_ITEM->Type; ?>', 'Width=120px'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Email', '<?= $_ITEM->EmailTypeHtml ; ?>', 'HtmlEntities=false', 'Width=350px'));
     $this->dtgGroups->SetDataBinder('dtgGroups_Bind');
     //			$this->dtgGroups->Visible = false;
     $this->btnGroupReport = new QButton($this);
     $this->btnGroupReport->CssClass = 'primary';
     $this->btnGroupReport->AddAction(new QClickEvent(), new QAjaxAction('btnGroupReport_Click'));
     $this->btnGroupReport->Name = "Growth Group Report";
     $this->btnGroupReport->Text = "Growth Group Report";
     $this->btnGroupReport->Visible = false;
     $this->btnGroupRegistrations = new QButton($this);
     $this->btnGroupRegistrations->CssClass = 'primary';
     $this->btnGroupRegistrations->AddAction(new QClickEvent(), new QAjaxAction('btnGroupRegistrations_Click'));
     $this->btnGroupRegistrations->Name = "Process New Growth Group Registrations";
     $this->btnGroupRegistrations->Text = "Process New Growth Group Registrations";
     $this->btnGroupRegistrations->Visible = false;
     $this->lblStartText = new QLabel($this);
     $this->lblStartText->Text = '<h3>Groups and Ministries</h3><p>Please select a ministry from the list on the right.</p>';
     $this->lblStartText->HtmlEntities = false;
     $this->SetUrlHashProcessor('Form_ProcessHash');
 }