]> mj.ucw.cz Git - pciids.git/blobdiff - PciIds/Html/Admin.pm
Make the h1 titles little lower
[pciids.git] / PciIds / Html / Admin.pm
index 3d8e438fc86818f3a71b61b5af280663081453b3..c1ef0517a6ff110923607cfdcc294b4fd66437d2 100644 (file)
@@ -29,7 +29,8 @@ sub genNewAdminForm( $$$$$ ) {
        $prefix = '' if( $args->{'global'} );
        my $caption = 'Administration '.( $args->{'global'} ? '(Global)' : '('.encode( $address->pretty() ).')' );
        genHtmlHead( $req, $caption, undef );
-       genCustomHead( $req, $args, $address, $caption, [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'admin' ], [ '', 'jump' ] ], [ [ 'Log out', 'logout' ] ] );
+       my $glob = delete $args->{'global'};
+       genCustomHead( $req, $args, $address, $caption, [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), $glob ? [ 'Local', 'admin' ] : [ 'Global', 'admin?global=1' ], [ 'Help', 'help', 'admin' ], [ '', 'jump' ] ], [ [ 'Log out', 'logout' ] ] );
        print "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='admin' id='admin' class='admin' method='POST' action=''>\n";
        my $lastId;
@@ -151,12 +152,10 @@ sub submitAdminForm( $$$$ ) {
                #Do the deletes and approves
                foreach my $del ( keys %deleted ) {
                        $tables->deleteHistory( $del );
-                       #TODO notify
                        tulog( $authid, "Discussion deleted $del" );
                }
                foreach my $appr ( keys %approved ) {
                        $tables->markChecked( $appr );
-                       #TODO notify
                        tulog( $authid, "Discussion checked $appr" );
                }
                #Handle the items
@@ -168,7 +167,6 @@ sub submitAdminForm( $$$$ ) {
                        my $del = getFormValue( "loc-$i-del", '' );
                        if( defined $del && $del eq 'del' && ( hasRight( $auth->{'accrights'}, 'prune' ) || ( !$tables->hasChildren( $addr->get() ) && !$tables->hasMain( $addr->get() ) ) ) ) {
                                $tables->deleteItem( $addr->get() );
-                               #TODO notify
                                tulog( $authid, "Item deleted (recursive) ".$addr->get() );
                                next;
                        }
@@ -196,13 +194,13 @@ sub submitAdminForm( $$$$ ) {
                                $select = $histId if defined $name || $delete;
                                tulog( $authid, "Discussion submited (admin) $histId ".$addr->get()." ".logEscape( $name )." ".logEscape( $note )." ".logEscape( $discussion ) );
                                $action = 1;
-                               #TODO notify
+                               notify( $tables, $addr->get(), $histId, defined $name ? 1 : 0, 1 );
                        }
                        if( defined $select && select ne '' ) {
                                $tables->setMainHistory( $addr->get(), $select );
                                tulog( $authid, "Item main history changed ".$addr->get()." $select" );
                                $action = 1;
-                               #TODO Notify
+                               notify( $tables, $addr->get(), $select, 2, 2 );
                        }
                        if( $action && $defaultSeen ) {#Approve anything in this item
                                my $subcnt = getFormValue( "loc-$i-subcnt", 0 );