Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3a4d4d4f

Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt

  • ID 3a4d4d4ff1e801c52147e98dd00298d6b39b713b
  • Vorgänger 4feca419
  • Nachfolger b149673a

Wiedervorlage: Benutzer aus Gruppen hinzufügen können

Unterschiede anzeigen:

SL/Controller/CustomerVendor.pm
17 17
use SL::Controller::Helper::ReportGenerator;
18 18
use SL::Controller::Helper::ParseFilter;
19 19

  
20
use SL::DB::AuthGroup;
20 21
use SL::DB::Customer;
21 22
use SL::DB::Vendor;
22 23
use SL::DB::Business;
......
1084 1085

  
1085 1086
  $self->{all_business} = SL::DB::Manager::Business->get_all();
1086 1087

  
1087
  $self->{all_employees} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
1088
  $self->{all_employees}   = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
1089
  $self->{all_auth_groups} = SL::DB::Manager::AuthGroup->get_all_sorted;
1088 1090

  
1089 1091
  $self->{all_greetings} = SL::DB::Manager::Greeting->get_all_sorted();
1090 1092
  if ($self->{cv}->id && $self->{cv}->greeting && !grep {$self->{cv}->greeting eq $_->description} @{$self->{all_greetings}}) {
......
1208 1210

  
1209 1211
  $self->{template_args} ||= {};
1210 1212

  
1211
  $::request->{layout}->add_javascripts("$_.js") for qw (kivi.CustomerVendor kivi.File kivi.CustomerVendorTurnover ckeditor/ckeditor ckeditor/adapters/jquery jquery.selectboxes jquery.multiselect2side);
1213
  $::request->{layout}->add_javascripts("$_.js") for qw (kivi.CustomerVendor kivi.File kivi.CustomerVendorTurnover ckeditor/ckeditor ckeditor/adapters/jquery follow_up);
1212 1214

  
1213 1215
  $self->_setup_form_action_bar;
1214 1216
}
bin/mozilla/fu.pl
3 3
use SL::FU;
4 4
use SL::Locale::String qw(t8);
5 5
use SL::ReportGenerator;
6
use SL::DB::AuthGroup;
6 7
use SL::DB::Employee;
7 8

  
8 9
require "bin/mozilla/reportgenerator.pl";
......
99 100

  
100 101
  my $form     = $main::form;
101 102

  
102
  $form->{all_employees} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
103
  $form->{all_employees}   = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
104
  $form->{all_auth_groups} = SL::DB::Manager::AuthGroup->get_all_sorted;
103 105

  
104 106
  my %params;
105 107
  $params{not_id}     = $form->{id} if ($form->{id});
......
112 114
  setup_fu_display_form_action_bar() unless $::form->{POPUP_MODE};
113 115

  
114 116
  $form->header(no_layout       => $::form->{POPUP_MODE},
115
                use_javascripts => [ qw(jquery.selectboxes jquery.multiselect2side) ],
117
                use_javascripts => [ qw(follow_up) ],
116 118
  );
117 119
  print $form->parse_html_template('fu/add_edit');
118 120

  
js/follow_up.js
30 30
  //alert(url);
31 31
  window.open(url, "_new_generic", parm);
32 32
}
33

  
34
function follow_up_do_select(target) {
35
  let ids = ($(target).data('ids')+'').split(',');
36
  $('.employee_check').each(function(check_idx, check_elt) {
37
    if (ids.indexOf($(check_elt).val()) !== -1) {
38
      $(check_elt).prop('checked', true);
39
    }
40
  });
41
}
locale/de/all
4448 4448
  'chart_of_accounts'           => 'kontenuebersicht',
4449 4449
  'cleared'                     => 'Abgeglichen',
4450 4450
  'click here to edit cvars'    => 'Klicken Sie hier, um nach benutzerdefinierten Variablen zu suchen',
4451
  'click on a group to add the group\'s users' => 'auf eine Gruppe klicken, um alle Gruppenmitglieder auszuwählen',
4451 4452
  'close'                       => 'schließen',
4452 4453
  'closed'                      => 'geschlossen',
4453 4454
  'companylogo_subtitle'        => 'Lizenziert für',
locale/en/all
4447 4447
  'chart_of_accounts'           => '',
4448 4448
  'cleared'                     => '',
4449 4449
  'click here to edit cvars'    => '',
4450
  'click on a group to add the group\'s users' => '',
4450 4451
  'close'                       => '',
4451 4452
  'closed'                      => '',
4452 4453
  'companylogo_subtitle'        => '',
templates/webpages/customer_vendor/tabs/vcnotes.html
77 77
      <tr>
78 78
        <td valign="right">[% 'Subject' | $T8 %]</td>
79 79

  
80
        <td>
80
        <td colspan="3">
81 81
          [% L.input_tag('note.subject', SELF.note.subject, size = 50) %]
82 82
        </td>
83 83
      </tr>
......
85 85
      <tr>
86 86
        <td valign="right" align="top">[% 'Body' | $T8 %]</td>
87 87

  
88
        <td align="top">
88
        <td align="top" colspan="3">
89 89
          [% L.textarea_tag('note.body', SELF.note.body, cols = 50 rows = 10) %]
90 90
        </td>
91 91
      </tr>
......
93 93
      <tr>
94 94
        <td valign="right">[% 'Follow-Up On' | $T8 %]</td>
95 95

  
96
        <td>
96
        <td colspan="3">
97 97
          [% L.date_tag('note_followup.follow_up_date', SELF.note_followup.follow_up_date) %]
98 98
        <td>
99 99
      </tr>
100 100

  
101 101
      <tr>
102 102
        <td valign="right" align="top">[% 'for' | $T8 %]</td>
103
        <td align="top">
104
          [% L.select_tag(
105
            'note_followup.created_for_employees[]',
106
            SELF.all_employees,
107
            id                => 'note_followup_created_for_employees',
108
            value_key         => 'id',
109
            title_key         => 'safe_name',
110
            default           => SELF.note_followup.created_for_employees,
111
            default_value_key => 'id',
112
            multiple          => 1)
113
          %]
114
          [% L.multiselect2side(
115
            'note_followup_created_for_employees',
116
            labelsx => LxERP.t8('All users'),
117
            labeldx => LxERP.t8('Wiedervorlage für Benutzer'))
118
          %]
119
        </td>
103
<td valign="top">
104
      <table>
105
       <tr class="listheading">
106
       <th>[% L.checkbox_tag('checkall_checkboxes', label='', id='ckeckall', checkall="[data-checkall=1]") %]</th>
107
       <th>[% LxERP.t8('All users') %]</th>
108
       </tr>
109

  
110
       [% FOREACH employee = SELF.all_employees %]
111
        [% SET checked = 0 %]
112
        [% FOREACH cfe = SELF.note_followup.created_for_employees %]
113
         [% IF cfe.id == employee.id %][% SET checked = 1 %][% LAST %][% END %]
114
        [% END %]
115
       <tr class="listrow">
116
         <td>[% L.checkbox_tag('note_followup.created_for_employees[]', value=employee.id, checked=checked, "data-checkall"=1, class="employee_check") %]</td>
117
         <td><label for='created_for_employees[]'>[% HTML.escape(employee.safe_name) %]</label><td>
118
       </tr>
119
        [% END %]
120
      </table>
121
     <td>
122
     <td valign="top">
123
      <table>
124
       <tr class="listheading"><th>[% LxERP.t8('Users that are a member in this group') %] ([% LxERP.t8('Click group to add the group\'s users') %])</th></tr>
125
        [% FOREACH auth_group = SELF.all_auth_groups %]
126
         <tr onclick="follow_up_do_select(this)" data-ids='[% FOREACH employee = auth_group.get_employees %][% employee.id %][% IF !loop.last %],[% END%][% END%]' class="interactive cursor-pointer">
127
          <td class="listrow1"><b>←&nbsp;[% auth_group.name %]</b>: [% auth_group.description %]</td>
128
         </tr>
129
         [% FOREACH employee = auth_group.get_employees %]
130
          <tr class="listrow0"><td>&nbsp;&nbsp;&nbsp;[% employee.safe_name %]</td></tr>
