2
0
forked from Wavyzz/dolibarr

documentation des lib grace a phpdocumentor

This commit is contained in:
opensides
2004-06-19 10:09:05 +00:00
parent e0e94faa24
commit 27cd9ba85d
5 changed files with 130 additions and 40 deletions

View File

@@ -27,7 +27,9 @@
* serveur ldap * serveur ldap
* *
* @package ldap.lib * @package ldap.lib
* @version 1.9 * @author Rodolphe Quiedeville
* @author Benoit Mortier
* @version 1.2
* *
*/ */

View File

@@ -22,6 +22,19 @@
* *
*/ */
/**
* classe DoliDb
*
* Classe contenant les fonctions pour gere la database de dolibarr
*
* @package mysql.lib.php
* @author Fabien Seisen
* @author Rodolphe Quiedeville
* @author Laurent Destailleur
* @version 1.2
*
*/
class DoliDb { class DoliDb {
var $db, $results, $ok, $connected, $database_selected; var $db, $results, $ok, $connected, $database_selected;
@@ -55,7 +68,7 @@ class DoliDb {
$name = $conf->db->name; $name = $conf->db->name;
} }
//print "Name DB: $host,$user,$pass,$name<br>"; //print "Name DB: $host,$user,$pass,$name<br>";
// Essai connexion serveur // Essai connexion serveur
$this->db = $this->connect($host, $user, $pass); $this->db = $this->connect($host, $user, $pass);

View File

@@ -20,6 +20,24 @@
* *
*/ */
/**
* librairie contenant les fonctions pour calculer un prix
*
* @package price.lib.php
* @author Rodolphe Quiedeville
* @version 1.2
*
*/
/**
* permet de calculer un prix
*
* @access public
* @param integer $products
* @param integer $remise_percent
* @return integer $result
*/
Function calcul_price($products, $remise_percent) Function calcul_price($products, $remise_percent)
{ {
$total_ht = 0; $total_ht = 0;

View File

@@ -20,6 +20,28 @@
* $Source$ * $Source$
* *
*/ */
/**
* librairie contenant les fonctions pour afficher un thermometre
* monetaire
*
* @package thermometer.php
* @author Timothy Kanters
* @author Rodolphe Quiedeville
* @version 1.2
*
*/
/**
* permet d'afficher un thermometre monetaire
*
* @access public
* @param integer $actualValue
* @param integer $pendingValue
* @param integer $intendValue
* @return string $thermometer $htmlLegenda
*/
function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0) function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0)
/* /*
This function returns the html for the moneymeter. This function returns the html for the moneymeter.

View File

@@ -20,28 +20,55 @@
* *
*/ */
/**
* classe Webcal
*
* Classe permettant d'acceder a la database webcalendar
*
* @package Webcal
* @author Rodolphe Quiedeville
* @version 1.2
*
*/
class Webcal { class Webcal {
var $localdb; var $localdb;
var $heure = -1; var $heure = -1;
var $duree = 0; var $duree = 0;
/**
* permet la connection a la base de donn<6E>e webcal
*
* @access public
*
*/
Function Webcal() Function Webcal()
{ {
global $conf; global $conf;
$this->localdb = new Db($conf->webcal->db->type, $this->localdb = new Db($conf->webcal->db->type,
$conf->webcal->db->host, $conf->webcal->db->host,
$conf->webcal->db->user, $conf->webcal->db->user,
$conf->webcal->db->pass, $conf->webcal->db->pass,
$conf->webcal->db->name); $conf->webcal->db->name);
} }
/**
* ajoute une entree dans le calendrier de l'utilsateur
*
* @access public
* @param string $user
* @param integer $date
* @param string $texte
* @param string $desc
*/
Function add($user, $date, $texte, $desc) Function add($user, $date, $texte, $desc)
{ {
$id = $this->get_next_id(); $id = $this->get_next_id();
$cal_id = $id; $cal_id = $id;
$cal_create_by = $user->webcal_login; $cal_create_by = $user->webcal_login;
$cal_date = strftime('%Y%m%d', $date); $cal_date = strftime('%Y%m%d', $date);
@@ -54,49 +81,57 @@ class Webcal {
$cal_access = "P"; $cal_access = "P";
$cal_name = $texte; $cal_name = $texte;
$cal_description = $desc; $cal_description = $desc;
$sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date, cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)"; $sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date,
cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)";
$sql .= " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time, $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description');";
$sql .= " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time,
if ( $this->localdb->query($sql) ) $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description')";
{
if ( $this->localdb->query($sql) )
$sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)"; {
$sql .= " VALUES ($cal_id, '$cal_create_by', 'A')";
$sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)";
if ( $this->localdb->query($sql) ) $sql .= " VALUES ($cal_id, '$cal_create_by', 'A')";
{
if ( $this->localdb->query($sql) )
} {
else
{ }
$error = $this->localdb->error() . '<br>' .$sql; else
} {
} $error = $this->localdb->error() . '<br>' .$sql;
}
}
else else
{ {
$error = $this->localdb->error() . '<br>' .$sql; $error = $this->localdb->error() . '<br>' .$sql;
} }
$this->localdb->close(); $this->localdb->close();
} }
/**
* obtient l'id suivant
*
* @access public
* @return integer $id
*/
Function get_next_id() Function get_next_id()
{ {
$sql = "SELECT max(cal_id) FROM webcal_entry"; $sql = "SELECT max(cal_id) FROM webcal_entry";
if ($this->localdb->query($sql)) if ($this->localdb->query($sql))
{ {
$id = $this->localdb->result(0, 0) + 1; $id = $this->localdb->result(0, 0) + 1;
return $id; return $id;
} }
else else
{ {
print $this->localdb->error(); print $this->localdb->error();
} }
} }
} }
?> ?>