本文整理汇总了PHP中QQ类的典型用法代码示例。如果您正苦于以下问题:PHP QQ类的具体用法?PHP QQ怎么用?PHP QQ使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QQ类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMultiLevel
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");
}
示例2: RenderValue
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');
}
}
示例3: tblProjects_Bind
/**
* 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);
}
示例4: Form_Create
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;
}
示例5: GetControlHtml
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();
}
示例6: Form_Create
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);
}
示例7: Form_Create
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());
}
}
示例8: Form_Create
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);
}
示例9: Form_Create
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;
}
示例10: CreateGroupParticipations
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";
}
示例11: dtgItems_Bind
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;
}
示例12: Form_Create
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);
}
示例13: dtgWikiItems_Bind
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);
}
示例14: process_object
/**
* @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++;
}
}
示例15: SetupPanel
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();
}