Clause() public static méthode

public static Clause ( )
 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;
             }
     }
 }
 protected function Form_Create()
 {
     // Define our Label
     $this->lblMessage = new QLabel($this);
     $this->lblMessage->Text = '<None>';
     // Define the ListBox, and create the first listitem as 'Select One'
     $this->lstPersons = new QListBox($this);
     $this->lstPersons->AddItem('- Select One -', null);
     // Add the items for the listbox, pulling in from the Person table
     $objPersons = Person::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     if ($objPersons) {
         foreach ($objPersons as $objPerson) {
             // We want to display the listitem as Last Name, First Name
             // and the VALUE of the listitem should be the person object itself
             $this->lstPersons->AddItem($objPerson->LastName . ', ' . $objPerson->FirstName, $objPerson);
         }
     }
     // Declare a QChangeEvent to call a server action: the lstPersons_Change PHP method
     $this->lstPersons->AddAction(new QChangeEvent(), new QServerAction('lstPersons_Change'));
     // Do the same but with a multiple selection QCheckboxList
     $this->chkPersons = new QCheckBoxList($this);
     if ($objPersons) {
         foreach ($objPersons as $objPerson) {
             // We want to display the listitem as Last Name, First Name
             // and the VALUE of the listitem will be the database id
             $this->chkPersons->AddItem($objPerson->FirstName . ' ' . $objPerson->LastName, $objPerson->Id);
         }
     }
     $this->chkPersons->RepeatColumns = 2;
     $this->chkPersons->AddAction(new QChangeEvent(), new QServerAction('chkPersons_Change'));
 }
 public function __construct(QPanel $pnlContent, $strReturnUrl)
 {
     $this->pnlContent = $pnlContent;
     $this->pnlContent->Template = dirname(__FILE__) . '/EditGroupParticipationDelegate.tpl.php';
     // Throw Exception if Group Cannot have Explicitly Defined Participants
     if (!$this->pnlContent->objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) {
         throw new Exception('Group Cannot have Explicitly Defined Participants');
     }
     $this->strReturnUrl = $strReturnUrl;
     $this->objParticipationArray = GroupParticipation::LoadArrayByPersonIdGroupId($this->pnlContent->objPerson->Id, $this->pnlContent->objGroup->Id, QQ::OrderBy(QQN::GroupParticipation()->GroupRole->Name, QQN::GroupParticipation()->DateStart), QQ::Clause(QQ::Expand(QQN::GroupParticipation()->GroupRole)));
     $this->chkIsAuthorizedSender = new QCheckBox($this->pnlContent);
     $this->chkIsAuthorizedSender->Name = '  Is Authorized Sender';
     if (GroupAuthorizedSender::LoadByGroupIdPersonId($this->pnlContent->objGroup->Id, $this->pnlContent->objPerson->Id)) {
         $this->chkIsAuthorizedSender->Checked = true;
     } else {
         $this->chkIsAuthorizedSender->Checked = false;
     }
     $this->lblCurrentRoles = new QLabel($this->pnlContent);
     $this->lblCurrentRoles->Name = 'Current Roles';
     $this->lblCurrentRoles->HtmlEntities = false;
     $this->lblCurrentRoles_Refresh();
     $this->dtgParticipations = new QDataGrid($this->pnlContent);
     $this->dtgParticipations->AddColumn(new QDataGridColumn('Role', '<?= $_CONTROL->ParentControl->objDelegate->RenderRole($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'));
     $this->dtgParticipations->AddColumn(new QDataGridColumn('Participation Started', '<?= $_CONTROL->ParentControl->objDelegate->RenderDateStart($_ITEM); ?>', 'HtmlEntities=false', 'Width=150px'));
     $this->dtgParticipations->AddColumn(new QDataGridColumn('Participation Ended', '<?= $_CONTROL->ParentControl->objDelegate->RenderDateEnd($_ITEM); ?>', 'HtmlEntities=false', 'Width=150px'));
     $this->dtgParticipations->SetDataBinder('dtgParticipations_Bind', $this);
     $this->pxyEdit = new QControlProxy($this->pnlContent);
     $this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'pxyEdit_Click'));
     $this->pxyEdit->AddAction(new QClickEvent(), new QTerminateAction());
     $this->dlgEdit_Setup();
 }
Exemple #4
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;
 }
Exemple #5
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;
 }
Exemple #6
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>';
     }
 }
 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 #8
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 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 __construct($objParentObject, $objVariableOrParameter, $blnDefaultValueEditable, $blnShowExtendedDescription, $strControlId = null)
 {
     // First, call the parent to do most of the basic setup
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     if ($objVariableOrParameter instanceof Parameter) {
         $this->objParameter = $objVariableOrParameter;
         $this->objVariable = $this->objParameter->Variable;
         $blnShowReference = true;
     } else {
         $this->objVariable = $objVariableOrParameter;
         $blnShowReference = false;
     }
     // Setup Local Variables
     $this->strName = $this->objVariable->Name;
     // Next, we'll create our local subcontrols.  Make sure to set "this" as these subcontrols' parent.
     $this->lstVariableType = new QListBox($this);
     $this->lstVariableType->Name = $this->strName . ' Variable Type';
     $this->lstVariableType->CssClass .= ' vctl';
     foreach (VariableType::$NameArray as $intId => $strName) {
         $this->lstVariableType->AddItem($strName, $intId, $this->objVariable->VariableTypeId == $intId);
     }
     $this->lstObjectType = new QListBox($this);
     $this->lstObjectType->Name = 'Object Type';
     $this->lstObjectType->AddItem('- Unspecified -', null);
     $this->lstObjectType->CssClass .= ' vctl';
     foreach (QcodoClass::LoadAll(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objQcodoClass) {
         $this->lstObjectType->AddItem($objQcodoClass->Name, $objQcodoClass->Id, $this->objVariable->ObjectTypeId == $objQcodoClass->Id);
     }
     $this->chkArray = new QCheckBox($this);
     $this->chkArray->Name = $this->strName . ' is an Array?';
     $this->chkArray->Checked = $this->objVariable->ArrayFlag;
     $this->chkReference = new QCheckBox($this);
     $this->chkReference->Visible = $blnShowReference;
     if ($this->objParameter) {
         $this->chkReference->Checked = $this->objParameter->ReferenceFlag;
     }
     $this->txtDefaultValue = new QTextBox($this);
     $this->txtDefaultValue->Name = $this->strName . ' Default Value';
     $this->txtDefaultValue->Text = $this->objVariable->DefaultValue;
     $this->txtDefaultValue->Enabled = $blnDefaultValueEditable;
     $this->txtDefaultValue->CssClass .= ' vctl';
     $this->txtShortDescription = new QTextBox($this);
     $this->txtShortDescription->Name = $this->strName . ' Short Description';
     $this->txtShortDescription->Text = $this->objVariable->ShortDescription;
     $this->txtShortDescription->TextMode = QTextMode::MultiLine;
     $this->txtShortDescription->CssClass = 'textbox_multiline';
     $this->txtExtendedDescription = new QWriteBox($this);
     $this->txtExtendedDescription->Name = $this->strName . ' Extended Description';
     $this->txtExtendedDescription->Text = $this->objVariable->ExtendedDescription;
     $this->txtExtendedDescription->CssClass = 'textbox_multiline';
     $this->txtExtendedDescription->Visible = $blnShowExtendedDescription;
     $this->lstVariableType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstVariableType_Change'));
     $this->lstVariableType_Change();
 }
Exemple #11
0
 /**
  * @return WpPosts|null The WpPosts object, that is a copy of this DLE post.
  */
 public function LoadWpPosts()
 {
     $objWpUsers = $this->LoadWpUser();
     if (!$objWpUsers) {
         return null;
     }
     return WpPosts::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::WpPosts()->PostAuthor, $objWpUsers->Id), QQ::Equal(QQN::WpPosts()->PostDate, $this->Date), QQ::Equal(QQN::WpPosts()->PostName, $this->AltName)), QQ::Clause(QQ::LimitInfo(1)));
 }
