Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
1dd91fe5
Verified
Commit
1dd91fe5
authored
6 years ago
by
Florian Azizian
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 18.04
parents
3e61bb74
cb83d071
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/maarch_entreprise/admin/update_control/update_control.php
+1
-3
1 addition, 3 deletions
...maarch_entreprise/admin/update_control/update_control.php
install/view/update_download_view.php
+25
-32
25 additions, 32 deletions
install/view/update_download_view.php
with
26 additions
and
35 deletions
apps/maarch_entreprise/admin/update_control/update_control.php
+
1
−
3
View file @
1dd91fe5
...
@@ -56,7 +56,6 @@ $allCurrentTags = [];
...
@@ -56,7 +56,6 @@ $allCurrentTags = [];
$allNextTags
=
[];
$allNextTags
=
[];
$cptCurrentTags
=
0
;
$cptCurrentTags
=
0
;
$isAnyAvailableTag
=
false
;
$isAnyAvailableTag
=
false
;
$isAnyAvailableVersion
=
false
;
foreach
(
$tags
as
$value
)
{
foreach
(
$tags
as
$value
)
{
if
(
!
preg_match
(
"/^\d
{
2}\.\d{2
}
\.\d+$/"
,
$value
[
'name'
]))
{
if
(
!
preg_match
(
"/^\d
{
2}\.\d{2
}
\.\d+$/"
,
$value
[
'name'
]))
{
...
@@ -68,7 +67,6 @@ foreach ($tags as $value) {
...
@@ -68,7 +67,6 @@ foreach ($tags as $value) {
$year
=
substr
(
$value
[
'name'
],
0
,
2
);
$year
=
substr
(
$value
[
'name'
],
0
,
2
);
$month
=
substr
(
$value
[
'name'
],
3
,
2
);
$month
=
substr
(
$value
[
'name'
],
3
,
2
);
if
((
$year
==
$currentVersionBranchYear
&&
$month
>
$currentVersionBranchMonth
)
||
$year
>
$currentVersionBranchYear
)
{
if
((
$year
==
$currentVersionBranchYear
&&
$month
>
$currentVersionBranchMonth
)
||
$year
>
$currentVersionBranchYear
)
{
$isAnyAvailableVersion
=
true
;
$allNextTags
[]
=
$value
[
'name'
];
$allNextTags
[]
=
$value
[
'name'
];
}
}
}
else
{
}
else
{
...
@@ -139,7 +137,7 @@ foreach ($tags as $value) {
...
@@ -139,7 +137,7 @@ foreach ($tags as $value) {
}
}
}
}
if
(
$isAnyAvailableVersion
)
{
if
(
!
empty
(
$allNextTags
)
)
{
echo
'<br><br><br><b>'
.
_NEW_MAJOR_VERSION_AVAILABLE
.
'</b> : <br>'
;
echo
'<br><br><br><b>'
.
_NEW_MAJOR_VERSION_AVAILABLE
.
'</b> : <br>'
;
for
(
$j
=
0
;
$j
<
count
(
$allNextTags
);
++
$j
)
{
for
(
$j
=
0
;
$j
<
count
(
$allNextTags
);
++
$j
)
{
echo
$allNextTags
[
$j
]
.
'<br />'
;
echo
$allNextTags
[
$j
]
.
'<br />'
;
...
...
This diff is collapsed.
Click to expand it.
install/view/update_download_view.php
+
25
−
32
View file @
1dd91fe5
...
@@ -23,59 +23,52 @@ if ($_SESSION['user']['UserId'] <> 'superadmin') {
...
@@ -23,59 +23,52 @@ if ($_SESSION['user']['UserId'] <> 'superadmin') {
//retrives tags
//retrives tags
$client
=
new
\Gitlab\Client
(
'https://labs.maarch.org/api/v4/'
);
$client
=
new
\Gitlab\Client
(
'https://labs.maarch.org/api/v4/'
);
//$client->authenticate('aSecretToken', \Gitlab\Client::AUTH_URL_TOKEN);
// $project = $client->api('projects')->show('12');
$tags
=
$client
->
api
(
'tags'
)
->
all
(
'12'
);
$tags
=
$client
->
api
(
'tags'
)
->
all
(
'12'
);
//retrieve current version
//retrieve current version
$db
=
new
Database
();
$db
=
new
Database
();
$query
=
"SELECT param_value_int,
param_value_string FROM parameters WHERE id = 'database_version'"
;
$query
=
"SELECT
param_value_string FROM parameters WHERE id = 'database_version'"
;
$stmt
=
$db
->
query
(
$query
,
[]);
$stmt
=
$db
->
query
(
$query
,
[]);
$currentVersion
=
$stmt
->
fetchObject
();
$currentVersion
=
$stmt
->
fetchObject
();
$versionBranch
=
substr
(
$currentVersion
->
param_value_int
,
0
,
2
)
.
'.'
.
substr
(
$currentVersion
->
param_value_int
,
2
);
$currentVersionBranch
=
substr
(
$currentVersion
->
param_value_string
,
0
,
5
);
$currentVersionNumeric
=
preg_replace
(
"/[^0-9,]/"
,
""
,
$currentVersion
->
param_value_int
);
$currentVersionBranchYear
=
substr
(
$currentVersion
->
param_value_string
,
0
,
2
);
if
(
!
empty
(
$currentVersion
->
param_value_string
))
{
$currentVersionBranchMonth
=
substr
(
$currentVersion
->
param_value_string
,
3
,
2
);
$currentVersionTagNumeric
=
preg_replace
(
"/[^0-9,]/"
,
""
,
$currentVersion
->
param_value_string
);
$currentVersionTag
=
substr
(
$currentVersion
->
param_value_string
,
6
);
}
$allCurrentTags
=
[];
$allCurrentTags
=
[];
$allNextTags
=
[];
$allNextTags
=
[];
$cptCurrentTags
=
0
;
$cptCurrentTags
=
0
;
$isAnyAvailableTag
=
false
;
$isAnyAvailableTag
=
false
;
$isAnyAvailableVersion
=
false
;
$isAnyAvailableVersion
=
false
;
foreach
(
$tags
as
$key
=>
$value
)
{
foreach
(
$tags
as
$value
)
{
//echo $tags[$key]['name'] . ' ' . preg_replace("/[^0-9,]/", "", $tags[$key]['name']) . '<br />';
if
(
!
preg_match
(
"/^\d
{
2}\.\d{2
}
\.\d+$/"
,
$value
[
'name'
]))
{
if
(
!
preg_match
(
"/^\d
{
2}\.\d{2
}
\.\d+$/"
,
$tags
[
$key
][
'name'
]))
{
continue
;
continue
;
}
}
$tag
Numeric
=
preg_replace
(
"/[^0-9,]/"
,
""
,
$tags
[
$key
]
[
'name'
]);
$tag
=
substr
(
$value
[
'name'
]
,
6
);
$pos
=
strpos
(
$
tagNumeric
,
$currentVersion
Numeric
);
$pos
=
strpos
(
$
value
[
'name'
]
,
$currentVersion
Branch
);
if
(
$pos
===
false
)
{
if
(
$pos
===
false
)
{
//echo 'tag not in currentVersion:';
$year
=
substr
(
$value
[
'name'
],
0
,
2
);
$isAnyAvailableVersion
=
true
;
$month
=
substr
(
$value
[
'name'
],
3
,
2
);
$allNextTags
[]
=
$tags
[
$key
][
'name'
];
if
((
$year
==
$currentVersionBranchYear
&&
$month
>
$currentVersionBranchMonth
)
||
$year
>
$currentVersionBranchYear
)
{
$isAnyAvailableVersion
=
true
;
$allNextTags
[]
=
$value
[
'name'
];
}
}
else
{
}
else
{
//echo 'tag in currentVersion:';
$allCurrentTags
[
$cptCurrentTags
]
=
[];
$allCurrentTags
[
$cptCurrentTags
]
=
[];
$allCurrentTags
[
$cptCurrentTags
][
'name'
]
=
$tags
[
$key
][
'name'
];
$allCurrentTags
[
$cptCurrentTags
][
'name'
]
=
$value
[
'name'
];
$allCurrentTags
[
$cptCurrentTags
][
'numeric'
]
=
$tagNumeric
;
if
(
$tag
>
$currentVersionTag
)
{
if
(
$tagNumeric
>
$currentVersionTagNumeric
)
{
$allCurrentTags
[
$cptCurrentTags
][
'enabled'
]
=
true
;
$allCurrentTags
[
$cptCurrentTags
][
'enabled'
]
=
true
;
$isAnyAvailableTag
=
true
;
$isAnyAvailableTag
=
true
;
}
else
{
}
else
{
$allCurrentTags
[
$cptCurrentTags
][
'enabled'
]
=
false
;
$allCurrentTags
[
$cptCurrentTags
][
'enabled'
]
=
false
;
}
}
$cptCurrentTags
++
;
++
$cptCurrentTags
;
}
}
}
}
// require_once('install/class/Class_Install.php');
// $Class_Install = new Install;
?>
?>
<script>
<script>
function
launchProcess
(
myVar
)
{
function
launchProcess
(
myVar
)
{
...
@@ -121,7 +114,7 @@ foreach ($tags as $key => $value) {
...
@@ -121,7 +114,7 @@ foreach ($tags as $key => $value) {
<td>
<?php
echo
_YOUR_VERSION
;
?>
</td>
<td>
<?php
echo
_YOUR_VERSION
;
?>
</td>
<td>
:
</td>
<td>
:
</td>
<td>
<td>
<?php
echo
'<b>'
.
$currentVersion
->
param_value_string
.
'</b>
('
.
_BRANCH_VERSION
.
' : <b>'
.
$versionBranch
.
'</b>)
'
;
?>
<?php
echo
'<b>'
.
$currentVersion
->
param_value_string
.
'</b>'
;
?>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment