31 define(
"ERP_NONE", 0);
32 define(
"ERP_ECONOMIC", 1);
34 require_once
'./Services/Payment/exceptions/class.ilERPException.php';
50 abstract public function getName();
54 abstract public function connect();
72 return $ilias->ini_ilias->GROUPS[
'server'][
'absolute_path'] .
'/' .
self::_getFilename();
87 return $ilias->ini_ilias->GROUPS[
'clients'][
'datadir'] .
'/' . $ilias->client_id .
'/invoices/';
92 return file_exists( self::getPreviewFile() );
96 if (self::preview_exists())
97 unlink (self::getPreviewFile());
106 $res = $ilDB->query(
'SELECT * FROM payment_erp ORDER BY erp_id' );
126 unset( $settings[
'url']);
127 unset( $settings[
'description']);
128 unset( $settings[
'erp_short']);
129 unset( $settings[
'name']);
131 $settings[
'save_copy'] = (int) $settings[
'save_copy'];
132 $settings[
'use_ean'] = (int) $settings[
'use_ean'];
134 if ($settings[
'erp_id'] == 0)
137 $settings[
'erp_id'] = 0;
141 UPDATE payment_erp SET save_copy=%s, use_ean=%s WHERE erp_id=%s",
142 array(
"integer",
"integer",
"integer"),
143 array($settings[
'save_copy'], $settings[
'use_ean'], $settings[
'erp_id'])
146 unset($settings[
'save_copy']);
147 unset($settings[
'use_ean']);
150 UPDATE payment_erps SET settings=%s WHERE erps_id=%s AND erp_id=%s",
151 array(
"text",
"integer",
"integer"),
152 array( serialize($settings), $this->erps_id, $settings[
'erp_id']));
164 $this->username = $v;
173 $this->password = $v;
182 $this->save_copy = (int) $v;
187 $this->use_ean = (int) $v;
197 public function setActive($erp_system = 0, $erp_settings = 0)
200 $ilDB->query(
'UPDATE payment_erps SET active=0');
201 $ilDB->query(
'UPDATE payment_erps SET active=1 WHERE erp_id=' . $erp_system .
' AND erps_id=' . $erp_settings);
211 $row = $ilDB->query(
'SELECT payment_erps.erp_id, payment_erps.erps_id, payment_erp.erp_short,payment_erp.use_ean, payment_erp.save_copy FROM payment_erps,payment_erp WHERE payment_erps.active=1 AND payment_erps.erp_id=payment_erp.erp_id LIMIT 1');
230 $system = $this->getERPConstants(self::$erp_id);
235 return array_merge($system, $a);
249 $res = $ilDB->query(
'SELECT * FROM payment_erp WHERE erp_id=' . $erp_system);