From 2bd9cd80e6bc1a41f52dfb8cbd2f75b332a29b96 Mon Sep 17 00:00:00 2001 From: teravest Date: Fri, 14 Feb 2014 15:37:04 -0700 Subject: [PATCH 01/16] separatating barcode edits --- python_code/data_access/qiime_data_access.py | 20 +++++ www/wwwadmin/edit_barcode.psp | 79 ++++++++++++++++++++ www/wwwadmin/header.psp | 16 +++- 3 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 www/wwwadmin/edit_barcode.psp diff --git a/python_code/data_access/qiime_data_access.py b/python_code/data_access/qiime_data_access.py index 2c638321..77ebf169 100755 --- a/python_code/data_access/qiime_data_access.py +++ b/python_code/data_access/qiime_data_access.py @@ -2999,3 +2999,23 @@ def getProjectNames(self): projnames = [row[0] for row in result] return projnames + def getBarcodeDetails(self, barcode): + """returns a dictionary of barcode deatails + """ + con = self.getMetadataDatabaseConnection() + results = con.cursor() + con.cursor().callproc('get_barcode_details',[barcode, results]) + row = results.fetchone() + try: + barcode_details = { + 'create_date' : row[0], + 'status' : row[1], + 'sample_postmark_date' : row[2], + 'biomass_remaining' : row[3], + 'sequencing_status' : row[4], + 'obsolete' : row[5] + } + except TypeError : + #no results mean barcode doesn't exist + return {} + return barcode_details \ No newline at end of file diff --git a/www/wwwadmin/edit_barcode.psp b/www/wwwadmin/edit_barcode.psp new file mode 100644 index 00000000..6e7d136b --- /dev/null +++ b/www/wwwadmin/edit_barcode.psp @@ -0,0 +1,79 @@ + + +<%@ include file="common_vars.psp" %> + +
+ + +
+ +<% +qiime_data_access = data_access = data_access_factory(ServerConfig.data_access_type) +if 'submit_flag' in form: + if form['submit_flag'] == '1': + # Submit and redirect to fusebox + qiime_data_access.updateBarcode(form['barcode'], form['status'], + form['scan_date'], form['sample_postmark_date'], + form['biomass_remaining'], form['sequencing_status'], + form['obsolete']) + req.write('') +# End if +%> + +
+ + + + + + +
Barcode + +
+
+ +<% + +if 'barcode' in form: + barcode = form['barcode'] + if len(barcode) != 9: + req.write('Barcode does not exist') + else: + details = qiime_data_access.getBarcodeDetails(barcode) + if len(details) == 0: + req.write('Barcode does not exist') + else: + date_created = details['create_date'] + status = details['status'] + sample_postmark_date = details['sample_postmark_date'] + biomass_remaining = details['biomass_remaining'] + obsolete = details['obsolete'] + #Indent + %> +
+ + + + + + + + + + + + + + + + + + + + + +
Date Created value="<%=date_created%>"/>
Status
Biomass Remaining (Y or N)
Obsolete (Y or N)
+
+<% +#END Indent +%> \ No newline at end of file diff --git a/www/wwwadmin/header.psp b/www/wwwadmin/header.psp index 3300ab09..2fffa4ee 100644 --- a/www/wwwadmin/header.psp +++ b/www/wwwadmin/header.psp @@ -72,6 +72,11 @@ else: +
+ + +
+