Skip to content

Commit 92c24cd

Browse files
committed
Fix details
1 parent 741330a commit 92c24cd

5 files changed

Lines changed: 219 additions & 275 deletions

File tree

front/migration_status.php

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/** @var \DBmysql $DB */
1919
global $DB;
2020

21-
// Collect migration data
21+
// Collect basic statistics - simple and reliable
2222
$formCount = 0;
2323
if ($DB->tableExists('glpi_plugin_formcreator_forms')) {
2424
$formCount = countElementsInTable('glpi_plugin_formcreator_forms');
@@ -29,27 +29,9 @@
2929
$answerCount = countElementsInTable('glpi_plugin_formcreator_formanswers');
3030
}
3131

32-
$migrationCompleted = Config::getConfigurationValue('formcreator', 'migration_completed');
33-
$showMigrationProgress = false;
34-
$migrationError = null;
35-
36-
// Handle migration request
37-
if (isset($_POST['start_migration'])) {
38-
Session::checkRight('config', UPDATE);
39-
Session::checkCSRF($_POST);
40-
41-
$showMigrationProgress = true;
42-
43-
try {
44-
$migration = new Migration(PLUGIN_FORMCREATOR_VERSION);
45-
46-
// Simple migration status update for now
47-
Config::setConfigurationValues('formcreator', ['migration_completed' => true]);
48-
$migrationCompleted = true;
49-
50-
} catch (Exception $e) {
51-
$migrationError = __('Migration error: ', 'formcreator') . $e->getMessage();
52-
}
32+
$nativeFormCount = 0;
33+
if ($DB->tableExists('glpi_forms_forms')) {
34+
$nativeFormCount = countElementsInTable('glpi_forms_forms');
5335
}
5436

5537
// Display GLPI header
@@ -59,11 +41,7 @@
5941
TemplateRenderer::getInstance()->display('@formcreator/migration_status.html.twig', [
6042
'form_count' => $formCount,
6143
'answer_count' => $answerCount,
62-
'migration_completed' => $migrationCompleted,
63-
'show_migration_progress' => $showMigrationProgress,
64-
'migration_error' => $migrationError,
65-
'current_url' => $_SERVER['PHP_SELF'],
66-
'csrf_token' => Session::getNewCSRFToken(),
44+
'native_form_count' => $nativeFormCount,
6745
]);
6846

6947
// Display GLPI footer

setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@
5757
/**
5858
* Define the plugin's version and informations
5959
*
60-
* @return array|false [name, version, author, homepage, license, minGlpiVersion]
60+
* @return array [name, version, author, homepage, license, minGlpiVersion]
6161
*/
6262
function plugin_version_formcreator() {
6363
plugin_formcreator_savePreviousVersion();
6464

6565
// Use constant instead of deprecated method
6666
$webDir = FORMCREATOR_ROOTDOC;
67-
67+
6868
return [
6969
'name' => 'Form Creator (Migration Only)',
7070
'version' => PLUGIN_FORMCREATOR_VERSION,

templates/central_eol_warning.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="d-flex align-items-start">
33
{# Icon section #}
44
<div class="flex-shrink-0 me-3">
5-
<i class="fas fa-exclamation-triangle fa-2x text-warning"></i>
5+
<i class="ti ti-alert-triangle fa-2x text-warning"></i>
66
</div>
77

88
{# Content section #}
@@ -22,12 +22,12 @@
2222
<div class="d-flex flex-column flex-md-row gap-2 justify-content-md-end">
2323
<a href="{{ root_doc }}/plugins/formcreator/front/eol_info.php"
2424
class="btn btn-sm btn-outline-dark">
25-
<i class="fas fa-info-circle me-1"></i>
25+
<i class="ti ti-info-circle me-1"></i>
2626
{{ __('Learn More', 'formcreator') }}
2727
</a>
2828
<a href="{{ root_doc }}/plugins/formcreator/front/migration_status.php"
2929
class="btn btn-sm btn-primary">
30-
<i class="fas fa-exchange-alt me-1"></i>
30+
<i class="ti ti-arrows-exchange me-1"></i>
3131
{{ __('Migration Status', 'formcreator') }}
3232
</a>
3333
</div>

templates/eol_info.html.twig

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
<div class="card-header bg-warning text-dark border-0">
77
<div class="d-flex align-items-center">
88
<div class="me-3">
9-
<i class="fas fa-exclamation-triangle fa-2x"></i>
9+
<i class="ti ti-alert-triangle fa-2x"></i>
1010
</div>
11-
<div>
12-
<h2 class="mb-0 h4">
11+
<div class="d-flex align-items-center flex-column">
12+
<p class="mb-0 h3">
1313
{{ __('Formcreator End of Life Notice', 'formcreator') }}
14-
</h2>
15-
<small class="text-muted">
14+
</p>
15+
<p class="mb-0 text-light">
1616
{{ __('Migration guidance and information', 'formcreator') }}
17-
</small>
17+
</p>
1818
</div>
1919
</div>
2020
</div>
2121

2222
{# Body #}
2323
<div class="card-body">
2424
{# EOL Notice Banner #}
25-
<div class="alert alert-info border-start border-info border-4 mb-4">
25+
<div class="alert alert-info border-start border-info border-2 mb-4">
2626
<div class="d-flex align-items-start">
27-
<i class="fas fa-info-circle text-info me-2 mt-1"></i>
27+
<i class="ti ti-info-circle text-info me-2 mt-1"></i>
2828
<div>
2929
<h5 class="alert-heading mb-2">{{ __('Important Notice', 'formcreator') }}</h5>
3030
<p class="mb-0">
@@ -40,26 +40,26 @@
4040
<div class="card border-success h-100">
4141
<div class="card-header bg-light border-success">
4242
<h5 class="card-title mb-0 text-success">
43-
<i class="fas fa-arrow-up me-2"></i>
43+
<i class="ti ti-arrow-up me-2"></i>
4444
{{ __('What changed?', 'formcreator') }}
4545
</h5>
4646
</div>
4747
<div class="card-body">
4848
<ul class="list-unstyled mb-0">
4949
<li class="mb-2">
50-
<i class="fas fa-check text-success me-2"></i>
50+
<i class="ti ti-check text-success me-2"></i>
5151
{{ __('GLPI 11 now has native form creation capabilities', 'formcreator') }}
5252
</li>
5353
<li class="mb-2">
54-
<i class="fas fa-check text-success me-2"></i>
54+
<i class="ti ti-check text-success me-2"></i>
5555
{{ __('All Formcreator features are available in GLPI core', 'formcreator') }}
5656
</li>
5757
<li class="mb-2">
58-
<i class="fas fa-check text-success me-2"></i>
58+
<i class="ti ti-check text-success me-2"></i>
5959
{{ __('Better integration with GLPI workflows', 'formcreator') }}
6060
</li>
6161
<li class="mb-0">
62-
<i class="fas fa-check text-success me-2"></i>
62+
<i class="ti ti-check text-success me-2"></i>
6363
{{ __('Improved performance and security', 'formcreator') }}
6464
</li>
6565
</ul>
@@ -71,26 +71,26 @@
7171
<div class="card border-primary h-100">
7272
<div class="card-header bg-light border-primary">
7373
<h5 class="card-title mb-0 text-primary">
74-
<i class="fas fa-tasks me-2"></i>
74+
<i class="ti ti-checklist me-2"></i>
7575
{{ __('Next steps', 'formcreator') }}
7676
</h5>
7777
</div>
7878
<div class="card-body">
7979
<ul class="list-unstyled mb-0">
8080
<li class="mb-2">
81-
<i class="fas fa-chevron-right text-primary me-2"></i>
81+
<i class="ti ti-chevron-right text-primary me-2"></i>
8282
{{ __('Review your existing forms', 'formcreator') }}
8383
</li>
8484
<li class="mb-2">
85-
<i class="fas fa-chevron-right text-primary me-2"></i>
85+
<i class="ti ti-chevron-right text-primary me-2"></i>
8686
{{ __('Migrate to GLPI 11 native forms', 'formcreator') }}
8787
</li>
8888
<li class="mb-2">
89-
<i class="fas fa-chevron-right text-primary me-2"></i>
89+
<i class="ti ti-chevron-right text-primary me-2"></i>
9090
{{ __('Test the new form system', 'formcreator') }}
9191
</li>
9292
<li class="mb-0">
93-
<i class="fas fa-chevron-right text-primary me-2"></i>
93+
<i class="ti ti-chevron-right text-primary me-2"></i>
9494
{{ __('Uninstall Formcreator plugin when ready', 'formcreator') }}
9595
</li>
9696
</ul>
@@ -104,7 +104,7 @@
104104
<div class="d-flex flex-wrap justify-content-center gap-3">
105105
<a href="{{ plugin_web_dir }}/front/migration_status.php"
106106
class="btn btn-primary px-4">
107-
<i class="fas fa-exchange-alt me-2"></i>
107+
<i class="ti ti-arrows-exchange me-2"></i>
108108
{{ __('View Migration Status', 'formcreator') }}
109109
</a>
110110
</div>

0 commit comments

Comments
 (0)