Exemple #12
0
 protected function dtgPersons_Bind()
 {
     // We must first let the datagrid know how many total items there are
     $this->dtgPersons->TotalItemCount = Person::CountAll();
     // Next, we must be sure to load the data source, passing in the datagrid's
     // limit info into our loadall method.
     $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause));
 }
 protected function dtgProjects_Bind()
 {
     // We must first let the datagrid know how many total items there are
     $this->dtgProjects->TotalItemCount = Project::QueryCount($this->dtgProjects->Conditions);
     // Next, we must be sure to load the data source, passing in the datagrid's
     // limit info into our loadall method.
     $this->dtgProjects->DataSource = Project::QueryArray($this->dtgProjects->Conditions, QQ::Clause($this->dtgProjects->OrderByClause, $this->dtgProjects->LimitClause));
 }
 protected function dtgGroupRegistration_Bind()
 {
     $objConditions = QQ::All();
     $objClauses = QQ::Clause($this->dtgGroupRegistrations->OrderByClause);
     if (!$this->chkShowInactive->Checked) {
         $objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::GroupRegistrations()->ProcessedFlag, false), QQ::IsNull(QQN::GroupRegistrations()->ProcessedFlag)));
     }
     $this->dtgGroupRegistrations->DataSource = GroupRegistrations::QueryArray($objConditions, $objClauses);
 }
 public function __construct(QcodoClass $objQcodoClass, $objParentControl, $strControlId = null)
 {
     parent::__construct($objParentControl, $strControlId);
     // We're looking at ALL Methods/Operations
     $this->objQcodoClass = $objQcodoClass;
     $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name . '/Constants';
     $this->strTemplate = 'ConstantPanel.tpl.php';
     $this->objConstantArray = $this->objQcodoClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name), QQ::Expand(QQN::QcodoConstant()->Variable)));
 }
Exemple #16
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);
     $this->dtgItems->DataSource = Person::QueryArray(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd), QQ::IsNull(QQN::Person()->PrimaryAddressText), QQ::IsNull(QQN::Person()->StewardshipAddressId)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
 }
