]> Frank Brehm's Git Trees - books.git/commitdiff
Hervorhebung von Aufbewahrungsorten (z.B. fuer Ausleihe) dazu
authorFrank Brehm <frank@brehm-online.com>
Sun, 13 Feb 2011 16:33:12 +0000 (16:33 +0000)
committerFrank Brehm <frank@brehm-online.com>
Sun, 13 Feb 2011 16:33:12 +0000 (16:33 +0000)
12 files changed:
db/structure.sql
lib/FrBr/Books/Controller/Ort.pm
lib/FrBr/Books/Db/Result/Orte.pm
lib/FrBr/Books/Plugin/Book.pm
lib/FrBr/Books/Plugin/Ort.pm
root/lib/config/colors.tt2
root/lib/site/styles.css
root/src/books/list.tt2
root/src/books/view.tt2
root/src/ort/form.tt2
root/src/ort/list.tt2
root/src/ort/view.tt2

index 130b1130f59e01e965e046f5d70f4daec43c3614..22ba9e2efccf4cfb0a075c08811f04bde9899aba 100644 (file)
@@ -238,6 +238,7 @@ CREATE TABLE `orte` (
   `name` varchar(100) NOT NULL,
   `descr` text NOT NULL,
   `statisch` enum('n','y') NOT NULL DEFAULT 'n' COMMENT 'Ort darf nicht gelöscht oder verändert werden',
+  `emphased` enum('n','y') NOT NULL DEFAULT 'n' COMMENT 'Soll der Aufbewahrungsort hervorgehoben werden?',
   `created_at` datetime NOT NULL COMMENT 'Wann erstellt',
   `created_by` int(10) unsigned NOT NULL COMMENT 'Von welcher User-Id erstellt',
   `changed_at` datetime NOT NULL COMMENT 'Wann geändert',
@@ -255,6 +256,8 @@ CREATE TABLE `orte` (
 -- Dumping data for table `orte`
 --
 
+INSERT INTO `orte` (`id`, `name`, `descr`, `statisch`, `emphased`, `created_at`, `created_by`, `changed_at`, `changed_by`) VALUES
+(1, 'Ausgeliehen', 'Irgendwohin hausgeliehen', 'y', 'y', NOW(), 1, NOW(), 1)
 
 --
 -- Table structure for table `serien`
index 0fa4feb52af30fa7e0c1801a27b787b7d50e8bdd..3bf18ca583b8cb4698b7cac4d009b61b2e5da458 100644 (file)
@@ -476,6 +476,7 @@ sub check_formparams : Private {
     }
 
     $c->stash->{'ort_edit'}{'statisch'} = to_bool( $c->stash->{'ort_edit'}{'statisch'} ) ? 'y' : 'n';
+    $c->stash->{'ort_edit'}{'emphased'} = to_bool( $c->stash->{'ort_edit'}{'emphased'} ) ? 'y' : 'n';
 
     return 1;
 
@@ -520,6 +521,9 @@ sub ort_cgi2session : Private {
     # ist es statischer (nicht änderbarer) Aufbewahrungsort ?
     $c->session->{'ort_data_edit'}{'statisch'} = to_bool( $c->request->params->{'ort_statisch'} ) ? 'y' : 'n';
 
+    # ist es hervorgehobener Aufbewahrungsort ?
+    $c->session->{'ort_data_edit'}{'emphased'} = to_bool( $c->request->params->{'ort_emphased'} ) ? 'y' : 'n';
+
     return 1;
 
 }
@@ -538,6 +542,7 @@ sub ort_session2stash : Private {
     $c->stash->{'ort_edit'}{'name'}     = $c->session->{'ort_data_edit'}{'name'} if $c->session->{'ort_data_edit'}{'name'};
     $c->stash->{'ort_edit'}{'descr'}    = $c->session->{'ort_data_edit'}{'descr'};
     $c->stash->{'ort_edit'}{'statisch'} = $c->session->{'ort_data_edit'}{'statisch'};
+    $c->stash->{'ort_edit'}{'emphased'} = $c->session->{'ort_data_edit'}{'emphased'};
 
     $c->stash->{'return_target_ort_save'} = $c->session->{'return_target_ort_save'} || $c->web_path('/ort');
 
index 54e90257b97d61347464ef6567ab713cf45526ee..bb042808646390963f649ff3f2571dec9c959e9b 100644 (file)
@@ -15,6 +15,7 @@ __PACKAGE__->add_columns(
   "name"       => { data_type => "VARCHAR",  default_value => undef, is_nullable => 0, size => 100, },
   "descr"      => { data_type => "TEXT",     default_value => undef, is_nullable => 0, size => 65535, },
   "statisch"   => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
+  "emphased"   => { data_type => "ENUM",     default_value => "n",   is_nullable => 0, size => 1 },
   "created_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
   "created_by" => { data_type => "INT",      default_value => undef, is_nullable => 0, size => 10 },
   "changed_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
index 4f1d680b663645db3597a0b7cb8ab6c888028c80..9a499da6bbe0d9346ab1072bfa7986b41757cc4e 100644 (file)
@@ -93,7 +93,8 @@ Rueckgabe: Eine Array-Ref mit allen Buchtiteln, die den uebergebenen Suchkriteri
     'kurzinhalt'         => 'Bla bla bla, tolles Buch',
     'notes'              => 'naja, geht so',
     'ort_beschreibung'   => undef,
-    'ort_ist_statisch'   => undef,
+    'ort_ist_statisch'   => 'n',
+    'ort_emphased'       => 'n',
     'orts_id'            => undef,
     'ortsname'           => undef,
     'preis'              => '7.45',
@@ -361,6 +362,7 @@ sub b_get_booklist {
         'ort.name',
         'ort.descr',
         'ort.statisch',
+        'ort.emphased',
         'me.created_by',
         'created_by.vorname',
         'created_by.nachname',
@@ -396,6 +398,7 @@ sub b_get_booklist {
         'ortsname',
         'ort_beschreibung',
         'ort_ist_statisch',
+        'ort_emphased',
         'created_by',
         'created_by_vorname',
         'created_by_nachname',
@@ -436,6 +439,7 @@ sub b_get_booklist {
         $buch->{'ortsname'}           = $book->get_column('ortsname');
         $buch->{'ort_beschreibung'}   = $book->get_column('ort_beschreibung');
         $buch->{'ort_ist_statisch'}   = $book->get_column('ort_ist_statisch');
+        $buch->{'ort_emphased'}       = $book->get_column('ort_emphased');
 
         $buch->{'id_created_by'}   = $book->get_column('created_by');
         $buch->{'created_at'}      = $book->get_column('created_at');
index 96181ff54121143adeb739c3321427d26816c522..41d9a8495cd551fb1184e1a1057e40884f3c4b1e 100644 (file)
@@ -57,6 +57,7 @@ Rueckgabe: Eine Array-Ref von Hash-Refs mit allen Aufbewahrungsorten, die den ue
         'name'            => 'Ausgeliehen',
         'descr'           => '',
         'statisch'        => 'y',
+        'emphased'        => 'y',
                'count_books'     => 16,
         'created_at'      => '2010-02-22 12:13:14',
         'id_created_by'   => 1,
@@ -153,6 +154,7 @@ sub b_get_ortsliste {
         'me.name',
         'me.descr',
         'me.statisch',
+        'me.emphased',
         'me.created_by',
         'created_by.vorname',
         'created_by.nachname',
@@ -168,6 +170,7 @@ sub b_get_ortsliste {
         'name',
         'descr',
         'statisch',
+        'emphased',
         'created_by',
         'created_by_vorname',
         'created_by_nachname',
@@ -194,6 +197,7 @@ sub b_get_ortsliste {
         $ort->{'name'}        = $ort_rs->name();
         $ort->{'descr'}       = $ort_rs->descr();
         $ort->{'statisch'}    = $ort_rs->statisch();
+        $ort->{'emphased'}    = $ort_rs->emphased();
         $ort->{'count_books'} = $ort_rs->get_column('count_books');
 
         $ort->{'id_created_by'}   = $ort_rs->get_column('created_by');
@@ -379,6 +383,7 @@ sub b_save_ort {
        $row->{'descr'} = defined $tmp ? $tmp : undef;
 
     $row->{'statisch'} = to_bool( $ort->{'statisch'} ) ? 'y' : 'n';
+    $row->{'emphased'} = to_bool( $ort->{'emphased'} ) ? 'y' : 'n';
 
     my $user_id = $c->stash->{'current_user_id'} || 1;
     $row->{'changed_at'} = \'NOW()';
index 0a7de3939a63a297ab910334503e27812f7ab00a..17fe55c841f2ce01c09820bad44a360b62f728ce 100644 (file)
@@ -61,6 +61,7 @@
         line            = site.rgb.dunkelgraugelb
         message         = site.rgb.green
         error           = site.rgb.red
+        emphased        = site.rgb.rotbraun
         warn            = site.rgb.darkgreen
         alink           = site.rgb.darkblue
         statusbarbg     = site.rgb.mittelmgenta
index 3a32cefd79c8fde2a9db6869739697f46987835d..0f3270f780f505c520efbb9bdfc075f26cf8b08f 100644 (file)
@@ -177,6 +177,11 @@ SPAN.book_orgtitle {
     font-style:         italic;
 }
 
+SPAN.emphased {
+    font-weight:        bold;
+    color:              [% site.col.emphased %];
+}
+
 DIV.error {
     white-space:        pre;
 }
index 5ed0113c923d343c29c9ebdb83995320098ee098..dd73aa70423e0ec3370f47641e8ba36ea466e9a0 100644 (file)
@@ -69,7 +69,7 @@
     <td class="[% rowstyle %]">[% book.title %][% IF book.untertitel %]<br /><span class="book_subtitle">[% book.untertitel %]</span>[% END %][% IF book.title_original %]<br /><span class="book_orgtitle">("[% book.title_original %]")</span>[% END %]</td>
     <td class="[% rowstyle %]">[% tt_cat = [ ]; tt_cat.push(cat) FOREACH cat = book.kategorien %][% tt_cat.join(',<br />') %]</td>
     <td class="[% rowstyle %]">[% book.verlagsname_short %]</td>
-    <td class="[% rowstyle %]">[% IF book.orts_id %][% book.ortsname %][% ELSE %]unbekannt[% END %]</td>
+    <td class="[% rowstyle %]">[% IF book.orts_id %][% IF book.ort_emphased == 'y' %]<span class="emphased">[% END %][% book.ortsname %][% IF book.ort_emphased == 'y' %]</span>[% END %][% ELSE %]unbekannt[% END %]</td>
     <td class="[% rowstyle %] button"><a href="[% path('/books/view') %]?view_book_id=[% book.id %]">Ansehen</a></td>
     [% IF Catalyst.user_exists %]<td class="[% rowstyle %] button"><a href="[% path('/books/edit') %]?edit_book_id=[% book.id %]">Ändern</a></td>
     <td class="[% rowstyle %] button"><a href="[% path('/books/delete') %]?delete_book_id=[% book.id %]">Löschen</a></td>[% END %]
index b00e119276da769b212df6efc29dda51dbc66213..84c4b9055f1fccece7c44dcc4c6f9dda5f08afab 100644 (file)
@@ -31,7 +31,8 @@
       'name_created_by'    => 'Frank Brehm',
       'notes'              => 'tolles Buch, wie gesagt',
       'ort_beschreibung'   => undef,
-      'ort_ist_statisch'   => undef,
+      'ort_ist_statisch'   => 'n',
+      'ort_emphased'       => 'n',
       'orts_id'            => undef,
       'ortsname'           => undef,
       'preis'              => '7.45',
@@ -76,7 +77,7 @@ Buchanzeige -->
     <td>[% book.verlagsname_long | html %]</td>
   </tr><tr>
     <th>Aufbewahrungsort:</th>
-    <td>[% book.ortsname | html %]</td>
+    <td>[% IF book.ort_emphased == 'y' %]<span class="emphased">[% END %][% book.ortsname | html %][% IF book.ort_emphased == 'y' %]</span>[% END %]</td>
   </tr><tr>
     <th>Bindungsart:</th>
     <td>[% book.bindungsart | html %]</td>
index 7db0ffb0c2709a5a6694f551aeb7657bcb6b7f29..fdf64d8fa1f2b9449c4b9a6fa74ad97a8333adf0 100644 (file)
@@ -25,6 +25,12 @@ Aufbewahrungsort-Formular -->
       <td><input type="text" name="orts_name" size="50" maxlength="100" value="[% ort_edit.name | html %]" /></td>
     </tr><tr>
       <td colspan="2">&nbsp;</td>
+    </tr><tr>
+      <th>Hervorgehobene Darstellung:</th>
+      <td><input type="radio" name="ort_emphased" id="ort_em_off" value="0"[%- IF ort_edit.emphased != 'y' %] checked[% END %]><label for="ort_em_off">Nein</label>&nbsp;&nbsp;&nbsp;
+          <input type="radio" name="ort_emphased" id="ort_em_on" value="1"[%- IF ort_edit.emphased == 'y' %] checked[% END %]><label for="ort_em_on">Ja</label>
+    </tr><tr>
+      <td colspan="2">&nbsp;</td>
     </tr><tr>
       <th>Beschreibung:</th>
       <td><textarea name="orts_descr" cols="50" rows="10">[% ort_edit.descr | html %]</textarea></td>
index b49cf5988d15010824363ad0f3bdcb182b9dc67b..b90776fcb0e9221a7657655b3067356402e7ccde 100644 (file)
@@ -42,7 +42,7 @@
   </tr>[% PROCESS navrow %]
 [% rowstyle = 'even' %][%- FOREACH ort IN orte -%]
   <tr>
-    <td class="[% rowstyle %]">[% ort.name %]</td>
+    <td class="[% rowstyle %]">[% IF ort.emphased == 'y' %]<span class="emphased">[% END %][% ort.name %][% IF ort.emphased == 'y' %]</span>[% END %]</td>
     <td class="[% rowstyle %]">[% ort.descr %]</td>
     <td class="[% rowstyle %]" style="text-align: right;">[% ort.count_books %]</td>
     <td class="button [% rowstyle %]"><a href="[% path('/ort/view') %]?view_orts_id=[% ort.id %]">Ansehen</a></td>
index 9bc03f41bb9dcf97133a0cbaf3f183acfa7beecf..dcc533eebd46f1455c0300d3fd56af78bef975d0 100644 (file)
@@ -15,6 +15,7 @@
                'id'              => '1',
                'name'            => 'Ausgeliehen',
         'statisch'        => 'y',
+        'emphased'        => 'y',
         'changed_at'      => '2010-02-25 21:45:18',
         'created_at'      => '2010-02-25 21:45:18',
         'id_changed_by'   => '1',
@@ -68,6 +69,9 @@ Anzeige Aufbewahrungsort -->
   </tr><tr>
     <th>Aufbewahrungsort:</th>
     <td>[%- ort.name | html -%]</td>
+  </tr><tr>
+    <th>Hervorgehobene Darstellung:</th>
+    <td>[% IF ort.emphased == 'y' %]Ja[% ELSE %]Nein[% END %]</td>
   </tr><tr>
     <th>Beschreibung:</th>
     <td>[%- ort.descr | html %]</td>