ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilERP Class Reference
+ Inheritance diagram for ilERP:
+ Collaboration diagram for ilERP:

Public Member Functions

 getName ()
 loadSettings ($erps_id=0)
 looksValid ()
 connect ()
 disconnect ()
 setSettings ($a)
 Set settings posted by some form.
 saveSettings ($settings)
 setActive ($erp_system=0, $erp_settings=0)
 Sets a specific configuration active and disable all other ERPs.
 getSettings ($elvis_is_alive=0)
 Return all relevant settings for a configuration.
 getERPconstants ($erp_system=0)
 Get some ERP system specific variables, stored in payment_erp.

Static Public Member Functions

static getPreviewFile ()
static getPreviewUrl ()
static getPreviewLink ()
static getSaveDirectory ()
static preview_exists ()
static preview_delete ()
static getAllERPs ()
 Get the list of ILIAS supported ERPs.
static getActive ()
 Get information about what ERP is activated.

Data Fields

const preview_pre = "invoice_"
const preview_ext = ".pdf"

Protected Member Functions

 setUsername ($v)
 Set the username used to login to ERP.
 setPassword ($v)
 Set the password used in the ERP.
 setSaveCopy ($v)
 Set the directory for saving invoices.
 setUseEAN ($v)

Protected Attributes

 $username
 $password
 $use_ean
 $save_copy

Static Private Member Functions

static _getFilename ()
 Get filename for preview invoice invoice_[client_id].pdf.

Private Attributes

 $erps_id = 0

Static Private Attributes

static $erp_id = ERP_NONE

Detailed Description

Definition at line 36 of file class.ilERP.php.

Member Function Documentation

static ilERP::_getFilename ( )
staticprivate

Get filename for preview invoice invoice_[client_id].pdf.

Definition at line 63 of file class.ilERP.php.

References preview_ext.

Referenced by getPreviewFile(), getPreviewLink(), and getPreviewUrl().

{
global $ilias;
return self::preview_pre . $ilias->client_id . self::preview_ext;
}

+ Here is the caller graph for this function:

ilERP::connect ( )
abstract

Reimplemented in ilERP_eco, and ilERP_none.

ilERP::disconnect ( )
abstract

Reimplemented in ilERP_eco, and ilERP_none.

static ilERP::getActive ( )
static

Get information about what ERP is activated.

Returns
mixed

Definition at line 208 of file class.ilERP.php.

References $ilDB, $row, and MDB2_FETCHMODE_ASSOC.

Referenced by ilPurchase\__construct(), ilObjPaymentSettingsGUI\getERPform(), and ilObjPaymentSettingsGUI\testERPSettingsObject().

{
global $ilDB;
$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');
$values = $row->fetchRow(MDB2_FETCHMODE_ASSOC);
return $values;
}

+ Here is the caller graph for this function:

static ilERP::getAllERPs ( )
static

Get the list of ILIAS supported ERPs.

Returns
mixed array of ERPs

Definition at line 103 of file class.ilERP.php.

References $ilDB, $res, and MDB2_FETCHMODE_ASSOC.

Referenced by ilObjPaymentSettingsGUI\getERPform().

{
global $ilDB;
$res = $ilDB->query('SELECT * FROM payment_erp ORDER BY erp_id' );
$a = array();
while ( $result = $res->fetchRow(MDB2_FETCHMODE_ASSOC) ) $a[$result['erp_id']] = $result;
return $a;
}

+ Here is the caller graph for this function:

ilERP::getERPconstants (   $erp_system = 0)

Get some ERP system specific variables, stored in payment_erp.

Returns
mixed

Definition at line 246 of file class.ilERP.php.

References $ilDB, $res, and MDB2_FETCHMODE_ASSOC.

{
global $ilDB;
$res = $ilDB->query('SELECT * FROM payment_erp WHERE erp_id=' . $erp_system);
$result = $res->fetchRow(MDB2_FETCHMODE_ASSOC);
return $result;
}
ilERP::getName ( )
abstract

Reimplemented in ilERP_eco, and ilERP_none.

static ilERP::getPreviewFile ( )
static

Definition at line 69 of file class.ilERP.php.

References _getFilename().

Referenced by ilERPDebtor\saveInvoice(), and ilERPDebtor_none\saveInvoice().

