A new syspref (SubscriptionDuplicateDroppedInput) contains the list of fields to
duplicate when duplicating a subscription. The library will be able to
define that, for example, the internal note should not be duplicated
Test plan:
On the detail subscription page, click Edit > Edit as New (Duplicate):
All the information must be copied from the original subscription.
Fill the syspref SubscriptionDuplicateDroppedInput with a list of fields
you don't want to be duplicated (e.g. location;notes;branchcode).
Repeat the duplicate action. Normally, information for these fields are
not copied.
Signed-off-by: Kristina D.C. Hoeppner <kristina@catalyst.net.nz>
SetVersion($DBversion);
}
+
+
+$DBversion = "3.07.00.XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by semicolon)','Free')");
+ print "Upgrade to $DBversion done (Add System Preferences SubscriptionDuplicateDroppedInput)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)
simplified: a summary
full: a full list
- of the serial issues.
+ -
+ - List of fields which must not be rewritten when a subscription is duplicated (Separated by semicolon)
+ - pref: SubscriptionDuplicateDroppedInput
$('#numberpattern').change( function() {
reset_num_pattern();
});
+
+ var node;
+ [% FOREACH field IN dont_export_field_loop %]
+ node = $("#[% field.fieldid %]");
+ if ( $(node).is('input') || $(node).is('textarea') ) {
+ $(node).val("");
+ } else if ( $(node).is('select') ) {
+ $(node).find("option:first").attr('selected','selected');
+ }
+ [% END %]
});
//]]>
</script>
[% IF ( subtype_numberlength ) %]<option value="numberlength" selected="selected">[% ELSE %]<option value="numberlength">[% END %] Number of issues</option>
[% IF ( subtype_weeklength ) %]<option value="weeklength" selected="selected">[% ELSE %]<option value="weeklength">[% END %] Number of weeks</option>
</select>
- <input type="text" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
+ <input type="text" id="numberlength" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
<span class="required">Required</span>
</li>
<li>
firstacquiyear => substr($firstissuedate,0,4),
);
}
+
+ if ( $op eq 'dup' ) {
+ my $dont_copy_fields = C4::Context->preference('SubscriptionDuplicateDroppedInput');
+ my @fields_id = map { fieldid => $_ }, split ';', $dont_copy_fields;
+ $template->param( dont_export_field_loop => \@fields_id );
+ }
}
my $onlymine=C4::Context->preference('IndependantBranches') &&