/** * * @return string */ public function getForm($readOnly = 'readwrite') { $RO = 'readonly' === $readOnly ? 'READONLY="READONLY" ' : ''; $jobModel = $this->_jobModel; $title = $this->getTitle(); $id = $jobModel->getId(); $primaryContactId = $jobModel->getPrimaryContactId(); $companyId = $jobModel->getCompanyId(); $applicationStatusId = $jobModel->getApplicationStatusId(); $lastStatusChange = $jobModel->getLastStatusChange(); $urgency = $jobModel->getUrgency(); $created = $jobModel->getCreated(); $updated = $jobModel->getUpdated(); $nextActionDue = $jobModel->getNextActionDue(); $nextAction = $jobModel->getNextAction(); $positionTitle = $jobModel->getPositionTitle(); $location = $jobModel->getLocation(); $url = $jobModel->getUrl(); $buttonLabel = $this->getButtonLabel(); $contactFormView = new ContactFormView(); $contactList = $contactFormView->getContactSelectList($primaryContactId, $RO); $companyFormView = new CompanyFormView(); $companyList = $companyFormView->getCompanySelectList($companyId, $RO); $applicationStatusView = new ApplicationStatusFormView(); $applicationStatusList = $applicationStatusView->getApplicationStatusSelectList($applicationStatusId, $RO); $returnValue = <<<HTML <h2>{$title}</h2> <form name="job" onsubmit="return validateJob()" method="GET"> <table border="1" cellspacing="1" cellpadding="2"> <tr> <th>ID</th> <td><input type="text" name="id" value="{$id}" readonly="readonly" /></td> </tr> <tr> <th>Primary Contact *</th> <td>{$contactList}</td> </tr> <tr> <th>Company *</th> <td>{$companyList}</th> </tr> <tr> <th>Application Status *</th> <td>{$applicationStatusList}</td> </tr> <tr> <th>Last Status Change</th> <td><input type="text" name="lastStatusChange" value="{$lastStatusChange}" readonly="readonly" /></td> </tr> <tr> <th>Urgency *</th> <td><input type="text" name="urgency" value="{$urgency}" {$RO} /></td> </tr> <tr> <th>Created</th> <td><input type="text" name="created" value="{$created}" readonly="readonly" /></td> </tr> <tr> <th>Updated</th> <td><input type="text" name="updated" value="{$updated}" readonly="readonly" /></td> </tr> <tr> <th>Next Action Due *</th> <td><input type="text" name="nextActionDue" value="{$nextActionDue}" class="datepicker" {$RO}/></td> </tr> <tr> <th>Next Action *</th> <td><input type="text" name="nextAction" value="{$nextAction}" {$RO} /></td> </tr> <tr> <th>Position Title *</th> <td><input type="text" name="positionTitle" value="{$positionTitle}" {$RO} /></td> </tr> <tr> <th>Location *</th> <td><input type="text" name="location" value="{$location}" {$RO} /></td> </tr> <tr> <th>URL</th> <td><input type="text" name="url" value="{$url}" {$RO} /></td> </tr> <tr> <td colspan="2"> <center> <input type="reset" /> <input type="submit" name="act" value="{$buttonLabel}" /> </center> </td> </tr> </table> </form> HTML; return $returnValue; }
/** * * @return string */ public function getForm($readOnly = 'readwrite') { $RO = 'readonly' === $readOnly ? 'READONLY="READONLY" ' : ''; $contactModel = $this->_contactModel; $title = $this->getTitle(); $contactId = $contactModel->getId(); $companyId = $contactModel->getContactCompanyId(); $contactName = $contactModel->getContactName(); $contactEmail = $contactModel->getContactEmail(); $contactPhone = $contactModel->getContactPhone(); $contactAltPhone = $contactModel->getContactAlternatePhone(); $created = $contactModel->getCreated(); $updated = $contactModel->getUpdated(); $companyFormView = new CompanyFormView(); $companyList = $companyFormView->getCompanySelectList($companyId, $RO); $buttonLabel = $this->getButtonLabel(); $returnValue = <<<HTML <h2>{$title}</h2> <form name="contact" onsubmit="return validateContact()" method="GET"> <table border="1" cellspacing="1" cellpadding="2"> <tr> <th>ID</th> <td><input type="text" name="id" value="{$contactId}" readonly="readonly" /></td> </tr> <tr> <th>Contact's Company *</th> <td>{$companyList}</td> </tr> <tr> <th>Contact's Name *</th> <td><input type="text" name="contactName" value="{$contactName}" {$RO} /></td> </tr> <tr> <th>Contact's Email *</th> <td><input type="text" name="contactEmail" value="{$contactEmail}" {$RO} /></td> </tr> <tr> <th>Contact's Phone *</th> <td><input type="text" name="contactPhone" value="{$contactPhone}" {$RO} /></td> </tr> <tr> <th>Contact's Alternate Phone</th> <td><input type="text" name="contactAlternatePhone" value="{$contactAltPhone}" {$RO} /></td> </tr> <tr> <th>Created</th> <td><input type="text" name="created" value="{$created}" readonly="readonly" /></td> </tr> <tr> <th>Updated</th> <td><input type="text" name="updated" value="{$updated}" readonly="readonly" /></td> </tr> <tr> <td colspan="2"> <center> <input type="reset" /> <input type="submit" name="act" value="{$buttonLabel}" /> </center> </td> </tr> </table> </form> HTML; return $returnValue; }