Merge pull request #9506 from frederic34/printing
printing remove no camelcaps function
This commit is contained in:
commit
75f3dd94c6
@ -342,7 +342,7 @@ if ($mode == 'test' && $user->admin)
|
||||
$langs->load($driver);
|
||||
$printer = new $classname($db);
|
||||
//print '<pre>'.print_r($printer, true).'</pre>';
|
||||
if (count($printer->getlist_available_printers())) {
|
||||
if (count($printer->getlistAvailablePrinters())) {
|
||||
if ($printer->listAvailablePrinters()==0) {
|
||||
print $printer->resprint;
|
||||
} else {
|
||||
|
||||
@ -28,8 +28,7 @@
|
||||
// Filename to print must be provided into 'file' parameter
|
||||
|
||||
// Print file
|
||||
if ($action == 'print_file' && $user->rights->printing->read)
|
||||
{
|
||||
if ($action == 'print_file' && $user->rights->printing->read) {
|
||||
$langs->load("printing");
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
||||
$objectprint = new PrintingDriver($db);
|
||||
@ -55,7 +54,7 @@ if ($action == 'print_file' && $user->rights->printing->read)
|
||||
$subdir = 'commande';
|
||||
}
|
||||
try {
|
||||
$ret = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir);
|
||||
$ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir);
|
||||
if ($ret > 0) {
|
||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
|
||||
@ -44,14 +44,14 @@ class printing_printgcp extends PrintingDriver
|
||||
public $google_secret = '';
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error = '';
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
@ -75,8 +75,8 @@ class printing_printgcp extends PrintingDriver
|
||||
global $conf, $langs, $dolibarr_main_url_root;
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
$this->db = $db;
|
||||
@ -85,7 +85,7 @@ class printing_printgcp extends PrintingDriver
|
||||
$this->conf[] = array(
|
||||
'varname'=>'PRINTGCP_INFO',
|
||||
'info'=>$langs->transnoentitiesnoconv("WarningModuleNotActive", "OAuth"),
|
||||
'type'=>'info'
|
||||
'type'=>'info',
|
||||
);
|
||||
} else {
|
||||
|
||||
@ -144,7 +144,7 @@ class printing_printgcp extends PrintingDriver
|
||||
|
||||
$refreshtoken = $token->getRefreshToken();
|
||||
|
||||
$endoflife=$token->getEndOfLife();
|
||||
$endoflife = $token->getEndOfLife();
|
||||
|
||||
if ($endoflife == $token::EOL_NEVER_EXPIRES)
|
||||
{
|
||||
@ -183,9 +183,9 @@ class printing_printgcp extends PrintingDriver
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
function listAvailablePrinters()
|
||||
public function listAvailablePrinters()
|
||||
{
|
||||
global $bc, $conf, $langs;
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
$langs->load('printing');
|
||||
|
||||
@ -199,7 +199,7 @@ class printing_printgcp extends PrintingDriver
|
||||
$html.= '<td>'.$langs->trans('GCP_Type').'</td>';
|
||||
$html.= '<td align="center">'.$langs->trans("Select").'</td>';
|
||||
$html.= '</tr>'."\n";
|
||||
$list = $this->getlist_available_printers();
|
||||
$list = $this->getlistAvailablePrinters();
|
||||
//$html.= '<td><pre>'.print_r($list,true).'</pre></td>';
|
||||
foreach ($list['available'] as $printer_det)
|
||||
{
|
||||
@ -227,15 +227,13 @@ class printing_printgcp extends PrintingDriver
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of available printers
|
||||
*
|
||||
* @return array list of printers
|
||||
*/
|
||||
function getlist_available_printers()
|
||||
public function getlistAvailablePrinters()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Token storage
|
||||
$storage = new DoliStorage($this->db, $this->conf);
|
||||
// Setup the credentials for the requests
|
||||
@ -293,7 +291,6 @@ class printing_printgcp extends PrintingDriver
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Print selected file
|
||||
*
|
||||
@ -302,16 +299,17 @@ class printing_printgcp extends PrintingDriver
|
||||
* @param string $subdir subdir for file
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
function print_file($file, $module, $subdir='')
|
||||
public function printFile($file, $module, $subdir='')
|
||||
{
|
||||
// phpcs:enable
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
global $conf, $user;
|
||||
$error = 0;
|
||||
|
||||
$fileprint=$conf->{$module}->dir_output;
|
||||
if ($subdir!='') $fileprint.='/'.$subdir;
|
||||
$fileprint = $conf->{$module}->dir_output;
|
||||
if ($subdir!='') {
|
||||
$fileprint.='/'.$subdir;
|
||||
}
|
||||
$fileprint.='/'.$file;
|
||||
$mimetype = dol_mimetype($fileprint);
|
||||
// select printer uri for module order, propal,...
|
||||
@ -342,7 +340,9 @@ class printing_printgcp extends PrintingDriver
|
||||
|
||||
$ret = $this->sendPrintToPrinter($printer_id, $file, $fileprint, $mimetype);
|
||||
$this->error = 'PRINTGCP: '.$ret['errormessage'];
|
||||
if ($ret['status']!=1) $error++;
|
||||
if ($ret['status']!=1) {
|
||||
$error++;
|
||||
}
|
||||
return $error;
|
||||
}
|
||||
|
||||
@ -370,12 +370,13 @@ class printing_printgcp extends PrintingDriver
|
||||
$contents = fread($handle, filesize($filepath));
|
||||
fclose($handle);
|
||||
// Prepare post fields for sending print
|
||||
$post_fields = array('printerid' => $printerid,
|
||||
'title' => $printjobtitle,
|
||||
'contentTransferEncoding' => 'base64',
|
||||
'content' => base64_encode($contents), // encode file content as base64
|
||||
'contentType' => $contenttype
|
||||
);
|
||||
$post_fields = array(
|
||||
'printerid' => $printerid,
|
||||
'title' => $printjobtitle,
|
||||
'contentTransferEncoding' => 'base64',
|
||||
'content' => base64_encode($contents), // encode file content as base64
|
||||
'contentType' => $contenttype,
|
||||
);
|
||||
// Dolibarr Token storage
|
||||
$storage = new DoliStorage($this->db, $this->conf);
|
||||
// Setup the credentials for the requests
|
||||
@ -410,20 +411,18 @@ class printing_printgcp extends PrintingDriver
|
||||
// Send a request with api
|
||||
$response = json_decode($apiService->request(self::PRINT_URL, 'POST', $post_fields), true);
|
||||
//print '<tr><td><pre>'.print_r($response, true).'</pre></td></tr>';
|
||||
return array('status' =>$response['success'],'errorcode' =>$response['errorCode'],'errormessage'=>$response['message']);
|
||||
return array('status' => $response['success'], 'errorcode' => $response['errorCode'], 'errormessage' => $response['message']);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List jobs print
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
function list_jobs()
|
||||
public function listJobs()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db, $langs, $bc;
|
||||
global $conf, $langs;
|
||||
|
||||
$error = 0;
|
||||
$html = '';
|
||||
@ -489,13 +488,11 @@ class printing_printgcp extends PrintingDriver
|
||||
|
||||
$jobs = $responsedata['jobs'];
|
||||
//$html .= '<pre>'.print_r($jobs['0'],true).'</pre>';
|
||||
if (is_array($jobs))
|
||||
{
|
||||
foreach ($jobs as $value)
|
||||
{
|
||||
if (is_array($jobs)) {
|
||||
foreach ($jobs as $value) {
|
||||
$html .= '<tr class="oddeven">';
|
||||
$html .= '<td>'.$value['id'].'</td>';
|
||||
$dates=dol_print_date((int) substr($value['createTime'], 0, 10), 'dayhour');
|
||||
$dates = dol_print_date((int) substr($value['createTime'], 0, 10), 'dayhour');
|
||||
$html .= '<td>'.$dates.'</td>';
|
||||
$html .= '<td>'.$value['ownerId'].'</td>';
|
||||
$html .= '<td>'.$value['printerName'].'</td>';
|
||||
|
||||
@ -30,16 +30,16 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
|
||||
*/
|
||||
class printing_printipp extends PrintingDriver
|
||||
{
|
||||
var $name='printipp';
|
||||
var $desc='PrintIPPDesc';
|
||||
var $picto='printer';
|
||||
var $active='PRINTING_PRINTIPP';
|
||||
var $conf=array();
|
||||
var $host;
|
||||
var $port;
|
||||
var $userid; /* user login */
|
||||
var $user;
|
||||
var $password;
|
||||
public $name = 'printipp';
|
||||
public $desc = 'PrintIPPDesc';
|
||||
public $picto = 'printer';
|
||||
public $active = 'PRINTING_PRINTIPP';
|
||||
public $conf = array();
|
||||
public $host;
|
||||
public $port;
|
||||
public $userid; /* user login */
|
||||
public $user;
|
||||
public $password;
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
@ -78,7 +78,6 @@ class printing_printipp extends PrintingDriver
|
||||
$this->conf[] = array('enabled'=>1, 'type'=>'submit');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Print selected file
|
||||
*
|
||||
@ -88,9 +87,8 @@ class printing_printipp extends PrintingDriver
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
function print_file($file, $module, $subdir='')
|
||||
public function printFile($file, $module, $subdir='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
$error = 0;
|
||||
|
||||
@ -107,8 +105,7 @@ class printing_printipp extends PrintingDriver
|
||||
// select printer uri for module order, propal,...
|
||||
$sql = "SELECT rowid,printer_id,copy FROM ".MAIN_DB_PREFIX."printing WHERE module = '".$module."' AND driver = 'printipp' AND userid = ".$user->id;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj)
|
||||
{
|
||||
@ -129,8 +126,9 @@ class printing_printipp extends PrintingDriver
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
|
||||
// Set number of copy
|
||||
$ipp->setCopies($obj->copy);
|
||||
@ -156,7 +154,7 @@ class printing_printipp extends PrintingDriver
|
||||
*/
|
||||
function listAvailablePrinters()
|
||||
{
|
||||
global $bc, $conf, $langs;
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
|
||||
$html = '<tr class="liste_titre">';
|
||||
@ -172,11 +170,9 @@ class printing_printipp extends PrintingDriver
|
||||
$html.= '<td>'.$langs->trans('IPP_Supported').'</td>';
|
||||
$html.= '<td align="center">'.$langs->trans("Select").'</td>';
|
||||
$html.= "</tr>\n";
|
||||
$list = $this->getlist_available_printers();
|
||||
foreach ($list as $value)
|
||||
{
|
||||
|
||||
$printer_det = $this->get_printer_detail($value);
|
||||
$list = $this->getlistAvailablePrinters();
|
||||
foreach ($list as $value) {
|
||||
$printer_det = $this->getPrinterDetail($value);
|
||||
$html.= '<tr class="oddeven">';
|
||||
$html.= '<td>'.$value.'</td>';
|
||||
//$html.= '<td><pre>'.print_r($printer_det,true).'</pre></td>';
|
||||
@ -191,12 +187,9 @@ class printing_printipp extends PrintingDriver
|
||||
$html.= '<td>'.$langs->trans('MEDIA_IPP_'.$printer_det->media_type_supported->_value1).'</td>';
|
||||
// Defaut
|
||||
$html.= '<td align="center">';
|
||||
if ($conf->global->PRINTIPP_URI_DEFAULT == $value)
|
||||
{
|
||||
if ($conf->global->PRINTIPP_URI_DEFAULT == $value) {
|
||||
$html.= img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$html.= '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&mode=test&varname=PRINTIPP_URI_DEFAULT&driver=printipp&value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
$html.= '</td>';
|
||||
@ -206,37 +199,35 @@ class printing_printipp extends PrintingDriver
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of available printers
|
||||
*
|
||||
* @return array list of printers
|
||||
*/
|
||||
function getlist_available_printers()
|
||||
public function getlistAvailablePrinters()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$db;
|
||||
global $conf, $db;
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
$ipp = new CupsPrintIPP();
|
||||
$ipp->setLog(DOL_DATA_ROOT.'/dolibarr_printipp.log','file',3); // logging very verbose
|
||||
$ipp->setHost($this->host);
|
||||
$ipp->setPort($this->port);
|
||||
$ipp->setUserName($this->userid);
|
||||
if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password);
|
||||
if (! empty($this->user)) {
|
||||
$ipp->setAuthentication($this->user, $this->password);
|
||||
}
|
||||
$ipp->getPrinters();
|
||||
return $ipp->available_printers;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get printer detail
|
||||
*
|
||||
* @param string $uri URI
|
||||
* @return array List of attributes
|
||||
*/
|
||||
function get_printer_detail($uri)
|
||||
private function getPrinterDetail($uri)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$db;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
@ -245,13 +236,14 @@ class printing_printipp extends PrintingDriver
|
||||
$ipp->setHost($this->host);
|
||||
$ipp->setPort($this->port);
|
||||
$ipp->setUserName($this->userid);
|
||||
if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password);
|
||||
if (! empty($this->user)) {
|
||||
$ipp->setAuthentication($this->user, $this->password);
|
||||
}
|
||||
$ipp->setPrinterURI($uri);
|
||||
$ipp->getPrinterAttributes();
|
||||
return $ipp->printer_attributes;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List jobs print
|
||||
*
|
||||
@ -259,10 +251,9 @@ class printing_printipp extends PrintingDriver
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
function list_jobs($module)
|
||||
public function listJobs($module)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db, $bc;
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$html = '';
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
@ -271,19 +262,17 @@ class printing_printipp extends PrintingDriver
|
||||
$ipp->setHost($this->host);
|
||||
$ipp->setPort($this->port);
|
||||
$ipp->setUserName($this->userid);
|
||||
if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password);
|
||||
if (! empty($this->user)) {
|
||||
$ipp->setAuthentication($this->user,$this->password);
|
||||
}
|
||||
// select printer uri for module order, propal,...
|
||||
$sql = 'SELECT rowid,printer_uri,printer_name FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"';
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj)
|
||||
{
|
||||
if ($obj) {
|
||||
$ipp->setPrinterURI($obj->printer_uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// All printers
|
||||
$ipp->setPrinterURI("ipp://localhost:631/printers/");
|
||||
}
|
||||
@ -307,8 +296,7 @@ class printing_printipp extends PrintingDriver
|
||||
$jobs = $ipp->jobs_attributes;
|
||||
|
||||
//$html .= '<pre>'.print_r($jobs,true).'</pre>';
|
||||
foreach ($jobs as $value )
|
||||
{
|
||||
foreach ($jobs as $value ) {
|
||||
$html .= '<tr class="oddeven">';
|
||||
$html .= '<td>'.$value->job_id->_value0.'</td>';
|
||||
$html .= '<td>'.$value->job_originating_user_name->_value0.'</td>';
|
||||
|
||||
@ -109,12 +109,12 @@ if ($action == 'setvalue' && $user->admin)
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("PrintingSetup"));
|
||||
llxHeader('', $langs->trans("PrintingSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("PrintingSetup"),$linkback,'title_setup');
|
||||
|
||||
$head=printingadmin_prepare_head($mode);
|
||||
$head = printingAdminPrepareHead($mode);
|
||||
|
||||
if ($mode == 'setup' && $user->admin)
|
||||
{
|
||||
@ -134,8 +134,7 @@ if ($mode == 'setup' && $user->admin)
|
||||
print "</tr>\n";
|
||||
$submit_enabled=0;
|
||||
|
||||
if (! empty($driver))
|
||||
{
|
||||
if (! empty($driver)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||
$classname = 'printing_'.$driver;
|
||||
$langs->load($driver);
|
||||
@ -304,7 +303,7 @@ if ($mode == 'test' && $user->admin)
|
||||
$langs->load($driver);
|
||||
$printer = new $classname($db);
|
||||
//print '<pre>'.print_r($printer, true).'</pre>';
|
||||
if (count($printer->getlist_available_printers())) {
|
||||
if (count($printer->getlistAvailablePrinters())) {
|
||||
if ($printer->listAvailablePrinters()==0) {
|
||||
print $printer->resprint;
|
||||
} else {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -40,29 +40,26 @@ $langs->load("printing");
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader("",$langs->trans("Printing"));
|
||||
llxHeader("", $langs->trans("Printing"));
|
||||
|
||||
print_barre_liste($langs->trans("Printing"), 0, $_SERVER["PHP_SELF"], '', '', '', '<a class="button" href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Refresh").'</a>', 0, 0, 'title_setup.png');
|
||||
print_barre_liste($langs->trans("Printing"), 0, $_SERVER["PHP_SELF"], '', '', '', '<a class="button" href="' . $_SERVER["PHP_SELF"] . '">' . $langs->trans("Refresh") . '</a>', 0, 0, 'title_setup.png');
|
||||
|
||||
print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
|
||||
|
||||
// List Jobs from printing modules
|
||||
$object = new PrintingDriver($db);
|
||||
$result = $object->listDrivers($db, 10);
|
||||
foreach ($result as $driver)
|
||||
{
|
||||
foreach ($result as $driver) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||
$classname = 'printing_'.$driver;
|
||||
$langs->load($driver);
|
||||
$printer = new $classname($db);
|
||||
if ($conf->global->{$printer->active})
|
||||
{
|
||||
//$printer->list_jobs('commande');
|
||||
$result = $printer->list_jobs();
|
||||
if ($conf->global->{$printer->active}) {
|
||||
//$printer->listJobs('commande');
|
||||
$result = $printer->listJobs();
|
||||
print $printer->resprint;
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -26,10 +27,10 @@
|
||||
/**
|
||||
* Define head array for tabs of printing tools setup pages
|
||||
*
|
||||
* @param string $mode Mode
|
||||
* @return Array of head
|
||||
* @param string $mode Mode
|
||||
* @return array Array of head
|
||||
*/
|
||||
function printingadmin_prepare_head($mode)
|
||||
function printingAdminPrepareHead($mode)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -41,28 +42,26 @@ function printingadmin_prepare_head($mode)
|
||||
$head[$h][2] = 'config';
|
||||
$h++;
|
||||
|
||||
if ($mode == 'setup')
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver','alpha');
|
||||
$head[$h][1] = $langs->trans("SetupDriver");
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
if ($mode == 'setup') {
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver','alpha');
|
||||
$head[$h][1] = $langs->trans("SetupDriver");
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($mode == 'test')
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver','alpha');
|
||||
$head[$h][1] = $langs->trans("TargetedPrinter");
|
||||
$head[$h][2] = 'test';
|
||||
$h++;
|
||||
if ($mode == 'test') {
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver','alpha');
|
||||
$head[$h][1] = $langs->trans("TargetedPrinter");
|
||||
$head[$h][2] = 'test';
|
||||
$h++;
|
||||
}
|
||||
|
||||
/** TODO This feature seem to be not ready yet.
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
|
||||
$head[$h][1] = $langs->trans("UserConf");
|
||||
$head[$h][2] = 'userconf';
|
||||
$h++;
|
||||
*/
|
||||
/** TODO This feature seem to be not ready yet.
|
||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
|
||||
$head[$h][1] = $langs->trans("UserConf");
|
||||
$head[$h][2] = 'userconf';
|
||||
$h++;
|
||||
*/
|
||||
|
||||
//$object=new stdClass();
|
||||
|
||||
@ -76,4 +75,3 @@ function printingadmin_prepare_head($mode)
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user