fix for bug 1501 - removed reference to marc_biblio from framework test
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 18 Oct 2007 23:53:53 +0000 (18:53 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 19 Oct 2007 01:20:33 +0000 (20:20 -0500)
Also added results of two subtests missing from the template.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/checkmarc.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tmpl

index e5df99b..6fb4a94 100755 (executable)
@@ -38,7 +38,7 @@ my ($template, $borrowernumber, $cookie)
                             });
 
 my $dbh = C4::Context->dbh;
-my $total;
+my $total = 0;
 # checks itemnum field
 my $sth = $dbh->prepare("select tab from marc_subfield_structure where kohafield=\"items.itemnumber\"");
 $sth->execute;
@@ -148,26 +148,24 @@ if ($res && $res2 eq 10 && $field eq "branches") {
 $sth = $dbh->prepare("select count(*) from itemtypes");
 $sth->execute;
 ($res) = $sth->fetchrow;
-unless ($res) {
+if ($res) {
+       $template->param(itemtypes_empty =>0);
+} else {
        $template->param(itemtypes_empty =>1);
        $total++;
 }
 
+
 $sth = $dbh->prepare("select count(*) from branches");
 $sth->execute;
 ($res) = $sth->fetchrow;
-unless ($res) {
+if ($res) {
+       $template->param(branches_empty =>0);
+} else {
        $template->param(branches_empty =>1);
        $total++;
 }
 
-$sth = $dbh->prepare("select count(*) from marc_biblio where frameworkcode is NULL");
-$sth->execute;
-($res) = $sth->fetchrow;
-if ($res) {
-       $template->param(frameworknull =>1);
-       $total++;
-}
 $sth = $dbh->prepare("select count(*) from marc_subfield_structure where frameworkcode is NULL");
 $sth->execute;
 ($res) = $sth->fetchrow;
index 27f526b..81a04cb 100644 (file)
     </tr>
 <!-- /TMPL_IF -->
 <!-- -->
+<!-- TMPL_IF name="itemtypes_empty" -->
+    <tr>
+        <td>item type not defined</td>
+        <td>at least 1 item type must be defined</td>
+    </tr>
+<!-- TMPL_ELSE -->
+    <tr>
+        <td>OK</td>
+        <td>at least 1 item type defined</td>
+    </tr>
+<!-- /TMPL_IF -->
+<!-- -->
+<!-- TMPL_IF name="branches_empty" -->
+    <tr>
+        <td>branch not defined</td>
+        <td>at least 1 branch must be defined</td>
+    </tr>
+<!-- TMPL_ELSE --> 
+    <tr>
+        <td>OK</td>             
+        <td>at least 1 branch defined</td>
+    </tr>                                       
+<!-- /TMPL_IF -->
+<!-- -->
 <!-- TMPL_IF name="biblionumber" -->
     <tr>
         <td>biblio and biblionumber</td>
             <td>there is a null value in a frameworkcode. Check the following tables<br />
                 <li>select * from marc_subfield_structure where frameworkcode is NULL</li>
                 <li>select * from marc_tag_structure where frameworkcode is NULL</li>
-                <li>select * from marc_biblio where frameworkcode is NULL</li></td>
+            </td>
         </tr>
     <!-- TMPL_ELSE -->
         <tr>