コード例 #1
0
 /**
  * function setLinks
  * <pre>
  * Sets the value of the linkValues array.
  * </pre>
  * @param $links [ARRAY] Array of Link Values
  * @return [void]
  */
 function setLinks($links)
 {
     $dataAccessManager = new RowManager_EditCampusAssignmentManager();
     $dataAccessManager->setPersonID($this->person_id);
     $dataAccessManager->setCampusID($this->campus_id);
     $dataAccessManager->setSortOrder($this->sortBy);
     $dataList = $dataAccessManager->getListIterator();
     $displayedValues = $dataList->getDataList();
     // disallow the 'continue' link if there is no campus assignment data recorded for this person
     if (count($displayedValues) == 0) {
         $baseLink = $links['edit'];
         $baseLink = str_replace(modulecim_reg::ASSIGNMENT_ID . '=', '', $baseLink);
         $links['cont'] = $baseLink;
     }
     parent::setLinks($links);
 }
コード例 #2
0
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     //$path = $this->pathModuleRoot.'templates/';
     // Otherwise use the standard Templates for the site:
     $path = SITE_PATH_TEMPLATES;
     /*
      * store the link values
      */
     // example:
     // $this->linkValues[ 'view' ] = 'add/new/href/data/here';
     // store the link labels
     $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]');
     $this->linkLabels['del'] = $this->labels->getLabel('[Delete]');
     $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]');
     // $this->linkLabels[ 'view' ] = 'new link label here';
     /*
      * store any additional link Columns
      */
     // example:
     //$title = $this->labels->getLabel( '[title_groups]');
     //$columnLabel = $this->labels->getLabel( '[groups]');
     //$link = $this->linkValues[ 'groups' ];
     //$fieldName = 'accessgroup_id';
     //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName);
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     // NOTE:  this parent method prepares the $this->template with the
     // common AdminBox data.
     $this->prepareTemplate($path);
     // store the statevar id to edit
     $this->template->set('editEntryID', $this->assignment_id);
     // store all the fields to the template
     $this->setFormFieldsToTemplate();
     /*
      * Form related Template variables:
      */
     /*
      * Insert the date start/end values for the following date fields:
      */
     // example:
     //$this->template->set( 'startYear_[fieldName]', 2000);
     //$this->template->set( 'endYear_[fieldName]', 2010);
     /*
      * List related Template variables :
      */
     // Store the XML Node name for the Data Access Field List
     $xmlNodeName = RowManager_EditCampusAssignmentManager::XML_NODE_NAME;
     $this->template->set('rowManagerXMLNodeName', $xmlNodeName);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'assignment_id');
     // store data list to the template
     // NOTE: we initialize it here to make sure we capture any new data
     // from a recent processData() call.
     $dataAccessManager = new RowManager_EditCampusAssignmentManager();
     $dataAccessManager->setPersonID($this->person_id);
     $dataAccessManager->setSortOrder($this->sortBy);
     //        $this->dataList = new EditCampusAssignmentList( $this->sortBy );
     $this->dataList = $dataAccessManager->getListIterator();
     $this->template->setXML('dataList', $this->dataList->getXML());
     /*
      * Add any additional data required by the template here
      */
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $campusList = $campusManager->getListIterator();
     $campusArray = $campusList->getDropListArray();
     $this->template->set('list_campus_id', $campusArray);
     // TODO - we probably should restrict this list of options, since people
     // could assign themselves as staff and that could (implementation dependent)
     // allow them access to other systems
     $statusManager = new RowManager_CampusAssignmentStatusManager();
     $statusList = $statusManager->getListIterator();
     $statusArray = $statusList->getDropListArray();
     $this->template->set('list_assignmentstatus_id', $statusArray);
     $templateName = 'siteAdminBox.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     //$templateName = 'page_EditMyCampusAssignment.php';
     return $this->template->fetch($templateName);
 }
コード例 #3
0
 /**
  * function setLinks
  * <pre>
  * Sets the value of the linkValues array.
  * </pre>
  * @param $links [ARRAY] Array of Link Values
  * @return [void]
  */
 function setLinks($links, $cashTransLinks, $ccTransLinks, $disabledLink)
 {
     $this->cashTrans_form->setLinks($cashTransLinks);
     $this->ccTrans_form->setLinks($ccTransLinks);
     $dataAccessManager = new RowManager_EditCampusAssignmentManager();
     $dataAccessManager->setPersonID($this->person_id);
     $dataAccessManager->setCampusID($this->campus_id);
     $dataAccessManager->setSortOrder($this->sortBy);
     $dataList = $dataAccessManager->getListIterator();
     $displayedValues = $dataList->getDataList();
     // calculate total paid already
     $scholarshipTotal = $this->getScholarshipsTotal();
     $cashTotal = $this->getCashPaidTotal();
     $ccTotal = $this->getCCtransTotal();
     $cashOwed = $this->getCashOwedTotal();
     $totalPaid = $scholarshipTotal + $cashTotal + $ccTotal;
     //          echo "<br>scholarships = ".$scholarshipTotal;
     //          echo "<br>cash total = ".$cashTotal;
     //          echo "<br>cc total = ".$ccTotal;
     // disallow the 'continue' link if total paid (+ recorded as owed) is less than event deposit for this person
     $deposit = $this->getEventDeposit();
     if ($deposit == "NOT YET DETERMINED" || $totalPaid + $cashOwed < $deposit) {
         $baseLink = $disabledLink;
         //cashTransLinks['sortBy'];
         // 			   $baseLink = str_replace( modulecim_reg::CASHTRANS_ID.'=', '', $baseLink);
         $links['cont'] = $baseLink;
         $this->linkLabels['cont'] = $this->labels->getLabel('[Disabled]');
     }
     //   		          echo print_r($this->linkValues,true);
     parent::setLinks($links);
 }