Text copy

This commit is contained in:
KONE SOREL 2025-12-27 20:41:08 +00:00
parent 1a44f868ca
commit 99ca118fe2
6 changed files with 145 additions and 4 deletions

View File

@ -759,6 +759,11 @@ body {
border-right: none !important;
border-bottom: 1px solid var(--office-border);
}
.editor-paper {
padding: 1rem !important;
font-size: 9pt;
}
}
/* Écrans larges : mêmes insets pour nav-tabs et content-area */
@ -952,7 +957,7 @@ li i { margin-right:10px; color:#007bff; }
border-radius: 2px; /* Office style is more rectangular */
}
#div_police .card-header {
#div_police .card-header, #div_texte_cp .card-header {
border-bottom: 1px solid var(--office-border) !important;
background-color: white;
color: var(--office-dark);
@ -1058,3 +1063,47 @@ li i { margin-right:10px; color:#007bff; }
border-left: 3px solid var(--office-primary) !important;
font-weight: bold;
}
/* Styles spécifiques à l'éditeur de texte CP */
/* Effet "Feuille de papier" pour le textarea */
.editor-paper {
background-color: #ffffff !important;
background-image:
linear-gradient(#f1f1f1 1px, transparent 1px);
background-size: 100% 2.5rem; /* Simule des lignes d'écriture si besoin */
line-height: 2.5rem;
padding: 2rem !important;
border: 1px solid var(--office-border) !important;
border-radius: 0;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace; /* Police technique et lisible */
color: var(--office-dark);
resize: vertical;
transition: all 0.3s ease;
}
.editor-paper:focus {
outline: none;
box-shadow: 0 0 15px rgba(0,0,0,0.1) !important;
border-color: var(--office-secondary) !important; /* Focus bleu Office */
}
/* Bouton Enregistrer - Style Bleu Office */
#div_texte_cp .btn-secondary {
background-color: var(--office-secondary) !important;
border-color: var(--office-secondary) !important;
border-radius: 2px;
transition: transform 0.2s;
}
#div_texte_cp .btn-secondary:hover {
background-color: #1e4275 !important;
transform: translateY(-1px);
}
/* Conteneur de l'éditeur */
.editor-container {
background: white;
border-radius: 2px;
position: relative;
}

View File

@ -0,0 +1,21 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurTextecp extends Controleur {
private $textecp;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Textecp");
$this->textecp = new Police();
}
public function index() {
$idPolice = $_SESSION['idPolice_C'];
$textecp = $this->textecp->getTextecp($idPolice);
$this->genererVue(array('textecp' => $textecp));
}
}

View File

@ -561,4 +561,9 @@ function afficher_emission(idEmission)
{
window.location.assign($("#racineWeb" ).val()+"Emission/"+idEmission+"/");
}
}
}
function texte_cp()
{
window.location.assign($("#racineWeb" ).val()+"Textecp/");
}

View File

@ -110,4 +110,10 @@ class Police extends Modele {
return $ligne['nb_non_facturees'];
}
public function getTextecp($id) {
$sql = 'select texteCp from police where (id=?)';
$textecp = $this->executerRequete($sql, array($id));
return $textecp->fetch(PDO::FETCH_ASSOC);
}
}

60
Vue/Textecp/index.php Normal file
View File

@ -0,0 +1,60 @@
<?php
/**
* Vue : Texte libre sur CP
* Thème : Office/Document Editor
*/
$this->titre = "Tâches - Texte libre sur CP";
$numeroPolice = $this->nettoyer($_SESSION['numeroPolice_C']);
?>
<div id="div_texte_cp" class="container-fluid py-4">
<div class="card shadow-sm border-0">
<div class="card-header d-flex justify-content-between align-items-center py-3">
<h5 class="mb-0 fw-bold text-uppercase">
<i class="fas fa-edit me-2"></i>
<?= _("Conditions Particulières") ?>
</h5>
<span class="badge bg-white text-dark shadow-sm">
<?= _("Police No") ?> : <?= $numeroPolice ?>
</span>
</div>
<div class="card-body p-4 bg-light">
<div class="mb-3">
<label for="texteCp" class="form-label fw-bold text-primary small">
<?= _("SAISIE DU TEXTE LIBRE") ?>
</label>
<p class="text-muted small mb-3">
<i class="fas fa-info-circle me-1"></i>
<?= _("Ce texte apparaîtra sur les documents officiels de la police.") ?>
</p>
<form method="POST" action="Textecp/enregistrer/">
<div class="editor-container shadow-sm mb-4">
<textarea
class="form-control editor-paper"
id="texteCp"
name="texteCp"
rows="18"
placeholder="<?= _("Saisissez votre texte ici...") ?>"
><?= $this->nettoyer($textecp['texteCp']) ?></textarea>
</div>
<div class="row">
<div class="col-md-4 ms-auto">
<button type="submit" class="btn btn-secondary w-100 fw-bold py-2 shadow-sm">
<i class="fas fa-save me-2"></i> <?= _("Enregistrer les modifications") ?>
</button>
</div>
</div>
</form>
</div>
</div>
<div class="card-footer bg-white text-end py-2">
<small class="text-muted fst-italic">
<?= _("Dernière mise à jour : ") . date('d/m/Y H:i') ?>
</small>
</div>
</div>
</div>

View File

@ -119,7 +119,7 @@ $activeChildId = $menuData['child'];
<link rel="manifest" href="<?= $racineWeb ?>manifest.json">
<!-- 4. VOS STYLES PERSONNALISÉS (en dernier pour qu'ils dominent) -->
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2025.12.27.10" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2025.12.27.11" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/ux_enhancements.css?ver=2025.12.21.02" rel="stylesheet">
<!-- ============================================
@ -600,7 +600,7 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2025.12.27.01"></script>
<script src="/Js/fonctions.js?ver=2025.12.27.02"></script>
<?php if (est_anglophone()): ?>
<script src="/Js/datepicker-eng.js"></script>