]> mj.ucw.cz Git - pciids.git/commitdiff
New item -> notification
authorMichal Vaner <vorner@ucw.cz>
Wed, 3 Sep 2008 11:18:00 +0000 (13:18 +0200)
committerMichal Vaner <vorner@ucw.cz>
Wed, 3 Sep 2008 11:18:00 +0000 (13:18 +0200)
New item has a 'subscribe' checkbox, if checked, it adds a notification
for that item.

PciIds/Html/Changes.pm

index f5fbea1012275f363d85d9f969e5146901dfe506..7978fa83e891c634f1785e27836abcf0d31af3fe 100644 (file)
@@ -21,6 +21,7 @@ sub genNewItemForm( $$$$$$ ) {
                [ 'input', 'Name:', 'text', 'name', 'maxlength="200"' ],
                [ 'input', 'Note:', 'text', 'note', 'maxlength="1024"' ],
                [ 'textarea', 'Discussion:', undef, 'discussion', 'rows="5" cols="50"' ],
+               [ 'input', 'Subscribe:', 'checkbox', 'subscribe', 'value="subscribe" checked="checked"' ],
                [ 'input', '', 'submit', 'submit', 'value="Submit"' ] ], $values );
        print '</table></form>';
        print '
@@ -80,6 +81,7 @@ sub newItemSubmit( $$$$ ) {
                        return genNewItemForm( $req, $args, $auth, $tables, $result, $data );
                }
                notify( $tables, $data->{'address'}->parent()->get(), $comName, 2, 0 );#Notify the parent (parent gets new items)
+               $tables->submitNotification( $auth->{'authid'}, $data->{'address'}->get(), { 'recursive' => 0, 'notification' => 1, 'way' => 0 } );
                tulog( $auth->{'authid'}, "Item created ".$data->{'address'}->get()." ".logEscape( $data->{'name'} )." ".logEscape( $data->{'note'} )." ".logEscape( $data->{'discussion'} )." $comName" );
                return HTTPRedirect( $req, '/read/'.$data->{'address'}->get().'?action=list' );
        } else {