From cce857d6ee3e7b727e10d0fd3a1233db50633fbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Apr 2013 01:35:33 +0200 Subject: [PATCH] Fix: When box is removed, it is added into combo box of available boxes. --- htdocs/core/boxes/box_graph_invoices_permonth.php | 3 ++- htdocs/core/boxes/modules_boxes.php | 4 +++- htdocs/core/class/html.formother.class.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index c0e6ce00447..3ec5add8a05 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -71,7 +71,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $text = $langs->trans("BoxInvoicesPerMonth",$max); $this->info_box_head = array( 'text' => $text, - 'limit'=> dol_strlen($text) + 'limit'=> dol_strlen($text), + 'graph'=> 1 ); if ($user->rights->facture->lire) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index cf9e7f6fd32..140b5c757f9 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -168,7 +168,9 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"'); print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); - print ''; + $label=$head['text']; + if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; + print ''; print ''; } print ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 73427b71455..c87f2df36dd 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -957,7 +957,7 @@ class FormOther var boxid=self.id.substring(8); var label=jQuery(\'#boxlabelentry\'+boxid).val(); jQuery(\'#boxto_\'+boxid).remove(); - // TODO Add id, label into combo list + if (boxid > 0) jQuery(\'#boxcombo\').append(new Option(label, boxid)); updateBoxOrder(1); });