{
global $ilias;
return $ilias->ini_ilias->GROUPS['server']['absolute_path'] . '/' . self::_getFilename();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilERP::getPreviewLink ( )
static

Definition at line 80 of file class.ilERP.php.

References _getFilename().

{
return self::getPreviewUrl . self::_getFilename() ;
}

+ Here is the call graph for this function:

static ilERP::getPreviewUrl ( )
static

Definition at line 75 of file class.ilERP.php.

References _getFilename().

Referenced by ilObjPaymentSettingsGUI\getERPform().

{
global $ilias;
return $ilias->ini_ilias->GROUPS['server']['http_path'] . '/' . self::_getFilename() ;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilERP::getSaveDirectory ( )
static

Definition at line 84 of file class.ilERP.php.

Referenced by ilObjPaymentSettingsGUI\getERPform(), ilERPDebtor\saveInvoice(), and ilERPDebtor_none\saveInvoice().

{
global $ilias;
return $ilias->ini_ilias->GROUPS['clients']['datadir'] . '/' . $ilias->client_id .'/invoices/';
}

+ Here is the caller graph for this function:

ilERP::getSettings (   $elvis_is_alive = 0)

Return all relevant settings for a configuration.

This includes ERP-system constants, general setttings (i.e. username) and subclasses should merge their data into the output.

Reimplemented in ilERP_eco, and ilERP_none.

Definition at line 228 of file class.ilERP.php.

References $password, $save_copy, $use_ean, and $username.

{
$system = $this->getERPConstants(self::$erp_id);
$a['username'] = $this->username;
$a['password'] = $this->password;
$a['use_ean'] = $this->use_ean;
$a['save_copy'] = $this->save_copy;
return array_merge($system, $a);
}
ilERP::loadSettings (   $erps_id = 0)
abstract

Reimplemented in ilERP_eco, and ilERP_none.

ilERP::looksValid ( )
abstract

Reimplemented in ilERP_eco, and ilERP_none.

static ilERP::preview_delete ( )
static

Definition at line 94 of file class.ilERP.php.

Referenced by ilObjPaymentSettingsGUI\delERPpreviewObject().

{
if (self::preview_exists())
unlink (self::getPreviewFile());
}

+ Here is the caller graph for this function:

static ilERP::preview_exists ( )
static

Definition at line 90 of file class.ilERP.php.

Referenced by ilObjPaymentSettingsGUI\delERPpreviewObject(), and ilObjPaymentSettingsGUI\getERPform().

{
return file_exists( self::getPreviewFile() );
}

+ Here is the caller graph for this function:

ilERP::saveSettings (   $settings)

Definition at line 123 of file class.ilERP.php.

References $ilDB.

{
global $ilDB;
unset( $settings['url']);
unset( $settings['description']);
unset( $settings['erp_short']);
unset( $settings['name']);
$settings['save_copy'] = (int) $settings['save_copy'];
$settings['use_ean'] = (int) $settings['use_ean'];
if ($settings['erp_id'] == 0)
{
unset($settings);
$settings['erp_id'] = 0;
}
$ilDB->manipulateF("
UPDATE payment_erp SET save_copy=%s, use_ean=%s WHERE erp_id=%s",
array("integer", "integer", "integer"),
array($settings['save_copy'], $settings['use_ean'], $settings['erp_id'])
);
unset($settings['save_copy']);
unset($settings['use_ean']);
$ilDB->manipulateF("
UPDATE payment_erps SET settings=%s WHERE erps_id=%s AND erp_id=%s",
array("text", "integer", "integer"),
array( serialize($settings), $this->erps_id, $settings['erp_id']));
return true;
}
ilERP::setActive (   $erp_system = 0,
  $erp_settings = 0 
)

Sets a specific configuration active and disable all other ERPs.

Parameters
int$erp_systempredefined constant specifying the ERP-system
int$erp_settingsunsupported currently

Definition at line 197 of file class.ilERP.php.

References $ilDB.

{
global $ilDB;
$ilDB->query('UPDATE payment_erps SET active=0');
$ilDB->query('UPDATE payment_erps SET active=1 WHERE erp_id=' . $erp_system . ' AND erps_id=' . $erp_settings);
}
ilERP::setPassword (   $v)
protected

Set the password used in the ERP.

Parameters
string$vERP password

Definition at line 171 of file class.ilERP.php.

Referenced by ilERP_eco\loadSettings(), and setSettings().

{
$this->password = $v;
}

+ Here is the caller graph for this function:

ilERP::setSaveCopy (   $v)
protected

Set the directory for saving invoices.

Parameters
string$vdirectory

Definition at line 180 of file class.ilERP.php.

Referenced by setSettings().

{
$this->save_copy = (int) $v;
}

+ Here is the caller graph for this function:

ilERP::setSettings (   $a)

Set settings posted by some form.

Reimplemented in ilERP_eco, and ilERP_none.

Definition at line 115 of file class.ilERP.php.

References setPassword(), setSaveCopy(), setUseEAN(), and setUsername().

{
$this->setUsername( $a['username'] );
$this->setPassword( $a['passsword'] );
$this->setSaveCopy( $a['save_copy'] );
$this->setUseEAN( $a['use_ean'] );
}

+ Here is the call graph for this function:

ilERP::setUseEAN (   $v)
protected

Definition at line 185 of file class.ilERP.php.

Referenced by setSettings().

{
$this->use_ean = (int) $v;
}

+ Here is the caller graph for this function:

ilERP::setUsername (   $v)
protected

Set the username used to login to ERP.

Parameters
string$vERP login name

Definition at line 162 of file class.ilERP.php.

Referenced by ilERP_eco\loadSettings(), and setSettings().

{
$this->username = $v;
}

+ Here is the caller graph for this function:

Field Documentation

ilERP::$erp_id = ERP_NONE
staticprivate

Definition at line 44 of file class.ilERP.php.

ilERP::$erps_id = 0
private

Definition at line 43 of file class.ilERP.php.

Referenced by ilERP_eco\getSettings(), and ilERP_eco\loadSettings().

ilERP::$password
protected

Definition at line 39 of file class.ilERP.php.

Referenced by getSettings().

ilERP::$save_copy
protected

Definition at line 41 of file class.ilERP.php.

Referenced by getSettings().

ilERP::$use_ean
protected

Definition at line 40 of file class.ilERP.php.

Referenced by getSettings().

ilERP::$username
protected

Definition at line 38 of file class.ilERP.php.

Referenced by getSettings().

const ilERP::preview_ext = ".pdf"

Definition at line 47 of file class.ilERP.php.

Referenced by _getFilename().

const ilERP::preview_pre = "invoice_"

Definition at line 46 of file class.ilERP.php.


The documentation for this class was generated from the following file: