Now each jobset input has exactly one value. (Actually, adding multiple values was already broken, so all this does is clean up the UI…)
OK4P3AMKXIBSUNL4ABLFKTK3UBFLINDINBPZVP5OSHLRSV44BICAC
VJFLX7B6DEYXQRS3T5LHOM4POSGMEBQSJJVBHAQV3U4LRPF4KVBAC
F7NHYL4CTCSYTIQYWNQCAFOOGXLLVXHHE4P4E2ZLILV32RY67NIQC
VZX6HJ3I35NVK6L4FP7ASLNAMLMGPAESPQAAYZEUCXYKFUA6HTAQC
GTXYNFUKUWXM5KO2FOJ5RHAMT7GMHABIVMERLA36COZ4ZZ4S2NKQC
Z52T2BC4CTXQGBXPW4VZF5A5W67KDJ65RUBCM7MWHUNPMI6XLQCQC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
ZCTQCN3EQDFYIKRKM3SJIGLTZ6QVKNPCIR3V6CRZ3W4PP2V2YQ2AC
RQI3GRC6NSTPQMBTTOM37ITBZQIROTIGAIPDCVZ672TSEJVECB2AC
UMFB2767NMAG46NAG3XHMYQMCLF5TMVN46SST4AM2CFUEMNZH3WQC
ZFEN2MAOJRRQEIORSK2N6PNAWGBEN2WNAWA6IWUVOHP5I5PQC6JAC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
OOQ2D3KCLFPYNAN253PHWLBQMB6OMO2KYQWQXLTP65SQAYZWQ5LAC
LSZLZHJYGXZTCNH4JUXU7W23MW5PBVM4OBMWRRVNEDROMIBUVQNAC
XJRJ4J7M6BC433TBLWHHKX7UYYCFX6M7ZQLUEYYTREPCSM6M3RDQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
PCKLFRT5IZVLG47GQQ23GBSROKUR4CUEZW4PRVGREHNDFTCZ7VBAC
N45RZUQ6E7XXUPVWMR2SSZZB57ZD236PEMBCCOCAQOUOYFVJDBXQC
2CZSW5S53UW7ACDNT5T3UQNJKFBCXCBYLQ5CL6GVCCOMKBGXZIEQC
GEADFVZ5LXXFIE3VIP4UJ4AEI2VX57DXER47JA4IHH5BG3QNPAEAC
OX6NYJDVCDX2UCJ4QQMTRJVZ535NOMCJGYCHDLCADJPQI7RMCXPQC
2G63HKCHG7S6DGWDOHSDF7PXFPD6H4TRKDKIIFCXXAKET6FCWN2AC
K3HODXGHZ47WWSTEKUFCAPRJYCM564XF6YVE2QM37HPR5RQMFCWQC
2GUW2QBCQZ5YJKKHAYHPVL56V33E6AKWWWGMZFB77VBF36CMUDTAC
TQVKZQUGCFYNH5P56LXMXRXZNTD56MH5T5GX2BMQ5YSRPGHAUYMAC
# Set the values for this input.
my @values = ref($values) eq 'ARRAY' ? @{$values} : ($values);
my $altnr = 0;
foreach my $value (@values) {
$value = checkInputValue($c, $name, $type, $value);
$input->jobsetinputalts->create({altnr => $altnr++, value => $value});
}
$value = checkInputValue($c, $name, $type, $value);
$input->jobsetinputalts->create({altnr => 0, value => $value});
[% BLOCK renderJobsetInputAlt %]
<button type="button" class="btn btn-warning" onclick='$(this).parents(".inputalt").remove()'><i class="icon-trash icon-white"></i></button>
<input type="text" [% HTML.attributes(value => alt.value, name => name) %]/>
<br />
[% END %]
<td class="inputalts" id="[% baseName %]">
[% FOREACH alt IN input.search_related('jobsetinputalts', {}, { order_by => 'altnr' }) %]
<span class="inputalt">
[% INCLUDE renderJobsetInputAlt alt=alt name="$baseName-values" %]
</span>
<td id="[% baseName %]">
[% alt = input.search_related('jobsetinputalts', {altnr => 0}) %]
<input type="text" [% HTML.attributes(value => alt.value, id => "$baseName-value", name => "$baseName-value") %]/>
[% IF input.jobsetinputalts_rs.count > 1 %]
<div class="alert alert-warning">Warning: This input had more
than one value. This is no longer supported. The additional
values have been removed.</div>