This commit is contained in:
frederic34 2015-11-03 21:40:05 +01:00
parent d362d889f6
commit 5c725aceb8
3 changed files with 27 additions and 2 deletions

View File

@ -239,6 +239,9 @@ if ($mode == 'config' && $user->admin)
case 4: case 4:
$connector = 'CONNECTOR_WINDOWS_PRINT'; $connector = 'CONNECTOR_WINDOWS_PRINT';
break; break;
case 5:
$connector = 'CONNECTOR_JAVA';
break;
default: default:
$connector = 'CONNECTOR_UNKNOWN'; $connector = 'CONNECTOR_UNKNOWN';
break; break;

View File

@ -104,7 +104,7 @@ class dolReceiptPrinter extends Escpos
const CONNECTOR_FILE_PRINT = 2; const CONNECTOR_FILE_PRINT = 2;
const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_NETWORK_PRINT = 3;
const CONNECTOR_WINDOWS_PRINT = 4; const CONNECTOR_WINDOWS_PRINT = 4;
//const CONNECTOR_JAVA = 6; //const CONNECTOR_JAVA = 5;
var $db; var $db;
var $error; var $error;
var $errors; var $errors;

View File

@ -93,7 +93,7 @@ class modReceiptPrinter extends DolibarrModules
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code
$r++; $r++;
$this->rights[$r][0] = 67001; $this->rights[$r][0] = 67000;
$this->rights[$r][1] = 'ReceiptPrinter'; $this->rights[$r][1] = 'ReceiptPrinter';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
@ -120,4 +120,26 @@ class modReceiptPrinter extends DolibarrModules
} }
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
{
global $conf;
// Clean before activation
$this->remove($options);
$sql = array(
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), fk_type int(11), parameter varchar(128), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;",
"CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), template text, entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;",
);
return $this->_init($sql,$options);
}
} }