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
919ef20b
authored
2015-11-25 12:21:46 -0500
by
Insu Mun
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add language selection for new notification page.
1 parent
7cc54a60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
com/Notifications/Admin.php
com/Notifications/Validation.php
com/Notifications/views/create.php
com/Notifications/Admin.php
View file @
919ef20
...
...
@@ -132,7 +132,8 @@ function display_page()
);
update_post_meta
(
$id
,
'send_status'
,
$entry
->
details
[
'status'
]);
update_post_meta
(
$id
,
'notif_type'
,
$type
);
update_post_meta
(
$id
,
'execute_date'
,
mysqldatetime_to_timestamp
(
$executeDate
));
// update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
update_post_meta
(
$id
,
'execute_date'
,
strtotime
(
$executeDate
));
update_post_meta
(
$id
,
'trigger'
,
$trigger
);
update_post_meta
(
$id
,
'email'
,
$emailData
);
...
...
@@ -288,15 +289,17 @@ function create_notification()
foreach
([
'en'
,
'fr'
]
as
$lang
)
{
$validation
->
set_rules
(
$lang
.
'_subject'
,
'Subject'
,
'trim'
);
$validation
->
set_rules
(
$lang
.
'_text'
,
'Text Version'
,
'trim|min_length[16]'
);
$validation
->
set_rules
(
$lang
.
'_html'
,
'HTML Version'
,
'trim|min_length[16]'
);
// $validation->set_rules($lang.'_text', 'Text Version', 'trim|min_length[16]');
// $validation->set_rules($lang.'_html', 'HTML Version', 'trim|min_length[16]');
$validation
->
set_rules
(
$lang
.
'_text'
,
'Text Version'
,
'trim'
);
$validation
->
set_rules
(
$lang
.
'_html'
,
'HTML Version'
,
'trim'
);
$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['subject'] == '' && $_POST['system'] == '')) {
//
$form_error = true;
//
require_once(__DIR__.'/views/create.php');
//
} else {
if
(
$validation
->
run
()
==
true
)
{
// Clean up the data before saving
...
...
@@ -385,7 +388,9 @@ function create_notification()
);
update_post_meta
(
$id
,
'send_status'
,
'pending'
);
update_post_meta
(
$id
,
'notif_type'
,
$type
);
update_post_meta
(
$id
,
'execute_date'
,
mysqldatetime_to_timestamp
(
$executeDate
));
// update_post_meta($id, 'execute_date', mysqldatetime_to_timestamp($executeDate));
update_post_meta
(
$id
,
'execute_date'
,
strtotime
(
$executeDate
));
update_post_meta
(
$id
,
'trigger'
,
$trigger
);
update_post_meta
(
$id
,
'email'
,
$emailData
);
...
...
@@ -396,5 +401,5 @@ function create_notification()
}
else
{
require_once
(
__DIR__
.
DIRECTORY_SEPARATOR
.
'views'
.
DIRECTORY_SEPARATOR
.
'create.php'
);
}
}
//
}
}
...
...
com/Notifications/Validation.php
View file @
919ef20
...
...
@@ -309,7 +309,6 @@ class Validation
// Did we end up with any errors?
$total_errors
=
count
(
$this
->
_error_array
);
if
(
$total_errors
>
0
)
{
$this
->
_safe_form_data
=
true
;
}
...
...
com/Notifications/views/create.php
View file @
919ef20
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment