]> mj.ucw.cz Git - pciids.git/commitdiff
Another attempt to reorder admin columns
authorMichal Vaner <vorner@ucw.cz>
Thu, 16 Oct 2008 20:48:13 +0000 (22:48 +0200)
committerMichal Vaner <vorner@ucw.cz>
Thu, 16 Oct 2008 20:48:13 +0000 (22:48 +0200)
This time without breaking the IDs behind the scene

PciIds/Html/Admin.pm

index 0f8c1599775d6c4201e9096efeec2840324e5756..7b73cb4dff2a987fc428d0982cd86a4db8497160 100644 (file)
@@ -46,9 +46,13 @@ sub mailEncode( $$ ) {
 
 sub genHist( $$$$$$$$$$$ ) {
        my( $class, $email, $login, $time, $name, $note, $disc, $selname, $selvalue, $delname, $delvalue ) = @_;
 
 sub genHist( $$$$$$$$$$$ ) {
        my( $class, $email, $login, $time, $name, $note, $disc, $selname, $selvalue, $delname, $delvalue ) = @_;
-       print "<tr class='$class'><td>";
-       print "<span class='author'>".mailEncode( $email, $login )."<br></span>" if( defined $email );
-       print "<span class='time'>".safeEncode( $time )."</span>";
+       print "<tr class='$class'>";
+       print "<td class='selects'><input type='radio' name='$selname' value='$selvalue'>\n";
+       if( defined $delname ) {
+               print "<td class='deletes'><input type='checkbox' name='$delname' value='$delvalue'>\n";
+       } else {
+               print "<td class='empty'>\n";
+       }
        print "<td>";
        if( defined $name ) {
                if( $name eq '' ) {
        print "<td>";
        if( defined $name ) {
                if( $name eq '' ) {
@@ -59,13 +63,19 @@ sub genHist( $$$$$$$$$$$ ) {
        }
        print "<span class='note'>Note: ".encode( $note )."<br></span>" if defined $note && $note ne '';
        print safeEncode( $disc );
        }
        print "<span class='note'>Note: ".encode( $note )."<br></span>" if defined $note && $note ne '';
        print safeEncode( $disc );
-       print "<td class='selects'><input type='radio' name='$selname' value='$selvalue'>\n";
-       print "<td class='deletes'><input type='checkbox' name='$delname' value='$delvalue'>\n" if defined $delname
+       print "<td>";
+       print "<span class='author'>".mailEncode( $email, $login )."<br></span>" if( defined $email );
+       print "<span class='time'>".safeEncode( $time )."</span>";
 }
 
 sub genNewForm( $$ ) {
        my( $num, $values ) = @_;
 }
 
 sub genNewForm( $$ ) {
        my( $num, $values ) = @_;
-       print "<tr class='newhistory'><td>";
+       print "<tr class='newhistory'>";
+       print "<td class='empty'>";
+       print "<td class='deletes'><input type='checkbox' name='loc-$num-softdel' value='del'>\n";
+       print "<td><span class='newname'>Name: <input type='text' name='name-$num'></span><span class='newnote'>Note: <input type='text' name='note-$num'></span><br>\n";
+       print "<textarea id='disc-$num' name='disc-$num'></textarea>\n";
+       print "<td>";
        if( @{$values} ) {
                print "<select id='ans-$num' name='ans-$num' onchange='answer( \"$num\" );'><option value='0'>Stock answers</option>";
                my $i = 0;
        if( @{$values} ) {
                print "<select id='ans-$num' name='ans-$num' onchange='answer( \"$num\" );'><option value='0'>Stock answers</option>";
                my $i = 0;
@@ -78,9 +88,6 @@ sub genNewForm( $$ ) {
        } else {
                print "No stock answers";
        }
        } else {
                print "No stock answers";
        }
-       print "<td><span class='newname'>Name: <input type='text' name='name-$num'></span><span class='newnote'>Note: <input type='text' name='note-$num'></span><br>\n";
-       print "<textarea id='disc-$num' name='disc-$num'></textarea>\n";
-       print "<td><td class='deletes'><input type='checkbox' name='loc-$num-softdel' value='del'>\n";
 }
 
 sub loadStock() {
 }
 
 sub loadStock() {
@@ -160,24 +167,29 @@ function answer( id ) {
                        }
                        my $addr = PciIds::Address::new( $locId );
                        if( defined( $actHist ) ) {
                        }
                        my $addr = PciIds::Address::new( $locId );
                        if( defined( $actHist ) ) {
-                               print "<table class='item'>\n";
+                               print "<p><table class='item'>\n";
                        } else {
                        } else {
-                               print "<table class='unnamedItem'>\n";
+                               print "<p><table class='unnamedItem'>\n";
                        }
                        }
-                       print "<col class='author'><col class='main'><col class='controls' span='2'>\n";
-                       print "<tr class='label'><p>\n";
-                       print "<td class='path' colspan='2'>";
-                       genPathBare( $req, $addr, 1, 0, $tables );
+                       print "<col class='controls' span='2'><col class='main'><col class='author'>\n";
+                       print "<tr class='label'>\n";
+                       print "<td class='selects'>\n";
                        print "<input type='hidden' name='loc-$cnt-subcnt' value='$subcnt'>" if( $subcnt );
                        $subcnt = 0;
                        $cnt ++;
                        print "<input type='hidden' name='loc-$cnt-subcnt' value='$subcnt'>" if( $subcnt );
                        $subcnt = 0;
                        $cnt ++;
-                       print "<td class='selects'><input type='radio' name='loc-$cnt-sel' value='curr' checked='checked'>";
-                       print "<td class='deletes'><input type='checkbox' name='loc-$cnt-del' value='del'>" if hasRight( $auth->{'accrights'}, 'prune' ) || ( !defined $actHist && !$tables->hasChildren( $addr->get() ) );
+                       print "<input type='radio' name='loc-$cnt-sel' value='curr' checked='checked'>";
+                       if( hasRight( $auth->{'accrights'}, 'prune' ) || ( !defined $actHist && !$tables->hasChildren( $addr->get() ) ) ) {
+                               print "<td class='deletes'><input type='checkbox' name='loc-$cnt-del' value='del'>";
+                       } else {
+                               print "<td class='empty'>";
+                       }
+                       print "<td class='path' colspan='2'>";
+                       genPathBare( $req, $addr, 1, 0, $tables );
                        print "<input type='hidden' name='loc-$cnt' value='$locId'>";
                        if( defined $actHist ) {
                                genHist( 'main-history', $actEmail, $actLogin, $actTime, $actName, $actNote, $actDisc, "loc-$cnt-sel", 'seen', undef, undef );
                        } else {
                        print "<input type='hidden' name='loc-$cnt' value='$locId'>";
                        if( defined $actHist ) {
                                genHist( 'main-history', $actEmail, $actLogin, $actTime, $actName, $actNote, $actDisc, "loc-$cnt-sel", 'seen', undef, undef );
                        } else {
-                               print "<tr class='main-history'><td class='empty' colspan='2'><td><input type='radio' name='loc-$cnt-sel' value='seen'>";
+                               print "<tr class='main-history'><td><input type='radio' name='loc-$cnt-sel' value='seen'>";
                        }
                }
                $hiscnt ++;
                        }
                }
                $hiscnt ++;