public function testMultiLevel()
 {
     $arrPeople = Person::LoadAll(QQ::Clause(QQ::ExpandAsArray(QQN::Person()->Address), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone)));
     $targetPerson = null;
     foreach ($arrPeople as $objPerson) {
         if ($objPerson->LastName == "Wolfe") {
             $targetPerson = $objPerson;
         }
     }
     $this->assertEqual(sizeof($arrPeople), 12);
     $this->assertNotEqual($targetPerson, null, "Karen Wolfe found");
     $targetProject = null;
     foreach ($targetPerson->_ProjectAsManagerArray as $objProject) {
         if ($objProject->Name == "ACME Payment System") {
             $targetProject = $objProject;
         }
     }
     $this->assertEqual(sizeof($targetPerson->_ProjectAsManagerArray), 2, "2 projects found");
     $this->assertNotEqual($targetProject, null, "ACME Payment System project found");
     $targetMilestone = null;
     foreach ($targetProject->_MilestoneArray as $objMilestone) {
         if ($objMilestone->Name == "Milestone H") {
             $targetMilestone = $objMilestone;
         }
     }
     $this->assertEqual(sizeof($targetProject->_MilestoneArray), 4, "4 milestones found");
     $this->assertNotEqual($targetMilestone, null, "Milestone H found");
 }
Exemple #2
0
 public function RenderValue(AttributeValue $objValue)
 {
     switch ($objValue->Attribute->AttributeDataTypeId) {
         case AttributeDataType::Text:
             return QApplication::HtmlEntities($objValue->TextValue);
         case AttributeDataType::Checkbox:
             return $objValue->BooleanValue ? 'Yes' : 'No';
         case AttributeDataType::Date:
             return $objValue->DateValue->ToString('MMMM D, YYYY');
         case AttributeDataType::DateTime:
             return $objValue->DatetimeValue->ToString('MMMM D, YYYY') . ' at ' . $objValue->DatetimeValue->ToString('h:mmz');
         case AttributeDataType::ImmutableSingleDropdown:
         case AttributeDataType::MutableSingleDropdown:
             return $objValue->SingleAttributeOption != null ? QApplication::HtmlEntities($objValue->SingleAttributeOption->Name) : ' ';
         case AttributeDataType::ImmutableMultipleDropdown:
         case AttributeDataType::MutableMultipleDropdown:
             $strArray = array();
             foreach ($objValue->GetAttributeOptionAsMultipleArray(QQ::OrderBy(QQN::AttributeOption()->Name)) as $objOption) {
                 $strArray[] = '• ' . QApplication::HtmlEntities($objOption->Name);
             }
             return implode('<br/>', $strArray);
         default:
             throw new Exception('Unhandled Attribute Data Type');
     }
 }
 /**
  * Bind the Projects table to the html table.
  *
  * @throws QCallerException
  */
 protected function tblProjects_Bind()
 {
     // Expand the PersonAsTeamMember node as an array so that it will be included in each item sent to the columns.
     $clauses = QQ::ExpandAsArray(QQN::Project()->PersonAsTeamMember);
     // We load the data source, and set it to the datagrid's DataSource parameter
     $this->tblProjects->DataSource = Project::LoadAll($clauses);
 }
