11 <& /util/import_javascript.mas, classes => [ 'jqueryui.js', 'jquery.js'] &>
13 <div class="modal fade" id="generate_identifier_barcode_dialog" name="generate_identifier_barcode_dialog" tabindex="-1" role="dialog" aria-labelledby="generateIdentifierBarcodeDialog">
14 <div class="modal-dialog modal-lg" role="document">
15 <div class="modal-content">
16 <div class="modal-header" style="text-align: center">
17 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
18 <h4 class="modal-title" id="generateIdentifierBarcodeDialog">Generate Identifier Barcode</h4>
20 <div class="modal-body">
21 <div class="container-fluid">
23 <button type="button" class="btn btn-primary" name="design_custom_barcode" id="design_custom_barcode">Design Custom Barcodes Using a List</button>
25 <p id = "barcode_dialog_subtitle2">
26 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
28 <div class="well well-sm">
30 <div class="col-md-1 col-lg-1">
32 <div class="col-md-10 col-lg-10">
34 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/identifier/download/pdf?order_id=<%$order_id%>" >
35 % } elsif ($trial_id) {
36 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/identifier/download/pdf?trial_id=<%$trial_id%>" >
38 <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/identifier/download/pdf?user_id=<%$user_id%>" >
40 <div class="form-group" form-group-sm id="order_id_section" style="display: none">
41 <label class="col-sm-4 control-label" for="tracking_order_id">Order ID: </label>
42 <div class="col-sm-8 ">
43 <div class="input-group">
44 <input class="form-control col-sm-8" id="tracking_order_id" type="text" value="<%$order_id%>" disabled/>
48 <div class="form-group form-group-sm" >
49 <label class="col-sm-4 control-label">List of Identifiers: </label>
50 <div class="col-sm-8" id="item_list">
53 <div class="form-group form-group-sm">
54 <label class="col-sm-4 control-label">Barcode Type: </label>
55 <div class="col-sm-8">
56 <select class="form-control" id="select_barcode_type" name="select_barcode_type">
57 <option value="2D">2D Barcode</option>
58 <option value="1D">1D Barcode</option>
62 <div id="2D_fieldbook_option" >
63 <div class="form-group form-group-sm" >
64 <label class="col-sm-4 control-label">Enable 2D Barcode For FieldBook: </label>
65 <div class="col-sm-8">
66 <input type="checkbox" id="enable_fieldbook_2d_barcode" name="enable_fieldbook_2d_barcode" value="enable_fieldbook_2d_barcode" checked/>
71 <script defer="defer">
72 jQuery(document).ready(function() {
74 jQuery(document).on('change', '#select_barcode_type', function () {
75 var barcode_type = jQuery("#select_barcode_type").val();
76 if (barcode_type == "2D") {
77 jQuery("#2D_fieldbook_option").show();
78 } else if (barcode_type == "1D") {
79 jQuery("#2D_fieldbook_option").hide();
83 jQuery('#custom_barcode_trial_link').click(function () {
84 location.href = '/tools/label_designer';
87 jQuery(document).on('change', '#select_print_format', function () {
88 var format = jQuery("#select_print_format").val();
89 if (format == "32A4") {
93 var lefts_margin = 17;
94 var bottoms_margin = 12;
95 var rights_margin = 10;
97 if (format == "32_unique") {
100 var tops_margin = 12;
101 var lefts_margin = 17;
102 var bottoms_margin = 12;
103 var rights_margin = 10;
105 else if (format == "CASS") {
108 var tops_margin = 10;
109 var lefts_margin = 112;
110 var bottoms_margin = 13;
111 var rights_margin = 20;
113 else if (format == "MUSA") {
116 var tops_margin = 10;
117 var lefts_margin = 112;
118 var bottoms_margin = 13;
119 var rights_margin = 20;
121 else if (format == "NCSU") {
124 var tops_margin = 12;
125 var lefts_margin = 10;
126 var bottoms_margin = 12;
127 var rights_margin = 10;
128 var text = 'year,location';
130 else if (format == "20A4") {
133 var tops_margin = 12;
134 var lefts_margin = 10;
135 var bottoms_margin = 12;
136 var rights_margin = 10;
138 else if (format == "IITA-3") {
141 var tops_margin = 13;
142 var lefts_margin = 130;
143 var bottoms_margin = 11;
144 var rights_margin = 10;
146 else if (format == "IITA-2") {
149 var tops_margin = 13;
150 var lefts_margin = 130;
151 var bottoms_margin = 11;
152 var rights_margin = 10;
154 else if (format == "crossing") {
158 var lefts_margin = 2;
159 var bottoms_margin = 0;
160 var rights_margin = 0;
162 jQuery("#text_margin").empty();
163 jQuery("#text_margin").val(text);
164 jQuery("#label_rows").empty();
165 jQuery("#label_rows").val(labels_row);
166 jQuery("#label_cols").empty();
167 jQuery("#label_cols").val(labels_cols);
168 jQuery("#select_barcode_type").prop('selectedIndex',1);
169 jQuery("#page_format").prop('selectedIndex',0);
170 jQuery("#tops_margin").empty();
171 jQuery("#tops_margin").val(tops_margin);
172 jQuery("#left_margin").empty();
173 jQuery("#left_margin").val(lefts_margin);
174 jQuery("#bottom_margin").empty();
175 jQuery("#bottom_margin").val(bottoms_margin);
176 jQuery("#right_margin").empty();
177 jQuery("#right_margin").val(rights_margin);
182 <div class="form-group form-group-sm">
183 <label class="col-sm-4 control-label">Printing Format (Optional): </label>
184 <div class="col-sm-8">
185 <select class="form-control" id="select_print_format" name="select_print_format">
186 <!--<option selected disabled>select printing format</option>-->
187 <option value="">select printing format</option>
188 <option value="CASS">CASS printing format</option>
189 <option value="MUSA">MUSA printing format</option>
190 <option value="32A4">32 label Size Sticker Paper</option>
191 <option value="32_unique">32 Unique label Size Sticker Paper</option>
192 <option value="20A4">20 label Size Sticker Paper</option>
193 <option value="IITA-3">IITA-3-barcode</option>
194 <option value="IITA-2">IITA-2-barcode</option>
198 <div class="form-group form-group-sm" style="display: none">
199 <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
200 <div class="col-sm-8">
201 <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
206 <div class="col-md-1 col-lg-1">
210 <& /barcode/printer_settings.mas &>
214 <div class="modal-footer">
215 <button class="btn btn-primary type="submit" type="submit" value="Download Barcodes">Download Barcodes</button>
216 <button id="trial_barcode_dialog_ok_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
226 jQuery(document).ready(function () {
227 var project_id = "<%$trial_id%>";
228 var dialog_subtitle = '';
229 var dialog_subtitle2 = '';
230 var barcode_button_label = '';
232 jQuery('#barcode_dialog_subtitle').text(dialog_subtitle);
234 jQuery('#generate_item_barcode_button').click(function() {
235 jQuery('#generate_identifier_barcode_dialog').modal("show");
236 jQuery('#barcode_dialog_subtitle2').text('Generate barcodes for requested items');
239 url:'/ajax/order/order_tracking_ids',
240 data:{'order_id': "<% $order_id %>" },
241 success: function(response){
242 var order_item_html = '<textarea class="form-control" id="identifier_names" name="identifier_names" >';
244 for (i=0; i<response.tracking_info.length; i++) {
245 order_item_html = order_item_html + response.tracking_info[i][0] + "\n";
247 order_item_html = order_item_html + "</textarea>";
248 jQuery('#item_list').empty();
249 jQuery('#item_list').html(order_item_html);
252 error: function(response){
253 alert("Error retrieving requested item info.");
258 jQuery('#generate_active_item_barcode_button').click(function() {
259 jQuery('#generate_identifier_barcode_dialog').modal("show");
260 jQuery('#barcode_dialog_subtitle2').text('Generate barcodes for requested items');
263 url:'/ajax/order/active_order_tracking_ids',
264 success: function(response){
265 console.log(response);
266 var order_item_html = '<textarea class="form-control" id="identifier_names" name="identifier_names" >';
268 for (i=0; i<response.tracking_info.length; i++) {
269 order_item_html = order_item_html + response.tracking_info[i][0] + "\n";
271 order_item_html = order_item_html + "</textarea>";
272 jQuery('#item_list').empty();
273 jQuery('#item_list').html(order_item_html);
276 error: function(response){
277 alert("Error retrieving requested item info.");
282 jQuery('#generate_barcodes_project_page').click(function() {
283 jQuery('#generate_identifier_barcode_dialog').modal("show");
284 jQuery('#barcode_dialog_subtitle2').text('Generate barcodes for active tracking identifiers');
287 url:'/ajax/tracking_activity/project_active_identifier_names/'+project_id,
289 success: function(response){
290 console.log(response);
291 var order_item_html = '<textarea class="form-control" id="identifier_names" name="identifier_names" >';
293 for (i=0; i<response.data.length; i++) {
294 order_item_html = order_item_html + response.data[i] + "\n";
296 order_item_html = order_item_html + "</textarea>";
297 jQuery('#item_list').empty();
298 jQuery('#item_list').html(order_item_html);
301 error: function(response){
302 alert("Error retrieving requested item info.");
307 jQuery('#design_custom_barcode').click(function () {
308 location.href = '/tools/label_designer';