Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
91d1f9d48b
@ -188,8 +188,8 @@ class ActionComm extends CommonObject
|
|||||||
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
|
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
|
||||||
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||||
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
||||||
$sql.= " '".$this->type_id."',";
|
$sql.= (isset($this->type_id)?$this->type_id:"null").",";
|
||||||
$sql.= " '".$this->code."',";
|
$sql.= (isset($this->code)?" '".$this->code."'":"null").",";
|
||||||
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
|
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
|
||||||
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
|
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
|
||||||
$sql.= " '".$this->db->escape($this->note)."',";
|
$sql.= " '".$this->db->escape($this->note)."',";
|
||||||
|
|||||||
@ -243,6 +243,7 @@ if ($action == 'add_action')
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error=$langs->trans($actioncomm->error);
|
$error=$langs->trans($actioncomm->error);
|
||||||
|
setEventMessage($error,'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,6 +252,7 @@ if ($action == 'add_action')
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error=$langs->trans($actioncomm->error);
|
$error=$langs->trans($actioncomm->error);
|
||||||
|
setEventMessage($error,'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -277,6 +279,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg=$actioncomm->error;
|
$mesg=$actioncomm->error;
|
||||||
|
setEventMessage($mesg,'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1845,7 +1845,11 @@ else
|
|||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
if ($action == 'edit_extras') {
|
||||||
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
|
} else {
|
||||||
|
$value=$object->array_options["options_".$key];
|
||||||
|
}
|
||||||
if ($extrafields->attribute_type[$key] == 'separate')
|
if ($extrafields->attribute_type[$key] == 'separate')
|
||||||
{
|
{
|
||||||
print $extrafields->showSeparator($key);
|
print $extrafields->showSeparator($key);
|
||||||
|
|||||||
@ -2554,6 +2554,7 @@ class Propal extends CommonObject
|
|||||||
$sql.= ' WHERE pt.fk_propal = '.$this->id;
|
$sql.= ' WHERE pt.fk_propal = '.$this->id;
|
||||||
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';
|
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';
|
||||||
|
|
||||||
|
dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2834,7 +2834,7 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update value of extrafields on the proposal
|
* Update value of extrafields on order
|
||||||
*
|
*
|
||||||
* @param User $user Object user that modify
|
* @param User $user Object user that modify
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
|
|||||||
@ -2145,7 +2145,11 @@ else
|
|||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
if ($action == 'edit_extras') {
|
||||||
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
|
} else {
|
||||||
|
$value=$object->array_options["options_".$key];
|
||||||
|
}
|
||||||
if ($extrafields->attribute_type[$key] == 'separate')
|
if ($extrafields->attribute_type[$key] == 'separate')
|
||||||
{
|
{
|
||||||
print $extrafields->showSeparator($key);
|
print $extrafields->showSeparator($key);
|
||||||
|
|||||||
@ -3291,7 +3291,11 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
if ($action == 'edit_extras') {
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
|
} else {
|
||||||
|
$value=$object->array_options["options_".$key];
|
||||||
|
}
|
||||||
if ($extrafields->attribute_type[$key] == 'separate')
|
if ($extrafields->attribute_type[$key] == 'separate')
|
||||||
{
|
{
|
||||||
print $extrafields->showSeparator($key);
|
print $extrafields->showSeparator($key);
|
||||||
|
|||||||
@ -3203,6 +3203,7 @@ class Facture extends CommonInvoice
|
|||||||
$sql.= ' WHERE l.fk_facture = '.$this->id;
|
$sql.= ' WHERE l.fk_facture = '.$this->id;
|
||||||
$sql.= ' ORDER BY l.rang ASC, l.rowid';
|
$sql.= ' ORDER BY l.rang ASC, l.rowid';
|
||||||
|
|
||||||
|
dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -187,7 +187,7 @@ abstract class CommonObject
|
|||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||||
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
||||||
$sql.= $this->db->idate($datecreate);
|
$sql.= "'".$this->db->idate($datecreate)."'";
|
||||||
$sql.= ", 4, '". $id_type_contact . "' ";
|
$sql.= ", 4, '". $id_type_contact . "' ";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
dol_syslog(get_class($this)."::add_contact sql=".$sql);
|
dol_syslog(get_class($this)."::add_contact sql=".$sql);
|
||||||
@ -2517,6 +2517,9 @@ abstract class CommonObject
|
|||||||
if ($objecttype == 'cabinetmed_cons') {
|
if ($objecttype == 'cabinetmed_cons') {
|
||||||
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
|
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
|
||||||
}
|
}
|
||||||
|
if ($objecttype == 'fichinter') {
|
||||||
|
$classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter';
|
||||||
|
}
|
||||||
|
|
||||||
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
||||||
|
|
||||||
|
|||||||
@ -445,7 +445,7 @@ class ExtraFields
|
|||||||
|
|
||||||
if(is_array($param) && count($param) > 0)
|
if(is_array($param) && count($param) > 0)
|
||||||
{
|
{
|
||||||
$param = serialize($param);
|
$param = $this->db->escape(serialize($param));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
|
||||||
|
|||||||
@ -49,8 +49,8 @@
|
|||||||
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||||
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||||
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();}
|
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();}
|
||||||
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
|
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||||
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
|
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||||
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||||
else size.val('').attr('disabled','disabled');
|
else size.val('').attr('disabled','disabled');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,9 @@ class Fichinter extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::create ref=".$this->ref);
|
dol_syslog(get_class($this)."::create ref=".$this->ref);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! is_numeric($this->duree)) { $this->duree = 0; }
|
if (! is_numeric($this->duree)) {
|
||||||
|
$this->duree = 0;
|
||||||
|
}
|
||||||
if ($this->socid <= 0)
|
if ($this->socid <= 0)
|
||||||
{
|
{
|
||||||
$this->error='ErrorBadParameterForFunc';
|
$this->error='ErrorBadParameterForFunc';
|
||||||
@ -218,8 +220,12 @@ class Fichinter extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function update($user, $notrigger=0)
|
function update($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
if (! is_numeric($this->duree)) { $this->duree = 0; }
|
if (! is_numeric($this->duree)) {
|
||||||
if (! dol_strlen($this->fk_project)) { $this->fk_project = 0; }
|
$this->duree = 0;
|
||||||
|
}
|
||||||
|
if (! dol_strlen($this->fk_project)) {
|
||||||
|
$this->fk_project = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -240,7 +246,7 @@ class Fichinter extends CommonObject
|
|||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('FICHINTER_MODIFY',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('FICHINTER_UPDATE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $this->errors=$interface->errors;
|
||||||
}
|
}
|
||||||
@ -411,7 +417,9 @@ class Fichinter extends CommonObject
|
|||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('FICHINTER_VALIDATE',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('FICHINTER_VALIDATE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -525,7 +533,7 @@ class Fichinter extends CommonObject
|
|||||||
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
|
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0)
|
function getNomUrl($withpicto=0,$option='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -651,9 +659,9 @@ class Fichinter extends CommonObject
|
|||||||
* @param User $user Object user who delete
|
* @param User $user Object user who delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf,$langs;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -718,15 +726,17 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Appel des triggers
|
if (! $notrigger)
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
{
|
||||||
$interface=new Interfaces($this->db);
|
// Appel des triggers
|
||||||
$result=$interface->run_triggers('FICHINTER_DELETE',$this,$user,$langs,$conf);
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
if ($result < 0) {
|
$interface=new Interfaces($this->db);
|
||||||
$error++; $this->errors=$interface->errors;
|
$result=$interface->run_triggers('FICHINTER_DELETE',$this,$user,$langs,$conf);
|
||||||
}
|
if ($result < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
}
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -814,13 +824,14 @@ class Fichinter extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Adding a line of intervention into data base
|
* Adding a line of intervention into data base
|
||||||
*
|
*
|
||||||
|
* @param user $user User that do the action
|
||||||
* @param int $fichinterid Id of intervention
|
* @param int $fichinterid Id of intervention
|
||||||
* @param string $desc Line description
|
* @param string $desc Line description
|
||||||
* @param date $date_intervention Intervention date
|
* @param date $date_intervention Intervention date
|
||||||
* @param int $duration Intervention duration
|
* @param int $duration Intervention duration
|
||||||
* @return int >0 if ok, <0 if ko
|
* @return int >0 if ok, <0 if ko
|
||||||
*/
|
*/
|
||||||
function addline($fichinterid, $desc, $date_intervention, $duration)
|
function addline($user,$fichinterid, $desc, $date_intervention, $duration)
|
||||||
{
|
{
|
||||||
dol_syslog("Fichinter::Addline $fichinterid, $desc, $date_intervention, $duration");
|
dol_syslog("Fichinter::Addline $fichinterid, $desc, $date_intervention, $duration");
|
||||||
|
|
||||||
@ -836,7 +847,7 @@ class Fichinter extends CommonObject
|
|||||||
$line->datei = $date_intervention;
|
$line->datei = $date_intervention;
|
||||||
$line->duration = $duration;
|
$line->duration = $duration;
|
||||||
|
|
||||||
$result=$line->insert();
|
$result=$line->insert($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -1003,10 +1014,14 @@ class FichinterLigne
|
|||||||
/**
|
/**
|
||||||
* Insert the line into database
|
* Insert the line into database
|
||||||
*
|
*
|
||||||
|
* @param User $user Objet user that make creation
|
||||||
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function insert()
|
function insert($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
dol_syslog("FichinterLigne::insert rang=".$this->rang);
|
dol_syslog("FichinterLigne::insert rang=".$this->rang);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -1049,6 +1064,21 @@ class FichinterLigne
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->rang=$rangToUse;
|
$this->rang=$rangToUse;
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_CREATE',$this,$user,$langs,$conf);
|
||||||
|
if ($resulttrigger < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -1071,10 +1101,14 @@ class FichinterLigne
|
|||||||
/**
|
/**
|
||||||
* Update intervention into database
|
* Update intervention into database
|
||||||
*
|
*
|
||||||
|
* @param User $user Objet user that make creation
|
||||||
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function update()
|
function update($user,$notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Mise a jour ligne en base
|
// Mise a jour ligne en base
|
||||||
@ -1091,6 +1125,22 @@ class FichinterLigne
|
|||||||
{
|
{
|
||||||
$result=$this->update_total();
|
$result=$this->update_total();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_UPDATE',$this,$user,$langs,$conf);
|
||||||
|
if ($resulttrigger < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
@ -1167,10 +1217,14 @@ class FichinterLigne
|
|||||||
/**
|
/**
|
||||||
* Delete a intervention line
|
* Delete a intervention line
|
||||||
*
|
*
|
||||||
|
* @param User $user Objet user that make creation
|
||||||
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int >0 if ok, <0 if ko
|
* @return int >0 if ok, <0 if ko
|
||||||
*/
|
*/
|
||||||
function deleteline()
|
function deleteline($user,$notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
if ($this->statut == 0)
|
if ($this->statut == 0)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid);
|
dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid);
|
||||||
@ -1186,6 +1240,19 @@ class FichinterLigne
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$resulttrigger=$interface->run_triggers('FICHINTERDET_DELETE',$this,$user,$langs,$conf);
|
||||||
|
if ($resulttrigger < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -248,6 +248,7 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
|||||||
$duration = 3600;
|
$duration = 3600;
|
||||||
|
|
||||||
$result = $object->addline(
|
$result = $object->addline(
|
||||||
|
$user,
|
||||||
$id,
|
$id,
|
||||||
$desc,
|
$desc,
|
||||||
$date_intervention,
|
$date_intervention,
|
||||||
@ -376,7 +377,10 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fich
|
|||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$object->delete($user);
|
$result=$object->delete($user);
|
||||||
|
if ($result<0) {
|
||||||
|
setEventMessage($object->error,'errors');
|
||||||
|
}
|
||||||
|
|
||||||
header('Location: '.DOL_URL_ROOT.'/fichinter/list.php?leftmenu=ficheinter');
|
header('Location: '.DOL_URL_ROOT.'/fichinter/list.php?leftmenu=ficheinter');
|
||||||
exit;
|
exit;
|
||||||
@ -426,6 +430,7 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
|
|||||||
$duration = convertTime2Seconds(GETPOST('durationhour','int'), GETPOST('durationmin','int'));
|
$duration = convertTime2Seconds(GETPOST('durationhour','int'), GETPOST('durationmin','int'));
|
||||||
|
|
||||||
$result=$object->addline(
|
$result=$object->addline(
|
||||||
|
$user,
|
||||||
$id,
|
$id,
|
||||||
$desc,
|
$desc,
|
||||||
$date_intervention,
|
$date_intervention,
|
||||||
@ -501,7 +506,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
|
|||||||
$objectline->datei = $date_inter;
|
$objectline->datei = $date_inter;
|
||||||
$objectline->desc = $desc;
|
$objectline->desc = $desc;
|
||||||
$objectline->duration = $duration;
|
$objectline->duration = $duration;
|
||||||
$result = $objectline->update();
|
$result = $objectline->update($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -535,7 +540,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$result=$objectline->deleteline();
|
$result=$objectline->deleteline($user);
|
||||||
|
|
||||||
if ($object->fetch($objectline->fk_fichinter) <= 0)
|
if ($object->fetch($objectline->fk_fichinter) <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -381,7 +381,7 @@ class PaiementFourn extends Paiement
|
|||||||
$sql.= ' WHERE pf.fk_facturefourn = f.rowid AND fk_paiementfourn = '.$this->id;
|
$sql.= ' WHERE pf.fk_facturefourn = f.rowid AND fk_paiementfourn = '.$this->id;
|
||||||
if ($filter) $sql.= ' AND '.$filter;
|
if ($filter) $sql.= ' AND '.$filter;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getBillsArray sql='.$sql);
|
dol_syslog(get_class($this).'::getBillsArray sql='.$sql,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -356,14 +356,14 @@ ExtrafieldPhone=Teléfono
|
|||||||
ExtrafieldPrice=Precio
|
ExtrafieldPrice=Precio
|
||||||
ExtrafieldMail=Correo
|
ExtrafieldMail=Correo
|
||||||
ExtrafieldSelect=Lista de selección
|
ExtrafieldSelect=Lista de selección
|
||||||
ExtrafieldSelectList=Llista de selección de table
|
ExtrafieldSelectList=Lista de selección de tabla
|
||||||
ExtrafieldSeparator=Separador
|
ExtrafieldSeparator=Separador
|
||||||
ExtrafieldCheckBox=Casilla de verificación
|
ExtrafieldCheckBox=Casilla de verificación
|
||||||
ExtrafieldRadio=Botón de selección excluyente
|
ExtrafieldRadio=Botón de selección excluyente
|
||||||
ExtrafieldParamHelpselect=La llista ha de ser en forma clau, valor<br><br> per exemple : <br>1,text1<br>2,text2<br>3,text3<br>...
|
ExtrafieldParamHelpselect=La lista ha de ser en forma llave, valor<br><br> por ejemplo : <br>1,text1<br>2,text2<br>3,text3<br>...
|
||||||
ExtrafieldParamHelpcheckbox=La llista ha de ser en forma clau, valor<br><br> per exemple : <br>1,text1<br>2,text2<br>3,text3<br>...
|
ExtrafieldParamHelpcheckbox=La lista ha de ser en forma llave, valor<br><br> por ejemplo : <br>1,text1<br>2,text2<br>3,text3<br>...
|
||||||
ExtrafieldParamHelpradio=La llista ha de ser en forma clau, valor<br><br> per exemple : <br>1,text1<br>2,text2<br>3,text3<br>...
|
ExtrafieldParamHelpradio=La lista ha de ser en forma llave, valor<br><br> por ejemplo : <br>1,text1<br>2,text2<br>3,text3<br>...
|
||||||
ExtrafieldParamHelpsellist=La llista ha de ser del table<br><br> per exemple : <br>table:label:(code)<br>
|
ExtrafieldParamHelpsellist=La lista ha de ser de la tabl<br><br> por ejemplo: <br>table:label:(code)<br>
|
||||||
LibraryToBuildPDF=Librería usada para la creación de archivos PDF
|
LibraryToBuildPDF=Librería usada para la creación de archivos PDF
|
||||||
WarningUsingFPDF=Atención: Su archivo <b>conf.php</b> contiene la directiva <b>dolibarr_pdf_force_fpdf=1</b>. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.<br>Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la <a href="http://www.tcpdf.org/" target="_blank">librería TCPDF</a> , y a continuación comentar o eliminar la línea <b>$dolibarr_pdf_force_fpdf=1</b>, y añadir en su lugar <b>$dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF'</b>
|
WarningUsingFPDF=Atención: Su archivo <b>conf.php</b> contiene la directiva <b>dolibarr_pdf_force_fpdf=1</b>. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.<br>Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la <a href="http://www.tcpdf.org/" target="_blank">librería TCPDF</a> , y a continuación comentar o eliminar la línea <b>$dolibarr_pdf_force_fpdf=1</b>, y añadir en su lugar <b>$dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF'</b>
|
||||||
LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:<br>1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)<br>2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)<br>3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)<br>4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)<br>5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)<br>6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local)
|
LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:<br>1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)<br>2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)<br>3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)<br>4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)<br>5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)<br>6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user