Skip to content

Commit

Permalink
new contract
Browse files Browse the repository at this point in the history
  • Loading branch information
caldwellc1 committed Jul 2, 2019
1 parent 98dadf5 commit b460abf
Show file tree
Hide file tree
Showing 10 changed files with 1,240 additions and 2,003 deletions.
2 changes: 1 addition & 1 deletion boost/boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

$proper_name = 'Internship Inventory';
$version = '0.6.2';
$version = '0.6.3';
$register = false;
$unregister = false;
$import_sql = true;
Expand Down
2 changes: 1 addition & 1 deletion boost/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CREATE TABLE intern_department (
);

CREATE TABLE intern_faculty (
id INT NOT NULL,
id INT NOT NULL, --banner id
username character varying NOT NULL,
first_name character varying NOT NULL,
last_name character varying NOT NULL,
Expand Down
58 changes: 29 additions & 29 deletions class/InternshipContractPdfView.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function generatePdf()
$f = $this->internship->getFaculty();
//$subject = $this->internship->getSubject();

$this->pdf->setSourceFile(PHPWS_SOURCE_DIR . 'mod/intern/pdf/AppState_Internship_Contract.pdf');
$this->pdf->setSourceFile(PHPWS_SOURCE_DIR . 'mod/intern/pdf/Contract_Updated_201920.pdf');
$tplidx = $this->pdf->importPage(1);
$this->pdf->addPage();
$this->pdf->useTemplate($tplidx);
Expand All @@ -89,20 +89,20 @@ private function generatePdf()
*/

/* Department */
$this->pdf->setXY(138, 40);
$this->pdf->multiCell(73, 3, $d->getName());
$this->pdf->setXY(138, 41);
$this->pdf->multiCell(60, 3, $d->getName());

/* Course title */
$this->pdf->setXY(138, 52);
$this->pdf->setXY(138, 53);
$this->pdf->cell(73, 6, $this->internship->getCourseTitle());

/* Location center aligned*/
if($this->internship->isDomestic()){
$this->pdf->setXY(85, 68);
$this->pdf->setXY(85, 69);
$this->pdf->cell(24, 5, 'X', 0, 0, 'C');
}
if($this->internship->isInternational()){
$this->pdf->setXY(168, 68);
$this->pdf->setXY(168, 69);
$this->pdf->cell(24, 5, 'X', 0, 0, 'C');
}

Expand Down Expand Up @@ -159,62 +159,62 @@ private function generatePdf()
* Faculty supervisor information.
*/
if(isset($f)){
$this->pdf->setXY(28, 119);
$this->pdf->setXY(28, 120);
$this->pdf->cell(81, 5, $f->getFullName());

$this->pdf->setXY(31, 126);
$this->pdf->setXY(31, 127);
$this->pdf->cell(81, 5, $f->getStreetAddress1());

$this->pdf->setXY(16, 133);
$this->pdf->setXY(16, 134);
$this->pdf->cell(81, 5, $f->getStreetAddress2());

$this->pdf->setXY(60, 133);
$this->pdf->setXY(60, 134);
$this->pdf->cell(81, 5, $f->getCity());

$this->pdf->setXY(88, 133);
$this->pdf->setXY(88, 134);
$this->pdf->cell(81, 5, $f->getState());

$this->pdf->setXY(95, 133);
$this->pdf->setXY(95, 134);
$this->pdf->cell(81, 5, $f->getZip());

$this->pdf->setXY(29, 140);
$this->pdf->setXY(29, 141);
$this->pdf->cell(77, 5, $f->getPhone());

$this->pdf->setXY(25, 147);
$this->pdf->setXY(25, 148);
$this->pdf->cell(77, 5, $f->getFax());

$this->pdf->setXY(28, 154);
$this->pdf->setXY(28, 155);
$this->pdf->cell(77, 5, $f->getUsername() . '@appstate.edu');
}

/***
* Agency information.
*/
$this->pdf->setXY(139, 117);
$this->pdf->setXY(139, 118);
$this->pdf->cell(71, 5, $a->getName());

$agency_address = $a->getStreetAddress();

//TODO: make this smarter so it adds the line break between words
if(strlen($agency_address) < 49){
// If it's short enough, just write it
$this->pdf->setXY(127, 122);
$this->pdf->setXY(127, 123);
$this->pdf->cell(77, 5, $agency_address);
}else{
// Too long, need to use two lines
$agencyLine1 = substr($agency_address, 0, 49); // get first 50 chars
$agencyLine2 = substr($agency_address, 49); // get the rest, hope it fits
$agencyLine1 = substr($agency_address, 0, 44); // get first 50ish chars
$agencyLine2 = substr($agency_address, 44); // get the rest, hope it fits

$this->pdf->setXY(127, 122);
$this->pdf->setXY(127, 123);
$this->pdf->cell(77, 5, $agencyLine1);
$this->pdf->setXY(113, 127);
$this->pdf->setXY(113, 128);
$this->pdf->cell(77, 5, $agencyLine2);
}

/**
* Agency supervisor info.
*/
$this->pdf->setXY(113, 138);
$this->pdf->setXY(113, 139);
$super = "";
$superName = $a->getSupervisorFullName();
if(isset($superName) && !empty($superName) && $superName != ''){
Expand All @@ -233,34 +233,34 @@ private function generatePdf()
//TODO: make this smarter so it adds the line break between words
if(strlen($super_address) < 54){
// If it's short enough, just write it
$this->pdf->setXY(113, 143);
$this->pdf->setXY(113, 144);
$this->pdf->cell(78, 5, $super_address);
}else{
// Too long, need to use two lines
$superLine1 = substr($super_address, 0, 54); // get first 55 chars
$superLine2 = substr($super_address, 54); // get the rest, hope it fits

$this->pdf->setXY(113, 143);
$this->pdf->setXY(113, 144);
$this->pdf->cell(78, 5, $superLine1);
$this->pdf->setXY(113, 148);
$this->pdf->setXY(113, 149);
$this->pdf->cell(78, 5, $superLine2);
}

$this->pdf->setXY(125, 159);
$this->pdf->setXY(125, 160);
$this->pdf->cell(72, 5, $a->getSupervisorEmail());

$this->pdf->setXY(125, 154);
$this->pdf->setXY(125, 155);
$this->pdf->cell(33, 5, $a->getSupervisorPhoneNumber());

$this->pdf->setXY(166, 154);
$this->pdf->setXY(166, 155);
$this->pdf->cell(40, 5, $a->getSupervisorFaxNumber());

/* Internship Location */
$internshipAddress = trim($this->internship->getStreetAddress());
$agencyAddress = trim($a->getStreetAddress());

if($internshipAddress != '' && $agencyAddress != '' && $internshipAddress != $agencyAddress) {
$this->pdf->setXY(112, 169);
$this->pdf->setXY(112, 170);
$this->pdf->cell(52, 5, $this->internship->getLocationAddress());
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"setasign/fpdi-fpdf": "1.6",
"setasign/fpdi-fpdf": "^2.2",
"swiftmailer/swiftmailer": "@stable"
},
"require-dev": {
Expand Down
Loading

0 comments on commit b460abf

Please sign in to comment.