Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1bfffaf5
authored
2015-11-27 09:58:41 -0500
by
Insu Mun
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Check the notification language when user creates a notification.
1 parent
4772fe24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
com/Notifications/Admin.php
com/Notifications/views/create.php
com/Notifications/Admin.php
View file @
1bfffaf
...
...
@@ -24,7 +24,6 @@ call_user_func(
function
display_page
()
{
if
(
isset
(
$_GET
[
'action'
])
&&
$_GET
[
'action'
]
==
"edit"
)
{
/** @var \StdClass $entry */
$entry
=
get_post
(
$_GET
[
'page_id'
]);
...
...
@@ -201,8 +200,8 @@ function display_page()
$entry
->
type
=
$details
[
'type'
];
$entry
->
sendto
=
$details
[
'sendto'
];
$entry
->
is_email
=
((
$email
[
'en_text'
]
!=
''
||
$email
[
'en_html'
]
!=
''
))
?
true
:
false
;
$entry
->
is_system
=
(
isset
(
$system
[
'en_message'
])
&&
$system
[
'en_message'
]
!=
''
)
?
true
:
false
;
$entry
->
is_email
=
((
$email
[
'en_text'
]
!=
''
||
$email
[
'en_html'
]
!=
''
))
||
((
$email
[
'fr_text'
]
!=
''
||
$email
[
'fr_html'
]
!=
''
))
?
true
:
false
;
$entry
->
is_system
=
(
isset
(
$system
[
'en_message'
])
&&
$system
[
'en_message'
]
!=
''
)
||
(
isset
(
$system
[
'fr_message'
])
&&
$system
[
'fr_message'
]
!=
''
)
?
true
:
false
;
$entry
->
execute_date
=
$details
[
'execute_date'
];
...
...
@@ -296,10 +295,10 @@ function create_notification()
$validation
->
set_rules
(
$lang
.
'_system'
,
'System Message'
,
'trim|min_length[16]'
);
}
// if ($_POST && ($_POST['subject'] == '' && $_POST['
system'] == '')) {
//
$form_error = true;
//
require_once(__DIR__.'/views/create.php');
//
} else {
if
(
$_POST
&&
(
$_POST
[
'en_subject'
]
==
''
&&
$_POST
[
'fr_subject'
]
==
''
&&
$_POST
[
'en_system'
]
==
''
&&
$_POST
[
'fr_
system'
]
==
''
))
{
$form_error
=
true
;
require_once
(
__DIR__
.
'/views/create.php'
);
}
else
{
if
(
$validation
->
run
()
==
true
)
{
// Clean up the data before saving
...
...
@@ -401,5 +400,5 @@ function create_notification()
}
else
{
require_once
(
__DIR__
.
DIRECTORY_SEPARATOR
.
'views'
.
DIRECTORY_SEPARATOR
.
'create.php'
);
}
//
}
}
}
...
...
com/Notifications/views/create.php
View file @
1bfffaf
...
...
@@ -249,16 +249,12 @@ function getInputFormValues($validation, $name) {
</div>
<?php
endforeach
;
?>
</div>
<p>
<input
type=
"submit"
value=
" Save "
/>
<input
type=
"button"
value=
" Cancel "
onclick=
"document.location.href='/wp-admin/admin.php?page=notifications';"
/>
</p>
</form>
</div>
<script>
...
...
Please
register
or
sign in
to post a comment