Exemple #17
0
 public function testAssociationTables()
 {
     // All People Who Are on a Project Managed by Karen Wolfe (Person ID #7)
     $objPersonArray = Person::QueryArray(QQ::Equal(QQN::Person()->ProjectAsTeamMember->Project->ManagerPersonId, 7), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     $arrNamesOnly = array();
     foreach ($objPersonArray as $item) {
         $arrNamesOnly[] = $item->FirstName . " " . $item->LastName;
     }
     $this->assertEqual($arrNamesOnly, array("Brett Carlisle", "John Doe", "Samantha Jones", "Jacob Pratt", "Kendall Public", "Ben Robinson", "Alex Smith", "Wendy Smith", "Karen Wolfe"), "List managed persons is correct");
 }
Exemple #18
0
 protected function dtgPersons_Bind()
 {
     $objPersonArray = $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause));
     // If we are editing someone new, we need to add a new (blank) person to the data source
     if ($this->intEditPersonId == -1) {
         array_push($objPersonArray, new Person());
     }
     // Bind the datasource to the datagrid
     $this->dtgPersons->DataSource = $objPersonArray;
 }
 public function RefreshStats()
 {
     $this->intPackageCount = $this->CountPackages();
     $objPackage = Package::QuerySingle(QQ::Equal(QQN::Package()->PackageCategoryId, $this->intId), QQ::Clause(QQ::LimitInfo(1), QQ::OrderBy(QQN::Package()->LastPostDate, false)));
     if ($objPackage && $objPackage->LastPostDate) {
         $this->dttLastPostDate = new QDateTime($objPackage->LastPostDate);
     } else {
         $this->dttLastPostDate = null;
     }
     $this->Save();
 }
 /**
  * This will refresh all the stats (last post date, message/topic counts) and save the record to the database
  * @return void
  */
 public function RefreshStats()
 {
     $objMessage = Message::QuerySingle(QQ::Equal(QQN::Message()->TopicLinkId, $this->intId), QQ::Clause(QQ::OrderBy(QQN::Message()->PostDate, false), QQ::LimitInfo(1)));
     if ($objMessage) {
         $this->dttLastPostDate = $objMessage->PostDate;
     } else {
         $this->dttLastPostDate = null;
     }
     $this->intMessageCount = Message::CountByTopicLinkId($this->intId);
     $this->intTopicCount = Topic::CountByTopicLinkId($this->intId);
     $this->Save();
 }
 /**
  * @return WpComments|null The Worpress comment for this DLE comment.
  */
 public function LoadWpComments()
 {
     $objWpPosts = $this->LoadWpPosts();
     if (!$objWpPosts) {
         return null;
     }
     $objWpUsers = $this->LoadWpUsers();
     $conUsersCondition = QQ::Equal(QQN::WpComments()->CommentAuthorEmail, $this->Email);
     if ($objWpUsers) {
         $conUsersCondition = QQ::Equal(QQN::WpComments()->UserId, $objWpUsers->Id);
     }
     return WpComments::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::WpComments()->CommentPostID, $objWpPosts->Id), $conUsersCondition, QQ::Equal(QQN::WpComments()->CommentDate, $this->Date), QQ::Equal(QQN::WpComments()->CommentContent, str_replace('\\"', '"', $this->Text))), QQ::Clause(QQ::OrderBy(QQN::WpComments()->CommentID), QQ::LimitInfo(1)));
 }
 public function __construct(QcodoClass $objQcodoClass, $objParentControl, $strControlId = null)
 {
     parent::__construct($objParentControl, $strControlId);
     // We're looking at ALL Methods/Operations
     $this->objQcodoClass = $objQcodoClass;
     $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name . '/Variables';
     $this->strTemplate = 'VariablePanel.tpl.php';
     $objGroupArray = VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber)));
     foreach ($objGroupArray as $objGroup) {
         $objVariableArray = $this->objQcodoClass->GetVariablesForVariableGroupId($objGroup->Id);
         $this->objVariableGroupArray[$objGroup->Name] = $objVariableArray;
     }
 }
 protected function Form_Create()
 {
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     $this->ctlShortcutMenu_Create();
     if ($_GET && $_GET['method'] == 'delete') {
         $objAudit = Audit::Load($_GET['intAuditId']);
         if ($objAudit) {
             $objAudit->Delete();
             QApplication::Redirect("./inventory_audit_list.php");
         }
     }
     // Load an array of Audit objects using join on UserAccount.
     $this->objAuditArray = Audit::LoadArrayByEntityQtypeId(2, QQ::Clause(QQ::Expand(QQN::Audit()->CreatedByObject)));
 }
