282 |
<trigger name="productRollbackTrigger" type="NAMED"> |
<trigger name="productRollbackTrigger" type="NAMED"> |
283 |
import hack |
import hack |
284 |
hack.rollback(productBlock) |
hack.rollback(productBlock) |
285 |
|
hack.rollback(showDescriptionsBlock) |
286 |
</trigger> |
</trigger> |
287 |
|
|
288 |
<trigger name="askForChangesTrigger" type="NAMED"> |
<trigger name="askForChangesTrigger" type="NAMED"> |
349 |
</block> |
</block> |
350 |
</page> |
</page> |
351 |
<page name="Producto"> |
<page name="Producto"> |
352 |
|
<!-- new_schema_begin --> |
353 |
|
<block name="searchingProductClassificationBlock" datasource="productClassificationDataSource"> |
354 |
|
<entry name="idEntry" field="_table" |
355 |
|
x="1" y="1" hidden="y"/> |
356 |
|
<entry name="nameEntry" field="name" |
357 |
|
x="1" y="1" hidden="y"/> |
358 |
|
</block> |
359 |
|
<block name="searchingPhysicalStructureBlock" datasource="physicalStructureDataSource"> |
360 |
|
<entry name="idEntry" field="_table" |
361 |
|
x="1" y="1" hidden="y"/> |
362 |
|
<entry name="nameEntry" field="name" |
363 |
|
x="1" y="1" hidden="y"/> |
364 |
|
</block> |
365 |
|
<block name="searchingCountryBlock" datasource="countryDataSource"> |
366 |
|
<entry name="idEntry" field="_table" |
367 |
|
x="1" y="1" hidden="y"/> |
368 |
|
<entry name="iso3Entry" field="iso3" |
369 |
|
x="1" y="1" hidden="y"/> |
370 |
|
<entry name="nameEntry" field="name" |
371 |
|
x="1" y="1" hidden="y"/> |
372 |
|
</block> |
373 |
|
<trigger type="Pre-Focusin"> |
374 |
|
showDescriptionsBlock.newRecord () |
375 |
|
|
376 |
|
if str(productBlock.product_classificationEntry)!='': |
377 |
|
searchingProductClassificationBlock.processRollback () |
378 |
|
searchingProductClassificationBlock.initQuery () |
379 |
|
searchingProductClassificationBlock.idEntry= str(productBlock.product_classificationEntry) |
380 |
|
searchingProductClassificationBlock.processQuery () |
381 |
|
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
382 |
|
else: |
383 |
|
showDescriptionsBlock.classificationEntry= '' |
384 |
|
|
385 |
|
if str(productBlock.physical_structureEntry)!='': |
386 |
|
searchingPhysicalStructureBlock.processRollback () |
387 |
|
searchingPhysicalStructureBlock.initQuery () |
388 |
|
searchingPhysicalStructureBlock.idEntry= str(productBlock.physical_structureEntry) |
389 |
|
searchingPhysicalStructureBlock.processQuery () |
390 |
|
showDescriptionsBlock.storeEntry= str(searchingPhtsicalStructureBlock.nameEntry) |
391 |
|
else: |
392 |
|
showDescriptionsBlock.storeEntry= '' |
393 |
|
|
394 |
|
if str(productBlock.countryEntry)!='': |
395 |
|
searchingCountryBlock.processRollback () |
396 |
|
searchingCountryBlock.initQuery () |
397 |
|
searchingCountryBlock.idEntry= str(productBlock.countryEntry) |
398 |
|
searchingProductBlock.processQuery () |
399 |
|
showDescriptionsBlock.countryCodeEntry= str(searchingCountryBlock.iso3Entry) |
400 |
|
showDescriptionsBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
401 |
|
else: |
402 |
|
showDescriptionsBlock.countryCodeEntry= '' |
403 |
|
showDescriptionsBlock.countryNameEntry= '' |
404 |
|
|
405 |
|
showDescriptionsBlock.commit () |
406 |
|
</trigger> |
407 |
|
<!-- new_schema_end --> |
408 |
|
|
409 |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
410 |
<box label="Datos" x="0" y="0" height="20" width="70"> |
<box label="Datos" x="0" y="0" height="20" width="70"> |
411 |
<block name="productBlock" datasource="productDataSource" restrictInsert="y"> |
<block name="productBlock" datasource="productDataSource" restrictInsert="y"> |
418 |
<label text="Nombre Canónico:" x="1" y="1"/> |
<label text="Nombre Canónico:" x="1" y="1"/> |
419 |
<entry name="canonical_nameEntry" field="_product_data.canonical_name" |
<entry name="canonical_nameEntry" field="_product_data.canonical_name" |
420 |
x="2" y="2" width="48"/> |
x="2" y="2" width="48"/> |
|
<!-- here --> |
|
421 |
<button x="57" y="2" width="10" height="1" label="Nuevo" trigger="newProductTrigger"> |
<button x="57" y="2" width="10" height="1" label="Nuevo" trigger="newProductTrigger"> |
422 |
<trigger type="NAMED" name="newProductTrigger"> |
<trigger type="NAMED" name="newProductTrigger"> |
423 |
productBlock.newRecord() |
productBlock.newRecord() |
425 |
</trigger> |
</trigger> |
426 |
</button> |
</button> |
427 |
<label text="Clasificación:" x="1" y="3"/> |
<label text="Clasificación:" x="1" y="3"/> |
428 |
<entry x="2" y="4" width="40" name="product_classificationEntry" style="dropdown" |
<entry name="product_classificationEntry" field="_product_data.product_classification" |
429 |
field="_product_data.product_classification" |
x="1" y="1" hidden="y"/> |
430 |
foreign_key="productClassificationDataSource._table" |
<!-- new_schema_begin --> |
431 |
foreign_key_description="description"/> |
<button name="searchClassificationButton" label="Buscar" trigger="searchClassificationTrigger" |
432 |
<button x="45" y="4" name="product_classificationButton" |
x="42" y="4" width="10" height="1"> |
433 |
|
<trigger name="searchClassificationTrigger" type="NAMED"> |
434 |
|
try: |
435 |
|
from gnue.forms.GFEvent import GFEvent |
436 |
|
except ImportError: |
437 |
|
from gnue.common.events.Event import Event as GFEvent |
438 |
|
|
439 |
|
setStatusText('buscando...') |
440 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
441 |
|
|
442 |
|
def setClassification (recNo): |
443 |
|
if recNo>=0: |
444 |
|
searchingProductClassificationBlock.jumpRecord (recNo) |
445 |
|
productBlock.product_classificationEntry= str(searchingProductClassificationBlock.idEntry) |
446 |
|
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
447 |
|
|
448 |
|
# look for the name... |
449 |
|
searchingProductClassificationBlock.processRollback () |
450 |
|
searchingProductClassificationBlock.initQuery () |
451 |
|
searchingProductClassificationBlock.nameEntry= str(showDescriptionsBlock.classificationEntry)+'%' |
452 |
|
searchingProductClassificationBlock.processQuery () |
453 |
|
|
454 |
|
# are there too much results? |
455 |
|
resultCount= searchingProductClassificationBlock.getRecordCount () |
456 |
|
if resultCount>1: |
457 |
|
# do the select-man |
458 |
|
runForm ('productClassificationSelect.gfd', { |
459 |
|
'data': searchingProductClassificationBlock, |
460 |
|
'callback': setClassification |
461 |
|
}) |
462 |
|
elif resultCount==1: |
463 |
|
setClassification (0) |
464 |
|
|
465 |
|
setStatusText('Ok') |
466 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
467 |
|
</trigger> |
468 |
|
</button> |
469 |
|
<!-- new_schema_end --> |
470 |
|
<button x="53" y="4" name="product_classificationButton" |
471 |
label="..." width="5" height="1" trigger="product_classificationTrigger"> |
label="..." width="5" height="1" trigger="product_classificationTrigger"> |
472 |
<trigger type="NAMED" name="product_classificationTrigger"> |
<trigger type="NAMED" name="product_classificationTrigger"> |
473 |
runForm('product_classification.gfd'); |
runForm('product_classification.gfd'); |
474 |
</trigger> |
</trigger> |
475 |
</button> |
</button> |
476 |
<label text="Ubicación:" x="1" y="5"/> |
<label text="Ubicación:" x="1" y="5"/> |
477 |
<entry x="2" y="6" width="40" name="physical_structureEntry" style="dropdown" |
<entry name="physical_structureEntry" field="_product_data.location" |
478 |
field="_product_data.location" |
x="1" y="1" hidden="y"/> |
479 |
foreign_key="physicalStructureDataSource._table" |
<!-- new_schema_begin --> |
480 |
foreign_key_description="name"/> |
<button name="searchLocationButton" label="Buscar" trigger="searchLocationTrigger" |
481 |
<button x="45" y="6" name="physical_structureButton" |
x="42" y="6" width="10" height="1"> |
482 |
|
<trigger name="searchLocationTrigger" type="NAMED"> |
483 |
|
self.genericBox('No implementado', ['Ok']); |
484 |
|
<!-- doesn't work; wait till is implemented. |
485 |
|
try: |
486 |
|
from gnue.forms.GFEvent import GFEvent |
487 |
|
except ImportError: |
488 |
|
from gnue.common.events.Event import Event as GFEvent |
489 |
|
|
490 |
|
setStatusText('buscando...') |
491 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
492 |
|
|
493 |
|
def setClassification (recNo): |
494 |
|
if recNo>=0: |
495 |
|
searchingProducClassificationBlock.jumpRecord (recNo) |
496 |
|
productBlock.product_classificationEntry= str(searchingProductClassificationBlock.idEntry) |
497 |
|
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
498 |
|
|
499 |
|
# look for the name... |
500 |
|
searchingProducClassificationBlock.processRollback () |
501 |
|
searchingProducClassificationBlock.initQuery () |
502 |
|
searchingProducClassificationBlock.nameEntry= str(showDescriptionsBlock.calssificationEntry)+'%' |
503 |
|
searchingProducClassificationBlock.processQuery () |
504 |
|
|
505 |
|
# are there too much results? |
506 |
|
resultCount= searchingProducClassificationBlock.getRecordCount () |
507 |
|
if resultCount>1: |
508 |
|
# do the select-man |
509 |
|
runForm ('productClassificationSelect.gfd', { |
510 |
|
'data': searchingProducClassificationBlock, |
511 |
|
'callback': setClassification |
512 |
|
}) |
513 |
|
elif resultCount==1: |
514 |
|
setClassification (0) |
515 |
|
|
516 |
|
setStatusText('Ok') |
517 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) --> |
518 |
|
</trigger> |
519 |
|
</button> |
520 |
|
<!-- new_schema_end --> |
521 |
|
<button x="53" y="6" name="physical_structureButton" |
522 |
label="..." width="5" height="1" trigger="physical_structureTrigger"> |
label="..." width="5" height="1" trigger="physical_structureTrigger"> |
523 |
<trigger type="NAMED" name="physical_structureTrigger"> |
<trigger type="NAMED" name="physical_structureTrigger"> |
524 |
self.genericBox('No implementado', ['Ok']); |
self.genericBox('No implementado', ['Ok']); |
525 |
</trigger> |
</trigger> |
526 |
</button> |
</button> |
527 |
<label text="País de Origen:" x="1" y="7"/> |
<label text="País de Origen:" x="1" y="7"/> |
528 |
<entry x="2" y="8" width="40" name="countryEntry" style="dropdown" |
<entry name="countryEntry" field="_product_data.country" |
529 |
field="_product_data.country" |
x="1" y="1" hidden="y"/> |
530 |
foreign_key="countryDataSource._table" |
<!-- new_schema_begin --> |
531 |
foreign_key_description="name"/> |
<button name="searchCountryButton" label="Buscar" trigger="searchCountryTrigger" |
532 |
<button x="45" y="8" name="countryButton" |
x="42" y="8" width="10" height="1"> |
533 |
|
<trigger name="searchCountryTrigger" type="NAMED"> |
534 |
|
try: |
535 |
|
from gnue.forms.GFEvent import GFEvent |
536 |
|
except ImportError: |
537 |
|
from gnue.common.events.Event import Event as GFEvent |
538 |
|
|
539 |
|
setStatusText('buscando...') |
540 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
541 |
|
|
542 |
|
def setCountry (recNo): |
543 |
|
if recNo>=0: |
544 |
|
searchingCountryBlock.jumpRecord (recNo) |
545 |
|
productBlock.countryEntry= str(searchingCountryBlock.idEntry) |
546 |
|
showDescriptionsBlock.countryCodeEntry= str(searchingCountryBlock.iso3Entry) |
547 |
|
showDescriptionsBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
548 |
|
|
549 |
|
# look for the name... |
550 |
|
searchingCountryBlock.processRollback () |
551 |
|
searchingCountryBlock.initQuery () |
552 |
|
searchingCountryBlock.iso3Entry= str(showDescriptionsBlock.countryCodeEntry)+'%' |
553 |
|
searchingCountryBlock.nameEntry= str(showDescriptionsBlock.countryNameEntry)+'%' |
554 |
|
searchingCountryBlock.processQuery () |
555 |
|
|
556 |
|
# are there too much results? |
557 |
|
resultCount= searchingCountryBlock.getRecordCount () |
558 |
|
if resultCount>1: |
559 |
|
# do the select-man |
560 |
|
runForm ('countrySelect.gfd', { |
561 |
|
'data': searchingCountryBlock, |
562 |
|
'callback': setCountry |
563 |
|
}) |
564 |
|
elif resultCount==1: |
565 |
|
setCountry (0) |
566 |
|
|
567 |
|
setStatusText('Ok') |
568 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
569 |
|
</trigger> |
570 |
|
</button> |
571 |
|
<!-- new_schema_end --> |
572 |
|
<button x="53" y="8" name="countryButton" |
573 |
label="..." width="5" height="1" trigger="countryTrigger"> |
label="..." width="5" height="1" trigger="countryTrigger"> |
574 |
<trigger type="NAMED" name="countryTrigger"> |
<trigger type="NAMED" name="countryTrigger"> |
575 |
runForm('country.gfd'); |
runForm('country.gfd'); |
593 |
name="productDeleteBtn" height="1"/> |
name="productDeleteBtn" height="1"/> |
594 |
<button x="21" y="17" trigger="productRollbackTrigger" width="9" label="Cancelar" |
<button x="21" y="17" trigger="productRollbackTrigger" width="9" label="Cancelar" |
595 |
name="productRollbackBtn" height="1"/> |
name="productRollbackBtn" height="1"/> |
596 |
</block> |
</block> |
597 |
</box> |
|
598 |
|
<!-- new_schema_begin --> |
599 |
|
<datasource name="showNames" cache="1"/> |
600 |
|
<block name="showDescriptionsBlock" datasource="showNames"> |
601 |
|
<entry name="classificationEntry" field="classificationDesc" |
602 |
|
x="2" y="4" width="40"/> |
603 |
|
<entry name="storeEntry" field="storeDesc" |
604 |
|
x="2" y="6" width="40"/> |
605 |
|
<entry name="countryCodeEntry" field="countryCode" |
606 |
|
x="2" y="8" width="4"/> |
607 |
|
<entry name="countryNameEntry" field="countryName" |
608 |
|
x="6" y="8" width="36"/> |
609 |
|
</block> |
610 |
|
<!-- new_schema_end --> |
611 |
|
</box> |
612 |
</page> |
</page> |
613 |
|
|
614 |
</form> |
</form> |