diff --git a/blocks/html/applicants/updateForm.inc b/blocks/html/applicants/updateForm.inc index d67a6b26..d7223788 100644 --- a/blocks/html/applicants/updateForm.inc +++ b/blocks/html/applicants/updateForm.inc @@ -44,9 +44,9 @@ $title = $id ? $this->_('applicant_edit') : $this->_('applicant_add'); foreach ($this->applicant->getFiles() as $f) { $file_id = $f->getId(); - $uri = BASE_URI.'/files/download?file_id='.$file_id; - $filename = self::escape($m->getFilename()); - $filename = "getMime_type()}\">$filename"; + $uri = parent::generateUri('applicantFiles.download').'?applicantFile_id='.$file_id; + $filename = self::escape($f->getFilename()); + $filename = "getMime_type()}\">$filename"; echo "
diff --git a/blocks/html/committees/endDateForm.inc b/blocks/html/committees/endDateForm.inc index ad2c83f2..9aeac08f 100644 --- a/blocks/html/committees/endDateForm.inc +++ b/blocks/html/committees/endDateForm.inc @@ -9,7 +9,7 @@

_('committee_end'); ?>

-
+
diff --git a/blocks/html/departments/updateForm.inc b/blocks/html/departments/updateForm.inc index dfdf89aa..9fae48c3 100644 --- a/blocks/html/departments/updateForm.inc +++ b/blocks/html/departments/updateForm.inc @@ -16,7 +16,7 @@ $title = $this->department->getId() ? $this->_('department_edit') : $this->_('de

- +
template->getHelper('buttonLink'); $button = $h->buttonLink( - BASE_URI.'/login?return_url='.$_SERVER['REQUEST_URI'], + parent::generateUri('login.index').'?return_url='.$_SERVER['REQUEST_URI'], $this->_('login'), 'login' ); diff --git a/blocks/html/meetingFiles/addForm.inc b/blocks/html/meetingFiles/addForm.inc index 4ed755d3..c424a697 100644 --- a/blocks/html/meetingFiles/addForm.inc +++ b/blocks/html/meetingFiles/addForm.inc @@ -1,7 +1,7 @@ type * @param Committee $this->committee * @param string $this->eventId @@ -9,7 +9,7 @@ */ use Web\Url; ?> - +
diff --git a/blocks/html/people/list.inc b/blocks/html/people/list.inc index b1785342..68421a75 100644 --- a/blocks/html/people/list.inc +++ b/blocks/html/people/list.inc @@ -50,7 +50,7 @@ use Web\Url; $value) { if (!in_array($key, $fields)) { $url->$key = $value; } diff --git a/blocks/html/seats/list.inc b/blocks/html/seats/list.inc index 9c5868ff..60d9ea1b 100644 --- a/blocks/html/seats/list.inc +++ b/blocks/html/seats/list.inc @@ -45,9 +45,7 @@ $title = $this->title ? self::escape($this->title) : $this->_(['seat', 'seats', $code = self::escape($seat->getCode()); $name = self::escape($seat->getName()); $appointer = self::escape($seat->getAppointer()); - $uri = BASE_URI."/seats/view?seat_id=$seat_id"; - - + $uri = parent::generateUri('seats.view')."?seat_id=$seat_id"; echo " $editButton $code diff --git a/blocks/html/terms/updateForm.inc b/blocks/html/terms/updateForm.inc index 5c299c07..8e409b77 100644 --- a/blocks/html/terms/updateForm.inc +++ b/blocks/html/terms/updateForm.inc @@ -11,7 +11,7 @@ $helper = $this->template->getHelper('field');

- + template->getHelper('buttonLink'); echo $helper->buttonLink( - BASE_URI.'/users/update', + parent::generateUri('users.update'), $this->translate('create_account'), 'add' ); diff --git a/blocks/txt/liaisons/applicationNotification.inc b/blocks/txt/liaisons/applicationNotification.inc index 2f7107cb..2df3052b 100644 --- a/blocks/txt/liaisons/applicationNotification.inc +++ b/blocks/txt/liaisons/applicationNotification.inc @@ -1,16 +1,17 @@ application */ declare (strict_types=1); +use Web\View; $committee = $this->application->getCommittee()->getName(); $committee_id = $this->application->getCommittee_id(); $person = $this->application->getApplicant()->getFullname(); $message = sprintf($this->template->_('board_application_message', 'messages'), $person, $committee); -$url = BASE_URL.'/committees/applications?committee_id='.$committee_id; +$url = View::generateUrl('committees.applications').'?committee_id='.$committee_id; echo " $message diff --git a/src/Application/Controllers/ApplicantsController.php b/src/Application/Controllers/ApplicantsController.php index ba3d1d63..530f762d 100644 --- a/src/Application/Controllers/ApplicantsController.php +++ b/src/Application/Controllers/ApplicantsController.php @@ -163,7 +163,7 @@ public function delete(): View if (isset($applicant)) { $applicant->delete(); - header('Location: '.BASE_URL.'/applicants'); + header('Location: '.View::generateUrl('applicants.index')); exit(); } else { diff --git a/src/Application/Models/Legislation/Legislation.php b/src/Application/Models/Legislation/Legislation.php index 51b01753..d71b783f 100644 --- a/src/Application/Models/Legislation/Legislation.php +++ b/src/Application/Models/Legislation/Legislation.php @@ -11,6 +11,7 @@ use Web\ActiveRecord; use Web\Database; +use Web\View; class Legislation extends ActiveRecord { @@ -229,9 +230,10 @@ public function toArray() } $files = []; + $url = View::generateUrl('legislationFiles.download'); foreach ($this->getFiles() as $f) { $files[] = [ - 'url' => BASE_URL.'/legislationFiles/download?id='.$f->getId() + 'url' => $url.'?legislationFile_id='.$f->getId() ]; } diff --git a/src/Application/Models/MeetingFile.php b/src/Application/Models/MeetingFile.php index 8303ae82..6abf90c9 100644 --- a/src/Application/Models/MeetingFile.php +++ b/src/Application/Models/MeetingFile.php @@ -7,6 +7,7 @@ use Web\ActiveRecord; use Web\Database; +use Web\View; class MeetingFile extends File { @@ -149,6 +150,6 @@ public function getEvent() /** * @return string */ - public function getDownloadUrl() { return BASE_URL.'/meetingFiles/download?meetingFile_id='.$this->getId(); } - public function getDownloadUri() { return BASE_URI.'/meetingFiles/download?meetingFile_id='.$this->getId(); } + public function getDownloadUrl() { return View::generateUrl('meetingFiles.download').'?meetingFile_id='.$this->getId(); } + public function getDownloadUri() { return View::generateUri('meetingFiles.download').'?meetingFile_id='.$this->getId(); } } diff --git a/src/Application/Models/Person.php b/src/Application/Models/Person.php index 022a90e6..001fa01e 100644 --- a/src/Application/Models/Person.php +++ b/src/Application/Models/Person.php @@ -8,6 +8,7 @@ use Web\ActiveRecord; use Web\Database; +use Web\View; use Web\Auth\ExternalIdentity; class Person extends ActiveRecord @@ -291,8 +292,8 @@ public function getFullname() /** * @return string */ - public function getUrl() { return BASE_URL.'/people/view?person_id='.$this->getId(); } - public function getUri() { return BASE_URI.'/people/view?person_id='.$this->getId(); } + public function getUrl() { return View::generateUrl('people.view').'?person_id='.$this->getId(); } + public function getUri() { return View::generateUrl('people.view').'?person_id='.$this->getId(); } /** * @return Laminas\Db\ResultSet diff --git a/src/Application/Models/Reports/Report.php b/src/Application/Models/Reports/Report.php index 307ce186..9cf5516e 100644 --- a/src/Application/Models/Reports/Report.php +++ b/src/Application/Models/Reports/Report.php @@ -10,6 +10,7 @@ use Application\Models\Committee; use Application\Models\File; use Web\ActiveRecord; +use Web\View; class Report extends File { @@ -64,12 +65,6 @@ public function setCommittee (Committee $o) { parent::setForeignKeyObject('\Appl //---------------------------------------------------------------- //---------------------------------------------------------------- - /** - * @return string - */ - public function getDownloadUrl() { return BASE_URL.'/reports/download?id='.$this->getId(); } - public function getDownloadUri() { return BASE_URI.'/reports/download?id='.$this->getId(); } - public function toArray() { return [ @@ -77,7 +72,7 @@ public function toArray() 'committee' => $this->getCommittee()->getName(), 'title' => $this->getTitle(), 'date' => $this->getReportDate(), - 'url' => $this->getDownloadUrl() + 'url' => View::generateUrl('reports.download').'?report_id='.$this->getId() ]; } }