From: <ann...@us...> - 2013-06-06 12:14:25
|
Revision: 3433 http://sourceforge.net/p/bika/code/3433 Author: anneline Date: 2013-06-06 12:14:22 +0000 (Thu, 06 Jun 2013) Log Message: ----------- sample batches Modified Paths: -------------- tracer/skins/bika/analysisservice_edit.cpt tracer/skins/bika/analysisservice_mod.cpy tracer/skins/bika/analysisservices.pt tracer/skins/bika/client_samples.pt tracer/skins/bika/load_sample_data.py tracer/skins/bika/load_small_data.py tracer/skins/bika/load_tiny_data.py tracer/skins/bika/project_samples.pt tracer/skins/bika/validate_analysisservice.vpy Modified: tracer/skins/bika/analysisservice_edit.cpt =================================================================== --- tracer/skins/bika/analysisservice_edit.cpt 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/analysisservice_edit.cpt 2013-06-06 12:14:22 UTC (rev 3433) @@ -68,122 +68,7 @@ <textarea name="Instructions" rows="5" cols="40" tal:content="request/Instructions | here/getInstructions"></textarea> </div> -<div class="field" - tal:define=" - instruments python:[p.getObject() for p in here.portal_catalog(portal_type='Instrument')]; - sort_on python:(('Title', 'nocase', 'asc'),); - instruments python:sequence.sort(instruments, sort_on)"> -<label i18n:translate="label_instrument">Instrument</label> -<div> </div> - <select name="Instrument" - tal:define=" - old python:here.getInstrument() and here.getInstrument().UID() or None; - prev python:request.get('Instrument', old)"> - <option></option> - <tal:item - tal:repeat="instrument instruments"> - <option selected="selected" - tal:define=" - this_selected python:test(instrument.UID() == prev, 'selected', '')" - tal:attributes="value instrument/UID; - selected this_selected" - tal:content="instrument/Title"></option> - </tal:item> - </select> -</div> - -<div class="field" - tal:define=" - methods python:[p.getObject() for p in here.portal_catalog(portal_type='Method')]; - sort_on python:(('Title', 'nocase', 'asc'),); - methods python:sequence.sort(methods, sort_on)"> -<label i18n:translate="label_method">Method</label> -<div> </div> - <select multiple="multiple" name="Method:List" - tal:define=" - prev python:request.get('Method', []); - old python:prev and prev or [s.UID() for s in here.getMethod()];"> - - <tal:item - tal:repeat="method methods"> - <option selected="selected" - tal:define=" - this_selected python:test(method.UID() in old, 'selected', '')" - tal:attributes="value method/UID; - selected this_selected" - tal:content="method/Title"></option> - </tal:item> - - </select> -</div> - - -<div class="field" - tal:define=" - departments python:[p.getObject() for p in here.portal_catalog(portal_type='Department')]; - sort_on python:(('Title', 'nocase', 'asc'),); - departments python:sequence.sort(departments, sort_on)"> -<label i18n:translate="label_department">Lab department</label> - <span class="fieldRequired">(Required)</span> -<div> </div> - <select name="Department" - tal:define=" - old python:here.getDepartment() and here.getDepartment().UID() or None; - prev python:request.get('Department', old)"> - <option></option> - <tal:item - tal:repeat="department departments"> - <option selected="selected" - tal:define=" - this_selected python:test(department.UID() == prev, 'selected', '')" - tal:attributes="value department/UID; - selected this_selected" - tal:content="department/Title"></option> - </tal:item> - </select> -</div> - - -<div class="field" - tal:define=" - categories python:[p.getObject() for p in here.portal_catalog(portal_type='AnalysisCategory')]; - sort_on python:(('Title', 'nocase', 'asc'),); - categories python:sequence.sort(categories, sort_on)"> -<label i18n:translate="label_category">Analysis service category</label> - <span class="fieldRequired">(Required)</span> -<div> </div> - <select name="AnalysisCategory" - tal:define=" - old python:here.getAnalysisCategory() and here.getAnalysisCategory().UID() or None; - prev python:request.get('AnalysisCategory', old)"> - <option></option> - <tal:item - tal:repeat="category categories"> - <option selected="selected" - tal:define=" - this_selected python:test(category.UID() == prev, 'selected', '')" - tal:attributes="value category/UID; - selected this_selected" - tal:content="category/Title"></option> - </tal:item> - </select> -</div> - - -<div class="field"> -<input class="noborder" type="checkbox" value="" - id="Accredited" name="Accredited_visible" - onclick="toggleBoolean('Accredited', 'Accredited_hidden'); return 1" - tal:attributes="checked request/Accredited | here/getAccredited" /> -<input type="hidden" name="Accredited" value="" - id="Accredited_hidden" - tal:attributes="value request/Accredited | here/getAccredited" /> -<label i18n:translate="label_accredited">Accredited</label> -</div> - -</fieldset> - <fieldset> <legend i18n:translate="label_identification">Identification</legend> <div class="field"> @@ -296,183 +181,7 @@ </div> </fieldset> -<fieldset> -<legend i18n:translate="label_calculations">Calculations</legend> -<div class="field" > -<label i18n:translate="label_result_options">Result options</label> -<div class="formHelp" i18n:translate="label_result_options"> - Restricted set of result options </div> -<tal:old - tal:define="options python:here.getResultOptionsSorted()" - tal:repeat="option options"> -<input name="" value="" size="10" - tal:define="seq repeat/option/index" - tal:attributes="name string:ResultOptions.${seq}:record:ignore_empty; - value python:option"/> -<br/> -</tal:old> -<tal:new tal:repeat="i python:range(3)"> -<input name="" value="" size="10" - tal:define="seq python:len(here.getResultOptions()) + i" - tal:attributes="name string:ResultOptions.${seq}:record:ignore_empty"/> -<br/> -</tal:new> -</div> - -<div class="field" - tal:define=" - calctypes python:[p.getObject() for p in here.portal_catalog(portal_type='CalculationType')]; - sort_on python:(('Title', 'nocase', 'asc'),); - calctypes python:sequence.sort(calctypes, sort_on)"> -<label i18n:translate="label_calc_type">Calculation Type</label> -<div> </div> - <select name="CalculationType" - tal:define=" - old python:here.getCalculationType() and here.getCalculationType().UID() or None; - prev python:request.get('CalculationType', old)"> - <option></option> - <tal:item - tal:repeat="calctype calctypes"> - <option selected="selected" - tal:define=" - this_selected python:test(calctype.UID() == prev, 'selected', '')" - tal:attributes="value calctype/UID; - selected this_selected" - tal:content="calctype/Title"></option> - </tal:item> - </select> -</div> - -<div class="field"> -<label i18n:translate="label_dependant_analyses">Dependant Analyses</label> -<tal:admin tal:condition="python:member.has_role(('Manager',))"> -<tal:dependantanalyses - tal:define=" - services python:[p.getObject() for p in here.portal_catalog(portal_type='AnalysisService')]; - sort_on python:(('Title', 'nocase', 'asc'),); - services python:sequence.sort(services, sort_on)"> -<div> </div> - <select multiple="multiple" name="CalcDependancy:List" - tal:define=" - prev python:request.get('CalcDependancy', []); - old python:prev and prev or [s.UID() for s in here.getCalcDependancy()];"> - - <tal:item - tal:repeat="service services"> - <option selected="selected" - tal:define=" - this_selected python:test(service.UID() in old, 'selected', '')" - tal:attributes="value service/UID; - selected this_selected" - tal:content="service/Title"></option> - </tal:item> - - </select> -</tal:dependantanalyses> -</tal:admin> -<tal:notadmin tal:condition="python:not member.has_role(('Manager',))"> -<tal:showdependants - tal:define="dependants python:[s.Title() for s in here.getCalcDependancy()]; - dummy python:dependants.sort()" - tal:repeat="dependant dependants"> -<br/> -<span tal:content="dependant">some analyses</span> - -</tal:showdependants> -</tal:notadmin> -</div> - - -<div class="field"> -<label i18n:translate="label_max_hours">Maximum Hours Allowed</label> -<div class="formHelp" i18n:translate="label_maximum_hours_allowed"> -Maximum time allowed for publication of results -</div> -<input name="MaxHoursAllowed" value="" size="5" - tal:attributes="value request/MaxHoursAllowed | here/MaxHoursAllowed"/> -</div> - -</fieldset> - -<div class="field"> -<fieldset> -<legend i18n:translate="label_uncertainties">Uncertainties</legend> -<table - tal:define="uncertainties request/Uncertainties | here/getUncertainties"> -<tr> -<td i18n:translate="label_min">Min</td> -<td i18n:translate="label_max">Max</td> -<td i18n:translate="label_actual_value">Actual value</td> -<td> -<span i18n:translate="delete">delete</span> -</td> -</tr> -<tal:uncertainty tal:repeat="uncertainty uncertainties"> -<tr> -<div> -<td> -<input type="text" - name="Uncertainties.intercept_min:records:ignore_empty" - value="" size="10" maxlength="40" - tal:attributes="value uncertainty/intercept_min" /> -</td> -</div> -<div> -<td> -<input type="text" - name="Uncertainties.intercept_max:records:ignore_empty" - value="" size="10" maxlength="40" - tal:attributes="value uncertainty/intercept_max" /> -</td> -</div> -<div> -<td> -<input type="text" - name="Uncertainties.errorvalue:records:ignore_empty" - value="" size="10" maxlength="40" - tal:attributes="value uncertainty/errorvalue" /> -</td> -</div> -<td tal:define="row repeat/uncertainty/number"> -<input class="noborder" type="checkbox" value="on" - name="Uncertainties.delete:records:ignore_empty"> -</td> -</tr> -</tal:uncertainty> -<tr> -<div> -<td> -<input type="text" - name="Uncertainties.intercept_min:records:ignore_empty" - value="" size="10" maxlength="40" /> -</td> -</div> -<div> -<td> -<input type="text" - name="Uncertainties.intercept_max:records:ignore_empty" - value="" size="10" maxlength="40" /> -</td> -</div> -<div> -<td> -<input type="text" - name="Uncertainties.errorvalue:records:ignore_empty" - value="" size="10" maxlength="40" /> -</td> -</div> -<td> -</td> -</tr> -</table> - -</fieldset> - -</div> - - - <input class="context" type="submit" name="form.button.submit" Modified: tracer/skins/bika/analysisservice_mod.cpy =================================================================== --- tracer/skins/bika/analysisservice_mod.cpy 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/analysisservice_mod.cpy 2013-06-06 12:14:22 UTC (rev 3433) @@ -12,23 +12,6 @@ req = context.REQUEST.form service = context -calcdependancy=context.REQUEST.get('CalcDependancy', []) -method=context.REQUEST.get('Method', []) -new_uncertainties = [] -old_uncertainties=context.REQUEST.get('Uncertainties', []) -for uncertainty in old_uncertainties: - if uncertainty.has_key('delete'): - continue - new_uncertainties.append(uncertainty) - -resultoptions = [] -options = context.REQUEST.get('ResultOptions',{}) -option_keys = options.keys() -option_keys.sort() -for key in option_keys: - resultoptions.append({'Seq': key, - 'Result': options[key]}) - service.edit( title=req['Title'].strip(), ServiceDescription=req['ServiceDescription'], @@ -42,18 +25,7 @@ VAT=req['VAT'], InstrumentKeyword=req['InstrumentKeyword'].strip(), AnalysisKey=req['AnalysisKey'].strip(), - CalcDependancy=calcdependancy, - Instrument=req['Instrument'], - Method=method, - MaxHoursAllowed=req['MaxHoursAllowed'], - CalculationType=req['CalculationType'], - TitrationUnit=req['TitrationUnit'], DuplicateVariation=req['DuplicateVariation'], - Department=req['Department'], - AnalysisCategory=req['AnalysisCategory'], - Accredited=req['Accredited'], - ResultOptions=resultoptions, - Uncertainties=new_uncertainties, ) service.reindexObject() Modified: tracer/skins/bika/analysisservices.pt =================================================================== --- tracer/skins/bika/analysisservices.pt 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/analysisservices.pt 2013-06-06 12:14:22 UTC (rev 3433) @@ -27,16 +27,11 @@ Up to Plone Setup </a> <p tal:content="here/description">Tool description</p> -<tal:set tal:define="cat python:request.get('Category', None)"> <tal:x define=" dummy_a python:request.set('portal_type', 'AnalysisService'); dummy_c python:request.set('sort_on', 'sortable_title'); " /> -<tal:y tal:condition="python:cat != 'All'"> -<tal:z tal:define="dummy_b python:request.set('getCategoryUID', cat)"/> -</tal:y> -</tal:set> <div id="content-analysisservices" @@ -62,34 +57,7 @@ <br/> -<form name="filter_result" action="" method="post" - tal:attributes="action template/getId" - tal:define="categories python:[c for c in here.portal_catalog(portal_type='AnalysisCategory', sort_on='sortable_title')]"> -<label i18n:translate="label_category">Category</label> - <select name="Category" - onchange="this.form.submit()" - tal:attributes="tabindex tabindex/next;"> - <option selected="selected" - tal:attributes="value python:None" - >All</option> - <tal:item - tal:define=" - vocab categories" - tal:repeat="item vocab"> - <option selected="selected" - tal:define=" - uid python:request.get('Category', ); - this_selected python:test((item.UID == uid), 'selected', '')" - tal:attributes="value item/UID; - selected this_selected" - tal:content="item/Title"></option> - </tal:item> - - </select> -</form> - - <tal:button_conditions tal:condition="python:batch" tal:repeat="button actions/folder_buttons|nothing"> @@ -126,7 +94,6 @@ /> </th> <th i18n:translate="label_title">Title</th> -<th i18n:translate="label_category">Category</th> <th i18n:translate="label_report_dry_matter">Report as dry matter</th> <th i18n:translate="label_attachments">Attachments</th> <th i18n:translate="label_unit">Unit</th> @@ -134,7 +101,6 @@ <th i18n:translate="label_corporate_price_excl_vat">Corporate price excluding VAT</th> <th i18n:translate="label_maximum_hours_allowed">Maximum Hours Allowed</th> <th i18n:translate="label_duplicate_variation">Duplicate Variation</th> -<th i18n:translate="label_calc">Calc</th> </tr> </thead> @@ -166,12 +132,6 @@ tal:attributes="href obj/absolute_url" tal:content="obj/Title">A service</a> </td> -<td> -<a href="" - tal:define="cat obj/getAnalysisCategory" - tal:attributes="href cat/absolute_url|nothing" - tal:content="cat/Title|nothing">A category</a> -</td> <td tal:content="python:reportdry and 'Yes' or 'No'"></td> <td tal:define="vocab python:obj.Schema()['AttachmentOption'].Vocabulary()" tal:content="python:vocab.getMsgId(obj.getAttachmentOption())"></td> @@ -180,7 +140,6 @@ <td tal:content="obj/getCorporatePrice"></td> <td tal:content="obj/getMaxHoursAllowed"></td> <td tal:content="obj/getDuplicateVariation"></td> -<td tal:content="obj/getCalcName"></td> </tr> </metal:block> Modified: tracer/skins/bika/client_samples.pt =================================================================== --- tracer/skins/bika/client_samples.pt 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/client_samples.pt 2013-06-06 12:14:22 UTC (rev 3433) @@ -184,6 +184,7 @@ <td tal:content="obj/getEastUTM|nothing">R001</td> <td tal:define="contact obj/getContact"> <a href="" + tal:condition="contact" tal:attributes="href contact/absolute_url" tal:content="contact/Title|nothing">Pete Smith</a></td> <td tal:content="sampletype/Title|nothing">Sample Type</td> Modified: tracer/skins/bika/load_sample_data.py =================================================================== --- tracer/skins/bika/load_sample_data.py 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/load_sample_data.py 2013-06-06 12:14:22 UTC (rev 3433) @@ -665,7 +665,7 @@ ('Simon', 'Meadows Smith', 'simonms', 'simonms', 'si...@se...', 'fieldmanager'), ('Paul', 'Howe', 'paulh', 'paulh', 'pau...@se...', 'fieldmanager'), ('Ghislain', 'Tourigny', 'ghislaint', 'ghislaint', 'af...@ho...', 'fieldmanager'), - ('Nana', 'Abrefa', 'nanaa', 'nanaa', ' nan...@ya...', 'geologist'), + ('Nana', 'Abrefa', 'nanaa', 'nanaa', 'nan...@ya...', 'fieldmanager'), ('Stan', 'de Stabenrath', 'stands', 'stands', 'st...@se...', 'fieldmanager'), ('Isabelle', 'Guirma', 'isabelleg', 'isabelleg', 'isa...@se...', 'fieldmanager'), ('Clement', 'Asare', 'clema', 'clema', 'cle...@se...', 'fieldmanager'), @@ -870,6 +870,9 @@ ('Copper', 'mg/l', 5, 10, 'description for copper', 'Cu', 'Cu', 'Instructions for copper', ), ('Zinc', 'mg/l', 5, 9, 'Description for zinc testing', 'Zn', 'Zinc', 'Instructions for zinc', ), ('Arsenic', 'mg/l', 5, 10, 'description for arsenic', 'As', 'As', 'Instructions for arsenic', ), + ('ME-XRF21c', 'mg/l', 5, 10, 'description for ME-XRF21c', 'MEXRF21c', 'MEXRF21c', 'Instructions for ME-XRF21c', ), + ('MEXRF21u', 'mg/l', 5, 10, 'description for MEXRF21u', 'MEXRF21u', 'MEXRF21u', 'Instructions for MEXRF21u', ), + ('DTR_REC', 'mg/l', 5, 10, 'description for DTR_REC', 'DTRREC', 'DTRREC', 'Instructions for DTR_REC', ), ) for title, unit, min, max, description, instr_kw, keyword, instructions in services: id = folder.generateUniqueId('AnalysisService') Modified: tracer/skins/bika/load_small_data.py =================================================================== --- tracer/skins/bika/load_small_data.py 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/load_small_data.py 2013-06-06 12:14:22 UTC (rev 3433) @@ -603,6 +603,9 @@ ('Copper', 'mg/l', 5, 10, 'description for copper', 'Cu', 'Cu', 'Instructions for copper', ), ('Zinc', 'mg/l', 5, 9, 'Description for zinc testing', 'Zn', 'Zinc', 'Instructions for zinc', ), ('Arsenic', 'mg/l', 5, 10, 'description for arsenic', 'As', 'As', 'Instructions for arsenic', ), + ('ME-XRF21c', 'mg/l', 5, 10, 'description for ME-XRF21c', 'MEXRF21c', 'MEXRF21c', 'Instructions for ME-XRF21c', ), + ('MEXRF21u', 'mg/l', 5, 10, 'description for MEXRF21u', 'MEXRF21u', 'MEXRF21u', 'Instructions for MEXRF21u', ), + ('DTR_REC', 'mg/l', 5, 10, 'description for DTR_REC', 'DTRREC', 'DTRREC', 'Instructions for DTR_REC', ), ) for title, unit, min, max, description, instr_kw, keyword, instructions in services: id = folder.generateUniqueId('AnalysisService') Modified: tracer/skins/bika/load_tiny_data.py =================================================================== --- tracer/skins/bika/load_tiny_data.py 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/load_tiny_data.py 2013-06-06 12:14:22 UTC (rev 3433) @@ -363,6 +363,9 @@ ('Copper', 'mg/l', 5, 10, 'description for copper', 'Cu', 'Cu', 'Instructions for copper', ), ('Zinc', 'mg/l', 5, 9, 'Description for zinc testing', 'Zn', 'Zinc', 'Instructions for zinc', ), ('Arsenic', 'mg/l', 5, 10, 'description for arsenic', 'As', 'As', 'Instructions for arsenic', ), + ('ME-XRF21c', 'mg/l', 5, 10, 'description for ME-XRF21c', 'MEXRF21c', 'MEXRF21c', 'Instructions for ME-XRF21c', ), + ('MEXRF21u', 'mg/l', 5, 10, 'description for MEXRF21u', 'MEXRF21u', 'MEXRF21u', 'Instructions for MEXRF21u', ), + ('DTR_REC', 'mg/l', 5, 10, 'description for DTR_REC', 'DTRREC', 'DTRREC', 'Instructions for DTR_REC', ), ) for title, unit, min, max, description, instr_kw, keyword, instructions in services: id = folder.generateUniqueId('AnalysisService') Modified: tracer/skins/bika/project_samples.pt =================================================================== --- tracer/skins/bika/project_samples.pt 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/project_samples.pt 2013-06-06 12:14:22 UTC (rev 3433) @@ -19,7 +19,7 @@ <div metal:fill-slot="main" tal:define=" - batch_size python:int(request.get('batch_size', '15')); + batch_size python:int(request.get('batch_size', '100')); dummy_a python:request.set('portal_type', 'Sample'); dummy_b python:request.set('getProjectUID', here.UID()); dummy_c python:request.set('sort_on', 'getSampleID'); Modified: tracer/skins/bika/validate_analysisservice.vpy =================================================================== --- tracer/skins/bika/validate_analysisservice.vpy 2013-06-03 11:58:42 UTC (rev 3432) +++ tracer/skins/bika/validate_analysisservice.vpy 2013-06-06 12:14:22 UTC (rev 3433) @@ -36,10 +36,6 @@ state.setError(error_key, '%s is already in use' %analysis_title) -analysis_cat = req['AnalysisCategory'] -if analysis_cat == '': - missing('AnalysisCategory') - analysis_key = req['AnalysisKey'].strip() if analysis_key == '': missing('AnalysisKey') @@ -68,51 +64,6 @@ state.setError(error_key, '%s is already in use' %instrument_key) -error_key = 'Uncertainty' -valid_uncertainties = True -uncertainties = {} -for uncertainty in context.REQUEST.get('Uncertainties', []): - intercept_min = None - intercept_max = None - if uncertainty.has_key('delete'): - continue - if uncertainty.has_key('intercept_min') \ - and uncertainty.has_key('intercept_max') \ - and uncertainty.has_key('errorvalue'): - try: - intercept_min = float(uncertainty['intercept_min']) - except ValueError: - valid_uncertainties = False - state.setError(error_key, 'Min value %s must be numeric' %(uncertainty['intercept_min'])) - - try: - intercept_max = float(uncertainty['intercept_max']) - except ValueError: - valid_uncertainties = False - state.setError(error_key, 'Max value %s must be numeric' %(uncertainty['intercept_max'])) - - try: - errorvalue = float(uncertainty['errorvalue']) - except ValueError: - valid_uncertainties = False - state.setError(error_key, 'Actual value %s must be numeric' %(uncertainty['errorvalue'])) - if valid_uncertainties: - uncertainties[intercept_min] = intercept_max - else: - state.setError(error_key, 'All 3 values required') - - mins = uncertainties.keys() - mins.sort() - prev_max = None - for min in mins: - max = uncertainties[min] - if min > max: - state.setError(error_key, 'Min %s must be less than max %s' %(min, max)) - if prev_max: - if min < prev_max: - state.setError(error_key, 'Min %s must be greater than or equal to max %s' %(min, prev_max)) - prev_max = max - if state.getErrors(): message=context.translate('message_correct_errors', default='Please correct the indicated errors', domain='bika') return state.set( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |