public function NotificationHistoryPanel($agentSchemeNumber)
 {
     $params = Zend_Registry::get('params');
     $baseReferencingUrl = $params->connect->baseUrl->referencing;
     // Instantiate security manager for generating MAC
     $securityManager = new Application_Core_Security($params->connect->ref->security->securityString->agent);
     $agentId = $this->view->agentId;
     $macToken = $securityManager->generate(array($agentSchemeNumber, $agentId));
     //	Zend_Debug::dump($this->view->agentId);die();
     $rs = new Datasource_Referencing_NotificationHistory();
     $dataToDisplay = $rs->getHistoryByASN($agentSchemeNumber);
     $enquiry = new Datasource_ReferencingLegacy_Enquiry();
     //Zend_Debug::dump($enquiry);
     $partialArray = array();
     $x = 0;
     foreach ($dataToDisplay as $d) {
         //Zend_Debug::dump($d);
         $refno = $d['refno'];
         $ds = $enquiry->getEnquiry($refno);
         $retrieveReportString = "/reports/view-report-pdf?refno={$refno}&repType=&contentDisposition=attachment";
         $partialArray[$x]['refno'] = $refno;
         $partialArray[$x]['line'] = '';
         $partialArray[$x]['viewReportURL'] = $retrieveReportString;
         $name = trim("{$ds->referenceSubject->name->firstName} {$ds->referenceSubject->name->lastName}");
         if ($name != '') {
             $partialArray[$x]['line'] .= "{$name}, ";
         }
         if (isset($ds->propertyLease->address->addressLine1)) {
             $partialArray[$x]['line'] .= $ds->propertyLease->address->addressLine1 . ', ';
         }
         /*if(isset($ds->propertyLease->address->addressLine2) && $ds->propertyLease->address->addressLine2 != ""){
         			$partialArray[$x]['line'] .= $ds->propertyLease->address->addressLine2 . ', ';
         		}
         		if(isset($ds->propertyLease->address->postCode)){
         			$partialArray[$x]['line'] .= $ds->propertyLease->address->postCode . ', ';
         		}*/
         $partialArray[$x]['line'] = preg_replace('/, $/', ' ', $partialArray[$x]['line']);
         //$partialArray[$x]['line'] .= "<em>(Reference number: {$refno})</em>";
         $x++;
     }
     //Zend_Debug::dump($partialArray);die();
     return array($this->view->partialLoop('partials/notificationhistorypanel.phtml', $partialArray), $x);
 }
 /**
  * Login screen
  *
  * @return void
  */
 public function loginAction()
 {
     $this->view->pageTitle = 'Login | HomeLet Tenant Referencing Application Tracker';
     $pageForm = new Form_TenantsReferencingTracker_Login();
     $request = $this->getRequest();
     $formData = $request->getPost();
     $pageForm->populate($formData);
     if ($request->isPost()) {
         // If this is a valid IRIS login, store credentials in session and redirect to new IRIS TAT section
         if (Form_TenantsReferencingTracker_Login::IRIS_LOGIN === $pageForm->isValid($formData)) {
             $globalSession = new Zend_Session_Namespace('homelet_global');
             $globalSession->legacy_tat_login = $formData;
             $this->_helper->redirector->gotoUrl('/tenant-application-tracker/login');
             return;
         }
         // Legacy HRT TAT login
         if ($pageForm->isValid($formData)) {
             // Log in successful
             // TODO: Use Zend_Auth
             $data = $pageForm->getValues();
             $this->_enquiryId = $this->_pageSession->enquiryId = $data['tenant_reference_number'];
             // Get the ASN from the enquiry number
             // TODO: Requires a manager rather than using direct access to data source
             $enquiryDS = new Datasource_ReferencingLegacy_Enquiry();
             $enquiry = $enquiryDS->getEnquiry($this->_enquiryId);
             $this->_asn = $this->_pageSession->asn = $enquiry->customer->customerId;
             // Set the ASN for the "Get a Quote" links - note these links do not directly go to the TCI+ process since OBC 1051 - Tenancy Liability
             // Put the ASN into the global session for insurance products that lay below the new insurance product selection page to pick up.
             $globalSession = new Zend_Session_Namespace('homelet_global');
             $globalSession->agentSchemeNumber = $this->_asn;
             // Log Activity
             Application_Core_ActivityLogger::log('TAT Login', 'complete', 'TAT', null, "IRN: {$this->_enquiryId}");
             // Redirect user to index page
             $this->_helper->redirector->gotoUrl('/tenants/reference-tracker');
             return;
         } else {
             // Unable to log in, pass form-level errors to view
             $this->view->errors = $pageForm->getErrorMessages();
             // Decrement log in attempt counter
             $this->_logInAttempts = $this->_pageSession->logInAttempts = --$this->_logInAttempts;
             // Log MI event
             Application_Core_ActivityLogger::log('TAT Login', 'failure', 'TAT', null, print_r($this->view->errors, true));
         }
     }
     $this->view->form = $pageForm;
 }
 /**
  * Get reference details of a rent guarantee policy
  *
  * @param string $policynumber Rent guarantee policy number
  * @return Model_ReferencingLegacy_Enquiry Reference object, representing the reference, populated with data
  */
 public function getReference($policynumber)
 {
     $enquiryId = $this->_enquiryModel->getExternalIdentifierByPolicyNumber($policynumber);
     return $this->_enquiryModel->getEnquiry($enquiryId);
 }
 /**
  * Gets the current reference Enquiry declaration version
  *
  * @return int
  */
 private function _getDeclarationVersion()
 {
     $session = new Zend_Session_Namespace('referencing_global');
     $referencingLegacyEnquiryDatasource = new Datasource_ReferencingLegacy_Enquiry();
     $reference = $referencingLegacyEnquiryDatasource->getEnquiry($session->referenceId);
     return (int) $reference->declarationVersion;
 }
Beispiel #5
0
 /**
  * Retrieves the specified reference from the legacy (munting) datasources.
  *
  * @param mixed $referenceId
  * The unique Reference identifier. May be the IRN (internal refno) or the ERN (external
  * refno).
  *
  * @return mixed
  * The Reference details, encapsulated in a Model_Referencing_Reference object,
  * or null if the Reference cannot be found.
  */
 public function getReference($referenceId)
 {
     $legacyEnquiryDatasource = new Datasource_ReferencingLegacy_Enquiry();
     return $legacyEnquiryDatasource->getEnquiry($referenceId);
 }