Skip to content
This repository
Browse code

simplified code

  • Loading branch information...
commit 10c12e0abefe38d3b822c214b4cc60b064805d00 1 parent 0f03630
Andreas Weber authored January 29, 2013
2  src/mpv5/resources/languages/Panels.properties
@@ -2020,7 +2020,7 @@ MPBabelFish.transid.text=live client id
2020 2020
 MPBabelFish.transsecre.text=live client secret
2021 2021
 MPBabelFish.jButton1.text=Go
2022 2022
 wizard_FirstSettings1.jPanel1.border.title=Yabs Installation - Wizard
2023  
-wizard_FirstSettings1.jTextPane1.text=Welcome to Yabs!\nThis wizard will help you through the first steps for most yabs beginners.\nTo start, you should have downloaded the following file already:\n\n- a recent language file for yabs \n\nthis file should be available from your instalation package or openyabs.org\n\nPlease click Next when you are ready.
  2023
+wizard_FirstSettings1.jTextPane1.text=Welcome to Yabs!\nThis wizard will help you through the first steps for most yabs beginners.\nTo start, you should have downloaded the following file already:\n\n- a recent language file for yabs \n\nthis file should be available from your installation package or openyabs.org\n\nPlease click Next when you are ready.
2024 2024
 wizard_FirstSettings2.jPanel1.border.title=Yabs Installation - Wizard
2025 2025
 wizard_FirstSettings2.street._Label=Street
2026 2026
 wizard_FirstSettings2.zip._Label=Zip
2  src/mpv5/ui/dialogs/subcomponents/wizard_FirstSettings1.java
@@ -46,7 +46,7 @@ private void initComponents() {
46 46
       setLayout(new java.awt.BorderLayout());
47 47
 
48 48
       jPanel1.setBackground(new java.awt.Color(255, 255, 255));
49  
-      java.util.ResourceBundle bundle = mpv5.i18n.LanguageManager.getBundle();// NOI18N
  49
+      java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("mpv5/resources/languages/Panels"); // NOI18N
50 50
       jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_FirstSettings1.jPanel1.border.title"))); // NOI18N
51 51
       jPanel1.setName("jPanel1"); // NOI18N
52 52
 
49  src/mpv5/ui/dialogs/subcomponents/wizard_FirstSettings4.java
@@ -16,8 +16,10 @@
16 16
 import mpv5.db.common.DatabaseObject;
17 17
 import mpv5.db.common.NodataFoundException;
18 18
 import mpv5.db.common.QueryCriteria;
  19
+import mpv5.db.common.QueryCriteria2;
19 20
 import mpv5.db.common.QueryData;
20 21
 import mpv5.db.common.QueryHandler;
  22
+import mpv5.db.common.QueryParameter;
21 23
 import mpv5.db.common.SaveString;
22 24
 import mpv5.db.objects.Template;
23 25
 import mpv5.db.objects.User;
@@ -44,7 +46,6 @@
44 46
    private WizardMaster master;
45 47
    private PropertyStore nactions;
46 48
    private List<JToolBar> nbars;
47  
-   
48 49
 
49 50
    public wizard_FirstSettings4(WizardMaster w) {
50 51
       this.master = w;
@@ -139,14 +140,13 @@ public boolean next() {
139 140
             setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
140 141
             YabsViewProxy.instance().setWaiting(false);
141 142
          }
142  
-      }else{
143  
-         
  143
+      } else {
144 144
       }
145 145
       try {
146 146
          File template = new File(Main.class.getResource("/mpv5/resources/extra/invoice_de.odt").toURI());
147 147
          if (template != null) {
148 148
             String m = String.valueOf(new Date().getTime());
149  
-            
  149
+
150 150
             Template t = new Template();
151 151
             File fi = template;
152 152
             if (QueryHandler.instanceOf().clone(Context.getFiles(), this).insertFile(fi, t, new SaveString(fi.getName() + m, true))) {
@@ -157,7 +157,7 @@ public boolean next() {
157 157
          Logger.getLogger(wizard_FirstSettings4.class.getName()).log(Level.SEVERE, null, ex);
158 158
       }
159 159
 
160  
-     
  160
+
161 161
       return true;
162 162
    }
163 163
 
@@ -167,45 +167,22 @@ public void refresh() {
167 167
          int id = Integer.valueOf(xx.freeQuery(
168 168
                "select ids from templates order by dateadded desc ", MPSecurityManager.VIEW, null).getFirstEntry().toString());
169 169
          Template t = (Template) DatabaseObject.getObject(Context.getTemplate(), id);
170  
-         
  170
+
171 171
          t.setGroupsids(1);
172  
-         t.setCname("Invoice_DE_from_wizard.odt" );
  172
+         t.setCname("Invoice_DE_from_wizard.odt");
173 173
          t.setMimetype(String.valueOf(Constants.TYPE_BILL));
174 174
          t.setFormat("1,2,4,5,6");
175 175
          t.setDescription("Wizard insert");
176 176
          t.save(true);
177  
-         Object[][] UtT = new Object[0][0];
178  
-         QueryCriteria d = new QueryCriteria("templatesids", t.__getIDS());
179  
-         try {
180  
-            UtT = QueryHandler.instanceOf().clone(Context.getTemplatesToUsers()).select(d).getData();
181  
-         } catch (NodataFoundException ex) {
182  
-            Log.Debug(this, ex.getMessage());
183  
-         }
184 177
 
185 178
          User object = User.getCurrentUser();
186  
-         boolean found = false;
187  
-         for (int j = 0; j < UtT.length; j++) {
188  
-            if (Integer.parseInt(UtT[j][2].toString()) == object.__getIDS()) {
189  
-               found = true;
190  
-               UtT[j][1] = "found";
191  
-               break;
192  
-            }
193  
-         }
  179
+         QueryData c = new QueryData();
  180
+         c.add("usersids", object.__getIDS());
  181
+         c.add("templatesids", t.__getIDS());
  182
+         c.add("groupsids", 1);
  183
+         c.add("cname", t.__getIDS() + "@" + object.__getIDS() + "@" + 1);
  184
+         QueryHandler.instanceOf().clone(Context.getTemplatesToUsers()).insert(c, null);
194 185
 
195  
-         if (!found) {
196  
-            QueryData c = new QueryData();
197  
-            c.add("usersids", object.__getIDS());
198  
-            c.add("templatesids", t.__getIDS());
199  
-            c.add("groupsids", 1);
200  
-            c.add("cname", t.__getIDS() + "@" + object.__getIDS() + "@" + 1);
201  
-            QueryHandler.instanceOf().clone(Context.getTemplatesToUsers()).insert(c, null);
202  
-         }
203  
-         for (int j = 0; j < UtT.length; j++) {
204  
-            if (!UtT[j][1].equals("found")) {
205  
-               QueryCriteria d2 = new QueryCriteria("cname", UtT[j][1].toString());
206  
-               QueryHandler.instanceOf().clone(Context.getTemplatesToUsers()).delete(d2);
207  
-            }
208  
-         }
209 186
          TemplateHandler.clearCache();
210 187
       } catch (Exception ex) {
211 188
          Logger.getLogger(wizard_FirstSettings4.class.getName()).log(Level.SEVERE, null, ex);

0 notes on commit 10c12e0

Please sign in to comment.
Something went wrong with that request. Please try again.