Bug #610

auto-fill uemail field in tracking.function.php

Added by Anonymous almost 15 years ago. Updated almost 15 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:moyo% Done:

0%

Category:Common
Target version:0.68

Description

for users of "command center" ui, would be nice for ticket form to auto-fill uemail field (similar to users of "helpdesk" ui). not sure if there is a better way to get user e-mail string, but this works for me...

--- tracking.function.php.old    2006-07-12 00:25:15.000000000 -0400
+++ tracking.function.php    2006-07-12 12:10:43.119429100 -0400
@@ -671,7 +671,7 @@
 function addFormTracking ($device_type=0,$ID=0,$author,$assign,$target,$error,$searchauthor=_) {
     // Prints a nice form to add jobs

-    global $cfg_glpi, $lang,$cfg_glpi,$REFERER;
+    global $cfg_glpi, $lang,$cfg_glpi,$REFERER,$db;
     if (!haveRight("create_ticket","1")) return false;

     if (!empty($error)) {
@@ -791,6 +791,9 @@

     if($cfg_glpi[[mailing]] == 1)
     {
+        $query="SELECT email from glpi_users WHERE ID='$author'";
+        $result=$db->query($query);
+        $email=$db->result($result,0,"email");
         echo "<tr class='tab_bg_1'>";
         echo "<td align='center'>".$lang[[help]].":</td>";
         echo "<td align='center'>    <select name='emailupdates'>";
@@ -800,7 +803,7 @@
         echo "</td>";
         echo "<td align='center'>".$lang[[help]].":</td>";
         echo "<td>    ";
-        echo "<input type='text' size='30' name='uemail'>";
+        echo "<input type='text' size='30' name='uemail' value='$email'>";
         echo "</td></tr>";

     }

History

#1 Updated by moyo almost 15 years ago

  • Status changed from New to Closed

Also available in: Atom PDF