You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2007-08-17 14:37:24

benno
Member
From: Germany
Registered: 2007-08-06
Posts: 7
Website

patch: limit lenght of weblink-output in associated documents

Hi,

a link was so long that it made the webpage much to wide, so i changed  document.function.php showDocumentAssociated().

patch against snapshot 2007-08-15.

btw. whats the prefered way to submit patches? is there a (english) mailinglist?

/Benno


benoit@tool:/var/www/glpi$ diff -u inc/document.function.php.orig inc/document.function.php
--- inc/document.function.php.orig      2007-08-17 14:24:16.000000000 +0200
+++ inc/document.function.php   2007-08-17 14:32:16.000000000 +0200
@@ -327,8 +327,12 @@
                echo "<td align='center'  width='100px'>".getDocumentLink($data["filename"])."</td>";

                echo "<td class='center'>";
-               if (!empty($data["link"]))
-                       echo "<a target=_blank href='".$data["link"]."'>".$data["link"]."</a>";
+               if (!empty($data["link"])) {
+                       if(strlen($data["link"]) > 29)
+                               echo "<a target=_blank href='".$data["link"]."'>".substr($data["link"],0,29)."[...]</a>";
+                       else
+                               echo "<a target=_blank href='".$data["link"]."'>".$data["link"]."</a>";
+               }
                else echo "&nbsp;";
                echo "</td>";
                echo "<td class='center'>".getDropdownName("glpi_dropdown_rubdocs",$data["rubrique"])."</td>";

Offline

#2 2007-09-16 00:42:32

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: patch: limit lenght of weblink-output in associated documents

Hi,

Thanks for your interest in GLPi project;

Modifications wer  done in our SVN. ok

You could send your future  patch  to the developer mailing-list  discussions are both in english or french no pb.


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

Board footer

Powered by FluxBB