details:   https://code.openbravo.com/erp/devel/pi/rev/0401cf91a504
changeset: 15108:0401cf91a504
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Jan 10 15:38:20 2012 +0100
summary:   Fixed issue 19377. Audit section will be hidden when a record is new.

details:   https://code.openbravo.com/erp/devel/pi/rev/ad9032d6e574
changeset: 15109:ad9032d6e574
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Jan 10 18:40:34 2012 +0100
summary:   Fixed issue 19455. Scheduler will no longer fail with a different 
date format

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
 |  21 ++++++++++
 src/org/openbravo/scheduling/OBScheduler.java                                  
                       |   8 +-
 src/org/openbravo/scheduling/Trigger_data.xsql                                 
                       |   6 +-
 3 files changed, 29 insertions(+), 6 deletions(-)

diffs (95 lines):

diff -r c7e35cf0b073 -r ad9032d6e574 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Tue Jan 10 18:19:38 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Tue Jan 10 18:40:34 2012 +0100
@@ -264,6 +264,26 @@
       }
   },
   
+  enableAuditSection: function(enable){
+      var auditSection,i;
+      for(i=0;i<this.items.length;i++) {
+        if(this.items[i].type==='OBAuditSectionItem') {
+          auditSection = this.items[i];
+        }
+      }
+      if (!auditSection) {
+        return;
+      }
+      if (enable) {
+        delete auditSection.hiddenInForm;
+        auditSection.show();
+      } else {
+        auditSection.collapseSection(false);
+        auditSection.hiddenInForm = true;
+        auditSection.hide();
+      }
+  },
+
   enableLinkedItemSection: function(enable){
     if (!this.linkedItemSection) {
       return;
@@ -328,6 +348,7 @@
     this.enableNoteSection(!isNew);
     this.enableLinkedItemSection(!isNew);
     this.enableAttachmentsSection(!isNew);
+    this.enableAuditSection(!isNew);
     
     if (isNew) {
       this.view.statusBar.newIcon.prompt = 
OB.I18N.getLabel('OBUIAPP_NewIconPrompt');
diff -r c7e35cf0b073 -r ad9032d6e574 
src/org/openbravo/scheduling/OBScheduler.java
--- a/src/org/openbravo/scheduling/OBScheduler.java     Tue Jan 10 18:19:38 
2012 +0100
+++ b/src/org/openbravo/scheduling/OBScheduler.java     Tue Jan 10 18:40:34 
2012 +0100
@@ -369,11 +369,11 @@
 
         } else if (data.timingOption.equals(TIMING_OPTION_LATER)) {
           trigger = new SimpleTrigger();
-          start = timestamp(data.startDate, data.startTime, "dd-MM-yyyy 
HH:mm:ss");
+          start = timestamp(data.startDate, data.startTime, dateTimeFormat);
           trigger.setStartTime(start.getTime());
 
         } else if (data.timingOption.equals(TIMING_OPTION_SCHEDULED)) {
-          start = timestamp(data.startDate, data.startTime, "dd-MM-yyyy 
HH:mm:ss");
+          start = timestamp(data.startDate, data.startTime, dateTimeFormat);
 
           final int second = start.get(Calendar.SECOND);
           final int minute = start.get(Calendar.MINUTE);
@@ -472,12 +472,12 @@
             trigger.setStartTime(start.getTime());
           } else {
             Calendar nextTriggerTime = timestamp(data.nextFireTime, 
data.nextFireTime,
-                "dd-MM-yyyy HH:mm:ss");
+                dateTimeFormat);
             trigger.setStartTime(nextTriggerTime.getTime());
           }
 
           if (data.finishes.equals(FINISHES)) {
-            finish = timestamp(data.finishesDate, data.finishesTime, 
"dd-MM-yyyy HH:mm:ss");
+            finish = timestamp(data.finishesDate, data.finishesTime, 
dateTimeFormat);
             trigger.setEndTime(finish.getTime());
           }
 
diff -r c7e35cf0b073 -r ad9032d6e574 
src/org/openbravo/scheduling/Trigger_data.xsql
--- a/src/org/openbravo/scheduling/Trigger_data.xsql    Tue Jan 10 18:19:38 
2012 +0100
+++ b/src/org/openbravo/scheduling/Trigger_data.xsql    Tue Jan 10 18:40:34 
2012 +0100
@@ -22,16 +22,18 @@
    <SqlMethod name="select" type="preparedStatement" return="single">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[
-       SELECT AD_Process_Request_ID, Timing_Option, TO_CHAR(Start_Time, 
'HH24:MI:SS') AS Start_Time, to_char(Start_Date, 'dd-MM-yyyy HH:mm:ss') AS 
Start_Date,
+       SELECT AD_Process_Request_ID, Timing_Option, TO_CHAR(Start_Time, 
'HH24:MI:SS') AS Start_Time, to_char(Start_Date, ?) AS Start_Date,
        Frequency, Secondly_Interval, Secondly_Repetitions, Minutely_Interval, 
Minutely_Repetitions,
        Hourly_Interval, Hourly_Repetitions, Daily_Interval, Day_Mon, Day_Tue,
        Day_Wed, Day_Thu, Day_Fri, Day_Sat, Day_Sun, Monthly_Option, 
Monthly_Specific_Day,
-       Monthly_Day_Of_Week, Finishes, TO_CHAR(Finishes_Time, 'HH24:MI:SS') AS 
Finishes_Time, to_char(Finishes_Date, 'dd-MM-yyyy HH:mm:ss') as Finishes_Date,
+       Monthly_Day_Of_Week, Finishes, TO_CHAR(Finishes_Time, 'HH24:MI:SS') AS 
Finishes_Time, to_char(Finishes_Date, ?) as Finishes_Date,
        Daily_Option, Cron, Description, TO_CHAR(Next_Fire_Time, ?) AS 
Next_Fire_Time
        FROM AD_Process_Request
        WHERE AD_Process_Request_ID = ?
     ]]></Sql>
     <Parameter name="dateTimeFormat" />
+    <Parameter name="dateTimeFormat" />
+    <Parameter name="dateTimeFormat" />
     <Parameter name="id"/>
    </SqlMethod>
 </SqlClass>
\ No newline at end of file

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to