danmunn / redmine_dmsf

Fork of svn repository for redmine_dmsf
GNU General Public License v2.0
413 stars 193 forks source link

Possible to start with major version from 1 and minor version from 0 for new upload? #1460

Closed blackw123 closed 12 months ago

blackw123 commented 1 year ago

as subject. I use redmine v4.2.3 and DMSF 3.0.5.

picman commented 1 year ago

No, there is no such option.

blackw123 commented 1 year ago

Could you guide how to change the source code to realize this? Then I can have a temporary solution and look for a long term way.

for example, to change in dmsf_upload_helper file as below. The Major version can start from 1. but the minor version is also start with 1. not 0.

0..99, A..Z except O

def self.major_version_select_options (1..99).to_a + ('A'..'Y').to_a - ['O'] end

picman commented 1 year ago
diff --git a/app/helpers/dmsf_upload_helper.rb b/app/helpers/dmsf_upload_helper.rb
index d47b4a75..225814d8 100644
--- a/app/helpers/dmsf_upload_helper.rb
+++ b/app/helpers/dmsf_upload_helper.rb
@@ -159,7 +159,7 @@ module DmsfUploadHelper

   # 0..99, A..Z except O
   def self.major_version_select_options
-    (0..99).to_a + ('A'..'Y').to_a - ['O']
+    (1..99).to_a + ('A'..'Y').to_a - ['O']
   end

   # 0..999, ' '
diff --git a/app/models/dmsf_upload.rb b/app/models/dmsf_upload.rb
index 66ba061b..f73f4e17 100644
--- a/app/models/dmsf_upload.rb
+++ b/app/models/dmsf_upload.rb
@@ -75,7 +75,7 @@ class DmsfUpload
         @minor_version = nil
       else
         @major_version = 0
-        @minor_version = 0
+        @minor_version = -1
       end
       @patch_version = nil
       @workflow = nil
blackw123 commented 12 months ago

It works. Thanks.