Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
ad1ec032
Commit
ad1ec032
authored
13 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Normalize code
parent
354e8156
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/admin/company.php
+1
-1
1 addition, 1 deletion
htdocs/admin/company.php
htdocs/core/class/html.formother.class.php
+4
-2
4 additions, 2 deletions
htdocs/core/class/html.formother.class.php
htdocs/core/lib/date.lib.php
+17
-35
17 additions, 35 deletions
htdocs/core/lib/date.lib.php
with
22 additions
and
38 deletions
htdocs/admin/company.php
+
1
−
1
View file @
ad1ec032
...
...
@@ -871,7 +871,7 @@ else
$var
=!
$var
;
print
'<tr '
.
$bc
[
$var
]
.
'><td width="35%">'
.
$langs
->
trans
(
"FiscalMonthStart"
)
.
'</td><td>'
;
$monthstart
=
(
!
empty
(
$conf
->
global
->
SOCIETE_FISCAL_MONTH_START
))
?
$conf
->
global
->
SOCIETE_FISCAL_MONTH_START
:
1
;
print
monthArrayOrSelected
(
$monthstart
)
.
'</td></tr>'
;
print
dol_print_date
(
dol_mktime
(
12
,
0
,
0
,
$monthstart
,
1
,
2000
,
1
),
'%B'
,
'gm'
)
.
'</td></tr>'
;
print
"</table>"
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/html.formother.class.php
+
4
−
2
View file @
ad1ec032
...
...
@@ -542,16 +542,18 @@ class FormOther
*/
function
select_month
(
$selected
=
''
,
$htmlname
=
'monthid'
,
$useempty
=
0
)
{
global
$langs
;
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/lib/date.lib.php"
);
$month
=
monthArray
OrSelected
(
-
1
);
// Get array
$month
array
=
monthArray
(
$langs
);
// Get array
$select_month
=
'<select class="flat" name="'
.
$htmlname
.
'">'
;
if
(
$useempty
)
{
$select_month
.
=
'<option value="0"> </option>'
;
}
foreach
(
$month
as
$key
=>
$val
)
foreach
(
$month
array
as
$key
=>
$val
)
{
if
(
$selected
==
$key
)
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/lib/date.lib.php
+
17
−
35
View file @
ad1ec032
...
...
@@ -697,45 +697,27 @@ function num_open_day($timestampStart, $timestampEnd,$inhour=0,$lastday=0)
/**
* Return array of translated months or selected month
*
* @param
int $selected -1 to return array of all months or motnh to select
* @return
mixed
Month string or array if selected < 0
* @param
Translate $outputlangs Object langs
* @return
array
Month string or array if selected < 0
*/
function
monthArray
OrSelected
(
$selected
=
0
)
function
monthArray
(
$outputlangs
)
{
global
$langs
;
$month
=
array
(
1
=>
$langs
->
trans
(
"January"
),
2
=>
$langs
->
trans
(
"February"
),
3
=>
$langs
->
trans
(
"March"
),
4
=>
$langs
->
trans
(
"April"
),
5
=>
$langs
->
trans
(
"May"
),
6
=>
$langs
->
trans
(
"June"
),
7
=>
$langs
->
trans
(
"July"
),
8
=>
$langs
->
trans
(
"August"
),
9
=>
$langs
->
trans
(
"September"
),
10
=>
$langs
->
trans
(
"October"
),
11
=>
$langs
->
trans
(
"November"
),
12
=>
$langs
->
trans
(
"December"
)
$montharray
=
array
(
1
=>
$outputlangs
->
trans
(
"January"
),
2
=>
$outputlangs
->
trans
(
"February"
),
3
=>
$outputlangs
->
trans
(
"March"
),
4
=>
$outputlangs
->
trans
(
"April"
),
5
=>
$outputlangs
->
trans
(
"May"
),
6
=>
$outputlangs
->
trans
(
"June"
),
7
=>
$outputlangs
->
trans
(
"July"
),
8
=>
$outputlangs
->
trans
(
"August"
),
9
=>
$outputlangs
->
trans
(
"September"
),
10
=>
$outputlangs
->
trans
(
"October"
),
11
=>
$outputlangs
->
trans
(
"November"
),
12
=>
$outputlangs
->
trans
(
"December"
)
);
if
(
$selected
>=
0
)
{
$return
=
''
;
foreach
(
$month
as
$key
=>
$val
)
{
if
(
$selected
==
$key
)
{
$return
=
$val
;
break
;
}
}
return
$return
;
}
else
{
return
$month
;
}
return
$montharray
;
}
?>
\ No newline at end of file
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