[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6673] branches/1.3



Revision: 6673
          http://sourceforge.net/p/ledger-smb/code/6673
Author:   einhverfr
Date:     2014-01-28 03:27:42 +0000 (Tue, 28 Jan 2014)
Log Message:
-----------
Merging backbutton fix from trunk in preparation for 1.3.36-rc2

Modified Paths:
--------------
    branches/1.3/LedgerSMB/AM.pm
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/LedgerSMB/Template.pm
    branches/1.3/UI/am-defaults.html
    branches/1.3/bin/am.pl
    branches/1.3/sql/modules/Fixes.sql

Modified: branches/1.3/LedgerSMB/AM.pm
===================================================================
--- branches/1.3/LedgerSMB/AM.pm	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/LedgerSMB/AM.pm	2014-01-28 03:27:42 UTC (rev 6673)
@@ -1715,7 +1715,8 @@
                       sonumber ponumber sqnumber rfqnumber partnumber 
                       employeenumber customernumber vendornumber projectnumber 
                       yearend curr weightunit businessnumber default_country 
-                      check_prefix password_duration templates vclimit template_images)
+                      check_prefix password_duration templates vclimit 
+                      template_images disable_back)
     }
     for (@$defaults)
     {

Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/LedgerSMB/Form.pm	2014-01-28 03:27:42 UTC (rev 6673)
@@ -67,6 +67,7 @@
 use File::Copy;
 use LedgerSMB::Company_Config;
 use LedgerSMB::App_State;
+use LedgerSMB::Setting;
 
 use charnames qw(:full);
 use open ':utf8';
@@ -604,6 +605,12 @@
     my ( $self, $init, $headeradd ) = @_;
 
     return if $self->{header} or $ENV{LSMB_NOHEAD};
+    my $cache = 1; # default
+    if ($LedgerSMB::App_State::DBH){
+        # we have a db connection, so are logged in.  Let's see about caching.
+        $cache = 0 if LedgerSMB::Setting->get('disable_back');
+    }
+
     $ENV{LSMB_NOHEAD} = 1; # Only run once.
     my ( $stylesheet, $favicon, $charset );
 
@@ -634,10 +641,14 @@
 		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
 <head>
-	<title>$self->{titlebar}</title>
+	<title>$self->{titlebar}</title> |;
+        if (!$cache){
+            print qq|
 	<meta http-equiv="Pragma" content="no-cache" />
 	<meta http-equiv="Cache-Control" content="must-revalidate" />
-	<meta http-equiv="Expires" content="-1" />
+	<meta http-equiv="Expires" content="-1" /> |;
+        }
+        print qq|
 	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
 	$stylesheet
 	$charset

Modified: branches/1.3/LedgerSMB/Template.pm
===================================================================
--- branches/1.3/LedgerSMB/Template.pm	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/LedgerSMB/Template.pm	2014-01-28 03:27:42 UTC (rev 6673)
@@ -380,6 +380,13 @@
 sub _http_output {
 	my ($self, $data) = @_;
 	$data ||= $self->{output};
+        my $cache = 1; # default
+        if ($LedgerSMB::App_State::DBH){
+            # we have a db connection, so are logged in.  
+            # Let's see about caching.
+            $cache = 0 if LedgerSMB::Setting->get('disable_back');
+        }
+        
 	if ($self->{format} !~ /^\p{IsAlnum}+$/) {
 		throw Error::Simple "Invalid format";
 	}
@@ -404,9 +411,11 @@
 		$disposition .= qq|\nContent-Disposition: attachment; filename="$name"|;
 	}
         if (!$ENV{LSMB_NOHEAD}){
-            print "Cache-Control: no-store, no-cache, must-revalidate\n";
-            print "Cache-Control: post-check=0, pre-check=0, false\n";
-            print "Pragma: no-cache\n";
+            if (!$cache){
+                print "Cache-Control: no-store, no-cache, must-revalidate\n";
+                print "Cache-Control: post-check=0, pre-check=0, false\n";
+                print "Pragma: no-cache\n";
+            }
  	    if ($self->{mimetype} =~ /^text/) {
 		print "Content-Type: $self->{mimetype}; charset=utf-8$disposition\n\n";
 	    } else {

Modified: branches/1.3/UI/am-defaults.html
===================================================================
--- branches/1.3/UI/am-defaults.html	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/UI/am-defaults.html	2014-01-28 03:27:42 UTC (rev 6673)
@@ -44,6 +44,19 @@
            <?lsmb PROCESS select element_data=selects.default_language ?>
          </td>
 	</tr>
+  <tr>
+    <th align="right"><?lsmb text('Disable Back Button') ?></th>
+       <td>
+       <label id="disable-back-1-label" for="disable-back-1">
+              <?lsmb text('Yes') ?></label>
+          
+	  <input id="disable-back-1" title="Yes" type="radio" name="disable_back" value="1" />
+        <label id="disable-back-0-label" for="disable-back-0">
+              <?lsmb text('No') ?></label>
+          
+	  <input id="disable-back-0" title="No" type="radio" name="disable_back" value="0" checked="CHECKED" />
+    </td>
+  </tr>
       </table>
     </td>
   </tr>

Modified: branches/1.3/bin/am.pl
===================================================================
--- branches/1.3/bin/am.pl	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/bin/am.pl	2014-01-28 03:27:42 UTC (rev 6673)
@@ -81,7 +81,7 @@
 my @default_others = qw(businessnumber weightunit separate_duties default_language
                         inventory_accno_id income_accno_id expense_accno_id 
                         fxgain_accno_id fxloss_accno_id default_country 
-                        templates curr template_images);
+                        templates curr template_images disable_back);
 
 sub save_as_new {
 

Modified: branches/1.3/sql/modules/Fixes.sql
===================================================================
--- branches/1.3/sql/modules/Fixes.sql	2014-01-28 03:18:25 UTC (rev 6672)
+++ branches/1.3/sql/modules/Fixes.sql	2014-01-28 03:27:42 UTC (rev 6673)
@@ -670,5 +670,6 @@
 FOR EACH ROW EXECUTE PROCEDURE prevent_closed_transactions();
 COMMIT;
 
-
-
+BEGIN;
+INSERT INTO defaults VALUES ('disable_back', '0');
+COMMIT;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits