Skip to content

Commit

Permalink
Merge pull request #334 from grandoc/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hregis committed Aug 23, 2012
2 parents 4bdb204 + f6e31ee commit 08ea9c4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 deletions.
14 changes: 5 additions & 9 deletions dev/skeletons/README
Expand Up @@ -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.


Expand All @@ -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.
16 changes: 8 additions & 8 deletions dev/skeletons/skeleton_class.class.php
Expand Up @@ -61,7 +61,7 @@ function __construct($db)
/**
* 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
*/
Expand Down Expand Up @@ -102,7 +102,7 @@ function create($user, $notrigger=0)
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");
Expand Down Expand Up @@ -133,7 +133,7 @@ function create($user, $notrigger=0)


/**
* 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
Expand Down Expand Up @@ -178,7 +178,7 @@ function fetch($id)
/**
* 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
*/
Expand All @@ -193,7 +193,7 @@ function update($user=0, $notrigger=0)
//...

// 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";
Expand All @@ -213,7 +213,7 @@ function update($user=0, $notrigger=0)
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");
Expand Down Expand Up @@ -246,7 +246,7 @@ function update($user=0, $notrigger=0)
/**
* 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
*/
Expand All @@ -262,7 +262,7 @@ function delete($user, $notrigger=0)
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");
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/lib/ws.lib.php
Expand Up @@ -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)
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/theme/auguria/style.css.php
Expand Up @@ -517,7 +517,7 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/theme/bureau2crea/style.css.php
Expand Up @@ -576,7 +576,7 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/theme/cameleo/style.css.php
Expand Up @@ -590,7 +590,7 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/theme/eldy/style.css.php
Expand Up @@ -758,7 +758,7 @@
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;
Expand Down

0 comments on commit 08ea9c4

Please sign in to comment.