Merge remote branch 'katrin/3381_intranetusercss' into new/enh/bug_3381
[koha_gimpoz] / misc / cronjobs / fines.pl
index 42498f3..73cdf9f 100755 (executable)
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
 # FIXME: use FinesMode as described or change syspref description
 use strict;
+#use warnings; FIXME - Bug 2505
 
 BEGIN {
     # find Koha's Perl modules
@@ -105,12 +106,14 @@ if($output_dir){
     $fldir = $output_dir if( -d $output_dir );
 } else {
     $fldir = $ENV{TMPDIR} || "/tmp";
-    warn "Could not write to $output_dir ... does not exist!";
+}
+if (!-d $fldir) {
+    warn "Could not write to $fldir ... does not exist!";
 }
 $filename = $dbname;
 $filename =~ s/\W//;
 $filename = $fldir . '/'. $filename . '_' .  $today_iso . ".log";
-print "writing to $filename\n";
+print "writing to $filename\n" if $verbose;
 open (FILE, ">$filename") or die "Cannot write file $filename: $!";
 print FILE join $delim, (@borrower_fields, @item_fields, @other_fields);
 print FILE "\n";