Skip to content

Commit

Permalink
Fixed issue #7017: Unwanted date in print view footer
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Dec 9, 2012
1 parent aa20f0d commit bc38d20
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -70,28 +70,34 @@ function index($surveyid, $lang = null)
$surveyactive = $desrow['active'];
$surveytable = "{{survey_".$desrow['sid']."}}";
$surveyexpirydate = $desrow['expires'];
$surveystartdate = $desrow['startdate'];
$surveyfaxto = $desrow['faxto'];
$dateformattype = $desrow['surveyls_dateformat'];


if(isset($_POST['printableexport'])){$pdf->titleintopdf($surveyname,$surveydesc);}


Yii::app()->loadHelper('surveytranslator');
$dformat=getDateFormatData($dateformattype);
$dformat=$dformat['phpdate'];

if (!is_null($surveyexpirydate))
{
$dformat=getDateFormatData($dateformattype);
$dformat=$dformat['phpdate'];

$expirytimestamp = strtotime($surveyexpirydate);
$expirytimeofday_h = date('H',$expirytimestamp);
$expirytimeofday_m = date('i',$expirytimestamp);
$expirytimestamp = strtotime($surveyexpirydate);
$expirytimeofday_h = date('H',$expirytimestamp);
$expirytimeofday_m = date('i',$expirytimestamp);

$surveyexpirydate = date($dformat,$expirytimestamp);
$surveyexpirydate = date($dformat,$expirytimestamp);

if(!empty($expirytimeofday_h) || !empty($expirytimeofday_m))
if(!empty($expirytimeofday_h) || !empty($expirytimeofday_m))
{
$surveyexpirydate .= ' – '.$expirytimeofday_h.':'.$expirytimeofday_m;
};
sprintf($clang->gT("Please submit by %s"), $surveyexpirydate);
}
else
{
$surveyexpirydate .= ' – '.$expirytimeofday_h.':'.$expirytimeofday_m;
};
$surveyexpirydate='';
}

//define('PRINT_TEMPLATE' , '/templates/print/' , true);
if(is_file(Yii::app()->getConfig('usertemplaterootdir').DIRECTORY_SEPARATOR.$template.DIRECTORY_SEPARATOR.'print_survey.pstpl'))
Expand Down Expand Up @@ -158,12 +164,6 @@ function index($surveyid, $lang = null)
$survey_output['FAX_TO'] = $clang->gT("Please fax your completed survey to:")." $surveyfaxto";
}


if ($surveystartdate!='')
{
$survey_output['SUBMIT_BY'] = sprintf($clang->gT("Please submit by %s"), $surveyexpirydate);
}

/**
* Output arrays:
* $survey_output = final vaiables for whole survey
Expand Down

0 comments on commit bc38d20

Please sign in to comment.