Exemple #24
0
 public function __get($strName)
 {
     switch ($strName) {
         case 'ShortDescriptionAsHtml':
             $strToReturn = QApplication::HtmlEntities(trim($this->strShortDescription));
             $strToReturn = str_replace("\r", '', $strToReturn);
             $strToReturn = str_replace("\n", '<br/>', $strToReturn);
             return $strToReturn;
         case 'Parameters':
             return $this->GetParameterArray(QQ::Clause(QQ::OrderBy(QQN::Parameter()->OrderNumber), QQ::Expand(QQN::Parameter()->Variable)));
             /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         case 'InheritenceState':
             return $this->intInheritenceState;
             /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         case 'OverridesOperation':
             return $this->objOverridesOperation;
             /* CAN BE USED ANYWHERE */
         /* CAN BE USED ANYWHERE */
         case 'Overrides':
             $objClass = $this->QcodoClass->ParentQcodoClass;
             while ($objClass) {
                 if ($objOperation = Operation::LoadByQcodoClassIdQcodoInterfaceIdName($objClass->Id, null, $this->strName)) {
                     return $objOperation;
                 }
                 $objClass = $objClass->ParentQcodoClass;
             }
             return null;
         case 'DisplayName':
             switch ($this->intInheritenceState) {
                 case InheritenceState::Interited:
                     return $this->strName . '&nbsp;<img src="/images/inherited_light.png" border="0" alt="Inherited"/>';
                 case InheritenceState::Overrides:
                     return $this->strName . '&nbsp;<img src="/images/overrides.png" border="0" alt="Overrides"/>';
                 default:
                     return $this->strName;
             }
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Exemple #25
0
 protected function Form_Create()
 {
     if (!QApplication::$Login) {
         QApplication::Redirect('/');
     }
     $this->objProperty = ClassProperty::Load(QApplication::PathInfo(0));
     if (!$this->objProperty) {
         throw new Exception('Invalid ClassProperty Id: ' . QApplication::PathInfo(0));
     }
     $this->lblClass = new QLabel($this);
     $this->lblClass->Text = $this->objProperty->QcodoClass->Name;
     $this->lblName = new QLabel($this);
     $this->lblName->Text = $this->objProperty->Variable->Name;
     $this->lstVariableGroup = new QListBox($this);
     $this->lstVariableGroup->Name = 'Property Group/Classification';
     foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) {
         $this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objProperty->VariableGroupId);
     }
     $this->lstClassVariable = new QListBox($this);
     $this->lstClassVariable->Name = 'Linked to Member Variable';
     $this->lstClassVariable->AddItem('- None -', null);
     foreach ($this->objProperty->QcodoClass->GetVariablesForVariableGroupId(null) as $objVariable) {
         switch ($objVariable->InheritenceState) {
             case InheritenceState::Interited:
                 $this->lstClassVariable->AddItem($objVariable->Variable->Name . '(inherited)', $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id);
                 break;
             case InheritenceState::Overrides:
                 $this->lstClassVariable->AddItem($objVariable->Variable->Name . '(overrides)', $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id);
                 break;
             default:
                 $this->lstClassVariable->AddItem($objVariable->Variable->Name, $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id);
                 break;
         }
     }
     $this->lstClassVariable->AddAction(new QChangeEvent(), new QAjaxAction('lstClassVariable_Change'));
     $this->ctlVariable = new VariableControl($this, $this->objProperty->Variable, true, false);
     $this->ctlVariable->Name = 'Property 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;
     $this->lstClassVariable_Change();
 }
