]> git.pld-linux.org Git - packages/eventum.git/blob - eventum-email-notify-display.patch
- conditional dispelmagicquotes for the sake of performance for sane setups
[packages/eventum.git] / eventum-email-notify-display.patch
1 --- eventum-20060830/include/class.notification.php     2006-08-30 20:17:25.074832296 +0300
2 +++ eventum/include/class.notification.php      2006-09-21 20:59:32.125474606 +0300
3 @@ -853,6 +853,31 @@
4          }
5      }
6  
7 +    /**
8 +     * Method used to get list of addresses that were email sent to.
9 +     *
10 +     * @access  public
11 +     * @param   integer $issue_id The issue ID
12 +     * @return  array   list of addresse
13 +     */
14 +    function getLastNotifiedAddresses($issue_id = null)
15 +    {
16 +        global $_EVENTUM_LAST_NOTIFIED_LIST;
17 +
18 +        if (is_null($_EVENTUM_LAST_NOTIFIED_LIST)) {
19 +            return null;
20 +        }
21 +
22 +        if (is_null($issue_id)) {
23 +            // return all addresses in flat view
24 +            $ret = array_values($_EVENTUM_LAST_NOTIFIED_LIST);
25 +        } else {
26 +            // return address list for specific issue_id only.
27 +            $ret = $_EVENTUM_LAST_NOTIFIED_LIST[$issue_id];
28 +        }
29 +        return array_unique($ret);
30 +    }
31 +
32  
33      /**
34       * Method used to format and send the email notifications.
35 @@ -869,6 +894,8 @@
36       */
37      function notifySubscribers($issue_id, $emails, $type, $data, $subject, $internal_only, $type_id = false, $headers = false)
38      {
39 +        global $_EVENTUM_LAST_NOTIFIED_LIST;
40 +
41          // open text template
42          $tpl = new Template_API;
43          $tpl->setTemplate('notifications/' . $type . '.tpl.text');
44 @@ -954,6 +981,8 @@
45                  $full_subject = "[#$issue_id] $subject: $extra_subject";
46              }
47              $mail->send($from, $emails[$i], $full_subject, TRUE, $issue_id, $final_type, $sender_usr_id, $type_id);
48 +
49 +            $_EVENTUM_LAST_NOTIFIED_LIST[$issue_id][] = $emails[$i];
50          }
51      }
52  
53 --- eventum-20060829/update.php 2006-08-30 00:46:19.047416365 +0300
54 +++ eventum-20060830/update.php 2006-08-30 20:17:24.844826982 +0300
55 @@ -111,6 +111,7 @@
56  
57      $tpl->assign(array(
58          "subscribers"  => Notification::getSubscribers($issue_id),
59 +        "notify_list"  => Notification::getLastNotifiedAddresses($issue_id),
60          "categories"   => Category::getAssocList($prj_id),
61          "priorities"   => Priority::getAssocList($prj_id),
62          "status"       => $statuses,
63 --- eventum/templates/update_form.tpl.html~     2006-12-07 03:15:13.287421331 +0200
64 +++ eventum/templates/update_form.tpl.html      2006-12-07 03:16:11.678724963 +0200
65 @@ -15,7 +15,17 @@
66                  <br />{t}Also, all issues that are marked as duplicates from this one were updated as well.{/t}
67                {/if}
68                <br /><br />
69 +
70 +              {if $notify_list|@count > 0}
71 +              <b>{t}E-mail about issue update was sent to:{/t}</b><br />
72 +              {foreach from=$notify_list item=email_address}
73 +              &nbsp;&nbsp;{$email_address|escape:"html"}<br />
74 +              {/foreach}
75 +              <br />
76 +              {/if}
77 +              <b>
78                <a href="view.php?id={$smarty.post.issue_id}" class="link">{t 1=$smarty.post.issue_id}Return to Issue #%1 Details Page{/t}</a>
79 +              </b>
80              {/if}
81            </td>
82          </tr>
83 --- eventum-20060830/close.php  2006-09-04 14:46:53.766630207 +0300
84 +++ eventum-20060830/close.php  2006-09-04 13:57:56.000000000 +0300
85 @@ -68,9 +68,12 @@
86      $tpl->assign("close_result", $res);
87  }
88  
89 -$tpl->assign("statuses", Status::getClosedAssocList($prj_id));
90 -$tpl->assign("resolutions", Resolution::getAssocList());
91 -$tpl->assign("time_categories", Time_Tracking::getAssocCategories());
92 +$tpl->assign(array(
93 +    "statuses" => Status::getClosedAssocList($prj_id),
94 +    "resolutions" => Resolution::getAssocList(),
95 +    "time_categories" => Time_Tracking::getAssocCategories(),
96 +    "notify_list"  => Notification::getLastNotifiedAddresses($issue_id),
97 +));
98  
99  if ((Customer::hasCustomerIntegration($prj_id)) && (Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id)))) {
100      $details = Issue::getDetails($issue_id);
101 --- eventum-20060830/templates/close.tpl.html~  2006-09-04 14:46:53.486623924 +0300
102 +++ eventum-20060830/templates/close.tpl.html   2006-09-04 14:45:42.000000000 +0300
103 @@ -12,7 +12,18 @@
104              {if $close_result == -1}
105              <b>{t}Sorry, an error happened while trying to run your query.{/t}</b>
106              {elseif $close_result == 1}
107 -            <b>{t}Thank you, the issue was closed successfully. Please choose from one of the options below:{/t}</b>
108 +            <b>{t}Thank you, the issue was closed successfully.{/t}</b><br/>
109 +
110 +            {if $notify_list|@count > 0}
111 +            <br/>
112 +            <b>{t}E-mail about issue update was sent to:{/t}</b><br />
113 +            {foreach from=$notify_list item=email_address}
114 +            &nbsp;&nbsp;{$email_address|escape:"html"}<br />
115 +            {/foreach}
116 +            <br />
117 +            {/if}
118 +
119 +            <b>{t}Please choose from one of the options below:{/t}</b>
120              <ul>
121                <li><a href="view.php?id={$smarty.post.issue_id}" class="link">{t}Open the Issue Details Page{/t}</a></li>
122                <li><a href="list.php" class="link">{t}Open the Issue Listing Page{/t}</a></li>
This page took 0.039316 seconds and 3 git commands to generate.