App-SD

 view release on metacpan or  search on metacpan

lib/App/SD/CLI/Command/Ticket/Review.pm  view on Meta::CPAN

    my $record = shift;

    $self->prepare_actions($record) unless keys %ACTIONS;
    
    print "show [b] basics or [d] details\n";
    foreach my $property ( @{ $INFO{'properties'} } ) {
        my $prop_shortcut = $INFO{'shortcuts'}{$property};
        print "$property:\n";
        print "\t";
        my $current = $record->prop($property);
        my $not_first = 0;
        foreach my $value ( @{ $INFO{'values'}{$property} } ) {
            print ", " if $not_first++;
            print "[". $prop_shortcut . $INFO{vshortcuts}{$property}{$value} ."] $value";
            print "*" if $value eq $current;
        }
        print "\n";
    }
}

sub action_property {
    my $self = shift;
    my $record = shift;

lib/App/SD/CLI/Model/Ticket.pm  view on Meta::CPAN

    my $record = shift;
    my $update;

    if ($record) { $update = 1 }
    else {

        $record = $self->_get_record_object;
        $update = 0;
    }

    my @do_not_edit = $record->immutable_props;
    my ( @metadata_order,  @mutable_order );
    my ( %immutable_props, %mutable_props );

    # separate out user-editable props so we can both show all
    # the props that will be added to the new ticket and prevent
    # users from being able to break things by changing props
    # that shouldn't be changed, such as uuid
    #
    # filter out props we don't want to present for editing
    my %do_not_edit = map { $_ => 1 } @do_not_edit;

    for my $prop ( $record->props_to_show(
            # only call props_to_show with --verbose if we're in an update
            # because new tickets have no declared props
            { 'verbose' => ($self->has_arg('all-props') && $update),
              update => $update } ) ) {
        if ( $do_not_edit{$prop}) {
            if ( $prop eq 'id' && $update ) {

                # id isn't a *real* prop, so we have to mess with it some more
                push @metadata_order, $prop;
                $immutable_props{$prop}
                    = $record->luid . ' (' . $record->uuid . ")";
            } elsif ( !( ( $prop eq 'id' or $prop eq 'created' ) && !$update ) )
            {
                push @metadata_order, $prop;

lib/App/SD/Replica/hm/PullEncoder.pm  view on Meta::CPAN


    if ( my $props = $self->sync_source->props ) {
        while ( my ( $k, $v ) = each %$props ) { $args{$k} = $v }
    }

    unless ( keys %args ) {
        %args = (
            owner        => 'me',
            group        => 0,
            requestor    => 'me',
            not_complete => 1,
        );
    }

    my $status = $self->sync_source->hm->act( 'TaskSearch', %args );
    unless ( $status->{'success'} ) {
        die "couldn't search";
    }
    return $status->{content}{tasks};
}

lib/App/SD/Replica/rt.pm  view on Meta::CPAN


Push to rt algorithm

apply a single changeset that's part of the push:
    - for each record in that changeset:
        - pull the record's txn list from the server
        - for each txn we don't know we've already seen, look at it
            - if it is from the changeset we just pushed, then
                store the id of the new transaction and originating uuid in the push-ticket store.
                    - does that let us specify individual txns? or is it a high-water mark?
             - if it is _not_ from the changeset we just pushed, then 
                do we just ignore it?
                how do we mark an out-of-order transaction as not-pulled?



Changesets we want to push from SD to RT and how they map


what do we do with cfs rt doesn't know about?

lib/App/SD/Server/Dispatcher.pm  view on Meta::CPAN

        on qr'^([\w\d-]+)/?' => sub {
            my $self = shift;
            my $id = $1;

            my $ticket = App::SD::Model::Ticket->new(
                app_handle => $self->server->app_handle,
                handle     => $self->server->app_handle->handle
            );
            $ticket->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
            if (!$ticket->luid) {
                $self->server->_send_404(); #redirect( to => "/error/ticket_does_not_exist");
            } else {
                next_rule;
            }
        };
        on qr'^([\w\d-]+)/?$'    => sub { shift->server->_send_redirect( to => "/ticket/$1/view" ) };
        on qr'^([\w\d-]+)/edit$' => sub { shift->show_template( 'edit_ticket', $1 ) };
        on qr'^([\w\d-]+)/history$' => sub { shift->show_template( 'show_ticket_history', $1 ) };
        on qr'^([\w\d-]+)/view$'    => sub { shift->show_template( 'show_ticket', $1 ) };
    };
};



( run in 0.576 second using v1.01-cache-2.11-cpan-cc502c75498 )