17
17
projects[{$smarty.foreach.projects.iteration-1}] = {$prj_id};
21
21
function validateForm()
23
23
if (Validation.isFieldWhitespace('email')) {
24
alert('{/literal}{t escape=js}Please enter the email of this user.{/t}{literal}');
24
alert('{t escape=js}Please enter the email of this user.{/t}');
25
25
Validation.selectField('email');
28
28
if (!Validation.isEmail(Eventum.getField('email').val())) {
29
alert('{/literal}{t escape=js}Please enter a valid email address.{/t}{literal}');
29
alert('{t escape=js}Please enter a valid email address.{/t}');
30
30
Validation.selectField('email');
33
33
var password = Eventum.getField('password').val();
34
34
if (Eventum.getField('cat').val() == 'update') {
35
35
if ((!Validation.isWhitespace(password)) && (password.length < 6)) {
36
alert('{/literal}{t escape=js}Please enter a password of at least 6 characters.{/t}{literal}');
36
alert('{t escape=js}Please enter a password of at least 6 characters.{/t}');
37
37
Validation.selectField('password');
41
41
if ((Validation.isWhitespace(password)) || (password.length < 6)) {
42
alert('{/literal}{t escape=js}Please enter a password of at least 6 characters.{/t}{literal}');
42
alert('{t escape=js}Please enter a password of at least 6 characters.{/t}');
43
43
Validation.selectField('password');
47
47
if (Validation.isFieldWhitespace('full_name')) {
48
alert('{/literal}{t escape=js}Please enter the full name of this user.{/t}{literal}');
48
alert('{t escape=js}Please enter the full name of this user.{/t}');
49
49
Validation.selectField('full_name');
58
58
var total = Eventum.getField('items[]').length;
59
59
if (Eventum.getField('status').val() == 'inactive') {
60
60
if (active_users.length < 2) {
61
alert('{/literal}{t escape=js}You cannot change the status of the only active user left in the system.{/t}{literal}');
61
alert('{t escape=js}You cannot change the status of the only active user left in the system.{/t}');
64
64
if (total == total_selected) {
65
alert('{/literal}{t escape=js}You cannot inactivate all of the users in the system.{/t}{literal}');
65
alert('{t escape=js}You cannot inactivate all of the users in the system.{/t}');
69
69
if (!Validation.hasOneChecked('items[]')) {
70
alert('{/literal}{t escape=js}Please select at least one of the users.{/t}{literal}');
70
alert('{t escape=js}Please select at least one of the users.{/t}');
73
if (!confirm('{/literal}{t escape=js}This action will change the status of the selected users.{/t}{literal}')) {
73
if (!confirm('{t escape=js}This action will change the status of the selected users.{/t}')) {