ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilERP_eco Class Reference
+ Inheritance diagram for ilERP_eco:
+ Collaboration diagram for ilERP_eco:

Public Member Functions

 __construct ()
 getSettings ($erps_id=0)
 Return e-conomic settings as an array.
 connect ()
 disconnect ()
 getName ()
 setSettings ($a)
 Sets e-conomic settings.
 looksValid ()
 Returns true if the e-conomic settings looks valid to the interface Done without testing conection etc.
 loadSettings ($erps_id=0)
 Called from constructor to fetch settings from database.
- Public Member Functions inherited from ilERP
 saveSettings ($settings)
 setActive ($erp_system=0, $erp_settings=0)
 Sets a specific configuration active and disable all other ERPs.
 getERPconstants ($erp_system=0)
 Get some ERP system specific variables, stored in payment_erp.

Static Public Member Functions

static _getInstance ()
 Static method to get the singleton instance.
- Static Public Member Functions inherited from ilERP
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

 $client
const wsdl = "https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL"
const name = "E-conomic"
- Data Fields inherited from ilERP
const preview_pre = "invoice_"
const preview_ext = ".pdf"

Private Member Functions

 setAgreement ($v)
 Set the e-conomic agreement number private.
 setProduct ($v)
 setTerms ($v)
 setLayout ($v)
 setCode ($v)

Private Attributes

 $agreement
 $product
 $terms
 $layout
 $code

Static Private Attributes

static $instance = null
static $erp_id = ERP_ECONOMIC

Additional Inherited Members

- Protected Member Functions inherited from ilERP
 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 inherited from ilERP
 $username
 $password
 $use_ean
 $save_copy

Detailed Description

Author
Jesper Godvad jespe.nosp@m.r@il.nosp@m.ias.d.nosp@m.k
Nicolai Lundgaard nicol.nosp@m.ai@i.nosp@m.lias..nosp@m.dk
Version
$Id$

Definition at line 35 of file class.ilERP_eco.php.

Constructor & Destructor Documentation

ilERP_eco::__construct ( )

Definition at line 51 of file class.ilERP_eco.php.

References loadSettings().

{
//parent::__construct();
$this->loadSettings(0);
}

+ Here is the call graph for this function:

Member Function Documentation

static ilERP_eco::_getInstance ( )
static

Static method to get the singleton instance.

public

Returns
object $instance Singular E-conomic instance

Definition at line 65 of file class.ilERP_eco.php.

References $instance.

Referenced by ilERPDebtor_eco\__construct().

{
if (isset(self::$instance) and self::$instance)
{
return self::$instance;
}
return self::$instance = new ilERP_eco();
}

+ Here is the caller graph for this function:

ilERP_eco::connect ( )

Reimplemented from ilERP.

Definition at line 96 of file class.ilERP_eco.php.

{
if ($this->connection_ok) return;
try
{
$this->client = new SoapClient(self::wsdl, array("trace" => 1, "exceptions" => 1));
$this->client->Connect(array(
'agreementNumber' => $this->agreement,
'userName' => $this->username,
'password' => $this->password)
);
}
catch (Exception $e)
{
$this->connection_ok = false;
throw new ilERPException(__FILE__ . ":" . __LINE__ . " " . $e->getMessage());
}
$this->connection_ok = true;
}
ilERP_eco::disconnect ( )

Reimplemented from ilERP.

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

{
unset($this->client);
$this->connection_ok = false;
}
ilERP_eco::getName ( )

Reimplemented from ilERP.

Definition at line 121 of file class.ilERP_eco.php.

{
return "E-conomic";
}
ilERP_eco::getSettings (   $erps_id = 0)

Return e-conomic settings as an array.

public

Returns
array

Reimplemented from ilERP.

Definition at line 82 of file class.ilERP_eco.php.

References $agreement, $code, ilERP\$erps_id, $layout, $product, $ret, $terms, and loadSettings().

Referenced by looksValid().

