1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
<?xml version="1.0" encoding="ISO-8859-1"?> |
2 |
|
|
3 |
<form tabbed="top" title="@ $form @" height="18" width="84"> |
<form title="@ $form @"> |
4 |
<datasource name="focusDataSource" cache="1"/> |
<datasource name="focusDataSource" cache="1"/> |
5 |
<datasource name="searchDataSource" cache="1"/> |
<datasource name="searchDataSource" cache="1"/> |
6 |
<datasource name="resultDataSource" database="@ $database @" |
<datasource name="resultDataSource" database="@ $database @" |
7 |
table="@ $tables @" |
table="@ $tables @" |
8 |
order_by="@ $order_by @" |
order_by="@ $order_by @"> |
9 |
historytable="@ $histables @"> |
<!-- historytable="@ $histables @" --> |
10 |
<condition> |
<condition> |
11 |
<and> |
<and> |
12 |
@ $result_conditions @ |
@ $conditions @ |
13 |
</and> |
</and> |
14 |
</condition> |
</condition> |
15 |
</datasource> |
</datasource> |
16 |
<datasource name="editDataSource" database="@ $database @" |
<datasource name="editDataSource" database="@ $database @" |
17 |
table="@ $tables @" |
table="@ $tables @"> |
18 |
historytable="@ $histables @"> |
<!-- historytable="@ $histables @"--> |
19 |
<condition> |
<condition> |
20 |
<and> |
<and> |
21 |
@ $edit_conditions @ |
@ $conditions @ |
22 |
</and> |
</and> |
23 |
</condition> |
</condition> |
24 |
</datasource> |
</datasource> |
|
@ $datasources @ |
|
25 |
|
|
26 |
<trigger name="searchTrigger" type="NAMED"> |
<trigger name="searchTrigger" type="NAMED"> |
27 |
resultBlock.processRollback() |
resultBlock.rollback() |
28 |
resultBlock.initQuery() |
resultBlock.initQuery() |
29 |
@_DO_SEARCHERS_@ |
@_DO_SEARCHERS_@ |
30 |
resultBlock.listEntry@ $i @ = str(searchBlock.searchEntry@ $i @)+'%' |
resultBlock.@ $search_by[$i] @ = str(searchBlock.searchEntry@ $i @Field)+'%' |
31 |
@_DONE_@ |
@_DONE_@ |
32 |
resultBlock.processQuery() |
resultBlock.executeQuery() |
33 |
</trigger> |
</trigger> |
34 |
|
|
35 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
36 |
if editBlock.getCurrentRecord().isInserted(): |
if editBlock.getCurrentRecord().isInserted(): |
37 |
editBlock.commit() |
editBlock.commit() |
38 |
editBlock.jumpRecord(2) |
editBlock.gotoRecord(2) |
39 |
else: |
else: |
40 |
editBlock.commit() |
editBlock.commit() |
41 |
</trigger> |
</trigger> |
42 |
|
|
43 |
|
|
44 |
<trigger name="deleteTrigger" type="NAMED"> |
<trigger name="deleteTrigger" type="NAMED"> |
45 |
import hack |
import hack |
57 |
hack.confirmPageChanges(self, 'commitTrigger', editBlock) |
hack.confirmPageChanges(self, 'commitTrigger', editBlock) |
58 |
</trigger> |
</trigger> |
59 |
|
|
60 |
<trigger name="newTrigger" type="NAMED"> |
<logic> |
61 |
from hack import confirmRollback |
<block name="searchBlock" datasource="searchDataSource" restrictInsert=""> |
62 |
|
@{ $y=0 }@ |
63 |
confirmRollback (self, editBlock, 'commitTrigger') |
@_DO_SEARCHERS_@ |
64 |
</trigger> |
<field name="searchEntry@ $i @Field"/> |
65 |
|
@_DONE_@ |
66 |
|
</block> |
67 |
|
<block name="resultBlock" datasource="resultDataSource"> |
68 |
|
<field name="@ $id @" field="@ $id @"/> |
69 |
|
@{ $y++ }@ |
70 |
|
@_DO_SEARCHERS_@ |
71 |
|
<field name="@ $search_by[$i] @" field="@ $search_by[$i] @" /> |
72 |
|
@_DONE_@ |
73 |
|
</block> |
74 |
|
<block name="editBlock" datasource="editDataSource"> |
75 |
|
<field name="@ $id @" field="@ $id @"/> |
76 |
|
@{ $h=0; $y=1 }@ |
77 |
|
@_DO_FIELDS_@ |
78 |
|
<field name="@ $fqdn[$i] @" field="@ $fqdn[$i] @"/> |
79 |
|
@{ $y += $height[$i] }@ |
80 |
|
@_DONE_@ |
81 |
|
</block> |
82 |
|
</logic> |
83 |
|
|
84 |
|
<layout xmlns:c="GNUe:Layout:Char" tabbed="top" c:height="18" |
85 |
|
c:width="84"> |
86 |
<page name="@ $page{search} @"> |
<page name="@ $page{search} @"> |
87 |
<trigger type="Pre-Focusout"> |
<trigger type="Pre-Focusout"> |
88 |
editBlock.processRollback() |
editBlock.rollback() |
89 |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
90 |
editBlock.initQuery() |
editBlock.initQuery() |
91 |
editBlock.idEntry = ("%s" % resultBlock.idREntry) |
editBlock.idEntry = ("%s" % resultBlock.idREntry) |
92 |
editBlock.processQuery() |
editBlock.executeQuery() |
93 |
</trigger> |
</trigger> |
|
<block name="searchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert=""> |
|
94 |
@{ $y=0 }@ |
@{ $y=0 }@ |
95 |
@_DO_SEARCHERS_@ |
@_DO_SEARCHERS_@ |
96 |
<label x="1" y="@ ++$y @" text="@ $search_label[$i] @"/> |
<label c:x="1" c:y="@ ++$y @" text="@ $search_label[$i] @"/> |
97 |
<entry x="1" y="@ ++$y @" name="searchEntry@ $i @" width="35"/> |
<entry block="searchBlock" field="searchEntry@ $i @Field" |
98 |
|
name=" |
99 |
|
searchEntry@ $i @" c:x="1" c:y="@ ++$y @" c:width="35" /> |
100 |
@_DONE_@ |
@_DONE_@ |
101 |
<button x="37" y="@ $y++ @" trigger="searchTrigger" width="9" label="Buscar" |
<button c:x="37" c:y="@ $y++ @" c:width="9" label="Buscar" |
102 |
name="searchBtn" height="1"/> |
name="searchBtn" c:height="1"> |
103 |
</block> |
<trigger type="On-Action" src="searchTrigger" /> |
104 |
<block name="resultBlock" datasource="resultDataSource"> |
</button> |
105 |
<entry x="1" y="@ $y++ @" name="idREntry" field="@ $id @" hidden="y"/> |
<entry block="resultBlock" c:x="1" c:y="@ $y++ @" name="idREntry" field="@ $id @" hidden="y"/> |
106 |
@_DO_SEARCHERS_@ |
@_DO_SEARCHERS_@ |
107 |
<label x="@ $search_x[$i] @" y="@ $y @" text="@ $result_label[$i] @"/> |
<label c:x="@ $search_x[$i] @" c:y="@ $y @" text="@ $result_label[$i] @"/> |
108 |
@_DONE_@ |
@_DONE_@ |
109 |
@{ $y++ }@ |
@{ $y++ }@ |
110 |
@_DO_SEARCHERS_@ |
@_DO_SEARCHERS_@ |
111 |
<entry x="@ $search_x[$i] @" y="@ $y @" name="listEntry@ $i @" |
<entry block="resultBlock" c:x="@ $search_x[$i] @" c:y="@ $y @" name="listEntry@ $i @" |
112 |
field="@ $search_by[$i] @" width="@ $search_width[$i] @" rows="12"/> |
field="@ $search_by[$i] @" c:width="@ $search_width[$i] @" rows="12"/> |
113 |
@_DONE_@ |
@_DONE_@ |
114 |
<scrollbar page="12" x="81" y="@ $y @" width="3" height="12"/> |
<scrollbar block="resultBlock" page="12" c:x="81" c:y="@ $y @" c:width="3" c:height="12"/> |
115 |
</block> |
</page> |
116 |
</page> |
<page name="@ $page{edit} @"> |
117 |
<page name="@ $page{edit} @"> |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
118 |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
<entry block="editBlock" c:x="0" c:y="0" name="idEntry" field="@ $id @" hidden="y"/> |
|
<block name="editBlock" datasource="editDataSource" restrictInsert="y"> |
|
|
<entry x="0" y="0" name="idEntry" field="@ $id @" hidden="y"/> |
|
|
<button x="31" y="0" trigger="newTrigger" width="9" label="Nuevo" |
|
|
name="newButton" height="1"/> |
|
119 |
@{ $h=0; $y=1 }@ |
@{ $h=0; $y=1 }@ |
120 |
@_DO_FIELDS_@ |
@_DO_FIELDS_@ |
121 |
<label x="1" y="@ $y++ @" text="@ $label[$i] @"/> |
<label c:x="1" c:y="@ $y++ @" text="@ $label[$i] @"/> |
122 |
<entry x="1" y="@ $y @" |
<entry block="editBlock" c:x="1" c:y="@ $y @" |
123 |
width="@ $width[$i] @" |
c:width="@ $width[$i] @" |
124 |
height="@ $h = $height[$i] @" |
c:height="@ $h = $height[$i] @" |
125 |
name="@ $name[$i] @_entry" |
name="@ $fqdn[$i] @_entry" |
126 |
field="@ $fqdn[$i] @" |
field="@ $fqdn[$i] @"/> |
|
@ $fkey[$i] @/> |
|
127 |
@{ $y += $height[$i] }@ |
@{ $y += $height[$i] }@ |
128 |
@_DONE_@ |
@_DONE_@ |
129 |
<button x="1" y="@ $y @" trigger="commitTrigger" width="9" label="Aceptar" |
<button c:x="1" c:y="@ $y @" c:width="9" label="Aceptar" |
130 |
name="commitBtn" height="1"/> |
name="commitBtn" c:height="1"> |
131 |
<button x="11" y="@ $y @" trigger="deleteTrigger" width="9" label="Borrar" |
<trigger type="On-Action" src="commitTrigger" /> |
132 |
name="deleteBtn" height="1"/> |
</button> |
133 |
<button x="21" y="@ $y @" trigger="rollbackTrigger" width="9" label="Cancelar" |
<button c:x="11" c:y="@ $y @" c:width="9" label="Borrar" |
134 |
name="rollbackBtn" height="1"/> |
name="deleteBtn" c:height="1"> |
135 |
</block> |
<trigger type="On-Action" src="deleteTrigger" /> |
136 |
</page> |
</button> |
137 |
|
<button c:x="21" c:y="@ $y @" c:width="9" label="Cancelar" |
138 |
|
name="rollbackBtn" c:height="1"> |
139 |
|
<trigger type="On-Action" src="rollbackTrigger" /> |
140 |
|
</button> |
141 |
|
</page> |
142 |
|
</layout> |
143 |
</form> |
</form> |