Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cd7041fc

Von Tamino Steinert vor 7 Monaten hinzugefügt

  • ID cd7041fcf977940ea5f3e8f7d759c6e071bf5123
  • Vorgänger 66376ef2
  • Nachfolger 43749680

EmailJournal: Workflow: Auswahl von Beleg optimiert

Unterschiede anzeigen:

templates/design40_webpages/email_journal/show.html
6 6

  
7 7
<h1>[% FORM.title %]</h1>
8 8

  
9
<form>
10

  
9 11
[% INCLUDE 'common/flash.html' %]
10 12

  
11
<form>
12
<div class="tabwidget" id="email_tabs">
13
  <ul>
14
    <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
15
    <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=EmailJournal&object_id=[% HTML.url(SELF.entry.id) %]">[% 'Linked Records' | $T8 %]</a></li>
16
  </ul>
17

  
18
[% PROCESS "email_journal/tabs/basic_data.html" %]
19
</div> <!-- /.tabwidget -->
13
  <div class="tabwidget" id="email_tabs">
14
    <ul>
15
      <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
16
      <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=EmailJournal&object_id=[% HTML.url(SELF.entry.id) %]">[% 'Linked Records' | $T8 %]</a></li>
17
    </ul>
18

  
19
    [% PROCESS "email_journal/tabs/basic_data.html" %]
20
  </div> <!-- /.tabwidget -->
20 21
</form>
21 22

  
22 23
<div class="wrapper" id="wrapper-0">
23 24

  
24 25
[% SET attachments = SELF.entry.attachments_sorted %]
25 26

  
26
<div class="wrapper input-panel" style="vertical-align:top;" id="wrapper-2">
27

  
28 27
[% IF attachments.size %]
29
<table id="email_journal_details" class="tbl-list">
30
  <caption>[% 'Attachments' | $T8 %]</caption>
31
  <thead>
32
    <tr>
33
      <th>[% 'Attachment name' | $T8 %]</th>
34
      <th>[% 'MIME type' | $T8 %]</th>
35
      <th>[% 'Size' | $T8 %]</th>
36
    </tr>
37
  </thead>
38
  <tbody>
39
    [% FOREACH attachment = attachments %]
40
    <tr>
41
      <td>[% L.link(SELF.url_for(action="download_attachment", id=attachment.id), attachment.name) %]</td>
42
      <td>[% HTML.escape(attachment.mime_type) %]</td>
43
      <td>[% HTML.escape(LxERP.format_amount(attachment.content.length, 0)) %]</td>
44
    </tr>
45
    [% END %]
46
  </tbody>
47
</table>
28
<div class="wrapper input-panel">
29
  <table id="email_journal_details" class="tbl-list">
30
    <caption>[% 'Attachments' | $T8 %]</caption>
31
    <thead>
32
      <tr>
33
        <th>[% 'Attachment name' | $T8 %]</th>
34
        <th>[% 'MIME type' | $T8 %]</th>
35
        <th>[% 'Size' | $T8 %]</th>
36
      </tr>
37
    </thead>
38
    <tbody>
39
      [% FOREACH attachment = attachments %]
40
      <tr>
41
        <td>[% L.link(SELF.url_for(action="download_attachment", id=attachment.id), attachment.name) %]</td>
42
        <td>[% HTML.escape(attachment.mime_type) %]</td>
43
        <td>[% HTML.escape(LxERP.format_amount(attachment.content.length, 0)) %]</td>
44
      </tr>
45
      [% END %]
46
    </tbody>
47
  </table>
48
</div>
48 49
[% END %]
49 50

  
50 51
[% IF SELF.entry.status == 'imported' || SELF.entry.status == 'record_imported' %]
51
<form method="post" action="controller.pl" id="record_action_form">
52
  [% L.hidden_tag('email_journal_id', SELF.entry.id) %]
53

  
54
  <div id="action_div" class="input-panel">
55

  
56
    <div class="col">
57
    [% L.select_tag('attachment_id',
58
         attachments, value_key='id', title_key='name',
59
         default = attachments.0.id,
60
         with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
61
         'data-title'=LxERP.t8("Attachment"), class="wi-normal",
62
         onchange='kivi.EmailJournal.update_attachment_preview();'
63
         )
64
      %]
