| 
      
            Lines 20-25
          use Modern::Perl;
      
      
        Link Here
      
     | 
  
        
          | 20 | 
          use Mojo::Base 'Mojolicious::Controller';  | 
          20 | 
          use Mojo::Base 'Mojolicious::Controller';  | 
        
        
          | 21 | 
           | 
          21 | 
           | 
        
        
          | 22 | 
          use Koha::Patrons;  | 
          22 | 
          use Koha::Patrons;  | 
        
            
               | 
               | 
              23 | 
              use Koha::ERM::Agreements;  | 
            
            
              | 24 | 
              use Koha::ERM::Licenses;  | 
            
            
              | 25 | 
              use Koha::ERM::Documents;  | 
            
            
              | 26 | 
              use Koha::ERM::EHoldings::Titles;  | 
            
            
              | 27 | 
              use Koha::ERM::EHoldings::Packages;  | 
            
            
              | 28 | 
              use Koha::ERM::EUsage::UsageDataProviders;  | 
            
        
          | 23 | 
           | 
          29 | 
           | 
        
        
          | 24 | 
          use Try::Tiny qw( catch try );  | 
          30 | 
          use Try::Tiny qw( catch try );  | 
        
        
          | 25 | 
           | 
          31 | 
           | 
        
  
    | 
      
            Lines 52-57
          sub config {
      
      
        Link Here
      
     | 
  
        
          | 52 | 
              );  | 
          58 | 
              );  | 
        
        
          | 53 | 
          }  | 
          59 | 
          }  | 
        
        
          | 54 | 
           | 
          60 | 
           | 
        
            
               | 
               | 
              61 | 
              =head3 counts  | 
            
            
              | 62 | 
               | 
            
            
              | 63 | 
              Return the ERM resources counts  | 
            
            
              | 64 | 
               | 
            
            
              | 65 | 
              =cut  | 
            
            
              | 66 | 
               | 
            
            
              | 67 | 
              sub counts { | 
            
            
              | 68 | 
                  my $c = shift->openapi->valid_input or return;  | 
            
            
              | 69 | 
               | 
            
            
              | 70 | 
                  my $agreements_count           = Koha::ERM::Agreements->search->count;  | 
            
            
              | 71 | 
                  my $documents_count            = Koha::ERM::Documents->search->count;  | 
            
            
              | 72 | 
                  my $eholdings_packages_count   = Koha::ERM::EHoldings::Packages->search->count;  | 
            
            
              | 73 | 
                  my $eholdings_titles_count     = Koha::ERM::EHoldings::Titles->search->count;  | 
            
            
              | 74 | 
                  my $licenses_count             = Koha::ERM::Licenses->search->count;  | 
            
            
              | 75 | 
                  my $usage_data_providers_count = Koha::ERM::EUsage::UsageDataProviders->search->count;  | 
            
            
              | 76 | 
               | 
            
            
              | 77 | 
                  return $c->render(  | 
            
            
              | 78 | 
                      status  => 200,  | 
            
            
              | 79 | 
                      openapi => { | 
            
            
              | 80 | 
                          counts => { | 
            
            
              | 81 | 
                              agreements_count           => $agreements_count,  | 
            
            
              | 82 | 
                              documents_count            => $documents_count,  | 
            
            
              | 83 | 
                              eholdings_packages_count   => $eholdings_packages_count,  | 
            
            
              | 84 | 
                              eholdings_titles_count     => $eholdings_titles_count,  | 
            
            
              | 85 | 
                              licenses_count             => $licenses_count,  | 
            
            
              | 86 | 
                              usage_data_providers_count => $usage_data_providers_count,  | 
            
            
              | 87 | 
                          }  | 
            
            
              | 88 | 
                      },  | 
            
            
              | 89 | 
                  );  | 
            
            
              | 90 | 
              }  | 
            
            
              | 91 | 
               | 
            
        
          | 55 | 
          =head3 list_users  | 
          92 | 
          =head3 list_users  | 
        
        
          | 56 | 
           | 
          93 | 
           | 
        
        
          | 57 | 
          Return the list of possible ERM users  | 
          94 | 
          Return the list of possible ERM users  |