Commit 190eeb61 authored by okhin's avatar okhin 🚴

Merge branch '32-nouveau-front' into 'preprod'

Ajout des petits triangles

See merge request !30
parents 3d6385d9 3a43f954
Pipeline #2123 passed with stages
in 1 minute and 19 seconds
......@@ -25,6 +25,12 @@ class Perso extends Controller
$this->get_contreparties($f3);
$this->get_dons($f3);
$this->get_recurrents($f3);
if ($f3->exists('GET.validate')) {
$f3->set('modal_counterparts', '1');
$f3->clear('GET.validate');
} else {
$f3->set('modal_counterparts', '0');
};
$f3->set('block_content', 'user/perso.html');
}
......@@ -356,6 +362,7 @@ class Perso extends Controller
// Récupération des valeurs du formulaire
$adresse_id = $f3->get('adresse_id');
$quoi = $f3->get('quoi');
$commentaire = $f3->get('commentaire');
$valeur = 0;
$piplome_id = intval(substr($f3->get('piplome_id'), 0, strpos($f3->get('piplome_id'), '_')));
$taille = intval($f3->get('taille'));
......@@ -380,22 +387,22 @@ class Perso extends Controller
if ($cumul >= $valeur) {
switch ($quoi) {
case 'piplome':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'piplome','".\Utils::asl($piplome_id)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status,commentaire) VALUES ('".$f3->get('SESSION.id')."',NOW(),'piplome','".\Utils::asl($piplome_id)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'pibag':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pibag','','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pibag','','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'pishirt':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pishirt','".\Utils::asl($taille)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pishirt','".\Utils::asl($taille)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'hoopie':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'hoodie','".\Utils::asl($taille_h)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'hoodie','".\Utils::asl($taille_h)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
}
}
// Puis diminution du cumul de la valeur des contreparties
$db->query("UPDATE users SET cumul = cumul - ".$valeur." WHERE id='".$f3->get('SESSION.id')."'");
$f3->set('msg', _("Merci, vos contreparties seront envoyées dès que possible !"));
$this->show($f3, $args);
$f3->reroute('/perso');
}
public function receipt($f3, $params)
......@@ -412,18 +419,18 @@ class Perso extends Controller
$logger->write($command . " " .$args);
// Vérification que le don appartient bien à l'utilisateur connecté
$query="SELECT dons.datec,
dons.somme,
adresses.nom as pseudo,
adresses.adresse,
adresses.adresse2,
adresses.codepostal,
adresses.ville,
adresses.pays
FROM dons
INNER JOIN users ON users.id = dons.user_id
LEFT OUTER JOIN adresses ON adresses.user_id = users.id
WHERE users.id=".$f3->get('SESSION.id')." AND adresses.defaut IS true AND dons.id=".\Utils::asl($id).";";
$query="SELECT dons.datec,
dons.somme,
adresses.nom as pseudo,
adresses.adresse,
adresses.adresse2,
adresses.codepostal,
adresses.ville,
adresses.pays
FROM dons
INNER JOIN users ON users.id = dons.user_id
LEFT OUTER JOIN adresses ON adresses.user_id = users.id
WHERE users.id=".$f3->get('SESSION.id')." AND adresses.defaut IS true AND dons.id=".\Utils::asl($id).";";
$result = $db->query($query);
$logger->write($query);
$don = $result->fetch(\PDO::FETCH_ASSOC);
......@@ -456,22 +463,22 @@ class Perso extends Controller
);
$date = substr($don['datec'], 8, 2)." ".$monthes[substr($don['datec'], 5, 2)]." ".substr($don['datec'], 0, 4);
$content = '<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="address">
<value>'.$address.'</value>
</field>
<field name="donor">
<value>'.$name.'</value>
</field>
<field name="content">
<value>Reçu le '.$date.' un don de '.$amount.' euros de la part de '.$name.'.</value>
</field>
<field name="date">
<value>Fait à Paris le '.$date.'</value>
</field>
</fields>
</xfdf>';
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="address">
<value>'.$address.'</value>
</field>
<field name="donor">
<value>'.$name.'</value>
</field>
<field name="content">
<value>Reçu le '.$date.' un don de '.$amount.' euros de la part de '.$name.'.</value>
</field>
<field name="date">
<value>Fait à Paris le '.$date.'</value>
</field>
</fields>
</xfdf>';
$fp = fopen("../tmp/".$id.".xfdf", "w");
if ($fp) {
fputs($fp, $content);
......@@ -537,12 +544,12 @@ class Perso extends Controller
$result = $client->customerCancel($parameters);
// Let's add a 103 don at 0€ to keep track of them
$f3->query("INSERT INTO dons SET
status = '103',
datec = NOW(),
somme = 0,
user_id = '".$user_id."',
identifier = '".$identifier."',
cumul = 0;");
status = '103',
datec = NOW(),
somme = 0,
user_id = '".$user_id."',
identifier = '".$identifier."',
cumul = 0;");
$f3->reroute('/perso');
}
......
......@@ -5,6 +5,5 @@
<include href="toolbar.html" />
<include href="{{ @block_content }}" />
<include href="footer.html" />
</check>
</body>
</html>
<head>
<title>{{ _("Soutenez La Quadrature du Net !") }}</title>
<meta charset="utf-8" />
<meta name="author" content="La Quadrature du Net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="favicon.png" />
<title>{{ _("Soutenez La Quadrature du Net !") }}</title>
<meta charset="utf-8" />
<meta name="author" content="La Quadrature du Net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="favicon.png" />
<!-- Open graph -->
<meta property="og:title" content="{{ _('Soutenez La Quadrature du Net !') }}" />
<meta property="og:url" content="https://soutien.laquadrature.net/" />
<!-- FIXME: Change the OG image -->
<meta property="og:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif" />
<meta property="og:site_name" content="La Quadrature du Net" />
<meta property="og:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}" />
<!-- Open graph -->
<meta property="og:title" content="{{ _('Soutenez La Quadrature du Net !') }}" />
<meta property="og:url" content="https://soutien.laquadrature.net/" />
<!-- FIXME: Change the OG image -->
<meta property="og:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif" />
<meta property="og:site_name" content="La Quadrature du Net" />
<meta property="og:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}" />
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@laquadrature" />
<meta name="twitter:title" content="{{ _("Soutenez la Quadrature du Net&nbsp!") }}">
<meta name="twitter:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif">
<meta name="twitter:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}">
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@laquadrature" />
<meta name="twitter:title" content="{{ _("Soutenez la Quadrature du Net&nbsp!") }}">
<meta name="twitter:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif">
<meta name="twitter:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}">
<!-- Styles -->
<link rel="stylesheet" href="/static/css/bootstrap.css" media="all">
<link rel="stylesheet" href="/static/css/fonts.css" media="all">
<link rel="stylesheet" href="/static/css/forms.css" media="all">
<link rel="stylesheet" href="/static/css/modals.css" media="all">
<link rel="stylesheet" href="/static/css/collapsibles.css" media="all">
<link rel="stylesheet" href="/static/css/layouts.css" media="all">
<!-- Custom Styles pour la version 2018 -->
<link rel="stylesheet" href="./static/css/custom.css" media="all">
<!-- Styles -->
<link rel="stylesheet" href="/static/css/bootstrap.css" media="all">
<link rel="stylesheet" href="/static/css/fonts.css" media="all">
<link rel="stylesheet" href="/static/css/forms.css" media="all">
<link rel="stylesheet" href="/static/css/modals.css" media="all">
<link rel="stylesheet" href="/static/css/collapsibles.css" media="all">
<link rel="stylesheet" href="/static/css/layouts.css" media="all">
<!-- Custom Styles pour la version 2018 -->
<link rel="stylesheet" href="./static/css/custom.css" media="all">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!--
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
-->
<!-- Latest compiled and minified JavaScript -->
<!--
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
-->
</head>
This diff is collapsed.
<?php
use Phinx\Migration\AbstractMigration;
class AddCommentaire extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('contreparties');
$table->addColumn('commentaire', 'string')
->update();
}
}
......@@ -660,4 +660,4 @@
\ No newline at end of file
......@@ -25,6 +25,7 @@ class CounterpartFinderTest extends FunctionalTest
'pdf_id' => '1',
'pdf_nom' => 'Main',
'pdf_url' => 'pdf',
'commentaire' => '',
];
$this->assertEquals($expectedCounterpart, $firstCounterpart);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment