Welcome, Guest
Username: Password: Remember me

TOPIC: Hide the "Export to PDF" button

Hide the "Export to PDF" button 2 months 2 weeks ago #109741

  • chrisvor
  • chrisvor's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Hello,
I need to HIDE the button after the submission of a survey that says "Export to PDF", as the final output is at this moment very ugly and I dont want to have the button to create it.

I tried the 'usepdfexport'=>0 in the config.php and also the $config [ 'usepdfexport' ] =0 (or ='0') in config-default.php, but the survey continues to show this button.

Any idea how I can completely remove it?

Thanks
Chris
Last Edit: 2 months 2 weeks ago by chrisvor.
The administrator has disabled public write access.

Hide the "Export to PDF" button 2 months 2 weeks ago #109759

  • chrisvor
  • chrisvor's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Answering my own question just in case somebody else needs to do the same:

Using version 2.05+
in application\controllers\PrintanswersController.php, line 103 change this:

$sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
."<center><input type='submit' value='".$clang->gT("PDF export")."'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";

to this:

if (app()->getConfig("usepdfexport") == 0) {
$sOutput = "";
} else {
$sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
."<center><input type='submit' value='".$clang->gT("PDF export")."'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
};

I hope this helps someone :)
The administrator has disabled public write access.

Hide the "Export to PDF" button 2 months 2 weeks ago #109773

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6256
  • Thank you received: 799
  • Karma: 239
Hi,

If you set 'usepdfexport'=>0 in the confir.php file (at same place than 'debug'=>0) without your patch: do you have the button ?

If yes : what's is your LS version ?
If it the last :please make a patch for LimeSurvey core in github.com/LimeSurvey/LimeSurvey/pulls

Denis
The administrator has disabled public write access.

Hide the "Export to PDF" button 2 months 2 weeks ago #109779

  • chrisvor
  • chrisvor's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Hi,
I'm using the latest version according to auto-update (Version 2.05+ Build 140520).

I searched the complete source for the "usepdfexport" keyword, and it does not appear anywhere. So apparently nothing is checking whether the setting is on or off, so having it in the config does not change anything.

As per your request, I created a patch and created a pull request to merge the change to the core.

Thanks :)
Chris
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.125 seconds
Donation Image