{
$ret = array();
$ret['agreement'] = $this->agreement;
$ret['product'] = $this->product;
$ret['terms'] = $this->terms;
$ret['layout'] = $this->layout;
$ret['code'] = $this->code;
return array_merge($ap, $ret);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilERP_eco::loadSettings (   $erps_id = 0)

Called from constructor to fetch settings from database.

private

Reimplemented from ilERP.

Definition at line 193 of file class.ilERP_eco.php.

References $data, ilERP\$erps_id, $ilDB, $res, $result, DB_FETCHMODE_OBJECT, ERP_ECONOMIC, setAgreement(), setCode(), setLayout(), ilERP\setPassword(), setProduct(), setTerms(), and ilERP\setUsername().

Referenced by __construct(), and getSettings().

{
global $ilDB;
$res = $ilDB->queryf('SELECT * FROM payment_erps WHERE erps_id=%s AND erp_id=%s',
array("integer", "integer"),
if (is_object($result))
{
if ($result->settings != "") $data = unserialize($result->settings);
else
{
// set some defaults
$data['agreement']=0;
$data['username']='erpuser';
$data['password']='pasword1234';
$data['product']=0;
$data['terms']=0;
$data['layout']=0;
$data['code']='EUR';
}
}
$this->setAgreement( $data['agreement'] );
$this->setUsername( $data['username'] );
$this->setPassword( $data['password'] );
$this->setProduct( $data['product']);
$this->setTerms( $data['terms']);
$this->setLayout( $data['layout']);
$this->setCode( $data['code']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilERP_eco::looksValid ( )

Returns true if the e-conomic settings looks valid to the interface Done without testing conection etc.

public

Reimplemented from ilERP.

Definition at line 176 of file class.ilERP_eco.php.

References $ok, and getSettings().

{
//if (!parent::looksValid()) return false;
$s = $this->getSettings();
$ok = true;
return true;
if ($s['agreement'] == 0) $ok = false;
if (($s['product']==0) || ($s['terms']==0) || ($s['layout']==0) ) $ok = false;
return $ok;
}

+ Here is the call graph for this function:

ilERP_eco::setAgreement (   $v)
private

Set the e-conomic agreement number private.

Definition at line 131 of file class.ilERP_eco.php.

Referenced by loadSettings(), and setSettings().

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

+ Here is the caller graph for this function:

ilERP_eco::setCode (   $v)
private

Definition at line 147 of file class.ilERP_eco.php.

Referenced by loadSettings(), and setSettings().

{
$this->code = $v;
}

+ Here is the caller graph for this function:

ilERP_eco::setLayout (   $v)
private

Definition at line 143 of file class.ilERP_eco.php.

Referenced by loadSettings(), and setSettings().

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

+ Here is the caller graph for this function:

ilERP_eco::setProduct (   $v)
private

Definition at line 135 of file class.ilERP_eco.php.

Referenced by loadSettings(), and setSettings().

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

+ Here is the caller graph for this function:

ilERP_eco::setSettings (   $a)

Sets e-conomic settings.

public

Reimplemented from ilERP.

Definition at line 159 of file class.ilERP_eco.php.

References setAgreement(), setCode(), setLayout(), setProduct(), and setTerms().

{
$this->setAgreement( $a['agreement'] );
$this->setProduct( $a['product'] );
$this->setTerms( $a['terms'] );
$this->setLayout( $a['layout'] );
$this->setCode( $a['code'] );
}

+ Here is the call graph for this function:

ilERP_eco::setTerms (   $v)
private

Definition at line 139 of file class.ilERP_eco.php.

Referenced by loadSettings(), and setSettings().

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

+ Here is the caller graph for this function:

Field Documentation

ilERP_eco::$agreement
private

Definition at line 37 of file class.ilERP_eco.php.

Referenced by getSettings().

ilERP_eco::$client

Definition at line 45 of file class.ilERP_eco.php.

ilERP_eco::$code
private

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

Referenced by getSettings().

ilERP_eco::$erp_id = ERP_ECONOMIC
staticprivate

Definition at line 48 of file class.ilERP_eco.php.

ilERP_eco::$instance = null
staticprivate

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

Referenced by _getInstance().

ilERP_eco::$layout
private

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

Referenced by getSettings().

ilERP_eco::$product
private

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

Referenced by getSettings().

ilERP_eco::$terms
private

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

Referenced by getSettings().

const ilERP_eco::name = "E-conomic"

Definition at line 49 of file class.ilERP_eco.php.

const ilERP_eco::wsdl = "https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL"

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


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