View | Details | Raw Unified | Return to bug 8612
Collapse All | Expand All

(-)a/acqui/basket.pl (-1 / +1 lines)
Lines 424-430 if ( $op eq 'list' ) { Link Here
424
        unclosable           => @orders ? $basket->{is_standing} : 1,
424
        unclosable           => @orders ? $basket->{is_standing} : 1,
425
        has_budgets          => $has_budgets,
425
        has_budgets          => $has_budgets,
426
        duplinbatch          => $duplinbatch,
426
        duplinbatch          => $duplinbatch,
427
        csv_profiles         => [ Koha::CsvProfiles->search({ type => 'sql' }) ],
427
        csv_profiles         => [ Koha::CsvProfiles->search({ type => 'export_basket' }) ],
428
    );
428
    );
429
}
429
}
430
430
(-)a/installer/data/mysql/atomicupdate/bug_8612.sql (+1 lines)
Line 0 Link Here
1
UPDATE export_format SET type = 'late_issues' WHERE type ='sql';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt (-15 / +21 lines)
Lines 101-106 function reloadPage(p) { Link Here
101
    [% END %]
101
    [% END %]
102
[% END %]
102
[% END %]
103
103
104
[% BLOCK type_description %]
105
    [% IF type_code == 'marc' %] MARC for export records
106
    [% ELSIF type_code == 'late_issues' %] SQL for late serial issues claims
107
    [% ELSIF type_code == 'export_basket' %] SQL for basket export in acquisition
108
    [% ELSE %] Uknown type
109
    [% END %]
110
[% END %]
111
104
[% IF op == 'add_form' %]
112
[% IF op == 'add_form' %]
105
    [% IF csv_profile %]
113
    [% IF csv_profile %]
106
        <h1>Modify a CSV profile</h1>
114
        <h1>Modify a CSV profile</h1>
Lines 124-135 function reloadPage(p) { Link Here
124
                <li>
132
                <li>
125
                    <label for="type" class="required">Profile type: </label>
133
                    <label for="type" class="required">Profile type: </label>
126
                    <select id="type" name="type">
134
                    <select id="type" name="type">
127
                        [% IF csv_profile.type == 'sql' %]
135
                        [% FOREACH type IN [ 'marc' 'late_issues' 'export_basket'] %]
128
                            <option value="marc">MARC</option>
136
                        [% IF csv_profile.type == type %]
129
                            <option value="sql" selected="selected">SQL</option>
137
                            <option value="[% type %]" selected="selected">[% PROCESS type_description type_code = type %]</option>
130
                        [% ELSE %]
138
                        [% ELSE %]
131
                            <option value="marc" selected="selected">MARC</option>
139
                            <option value="[% type %]">[% PROCESS type_description type_code = type %]</option>
132
                            <option value="sql">SQL</option>
140
                        [% END %]
133
                        [% END %]
141
                        [% END %]
134
                    </select>
142
                    </select>
135
                    <span class="required">Required</span>
143
                    <span class="required">Required</span>
Lines 182-192 function reloadPage(p) { Link Here
182
                </li>
190
                </li>
183
191
184
                <li class="sql_specific">
192
                <li class="sql_specific">
185
                  <label for="sql_content" class="required">Profile SQL fields: </label>
193
                    <label for="late_issues_content" class="required">Profile SQL fields: </label>
186
                  <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea>
194
                    <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea>
187
                  <p>You have to define which fields you want to export, separated by pipes.</p>
195
                    <p>You have to define which fields you want to export, separated by pipes.</p>
188
                  <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.</p>
196
                    <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.</p>
189
                  <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p>
197
                    <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p>
198
                    <p>For late issues claims you can use data from following tables: serial, subscription, biblio, biblioitems and aqbookseller.</p>
199
                    <p>For basket exports you can use data from following tables: biblio, biblioitems, aqorders, aqbudgets and aqbasket.</p>
190
                </li>
200
                </li>
191
            </ol>
201
            </ol>
192
        </fieldset>
202
        </fieldset>
Lines 243-253 function reloadPage(p) { Link Here
243
                    <td>[% csv_profile.description %]</td>
253
                    <td>[% csv_profile.description %]</td>
244
                    <td>[% csv_profile.content %]</td>
254
                    <td>[% csv_profile.content %]</td>
245
                    <td>[% csv_profile.csv_separator %]</td>
255
                    <td>[% csv_profile.csv_separator %]</td>
246
                    [% IF csv_profile.type == 'sql' %]
256
                    <td>[% PROCESS type_description type_code = csv_profile.type %]</td>
247
                        <td>SQL</td>
248
                    [% ELSE %]
249
                        <td>MARC</td>
250
                    [% END %]
251
                    <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=[% csv_profile.export_format_id %]">Edit</a></td>
257
                    <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&amp;export_format_id=[% csv_profile.export_format_id %]">Edit</a></td>
252
                    <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&amp;export_format_id=[% csv_profile.export_format_id %]">Delete</a></td>
258
                    <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&amp;export_format_id=[% csv_profile.export_format_id %]">Delete</a></td>
253
                </tr>
259
                </tr>
(-)a/serials/claims.pl (-1 / +1 lines)
Lines 104-110 $template->param( Link Here
104
        supplierid => $supplierid,
104
        supplierid => $supplierid,
105
        claimletter => $claimletter,
105
        claimletter => $claimletter,
106
        additional_fields_for_subscription => $additional_fields,
106
        additional_fields_for_subscription => $additional_fields,
107
        csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ],
107
        csv_profiles => [ Koha::CsvProfiles->search({ type => 'late_issues' }) ],
108
        letters => $letters,
108
        letters => $letters,
109
        (uc(C4::Context->preference("marcflavour"))) => 1
109
        (uc(C4::Context->preference("marcflavour"))) => 1
110
        );
110
        );
(-)a/t/db_dependent/Acquisition/GetBasketAsCSV.t (-1 / +1 lines)
Lines 36-42 my $budget = C4::Budgets::GetBudget( $budget_id ); Link Here
36
36
37
my $csv_profile = Koha::CsvProfile->new({
37
my $csv_profile = Koha::CsvProfile->new({
38
    profile => 'my user profile',
38
    profile => 'my user profile',
39
    type => 'sql',
39
    type => 'export_basket',
40
    csv_separator => ',',
40
    csv_separator => ',',
41
    content => 'autor=biblio.author|title=biblio.title|quantity=aqorders.quantity',
41
    content => 'autor=biblio.author|title=biblio.title|quantity=aqorders.quantity',
42
})->store;
42
})->store;
(-)a/t/db_dependent/Koha/CsvProfiles.t (-2 / +1 lines)
Lines 35-41 my $nb_of_csv_profiles = Koha::CsvProfiles->search->count; Link Here
35
my $new_csv_profile_1 = Koha::CsvProfile->new({
35
my $new_csv_profile_1 = Koha::CsvProfile->new({
36
    profile => 'my_csv_profile_name_for_test_1',
36
    profile => 'my_csv_profile_name_for_test_1',
37
    description => 'my_csv_profile_description_for_test_1',
37
    description => 'my_csv_profile_description_for_test_1',
38
    type => 'sql'
38
    type => 'late_issues'
39
})->store;
39
})->store;
40
my $new_csv_profile_2 = Koha::CsvProfile->new({
40
my $new_csv_profile_2 = Koha::CsvProfile->new({
41
    profile => 'my_csv_profile_name_for_test_2',
41
    profile => 'my_csv_profile_name_for_test_2',
42
- 

Return to bug 8612