Debug v16
This commit is contained in:
parent
60117bbaee
commit
a02c0f55fb
@ -67,7 +67,11 @@ class PrintingDriver
|
|||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
$listoffiles = array();
|
$listoffiles = array();
|
||||||
|
if (!empty($conf->modules_parts['printing'])) {
|
||||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||||
|
} else {
|
||||||
|
$dirmodels = array('/core/modules/printing/');
|
||||||
|
}
|
||||||
foreach ($dirmodels as $dir) {
|
foreach ($dirmodels as $dir) {
|
||||||
$tmpfiles = dol_dir_list(dol_buildpath($dir, 0), 'all', 0, '\.modules.php', '', 'name', SORT_ASC, 0);
|
$tmpfiles = dol_dir_list(dol_buildpath($dir, 0), 'all', 0, '\.modules.php', '', 'name', SORT_ASC, 0);
|
||||||
if (!empty($tmpfiles)) {
|
if (!empty($tmpfiles)) {
|
||||||
|
|||||||
@ -116,8 +116,8 @@ class printing_printgcp extends PrintingDriver
|
|||||||
'type'=>'info',
|
'type'=>'info',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->google_id = $conf->global->OAUTH_GOOGLE_ID;
|
$this->google_id = getDolGlobalString('OAUTH_GOOGLE_ID');
|
||||||
$this->google_secret = $conf->global->OAUTH_GOOGLE_SECRET;
|
$this->google_secret = getDolGlobalString('OAUTH_GOOGLE_SECRET');
|
||||||
// Token storage
|
// Token storage
|
||||||
$storage = new DoliStorage($this->db, $this->conf);
|
$storage = new DoliStorage($this->db, $this->conf);
|
||||||
//$storage->clearToken($this->OAUTH_SERVICENAME_GOOGLE);
|
//$storage->clearToken($this->OAUTH_SERVICENAME_GOOGLE);
|
||||||
|
|||||||
@ -141,14 +141,18 @@ class DoliStorage implements TokenStorageInterface
|
|||||||
dol_syslog("hasAccessToken service=".$service);
|
dol_syslog("hasAccessToken service=".$service);
|
||||||
|
|
||||||
$sql = "SELECT token FROM ".MAIN_DB_PREFIX."oauth_token";
|
$sql = "SELECT token FROM ".MAIN_DB_PREFIX."oauth_token";
|
||||||
$sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'";
|
$sql .= " WHERE service = '".$this->db->escape($service.(empty($this->keyforprovider) ? '' : '-'.$this->keyforprovider))."'";
|
||||||
$sql .= " AND entity IN (".getEntity('oauth_token').")";
|
$sql .= " AND entity IN (".getEntity('oauth_token').")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
$result = $this->db->fetch_array($resql);
|
$result = $this->db->fetch_array($resql);
|
||||||
|
if ($result) {
|
||||||
$token = unserialize($result['token']);
|
$token = unserialize($result['token']);
|
||||||
|
} else {
|
||||||
|
$token = '';
|
||||||
|
}
|
||||||
|
|
||||||
$this->tokens[$service] = $token;
|
$this->tokens[$service] = $token;
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,12 @@ if ($mode == 'setup' && $user->admin) {
|
|||||||
$submit_enabled = 0;
|
$submit_enabled = 0;
|
||||||
|
|
||||||
if (!empty($driver)) {
|
if (!empty($driver)) {
|
||||||
|
if (!empty($conf->modules_parts['printing'])) {
|
||||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||||
|
} else {
|
||||||
|
$dirmodels = array('/core/modules/printing/');
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($dirmodels as $dir) {
|
foreach ($dirmodels as $dir) {
|
||||||
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
||||||
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
|
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
|
||||||
@ -253,7 +258,13 @@ if ($mode == 'config' && $user->admin) {
|
|||||||
|
|
||||||
$object = new PrintingDriver($db);
|
$object = new PrintingDriver($db);
|
||||||
$result = $object->listDrivers($db, 10);
|
$result = $object->listDrivers($db, 10);
|
||||||
|
|
||||||
|
if (!empty($conf->modules_parts['printing'])) {
|
||||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||||
|
} else {
|
||||||
|
$dirmodels = array('/core/modules/printing/');
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($result as $driver) {
|
foreach ($result as $driver) {
|
||||||
foreach ($dirmodels as $dir) {
|
foreach ($dirmodels as $dir) {
|
||||||
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
||||||
@ -296,7 +307,12 @@ if ($mode == 'test' && $user->admin) {
|
|||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
if (!empty($driver)) {
|
if (!empty($driver)) {
|
||||||
|
if (!empty($conf->modules_parts['printing'])) {
|
||||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||||
|
} else {
|
||||||
|
$dirmodels = array('/core/modules/printing/');
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($dirmodels as $dir) {
|
foreach ($dirmodels as $dir) {
|
||||||
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) {
|
||||||
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
|
$classfile = dol_buildpath($dir, 0).$driver.'.modules.php';
|
||||||
|
|||||||
@ -59,7 +59,7 @@ foreach ($result as $driver) {
|
|||||||
$langs->load($driver);
|
$langs->load($driver);
|
||||||
$printer = new $classname($db);
|
$printer = new $classname($db);
|
||||||
$keyforprinteractive = $printer->active;
|
$keyforprinteractive = $printer->active;
|
||||||
if ($keyforprinteractive && $conf->global->$keyforprinteractive) {
|
if ($keyforprinteractive && getDolGlobalString($keyforprinteractive)) {
|
||||||
//$printer->listJobs('commande');
|
//$printer->listJobs('commande');
|
||||||
$result = $printer->listJobs();
|
$result = $printer->listJobs();
|
||||||
print $printer->resprint;
|
print $printer->resprint;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user