protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgCourier_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colCourierId = new QDataGridColumn(QApplication::Translate('Courier Id'), '<?= $_ITEM->CourierId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->CourierId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->CourierId, false)));
     $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription, false)));
     $this->colActiveFlag = new QDataGridColumn(QApplication::Translate('Active Flag'), '<?= ($_ITEM->ActiveFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag, false)));
     // Setup DataGrid
     $this->dtgCourier = new QDataGrid($this);
     $this->dtgCourier->CellSpacing = 0;
     $this->dtgCourier->CellPadding = 4;
     $this->dtgCourier->BorderStyle = QBorderStyle::Solid;
     $this->dtgCourier->BorderWidth = 1;
     $this->dtgCourier->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgCourier->Paginator = new QPaginator($this->dtgCourier);
     $this->dtgCourier->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgCourier->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgCourier->SetDataBinder('dtgCourier_Bind');
     $this->dtgCourier->AddColumn($this->colEditLinkColumn);
     $this->dtgCourier->AddColumn($this->colCourierId);
     $this->dtgCourier->AddColumn($this->colShortDescription);
     $this->dtgCourier->AddColumn($this->colActiveFlag);
 }
 public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Record Method Callbacks
     $this->strSetEditPanelMethod = $strSetEditPanelMethod;
     $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgCourier_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colCourierId = new QDataGridColumn(QApplication::Translate('Courier Id'), '<?= $_ITEM->CourierId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->CourierId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->CourierId, false)));
     $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription, false)));
     $this->colActiveFlag = new QDataGridColumn(QApplication::Translate('Active Flag'), '<?= ($_ITEM->ActiveFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag, false)));
     // Setup DataGrid
     $this->dtgCourier = new QDataGrid($this);
     $this->dtgCourier->CellSpacing = 0;
     $this->dtgCourier->CellPadding = 4;
     $this->dtgCourier->BorderStyle = QBorderStyle::Solid;
     $this->dtgCourier->BorderWidth = 1;
     $this->dtgCourier->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgCourier->Paginator = new QPaginator($this->dtgCourier);
     $this->dtgCourier->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgCourier->UseAjax = true;
     // Specify the local databind method this datagrid will use
     $this->dtgCourier->SetDataBinder('dtgCourier_Bind', $this);
     $this->dtgCourier->AddColumn($this->colEditLinkColumn);
     $this->dtgCourier->AddColumn($this->colCourierId);
     $this->dtgCourier->AddColumn($this->colShortDescription);
     $this->dtgCourier->AddColumn($this->colActiveFlag);
     // Setup the Create New button
     $this->btnCreateNew = new QButton($this);
     $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('Courier');
     $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
 }
 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a Courier-based QQNode.
  * It will also verify that it is a proper Courier-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'courier') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "courier".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'CourierId':
                     return QQN::Courier()->CourierId;
                 case 'ShortDescription':
                     return QQN::Courier()->ShortDescription;
                 case 'ActiveFlag':
                     return QQN::Courier()->ActiveFlag;
                 default:
                     throw new QCallerException('Simple Property not found in CourierDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
Example #4
0
 protected function lstCourier_Create()
 {
     $this->lstCourier = new QListBox($this);
     $this->lstCourier->Name = QApplication::Translate('Courier');
     $this->lstCourier->Required = true;
     //if (!$this->blnEditMode)
     $this->lstCourier->AddItem('- Select One -', null);
     $objCourierArray = Courier::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Courier()->ShortDescription)));
     if ($objCourierArray) {
         foreach ($objCourierArray as $objCourier) {
             if ($objCourier->ActiveFlag) {
                 $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId);
                 if ($this->objShipment->CourierId && $this->objShipment->CourierId == $objCourier->CourierId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCourier->AddItem($objListItem);
             }
         }
     }
     if ($this->blnEditMode && !$this->objShipment->CourierId) {
         $this->lstCourier->AddItem('Other', null, true);
     } else {
         $this->lstCourier->AddItem('Other', null);
     }
     $this->lstCourier->TabIndex = 7;
 }
Example #5
0
 /**
  * Load a single Courier object,
  * by CourierId Index(es)
  * @param integer $intCourierId
  * @return Courier
  */
 public static function LoadByCourierId($intCourierId, $objOptionalClauses = null)
 {
     return Courier::QuerySingle(QQ::Equal(QQN::Courier()->CourierId, $intCourierId), $objOptionalClauses);
 }
 protected function dtgCourier_Create()
 {
     $this->dtgCourier = new QDatagrid($this);
     $this->dtgCourier->CellPadding = 5;
     $this->dtgCourier->CellSpacing = 0;
     $this->dtgCourier->CssClass = "datagrid";
     $this->dtgCourier->UseAjax = true;
     // Enable Pagination, and set to 10 items per page
     $objPaginator = new QPaginator($this->dtgCourier);
     $this->dtgCourier->Paginator = $objPaginator;
     $this->dtgCourier->ItemsPerPage = 10;
     $this->dtgCourier->AddColumn(new QDataGridColumn('Courier', '<?= $_ITEM->__toStringWithLink("bluelink") ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ShortDescription, false), 'CssClass' => "dtg_column", 'HtmlEntities' => false)));
     $this->dtgCourier->AddColumn(new QDataGridColumn('Enabled', '<?= $_ITEM->__toStringActiveFlag() ?>', array('OrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Courier()->ActiveFlag, false), 'CssClass' => "dtg_column", 'HtmlEntities' => false)));
     $this->dtgCourier->SortColumnIndex = 0;
     $this->dtgCourier->SortDirection = 0;
     $objStyle = $this->dtgCourier->RowStyle;
     $objStyle->ForeColor = '#000000';
     $objStyle->BackColor = '#FFFFFF';
     $objStyle->FontSize = 12;
     $objStyle = $this->dtgCourier->AlternateRowStyle;
     $objStyle->BackColor = '#EFEFEF';
     $objStyle = $this->dtgCourier->HeaderRowStyle;
     $objStyle->ForeColor = '#000000';
     $objStyle->BackColor = '#EFEFEF';
     $objStyle->CssClass = 'dtg_header';
 }
 protected function lstCourier_Create()
 {
     $this->lstCourier = new QListBox($this, 'Courier');
     $this->lstCourier->Name = QApplication::Translate('Courier');
     $this->lstCourier->Required = true;
     $this->lstCourier->AddItem('- Select One -', null);
     $objCourierArray = Courier::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Courier()->ShortDescription)));
     if ($objCourierArray) {
         foreach ($objCourierArray as $objCourier) {
             if ($objCourier->ActiveFlag) {
                 $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId);
                 $this->lstCourier->AddItem($objListItem);
             }
         }
     }
     $this->lstCourier->AddItem('Other', null);
 }
Example #8
0
 /**
  * Load a single Courier object,
  * by CourierId Index(es)
  * @param integer $intCourierId
  * @return Courier
  */
 public static function LoadByCourierId($intCourierId)
 {
     return Courier::QuerySingle(QQ::Equal(QQN::Courier()->CourierId, $intCourierId));
 }