Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
6f84397b
Commit
6f84397b
authored
10 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
i18n: Add translations for popups and login dialog
parent
6cf4c2d8
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
include/ajax.orgs.php
+12
-12
12 additions, 12 deletions
include/ajax.orgs.php
include/ajax.users.php
+21
-19
21 additions, 19 deletions
include/ajax.users.php
include/staff/login.tpl.php
+2
-2
2 additions, 2 deletions
include/staff/login.tpl.php
with
35 additions
and
33 deletions
include/ajax.orgs.php
+
12
−
12
View file @
6f84397b
...
...
@@ -57,7 +57,7 @@ class OrgsAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'Unknown organization'
);
$info
=
array
(
'title'
=>
sprintf
(
'Update %s'
,
$org
->
getName
())
'title'
=>
sprintf
(
__
(
'Update %s'
)
,
$org
->
getName
())
);
$forms
=
$org
->
getForms
();
...
...
@@ -119,7 +119,7 @@ class OrgsAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'Unknown organization'
);
$info
=
array
();
$info
[
'title'
]
=
'Add User'
;
$info
[
'title'
]
=
__
(
'Add User'
)
;
$info
[
'action'
]
=
'#orgs/'
.
$org
->
getId
()
.
'/add-user'
;
$info
[
'onselect'
]
=
'ajax.php/orgs/'
.
$org
->
getId
()
.
'/add-user/'
;
...
...
@@ -130,20 +130,20 @@ class OrgsAjaxAPI extends AjaxController {
if
(
$_POST
)
{
if
(
$_POST
[
'id'
])
{
//Existing useer
if
(
!
(
$user
=
User
::
lookup
(
$_POST
[
'id'
])))
$info
[
'error'
]
=
'Unknown user selected'
;
$info
[
'error'
]
=
__
(
'Unknown user selected'
)
;
elseif
(
$user
->
getOrgId
()
==
$org
->
getId
())
$info
[
'error'
]
=
sprintf
(
'%s already belongs to the organization'
,
Format
::
htmlchars
(
$user
->
getName
()));
}
else
{
//Creating new user
$form
=
UserForm
::
getUserForm
()
->
getForm
(
$_POST
);
if
(
!
(
$user
=
User
::
fromForm
(
$form
)))
$info
[
'error'
]
=
'Error adding user - try again!'
;
$info
[
'error'
]
=
__
(
'Error adding user - try again!'
)
;
}
if
(
!
$info
[
'error'
]
&&
$user
&&
$user
->
setOrganization
(
$org
))
Http
::
response
(
201
,
$user
->
to_json
());
elseif
(
!
$info
[
'error'
])
$info
[
'error'
]
=
'Unable to add user to the organization - try again'
;
$info
[
'error'
]
=
__
(
'Unable to add user to the organization - try again'
)
;
}
elseif
(
$remote
&&
$userId
)
{
list
(
$bk
,
$userId
)
=
explode
(
':'
,
$userId
,
2
);
...
...
@@ -157,9 +157,9 @@ class OrgsAjaxAPI extends AjaxController {
if
(
$user
&&
$user
->
getOrgId
())
{
if
(
$user
->
getOrgId
()
==
$org
->
getId
())
$info
[
'warn'
]
=
'User already belongs to this organization!'
;
$info
[
'warn'
]
=
__
(
'User already belongs to this organization!'
)
;
else
$info
[
'warn'
]
=
"Are you sure you want to change the user's organization?"
;
$info
[
'warn'
]
=
__
(
"Are you sure you want to change the user's organization?"
)
;
}
ob_start
();
...
...
@@ -178,7 +178,7 @@ class OrgsAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'No such organization'
);
$info
=
array
(
'title'
=>
'Import Users'
,
'title'
=>
__
(
'Import Users'
)
,
'action'
=>
"#orgs/
$org_id
/import-users"
,
'upload_url'
=>
"orgs.php?a=import-users"
,
);
...
...
@@ -204,10 +204,10 @@ class OrgsAjaxAPI extends AjaxController {
if
((
$org
=
Organization
::
fromForm
(
$form
)))
Http
::
response
(
201
,
$org
->
to_json
());
$info
=
array
(
'error'
=>
'Error adding organization - try again!'
);
$info
=
array
(
'error'
=>
__
(
'Error adding organization - try again!'
)
)
;
}
$info
[
'title'
]
=
'Add New Organization'
;
$info
[
'title'
]
=
__
(
'Add New Organization'
)
;
$info
[
'search'
]
=
false
;
return
self
::
_lookupform
(
$form
,
$info
);
...
...
@@ -221,7 +221,7 @@ class OrgsAjaxAPI extends AjaxController {
if
(
$id
)
$org
=
Organization
::
lookup
(
$id
);
$info
=
array
(
'title'
=>
'Select Organization'
);
$info
=
array
(
'title'
=>
__
(
'Select Organization'
)
)
;
ob_start
();
include
(
STAFFINC_DIR
.
'templates/org-lookup.tmpl.php'
);
...
...
@@ -243,7 +243,7 @@ class OrgsAjaxAPI extends AjaxController {
static
function
_lookupform
(
$form
=
null
,
$info
=
array
())
{
if
(
!
$info
or
!
$info
[
'title'
])
$info
+=
array
(
'title'
=>
'Organization Lookup'
);
$info
+=
array
(
'title'
=>
__
(
'Organization Lookup'
)
)
;
ob_start
();
include
(
STAFFINC_DIR
.
'templates/org-lookup.tmpl.php'
);
...
...
This diff is collapsed.
Click to expand it.
include/ajax.users.php
+
21
−
19
View file @
6f84397b
...
...
@@ -113,7 +113,7 @@ class UsersAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'Unknown user'
);
$info
=
array
(
'title'
=>
sprintf
(
'Update %s'
,
$user
->
getName
())
'title'
=>
sprintf
(
__
(
'Update %s'
)
,
$user
->
getName
())
);
$forms
=
$user
->
getForms
();
...
...
@@ -148,7 +148,7 @@ class UsersAjaxAPI extends AjaxController {
if
(
$_POST
)
{
// Register user on post
if
(
$user
->
getAccount
())
$info
[
'error'
]
=
'User already registered'
;
$info
[
'error'
]
=
__
(
'User already registered'
)
;
elseif
(
$user
->
register
(
$_POST
,
$errors
))
Http
::
response
(
201
,
'Account created successfully'
);
...
...
@@ -157,7 +157,7 @@ class UsersAjaxAPI extends AjaxController {
if
(
$errors
[
'err'
])
$info
[
'error'
]
=
$errors
[
'err'
];
else
$info
[
'error'
]
=
'Unable to register user - try again!'
;
$info
[
'error'
]
=
__
(
'Unable to register user - try again!'
)
;
}
include
(
STAFFINC_DIR
.
'templates/user-register.tmpl.php'
);
...
...
@@ -187,7 +187,7 @@ class UsersAjaxAPI extends AjaxController {
if
(
$errors
[
'err'
])
$info
[
'error'
]
=
$errors
[
'err'
];
else
$info
[
'error'
]
=
'Unable to update account - try again!'
;
$info
[
'error'
]
=
__
(
'Unable to update account - try again!'
)
;
}
$info
[
'_target'
]
=
$target
;
...
...
@@ -207,19 +207,19 @@ class UsersAjaxAPI extends AjaxController {
if
(
$_POST
)
{
if
(
$user
->
tickets
->
count
())
{
if
(
!
$thisstaff
->
canDeleteTickets
())
{
$info
[
'error'
]
=
'You do not have permission to delete a user with tickets!'
;
$info
[
'error'
]
=
__
(
'You do not have permission to delete a user with tickets!'
)
;
}
elseif
(
$_POST
[
'deletetickets'
])
{
foreach
(
$user
->
tickets
as
$ticket
)
$ticket
->
delete
();
}
else
{
$info
[
'error'
]
=
'You cannot delete a user with tickets!'
;
$info
[
'error'
]
=
__
(
'You cannot delete a user with tickets!'
)
;
}
}
if
(
!
$info
[
'error'
]
&&
$user
->
delete
())
Http
::
response
(
204
,
'User deleted successfully'
);
elseif
(
!
$info
[
'error'
])
$info
[
'error'
]
=
'Unable to delete user - try again!'
;
$info
[
'error'
]
=
__
(
'Unable to delete user - try again!'
)
;
}
include
(
STAFFINC_DIR
.
'templates/user-delete.tmpl.php'
);
...
...
@@ -230,7 +230,7 @@ class UsersAjaxAPI extends AjaxController {
if
((
$user
=
User
::
lookup
((
$id
)
?
$id
:
$_REQUEST
[
'id'
])))
Http
::
response
(
201
,
$user
->
to_json
());
$info
=
array
(
'error'
=>
'Unknown or invalid user'
);
$info
=
array
(
'error'
=>
__
(
'Unknown or invalid user'
)
)
;
return
self
::
_lookupform
(
null
,
$info
);
}
...
...
@@ -247,12 +247,12 @@ class UsersAjaxAPI extends AjaxController {
$info
[
'lookup'
]
=
'local'
;
if
(
$_POST
)
{
$info
[
'title'
]
=
'Add New User'
;
$info
[
'title'
]
=
__
(
'Add New User'
)
;
$form
=
UserForm
::
getUserForm
()
->
getForm
(
$_POST
);
if
((
$user
=
User
::
fromForm
(
$form
)))
Http
::
response
(
201
,
$user
->
to_json
());
$info
[
'error'
]
=
'Error adding user - try again!'
;
$info
[
'error'
]
=
__
(
'Error adding user - try again!'
)
;
}
return
self
::
_lookupform
(
$form
,
$info
);
...
...
@@ -270,9 +270,11 @@ class UsersAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'User not found'
);
$form
=
UserForm
::
getUserForm
()
->
getForm
(
$user_info
);
$info
=
array
(
'title'
=>
'Import Remote User'
);
$info
=
array
(
'title'
=>
__
(
/* `remote` users are those in a remore directory such as LDAP */
'Import Remote User'
));
if
(
!
$user_info
)
$info
[
'error'
]
=
'Unable to find user in directory'
;
$info
[
'error'
]
=
__
(
'Unable to find user in directory'
)
;
include
(
STAFFINC_DIR
.
'templates/user-lookup.tmpl.php'
);
}
...
...
@@ -284,7 +286,7 @@ class UsersAjaxAPI extends AjaxController {
Http
::
response
(
403
,
'Login Required'
);
$info
=
array
(
'title'
=>
'Import Users'
,
'title'
=>
__
(
'Import Users'
)
,
'action'
=>
'#users/import'
,
'upload_url'
=>
"users.php?do=import-users"
,
);
...
...
@@ -306,7 +308,7 @@ class UsersAjaxAPI extends AjaxController {
if
(
$id
)
$user
=
User
::
lookup
(
$id
);
$info
=
array
(
'title'
=>
'Select User'
);
$info
=
array
(
'title'
=>
__
(
'Select User'
)
)
;
ob_start
();
include
(
STAFFINC_DIR
.
'templates/user-lookup.tmpl.php'
);
...
...
@@ -319,7 +321,7 @@ class UsersAjaxAPI extends AjaxController {
static
function
_lookupform
(
$form
=
null
,
$info
=
array
())
{
if
(
!
$info
or
!
$info
[
'title'
])
$info
+=
array
(
'title'
=>
'Lookup or create a user'
);
$info
+=
array
(
'title'
=>
__
(
'Lookup or create a user'
)
)
;
ob_start
();
include
(
STAFFINC_DIR
.
'templates/user-lookup.tmpl.php'
);
...
...
@@ -357,24 +359,24 @@ class UsersAjaxAPI extends AjaxController {
Http
::
response
(
404
,
'Unknown user'
);
$info
=
array
();
$info
[
'title'
]
=
'Organization for
'
.
$user
->
getName
();
$info
[
'title'
]
=
sprintf
(
__
(
'Organization for
%s'
),
$user
->
getName
()
)
;
$info
[
'action'
]
=
'#users/'
.
$user
->
getId
()
.
'/org'
;
$info
[
'onselect'
]
=
'ajax.php/users/'
.
$user
->
getId
()
.
'/org'
;
if
(
$_POST
)
{
if
(
$_POST
[
'orgid'
])
{
//Existing org.
if
(
!
(
$org
=
Organization
::
lookup
(
$_POST
[
'orgid'
])))
$info
[
'error'
]
=
'Unknown organization selected'
;
$info
[
'error'
]
=
__
(
'Unknown organization selected'
)
;
}
else
{
//Creating new org.
$form
=
OrganizationForm
::
getDefaultForm
()
->
getForm
(
$_POST
);
if
(
!
(
$org
=
Organization
::
fromForm
(
$form
)))
$info
[
'error'
]
=
'Unable to create organization - try again!'
;
$info
[
'error'
]
=
__
(
'Unable to create organization - try again!'
)
;
}
if
(
$org
&&
$user
->
setOrganization
(
$org
))
Http
::
response
(
201
,
$org
->
to_json
());
elseif
(
!
$info
[
'error'
])
$info
[
'error'
]
=
'Unable to add organization - try again!'
;
$info
[
'error'
]
=
__
(
'Unable to add organization - try again!'
)
;
}
elseif
(
$orgId
)
$org
=
Organization
::
lookup
(
$orgId
);
...
...
This diff is collapsed.
Click to expand it.
include/staff/login.tpl.php
+
2
−
2
View file @
6f84397b
...
...
@@ -10,8 +10,8 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array();
<?php
csrf_token
();
?>
<input
type=
"hidden"
name=
"do"
value=
"scplogin"
>
<fieldset>
<input
type=
"text"
name=
"userid"
id=
"name"
value=
"
<?php
echo
$info
[
'userid'
];
?>
"
placeholder=
"
u
sername"
autocorrect=
"off"
autocapitalize=
"off"
>
<input
type=
"password"
name=
"passwd"
id=
"pass"
placeholder=
"
p
assword"
autocorrect=
"off"
autocapitalize=
"off"
>
<input
type=
"text"
name=
"userid"
id=
"name"
value=
"
<?php
echo
$info
[
'userid'
];
?>
"
placeholder=
"
<?php
echo
__
(
'Email or U
sername
'
);
?>
"
autocorrect=
"off"
autocapitalize=
"off"
>
<input
type=
"password"
name=
"passwd"
id=
"pass"
placeholder=
"
<?php
echo
__
(
'P
assword
'
);
?>
"
autocorrect=
"off"
autocapitalize=
"off"
>
<?php
if
(
$show_reset
&&
$cfg
->
allowPasswordReset
())
{
?>
<h3
style=
"display:inline"
><a
href=
"pwreset.php"
>
<?php
echo
__
(
'Forgot my password'
);
?>
</a></h3>
<?php
}
?>
...
...
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