Fetches the value via POST from a form. Inside () specify the name of the form element e.g.
$name = $this->app->Secure->GetPOST('name');
Used to work with the data from the database. For modules in Xentral only these functions should be used.
Inside the brackets specify the SQL update statement to execute e.g.
$id = $this->app->Secure->GetGET('id'); $this->app->DB->Update("UPDATE address SET name ='Mayer Antonia' WHERE id = "$id"");
Inside the brackets specify the SQL query statement to execute e.g.
$id = 4; $name = $this->app->DB->Select("SELECT name FROM address WHERE id = "$id"");
Used when you want values from several columns of the database. The return is stored in an array with associative indices e.g.
$person data = $this->app->DB->SelectArr("SELECT name, street, loc, plz, country FROM address WHERE id = 5");
Inside the brackets specify the SQL insert statement to execute e.g.
$this->app->DB->Insert("INSERT INTO address (name, street, city, plz, country) VALUES ('Klein Christian', 'Musterstrasse 10', 'Musterort', '12345', 'DE')");
Inside the brackets specify the SQL delete statement to execute e.g.
$this->app->DB->Delete("DELETE FROM address WHERE id = 10");
Used to work with the template.
Adds a new string to the template field area. Attention: Set() overwrites the contents of the previous template field range. The first parameter stands for the template field range (always capitalized!) and the second parameter is the string that should overwrite this template field area. Example:
$this->app->Tpl->Set("FIRSTNAME", "Marie");
Adds a new string to the template field area. First parameter is the field area of the template, the second parameter is the string that should be should be inserted, e.g.
$this->app->Tpl->Add("TABLE", "FirstNameLastName");
These functions can be found in the file class.erpapi.php.
Adds a new menu item to the navigation. The first parameter is the link of the module in which the new menu item should be added. Parameter 2 is the label of the menu item. Example:
$this->app->erp->MenuEntry("index.php?module=modulename&action=list", "Overview");
Checks if the table exists in the database. If it does not exist it will be created. Example: $this->app->erp->CheckTable("address");
Checks if the column exists in the specified table. If not it will be created. Meaning of the parameters CheckColumn(Column name, data type, table name, default value). Example: $this->app->erp->CheckColumn("id", "int(10)", "address", "NOT NULL AUTO_INCREMENT");
Adds a new purchase price to the specified item. Meaning of the parameters AddPurchasePrice(ItemID, FromQuantity, IDSupplier, OrderNo, NameSupplier, PurchasePrice). Example: $this->app->erp->AddPurchasePrice(23, 1, 57, "14456", "Joghurt und Eis GmbH", 1.80);
Adds a new sales price to the specified item. Meaning of the parameters AddSalePrice(ItemID, FromQuantity, AddressID for which group the price applies, SalesPrice). 0 as the third parameter means that this sales price applies to all, i.e. for no particular group. Example: $this->app->erp->AddSalePrice(23, 1, 0, 2.00);
Adds a new article or updates an existing article. Parameter must be an array. If the article is to be updated, this must be passed, otherwise the article will be created. The indices of the array must be named like the columns of the article table. Example: $articledata = array(); $article_data['name_en'] = "Apple"; $article_data['anabregs_text'] = "A red apple"; $article_data['producer'] = "Apple farm";
$this->app->erp->InsertUpdateArticle($articleData);
Adds a new address or updates an existing address. Parameter must be an array. If the address is to be updated, the ID and - depending on the role of the address - the employee-, or customer-, or supplier number must be specified, otherwise the address will be recreated. The indices of the array must be named like the columns of the address table. Example: $addressdata = array(); $addressdata['name'] = "Max Mustermann"; $addressdata['street'] = "Musterstraße 1"; $adressdaten['plz'] = "00000"; $adressdaten['ort'] = "Musterort"; $addressdata['country'] = "DE";
$this->app->erp->InsertUpdateAddress($addressdata);
Adds a role to an already existing address. There are the roles Employee, Customer, and Supplier. The roles can be assigned to specific objects, such as "Project" or "Group". Meaning of the parameters AddRoleToAddress(AddressID, role, optional predicate, optional object, optional parameterID). If the role is generally valid, only the first two parameters can be used, if you want to assign it to specific objects, the last parameter must be filled with the respective project or group ID. In the following example, the role Customer is added to an address for a specific project. Example: $this->app->erp->AddRoleToAddress(145, "Customer", "From", "Project", 2);
Returns the next free article number from the number range. Example: $freearticlenr = $this->app->erp->GetNextArticleNumber();
Returns the next free customer number from the number range. Example: $freecustomernumber = $this->app->erp->GetNextCustomerNumber();
Returns the next free supplier number from the number range. Example: $freevendornr = $this->app->erp->GetNextVendorNumber();
Returns the next free employee number from the number range. Example: $freeemployeenr = $this->app->erp->GetNextEmployeeNumber();
Creates a new quote for the AddressID specified in (). Returns the ID of the created offer. Example: $offerid = $this->app->erp->CreateOffer(22);
Creates a new job for the AddressID specified in (). Returns the ID of the created order. Example: $auftragid = $this->app->erp->CreateAuftrag(34);
Creates a new delivery bill for the addressID specified in (). Returns the ID from the created delivery bill. Example: $deliverynoteid = $this->app->erp->CreateDeliveryNote(12);
Creates a new invoice for the AddressID specified in (). Returns the ID of of the created invoice. Example: $invoiceid = $this->app->erp->CreateInvoice(23);
Returns an array filled with country names and their two-character ISO code. If the parameter is set to true, the key of the array is the country name and the value is the ISO code. If false it is the other way around. Example: $country = $this->app->erp->GetSelectLaenderliste(true);
Returns an array filled with English country names and their two-character ISO code is returned. If the parameter is set to true, the key of the array is the English country name and the value is the ISO code. If false it is the other way around. Example: $laenderEN = $this->app->erp->GetSelectLaenderlisteEN(false);
These functions can be found in the class.yui.php file.
Determines which template is used to display the LiveTable. The first parameter specifies in which template field area the LiveTable is to be displayed. The second parameter specifies which LiveTable is to be used. Example: $this->app->YUI->TableSearch('TAB1','example_module_list', "show","",basename(FILE), CLASS);
Creates a preselection of matching entries while typing. Already existing pre-selections can be found in the ajax.php file in the AjaxFilter() function. Meaning of the parameters AutoComplete(TextfieldID, Filter, Only_Number). Only_Number can be omitted or set to 1. If the parameter is set to 1, only the number is inserted into the text field, instead of number and label. Example: $this->app->YUI->AutoComplete("selectitem", "itemnumber", 1);
Creates a small calendar by clicking in the text field specified in () where you can click on the desired date. You can see the graphical interface under Widgets. Example: $this->app->YUI->DatePicker("date_from");
Creates a window with two sliders when you click in the text field specified in () for time selection. You can see the graphical interface here under Widgets. Example: $this->app->YUI->TimePicker("time_from");
Adds some formatting options to a normal HTML textarea using buttons. As first parameter the Id of the textarea must be entered. The second parameter is the type of formatting options, such as basic, occupy or all. You can see the different graphical interfaces here under Widgets. Example: $this->app->YUI->CkEditor("textarea", "basic");
$this->app->erp->InternalEvent($this->app->User->GetID(), "text", "type",1);
-
Parameter is the UserID, must be present
-
Parameter is the text you want to output
-
Parameter is the type of message (see listing below)
-
Parameters whether the notification should appear with sound or without sound
Many PHP files can be overloaded with individual files. To do this copy the body of an original file e.g. class.invoice.php and name this class.invoice_custom.php. In this file, there must be the class with the appendix Custom. e.g. Class RechnungCustom Extends invoice now the methods in the file can be overloaded individually. The new file class.invoice_custom.php will not be overwritten by the update server. You can get an FTP account for the update server on request. The adjustments will automatically update with transferred. files, which are identical with the open source version which is delivered unencrypted.
-
Modules from www/pages
-
Documents from lib/documents
-
Class.erpapi.php → class.erpapi_custom.php
-
Class.printer.php → class.printer_custom.php
The general source code can be found in the .src.php file Example class.erpapi_custom.php
Information about importing images can be found in this article.