forked from Wavyzz/dolibarr
Doxygen
This commit is contained in:
@@ -601,10 +601,12 @@ class ActionComm extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoie nom clicable (avec eventuellement le picto)
|
* Renvoie nom clicable (avec eventuellement le picto)
|
||||||
* Utilise $this->id, $this->code et $this->label
|
* Utilise $this->id, $this->code et $this->label
|
||||||
|
*
|
||||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
* @param maxlength Nombre de caracteres max dans libelle
|
* @param maxlength Nombre de caracteres max dans libelle
|
||||||
* @param classname Force style class on a link
|
* @param classname Force style class on a link
|
||||||
* @param option ''=Link to action,'birthday'=Link to contact
|
* @param option ''=Link to action,'birthday'=Link to contact
|
||||||
|
* @param overwritepicto 1=Overwrite picto
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
|
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
|
||||||
|
|||||||
@@ -27,42 +27,44 @@
|
|||||||
* \class CActionComm
|
* \class CActionComm
|
||||||
* \brief Class to manage different types of events
|
* \brief Class to manage different types of events
|
||||||
*/
|
*/
|
||||||
class CActionComm {
|
class CActionComm
|
||||||
var $db;
|
{
|
||||||
|
var $error;
|
||||||
|
var $db;
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
|
|
||||||
var $code;
|
var $code;
|
||||||
var $type;
|
var $type;
|
||||||
var $libelle;
|
var $libelle;
|
||||||
var $active;
|
var $active;
|
||||||
|
|
||||||
var $error;
|
var $type_actions=array();
|
||||||
|
|
||||||
var $type_actions=array();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur
|
* Constructor
|
||||||
* \param DB Handler d'acces base de donnee
|
*
|
||||||
*/
|
* @param DoliDB $DB Database handler
|
||||||
function CActionComm($DB)
|
*/
|
||||||
|
function CActionComm($DB)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Charge l'objet type d'action depuis la base
|
* Charge l'objet type d'action depuis la base
|
||||||
* \param id id ou code du type d'action a recuperer
|
*
|
||||||
* \return int 1=ok, 0=aucune action, -1=erreur
|
* @param id id ou code du type d'action a recuperer
|
||||||
*/
|
* @return int 1=ok, 0=aucune action, -1=erreur
|
||||||
function fetch($id)
|
*/
|
||||||
|
function fetch($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT id, code, type, libelle, active";
|
$sql = "SELECT id, code, type, libelle, active";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
||||||
if (is_numeric($id)) $sql.= " WHERE id=".$id;
|
if (is_numeric($id)) $sql.= " WHERE id=".$id;
|
||||||
else $sql.= " WHERE code='".$id."'";
|
else $sql.= " WHERE code='".$id."'";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@@ -93,82 +95,84 @@ class CActionComm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of event types
|
* Return list of event types
|
||||||
* @param active 1 or 0 to filter on event state active or not ('' bu default = no filter)
|
*
|
||||||
* @return array Array of all event types if OK, <0 if KO
|
* @param int $active 1 or 0 to filter on event state active or not ('' bu default = no filter)
|
||||||
*/
|
* @param string $idorcode 'id' or 'code'
|
||||||
function liste_array($active='',$idorcode='id')
|
* @return array Array of all event types if OK, <0 if KO
|
||||||
{
|
*/
|
||||||
global $langs,$conf;
|
function liste_array($active='',$idorcode='id')
|
||||||
$langs->load("commercial");
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
$langs->load("commercial");
|
||||||
|
|
||||||
$repid = array();
|
$repid = array();
|
||||||
$repcode = array();
|
$repcode = array();
|
||||||
|
|
||||||
$sql = "SELECT id, code, libelle, module";
|
$sql = "SELECT id, code, libelle, module";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
||||||
if ($active != '')
|
if ($active != '')
|
||||||
{
|
{
|
||||||
$sql.=" WHERE active=".$active;
|
$sql.=" WHERE active=".$active;
|
||||||
}
|
}
|
||||||
$sql.= " ORDER BY module, position";
|
$sql.= " ORDER BY module, position";
|
||||||
|
|
||||||
dol_syslog("CActionComm::liste_array sql=".$sql);
|
dol_syslog("CActionComm::liste_array sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$nump = $this->db->num_rows($resql);
|
$nump = $this->db->num_rows($resql);
|
||||||
if ($nump)
|
if ($nump)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $nump)
|
while ($i < $nump)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$qualified=1;
|
$qualified=1;
|
||||||
if ($obj->module)
|
if ($obj->module)
|
||||||
{
|
{
|
||||||
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
|
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
|
||||||
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
|
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
|
||||||
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
|
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
|
||||||
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||||
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||||
}
|
}
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
$transcode=$langs->trans("Action".$obj->code);
|
$transcode=$langs->trans("Action".$obj->code);
|
||||||
$repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
$repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
||||||
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($idorcode == 'id') $this->liste_array=$repid;
|
if ($idorcode == 'id') $this->liste_array=$repid;
|
||||||
if ($idorcode == 'code') $this->liste_array=$repcode;
|
if ($idorcode == 'code') $this->liste_array=$repcode;
|
||||||
return $this->liste_array;
|
return $this->liste_array;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoie le nom sous forme d'un libelle traduit d'un type d'action
|
* Renvoie le nom sous forme d'un libelle traduit d'un type d'action
|
||||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
*
|
||||||
* \param option Sur quoi pointe le lien
|
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
* \return string Libelle du type d'action
|
* @return string Libelle du type d'action
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0)
|
function getNomUrl($withpicto=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
// Check if translation available
|
// Check if translation available
|
||||||
$transcode=$langs->trans("Action".$this->code);
|
$transcode=$langs->trans("Action".$this->code);
|
||||||
if ($transcode != "Action".$this->code) return $transcode;
|
if ($transcode != "Action".$this->code) return $transcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -820,10 +820,12 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
* @param fromid Id of object to clone
|
*
|
||||||
* @param invertdetail Reverse sign of amounts for lines
|
* @param int $fromid Id of object to clone
|
||||||
* @param socid Id of thirdparty
|
* @param int $invertdetail Reverse sign of amounts for lines
|
||||||
* @return int New id of clone
|
* @param int $socid Id of thirdparty
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($fromid,$invertdetail=0,$socid=0,$hookmanager=false)
|
function createFromClone($fromid,$invertdetail=0,$socid=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -512,9 +512,10 @@ class Facture extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
*
|
*
|
||||||
* @param fromid Id of object to clone
|
* @param int $fromid Id of object to clone
|
||||||
* @param invertdetail Reverse sign of amounts for lines
|
* @param int $invertdetail Reverse sign of amounts for lines
|
||||||
* @return int New id of clone
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($fromid,$invertdetail=0,$hookmanager=false)
|
function createFromClone($fromid,$invertdetail=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -598,10 +599,11 @@ class Facture extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an object from an order and create a new invoice into database
|
* Load an object from an order and create a new invoice into database
|
||||||
*
|
*
|
||||||
* @param object Object source
|
* @param Object $object Object source
|
||||||
* @return int <0 if KO, 0 if nothing done, 1 if OK
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int <0 if KO, 0 if nothing done, 1 if OK
|
||||||
*/
|
*/
|
||||||
function createFromOrder($object, $hookmanager=false)
|
function createFromOrder($object, $hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ abstract class CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if ref is used.
|
* Check if ref is used.
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if not found, >0 if found
|
* @return int <0 if KO, 0 if not found, >0 if found
|
||||||
*/
|
*/
|
||||||
function verifyNumRef()
|
function verifyNumRef()
|
||||||
{
|
{
|
||||||
@@ -68,13 +68,13 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a link between element $this->element and a contact
|
* Add a link between element $this->element and a contact
|
||||||
*
|
*
|
||||||
* @param fk_socpeople Id of contact to link
|
* @param fk_socpeople Id of contact to link
|
||||||
* @param type_contact Type of contact (code or id)
|
* @param type_contact Type of contact (code or id)
|
||||||
* @param source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
* @param source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
||||||
* @param notrigger Disable all triggers
|
* @param notrigger Disable all triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
||||||
{
|
{
|
||||||
@@ -259,10 +259,10 @@ abstract class CommonObject
|
|||||||
/**
|
/**
|
||||||
* Get array of all contacts for an object
|
* Get array of all contacts for an object
|
||||||
*
|
*
|
||||||
* @param statut int Status of lines to get (-1=all)
|
* @param int $statut Status of lines to get (-1=all)
|
||||||
* @param source string Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||||
* @param int list 0:Return array contains all properties, 1:Return array contains just id
|
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
||||||
* @return array Array of contacts
|
* @return array Array of contacts
|
||||||
*/
|
*/
|
||||||
function liste_contact($statut=-1,$source='external',$list=0)
|
function liste_contact($statut=-1,$source='external',$list=0)
|
||||||
{
|
{
|
||||||
@@ -713,8 +713,8 @@ abstract class CommonObject
|
|||||||
/**
|
/**
|
||||||
* Link element with a project
|
* Link element with a project
|
||||||
*
|
*
|
||||||
* @param projid Project id to link element to
|
* @param int $projectid Project id to link element to
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function setProject($projectid)
|
function setProject($projectid)
|
||||||
{
|
{
|
||||||
@@ -1662,9 +1662,11 @@ abstract class CommonObject
|
|||||||
* Show add predefined products/services form
|
* Show add predefined products/services form
|
||||||
* TODO Edit templates to use global variables and include them directly in controller call
|
* TODO Edit templates to use global variables and include them directly in controller call
|
||||||
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
||||||
* @param $dateSelector 1=Show also date range input fields
|
*
|
||||||
* @param $seller Object thirdparty who sell
|
* @param int $dateSelector 1=Show also date range input fields
|
||||||
* @param $buyer Object thirdparty who buy
|
* @param Societe $seller Object thirdparty who sell
|
||||||
|
* @param Societe $buyer Object thirdparty who buy
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false)
|
function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1679,7 +1681,11 @@ abstract class CommonObject
|
|||||||
* Show add free products/services form
|
* Show add free products/services form
|
||||||
* TODO Edit templates to use global variables and include them directly in controller call
|
* TODO Edit templates to use global variables and include them directly in controller call
|
||||||
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
|
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
|
||||||
* @param $dateSelector 1=Show also date range input fields
|
*
|
||||||
|
* @param int $dateSelector 1=Show also date range input fields
|
||||||
|
* @param Societe $seller Object thirdparty who sell
|
||||||
|
* @param Societe $buyer Object thirdparty who buy
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
|
function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class DolCookie
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $key Personnal key
|
* @param string $key Personnal key
|
||||||
*/
|
*/
|
||||||
function DolCookie($key = '')
|
function DolCookie($key = '')
|
||||||
{
|
{
|
||||||
@@ -75,7 +75,7 @@ class DolCookie
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Decrypt the cookie
|
* Decrypt the cookie
|
||||||
*/
|
*/
|
||||||
function decryptCookie()
|
function decryptCookie()
|
||||||
{
|
{
|
||||||
@@ -97,9 +97,14 @@ class DolCookie
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set and create the cookie
|
* Set and create the cookie
|
||||||
* \param cookie Cookie name
|
*
|
||||||
* \param value Cookie value
|
* @param string $cookie Cookie name
|
||||||
|
* @param string $value Cookie value
|
||||||
|
* @param string $expire Expiration
|
||||||
|
* @param string $path Path of cookie
|
||||||
|
* @param string $domaine Domain name
|
||||||
|
* @param int $secure 0 or 1
|
||||||
*/
|
*/
|
||||||
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
|
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
|
||||||
{
|
{
|
||||||
@@ -116,10 +121,10 @@ class DolCookie
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the cookie
|
* Get the cookie
|
||||||
* \param cookie Cookie name
|
*
|
||||||
* \param value Cookie value
|
* @param string $cookie Cookie name
|
||||||
* \return decryptValue Decrypted value
|
* @return string Decrypted value
|
||||||
*/
|
*/
|
||||||
function _getCookie($cookie)
|
function _getCookie($cookie)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1431,10 +1431,11 @@ class CommandeFournisseur extends Commande
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update notes
|
* Update notes
|
||||||
* @param user
|
*
|
||||||
* @param note
|
* @param User $user Object user
|
||||||
* @param note_public
|
* @param string $note Private note
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @param string $note_public Public note
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
* TODO Use instead update_note_public and update_note
|
* TODO Use instead update_note_public and update_note
|
||||||
*/
|
*/
|
||||||
function UpdateNote($user, $note, $note_public)
|
function UpdateNote($user, $note, $note_public)
|
||||||
@@ -1548,14 +1549,15 @@ class CommandeFournisseur extends Commande
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update line
|
* Update line
|
||||||
|
*
|
||||||
* @param rowid Id de la ligne de facture
|
* @param rowid Id de la ligne de facture
|
||||||
* @param desc Description de la ligne
|
* @param desc Description de la ligne
|
||||||
* @param pu Prix unitaire
|
* @param pu Prix unitaire
|
||||||
* @param qty Quantity
|
* @param qty Quantity
|
||||||
* @param remise_percent Pourcentage de remise de la ligne
|
* @param remise_percent Pourcentage de remise de la ligne
|
||||||
* @param tva_tx Taux TVA
|
* @param tva_tx Taux TVA
|
||||||
* @param localtax1_tx Localtax1 tax
|
* @param localtax1 Localtax1 tax
|
||||||
* @param localtax2_tx Localtax2 tax
|
* @param localtax2 Localtax2 tax
|
||||||
* @param price_base_type Type of price base
|
* @param price_base_type Type of price base
|
||||||
* @param info_bits Miscellanous informations
|
* @param info_bits Miscellanous informations
|
||||||
* @param type Type of line (0=product, 1=service)
|
* @param type Type of line (0=product, 1=service)
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ class box_external_rss extends ModeleBoxes {
|
|||||||
/**
|
/**
|
||||||
* Load information for box into memory to show them later with this->showBox method.
|
* Load information for box into memory to show them later with this->showBox method.
|
||||||
*
|
*
|
||||||
* @param $max Max numbe rof records to load
|
* @param int $max Max numbe rof records to load
|
||||||
* @param $cachedelay Delay we accept for cache file
|
* @param int $cachedelay Delay we accept for cache file
|
||||||
*/
|
*/
|
||||||
function loadBox($max=5, $cachdelay=3600)
|
function loadBox($max=5, $cachedelay=3600)
|
||||||
{
|
{
|
||||||
global $user, $langs, $conf;
|
global $user, $langs, $conf;
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
@@ -80,7 +80,7 @@ class box_external_rss extends ModeleBoxes {
|
|||||||
$url=@constant("EXTERNAL_RSS_URLRSS_".$site);
|
$url=@constant("EXTERNAL_RSS_URLRSS_".$site);
|
||||||
|
|
||||||
$rssparser=new RssParser($db);
|
$rssparser=new RssParser($db);
|
||||||
$result = $rssparser->parser($url, $this->max, $cachdelay, $conf->externalrss->dir_temp);
|
$result = $rssparser->parser($url, $this->max, $cachedelay, $conf->externalrss->dir_temp);
|
||||||
|
|
||||||
// INFO on channel
|
// INFO on channel
|
||||||
$description=$rssparser->getDescription();
|
$description=$rssparser->getDescription();
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
* @param $db Database handler
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function liste_modeles($db)
|
function liste_modeles($db)
|
||||||
{
|
{
|
||||||
@@ -70,6 +71,7 @@ class ModeleNumRefCommandes
|
|||||||
var $error='';
|
var $error='';
|
||||||
|
|
||||||
/** Return if a module can be used or not
|
/** Return if a module can be used or not
|
||||||
|
*
|
||||||
* @return boolean true if module can be used
|
* @return boolean true if module can be used
|
||||||
*/
|
*/
|
||||||
function isEnabled()
|
function isEnabled()
|
||||||
@@ -78,6 +80,7 @@ class ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie la description par defaut du modele de numerotation
|
/** Renvoie la description par defaut du modele de numerotation
|
||||||
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
function info()
|
||||||
@@ -88,6 +91,7 @@ class ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie un exemple de numerotation
|
/** Renvoie un exemple de numerotation
|
||||||
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
function getExample()
|
||||||
@@ -98,6 +102,7 @@ class ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
|
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
|
||||||
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
function canBeActivated()
|
||||||
@@ -106,6 +111,7 @@ class ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie prochaine valeur attribuee
|
/** Renvoie prochaine valeur attribuee
|
||||||
|
*
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getNextValue()
|
function getNextValue()
|
||||||
@@ -115,6 +121,7 @@ class ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie version du module numerotation
|
/** Renvoie version du module numerotation
|
||||||
|
*
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getVersion()
|
function getVersion()
|
||||||
@@ -131,15 +138,17 @@ class ModeleNumRefCommandes
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cree un bon de commande sur disque en fonction d'un modele
|
* Create a document onto disk accordign to template module.
|
||||||
* @param db data base object
|
*
|
||||||
* @param object object order
|
* @param DoliDB $db Database handler
|
||||||
* @param modele force le modele a utiliser ('' to not force)
|
* @param Object $object Object order
|
||||||
* @param outputlangs objet lang a utiliser pour traduction
|
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||||
* @param hidedetails Hide details of lines
|
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||||
* @param hidedesc Hide description
|
* @param int $hidedetails Hide details of lines
|
||||||
* @param hideref Hide ref
|
* @param int $hidedesc Hide description
|
||||||
* @return int 0 if KO, 1 if OK
|
* @param int $hideref Hide ref
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int 0 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -130,16 +130,18 @@ class ModeleNumRefFactures
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cree une facture sur le disque en fonction du modele de FACTURE_ADDON_PDF
|
* Create a document onto disk accordign to template module.
|
||||||
* @param db objet base de donnees
|
*
|
||||||
* @param object Object invoice
|
* @param DoliDB $db Database handler
|
||||||
* @param message message
|
* @param Object $object Object invoice
|
||||||
* @param modele force le modele a utiliser ('' to not force)
|
* @param string $message message
|
||||||
* @param outputlangs objet lang a utiliser pour traduction
|
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||||
* @param hidedetails Hide details of lines
|
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||||
* @param hidedesc Hide description
|
* @param int $hidedetails Hide details of lines
|
||||||
* @param hideref Hide ref
|
* @param int $hidedesc Hide description
|
||||||
* @return int <0 if KO, >0 if OK
|
* @param int $hideref Hide ref
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ class ModelePDFLabels
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return list of active generation modules
|
* Return list of active generation modules
|
||||||
* \param $db Database handler
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function liste_modeles($db)
|
function liste_modeles($db)
|
||||||
{
|
{
|
||||||
@@ -58,13 +59,14 @@ class ModelePDFLabels
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF
|
* Create a document onto disk accordign to template module
|
||||||
* \param db objet base de donnee
|
*
|
||||||
* \param id id de la facture a creer
|
* @param DoliDB $db objet base de donnee
|
||||||
* \param message message
|
* @param int $id id de la facture a creer
|
||||||
* \param modele force le modele a utiliser ('' to not force)
|
* @param string $message message
|
||||||
* \param outputlangs objet lang a utiliser pour traduction
|
* @param string $modele force le modele a utiliser ('' to not force)
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param string $outputlangs objet lang a utiliser pour traduction
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs)
|
function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -128,15 +128,17 @@ class ModeleNumRefPropales
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cree une propale sur disque en fonction du modele de PROPALE_ADDON_PDF
|
* Create a document onto disk accordign to template module.
|
||||||
* @param db Database handler
|
*
|
||||||
* @param object Object proposal
|
* @param DoliDB $db Database handler
|
||||||
* @param modele Force model to use ('' to not force)
|
* @param Object $object Object proposal
|
||||||
* @param outputlangs Object langs to use for output
|
* @param string $modele Force model to use ('' to not force)
|
||||||
* @param hidedetails Hide details of lines
|
* @param Translate $outputlangs Object langs to use for output
|
||||||
* @param hidedesc Hide description
|
* @param int $hidedetails Hide details of lines
|
||||||
* @param hideref Hide ref
|
* @param int $hidedesc Hide description
|
||||||
* @return int 0 if KO, 1 if OK
|
* @param int $hideref Hide ref
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int 0 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return list of active generation modules
|
* Return list of active generation modules
|
||||||
* \param $db Database handler
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function liste_modeles($db)
|
function liste_modeles($db)
|
||||||
{
|
{
|
||||||
@@ -53,12 +54,14 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create object on disk
|
* Create object on disk.
|
||||||
* @param db objet base de donnee
|
*
|
||||||
* @param object object supplier invoice
|
* @param DoliDB $db objet base de donnee
|
||||||
* @param model force le modele a utiliser ('' to not force)
|
* @param Object $object object supplier invoice
|
||||||
* @param outputlangs objet lang a utiliser pour traduction
|
* @param string $model force le modele a utiliser ('' to not force)
|
||||||
* @return int 0 si KO, 1 si OK
|
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int 0 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)
|
function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
var $error='';
|
var $error='';
|
||||||
|
|
||||||
/** Return if a module can be used or not
|
/** Return if a module can be used or not
|
||||||
|
*
|
||||||
* @return boolean true if module can be used
|
* @return boolean true if module can be used
|
||||||
*/
|
*/
|
||||||
function isEnabled()
|
function isEnabled()
|
||||||
@@ -78,6 +79,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie la description par defaut du modele de numerotation
|
/** Renvoie la description par defaut du modele de numerotation
|
||||||
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
function info()
|
||||||
@@ -88,6 +90,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie un exemple de numerotation
|
/** Renvoie un exemple de numerotation
|
||||||
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
function getExample()
|
||||||
@@ -98,6 +101,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
|
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
|
||||||
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
function canBeActivated()
|
||||||
@@ -106,6 +110,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie prochaine valeur attribuee
|
/** Renvoie prochaine valeur attribuee
|
||||||
|
*
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getNextValue()
|
function getNextValue()
|
||||||
@@ -115,6 +120,7 @@ class ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Renvoie version du module numerotation
|
/** Renvoie version du module numerotation
|
||||||
|
*
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getVersion()
|
function getVersion()
|
||||||
@@ -131,15 +137,17 @@ class ModeleNumRefSuppliersOrders
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cree un bon de commande sur disque en fonction d'un modele
|
* Create a document onto disk accordign to template module.
|
||||||
* @param db data base object
|
*
|
||||||
* @param object object order
|
* @param DoliDB $db data base object
|
||||||
* @param modele force le modele a utiliser ('' to not force)
|
* @param Object $object object order
|
||||||
* @param outputlangs objet lang a utiliser pour traduction
|
* @param string $modele force le modele a utiliser ('' to not force)
|
||||||
* @param hidedetails Hide details of lines
|
* @param Translate $outputlangs Objet lang a utiliser pour traduction
|
||||||
* @param hidedesc Hide description
|
* @param int $hidedetails Hide details of lines
|
||||||
* @param hideref Hide ref
|
* @param int $hidedesc Hide description
|
||||||
* @return int 0 if KO, 1 if OK
|
* @param int $hideref Hide ref
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
|
* @return int 0 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
function supplier_order_pdf_create($db, $object, $model, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
function supplier_order_pdf_create($db, $object, $model, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -673,7 +673,8 @@ pFooter($error,$setuplang,'jsinfo');
|
|||||||
/**
|
/**
|
||||||
* Create main file. No particular permissions are set by installer.
|
* Create main file. No particular permissions are set by installer.
|
||||||
*
|
*
|
||||||
* @param mainfile Path to conf file to generate/update
|
* @param string $mainfile Full path name of main file to generate/update
|
||||||
|
* @param string $main_dir Full path name to main.inc.php file
|
||||||
*/
|
*/
|
||||||
function write_main_file($mainfile,$main_dir)
|
function write_main_file($mainfile,$main_dir)
|
||||||
{
|
{
|
||||||
@@ -693,7 +694,8 @@ function write_main_file($mainfile,$main_dir)
|
|||||||
/**
|
/**
|
||||||
* Create master file. No particular permissions are set by installer.
|
* Create master file. No particular permissions are set by installer.
|
||||||
*
|
*
|
||||||
* @param masterfile Path to conf file to generate/update
|
* @param string $masterfile Full path name of master file to generate/update
|
||||||
|
* @param string $main_dir Full path name to master.inc.php file
|
||||||
*/
|
*/
|
||||||
function write_master_file($masterfile,$main_dir)
|
function write_master_file($masterfile,$main_dir)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class AntiVir
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @return AntiVir
|
* @return AntiVir
|
||||||
*/
|
*/
|
||||||
function AntiVir($db)
|
function AntiVir($db)
|
||||||
@@ -50,6 +50,7 @@ class AntiVir
|
|||||||
/**
|
/**
|
||||||
* Scan a file with antivirus.
|
* Scan a file with antivirus.
|
||||||
* This function runs the command defined in setup. This antivirus command must return 0 if OK.
|
* This function runs the command defined in setup. This antivirus command must return 0 if OK.
|
||||||
|
*
|
||||||
* @param file File to scan
|
* @param file File to scan
|
||||||
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
|
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -800,15 +800,16 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Cree une table
|
* Create a table into database
|
||||||
\param table Nom de la table
|
*
|
||||||
\param fields Tableau associatif [nom champ][tableau des descriptions]
|
* @param string $table Nom de la table
|
||||||
\param primary_key Nom du champ qui sera la clef primaire
|
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||||
\param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||||
\param fulltext Tableau des Nom de champs qui seront indexes en fulltext
|
* @param string $type Type de la table
|
||||||
\param key Tableau des champs cles noms => valeur
|
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||||
\param type Type de la table
|
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
|
||||||
\return int <0 si KO, >=0 si OK
|
* @param string $keys Tableau des champs cles noms => valeur
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -842,15 +842,16 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cree une table
|
* Create a table into database
|
||||||
* \param table Nom de la table
|
*
|
||||||
* \param fields Tableau associatif [nom champ][tableau des descriptions]
|
* @param string $table Nom de la table
|
||||||
* \param primary_key Nom du champ qui sera la clef primaire
|
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||||
* \param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||||
* \param fulltext Tableau des Nom de champs qui seront indexes en fulltext
|
* @param string $type Type de la table
|
||||||
* \param key Tableau des champs cles noms => valeur
|
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||||
* \param type Type de la table
|
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
|
||||||
* \return int <0 si KO, >=0 si OK
|
* @param string $keys Tableau des champs cles noms => valeur
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -687,9 +687,10 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Recupere l'id genere par le dernier INSERT.
|
* Recupere l'id genere par le dernier INSERT.
|
||||||
* \param tab Nom de la table concernee par l'insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
|
*
|
||||||
* \return int id
|
* @param tab Nom de la table concernee par l'insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
|
||||||
|
* @return int id
|
||||||
*/
|
*/
|
||||||
function last_insert_id($tab)
|
function last_insert_id($tab)
|
||||||
{
|
{
|
||||||
@@ -699,6 +700,7 @@ class DoliDb
|
|||||||
/**
|
/**
|
||||||
* Encrypt sensitive data in database
|
* Encrypt sensitive data in database
|
||||||
* Warning: This function includes the escape, so it must use direct value
|
* Warning: This function includes the escape, so it must use direct value
|
||||||
|
*
|
||||||
* @param fieldorvalue Field name or value to encrypt
|
* @param fieldorvalue Field name or value to encrypt
|
||||||
* @param withQuotes Return string with quotes
|
* @param withQuotes Return string with quotes
|
||||||
* @return return XXX(field) or XXX('value') or field or 'value'
|
* @return return XXX(field) or XXX('value') or field or 'value'
|
||||||
@@ -852,15 +854,16 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cree une table
|
* Create a table into database
|
||||||
* \param table Nom de la table
|
*
|
||||||
* \param fields Tableau associatif [nom champ][tableau des descriptions]
|
* @param string $table Nom de la table
|
||||||
* \param primary_key Nom du champ qui sera la clef primaire
|
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||||
* \param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||||
* \param fulltext Tableau des Nom de champs qui seront indexes en fulltext
|
* @param string $type Type de la table
|
||||||
* \param key Tableau des champs cles noms => valeur
|
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||||
* \param type Type de la table
|
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
|
||||||
* \return int <0 si KO, >=0 si OK
|
* @param string $keys Tableau des champs cles noms => valeur
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -989,17 +989,16 @@ class DoliDb
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cree une table
|
* Create a table into database
|
||||||
*
|
*
|
||||||
* @param table Nom de la table
|
* @param string $table Nom de la table
|
||||||
* @param fields Tableau associatif [nom champ][tableau des descriptions]
|
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||||
* @param primary_key Nom du champ qui sera la clef primaire
|
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||||
* @param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
* @param string $type Type de la table
|
||||||
* @param fulltext Tableau des Nom de champs qui seront indexes en fulltext
|
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||||
* @param key Tableau des champs cles noms => valeur
|
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
|
||||||
* @param type Type de la table
|
* @param string $keys Tableau des champs cles noms => valeur
|
||||||
* @return int <0 si KO, >=0 si OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
* TODO
|
|
||||||
*/
|
*/
|
||||||
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
|
||||||
{
|
{
|
||||||
@@ -1060,7 +1059,7 @@ class DoliDb
|
|||||||
$sql .=") type=".$type;
|
$sql .=") type=".$type;
|
||||||
|
|
||||||
dol_syslog($sql,LOG_DEBUG);
|
dol_syslog($sql,LOG_DEBUG);
|
||||||
if(! $this -> query($sql))
|
if(! $this->query($sql))
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -48,19 +48,19 @@ class DolEditor
|
|||||||
/**
|
/**
|
||||||
* Create an object to build an HTML area to edit a large string content
|
* Create an object to build an HTML area to edit a large string content
|
||||||
*
|
*
|
||||||
* @param htmlname HTML name of WYSIWIG form
|
* @param string $htmlname HTML name of WYSIWIG form
|
||||||
* @param content Content of WYSIWIG form
|
* @param string $content Content of WYSIWIG form
|
||||||
* @param width Width in pixel of edit area (auto by default)
|
* @param int $width Width in pixel of edit area (auto by default)
|
||||||
* @param height Height in pixel of edit area (200px by default)
|
* @param int $height Height in pixel of edit area (200px by default)
|
||||||
* @param toolbarname Name of bar set to use ('Full', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_mailings')
|
* @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_mailings')
|
||||||
* @param toolbarlocation Where bar is stored :
|
* @param string $toolbarlocation Where bar is stored :
|
||||||
* 'In' each window has its own toolbar
|
* 'In' each window has its own toolbar
|
||||||
* 'Out:name' share toolbar into the div called 'name'
|
* 'Out:name' share toolbar into the div called 'name'
|
||||||
* @param toolbarstartexpanded Bar is visible or not at start
|
* @param boolean $toolbarstartexpanded Bar is visible or not at start
|
||||||
* @param uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.
|
* @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.
|
||||||
* @param okforextandededitor True=Allow usage of extended editor tool (like fckeditor)
|
* @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor)
|
||||||
* @param rows Size of rows for textarea tool
|
* @param int $rows Size of rows for textarea tool
|
||||||
* @param cols Size of cols for textarea tool
|
* @param int $cols Size of cols for textarea tool
|
||||||
*/
|
*/
|
||||||
function DolEditor($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0)
|
function DolEditor($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1586,13 +1586,13 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8')
|
|||||||
/**
|
/**
|
||||||
* Show a picto called object_picto (generic function)
|
* Show a picto called object_picto (generic function)
|
||||||
*
|
*
|
||||||
* @param alt Text of alt on image
|
* @param string $alt Text of alt on image
|
||||||
* @param picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
|
* @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
|
||||||
* For external modules use imagename@mymodule to search into directory "img" of module.
|
* For external modules use imagename@mymodule to search into directory "img" of module.
|
||||||
* @param options Add more attribute on img tag
|
* @param string $options Add more attribute on img tag
|
||||||
* @param pictoisfullpath If 1, image path is a full path
|
* @param int $pictoisfullpath If 1, image path is a full path
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
* @see img_picto, img_picto_common
|
* @see #img_picto, #img_picto_common
|
||||||
*/
|
*/
|
||||||
function img_object($alt, $picto, $options='', $pictoisfullpath=0)
|
function img_object($alt, $picto, $options='', $pictoisfullpath=0)
|
||||||
{
|
{
|
||||||
@@ -1624,16 +1624,16 @@ function img_object($alt, $picto, $options='', $pictoisfullpath=0)
|
|||||||
/**
|
/**
|
||||||
* Show picto whatever it's its name (generic function)
|
* Show picto whatever it's its name (generic function)
|
||||||
*
|
*
|
||||||
* @param alt Text on alt and title of image
|
* @param string $alt Text on alt and title of image
|
||||||
* @param picto Name of image file to show ('filenew', ...)
|
* @param string $picto Name of image file to show ('filenew', ...)
|
||||||
* If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory.
|
* If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory.
|
||||||
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
|
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
|
||||||
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
|
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
|
||||||
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
||||||
* @param options Add more attribute on img tag (For example 'style="float: right"')
|
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||||
* @param pictoisfullpath If 1, image path is a full path
|
* @param int $pictoisfullpath If 1, image path is a full path
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
* @see img_object, img_picto_common
|
* @see #img_object, #img_picto_common
|
||||||
*/
|
*/
|
||||||
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
||||||
{
|
{
|
||||||
@@ -1665,12 +1665,12 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
|||||||
/**
|
/**
|
||||||
* Show picto (generic function)
|
* Show picto (generic function)
|
||||||
*
|
*
|
||||||
* @param alt Text on alt and title of image
|
* @param string $alt Text on alt and title of image
|
||||||
* @param picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
||||||
* @param options Add more attribute on img tag
|
* @param string $options Add more attribute on img tag
|
||||||
* @param pictoisfullpath If 1, image path is a full path
|
* @param int $pictoisfullpath If 1, image path is a full path
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
* @see img_object, img_picto
|
* @see #img_object, #img_picto
|
||||||
*/
|
*/
|
||||||
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
|
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -724,6 +724,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line description translated in outputlangs and encoded in UTF8
|
* Return line description translated in outputlangs and encoded in UTF8
|
||||||
|
*
|
||||||
* @param object Object
|
* @param object Object
|
||||||
* @param i Current line number
|
* @param i Current line number
|
||||||
* @param outputlangs Object langs for output
|
* @param outputlangs Object langs for output
|
||||||
@@ -856,9 +857,12 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line num
|
* Return line num
|
||||||
* @param object Object
|
*
|
||||||
* @param $i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
|
* @param Translate $outputlangs Object langs for output
|
||||||
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -877,9 +881,12 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line product ref
|
* Return line product ref
|
||||||
* @param object Object
|
*
|
||||||
* @param $i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlang Object lang for output
|
* @param int $i Current line number
|
||||||
|
* @param Translate $outputlangs Object langs for output
|
||||||
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -897,9 +904,12 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line ref_supplier
|
* Return line ref_supplier
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
|
* @param Translate $outputlangs Object langs for output
|
||||||
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -917,13 +927,12 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0,$hookman
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line vat rate
|
* Return line vat rate
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -942,13 +951,12 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line unit price excluding tax
|
* Return line unit price excluding tax
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -967,13 +975,12 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line quantity
|
* Return line quantity
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -995,13 +1002,12 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line quantity asked
|
* Return line quantity asked
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1023,13 +1029,12 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanage
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line quantity shipped
|
* Return line quantity shipped
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1051,13 +1056,12 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmana
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line keep to ship quantity
|
* Return line keep to ship quantity
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1079,13 +1083,12 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookm
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line remise percent
|
* Return line remise percent
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1109,13 +1112,12 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookma
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return line total excluding tax
|
* Return line total excluding tax
|
||||||
* @param object Object
|
*
|
||||||
* @param i Current line number
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param int $i Current line number
|
||||||
* @param hidedetails Hide value
|
* @param Translate $outputlangs Object langs for output
|
||||||
* 0 = no
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* 1 = yes
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
* 2 = just special lines
|
|
||||||
*/
|
*/
|
||||||
function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1141,9 +1143,11 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookman
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return total quantity of products and/or services
|
* Return total quantity of products and/or services
|
||||||
* @param object Object
|
*
|
||||||
* @param type Type of line (all=all, 0=product, 1=service, 9=other)
|
* @param Object $object Object
|
||||||
* @param outputlangs Object langs for output
|
* @param string $type Type
|
||||||
|
* @param Translate $outputlangs Object langs for output
|
||||||
|
* @param HookManager $hookmanager Hook manager instance
|
||||||
*/
|
*/
|
||||||
function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
|
function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
|
||||||
{
|
{
|
||||||
@@ -1182,8 +1186,9 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a currency code into its symbol
|
* Convert a currency code into its symbol
|
||||||
|
*
|
||||||
* @param pdf PDF object
|
* @param pdf PDF object
|
||||||
* @param currency_code
|
* @param currency_code Currency code
|
||||||
* @param string Currency symbol encoded into UTF8
|
* @param string Currency symbol encoded into UTF8
|
||||||
*/
|
*/
|
||||||
function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
function pdf_getCurrencySymbol(&$pdf, $currency_code)
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ function delivery_prepare_head($object)
|
|||||||
/**
|
/**
|
||||||
* List sendings and receive receipts
|
* List sendings and receive receipts
|
||||||
*
|
*
|
||||||
* @param $option
|
* @param string $origin Origin
|
||||||
|
* @param int $origin_id Origin id
|
||||||
|
* @param string $filter Filter
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ function CalEncode($line)
|
|||||||
* Encode into vcal format
|
* Encode into vcal format
|
||||||
*
|
*
|
||||||
* @param string $str String to convert
|
* @param string $str String to convert
|
||||||
* @param int forcal 1=For cal
|
* @param int $forcal 1=For cal
|
||||||
* @return string String converted
|
* @return string String converted
|
||||||
*/
|
*/
|
||||||
function QPEncode($str,$forcal=0)
|
function QPEncode($str,$forcal=0)
|
||||||
|
|||||||
@@ -62,8 +62,13 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST)
|
/**
|
||||||
function test_sql_and_script_inject($val,$get)
|
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST)
|
||||||
|
*
|
||||||
|
* @param string $val Value
|
||||||
|
* @param string $get 1=GET, 0=POST
|
||||||
|
*/
|
||||||
|
function test_sql_and_script_inject($val, $get)
|
||||||
{
|
{
|
||||||
$sql_inj = 0;
|
$sql_inj = 0;
|
||||||
// For SQL Injection
|
// For SQL Injection
|
||||||
@@ -80,8 +85,13 @@ function test_sql_and_script_inject($val,$get)
|
|||||||
if ($get) $sql_inj += preg_match('/"/i', $val); // We refused " in GET parameters value
|
if ($get) $sql_inj += preg_match('/"/i', $val); // We refused " in GET parameters value
|
||||||
return $sql_inj;
|
return $sql_inj;
|
||||||
}
|
}
|
||||||
// Security: Return true if OK, false otherwise
|
/**
|
||||||
function analyse_sql_and_script(&$var,$get)
|
* Security: Return true if OK, false otherwise
|
||||||
|
*
|
||||||
|
* @param string $var Variable name
|
||||||
|
* @param string $get 1=GET, 0=POST
|
||||||
|
*/
|
||||||
|
function analyse_sql_and_script(&$var, $get)
|
||||||
{
|
{
|
||||||
if (is_array($var))
|
if (is_array($var))
|
||||||
{
|
{
|
||||||
@@ -638,10 +648,10 @@ if (! defined('NOLOGIN'))
|
|||||||
$conf->theme=$user->conf->MAIN_THEME;
|
$conf->theme=$user->conf->MAIN_THEME;
|
||||||
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If theme support optim like flip-hide left menu and we use a smartphone, we force it
|
// If theme support optim like flip-hide left menu and we use a smartphone, we force it
|
||||||
if (! empty($conf->global->MAIN_SMARTPHONE_OPTIM) && $conf->browser->phone && $conf->theme == 'eldy') $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced';
|
if (! empty($conf->global->MAIN_SMARTPHONE_OPTIM) && $conf->browser->phone && $conf->theme == 'eldy') $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced';
|
||||||
|
|
||||||
// Set javascript option
|
// Set javascript option
|
||||||
if (! GETPOST('nojs')) // If javascript was not disabled on URL
|
if (! GETPOST('nojs')) // If javascript was not disabled on URL
|
||||||
{
|
{
|
||||||
@@ -815,7 +825,6 @@ function top_httphead()
|
|||||||
*
|
*
|
||||||
* @param string $head Optionnal head lines
|
* @param string $head Optionnal head lines
|
||||||
* @param string $title HTML title
|
* @param string $title HTML title
|
||||||
* @param string $help_url Link to online url help to show on left menu
|
|
||||||
* @param int $disablejs More content into html header
|
* @param int $disablejs More content into html header
|
||||||
* @param int $disablehead More content into html header
|
* @param int $disablehead More content into html header
|
||||||
* @param array $arrayofjs Array of complementary js files
|
* @param array $arrayofjs Array of complementary js files
|
||||||
@@ -1057,14 +1066,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
/**
|
/**
|
||||||
* Show an HTML header + a BODY + The top menu bar
|
* Show an HTML header + a BODY + The top menu bar
|
||||||
*
|
*
|
||||||
* @param string head Lines in the HEAD
|
* @param string $head Lines in the HEAD
|
||||||
* @param string title Title of web page
|
* @param string $title Title of web page
|
||||||
* @param string target Target to use in menu links
|
* @param string $target Target to use in menu links
|
||||||
* @param int disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
|
* @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
|
||||||
* @param int disablehead Do not output head section
|
* @param int $disablehead Do not output head section
|
||||||
* @param array arrayofjs Array of js files to add in header
|
* @param array $arrayofjs Array of js files to add in header
|
||||||
* @param array arrayofcss Array of css files to add in header
|
* @param array $arrayofcss Array of css files to add in header
|
||||||
* @param string morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||||
*/
|
*/
|
||||||
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ class ActionsCardProduct extends Product
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Handler acces base de donnees
|
* @param DoliDB $DB Handler acces base de donnees
|
||||||
* @param string $targmetmodule Name of directory of module where canvas is stored
|
* @param string $targetmodule Name of directory of module where canvas is stored
|
||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ class ActionsCardService extends Product
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Handler acces base de donnees
|
* @param DoliDB $DB Handler acces base de donnees
|
||||||
* @param string $targmetmodule Name of directory of module where canvas is stored
|
* @param string $targetmodule Name of directory of module where canvas is stored
|
||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ abstract class ActionsCardCommon
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Handler acces base de donnees
|
* @param DoliDB $DB Database handler
|
||||||
* @param string $targmetmodule Name of directory of module where canvas is stored
|
* @param string $targetmodule Name of directory of module where canvas is stored
|
||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function ActionsCardCommon($DB,$targetmodule,$canvas,$card)
|
function ActionsCardCommon($DB,$targetmodule,$canvas,$card)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ class ActionsCardDefault extends ActionsCardCommon
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Handler acces base de donnees
|
* @param DoliDB $DB Handler acces base de donnees
|
||||||
* @param string $targmetmodule Name of directory of module where canvas is stored
|
* @param string $targetmodule Name of directory of module where canvas is stored
|
||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function ActionsCardDefault($DB,$targetmodule,$canvas,$card)
|
function ActionsCardDefault($DB,$targetmodule,$canvas,$card)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ class ActionsCardIndividual extends ActionsCardCommon
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Handler acces base de donnees
|
* @param DoliDB $DB Handler acces base de donnees
|
||||||
* @param string $targmetmodule Name of directory of module where canvas is stored
|
* @param string $targetmodule Name of directory of module where canvas is stored
|
||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,11 +64,12 @@ class Address
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cree l'adresse de la societe en base
|
* Create address into database
|
||||||
* \param user Objet utilisateur qui demande la creation
|
*
|
||||||
* \return int 0 si ok, < 0 si erreur
|
* @param socid Company socid
|
||||||
|
* @param user Object user making creation
|
||||||
|
* @return int 0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function create($socid, $user='')
|
function create($socid, $user='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
@@ -135,8 +136,9 @@ class Address
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Verification lors de la modification de l'adresse
|
* Verification lors de la modification de l'adresse
|
||||||
* \return 0 si ok, < 0 en cas d'erreur
|
*
|
||||||
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function verify()
|
function verify()
|
||||||
{
|
{
|
||||||
@@ -153,10 +155,12 @@ class Address
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Mise a jour des parametres de l'adresse
|
* Mise a jour des parametres de l'adresse
|
||||||
* \param id id address
|
*
|
||||||
* \param user Utilisateur qui demande la mise a jour
|
* @param id id address
|
||||||
* \return int <0 si ko, >=0 si ok
|
* @param socid id third party
|
||||||
|
* @param user Utilisateur qui demande la mise a jour
|
||||||
|
* @return int <0 si ko, >=0 si ok
|
||||||
*/
|
*/
|
||||||
function update($id, $socid, $user='')
|
function update($id, $socid, $user='')
|
||||||
{
|
{
|
||||||
@@ -401,8 +405,10 @@ class Address
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Suppression d'une adresse
|
* Suppression d'une adresse
|
||||||
* \param id id de la societe a supprimer
|
*
|
||||||
|
* @param id id de la societe a supprimer
|
||||||
|
* @param socid id third party
|
||||||
*/
|
*/
|
||||||
function delete($id,$socid)
|
function delete($id,$socid)
|
||||||
{
|
{
|
||||||
@@ -421,9 +427,10 @@ class Address
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Charge les informations d'ordre info dans l'objet societe
|
* Charge les informations d'ordre info dans l'objet societe
|
||||||
* \param id id de la societe a charger
|
*
|
||||||
|
* @param id id de la societe a charger
|
||||||
*/
|
*/
|
||||||
function info($id)
|
function info($id)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user