Exemple #26
0
 protected function Form_Create()
 {
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     $this->ctlShortcutMenu_Create();
     //QApplication::$Database[1]->EnableProfiling();
     if ($_GET && $_GET['method'] == 'delete') {
         $objAudit = Audit::Load($_GET['intAuditId']);
         if ($objAudit) {
             // Set the relationship to ON DELETE CASCADE so that the AuditScans will be automatically deleted when deleting the Audit Object
             $objAudit->Delete();
             QApplication::Redirect("./asset_audit_list.php");
         }
     }
     // Load an array of Audit objects using join on UserAccount.
     $this->objAuditArray = Audit::LoadAll(QQ::Clause(QQ::Expand(QQN::Audit()->CreatedByObject)));
 }
 public function testAlias3()
 {
     $emptySelect = QQ::Select();
     $emptySelect->SetSkipPrimaryKey(true);
     $nVoyel = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'voyel');
     $nConson = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'conson');
     $objPersonArray = Person::QueryArray(QQ::IsNotNull($nConson->Id), QQ::Clause(QQ::Expand($nVoyel, QQ::In($nVoyel->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::Expand($nConson, QQ::NotIn($nConson->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::GroupBy(QQN::Person()->Id), QQ::Minimum($nVoyel->Name, 'min_voyel'), QQ::Minimum($nConson->Name, 'min_conson'), QQ::Expand(QQN::Person()->ProjectAsManager, null, $emptySelect), QQ::Minimum(QQN::Person()->ProjectAsManager->Id, 'dummy'), QQ::Select(QQN::Person()->FirstName, QQN::Person()->LastName)));
     $this->assertEquals(3, sizeof($objPersonArray));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Doe');
     $this->assertNull($obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone F', $obj->GetVirtualAttribute('min_conson'));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Ho');
     $this->assertEquals('Milestone E', $obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone D', $obj->GetVirtualAttribute('min_conson'));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Wolfe');
     $this->assertEquals('Milestone A', $obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone B', $obj->GetVirtualAttribute('min_conson'));
 }
 public function dtgRecordsSummary_Bind()
 {
     //$objConditions = $this->dtgRecordsSummary->Conditions;
     // setup $objClauses array
     $objClauses = array();
     // add OrderByClause to the $objClauses array
     // if ($objClause = $this->dtgRecordsSummary->OrderByClause){
     if ($objClause = $this->dtgRecordsSummary->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // add LimitByClause to the $objClauses array
     //if ($objClause = $this->dtgRecordsSummary->LimitClause)
     if ($objClause = $this->dtgRecordsSummary->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $team_array = $this->objProject->GetPersonAsTeamMemberArray(QQ::Clause($this->dtgRecordsSummary->OrderByClause));
     $this->dtgRecordsSummary->TotalItemCount = count($team_array);
     $this->dtgRecordsSummary->DataSource = $this->objProject->GetPersonAsTeamMemberArray(QQ::Clause($this->dtgRecordsSummary->OrderByClause), $objClauses);
 }
 protected function lstCompany_Create()
 {
     $this->lstCompany = new QListBox($this);
     $this->lstCompany->Name = QApplication::Translate('Company');
     $this->lstCompany->Required = true;
     if (!$this->blnEditMode) {
         $this->lstCompany->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $objCompanyArray = Company::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Company()->ShortDescription)));
     if ($objCompanyArray) {
         foreach ($objCompanyArray as $objCompany) {
             $objListItem = new QListItem($objCompany->__toString(), $objCompany->CompanyId);
             if ($objCompany->CompanyId == $this->intCompanyId) {
                 $objListItem->Selected = true;
             }
             $this->lstCompany->AddItem($objListItem);
         }
     }
 }
Exemple #30
0
 protected function Form_Create()
 {
     // Setup the Dropdown of Project Names
     $this->lstProjects = new QListBox($this);
     $this->lstProjects->AddItem('- Select One -', null, true);
     foreach (Project::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Project()->Name))) as $objProject) {
         $this->lstProjects->AddItem($objProject->Name, $objProject->Id);
     }
     $this->lstProjects->AddAction(new QChangeEvent(), new QAjaxAction('lstProjects_Change'));
     // Setup our Left and Right Panel Placeholders
     // Notice that both panels have "AutoRenderChildren" set to true so that
     // instantiated child panels will automatically get displayed
     $this->pnlLeft = new QPanel($this);
     $this->pnlLeft->Position = QPosition::Relative;
     $this->pnlLeft->CssClass = 'panelDefault';
     $this->pnlLeft->AutoRenderChildren = true;
     $this->pnlRight = new QPanel($this);
     $this->pnlRight->Position = QPosition::Relative;
     $this->pnlRight->CssClass = 'panelDefault panelRight';
     $this->pnlRight->AutoRenderChildren = true;
     $this->objDefaultWaitIcon = new QWaitIcon($this);
 }