forked from Wavyzz/dolibarr
Fix: product lines with parent line better works
Fix: add trigger LINEPROPAL_DELETE
This commit is contained in:
@@ -542,9 +542,9 @@ class Propal extends CommonObject
|
||||
{
|
||||
if ($this->statut == 0)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$lineid;
|
||||
$line=new PropaleLigne($this->db);
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
if ($line->delete($lineid))
|
||||
{
|
||||
$this->update_price();
|
||||
|
||||
@@ -2454,6 +2454,29 @@ class PropaleLigne
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete line in database
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete($rowid)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$rowid;
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result = $interface->run_triggers('LINEPROPAL_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise a jour de l'objet ligne de propale en base
|
||||
|
||||
@@ -146,14 +146,16 @@ class Form
|
||||
* @param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
|
||||
* @param img Code img du picto (use img_xxx() function to get it)
|
||||
* @param extracss Add a CSS style to td tags
|
||||
* @param notable Do not include table and tr tags
|
||||
* @param notabs Do not include table and tr tags
|
||||
* @param incbefore Include code before the text
|
||||
* @return string Code html du tooltip (texte+picto)
|
||||
* @see Use function textwithpicto if you can.
|
||||
*/
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0)
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if ($incbefore) $text = $incbefore.$text;
|
||||
if (! $htmltext) return $text;
|
||||
|
||||
$paramfortooltip ='';
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
||||
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
||||
else $text = img_object($langs->trans('Product'),'product');
|
||||
echo $text.' '.nl2br($line->description);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,7 @@
|
||||
<td>
|
||||
<a name="<?php echo $line->id; ?>"></a>
|
||||
<?php
|
||||
echo $html->textwithtooltip($text,$description,3,'','',$i);
|
||||
echo $html->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
|
||||
|
||||
// Show range
|
||||
print_date_range($line->date_start, $line->date_end);
|
||||
|
||||
@@ -281,6 +281,10 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'LINEPROPAL_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'LINEPROPAL_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
BIN
htdocs/theme/auguria/img/rightarrow.png
Normal file
BIN
htdocs/theme/auguria/img/rightarrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 507 B |
Reference in New Issue
Block a user