diff --git a/_Project-ID-ADempiere/sqls_3.1.3/004_fix_bad_year_dictionary_pg.sql b/_Project-ID-ADempiere/sqls_3.1.3/004_fix_bad_year_dictionary_pg.sql new file mode 100644 index 0000000000..2cfc5440b9 --- /dev/null +++ b/_Project-ID-ADempiere/sqls_3.1.3/004_fix_bad_year_dictionary_pg.sql @@ -0,0 +1,49 @@ +UPDATE ad_table + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_column + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_field + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_menu + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_message + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_reference + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_ref_list + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_ref_table + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_tab + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_treenodemm + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_val_rule + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +UPDATE ad_window + SET created = created + interval '1 month' + WHERE created < DATE '1000-01-01'; + +COMMIT ; \ No newline at end of file diff --git a/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name_pg.sql b/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name_pg.sql new file mode 100644 index 0000000000..15796ab6ab --- /dev/null +++ b/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name_pg.sql @@ -0,0 +1,18 @@ +--Delete field pk_name in window Pack Out Tab Pakage Details _> Reason: do not is nessesary becouse this field are in header +DELETE FROM AD_Field_Trl WHERE AD_Field_ID=50094; +DELETE FROM AD_Field WHERE AD_Field_ID=50094; +--SET ID Export Package AS Reference vs Pk_Name +UPDATE AD_Field SET SeqNo=30, isdisplayed = 'Y' WHERE AD_Field_ID=50091; +--Delete Pk_Name in the Table and History of Changes +DELETE FROM ad_changelog WHERE AD_Column_ID=50126 AND AD_TABLE_ID=50006; +DELETE FROM AD_Column_Trl WHERE AD_Column_ID=50126; +DELETE FROM AD_Column WHERE AD_Column_ID=50126 AND AD_TABLE_ID=50006; +--Set PK_Name AS REference to Table Header +UPDATE AD_Column SET isidentifier='Y', seqno= 1 WHERE AD_Column_ID=50086 +ALTER TABLE ad_package_exp_detail DROP COLUMN pk_name; +ALTER TABLE ad_package_exp RENAME COLUMN pk_name TO name; +UPDATE AD_Column SET AD_Element_ID=469, COLUMNNAME='Name' ,Name='Name' WHERE AD_Column_ID=50086; +ALTER TABLE ad_package_exp_common RENAME COLUMN pk_name TO name; +UPDATE Ad_column SET ad_Element_ID=469, columnname='Name' ,name='Name' WHERE AD_Column_ID=50146; +DELETE FROM ad_element_trl WHERE ad_element_ID=50021; +DELETE FROM ad_element WHERE ad_element_ID=50021; diff --git a/dbPort/src/org/compiere/PackOut/IntPackIn.java b/dbPort/src/org/compiere/PackOut/IntPackIn.java index f275609b7c..6efdaf116e 100644 --- a/dbPort/src/org/compiere/PackOut/IntPackIn.java +++ b/dbPort/src/org/compiere/PackOut/IntPackIn.java @@ -138,9 +138,9 @@ public class IntPackIn extends SvrProcess +fileSeperator; if (DB.isOracle()) impXML.m_Database = "Oracle"; -/* else if (DB.isSybase()) - impXML.m_Database = "Sybase"; -*/ + else if (DB.isPostgreSQL()) + impXML.m_Database = "PostgreSQL"; + //call XML Handler impXML.importXML(dict_file); diff --git a/dbPort/src/org/compiere/PackOut/IntPackInHandler.java b/dbPort/src/org/compiere/PackOut/IntPackInHandler.java index 6a734b9366..d9fc3891bb 100644 --- a/dbPort/src/org/compiere/PackOut/IntPackInHandler.java +++ b/dbPort/src/org/compiere/PackOut/IntPackInHandler.java @@ -229,13 +229,13 @@ public class IntPackInHandler extends DefaultHandler { //Start package log hd_documemt.startElement("","","compiereDocument",attsOut); hd_documemt.startElement("","","header",attsOut); - hd_documemt.characters((atts.getValue("PK_Name")+" Install Log").toCharArray(),0,(atts.getValue("PK_Name")+" Install Log").length()); + hd_documemt.characters((atts.getValue("Name")+" Install Log").toCharArray(),0,(atts.getValue("Name")+" Install Log").length()); hd_documemt.endElement("","","header"); hd_documemt.startElement("","","H3",attsOut); hd_documemt.characters(("Package Name:" ).toCharArray(),0,("Package Name:" ).length()); hd_documemt.endElement("","","H3"); hd_documemt.startElement("","","packagename4log",attsOut); - hd_documemt.characters(atts.getValue("PK_Name").toCharArray(),0,atts.getValue("PK_Name").length()); + hd_documemt.characters(atts.getValue("Name").toCharArray(),0,atts.getValue("Name").length()); hd_documemt.endElement("","","packagename4log"); hd_documemt.startElement("","","H3",attsOut); hd_documemt.characters(("Version:" ).toCharArray(),0,("Version:" ).length()); @@ -270,7 +270,7 @@ public class IntPackInHandler extends DefaultHandler { // Update Summary Package History Table String sql2 = "SELECT AD_PACKAGE_IMP_INST_ID FROM AD_PACKAGE_IMP_INST WHERE NAME =" - + "'" + atts.getValue("PK_Name") + + "'" + atts.getValue("Name") + "' AND PK_VERSION ='" + atts.getValue("Version") + "'"; int PK_preInstalled = DB.getSQLValue(null,sql2); @@ -292,7 +292,7 @@ public class IntPackInHandler extends DefaultHandler { + "', '" + atts.getValue("Version") + "', '" + atts.getValue("DataBase") + "', '" + atts.getValue("Description").replaceAll("'","''").replaceAll(",","") - + "', '" + atts.getValue("PK_Name") + + "', '" + atts.getValue("Name") + "', '" + atts.getValue("creator") + "', '" + atts.getValue("creatorcontact") + "', '" + atts.getValue("createddate") @@ -324,7 +324,7 @@ public class IntPackInHandler extends DefaultHandler { + "', '" + atts.getValue("Version") + "', '" + atts.getValue("DataBase") + "', '" + atts.getValue("Description").replaceAll("'","''").replaceAll(",","") - + "', '" + atts.getValue("PK_Name") + + "', '" + atts.getValue("Name") + "', '" + atts.getValue("creator") + "', '" + atts.getValue("creatorcontact") + "', '" + atts.getValue("createddate") diff --git a/dbPort/src/org/compiere/PackOut/PackOut.java b/dbPort/src/org/compiere/PackOut/PackOut.java index 9d20cd4a2a..706219195d 100644 --- a/dbPort/src/org/compiere/PackOut/PackOut.java +++ b/dbPort/src/org/compiere/PackOut/PackOut.java @@ -150,10 +150,10 @@ public class PackOut extends SvrProcess File file = new File(""); fileSeperator = file.separator; packagedir = rs1.getString("File_Directory"); - packagename = packagedir + rs1.getString("PK_Name"); - includesdir = rs1.getString("PK_Name") + fileSeperator+"**"; - boolean success = (new File(rs1.getString("File_Directory") + rs1.getString("PK_Name")+fileSeperator+"doc"+fileSeperator )).mkdirs(); - String file_document = rs1.getString("File_Directory") + rs1.getString("PK_Name") +fileSeperator+ "doc"+fileSeperator+rs1.getString("PK_Name")+"Doc.xml"; + packagename = packagedir + rs1.getString("Name"); + includesdir = rs1.getString("Name") + fileSeperator+"**"; + boolean success = (new File(rs1.getString("File_Directory") + rs1.getString("Name")+fileSeperator+"doc"+fileSeperator )).mkdirs(); + String file_document = rs1.getString("File_Directory") + rs1.getString("Name") +fileSeperator+ "doc"+fileSeperator+rs1.getString("Name")+"Doc.xml"; OutputStream fw_document = new FileOutputStream (file_document, false); StreamResult streamResult_document = new StreamResult(fw_document); SAXTransformerFactory tf_document = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); @@ -168,13 +168,13 @@ public class PackOut extends SvrProcess hd_documemt.processingInstruction("xml-stylesheet","type=\"text/css\" href=\"compiereDocument.css\""); hd_documemt.startElement("","","compiereDocument",atts); hd_documemt.startElement("","","header",atts); - hd_documemt.characters((rs1.getString("PK_Name")+" Package Description").toCharArray(),0,(rs1.getString("PK_Name")+" Package Description").length()); + hd_documemt.characters((rs1.getString("Name")+" Package Description").toCharArray(),0,(rs1.getString("Name")+" Package Description").length()); hd_documemt.endElement("","","header"); hd_documemt.startElement("","","H1",atts); hd_documemt.characters(("Package Name:" ).toCharArray(),0,("Package Name:" ).length()); hd_documemt.endElement("","","H1"); hd_documemt.startElement("","","packagename",atts); - hd_documemt.characters(rs1.getString("PK_Name").toCharArray(),0,rs1.getString("PK_Name").length()); + hd_documemt.characters(rs1.getString("Name").toCharArray(),0,rs1.getString("Name").length()); hd_documemt.endElement("","","packagename"); hd_documemt.startElement("","","H1",atts); hd_documemt.characters(("Creator:" ).toCharArray(),0,("Creator:").length()); @@ -224,8 +224,8 @@ public class PackOut extends SvrProcess hd_documemt.startElement("","","filenotes",atts); hd_documemt.characters("Notes: Contains all application/object settings for package".toCharArray(),0,"Notes: Contains all application/object settings for package".length()); hd_documemt.endElement("","","filenotes"); - success = (new File(rs1.getString("File_Directory") + rs1.getString("PK_Name")+fileSeperator+ "dict"+fileSeperator)).mkdirs(); - String file_menu = rs1.getString("File_Directory") + rs1.getString("PK_Name") +fileSeperator+ "dict"+fileSeperator+"PackOut.xml"; + success = (new File(rs1.getString("File_Directory") + rs1.getString("Name")+fileSeperator+ "dict"+fileSeperator)).mkdirs(); + String file_menu = rs1.getString("File_Directory") + rs1.getString("Name") +fileSeperator+ "dict"+fileSeperator+"PackOut.xml"; OutputStream fw_menu = new FileOutputStream (file_menu, false); StreamResult streamResult_menu = new StreamResult(fw_menu); SAXTransformerFactory tf_menu = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); @@ -236,7 +236,7 @@ public class PackOut extends SvrProcess hd_menu.setResult(streamResult_menu); hd_menu.startDocument(); atts.clear(); - atts.addAttribute("","","PK_Name","CDATA",rs1.getString("PK_Name")); + atts.addAttribute("","","Name","CDATA",rs1.getString("Name")); atts.addAttribute("","","Version","CDATA",rs1.getString("PK_Version")); atts.addAttribute("","","CompVer","CDATA",rs1.getString("ReleaseNo")); atts.addAttribute("","","DataBase","CDATA",rs1.getString("Version")); @@ -299,7 +299,7 @@ public class PackOut extends SvrProcess CreateWorkflow (rs.getInt("AD_Workflow_ID"), atts, hd_menu); else if (Type.compareTo("C") == 0){ - String fullDirectory = rs1.getString("File_Directory") + rs1.getString("PK_Name")+rs.getString("Target_Directory"); + String fullDirectory = rs1.getString("File_Directory") + rs1.getString("Name")+rs.getString("Target_Directory"); String targetDirectoryModified=null; char fileseperator1 = '/'; char fileseperator2 = '\\'; @@ -427,7 +427,7 @@ public class PackOut extends SvrProcess //Clean .tar file up success = destTarFile.delete(); - return ""; + return "Finish Process"; } // doIt public void CreateApplication (AttributesImpl atts, TransformerHandler hd_menu, int menu_id) throws SAXException