131
         [% END %]
132
        [% END %]
133
      </table>
134
     </td>
120 135
      </tr>
121 136

  
122 137
      <tr>
templates/webpages/fu/add_edit.html
21 21

  
22 22
  <table>
23 23
    <tr>
24
     <td valign="top">[% 'Follow-Up for user' | $T8 %]</td>
25
     <td align="top">
26
      [% L.select_tag(
27
        'created_for_employees[]',
28
        all_employees,
29
        id                => 'created_for_employees',
30
        value_key         => 'id',
31
        title_key         => 'safe_name',
32
        default           => created_for_employees,
33
        default_value_key => 'id',
34
        multiple          => 1)
35
      %]
36
      [% L.multiselect2side(
37
      'created_for_employees',
38
       labelsx => LxERP.t8('All users'),
39
       labeldx => LxERP.t8('Wiedervorlage für Benutzer'))
40
      -%]
24
     <td align="top">[% 'Follow-Up for user' | $T8 %]</td>
25
     <td valign="top">
26
      <table>
27
       <tr class="listheading">
28
       <th>[% L.checkbox_tag('checkall_checkboxes', label='', id='ckeckall', checkall="[data-checkall=1]") %]</th>
29
       <th>[% LxERP.t8('All users') %]</th>
30
       </tr>
31

  
32
       [% FOREACH employee = all_employees %]
33
        [% SET checked = 0 %]
34
        [% FOREACH cfe = created_for_employees %]
35
         [% IF cfe.id == employee.id %][% SET checked = 1 %][% LAST %][% END %]
36
        [% END %]
37
       <tr class="listrow">
38
         <td>[% L.checkbox_tag('created_for_employees[]', value=employee.id, checked=checked, "data-checkall"=1, class="employee_check") %]</td>
39
         <td><label for='created_for_employees[]'>[% HTML.escape(employee.safe_name) %]</label><td>
40
       </tr>
41
        [% END %]
42
      </table>
43
     <td>
44
     <td valign="top">
45
      <table>
46
       <tr class="listheading"><th>[% LxERP.t8('Users that are a member in this group') %] ([% LxERP.t8('Click group to add the group\'s users') %])</th></tr>
47
        [% FOREACH auth_group = all_auth_groups %]
48
         <tr onclick="follow_up_do_select(this)" data-ids='[% FOREACH employee = auth_group.get_employees %][% employee.id %][% IF !loop.last %],[% END%][% END%]' class="interactive cursor-pointer">
49
          <td class="listrow1"><b>←&nbsp;[% auth_group.name %]</b>: [% auth_group.description %]</td>
50
         </tr>
51
         [% FOREACH employee = auth_group.get_employees %]
52
          <tr class="listrow0"><td>&nbsp;&nbsp;&nbsp;[% employee.safe_name %]</td></tr>
53
         [% END %]
54
        [% END %]
55
      </table>
41 56
     </td>
42 57
    </tr>
43 58

  
44 59
    <tr>
45 60
     <td valign="right">[% 'Follow-Up Date' | $T8 %]</td>
46
     <td>
61
     <td colspan="3">
47 62
       [% L.date_tag('follow_up_date', follow_up_date) %]
48 63
    </tr>
49 64

  
50 65
    <tr>
51 66
     <td valign="right">[% 'Subject' | $T8 %]</td>
52
     <td><input name="subject" value="[% HTML.escape(subject) %]" size="50"></td>
67
     <td colspan="3"><input name="subject" value="[% HTML.escape(subject) %]" size="50"></td>
53 68
    </tr>
54 69

  
55 70
    <tr>
56 71
     <td valign="right" align="top">[% 'Body' | $T8 %]</td>
57
     <td align="top"><textarea cols="50" rows="10" name="body">[% HTML.escape(body) %]</textarea></td>
72
     <td colspan="3" align="top"><textarea cols="50" rows="10" name="body">[% HTML.escape(body) %]</textarea></td>
58 73
    </tr>
59 74
  </table>
60 75

  

Auch abrufbar als: Unified diff