65
    </div>
66

  
67
    <div id="customer_vendor_div" class="col">
68
    [% L.select_tag('customer_vendor_selection',
69
       [
70
         {value => "customer", name => LxERP.t8("Sales")},
71
         {value => "vendor",   name => LxERP.t8("Purchase")},
72
       ],
73
       default = CV_TYPE_FOUND,
74
       value_key='value', title_key='name',
75
       class="wi-verysmall",
76
       onchange='kivi.EmailJournal.update_customer_vendor_selection();'
77
       ) %]
78
    </div>
79
    [% FOREACH cv_option = [
80
         ['customer', 'Customer', 1],
81
         ['vendor',   'Vendor',   0],
82
         ] %]
83
    [% SET cv_type        = cv_option.0 %]
84
    [% SET cv_name        = cv_option.1 %]
85
    [% SET cv_is_cusotmer = cv_option.2 %]
86
    <div
87
      id="[% cv_type _ "_div" %]" class="col"
88
      style=[% IF cv_type == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
89
      >
90
      [% P.customer_vendor.picker(
91
           cv_type _ "_id",
92
           CUSTOMER_VENDOR.is_customer == cv_is_cusotmer ? CUSTOMER_VENDOR : undef,
93
           type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
94
           onchange='kivi.EmailJournal.update_record_list();'
95
           ) %]
96
    </div>
97
    [% END %]
98

  
99
    <div id="action_div" class="col">
100
    [% L.select_tag('action_selection',
101
       [
102
         {value => "workflow",   name => LxERP.t8("Create from Workflow")},
103
         {value => "linking",    name => LxERP.t8("Linking to Record")},
104
         {value => "create_new", name => LxERP.t8("Create new")},
105
       ],
106
       value_key='value', title_key='name',
107
       class="wi-normal",
108
       onchange='kivi.EmailJournal.update_action_selection();'
109
       ) %]
110
    </div>
111

  
112
    [% FOREACH customer_vendor = ['customer', 'vendor'] %]
113
    <div id="[% customer_vendor _ "_record_types_div" %]" class="col"
114
      style=[% IF customer_vendor == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
115
      >
52
<div class="wrapper input-panel control-panel" style="display:block">
53
  <form method="post" action="controller.pl" id="record_action_form">
54
    [% L.hidden_tag('email_journal_id', SELF.entry.id) %]
55
    <h2>[% LxERP.t8("Email-Workflow") %]</h2>
56

  
57
    <div id="action_div"><div class="input-panel" style="margin:0">
58

  
59
      <div class="col">
60
      [% L.select_tag('attachment_id',
61
           attachments, value_key='id', title_key='name',
62
           default = attachments.0.id,
63
           with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
64
           'data-title'=LxERP.t8("Attachment"), class="wi-normal",
65
           onchange='kivi.EmailJournal.update_attachment_preview();'
66
           )
67
        %]
68
      </div>
116 69

  
117
      [%
118
        SET options = [];
119
        FOREACH record_info = RECORD_TYPES_WITH_INFO;
120
          IF (record_info.customervendor == customer_vendor);
121
            options.push({value => record_info.record_type, name => record_info.text});
122
          END;
123
        END;
124
      %]
125
    [% L.select_tag(customer_vendor _ '_record_type_selection',
126
       options,
127
       value_key='value', title_key='name',
128
       with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
129
       class="wi-normal",
130
       onchange='kivi.EmailJournal.update_record_list();'
131
       ) %]
132
    </div>
133
    [% END %]
134
    <div id="record_number_div" class="col">
135
      [% L.input_tag('record_number', '',
136
         class="wi-normal", placeholder=LxERP.t8("Record number")
137
         onchange='kivi.EmailJournal.update_record_list();'
70
      <div id="action_div" class="col">
71
      [% L.select_tag('action_selection',
72
         [
73
           {value => "workflow",   name => LxERP.t8("Create from Workflow")},
74
           {value => "linking",    name => LxERP.t8("Linking to Record")},
75
           {value => "create_new", name => LxERP.t8("Create new")},
76
         ],
77
         value_key='value', title_key='name',
78
         class="wi-normal",
79
         onchange='kivi.EmailJournal.update_action_selection();'
138 80
         ) %]
139
    </div>
81
      </div>
140 82

  
141
    <div id="with_closed_div" class="col">
142
      [% L.select_tag('with_closed',
83
      <div id="customer_vendor_div" class="col">
84
      [% L.select_tag('customer_vendor_selection',
143 85
         [
144
           {value => "1", name => LxERP.t8("With closed")},
145
           {value => "0", name => LxERP.t8("Only open")},
86
           {value => "customer", name => LxERP.t8("Sales")},
87
           {value => "vendor",   name => LxERP.t8("Purchase")},
146 88
         ],
147
         default = 0, value_key='value', title_key='name',
148
         class="wi-small",
149
         onchange='kivi.EmailJournal.update_record_list();'
89
         default = CV_TYPE_FOUND,
90
         value_key='value', title_key='name',
91
         class="wi-verysmall",
92
         onchange='kivi.EmailJournal.update_customer_vendor_selection();'
150 93
         ) %]
151
    </div>
94
      </div>
152 95

  
96
      [% FOREACH customer_vendor = ['customer', 'vendor'] %]
97
      <div id="[% customer_vendor _ "_record_types_div" %]" class="col"
98
        style=[% IF customer_vendor == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
99
        >
100

  
101
        [%
102
          SET options = [];
103
          FOREACH record_info = RECORD_TYPES_WITH_INFO;
104
            IF (record_info.customervendor == customer_vendor);
105
              options.push({value => record_info.record_type, name => record_info.text});
106
            END;
107
          END;
108
        %]
109
      [% L.select_tag(customer_vendor _ '_record_type_selection',
110
         options,
111
         value_key='value', title_key='name',
112
         with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
113
         onchange='kivi.EmailJournal.update_record_list();'
114
         ) %]
115
      </div>
116
      [% END %]
117
    </div></div> <!-- action_div -->
118

  
119
    <div id="record_selection_div">
120
      <div id="filter_div"><div class="input-panel" style="margin:0">
121
        [% FOREACH cv_option = [
122
             ['customer', 'Customer', 1],
123
             ['vendor',   'Vendor',   0],
124
             ] %]
125
        [% SET cv_type        = cv_option.0 %]
126
        [% SET cv_name        = cv_option.1 %]
127
        [% SET cv_is_cusotmer = cv_option.2 %]
128
        <div
129
          id="[% cv_type _ "_div" %]" class="col"
130
          style=[% IF cv_type == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
131
          >
132
          [% P.customer_vendor.picker(
133
               cv_type _ "_id",
134
               CUSTOMER_VENDOR.is_customer == cv_is_cusotmer ? CUSTOMER_VENDOR : undef,
135
               type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
136
               onchange='kivi.EmailJournal.update_record_list();'
137
               ) %]
138
        </div>
139
        [% END %]
153 140

  
154
    <div class="col">
155
      [% L.button_tag('kivi.EmailJournal.apply_action_with_attachment();', LxERP.t8('Apply with Attachment')) %]
156
    </div>
157
  </div> <!-- action_div -->
141
        <div id="record_number_div" class="col">
142
          [% L.input_tag('record_number', '',
143
             class="wi-normal", placeholder=LxERP.t8("Record number")
144
             onchange='kivi.EmailJournal.update_record_list();'
145
             ) %]
146
        </div>
147

  
148
        <div id="with_closed_div" class="col">
149
          [% L.select_tag('with_closed',
150
             [
151
               {value => "1", name => LxERP.t8("With closed")},
152
               {value => "0", name => LxERP.t8("Only open")},
153
             ],
154
             default = 0, value_key='value', title_key='name',
155
             class="wi-small",
156
             onchange='kivi.EmailJournal.update_record_list();'
157
             ) %]
158
        </div>
159
      </div></div> <!-- filter_div -->
158 160

  
159
  [% BLOCK panel_1 %]
160 161
      <div id="record_div">
161
        <div id="record_list">
162
        [% FOREACH record = RECORDS %]
163
          <div id="record_[% record.id %]">
164
            [% L.radio_button_tag('record_type_id', class="record_radio",
165
                value=record.record_type _ '-' _ record.id,
166
                label_class="record_radio", label=record.displayable_name) %]
162
        [% SET show_records = (RECORDS.size < 20);
163
           IF show_records;
164
             SET display_toggle_off = 'style="display:none;"' ;
165
             SET display_toggle_on  = 'style="display:block;"' ;
166
           ELSE ;
167
             SET display_toggle_off = 'style="display:block;"' ;
168
             SET display_toggle_on  = 'style="display:none;"' ;
169
           END ;
170
        %]
171
        <div id="record_toggle_closed"
172
          class="record_toggle toggle_panel control-panel" [% display_toggle_off %]>
173
          <a href="#" onClick='javascript:$(".record_toggle").toggle()'
174
             class="button toggle off neutral">
175
            [% LxERP.t8('Show Records') %]
176
          </a>
177
        </div><!-- /.record_toggle -->
178

  
179
        <div id="record_toggle_open"
180
          class="record_toggle toggle_panel control-panel" [% display_toggle_on %]>
181
          <a href="#" onClick='javascript:$(".record_toggle").toggle()'
182
             class="button toggle on neutral with-panel">
183
            [% LxERP.t8('Hide Records') %]
184
          </a>
185
          <div class="toggle_panel_block">
186
            <div id="record_list">
187
            [% FOREACH record = RECORDS %]
188
              [% L.button_tag(
189
                  'kivi.EmailJournal.apply_action_with_attachment("'
190
                  _ record.id _ '", "' _ record.record_type
191
                  _ '");',
192
                  record.displayable_name,
193
                  class="record_button"
194
                ) %]
195
            [% END %]
196
            [% IF RECORDS.size == 0 %]
197
              <h3> [% LxERP.t8("No records found.") %] </h3>
198
            [% END %]
199
            </div>
167 200
          </div>
168
        [% END %]
169
        [% IF RECORDS.size == 0 %]
170
          <div id="no_record_div">
171
            <h3> [% LxERP.t8("No records found.") %] </h3>
172
          </div>
173
        [% END %]
174
      </div>
175
    </div>
176
    <div id="no_record_div" class="col" style="display:none">
177
      <h3> [% LxERP.t8("No record needed.") %] </h3>
201
        </div><!-- /.record_toggle -->
202
      </div><!-- record_div -->
203
    </div><!-- record_selection_div -->
204
    <div id="create_new_div" class="input-panel" style="display:none;min-width:0;margin:0">
205
        [% L.button_tag('kivi.EmailJournal.apply_action_with_attachment();',
206
          LxERP.t8('Apply with Attachment')) %]
178 207
    </div>
179
  [% END %]
180
  [% SET display_status = (RECORDS.size > 20 ? 'closed' : 'open');
181
     INCLUDE 'common/toggle_panel.html'
182
      block_name='panel_1'
183
      button_closed  = LxERP.t8('Show Records')
184
      button_open    = LxERP.t8('Hide Records')
185
      ;
186
  %]
187
</form>
188 208

  
189
<!-- kivi.EmailJournal.update_attachment_preview -->
190
<div id="attachment_preview"></div>
209
  </form>
210

  
211
  <!-- kivi.EmailJournal.update_attachment_preview -->
212
  <div class="wrapper" style="overflow:auto"><div id="attachment_preview"></div></div>
213

  
214
</div>
191 215
[% END %]
192
</div> <!-- wrapper-2 -->
193 216

  
194 217
</div> <!-- wrapper-0 -->
218

  
219
<script type="text/javascript">
220
  $(document).ready(function() {
221
    kivi.EmailJournal.update_action_selection();
222
    kivi.EmailJournal.update_customer_vendor_selection();
223
    kivi.EmailJournal.update_record_list();
224
    kivi.EmailJournal.update_attachment_preview();
225
  });
226
</script>

Auch abrufbar als: Unified diff