Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SACI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bruno Fernandes
SACI
Commits
e7b99107
Commit
e7b99107
authored
Dec 04, 2024
by
Márcio Adriano Siqueira Simão
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: Remove espaços em branco
parent
d38954ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
TabUsuariosController.php
backend/controllers/sistema/TabUsuariosController.php
+22
-22
No files found.
backend/controllers/sistema/TabUsuariosController.php
View file @
e7b99107
...
...
@@ -16,9 +16,9 @@ use yii\filters\VerbFilter;
class
TabUsuariosController
extends
\backend\controllers\BaseController
{
use
\backend\controllers\ControllerTrait
;
public
$strSearchModel
=
'common\models\sistema\SistemaTabUsuariosSearch'
;
public
function
behaviors
()
{
return
[
...
...
@@ -30,7 +30,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
],
];
}
/**
* Deletes an existing SistemaTabUsuarios model.
* If deletion is successful, the browser will be redirected to the 'index' page.
...
...
@@ -67,7 +67,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
}
return
$this
->
getResponse
(
$status
,
$msg
);
}
/**
* Finds the SistemaTabUsuarios model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
...
...
@@ -83,7 +83,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
throw
new
NotFoundHttpException
(
'A pagina solicitada nao existe. - '
.
basename
(
__FILE__
,
'.php'
)
.
'('
.
__LINE__
.
')'
);
}
}
public
function
actionForm
()
{
$model
=
$this
->
findModel
(
Yii
::
$app
->
user
->
identity
->
cod_usuario
);
if
(
...
...
@@ -96,7 +96,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
}
return
$this
->
render
(
'_form'
,[
'model'
=>
$model
]);
}
/**
* Creates a new PacTabSpa model.
* If creation is successful, the browser will be redirected to the 'view' page.
...
...
@@ -106,13 +106,13 @@ class TabUsuariosController extends \backend\controllers\BaseController
{
$changes
=
''
;
$cod_usuario
=
''
;
if
(
$arrPost
=
Yii
::
$app
->
request
->
post
(
'SistemaTabUsuarios'
))
{
if
(
array_key_exists
(
"cod_usuario"
,
$arrPost
))
{
$cod_usuario
=
$arrPost
[
"cod_usuario"
];
}
}
if
(
Yii
::
$app
->
request
->
get
(
'id'
)
||
$cod_usuario
)
{
$cod_usuario
=
Yii
::
$app
->
request
->
get
(
'id'
)
?
:
$cod_usuario
;
if
(
...
...
@@ -124,7 +124,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
}
else
{
$model
=
$this
->
findModel
(
$cod_usuario
);
if
(
SistemaTabUsuarios
::
isAdmin
()
&&
SistemaTabUsuarios
::
isAdmin
()
&&
(
Yii
::
$app
->
user
->
identity
->
cod_usuario
!=
$model
->
cod_usuario
)
)
{
$model
->
setScenario
(
SistemaTabUsuarios
::
SCENARIO_UPDATEADM
);
...
...
@@ -138,12 +138,12 @@ class TabUsuariosController extends \backend\controllers\BaseController
$msg
=
"Usuários só podem ser criados por administradores."
;
return
$this
->
getResponse
(
false
,
$msg
);
}
// Caso não esteja salvando, retorna o template
if
(
!
Yii
::
$app
->
request
->
get
(
'salvando'
))
{
return
json_encode
([
'tpl'
=>
$this
->
renderAjax
(
'_form'
,
'_form'
,
[
'model'
=>
$model
,]
)
]);
...
...
@@ -157,7 +157,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
?
'Usuário cadastrado com sucesso. Para criar a senha o usuário deve acessar o email cadastrado.'
:
'Erro enviando email para criação da senha. Contate o suporte.'
;
@
logAction
(
'Novo usuário'
,
'Novo usuário'
,
"
Usuário:
{
$model
->
username
}
Nome:
{
$model
->
txt_nome
}
...
...
@@ -200,24 +200,24 @@ class TabUsuariosController extends \backend\controllers\BaseController
return
$this
->
getResponse
(
false
,
$msg
);
}
}
/**
* Creates a new PacTabSpa model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public
function
redirectAba
()
{
$method
=
(
SistemaTabUsuarios
::
isAdmin
())
?
'sistema/tab-usuarios/index'
:
'sistema/tab-usuarios/form'
;
return
$this
->
redirect
([
$method
,]);
}
public
function
getResponse
(
$status
,
$msg
)
{
if
(
(
Yii
::
$app
->
request
->
get
(
'ajax'
))
&&
(
Yii
::
$app
->
request
->
get
(
'ajax'
))
&&
(
SistemaTabUsuarios
::
isAdmin
())
)
{
return
json_encode
([
...
...
@@ -232,15 +232,15 @@ class TabUsuariosController extends \backend\controllers\BaseController
return
$this
->
redirectAba
();
}
}
/*public function getGridParams() {
$idGrid = 'grid-usuarios';
$params = Yii::$app->request->queryParams;
$gridModel = new SistemaTabUsuariosSearch();
$dataProvider = $gridModel->search($params);
$dataProvider->setSort(['defaultOrder' => [ 'username' => SORT_ASC],]);
$dataProvider
->sort
...
...
@@ -261,7 +261,7 @@ class TabUsuariosController extends \backend\controllers\BaseController
]);
return [
'gridModel' => $gridModel,
'gridModel' => $gridModel,
'dataProvider' => $dataProvider,
'idGrid' => $idGrid,
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment