From e8f2e4314d930579b678899e7fbfd8d24fe090d7 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 5 Dec 2013 14:39:39 +0100 Subject: [PATCH 1/4] fix --- templates/account.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/account.html b/templates/account.html index 715a71d..1143132 100644 --- a/templates/account.html +++ b/templates/account.html @@ -88,7 +88,7 @@

Twój profil

Data rejestracji w systemie: {$user->r_date} - { if $user->statement_file && !$user->statement_downloaded } + { if $user->statement_file && $user->statement_downloaded!=1 } Pobierz oświadczenie dla wolontariusza
OŚWIADCZENIE MOŻE BYĆ POBRANE TYLKO RAZ! ZAPISZ LUB OD RAZU WYDRUKUJ I PODPISZ.
From 220f893b4f8f80d0dc51a59cc85c6ec38de46cca Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 5 Dec 2013 14:42:30 +0100 Subject: [PATCH 2/4] revert --- templates/account.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/account.html b/templates/account.html index 1143132..715a71d 100644 --- a/templates/account.html +++ b/templates/account.html @@ -88,7 +88,7 @@

Twój profil

Data rejestracji w systemie: {$user->r_date} - { if $user->statement_file && $user->statement_downloaded!=1 } + { if $user->statement_file && !$user->statement_downloaded } Pobierz oświadczenie dla wolontariusza
OŚWIADCZENIE MOŻE BYĆ POBRANE TYLKO RAZ! ZAPISZ LUB OD RAZU WYDRUKUJ I PODPISZ.
From e47d67c459c34c08ca013593ae9df758f0a404cf Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 5 Dec 2013 14:58:16 +0100 Subject: [PATCH 3/4] exceptions --- class/Exceptions_handler_lib.php | 2 +- class/displayManager.Class.php | 33 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/class/Exceptions_handler_lib.php b/class/Exceptions_handler_lib.php index 8730c70..3d3f7c4 100644 --- a/class/Exceptions_handler_lib.php +++ b/class/Exceptions_handler_lib.php @@ -124,7 +124,7 @@ class FileException extends Exception { function __construct($in_errormsg=Null,$in_errorcode=Null) { - parent::__construct("Bład pliku: + parent::__construct("Błąd pliku: {$in_errormsg}",$in_errorcode); } } \ No newline at end of file diff --git a/class/displayManager.Class.php b/class/displayManager.Class.php index a51463b..6f596a4 100644 --- a/class/displayManager.Class.php +++ b/class/displayManager.Class.php @@ -851,20 +851,25 @@ public function meetings(){ * @return statement file contents */ public function download_statement($data){ - if ($data['id']){ - /* id is set, logged in user should be superadmin */ - $this->secure('admin'); - $volunteer = $this->engine->loadVolunteers(array('id'=>$data['id'])); - $volunteer = $volunteer[0]; - $volunteer->getStatementFileContents(false); - }else{ - /* else only currently logged in user statement is available */ - $this->secure('self'); - if (!$this->user->statement_downloaded){ - $this->user->getStatementFileContents(); - }else{ - HTTP::redirect('/'); - } + try { + if ($data['id']){ + /* id is set, logged in user should be superadmin */ + $this->secure('admin'); + $volunteer = $this->engine->loadVolunteers(array('id'=>$data['id'])); + $volunteer = $volunteer[0]; + $volunteer->getStatementFileContents(false); + }else{ + /* else only currently logged in user statement is available */ + $this->secure('self'); + if (!$this->user->statement_downloaded){ + $this->user->getStatementFileContents(); + }else{ + HTTP::redirect('/'); + } + } + }catch (FileException $e){ + echo $e->getMessage(); + die(); } } } From da42e94cc2277ccb8757607e70280eee69305e82 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 5 Dec 2013 15:00:56 +0100 Subject: [PATCH 4/4] download link for admin --- templates/volunteer_account.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/volunteer_account.html b/templates/volunteer_account.html index c26a948..d561816 100644 --- a/templates/volunteer_account.html +++ b/templates/volunteer_account.html @@ -22,7 +22,7 @@

Dane wolontariusza {if $user->ACL_check('edit')}Pobierz oświadczenie wolontariusza