Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e7214232

Von Moritz Bunkus vor etwa 18 Jahren hinzugefügt

  • ID e7214232350249fdab6da3445442ff85891a0d7c
  • Vorgänger d69fdcda
  • Nachfolger 1c234944

ADR entfernt (kam aus Kundenprojekt und ist nicht fuer die allgemeine Lx-Office-Variante gedacht).

Unterschiede anzeigen:

bin/mozilla/am.pl
2267 2267
}
2268 2268

  
2269 2269

  
2270
sub add_adr {
2271
  $lxdebug->enter_sub();
2272

  
2273
  $form->{title} = "Add";
2274

  
2275
  $form->{callback} =
2276
    "$form->{script}?action=add_adr&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2277
    unless $form->{callback};
2278

  
2279
  &adr_header;
2280
  &form_footer;
2281

  
2282
  $lxdebug->leave_sub();
2283
}
2284

  
2285
sub edit_adr {
2286
  $lxdebug->enter_sub();
2287

  
2288
  $form->{title} = "Edit";
2289

  
2290
  AM->get_adr(\%myconfig, \%$form);
2291

  
2292
  &adr_header;
2293

  
2294
  $form->{orphaned} = 1;
2295
  &form_footer;
2296

  
2297
  $lxdebug->leave_sub();
2298
}
2299

  
2300
sub list_adr {
2301
  $lxdebug->enter_sub();
2302

  
2303
  AM->adr(\%myconfig, \%$form);
2304

  
2305
  $form->{callback} =
2306
    "$form->{script}?action=list_adr&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2307

  
2308
  $callback = $form->escape($form->{callback});
2309

  
2310
  $form->{title} = $locale->text('ADR');
2311

  
2312
  @column_index = qw(adr_code adr_description);
2313

  
2314
  $column_header{adr_description} =
2315
      qq|<th class=listheading width=60%>|
2316
    . $locale->text('ADR Description')
2317
    . qq|</th>|;
2318
  $column_header{adr_code} =
2319
      qq|<th class=listheading width=10%>|
2320
    . $locale->text('ADR Code')
2321
    . qq|</th>|;
2322

  
2323
  $form->header;
2324

  
2325
  print qq|
2326
<body>
2327

  
2328
<table width=100%>
2329
  <tr>
2330
    <th class=listtop>$form->{title}</th>
2331
  </tr>
2332
  <tr height="5"></tr>
2333
  <tr>
2334
    <td>
2335
      <table width=100%>
2336
        <tr class=listheading>
2337
|;
2338

  
2339
  map { print "$column_header{$_}\n" } @column_index;
2340

  
2341
  print qq|
2342
        </tr>
2343
|;
2344

  
2345
  foreach $ref (@{ $form->{ALL} }) {
2346

  
2347
    $i++;
2348
    $i %= 2;
2349

  
2350
    print qq|
2351
        <tr valign=top class=listrow$i>
2352
|;
2353

  
2354

  
2355
    $column_data{adr_code} =
2356
      qq|<td><a href=$form->{script}?action=edit_adr&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{adr_code}</td>|;
2357
    $column_data{adr_description}           = qq|<td align=left>$ref->{adr_description}</td>|;
2358

  
2359

  
2360
    map { print "$column_data{$_}\n" } @column_index;
2361

  
2362
    print qq|
2363
	</tr>
2364
|;
2365
  }
2366

  
2367
  print qq|
2368
      </table>
2369
    </td>
2370
  </tr>
2371
  <tr>
2372
  <td><hr size=3 noshade></td>
2373
  </tr>
2374
</table>
2375

  
2376
<br>
2377
<form method=post action=$form->{script}>
2378

  
2379
<input name=callback type=hidden value="$form->{callback}">
2380

  
2381
<input type=hidden name=type value=adr>
2382

  
2383
<input type=hidden name=path value=$form->{path}>
2384
<input type=hidden name=login value=$form->{login}>
2385
<input type=hidden name=password value=$form->{password}>
2386

  
2387
<input class=submit type=submit name=action value="|
2388
    . $locale->text('Add') . qq|">|;
2389

  
2390
  if ($form->{menubar}) {
2391
    require "$form->{path}/menu.pl";
2392
    &menubar;
2393
  }
2394

  
2395
  print qq|
2396

  
2397
  </form>
2398

  
2399
  </body>
2400
  </html>
2401
|;
2402

  
2403
  $lxdebug->leave_sub();
2404
}
2405

  
2406
sub adr_header {
2407
  $lxdebug->enter_sub();
2408

  
2409
  $form->{title}    = $locale->text("$form->{title} ADR");
2410

  
2411
  # $locale->text('Add ADR')
2412
  # $locale->text('Edit ADR')
2413

  
2414
  $form->{adr_description} =~ s/\"/&quot;/g;
2415
  $form->{adr_code} =~ s/\"/&quot;/g;
2416

  
2417

  
2418
  $form->header;
2419

  
2420
  print qq|
2421
<body>
2422

  
2423
<form method=post action=$form->{script}>
2424

  
2425
<input type=hidden name=id value=$form->{id}>
2426
<input type=hidden name=type value=adr>
2427

  
2428
<table width=100%>
2429
  <tr>
2430
    <th class=listtop colspan=2>$form->{title}</th>
2431
  </tr>
2432
  <tr height="5"></tr>
2433
  <tr>
2434
    <th align=right>| . $locale->text('ADR Code') . qq|</th>
2435
    <td><input name=adr_code size=30 value="$form->{adr_code}"></td>
2436
  <tr>
2437
  <tr>
2438
    <th align=right>| . $locale->text('ADR Description') . qq|</th>
2439
    <td><input name=adr_description size=60 value="$form->{adr_description}"></td>
2440
  </tr>
2441
  <td colspan=2><hr size=3 noshade></td>
2442
  </tr>
2443
</table>
2444
|;
2445

  
2446
  $lxdebug->leave_sub();
2447
}
2448

  
2449
sub save_adr {
2450
  $lxdebug->enter_sub();
2451

  
2452
  $form->isblank("adr_description", $locale->text('ADR Description missing!'));
2453
  $form->isblank("adr_code", $locale->text('ADR Code missing!'));
2454
  AM->save_adr(\%myconfig, \%$form);
2455
  $form->redirect($locale->text('ADR saved!'));
2456

  
2457
  $lxdebug->leave_sub();
2458
}
2459

  
2460

  
2461
sub delete_adr {
2462
  $lxdebug->enter_sub();
2463

  
2464
  AM->delete_adr(\%myconfig, \%$form);
2465
  $form->redirect($locale->text('ADR deleted!'));
2466

  
2467
  $lxdebug->leave_sub();
2468
}
2469

  
2470

  
2471 2270
sub add_payment {
2472 2271
  $lxdebug->enter_sub();
2473 2272

  

Auch abrufbar als: Unified diff