diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d7591bc7beb..322be49d1a6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -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(); @@ -2453,8 +2453,31 @@ class PropaleLigne return -1; } } - - + + /** + * 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 * \return int <0 si ko, >0 si ok diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3b55841a03d..fc5be47322b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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 =''; diff --git a/htdocs/core/tpl/freeproductline_view.tpl.php b/htdocs/core/tpl/freeproductline_view.tpl.php index d561f46b101..15defba59d8 100644 --- a/htdocs/core/tpl/freeproductline_view.tpl.php +++ b/htdocs/core/tpl/freeproductline_view.tpl.php @@ -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); diff --git a/htdocs/core/tpl/predefinedproductline_view.tpl.php b/htdocs/core/tpl/predefinedproductline_view.tpl.php index 6dce97bacec..7f327864a0a 100644 --- a/htdocs/core/tpl/predefinedproductline_view.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010 Laurent Destailleur +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2010-2011 Laurent Destailleur * * 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 @@ 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); diff --git a/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN b/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN index 464dd232223..662c7400875 100644 --- a/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN +++ b/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN @@ -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); diff --git a/htdocs/theme/auguria/img/rightarrow.png b/htdocs/theme/auguria/img/rightarrow.png new file mode 100644 index 00000000000..eb0310ee0cb Binary files /dev/null and b/htdocs/theme/auguria/img/rightarrow.png differ