Exemple #4
0
 protected function Form_Create()
 {
     if (!QApplication::$Login) {
         QApplication::Redirect('/');
     }
     $this->objQcodoClass = QcodoClass::Load(QApplication::PathInfo(0));
     if (!$this->objQcodoClass) {
         throw new Exception('Invalid QcodoClass Id: ' . QApplication::PathInfo(0));
     }
     $this->lblName = new QLabel($this);
     $this->lblName->Text = $this->objQcodoClass->Name;
     $this->lstClassGroup = new QListBox($this);
     $this->lstClassGroup->Name = 'Class Group/Classification';
     foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objClassGroup) {
         $this->lstClassGroup->AddItem($objClassGroup->Name, $objClassGroup->Id, $objClassGroup->Id == $this->objQcodoClass->ClassGroupId);
     }
     $this->chkEnumerationFlag = new QCheckBox($this);
     $this->chkEnumerationFlag->Checked = $this->objQcodoClass->EnumerationFlag;
     $this->chkEnumerationFlag->Name = 'Enumeration Class Flag';
     $this->txtShortDescription = new QTextBox($this);
     $this->txtShortDescription->Name = QApplication::Translate('Short Description');
     $this->txtShortDescription->Text = $this->objQcodoClass->ShortDescription;
     $this->txtShortDescription->TextMode = QTextMode::MultiLine;
     $this->txtExtendedDescription = new QWriteBox($this);
     $this->txtExtendedDescription->Name = QApplication::Translate('Extended Description');
     $this->txtExtendedDescription->Text = $this->objQcodoClass->ExtendedDescription;
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click'));
     $this->btnCancel->CausesValidation = false;
 }
 public function GetControlHtml()
 {
     $strLogContents = '';
     foreach (NarroLog::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroLog()->ProjectId, $this->intProjectId), QQ::Equal(QQN::NarroLog()->LanguageId, $this->intLanguageId), QQ::GreaterThan(QQN::NarroLog()->Date, $this->dttStart))) as $objLogEntry) {
         switch ($objLogEntry->Priority) {
             case NarroLog::PRIORITY_INFO:
                 $strLogContents .= '<div class="info"';
                 break;
             case NarroLog::PRIORITY_WARN:
                 $strLogContents .= '<div class="warning"';
                 break;
             case NarroLog::PRIORITY_ERROR:
                 $strLogContents .= '<div class="error"';
                 break;
             default:
                 $strLogContents .= '<div';
         }
         $strLogContents .= sprintf('title="%s">%s</div>', $objLogEntry->Date, nl2br(NarroString::HtmlEntities($objLogEntry->Message)));
     }
     $this->strText = sprintf('<div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
             <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-state-active ui-corner-top">
             <span class="ui-icon ui-icon-triangle-1-s"></span>
             <a>%s</a>
             </h3>
             <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="max-height:300px;overflow:auto">
             %s
             </div>
             </div>', t('Operation log'), $strLogContents);
     return parent::GetControlHtml();
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgCustomFieldSelection_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colCustomFieldSelectionId = new QDataGridColumn(QApplication::Translate('Custom Field Selection Id'), '<?= $_ITEM->CustomFieldSelectionId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->CustomFieldSelectionId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->CustomFieldSelectionId, false)));
     $this->colCustomFieldValueId = new QDataGridColumn(QApplication::Translate('Custom Field Value Id'), '<?= $_FORM->dtgCustomFieldSelection_CustomFieldValue_Render($_ITEM); ?>');
     $this->colEntityQtypeId = new QDataGridColumn(QApplication::Translate('Entity Qtype'), '<?= $_FORM->dtgCustomFieldSelection_EntityQtypeId_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityQtypeId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityQtypeId, false)));
     $this->colEntityId = new QDataGridColumn(QApplication::Translate('Entity Id'), '<?= $_ITEM->EntityId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityId, false)));
     // Setup DataGrid
     $this->dtgCustomFieldSelection = new QDataGrid($this);
     $this->dtgCustomFieldSelection->CellSpacing = 0;
     $this->dtgCustomFieldSelection->CellPadding = 4;
     $this->dtgCustomFieldSelection->BorderStyle = QBorderStyle::Solid;
     $this->dtgCustomFieldSelection->BorderWidth = 1;
     $this->dtgCustomFieldSelection->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgCustomFieldSelection->Paginator = new QPaginator($this->dtgCustomFieldSelection);
     $this->dtgCustomFieldSelection->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgCustomFieldSelection->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgCustomFieldSelection->SetDataBinder('dtgCustomFieldSelection_Bind');
     $this->dtgCustomFieldSelection->AddColumn($this->colEditLinkColumn);
     $this->dtgCustomFieldSelection->AddColumn($this->colCustomFieldSelectionId);
     $this->dtgCustomFieldSelection->AddColumn($this->colCustomFieldValueId);
     $this->dtgCustomFieldSelection->AddColumn($this->colEntityQtypeId);
     $this->dtgCustomFieldSelection->AddColumn($this->colEntityId);
 }
Exemple #7
0
 protected function Form_Create()
 {
     $this->mctObject = ClassInstructorMetaControl::CreateFromPathInfo($this, QMetaControlCreateType::CreateOnRecordNotFound);
     if ($this->mctObject->EditMode) {
         $this->strPageTitle .= 'Edit Instructor';
     } else {
         $this->strPageTitle .= 'Create New Instructor';
     }
     $this->lstLogin = $this->mctObject->lstLogin_Create(null, QQ::OrCondition(QQ::AndCondition(QQ::IsNull(QQN::Login()->ClassInstructor->Id), QQ::Equal(QQN::Login()->LoginActiveFlag, true), QQ::Equal(QQN::Login()->DomainActiveFlag, true)), QQ::Equal(QQN::Login()->Id, $this->mctObject->ClassInstructor->LoginId)), QQ::OrderBy(QQN::Login()->FirstName, QQN::Login()->LastName));
     $this->txtDisplayName = $this->mctObject->txtDisplayName_Create();
     $this->txtDisplayName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->btnSave = new QButton($this);
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->Text = $this->mctObject->EditMode ? 'Update' : 'Create';
     $this->btnSave->CausesValidation = true;
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     if ($this->mctObject->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDirectoryToken_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Id, false)));
     $this->colToken = new QDataGridColumn(QApplication::Translate('Token'), '<?= QString::Truncate($_ITEM->Token, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Token), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Token, false)));
     $this->colPath = new QDataGridColumn(QApplication::Translate('Path'), '<?= QString::Truncate($_ITEM->Path, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Path), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Path, false)));
     $this->colCoreFlag = new QDataGridColumn(QApplication::Translate('Core Flag'), '<?= ($_ITEM->CoreFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->CoreFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->CoreFlag, false)));
     $this->colRelativeFlag = new QDataGridColumn(QApplication::Translate('Relative Flag'), '<?= ($_ITEM->RelativeFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->RelativeFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->RelativeFlag, false)));
     // Setup DataGrid
     $this->dtgDirectoryToken = new QDataGrid($this);
     $this->dtgDirectoryToken->CellSpacing = 0;
     $this->dtgDirectoryToken->CellPadding = 4;
     $this->dtgDirectoryToken->BorderStyle = QBorderStyle::Solid;
     $this->dtgDirectoryToken->BorderWidth = 1;
     $this->dtgDirectoryToken->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgDirectoryToken->Paginator = new QPaginator($this->dtgDirectoryToken);
     $this->dtgDirectoryToken->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgDirectoryToken->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgDirectoryToken->SetDataBinder('dtgDirectoryToken_Bind');
     $this->dtgDirectoryToken->AddColumn($this->colEditLinkColumn);
     $this->dtgDirectoryToken->AddColumn($this->colId);
     $this->dtgDirectoryToken->AddColumn($this->colToken);
     $this->dtgDirectoryToken->AddColumn($this->colPath);
     $this->dtgDirectoryToken->AddColumn($this->colCoreFlag);
     $this->dtgDirectoryToken->AddColumn($this->colRelativeFlag);
 }
Exemple #9
0
 protected function Form_Create()
 {
     $this->strInitialToken = QApplication::PathInfo(0);
     if ($this->strInitialToken) {
         $this->objList = CommunicationList::LoadByToken($this->strInitialToken);
     }
     $this->chkBtnListArray = array();
     foreach (CommunicationList::LoadArrayBySubscribable(true, QQ::OrderBy(QQN::CommunicationList()->Token)) as $objEmailList) {
         $objItemList = new QCheckBox($this);
         $objItemList->Name = $objEmailList->Token;
         $objItemList->Text = $objEmailList->Name . ' - ' . $objEmailList->Description . "\n";
         if ($objEmailList->Token == $this->strInitialToken) {
             $objItemList->Checked = true;
         }
         $this->chkBtnListArray[] = $objItemList;
     }
     $this->txtEmail = new QTextBox($this);
     $this->txtEmail->Name = 'Email: ';
     $this->txtEmail->Visible = true;
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'First Name: ';
     $this->txtFirstName->Visible = true;
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Last Name';
     $this->txtLastName->Visible = true;
     $this->btnSubscribe = new QButton($this);
     $this->btnSubscribe->Name = 'Subscribe';
     $this->btnSubscribe->Text = 'Subscribe';
     $this->btnSubscribe->CssClass = 'primary';
     $this->btnSubscribe->Visible = true;
     $this->btnSubscribe->AddAction(new QClickEvent(), new QAjaxAction('btnSubscribe_Click'));
     $this->lblMessage = new QLabel($this);
     $this->lblMessage->FontBold = true;
     $this->lblMessage->Visible = false;
 }
Exemple #10
0
function CreateGroupParticipations(mysqli $objAcsDatabase, Group $objGroup, GroupRole $objRole, $intAcsGroupId, $intAcsReserveId)
{
    print "Adding for Group: " . $objGroup->Name . "\r\n      ";
    if ($intAcsReserveId) {
        $objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s AND reserveid1=%s', $intAcsGroupId, $intAcsReserveId));
    } else {
        $objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s', $intAcsGroupId));
    }
    while ($objRow = $objResult->fetch_array()) {
        $objAttributeValueArray = AttributeValue::QueryArray(QQ::AndCondition(QQ::Equal(QQN::AttributeValue()->AttributeId, 2), QQ::Equal(QQN::AttributeValue()->TextValue, $objRow['indvid'])));
        if (count($objAttributeValueArray) != 1) {
            printf("Issue with awgrrost.pkid of %s - IndvId %s for Group %s - AVCount of %s\r\n", $objRow['pkid'], $objRow['indvid'], $objGroup->Name, count($objAttributeValueArray));
        } else {
            $objPerson = $objAttributeValueArray[0]->Person;
            $dttStartDate = new QDateTime($objRow['dateadded']);
            if ($objRow['dateremoved']) {
                $dttEndDate = new QDateTime($objRow['dateremoved']);
            } else {
                $dttEndDate = null;
            }
            $objGroup->AddPerson($objPerson, $objRole->Id, $dttStartDate, $dttEndDate);
            print "*";
        }
    }
    print "\r\n      Done.\r\n\r\n";
}
Exemple #11
0
 public function dtgItems_Bind()
 {
     $intYear = QApplication::PathInfo(0);
     $dttStart = new QDateTime($intYear . '-01-01');
     $dttEnd = new QDateTime($dttStart);
     $dttEnd->Year += 1;
     $dttStart->SetTime(null, null, null);
     $dttEnd->SetTime(null, null, null);
     $objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     $strNameArray = array();
     $strNameValueArray = array();
     while ($objPerson = Person::InstantiateCursor($objPersonCursor)) {
         $strToken = strtolower($objPerson->FirstName . '|' . $objPerson->LastName);
         $strToken = str_replace(' ', '', $strToken);
         $strToken = str_replace('.', '', $strToken);
         $strToken = str_replace(',', '', $strToken);
         $strToken = str_replace('-', '', $strToken);
         $strToken = str_replace('_', '', $strToken);
         $strToken = str_replace('/', '', $strToken);
         if (array_key_exists($strToken, $strNameArray)) {
             $strNameValueArray[$strToken] = $objPerson->FirstName . ' ' . $objPerson->LastName;
         }
         $strNameArray[$strToken] = true;
     }
     $this->dtgItems->DataSource = $strNameValueArray;
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgParameter_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->Id, false)));
     $this->colOperationId = new QDataGridColumn(QApplication::Translate('Operation Id'), '<?= $_FORM->dtgParameter_Operation_Render($_ITEM); ?>');
     $this->colOrderNumber = new QDataGridColumn(QApplication::Translate('Order Number'), '<?= $_ITEM->OrderNumber; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->OrderNumber), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->OrderNumber, false)));
     $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgParameter_Variable_Render($_ITEM); ?>');
     $this->colReferenceFlag = new QDataGridColumn(QApplication::Translate('Reference Flag'), '<?= ($_ITEM->ReferenceFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->ReferenceFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->ReferenceFlag, false)));
     // Setup DataGrid
     $this->dtgParameter = new QDataGrid($this);
     $this->dtgParameter->CellSpacing = 0;
     $this->dtgParameter->CellPadding = 4;
     $this->dtgParameter->BorderStyle = QBorderStyle::Solid;
     $this->dtgParameter->BorderWidth = 1;
     $this->dtgParameter->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgParameter->Paginator = new QPaginator($this->dtgParameter);
     $this->dtgParameter->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgParameter->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgParameter->SetDataBinder('dtgParameter_Bind');
     $this->dtgParameter->AddColumn($this->colEditLinkColumn);
     $this->dtgParameter->AddColumn($this->colId);
     $this->dtgParameter->AddColumn($this->colOperationId);
     $this->dtgParameter->AddColumn($this->colOrderNumber);
     $this->dtgParameter->AddColumn($this->colVariableId);
     $this->dtgParameter->AddColumn($this->colReferenceFlag);
 }
Exemple #13
0
 public function dtgWikiItems_Bind()
 {
     $objCondition = QQ::All();
     if (trim($this->txtTitle->Text)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentName, '%' . trim($this->txtTitle->Text) . '%'));
     }
     if ($strPath = trim($this->txtPath->Text)) {
         $strPath = WikiItem::SanitizeForPath($strPath, $intWikiItemTypeId);
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->Path, $strPath . '%'));
     }
     if ($intValue = $this->lstWikiItemType->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::WikiItem()->WikiItemTypeId, $intValue));
     }
     if (trim($this->txtPostedBy->Text)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentPostedByPerson->DisplayName, trim($this->txtPostedBy->Text) . '%'));
     }
     $this->dtgWikiItems->TotalItemCount = WikiItem::QueryCount($objCondition);
     $objClauses = array();
     if ($objClause = $this->dtgWikiItems->LimitClause) {
         $objClauses[] = $objClause;
     }
     if ($objClause = $this->dtgWikiItems->OrderByClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgWikiItems->DataSource = WikiItem::QueryArray($objCondition, $objClauses);
 }
 /**
  * @param DleCategory $objDleCategory The DB ORM object to process
  */
 protected function process_object($objDleCategory)
 {
     // wp: term_taxonomy_id, term_id, description, parent
     // dl: id,               id,      descr,       parentid
     $wpTerms = $objDleCategory->LoadWpTerms();
     if (!$wpTerms) {
         throw QCallerException(QApplication::Translate("Failed to find the WpTerm object for DleCategory."));
     }
     $wpTermsParent = null;
     if ($objDleCategory->ParentidObject) {
         $wpTermsParent = $objDleCategory->ParentidObject->LoadWpTerms();
     }
     $intWpTermsParentId = 0;
     if ($wpTermsParent) {
         $intWpTermsParentId = $wpTermsParent->TermId;
     }
     // check if already copied
     if (!WpTermTaxonomy::QueryCount(QQ::AndCondition(QQ::Equal(QQN::WpTermTaxonomy()->TermId, $wpTerms->TermId), QQ::Equal(QQN::WpTermTaxonomy()->Parent, $intWpTermsParentId)))) {
         $objWpTermTaxonomy = new WpTermTaxonomy();
         $objWpTermTaxonomy->Initialize();
         // set defaults
         $objWpTermTaxonomy->TermId = $wpTerms->TermId;
         $objWpTermTaxonomy->Description = $objDleCategory->Descr;
         $objWpTermTaxonomy->Parent = $intWpTermsParentId;
         $objWpTermTaxonomy->Taxonomy = "category";
         $objWpTermTaxonomy->Count = 0;
         $objWpTermTaxonomy->Save();
         $this->intTermTaxonomyCount++;
     }
 }
 protected function SetupPanel()
 {
     // Get and Validate the Comments Object
     $this->mctComments = CommentMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);
     if (!$this->mctComments->EditMode) {
         // Trying to create a NEW comment
         $this->mctComments->Comment->Person = $this->objPerson;
         $this->mctComments->Comment->PostedByLogin = QApplication::$Login;
         $this->mctComments->Comment->CommentPrivacyTypeId = CommentPrivacyType::Staff;
         $this->btnSave->Text = 'Create';
     } else {
         // Ensure the this loginId can modify this comment
         if (!$this->mctComments->Comment->IsLoginCanEdit(QApplication::$Login)) {
             return $this->ReturnTo('#comments');
         }
         $this->btnSave->Text = 'Update';
     }
     // Create Controls
     $this->lstPrivacyLevel = $this->mctComments->lstCommentPrivacyType_Create();
     if (!QApplication::$Login->IsPermissionAllowed(PermissionType::AccessConfidentialNotes)) {
         $this->lstPrivacyLevel->RemoveItem(0);
     }
     $this->lstCategory = $this->mctComments->lstCommentCategory_Create(null, null, QQ::OrderBy(QQN::CommentCategory()->Name));
     $this->txtComment = $this->mctComments->txtComment_Create();
     $this->txtComment->Width = '500px';
     $this->txtComment->Height = '200px';
     $this->dtxDateAction = $this->mctComments->dtxDateAction_Create();
     $this->calDateAction = $this->mctComments->calDateAction_Create();
 }
 public static function RestoreByNameForClass($strName, $intClassId, $strVersion, $objFile)
 {
     $objConstant = QcodoConstant::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::QcodoConstant()->QcodoClassId, $intClassId), QQ::Equal(QQN::QcodoConstant()->Variable->Name, $strName)));
     if (!$objConstant) {
         $objVariable = new Variable();
         $objVariable->Name = $strName;
         $objVariable->VariableTypeId = VariableType::String;
         $objVariable->FirstVersion = $strVersion;
         $objVariable->Save();
         $objConstant = new QcodoConstant();
         $objConstant->Variable = $objVariable;
         $objConstant->File = $objFile;
         $objConstant->QcodoClassId = $intClassId;
         $objConstant->Save();
     } else {
         if ($objConstant->Variable->LastVersion) {
             $objConstant->Variable->LastVersion = null;
             $objConstant->Variable->Save();
         }
         if ($objFile->Id != $objConstant->intFileId) {
             $objConstant->File = $objFile;
             $objConstant->Save();
         }
     }
     return $objConstant;
 }
 protected function SetupPanel()
 {
     $this->mctPledge = StewardshipPledgeMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);
     if (!$this->mctPledge->EditMode) {
         // Trying to create a NEW comment
         $this->mctPledge->StewardshipPledge->DateStarted = QDateTime::Now();
         $this->mctPledge->StewardshipPledge->Person = $this->objPerson;
         $this->mctPledge->StewardshipPledge->FulfilledFlag = false;
         $this->mctPledge->StewardshipPledge->ActiveFlag = true;
         $this->btnSave->Text = 'Create';
     } else {
         $this->btnSave->Text = 'Update';
         $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 DELETE this pledge?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
     // Create Controls
     $this->lstStewardshipFund = $this->mctPledge->lstStewardshipFund_Create(null, QQ::All(), array(QQ::OrderBy(QQN::StewardshipFund()->Name)));
     $this->calDateStarted = $this->mctPledge->calDateStarted_Create();
     $this->calDateEnded = $this->mctPledge->calDateEnded_Create();
     $this->txtPledgeAmount = $this->mctPledge->txtPledgeAmount_Create();
     $this->chkActiveFlag = $this->mctPledge->chkActiveFlag_Create();
     $this->chkActiveFlag->Text = 'Note: All fulfilled pledges automatically considred "inactive".';
     $this->calDateStarted->MinimumYear = 2000;
     $this->calDateStarted->MaximumYear = date('Y') + 10;
     $this->calDateEnded->MinimumYear = 2000;
     $this->calDateEnded->MaximumYear = date('Y') + 10;
 }
Exemple #18
0
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     // Note that although we are using "Beta 2" style of SortBy and LimitInfo, QDataGrid does have support to "convert" QQ::OrderBy to SortBy strings.
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)));
     /*			$this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', 'SortByCommand="id ASC"', 'ReverseSortByCommand="id DESC"');*/
     $this->colFirstName = new QDataGridColumn(QApplication::Translate('First Name'), '<?= $_ITEM->FirstName; ?>', 'SortByCommand="first_name ASC"', 'ReverseSortByCommand="first_name DESC"');
     $this->colLastName = new QDataGridColumn(QApplication::Translate('Last Name'), '<?= $_ITEM->LastName; ?>', 'SortByCommand="last_name ASC"', 'ReverseSortByCommand="last_name DESC"');
     // Setup DataGrid
     $this->dtgPerson = new QDataGrid($this);
     $this->dtgPerson->CellSpacing = 0;
     $this->dtgPerson->CellPadding = 4;
     $this->dtgPerson->BorderStyle = QBorderStyle::Solid;
     $this->dtgPerson->BorderWidth = 1;
     $this->dtgPerson->GridLines = QGridLines::Both;
     $this->dtgPerson->SortColumnIndex = 0;
     // Datagrid Paginator
     $this->dtgPerson->Paginator = new QPaginator($this->dtgPerson);
     $this->dtgPerson->ItemsPerPage = 5;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgPerson->UseAjax = true;
     // Add the Columns to the DataGrid
     $this->dtgPerson->AddColumn($this->colId);
     $this->dtgPerson->AddColumn($this->colFirstName);
     $this->dtgPerson->AddColumn($this->colLastName);
 }
 protected function SetupPanel()
 {
     if (!$this->objGroup->IsLoginCanEdit(QApplication::$Login)) {
         $this->ReturnTo('/groups/');
     }
     // See if Group can have Explicitly Defined Participants
     if (!$this->objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) {
         return $this->ReturnTo('#' . $this->objGroup->Id);
     }
     $this->pnlPerson = new SelectPersonPanel($this);
     $this->pnlPerson->Name = 'Participant';
     $this->pnlPerson->AllowCreate = true;
     $this->pnlPerson->Required = true;
     $this->lstRole = new QListBox($this);
     $this->lstRole->Name = 'Role';
     $this->lstRole->Required = true;
     $this->lstRole->AddItem('- Select One -');
     foreach ($this->objGroup->Ministry->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)) as $objGroupRole) {
         $this->lstRole->AddItem($objGroupRole->Name, $objGroupRole->Id);
     }
     $this->dtxDateStart = new QDateTimeTextBox($this);
     $this->dtxDateStart->Name = 'Participation Started';
     $this->dtxDateStart->Required = true;
     $this->calDateStart = new QCalendar($this, $this->dtxDateStart);
     $this->dtxDateEnd = new QDateTimeTextBox($this);
     $this->dtxDateEnd->Name = 'Participation Ended';
     $this->calDateEnd = new QCalendar($this, $this->dtxDateEnd);
     $this->dtxDateStart->RemoveAllActions(QClickEvent::EventName);
     $this->dtxDateEnd->RemoveAllActions(QClickEvent::EventName);
     $this->pnlPerson->txtName->Focus();
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgClassProperty_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id, false)));
     $this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_FORM->dtgClassProperty_QcodoClass_Render($_ITEM); ?>');
     $this->colVariableGroupId = new QDataGridColumn(QApplication::Translate('Variable Group Id'), '<?= $_FORM->dtgClassProperty_VariableGroup_Render($_ITEM); ?>');
     $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgClassProperty_Variable_Render($_ITEM); ?>');
     $this->colClassVariableId = new QDataGridColumn(QApplication::Translate('Class Variable Id'), '<?= $_FORM->dtgClassProperty_ClassVariable_Render($_ITEM); ?>');
     $this->colReadOnlyFlag = new QDataGridColumn(QApplication::Translate('Read Only Flag'), '<?= ($_ITEM->ReadOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag, false)));
     $this->colWriteOnlyFlag = new QDataGridColumn(QApplication::Translate('Write Only Flag'), '<?= ($_ITEM->WriteOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag, false)));
     // Setup DataGrid
     $this->dtgClassProperty = new QDataGrid($this);
     $this->dtgClassProperty->CellSpacing = 0;
     $this->dtgClassProperty->CellPadding = 4;
     $this->dtgClassProperty->BorderStyle = QBorderStyle::Solid;
     $this->dtgClassProperty->BorderWidth = 1;
     $this->dtgClassProperty->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgClassProperty->Paginator = new QPaginator($this->dtgClassProperty);
     $this->dtgClassProperty->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgClassProperty->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgClassProperty->SetDataBinder('dtgClassProperty_Bind');
     $this->dtgClassProperty->AddColumn($this->colEditLinkColumn);
     $this->dtgClassProperty->AddColumn($this->colId);
     $this->dtgClassProperty->AddColumn($this->colQcodoClassId);
     $this->dtgClassProperty->AddColumn($this->colVariableGroupId);
     $this->dtgClassProperty->AddColumn($this->colVariableId);
     $this->dtgClassProperty->AddColumn($this->colClassVariableId);
     $this->dtgClassProperty->AddColumn($this->colReadOnlyFlag);
     $this->dtgClassProperty->AddColumn($this->colWriteOnlyFlag);
 }
Exemple #21
0
 public function __construct(QcodoClass $objClass, $objParentControl, $strControlId = null)
 {
     parent::__construct($objParentControl, $strControlId);
     $this->objQcodoClass = $objClass;
     $this->strTemplate = 'ClassPanel.tpl.php';
     $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name;
     $this->strShortDescriptionHtml = $this->objQcodoClass->ShortDescriptionAsHtml;
     if (!$this->strShortDescriptionHtml) {
         $this->strShortDescriptionHtml = '<span style="color: #888888;"><i>No description entered yet.</i></span>';
     }
     $this->strLongDescriptionHtml = QWriteBox::DisplayHtml($this->objQcodoClass->ExtendedDescription, 'writebox_code');
     $this->strVersion = 'Qcodo >= ' . $this->objQcodoClass->FirstVersion;
     if ($this->objQcodoClass->LastVersion) {
         $this->strVersion .= ' - Deprecated as of ' . $this->objQcodoClass->LastVersion;
     }
     $this->strParentClassArray[$objClass->Id] = $objClass->DisplayName;
     $objParentClass = $objClass->ParentQcodoClass;
     while ($objParentClass) {
         $this->strParentClassArray[$objParentClass->Id] = $objParentClass->DisplayName;
         $objParentClass = $objParentClass->ParentQcodoClass;
     }
     $this->strParentClassArray = array_reverse($this->strParentClassArray, true);
     foreach ($this->objQcodoClass->GetChildQcodoClassArray(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objChildClass) {
         $this->strChildClassArray[$objChildClass->Id] = $objChildClass->DisplayName;
     }
     if (QApplication::$Login) {
         $this->strEditLink = '<div class="edit_link" title="Edit" onclick="document.location=\'/edit_class.php/';
         $this->strEditLink .= $this->objQcodoClass->Id;
         $this->strEditLink .= '\'">EDIT</div>';
     }
 }
Exemple #22
0
 public function dtgStaff_Bind()
 {
     $objConditions = QQ::All();
     if ($this->lstMinistry->SelectedValue) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->Ministry->MinistryId, $this->lstMinistry->SelectedValue));
     }
     if ($this->lstActiveFlag->SelectedValue) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->DomainActiveFlag, true), QQ::Equal(QQN::Login()->LoginActiveFlag, true));
     } else {
         $objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::Login()->DomainActiveFlag, false), QQ::Equal(QQN::Login()->LoginActiveFlag, false)));
     }
     $this->dtgStaff->TotalItemCount = Login::QueryCount($objConditions);
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgStaff->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgStaff->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from Login, given the clauses above
     $this->dtgStaff->DataSource = Login::QueryArray($objConditions, $objClauses);
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgAudit_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colAuditId = new QDataGridColumn(QApplication::Translate('Audit Id'), '<?= $_ITEM->AuditId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId, false)));
     $this->colEntityQtypeId = new QDataGridColumn(QApplication::Translate('Entity Qtype'), '<?= $_FORM->dtgAudit_EntityQtypeId_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId, false)));
     $this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_FORM->dtgAudit_CreatedByObject_Render($_ITEM); ?>');
     $this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_FORM->dtgAudit_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate, false)));
     $this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_FORM->dtgAudit_ModifiedByObject_Render($_ITEM); ?>');
     $this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate, false)));
     // Setup DataGrid
     $this->dtgAudit = new QDataGrid($this);
     $this->dtgAudit->CellSpacing = 0;
     $this->dtgAudit->CellPadding = 4;
     $this->dtgAudit->BorderStyle = QBorderStyle::Solid;
     $this->dtgAudit->BorderWidth = 1;
     $this->dtgAudit->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgAudit->Paginator = new QPaginator($this->dtgAudit);
     $this->dtgAudit->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgAudit->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgAudit->SetDataBinder('dtgAudit_Bind');
     $this->dtgAudit->AddColumn($this->colEditLinkColumn);
     $this->dtgAudit->AddColumn($this->colAuditId);
     $this->dtgAudit->AddColumn($this->colEntityQtypeId);
     $this->dtgAudit->AddColumn($this->colCreatedBy);
     $this->dtgAudit->AddColumn($this->colCreationDate);
     $this->dtgAudit->AddColumn($this->colModifiedBy);
     $this->dtgAudit->AddColumn($this->colModifiedDate);
 }
 function getPrimaryResource($strResourceName, $intResourceID, $arrVariables)
 {
     if ($intResourceID) {
         $objPrimaryData = call_user_func(array(ucwords($strResourceName), 'Load'), $intResourceID);
     } else {
         // IF VARIABLES PASSED, USE IN QUERY
         if (!empty($arrVariables)) {
             $arrSearch = array();
             // LOOP THROUGH VARIABLES
             foreach ($arrVariables as $strField => $strValue) {
                 // IF NOT _VARIABLE
                 if (substr($strField, 0, 1) != '_') {
                     // ADD VARIABLE TO SEARCH ARRAY;
                     $objQQN = call_user_func(array('QQN', $strResourceName));
                     $objQQNode = $objQQN->{ucwords($strField)};
                     $arrSearch[] = QQ::Equal($objQQNode, $strValue);
                 }
             }
             if (!empty($arrSearch)) {
                 $objPrimaryData = call_user_func(array($strResourceName, 'QueryArray'), call_user_func(array('QQ', 'AndCondition'), $arrSearch));
             } else {
                 $objPrimaryData = call_user_func(array($strResourceName, 'LoadAll'));
             }
         } else {
             $objPrimaryData = call_user_func(array($strResourceName, 'LoadAll'));
         }
     }
     return $objPrimaryData;
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDatagridColumnPreference_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colDatagridColumnPreferenceId = new QDataGridColumn(QApplication::Translate('Datagrid Column Preference Id'), '<?= $_ITEM->DatagridColumnPreferenceId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId, false)));
     $this->colDatagridId = new QDataGridColumn(QApplication::Translate('Datagrid Id'), '<?= $_FORM->dtgDatagridColumnPreference_Datagrid_Render($_ITEM); ?>');
     $this->colColumnName = new QDataGridColumn(QApplication::Translate('Column Name'), '<?= QString::Truncate($_ITEM->ColumnName, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName, false)));
     $this->colUserAccountId = new QDataGridColumn(QApplication::Translate('User Account Id'), '<?= $_FORM->dtgDatagridColumnPreference_UserAccount_Render($_ITEM); ?>');
     $this->colDisplayFlag = new QDataGridColumn(QApplication::Translate('Display Flag'), '<?= ($_ITEM->DisplayFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag, false)));
     // Setup DataGrid
     $this->dtgDatagridColumnPreference = new QDataGrid($this);
     $this->dtgDatagridColumnPreference->CellSpacing = 0;
     $this->dtgDatagridColumnPreference->CellPadding = 4;
     $this->dtgDatagridColumnPreference->BorderStyle = QBorderStyle::Solid;
     $this->dtgDatagridColumnPreference->BorderWidth = 1;
     $this->dtgDatagridColumnPreference->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgDatagridColumnPreference->Paginator = new QPaginator($this->dtgDatagridColumnPreference);
     $this->dtgDatagridColumnPreference->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgDatagridColumnPreference->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgDatagridColumnPreference->SetDataBinder('dtgDatagridColumnPreference_Bind');
     $this->dtgDatagridColumnPreference->AddColumn($this->colEditLinkColumn);
     $this->dtgDatagridColumnPreference->AddColumn($this->colDatagridColumnPreferenceId);
     $this->dtgDatagridColumnPreference->AddColumn($this->colDatagridId);
     $this->dtgDatagridColumnPreference->AddColumn($this->colColumnName);
     $this->dtgDatagridColumnPreference->AddColumn($this->colUserAccountId);
     $this->dtgDatagridColumnPreference->AddColumn($this->colDisplayFlag);
 }
 public function testSelectSubsetInExpandAsArray()
 {
     $objPersonArray = Person::LoadAll(QQ::Clause(QQ::Select(QQN::Person()->FirstName), QQ::ExpandAsArray(QQN::Person()->Address, QQ::Select(QQN::Person()->Address->Street, QQN::Person()->Address->City)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager, QQ::Select(QQN::Person()->ProjectAsManager->StartDate)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone, QQ::Select(QQN::Person()->ProjectAsManager->Milestone->Name))));
     foreach ($objPersonArray as $objPerson) {
         $this->assertNull($objPerson->LastName, "LastName should be null, since it was not selected");
         $this->assertNotNull($objPerson->Id, "Id should not be null since it's always added to the select list");
         if (sizeof($objPerson->_AddressArray) > 0) {
             foreach ($objPerson->_AddressArray as $objAddress) {
                 $this->assertNotNull($objAddress->Id, "Address->Id should not be null since it's always added to the select list");
                 $this->assertNull($objAddress->PersonId, "Address->PersonId should be null, since it was not selected");
             }
         }
         if (sizeof($objPerson->_ProjectAsManagerArray) > 0) {
             foreach ($objPerson->_ProjectAsManagerArray as $objProject) {
                 $this->assertNotNull($objProject->Id, "Project->Id should not be null since it's always added to the select list");
                 $this->assertNull($objProject->Name, "Project->Name should be null, since it was not selected");
                 if (sizeof($objProject->_MilestoneArray) > 0) {
                     foreach ($objProject->_MilestoneArray as $objMilestone) {
                         $this->assertNotNull($objMilestone->Id, "Milestone->Id should not be null since it's always added to the select list");
                         $this->assertNull($objMilestone->ProjectId, "Milestone->ProjectId should be null, since it was not selected");
                     }
                 }
             }
         }
     }
 }
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "Expanded":
             $this->blnExpanded = $mixValue;
             if (!$this->blnDataBound) {
                 $this->blnDataBound = true;
                 // Get the class in question
                 $intClassId = $this->strItemId;
                 $objClass = QcodoClass::Load($intClassId);
                 // Bind Children
                 foreach ($objClass->Operations as $objOperation) {
                     new QTreeNavItem($objOperation->DisplayName, $intClassId . 'm' . $objOperation->Id, false, $this->objTreeNav->GetItem($intClassId . 'm'), $intClassId . 'm' . $objOperation->Id);
                 }
                 foreach ($objClass->GetPropertiesForVariableGroupId(null) as $objProperty) {
                     new QTreeNavItem($objProperty->DisplayName, $intClassId . 'p' . $objProperty->Id, false, $this->objTreeNav->GetItem($intClassId . 'p'), $intClassId . 'p' . $objProperty->Id);
                 }
                 foreach ($objClass->GetVariablesForVariableGroupId(null) as $objClassVariable) {
                     new QTreeNavItem($objClassVariable->DisplayName, $intClassId . 'v' . $objClassVariable->Id, false, $this->objTreeNav->GetItem($intClassId . 'v'), $intClassId . 'v' . $objClassVariable->Id);
                 }
                 foreach ($objClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name))) as $objConstant) {
                     new QTreeNavItem($objConstant->Variable->Name, $intClassId . 'c' . $objConstant->Id, false, $this->objTreeNav->GetItem($intClassId . 'c'), $intClassId . 'c' . $objConstant->Id);
                 }
             }
             break;
         default:
             try {
                 return parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Exemple #28
0
 protected function Form_Create()
 {
     if (!QApplication::$Login) {
         QApplication::Redirect('/');
     }
     $this->objVariable = ClassVariable::Load(QApplication::PathInfo(0));
     if (!$this->objVariable) {
         throw new Exception('Invalid Variable Id: ' . QApplication::PathInfo(0));
     }
     $this->lblClass = new QLabel($this);
     $this->lblClass->Text = $this->objVariable->QcodoClass->Name;
     $this->lblName = new QLabel($this);
     $this->lblName->Text = $this->objVariable->Variable->Name;
     $this->lstVariableGroup = new QListBox($this);
     $this->lstVariableGroup->Name = 'Variable Group/Classification';
     foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) {
         $this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objVariable->VariableGroupId);
     }
     $this->ctlVariable = new VariableControl($this, $this->objVariable->Variable, true, false);
     $this->ctlVariable->Name = 'Variable Information';
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click'));
     $this->btnCancel->CausesValidation = false;
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDatagrid_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colDatagridId = new QDataGridColumn(QApplication::Translate('Datagrid Id'), '<?= $_ITEM->DatagridId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Datagrid()->DatagridId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Datagrid()->DatagridId, false)));
     $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Datagrid()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Datagrid()->ShortDescription, false)));
     // Setup DataGrid
     $this->dtgDatagrid = new QDataGrid($this);
     $this->dtgDatagrid->CellSpacing = 0;
     $this->dtgDatagrid->CellPadding = 4;
     $this->dtgDatagrid->BorderStyle = QBorderStyle::Solid;
     $this->dtgDatagrid->BorderWidth = 1;
     $this->dtgDatagrid->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgDatagrid->Paginator = new QPaginator($this->dtgDatagrid);
     $this->dtgDatagrid->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgDatagrid->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgDatagrid->SetDataBinder('dtgDatagrid_Bind');
     $this->dtgDatagrid->AddColumn($this->colEditLinkColumn);
     $this->dtgDatagrid->AddColumn($this->colDatagridId);
     $this->dtgDatagrid->AddColumn($this->colShortDescription);
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgQcodoConstant_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id, false)));
     $this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_FORM->dtgQcodoConstant_QcodoClass_Render($_ITEM); ?>');
     $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgQcodoConstant_Variable_Render($_ITEM); ?>');
     $this->colFileId = new QDataGridColumn(QApplication::Translate('File Id'), '<?= $_FORM->dtgQcodoConstant_File_Render($_ITEM); ?>');
     // Setup DataGrid
     $this->dtgQcodoConstant = new QDataGrid($this);
     $this->dtgQcodoConstant->CellSpacing = 0;
     $this->dtgQcodoConstant->CellPadding = 4;
     $this->dtgQcodoConstant->BorderStyle = QBorderStyle::Solid;
     $this->dtgQcodoConstant->BorderWidth = 1;
     $this->dtgQcodoConstant->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgQcodoConstant->Paginator = new QPaginator($this->dtgQcodoConstant);
     $this->dtgQcodoConstant->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgQcodoConstant->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgQcodoConstant->SetDataBinder('dtgQcodoConstant_Bind');
     $this->dtgQcodoConstant->AddColumn($this->colEditLinkColumn);
     $this->dtgQcodoConstant->AddColumn($this->colId);
     $this->dtgQcodoConstant->AddColumn($this->colQcodoClassId);
     $this->dtgQcodoConstant->AddColumn($this->colVariableId);
     $this->dtgQcodoConstant->AddColumn($this->colFileId);
 }