|
|
|
|
@ -15,7 +15,10 @@ |
|
|
|
|
* @package chamilo.install |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
use ChamiloSession as Session; |
|
|
|
|
use ChamiloSession as Session, |
|
|
|
|
Chamilo\TicketBundle\Entity\Project as TicketProject, |
|
|
|
|
Chamilo\TicketBundle\Entity\Category as TicketCategory, |
|
|
|
|
Chamilo\TicketBundle\Entity\Priority as TicketPriority; |
|
|
|
|
|
|
|
|
|
ini_set('display_errors', '1'); |
|
|
|
|
ini_set('log_errors', '1'); |
|
|
|
|
@ -367,34 +370,44 @@ if ($encryptPassForm == '1') { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function send_contact_information() { |
|
|
|
|
var data_post = ""; |
|
|
|
|
data_post += "person_name="+$("#person_name").val()+"&"; |
|
|
|
|
data_post += "person_email="+$("#person_email").val()+"&"; |
|
|
|
|
data_post += "company_name="+$("#company_name").val()+"&"; |
|
|
|
|
data_post += "company_activity="+$("#company_activity option:selected").val()+"&"; |
|
|
|
|
data_post += "person_role="+$("#person_role option:selected").val()+"&"; |
|
|
|
|
data_post += "company_country="+$("#country option:selected").val()+"&"; |
|
|
|
|
data_post += "company_city="+$("#company_city").val()+"&"; |
|
|
|
|
data_post += "language="+$("#language option:selected").val()+"&"; |
|
|
|
|
data_post += "financial_decision="+$("input[@name='financial_decision']:checked").val(); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(objeto) {}, |
|
|
|
|
type: "POST", |
|
|
|
|
url: "<?php echo api_get_path(WEB_AJAX_PATH) ?>install.ajax.php?a=send_contact_information",
|
|
|
|
|
data: data_post, |
|
|
|
|
success: function(datos) { |
|
|
|
|
if (datos == 'required_field_error') { |
|
|
|
|
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
|
|
|
|
|
} else if (datos == '1') { |
|
|
|
|
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
|
|
|
|
|
} else { |
|
|
|
|
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
|
|
|
|
|
if (!document.getElementById('accept_licence').checked) { |
|
|
|
|
alert('Debe aceptar la licencia para poder usar este software') |
|
|
|
|
;return false; |
|
|
|
|
} else { |
|
|
|
|
var data_post = ""; |
|
|
|
|
data_post += "person_name="+$("#person_name").val()+"&"; |
|
|
|
|
data_post += "person_email="+$("#person_email").val()+"&"; |
|
|
|
|
data_post += "company_name="+$("#company_name").val()+"&"; |
|
|
|
|
data_post += "company_activity="+$("#company_activity option:selected").val()+"&"; |
|
|
|
|
data_post += "person_role="+$("#person_role option:selected").val()+"&"; |
|
|
|
|
data_post += "company_country="+$("#country option:selected").val()+"&"; |
|
|
|
|
data_post += "company_city="+$("#company_city").val()+"&"; |
|
|
|
|
data_post += "language="+$("#language option:selected").val()+"&"; |
|
|
|
|
data_post += "financial_decision="+$("input[name='financial_decision']:checked").val(); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(objeto) {}, |
|
|
|
|
type: "POST", |
|
|
|
|
url: "<?php echo api_get_path(WEB_AJAX_PATH) ?>install.ajax.php?a=send_contact_information",
|
|
|
|
|
beforeSend : function() { |
|
|
|
|
$('#loader-button').append(' <em class="fa fa-spinner fa-pulse fa-fw"></em>'); |
|
|
|
|
}, |
|
|
|
|
data: data_post, |
|
|
|
|
success: function(datos) { |
|
|
|
|
if (datos == 'required_field_error') { |
|
|
|
|
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
|
|
|
|
|
} else if (datos == '1') { |
|
|
|
|
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
|
|
|
|
|
} else { |
|
|
|
|
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
|
|
|
|
|
} |
|
|
|
|
alert(message); |
|
|
|
|
$('#license-next').trigger('click'); |
|
|
|
|
$('#loader-button').html(''); |
|
|
|
|
} |
|
|
|
|
alert(message); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
|
|
|
|
|
@ -821,14 +834,14 @@ if (@$_POST['step2']) { |
|
|
|
|
$connection->executeQuery('CREATE TABLE version (id int unsigned NOT NULL AUTO_INCREMENT, version varchar(255), PRIMARY KEY(id), UNIQUE(version))'); |
|
|
|
|
|
|
|
|
|
// Tickets |
|
|
|
|
$table = Database::get_main_table(TABLE_TICKET_PROJECT); |
|
|
|
|
$ticketProject = new TicketProject(); |
|
|
|
|
$ticketProject |
|
|
|
|
->setId(1) |
|
|
|
|
->setName('Ticket System') |
|
|
|
|
->setInsertUserId(1); |
|
|
|
|
|
|
|
|
|
// Default Project Table Ticket |
|
|
|
|
$attributes = array( |
|
|
|
|
'id' => 1, |
|
|
|
|
'name' => 'Ticket System' |
|
|
|
|
); |
|
|
|
|
Database::insert($table, $attributes); |
|
|
|
|
$manager->persist($ticketProject); |
|
|
|
|
$manager->flush(); |
|
|
|
|
|
|
|
|
|
$categories = array( |
|
|
|
|
get_lang('TicketEnrollment') => get_lang('TicketsAboutEnrollment'), |
|
|
|
|
@ -840,29 +853,27 @@ if (@$_POST['step2']) { |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$i = 1; |
|
|
|
|
$table = Database::get_main_table(TABLE_TICKET_CATEGORY); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @var string $category |
|
|
|
|
* @var string $description |
|
|
|
|
*/ |
|
|
|
|
foreach ($categories as $category => $description) { |
|
|
|
|
// Online evaluation requires a course |
|
|
|
|
if ($i == 6) { |
|
|
|
|
$attributes = array( |
|
|
|
|
'id' => $i, |
|
|
|
|
'name' => $category, |
|
|
|
|
'description' => $description, |
|
|
|
|
'project_id' => 1, |
|
|
|
|
'course_required' => 1 |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
$attributes = array( |
|
|
|
|
'id' => $i, |
|
|
|
|
'project_id' => 1, |
|
|
|
|
'description' => $description, |
|
|
|
|
'name' => $category, |
|
|
|
|
'course_required' => 0 |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
$ticketCategory = new TicketCategory(); |
|
|
|
|
$ticketCategory |
|
|
|
|
->setId($i) |
|
|
|
|
->setName($category) |
|
|
|
|
->setDescription($description) |
|
|
|
|
->setProject($ticketProject) |
|
|
|
|
->setInsertUserId(1); |
|
|
|
|
|
|
|
|
|
$isRequired = $i == 6; |
|
|
|
|
$ticketCategory->setCourseRequired($isRequired); |
|
|
|
|
|
|
|
|
|
$manager->persist($ticketCategory); |
|
|
|
|
$manager->flush(); |
|
|
|
|
|
|
|
|
|
Database::insert($table, $attributes); |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -876,12 +887,15 @@ if (@$_POST['step2']) { |
|
|
|
|
$table = Database::get_main_table(TABLE_TICKET_PRIORITY); |
|
|
|
|
$i = 1; |
|
|
|
|
foreach ($defaultPriorities as $code => $priority) { |
|
|
|
|
$attributes = array( |
|
|
|
|
'id' => $i, |
|
|
|
|
'name' => $priority, |
|
|
|
|
'code' => $code |
|
|
|
|
); |
|
|
|
|
Database::insert($table, $attributes); |
|
|
|
|
$ticketPriority = new TicketPriority(); |
|
|
|
|
$ticketPriority |
|
|
|
|
->setId($i) |
|
|
|
|
->setName($priority) |
|
|
|
|
->setCode($code) |
|
|
|
|
->setInsertUserId(1); |
|
|
|
|
|
|
|
|
|
$manager->persist($ticketPriority); |
|
|
|
|
$manager->flush(); |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|