Fix Javascript and LPR shell command
This commit is contained in:
parent
cdc94d2db7
commit
470d7c09ef
|
@ -76,7 +76,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = OC.generateUrl('/apps/printer/printfile'),
|
var url = OC.generateUrl('/apps/printer/printfile'),
|
||||||
data = {source: fileInfo.getFullPath(), orientation: orientation},
|
data = {sourcefile: fileInfo.getFullPath(), orientation: orientation},
|
||||||
_self = this;
|
_self = this;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
|
|
@ -29,7 +29,7 @@ class PrinterController extends Controller {
|
||||||
public function printfile($sourcefile, $orientation) {
|
public function printfile($sourcefile, $orientation) {
|
||||||
if($orientation === "landscape") {
|
if($orientation === "landscape") {
|
||||||
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
||||||
exec('lpr ' . $filefullpath);
|
exec('sudo lpr "' . $filefullpath . '"');
|
||||||
return new JSONResponse(
|
return new JSONResponse(
|
||||||
array(
|
array(
|
||||||
'response' => 'success',
|
'response' => 'success',
|
||||||
|
@ -40,7 +40,7 @@ class PrinterController extends Controller {
|
||||||
|
|
||||||
if($orientation === "portrait"){
|
if($orientation === "portrait"){
|
||||||
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
||||||
exec('lpr -o orientation-requested=4 ' . $filefullpath);
|
exec('sudo lpr -o orientation-requested=4 "' . $filefullpath . '"');
|
||||||
return new JSONResponse(
|
return new JSONResponse(
|
||||||
array(
|
array(
|
||||||
'response' => 'success',
|
'response' => 'success',
|
||||||
|
|
Loading…
Reference in a new issue