Merge branch 'dev-3.5.4'
[packages/eventum.git] / group-users.patch
1 === modified file 'htdocs/post_note.php'
2 --- htdocs/post_note.php        2011-01-19 10:31:30 +0000
3 +++ htdocs/post_note.php        2011-01-19 13:20:28 +0000
4 @@ -85,9 +85,29 @@
5      $reply_subject = ev_gettext('Re: %1$s', $details['iss_summary']);
6  }
7  
8 +$users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer'));
9 +$user_details = User::getDetailsAssoc(array_keys($users));
10 +function array_orderby() {
11 +    $args = func_get_args();
12 +    $data = array_shift($args);
13 +    foreach ($args as $n => $field) {
14 +        if (is_string($field)) {
15 +            $tmp = array();
16 +            foreach ($data as $key => $row)
17 +                $tmp[$key] = $row[$field];
18 +            $args[$n] = $tmp;
19 +            }
20 +    }
21 +    $args[] = &$data;
22 +    call_user_func_array('array_multisort', $args);
23 +    return array_pop($args);
24 +}
25 +$user_details = array_orderby($user_details, 'usr_grp_id', SORT_ASC, 'usr_full_name', SORT_ASC);
26 +
27  $tpl->assign(array(
28      'from'               => User::getFromHeader($usr_id),
29 -    'users'              => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')),
30 +    'users'              => $users, // XXX: drop me, we use $user_details now
31 +    'user_details'       => $user_details,
32      'current_user_prefs' => Prefs::get($usr_id),
33      'subscribers'        => Notification::getSubscribers($issue_id, false, User::getRoleID("Standard User")),
34      'statuses'           => Status::getAssocStatusList($prj_id, false),
35
36 === modified file 'templates/post_note.tpl.html'
37 --- templates/post_note.tpl.html        2010-10-07 11:47:17 +0000
38 +++ templates/post_note.tpl.html        2011-01-19 13:01:33 +0000
39 @@ -127,8 +127,17 @@
40                  size="{$users|@count}"
41                {/if}
42                multiple name="note_cc[]" onChange="showSelections('post_note_form', 'note_cc[]');">
43 -              {html_options options=$users}
44 -            </select><input class="button" type="button" value="{t}Clear Selections{/t}" onClick="clearExtraRecipients();"><br />
45 +
46 +              {foreach from=$user_details item=usr}
47 +              {if $usr.group}
48 +                {assign var=display_name value="`$usr.group`: `$usr.usr_full_name`"}
49 +              {else}
50 +                {assign var=display_name value=$usr.usr_full_name}
51 +              {/if}
52 +                {html_options values=$usr.usr_id output=$display_name}
53 +              {/foreach}
54 +            </select>
55 +            <input class="button" type="button" value="{t}Clear Selections{/t}" onClick="clearExtraRecipients();"><br />
56              {include file="lookup_field.tpl.html" lookup_field_name="search" lookup_field_target="note_cc[]" callbacks="new Array('showSelections(\'post_note_form\', \'note_cc[]\')')"}
57              <div class="default" id="selection_note_cc[]"></div>
58            </td>
59
This page took 0.035801 seconds and 3 git commands to generate.