\n"
line += "Código | "
line += "Nombre | "
line += "Dirección | "
line += "Teléfono |
\n"
line += "------------------------------------------------------------------------------- |
"
table.append(line)
]]>
if str($entity_tableSearchBlock.searchCodeEntry) or str($entity_tableSearchBlock.searchNameEntry):
$entity_tableCondition = GConditions.GConditions()
tmpAnd = GConditions.GCand($entity_tableCondition)
if str($entity_tableSearchBlock.searchCodeEntry):
eq1 = GConditions.GClike(tmpAnd)
GConditions.GCField(eq1,"_entity_uid_data.uid")
GConditions.GCConst(eq1,str($entity_tableSearchBlock.searchCodeEntry)+'%')
if str($entity_tableSearchBlock.searchNameEntry):
eq2 = GConditions.GClike(tmpAnd)
GConditions.GCField(eq2,"_entity_data.name")
GConditions.GCConst(eq2,str($entity_tableSearchBlock.searchNameEntry)+'%')
$entity_tableResulSet = print$entity_tableDataSource.createResultSet($entity_tableCondition)
else:
$entity_tableResulSet = print$entity_tableDataSource.createResultSet()
more = $entity_tableResulSet.firstRecord();
while more:
#agregar condicion de busquedq de direccion
addressCondition = GConditions.GCondition()
tmpAnd = GConditions.GCand(addressCondition)
eq1 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq1,"_address_data.entity")
GConditions.GCConst(eq1,str($entity_tableResulSet.current.getField("_entity_data._table")))
eq2 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq2,"_address_data.address_type")
GConditions.GCConst(eq2,"1")
addressResulSet = printAddressDataSource.createResultSet(addressCondition)
anAddress = addressResulSet.firstRecord()
addresses = []
while anAddress:
addresses.append(addressResulSet.current.getField("address"))
anAddress = addressResulSet.nextRecord()
# ahora telefono es una direccion de address_type = '2'
addressCondition = GConditions.GCondition()
tmpAnd = GConditions.GCand(addressCondition)
eq1 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq1,"_address_data.entity")
GConditions.GCConst(eq1,str($entity_tableResulSet.current.getField("_entity_data._table")))
eq2 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq2,"_address_data.address_type")
GConditions.GCConst(eq2,"2")
telephoneResulSet = printAddressDataSource.createResultSet(addressCondition)
anTelephone = telephoneResulSet.firstRecord()
telephones = []
while anTelephone:
telephones.append(telephoneResulSet.current.getField("address"))
anTelephone = telephoneResulSet.nextRecord()
"
]]>
preValue = $entity_tableResulSet.current.getField("_entity_uid_data.uid")
"
else:
line += " | "
line += ""
]]>
preValue = $entity_tableResulSet.current.getField("_entity_data.name")
"
else:
line += " | "
def fillHtmlCell(cellValue):
if cellValue:
preValue = cellValue.pop()
if preValue:
return ""+preValue+" | "
else:
return " | "
else:
return ""
line += fillHtmlCell(addresses)
line += fillHtmlCell(telephones)
line += "\n"
table.append(line)
while addresses or telephones:
line = " | | "
line += fillHtmlCell(addresses)
line += fillHtmlCell(telephones)
line += "\n"
table.append(line)
line = " |
"
table.append(line)
]]>
more = $entity_tableResulSet.nextRecord()