11 <& /page/page_title.mas, title=>"Available Seedlots" &>
19 <& /util/import_javascript.mas, classes => [ 'bootstrap_min.js', 'jquery.iframe-post-form','CXGN.List','CXGN.BreedersToolbox.Accessions', 'CXGN.BreedersToolbox.UploadPedigrees', 'jquery', 'jquery.dataTables', 'CXGN.BreedersToolbox.Crosses' ] &>
22 <&| /page/info_section.mas, title=>"About Seedlots", collapsible => 1, collapsed=>1 &>
23 <div class="well well-sm">
24 <div class="panel panel-default">
25 <div class="panel-body">
26 <b><p>What are seedlots?</p></b>
28 <li>Seedlots represent physical seed in packets.</li>
29 <li>This seed can be from crosses or for named accessions.</li>
30 <li>Seedlots can have a specific location, box, weight(g), and count.</li>
31 <li>Seed can be transferred into and out of a seedlot. Such as from a seedlot into a plot.</li>
32 <li>Seedlots can belong to breeding programs and organizations.</li>
35 <b><p>How do I inventory my seed?</p></b>
37 <li>1) Make sure your seedlots are in the database. Use "Add New Seedlot" to add a single seedlot or "Upload New Seedlots" to add many.</li>
38 <li>2) Make sure your seedlots are barcoded. You can print these barcodes from the database.</li>
39 <li>3) Use the "Seed Inventory" Android Application to scan seedlot barcodes and record weight. Then click "Upload Inventory" on the Manage Seedlots page to upload this info into the database. If you do not want to use the Seed Inventory Android Application you can create your own CSV file and upload that.</li>
40 <li><b>For more info about the "Seed Inventory" Android Application go to <a href="http://www.wheatgenetics.org/research/software/35-inventory">Seed Inventory</a>.</b></li>
41 <li>It is also possible to manually enter a transaction by going to the seedlot detail page and clicking "Add New Transaction".</li>
49 <&| /page/info_section.mas, title=>"Seedlots", collapsible => 1, subtitle => '[<a name="add_seedlot_button">Add New Seedlot</a>] [<a name="seedlot_bulk_upload">Upload Seedlots</a>] [<a id="seedlot_upload_inventory">Upload Inventory</a>]'&>
53 <div class="well well-sm">
54 <div class="panel panel-default">
55 <div class="panel-body">
57 <&| /page/info_section.mas, title=>"Search Seedlots", collapsible => 1, collapsed=>0 &>
59 <div class="well well-sm">
60 <form class="form-horizontal" id="search_seedlot_form" name="search_seedlot_form">
61 <div class="form-group form-group-sm">
62 <label class="col-sm-3 control-label">Seedlot Name: </label>
63 <div class="col-sm-9" >
64 <input class="form-control" id="search_seedlot_form_seedlot_name" type="text" />
67 <div class="form-group form-group-sm">
68 <label class="col-sm-3 control-label">Breeding Program: </label>
69 <div class="col-sm-9" >
70 <input class="form-control" id="search_seedlot_form_breeding_program" type="text" />
73 <div class="form-group form-group-sm">
74 <label class="col-sm-3 control-label">Contents (Accession Uniquename): </label>
75 <div class="col-sm-9" >
76 <input class="form-control" id="search_seedlot_form_contents_accession" type="text" />
79 <div class="form-group form-group-sm">
80 <label class="col-sm-3 control-label">Contents (Cross Uniquename): </label>
81 <div class="col-sm-9" >
82 <input class="form-control" id="search_seedlot_form_contents_cross" type="text" />
85 <div class="form-group form-group-sm">
86 <label class="col-sm-3 control-label">Location: </label>
87 <div class="col-sm-9" >
88 <input class="form-control" id="search_seedlot_form_location" type="text" />
91 <div class="form-group form-group-sm">
92 <label class="col-sm-3 control-label">Minimum Count: </label>
93 <div class="col-sm-9" >
94 <input class="form-control" id="search_seedlot_form_minimum_count" type="number" />
99 <button class="btn btn-primary" id="submit_seedlot_search" />Search</button>
106 <table id="available_seedlots_table" class="table table-hover table-striped table-bordered">
111 <div id="available_seedlots_to_list" style="display:none">
113 <div id="available_seedlots_add_to_list">
121 <& /breeders_toolbox/upload_seedlots_dialogs.mas &>
122 <& /breeders_toolbox/upload_seedlots_inventory_dialogs.mas &>
123 <& /breeders_toolbox/add_seedlot_dialogs.mas, timestamp=>$timestamp &>
124 <& /breeders_toolbox/add_accessions_dialogs.mas, preferred_species=>$preferred_species, editable_stock_props=>$editable_stock_props &>
125 <& /breeders_toolbox/upload_crosses_dialogs.mas, programs=>$programs, locations=>$locations, crossing_trials=>$crossing_trials &>
126 <& /breeders_toolbox/add_cross_dialogs.mas, programs=>$programs, locations=>$locations, crossing_trials=>$crossing_trials &>
129 jQuery(document).ready(function(){
131 var seedlots_table = jQuery('#available_seedlots_table').DataTable({
136 'lengthMenu': [10,20,50,100,1000],
137 'ajax': { 'url': '/ajax/breeders/seedlots',
138 'data': function(d) {
139 d.seedlot_name = jQuery('#search_seedlot_form_seedlot_name').val();
140 d.breeding_program = jQuery('#search_seedlot_form_breeding_program').val();
141 d.minimum_count = jQuery('#search_seedlot_form_minimum_count').val();
142 d.location = jQuery('#search_seedlot_form_location').val();
143 d.contents_accession = jQuery('#search_seedlot_form_contents_accession').val();
144 d.contents_cross = jQuery('#search_seedlot_form_contents_cross').val();
148 { title: "Seedlot Name", "data": null, "render": function ( data, type, row ) { return "<a href='/breeders/seedlot/"+row.seedlot_stock_id+"'>"+row.seedlot_stock_uniquename+"</a>"; } },
149 { title: "Breeding Program", "data": "breeding_program_name" },
150 { title: "Contents", "data": "contents_html" },
151 { title: "Location", "data": "location" },
152 { title: "Count", "data": "count" },
153 { title: "Weight (g)", "data": "weight_gram" },
154 { title: "Owners", "data": "owners_string" },
155 { title: "Organization", "data": "organization" },
156 { title: "Box", "data": "box" },
157 { title: "Delete", "data": "null", "render": function ( data, type, row ) { return "<a onclick='removeSeedlot("+row.seedlot_stock_id+")' >X</a>"; } },
159 "fnInitComplete": function(oSettings, json) {
162 jQuery('#available_seedlots_add_to_list').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
165 for(var i=0; i<json.data.length; i++){
166 html += json.data[i].seedlot_stock_uniquename+"\n";
168 jQuery("#available_seedlots_to_list").html(html);
169 addToListMenu("available_seedlots_add_to_list", "available_seedlots_to_list", {
171 listType: 'seedlots',
178 jQuery('#submit_seedlot_search').click( function() {
179 seedlots_table.search("available_seedlots_table").draw();
182 jQuery('#search_seedlot_form').keypress( function( e ) {
183 var code = e.keyCode || e.which;
185 jQuery('#submit_seedlot_search').click();
191 function removeSeedlot(seedlot_stock_id){
192 if (confirm("Are you sure you want to delete this seedlot?")){
194 url: '/ajax/breeders/seedlot/'+seedlot_stock_id+'/delete',
195 beforeSend: function(){
196 jQuery('#working_modal').modal('show');
198 success: function(response) {
199 jQuery('#working_modal').modal('hide');
200 if (response.success == 1) {
201 alert("The seedlot has been deleted.");
204 if (response.error) {
205 alert(response.error);
208 error: function(response){
209 jQuery('#working_modal').modal('hide');
210 alert('An error occurred deleting seed lot');