Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 11 Oct 2012 12:44:49 +0000 (14:44 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 11 Oct 2012 12:44:49 +0000 (14:44 +0200)
12 files changed:
SL/CT.pm
css/kivitendo/main.css
templates/webpages/acctranscorrections/analyze_filter.html
templates/webpages/acctranscorrections/delete_transaction.html
templates/webpages/acctranscorrections/delete_transaction_confirmation.html
templates/webpages/admin/edit_groups.html
templates/webpages/admin/list_users.html
templates/webpages/am/edit_templates.html
templates/webpages/common/show_vc_details.html
templates/webpages/report_generator/csv_export_options.html
templates/webpages/report_generator/html_report.html
templates/webpages/report_generator/pdf_export_options.html

index 0019e06..de10623 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -368,21 +368,7 @@ sub save_customer {
     );
   do_query( $form, $dbh, $query, @values );
 
-  $query = undef;
-  my @columns = qw(cp_title cp_givenname cp_name cp_email cp_phone1 cp_phone2 cp_abteilung cp_fax
-                   cp_mobile1 cp_mobile2 cp_satphone cp_satfax cp_project cp_privatphone cp_privatemail cp_birthday cp_gender
-                   cp_street cp_zipcode cp_city);
-  @values     = map { $_ eq 'cp_gender' ? ($form->{$_} eq 'f' ? 'f' : 'm') : $form->{$_} } @columns;
-
-  if ( $form->{cp_id} ) {
-    $query = qq|UPDATE contacts SET | . join(', ', map { "${_} = ?" } @columns) . qq| WHERE cp_id = ?|;
-    push @values, $form->{cp_id};
-
-  } elsif ( $form->{cp_name} || $form->{cp_givenname} ) {
-    $query = qq|INSERT INTO contacts (| . join(', ', 'cp_cv_id', @columns) . qq|) VALUES (?, | . join(', ', ('?') x scalar(@columns)) . qq|)|;
-    unshift @values, $form->{id};
-  }
-  do_query( $form, $dbh, $query, @values ) if ($query);
+  $form->{cp_id} = $self->_save_contact($form, $dbh);
 
   # add shipto
   $form->add_shipto( $dbh, $form->{id}, "CT" );
@@ -530,76 +516,7 @@ sub save_vendor {
     );
   do_query($form, $dbh, $query, @values);
 
-  $query = undef;
-  if ( $form->{cp_id} ) {
-    $query = qq|UPDATE contacts SET | .
-      qq|cp_title = ?,  | .
-      qq|cp_givenname = ?, | .
-      qq|cp_name = ?, | .
-      qq|cp_email = ?, | .
-      qq|cp_phone1 = ?, | .
-      qq|cp_phone2 = ?, | .
-      qq|cp_abteilung = ?, | .
-      qq|cp_fax = ?, | .
-      qq|cp_mobile1 = ?, | .
-      qq|cp_mobile2 = ?, | .
-      qq|cp_satphone = ?, | .
-      qq|cp_satfax = ?, | .
-      qq|cp_project = ?, | .
-      qq|cp_privatphone = ?, | .
-      qq|cp_privatemail = ?, | .
-      qq|cp_birthday = ?, | .
-      qq|cp_gender = ? | .
-      qq|WHERE cp_id = ?|;
-    @values = (
-      $form->{cp_title},
-      $form->{cp_givenname},
-      $form->{cp_name},
-      $form->{cp_email},
-      $form->{cp_phone1},
-      $form->{cp_phone2},
-      $form->{cp_abteilung},
-      $form->{cp_fax},
-      $form->{cp_mobile1},
-      $form->{cp_mobile2},
-      $form->{cp_satphone},
-      $form->{cp_satfax},
-      $form->{cp_project},
-      $form->{cp_privatphone},
-      $form->{cp_privatemail},
-      $form->{cp_birthday},
-      $form->{cp_gender} eq 'f' ? 'f' : 'm',
-      $form->{cp_id}
-      );
-  } elsif ( $form->{cp_name} || $form->{cp_givenname} ) {
-    $query =
-      qq|INSERT INTO contacts ( cp_cv_id, cp_title, cp_givenname,  | .
-      qq|  cp_name, cp_email, cp_phone1, cp_phone2, cp_abteilung, cp_fax, cp_mobile1, | .
-      qq|  cp_mobile2, cp_satphone, cp_satfax, cp_project, cp_privatphone, cp_privatemail, | .
-      qq|  cp_birthday, cp_gender) | .
-      qq|VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
-    @values = (
-      $form->{id},
-      $form->{cp_title},
-      $form->{cp_givenname},
-      $form->{cp_name},
-      $form->{cp_email},
-      $form->{cp_phone1},
-      $form->{cp_phone2},
-      $form->{cp_abteilung},
-      $form->{cp_fax},
-      $form->{cp_mobile1},
-      $form->{cp_mobile2},
-      $form->{cp_satphone},
-      $form->{cp_satfax},
-      $form->{cp_project},
-      $form->{cp_privatphone},
-      $form->{cp_privatemail},
-      $form->{cp_birthday},
-      $form->{cp_gender}
-      );
-  }
-  do_query($form, $dbh, $query, @values) if ($query);
+  $form->{cp_id} = $self->_save_contact($form, $dbh);
 
   # add shipto
   $form->add_shipto( $dbh, $form->{id}, "CT" );
@@ -627,6 +544,34 @@ sub save_vendor {
   return $rc;
 }
 
+sub _save_contact {
+  my ($self, $form, $dbh) = @_;
+
+  return undef unless $form->{cp_id} || $form->{cp_name} || $form->{cp_givenname};
+
+  my @columns = qw(cp_title cp_givenname cp_name cp_email cp_phone1 cp_phone2 cp_abteilung cp_fax
+                   cp_mobile1 cp_mobile2 cp_satphone cp_satfax cp_project cp_privatphone cp_privatemail cp_birthday cp_gender
+                   cp_street cp_zipcode cp_city);
+  my @values  = map { $_ eq 'cp_gender' ? ($form->{$_} eq 'f' ? 'f' : 'm') : $form->{$_} } @columns;
+
+  my ($query, $cp_id);
+  if ($form->{cp_id}) {
+    $query = qq|UPDATE contacts SET | . join(', ', map { "${_} = ?" } @columns) . qq| WHERE cp_id = ?|;
+    push @values, $form->{cp_id};
+    $cp_id = $form->{cp_id};
+
+  } else {
+    ($cp_id) = selectrow_query($form, $dbh, qq|SELECT nextval('id')|);
+
+    $query = qq|INSERT INTO contacts (| . join(', ', @columns, 'cp_cv_id', 'cp_id') . qq|) VALUES (| . join(', ', ('?') x (2 + scalar @columns)) . qq|)|;
+    push @values, $form->{id}, $cp_id;
+  }
+
+  do_query($form, $dbh, $query, @values);
+
+  return $cp_id;
+}
+
 sub delete {
   $main::lxdebug->enter_sub();
 
index 7b7f4fa..9714d4a 100644 (file)
@@ -166,7 +166,7 @@ body.menu {
        border-width: thin;
 }
 /*    Headings */
-.listtop, h1, .tabcontent .listheading {
+.listtop, h1 {
     font-size:125%;
        background-color: #006400;
        text-align: left;
@@ -192,21 +192,13 @@ body.menu {
 } */
 .listheading {
        padding: 0.2em;
-       background-color: #006400;
-       color: white;
+       background-color: #EBEBEB;
+       color: #006400;
        font-weight: bolder;
        text-align: left;
        border-style: none;
 }
 
-.listheading A:link, .listheading A:visited, .listheading A:active {
-       color: white;
-}
-
-.listheading th {
-  color: white;
-}
-
 /* .listheadingcontent {
        background-color: #EBEBEB;
        color: #006400;
index 2aa769d..db4198e 100644 (file)
@@ -2,7 +2,7 @@
 [% USE HTML %]
 [%- USE L %]
 <body>
- <p><div class="listheading">[% title %]</div></p>
+ <h1>[% title %]</h1>
 
  <p>
   [% 'Earlier versions of kivitendo contained bugs which might have led to wrong entries in the general ledger.' | $T8 %]
index 2c461b0..ad9a076 100644 (file)
@@ -2,7 +2,7 @@
 [% USE HTML %]
 [% USE LxERP %]
 <body>
- <p><div class="listheading">[% title %]</div></p>
+ <h1>[% title %]</h1>
 
  <p>
   [%- IF module == 'ar' %]
index c075471..63181fc 100644 (file)
@@ -2,7 +2,7 @@
 [% USE HTML %]
 [% USE LxERP %]
 <body>
- <p><div class="listheading">[% title %]</div></p>
+ <h1>[% title %]</h1>
 
  <p>
   [%- IF module == 'ar' %]
index 6056107..d893a58 100644 (file)
@@ -8,7 +8,8 @@
 
   <p><a href="admin.pl?action=login">[% 'Back' | $T8 %]</a></p>
 
- <div class="listheading">[% 'Add a new group' | $T8 %]</div>
+ <h1>[% 'Add a new group' | $T8 %]</h1>
+
  <form method="post" action="admin.pl">
  <br>
   <table border="0">
   </table>
    <input type="hidden" name="add_nextsub" value="add_group">
    <p><input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]"></p>
-  <hr>
  </form>
 
+ <h1>[% 'Edit and delete a group' | $T8 %]</h1>
 
  <form name="Form" method="post" action="admin.pl">
-  <div class="listheading">[% 'Edit and delete a group' | $T8 %]</div>
-
   [% IF num_groups %]
   <p>
    <select name="group_id" size="10">
@@ -46,9 +45,7 @@
   </p>
  </form>
 
- <hr size="2" noshade>
-
- <div class="listheading">[% 'Group membership' | $T8 %]</div>
+ <h1>[% 'Group membership' | $T8 %]</h1>
 
  <p>[% 'Edit the membership of all users in all groups:' | $T8 %]</p>
 
@@ -60,7 +57,5 @@
 
  </form>
 
- <hr size="2" noshade>
-
 </body>
 </html>
index 39883d1..ea8e8d7 100644 (file)
@@ -1,9 +1,9 @@
 [%- USE T8 %]
 [% USE HTML %]<body class="admin" onload="">
 
- <form method="post" action="admin.pl">
+ <h1>[% title %]</h1>
 
 <div class="listtop" width="100%">[% title %]</div>
<form method="post" action="admin.pl">
 
   <p>
    <table width="100%">
   </div>
  </form>
 
+ <h1>[% 'User Login' | $T8 %]</h1>
+
  <form method="post" action="controller.pl">
   <input type="hidden" name="action" value="LoginScreen/login">
 
-  <div class="listheading">[% 'User Login' | $T8 %]</div>
-
   <table border="0">
    <tr>
     <th align="right">[% 'Login Name' | $T8 %]</th>
index a25abc6..bbce544 100644 (file)
@@ -1,7 +1,7 @@
 [%- USE T8 %]
 [% USE HTML %]<body>
 
- <div class="listheading">[% title %]</div>
+ <h1>[% title %]</h1>
 
   [% IF type == 'templates' %]
    <p style="text-align: right;">[<a href="doc/html/ch03s02.html" target="_blank" title="[% 'Open in new window' | $T8 %]">[% 'Help Template Variables' | $T8 %]</a>]</p>
index 49363ea..a0abdc2 100644 (file)
@@ -31,7 +31,7 @@
 
  [%- INCLUDE jump_block CONTACTS = CONTACTS, SHIPTO = SHIPTO %]
 
- <a name="billing"><div class="listheading">[% 'Billing Address' | $T8 %]</div></a>
+ <a name="billing"><h1>[% 'Billing Address' | $T8 %]</h1></a>
 
  <table>
   <tr>
 
   [%- INCLUDE jump_block CONTACTS = CONTACTS, SHIPTO = SHIPTO %]
 
-  <a name="shipping[% loop.count %]"><div class="listheading">[% 'Shipping Address' | $T8 %] &quot;[% HTML.escape(row.shiptoname) %]&quot;</div></a>
+  <a name="shipping[% loop.count %]"><h1>[% 'Shipping Address' | $T8 %] &quot;[% HTML.escape(row.shiptoname) %]&quot;</h1></a>
 
   <table>
    <tr>
 
   [%- INCLUDE jump_block CONTACTS = CONTACTS, SHIPTO = SHIPTO %]
 
-  <a name="contact[% loop.count %]"><div class="listheading">[% 'Contact Person' | $T8 %] &quot;[% HTML.escape(row.cp_name) %]&quot;</div></a>
+  <a name="contact[% loop.count %]"><h1>[% 'Contact Person' | $T8 %] &quot;[% HTML.escape(row.cp_name) %]&quot;</h1></a>
 
   <table>
    <tr>
index 70c39af..0d49f28 100644 (file)
@@ -1,7 +1,7 @@
 [%- USE T8 %]
 [% USE HTML %]<body>
 
- <div class="listheading" width="100%">[% HTML.escape(title) %]</div>
+ <h1>[% HTML.escape(title) %]</h1>
 
  <form action="[% HTML.escape(script) %]" method="post" name="report_generator_form">
 
index a35cfb6..332c5ef 100644 (file)
@@ -18,7 +18,7 @@
   <p>[% MESSAGE %]</p>
  [% END %]
 
- <div class="listtop" width="100%">[% TITLE %]</div>
+ <h1>[% TITLE %]</h1>
 
  [% IF TOP_INFO_TEXT %]
   <p>[% TOP_INFO_TEXT %]</p>
index 5af4de8..8956ed7 100644 (file)
@@ -3,7 +3,7 @@
 
  [%- SET default_margin = LxERP.format_amount(1.5) %]
 
- <div class="listheading" width="100%">[% HTML.escape(title) %]</div>
+ <h1>[% HTML.escape(title) %]</h1>
 
  <form action="[% HTML.escape(script) %]" method="post" name="report_generator_form">