Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v.2013.3.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoor committed Dec 5, 2013
2 parents 9541de1 + da42e94 commit 7d43f2f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion class/Exceptions_handler_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
33 changes: 19 additions & 14 deletions class/displayManager.Class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/volunteer_account.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3><span>Dane wolontariusza</span> {if $user->ACL_check('edit')}<a id="change_v
<th>Status oświadczenia:</th>
<td>{$volunteer->getStatementState()}</td>
</tr>
{if $user->ACL_check('superadmin')}
{if $user->ACL_check('superadmin') && $volunteer->statement_file}
<tr>
<th colspan="2" class="text-left"><a href="/?action=download_statement&amp;id={$volunteer->id}">Pobierz oświadczenie wolontariusza</a></th>
</tr>
Expand Down

0 comments on commit 7d43f2f

Please sign in to comment.