commit
08ea9c4351
@ -9,7 +9,7 @@ skeleton_*.php to build its generated code.
|
||||
|
||||
|
||||
modMyModule.class.php:
|
||||
Is a sample of module descriptor you can use if you want to build a new module/plugin for
|
||||
Is a sample of module descriptor that you can use if you want to build a new module/plugin for
|
||||
Dolibarr.
|
||||
|
||||
|
||||
@ -20,11 +20,7 @@ skeleton_page.php:
|
||||
Is a sample you can use as an example if you need to build an HTML page to include in Dolibarr GUI.
|
||||
|
||||
skeleton_class.class.php:
|
||||
Is a sample you can use as an example if you need to build a class file to access a new table
|
||||
required by a Dolibarr development.
|
||||
However it is better to run the script build_class_from_table.php that accept a table name as a
|
||||
parameter and will used table description in database and the skeleton_class.class.php file to
|
||||
generate full code for your class file.
|
||||
After running this script, the class to access your table (insert a record, update, delete and select)
|
||||
is directly finished and can be used by your business code. No more coding for accesser on table
|
||||
is needed with this script as the file is completely generated once.
|
||||
Is a sample you can use as an example if you need to build a class file to access a new table required by a Dolibarr development.
|
||||
However it is better to run the build_class_from_table.php script that accepts a table name as a parameter and will uses the description table within database and the skeleton_class.class.php file to generate full code for your class file.
|
||||
After running this script, the class to access your table (insert a record, update, delete and select) is directly finished and can be used by your module's code.
|
||||
No more coding is needed to get access to table with this script because the file is completely generated once.
|
||||
|
||||
@ -61,7 +61,7 @@ class Skeleton_Class // extends CommonObject
|
||||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @param User $user User that creates
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
@ -102,7 +102,7 @@ class Skeleton_Class // extends CommonObject
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -133,7 +133,7 @@ class Skeleton_Class // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Load object in memory from database
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -178,7 +178,7 @@ class Skeleton_Class // extends CommonObject
|
||||
/**
|
||||
* Update object into database
|
||||
*
|
||||
* @param User $user User that modify
|
||||
* @param User $user User that modifies
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -193,7 +193,7 @@ class Skeleton_Class // extends CommonObject
|
||||
//...
|
||||
|
||||
// Check parameters
|
||||
// Put here code to add control on parameters values
|
||||
// Put here code to add a control on parameters values
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mytable SET";
|
||||
@ -213,7 +213,7 @@ class Skeleton_Class // extends CommonObject
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -246,7 +246,7 @@ class Skeleton_Class // extends CommonObject
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @param User $user User that deletes
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -262,7 +262,7 @@ class Skeleton_Class // extends CommonObject
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
// want this action calls a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
|
||||
@ -48,7 +48,7 @@ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel)
|
||||
if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity']))
|
||||
{
|
||||
$error++;
|
||||
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or filled with numeric id of instance if multicompany module is used).";
|
||||
$errorcode='BAD_PARAMETERS'; $errorlabel="The entity parameter must be empty (or filled with numeric id of instance if multicompany module is used).";
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -57,7 +57,7 @@ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel)
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$errorcode='ERROR_FETCH_USER'; $errorlabel='A technical error occurs during fetch of user';
|
||||
$errorcode='ERROR_FETCH_USER'; $errorlabel='A technical error occurred during fetch of user';
|
||||
}
|
||||
else if ($result == 0)
|
||||
{
|
||||
|
||||
@ -517,7 +517,7 @@ div.login a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
img.login, img.printer, img.entity {
|
||||
img.login, img.printer, img.entity, img.model {
|
||||
padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
|
||||
@ -576,7 +576,7 @@ div.login a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
img.login, img.printer, img.entity {
|
||||
img.login, img.printer, img.entity, img.model {
|
||||
padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
|
||||
@ -590,7 +590,7 @@ div.login a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
img.login, img.printer, img.entity {
|
||||
img.login, img.printer, img.entity, img.model {
|
||||
padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
|
||||
@ -758,7 +758,7 @@ div.login a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
img.login, img.printer, img.entity {
|
||||
img.login, img.printer, img.entity, img.model {
|
||||
padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user