/[A3C]/lib/A3C/View/Strix.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/View/Strix.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 243 by dpavlin, Wed Oct 1 20:22:22 2008 UTC revision 244 by dpavlin, Wed Oct 1 21:05:00 2008 UTC
# Line 60  template 'errors' => page { Line 60  template 'errors' => page {
60    
61          h2 { _('Name differences') }          h2 { _('Name differences') }
62    
63          my $name_diff = A3C::SQL->new({ query => qq{          my $diff = A3C::SQL->new({ query => qq{
64                  select                  select
65                          instance,hreduorgurl,                          instance,hreduorgurl,
66                          _site_name,o                          _site_name,o
# Line 69  template 'errors' => page { Line 69  template 'errors' => page {
69                  where o != _site_name                  where o != _site_name
70          }});          }});
71    
72          if ( $name_diff->count > 0 ) {          if ( $diff->count > 0 ) {
73    
74                    div { { class is 'note' } _("Found %1 instances with name in configuration different from name in LDAP", $diff->count) }
75    
76                  table {                  table {
77                          row {                          row {
# Line 78  template 'errors' => page { Line 80  template 'errors' => page {
80                                  th { _('Strix instance name') }                                  th { _('Strix instance name') }
81                                  th { _('hrEduOrg.o') }                                  th { _('hrEduOrg.o') }
82                          };                          };
83                          while ( my $row = $name_diff->next ) {                          while ( my $row = $diff->next ) {
84                                  row {                                  row {
85                                          cell { show( 'instance-op', 'Create', '+', $row->instance ) }                                          cell { show( 'instance-op', 'Create', '+', $row->instance ) }
86                                          cell { $row->instance }                                          cell { $row->instance }
# Line 92  template 'errors' => page { Line 94  template 'errors' => page {
94                  div { _("Can't find any instance of strix which has different name than data from LDAP") }                  div { _("Can't find any instance of strix which has different name than data from LDAP") }
95          }          }
96    
97            h2 { _('Missing instance configuration') }
98    
99            my $diff = A3C::SQL->new({ query => qq{
100                    select
101                            instance,hreduorgurl,o
102                    from strix_visits
103                    join hr_edu_orgs on cn = instance
104                    where instance not in (select instance from strix_instances)
105            }});
106    
107            if ( $diff->count > 0 ) {
108    
109                    div { { class is 'note' } _("Found %1 instances which have statistics but no conf.php", $diff->count) }
110    
111                    table {
112                            row {
113                                    th {}
114                                    th { _('Instance') }
115                                    th { _('hrEduOrg.o') }
116                            };
117                            while ( my $row = $diff->next ) {
118                                    row {
119                                            cell { show( 'instance-op', 'Create', '+', $row->instance ) }
120                                            cell { $row->instance }
121                                            cell { $row->o }
122                                    }
123                            }
124                    }
125            
126            } else {
127                    div { _("Can't find any instance of strix which has different name than data from LDAP") }
128            }
129  };  };
130    
131  =head2 instances  =head2 instances
# Line 104  template 'instances' => page { Line 138  template 'instances' => page {
138    
139          my $sql = A3C::SQL->new({ query => qq{          my $sql = A3C::SQL->new({ query => qq{
140                  select                  select
141                          hrEduOrgUrl, o, l, postalAddress, telephoneNumber, facsimileTelephoneNumber                          hrEduOrgUrl, o, l, postalAddress, telephoneNumber, facsimileTelephoneNumber,
142                  from strix_instances                          strix_visits.instance, strix_visits.hits, strix_changes.modifications
143                  join hr_edu_orgs on cn = instance                  from strix_visits
144                    left outer join hr_edu_orgs on cn = instance
145                    left outer join strix_changes on strix_changes.instance = strix_visits.instance
146                  order by l,o                  order by l,o
147          }});          }});
148    
149          if ( $sql->count > 0 ) {          if ( $sql->count > 0 ) {
150    
151                    div { { class is 'note' } _("Found total of %1 strix instances", $sql->count) }
152    
153                  table {                  table {
154                          row {                          row {
155                                  th { _('hrEduOrgUrl') }                                  th { _('hrEduOrgUrl') }
# Line 120  template 'instances' => page { Line 158  template 'instances' => page {
158                                  th { _('postalAddress') }                                  th { _('postalAddress') }
159                                  th { _('telephoneNumber') }                                  th { _('telephoneNumber') }
160                                  th { _('facsimileTelephoneNumber') }                                  th { _('facsimileTelephoneNumber') }
161                                    th { _('hits') }
162                                    th { _('edits') }
163                          };                          };
164                          while ( my $row = $sql->next ) {                          while ( my $row = $sql->next ) {
165                                  row {                                  row {
166                                          cell { outs_raw '<a href="http://' . $row->hrEduOrgUrl . '">' . $row->hrEduOrgUrl . '</a>' }                                          cell {
167                                                    if ( my $url = $row->hrEduOrgUrl ) {
168                                                            outs_raw qq{<a href="http://$url">$url</a>};
169                                                    } else {
170                                                            outs $row->instance;
171                                                    }
172                                            }
173                                          cell { $row->o }                                          cell { $row->o }
174                                          cell { $row->l }                                          cell { $row->l }
175                                          cell { $row->postalAddress }                                          cell { $row->postalAddress }
176                                          cell { $row->telephoneNumber }                                          cell { { class is 'center' } $row->telephoneNumber }
177                                          cell { $row->facsimileTelephoneNumber }                                          cell { { class is 'center' } $row->facsimileTelephoneNumber }
178                                            cell { { class is 'right' } $row->hits }
179                                            cell { { class is 'right' } $row->modifications }
180                                  }                                  }
181                          }                          }
182                  }                  }
183    
                 div { _("Found total of %1 strix instances", $sql->count) }  
   
184          } else {          } else {
185                  div { _("Can't find any strix instances") }                  div { _("Can't find any strix instances") }
186          }          }

Legend:
Removed from v.243  
changed lines
  Added in v.244

  ViewVC Help
Powered by ViewVC 1.1.26