From 2cf9d9f5834f417ba43fde15bc56b343e43f2814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 29 Jul 2015 19:42:41 +0200 Subject: [PATCH 1/2] Fix #3322 Use title for alt if no alt is provided alt has priority over title, so it should be filled if title is filled. Use the title value to fill alt. Unit test updated accordingly. --- htdocs/core/lib/functions.lib.php | 2 +- test/phpunit/FunctionsLibTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 830911fdfb4..7295abfe7df 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1906,7 +1906,7 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $ $tmparray=array(0=>$titlealt); if (preg_match('/:[^\s]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB $title=$tmparray[0]; - $alt=empty($tmparray[1])?'':$tmparray[1]; + $alt=empty($tmparray[1])?$tmparray[0]:$tmparray[1]; // Use title for alt if no alt is provided return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index dd3602ff8f7..88496680eec 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -609,11 +609,11 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $s=img_picto('title','/fullpath/img.png','',1); print __METHOD__." s=".$s."\n"; - $this->assertEquals('',$s,'testImgPicto3'); + $this->assertEquals('title',$s,'testImgPicto3'); $s=img_picto('title','/fullpath/img.png','',true); print __METHOD__." s=".$s."\n"; - $this->assertEquals('',$s,'testImgPicto4'); + $this->assertEquals('title',$s,'testImgPicto4'); $s=img_picto('title:alt','/fullpath/img.png','',true); print __METHOD__." s=".$s."\n"; From 62ad7d4d3419dfc3d6c0583d6b6ca86f0cf1981f Mon Sep 17 00:00:00 2001 From: fmarcet Date: Tue, 4 Aug 2015 13:32:44 +0200 Subject: [PATCH 2/2] FIX: Not showing task extrafields when creating from left menu --- ChangeLog | 1 + htdocs/projet/tasks.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5ea84cbb708..e4815781cd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ FIX [ bug 1634 ] Error deleting a project when it had many linked objects FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne FIX: Not showing delivery date on rouget pdf +FIX: Not showing task extrafields when creating from left menu NEW: Created new ContratLigne::insert function diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 6d1fb4d8462..f4d83eaa1f1 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -55,8 +55,8 @@ if ($id > 0 || ! empty($ref)) // fetch optionals attributes and labels $extralabels_projet=$extrafields_project->fetch_name_optionals_label($object->table_element); - $extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->table_element); } +$extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->table_element); // Security check $socid=0;