Changeset 2316
- Timestamp:
- 12/02/19 22:22:34 (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Data.pm
r2124 r2316 30 30 my ( $self, $c ) = @_; 31 31 32 $c->stash->{NoSync} = 1;33 34 32 $c->stash->{data} ||= {}; 35 33 $c->forward('CSV'); -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Json.pm
r2067 r2316 31 31 my ( $self, $c ) = @_; 32 32 33 $c->stash->{NoSync} = 1;34 35 33 $c->stash->{data} ||= {}; 36 34 $c->forward($c->view('Json')); -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Login.pm
r2069 r2316 29 29 sub index :Path :Args(0) { 30 30 my ( $self, $c ) = @_; 31 32 $c->stash->{NoSync} = 1;33 31 34 32 if ($c->req->param('username')) { -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Listing.pm
r2066 r2316 51 51 } 52 52 53 $c->stash->{NoSync} = 1;54 53 $c->stash->{data} = \%objects; 55 54 } -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Search.pm
r2068 r2316 27 27 my $otype = $c->req->param('otype'); 28 28 my @search = $c->req->param('q'); 29 $c->stash->{NoSync} = 1;30 29 31 30 push(@search, 'oalias=NULL') unless($c->req->param('oalias')); -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm
r2315 r2316 159 159 $c->forward($c->view('TT')) unless($c->res->body); 160 160 $c->model('Accounts')->db->rollback; 161 $c->model('Accounts')->call_batch_sync unless($c->stash->{NoSync}); 161 162 # DBNeedSync is set by the model when commit() is by base 163 if ($c->stash->{DBNeedSync}) { 164 $c->model('Accounts')->call_batch_sync; 165 } 162 166 } 163 167 -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Stat.pm
r2066 r2316 25 25 my ( $self, $c ) = @_; 26 26 27 $c->stash->{NoSync} = 1;28 27 } 29 28 -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/Accounts.pm
r2169 r2316 51 51 $self->{_default_base} and return $self->{_default_base}; 52 52 $self->{_default_base} = $self->base; 53 $self->{_default_base}->SetCallBack( 54 'commit', 55 sub { $self->{c}->stash->{DBNeedSync} = 1; } 56 ); 53 57 $self->{_default_base}->load or return; 54 58 $self->{_default_base}->wexported(1); … … 205 209 my ($self) = @_; 206 210 211 $self->{c}->log->debug('Running call_batch_sync()'); 212 207 213 if (my $command = $self->{c}->config->{callSyncCmd}) { 208 214 if (system($command) != 0) { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r2282 r2316 60 60 $base->{_la} = $options->{la}; 61 61 62 # Callback, the list bellow give the supported callback 63 $base->{_cb} = $options->{cb} || { 64 commit => undef, 65 postcommit => undef, 66 }; 67 62 68 $base->SetConnectedUser($ENV{LA_USERNAME}) if ($ENV{LA_USERNAME}); 63 69 64 70 la_log(LA_DEBUG, 'Instanciate base %s (%s)', ($base->label || 'N/A'), $pclass); 65 71 $base 72 } 73 74 =head2 SetCallBack( $cb, $code ) 75 76 Set callbalc $<cb> to function C<$code>. 77 78 =cut 79 80 sub SetCallBack { 81 my ( $self, $cb, $code ) = @_; 82 83 if (exists ($self->{_cb}{$cb})) { 84 return $self->{_cb}{$cb} = $code; 85 } 86 } 87 88 =head2 GetCallBack( $cb ) 89 90 Set callback $<cb> to function C<$code>. 91 92 =cut 93 94 sub GetCallBack { 95 my ( $self, $cb ) = @_; 96 97 if (exists ($self->{_cb}{$cb})) { 98 $self->{_cb}{$cb} || sub { 1; }; 99 } 66 100 } 67 101 … … 879 913 } 880 914 915 $self->GetCallBack('commit')->(); 916 881 917 $self->postcommit(); 882 918 … … 902 938 } 903 939 ); 940 $self->GetCallBack('postcommit')->(); 904 941 } else { 905 942 return 1;
Note: See TracChangeset
for help on using the changeset viewer.