<?php

/**
 * Création d'une nouvelle tâche associée à un événement d'un contact
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <*****@*****.**>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
// On ouvre la fiche contact
$evenement = new Event($_POST['evenement']);
// On ajoute le tag
$tache[0] = $evenement->newTask($_POST['user'], $_POST['tache'], $_POST['deadline']);
if (isset($tache[0]['user'])) {
    // On récupère le nom de la fiche qui est concernée par cette tâche
    $nickname = User::getLoginByID($tache[0]['user']);
} else {
    $nickname = 'Pas d\'utilisateur attribué';
}
// On ajoute cette donnée au tableau
$tache[0]['user'] = $nickname;
echo json_encode($tache);
Example #2
0
				<?php 
    foreach ($taches as $tache) {
        $event = new Event($tache['event']);
        $fiche = new People($event->get('people'));
        ?>
				<a href="<?php 
        Core::goPage('contact', array('contact' => $fiche->get('id'), 'evenement' => $event->get('id')));
        ?>
" class="transparent">
					<li class="tache loupeOver">
						<strong><?php 
        echo $tache['task'];
        ?>
</strong>
						<em><?php 
        echo User::getLoginByID($tache['user']);
        ?>
</em>
					</li>
				</a>
				<?php 
    }
    ?>
			</ul>
			<?php 
} else {
    ?>

			<?php 
}
?>
Example #3
0
        echo md5(User::ID());
        ?>
" class="nostyle"><button class="deleting" style="float: right; margin-top: 1.33em;">Refuser</button></a>
    		    <a href="ajax.php?script=mission-accepter&code=<?php 
        echo $mission->get('mission_hash');
        ?>
&user=<?php 
        echo md5(User::ID());
        ?>
" class="nostyle"><button class="vert" style="float: right; margin-top: 1.33em; margin-right: 1em;">Accepter</button></a>
    		    <h4><?php 
        echo $mission->get('mission_nom');
        ?>
</h4>
    		    <p>Vous êtes invité à participer à cette mission par <em><?php 
        echo User::getLoginByID($mission->get('responsable_id'));
        ?>
</em>.</p>
    		</li>
        <?php 
    }
    ?>
		</ul>
	</section>
    <?php 
}
?>
		
    <?php 
if ($missions_ouvertes) {
    ?>
Example #4
0
 $link = Configuration::read('db.core');
 $client = Configuration::read('ini')['LEQG']['compte'];
 $query = $link->prepare('INSERT INTO `user` (`client`, `email`, `password`, `firstname`, `lastname`, `auth_level`) VALUES (:client, :email, :pass, :first, :last, :auth)');
 $query->bindParam(':client', $client);
 $query->bindParam(':email', $form['email']);
 $query->bindParam(':pass', $form['pass_sec']);
 $query->bindParam(':first', $form['prenom']);
 $query->bindParam(':last', $form['nom']);
 $query->bindParam(':auth', $form['selectAuth']);
 $query->execute();
 // On lance l'envoi du mail avec les informations de connexion
 $email = file_get_contents('tpl/mail/user-creation.tpl.html');
 $objet = 'LeQG – Votre compte a été créé par ' . User::getLoginByID(User::ID()) . '.';
 // On insère dans le mail l'URL du fichier pour qu'il puisse être téléchargé
 $email = strtr($email, array('{COMPTE}' => $form['prenom'] . ' ' . $form['nom']));
 $email = strtr($email, array('{USER}' => User::getLoginByID(User::ID())));
 $email = strtr($email, array('{EMAIL}' => $form['email']));
 $email = strtr($email, array('{PASS}' => $form['pass']));
 // On démarre l'instance
 $mail = new PHPMailer();
 // On récupère les informations sur l'API
 $api = Configuration::read('api');
 // On contacte le serveur d'envoi SMTP
 $mail->IsSMTP();
 $mail->SMTPAuth = true;
 $mail->Host = $api['mail']['smtp']['host'];
 $mail->Port = $api['mail']['smtp']['port'];
 $mail->Username = $api['mail']['smtp']['user'];
 $mail->Password = $api['mail']['smtp']['pass'];
 // On configure le mail à envoyer
 $mail->CharSet = $api['mail']['charset'];
Example #5
0
                    <span>Responsable</span>
                    <span><?php 
    echo User::getLoginByID($data->get('responsable_id'));
    ?>
</span>
                </li>
                <li class="actif<?php 
    echo !$militants['reporting'] ? '-inconnu' : '';
    ?>
">
                    <span>Militant le plus actif</span>
                    <?php 
    if ($militants['reporting']) {
        ?>
                    <span><?php 
        echo User::getLoginByID($militants['actif']);
        ?>
</span>
                    <?php 
    } else {
        ?>
                    <span>Aucun militant actif pour l'instant</span>
                    <?php 
    }
    ?>
                </li>
                <li class="utilisateurs inscrit">
                    <span>Militants inscrits</span>
                    <span><strong><?php 
    echo $militants['inscrit'] ? $militants['inscrit'] : 'Aucun';
    ?>
Example #6
0
					<span><a href="exports/publi-<?php 
echo md5($campaign->get('id'));
?>
.csv" class="nostyle"><strong>Ouvrir le fichier</strong></a></span>
				</li>
				<li class="date">
					<span>Date d'envoi</span>
					<span><strong><?php 
echo strftime('%d %B %Y', strtotime($campaign->get('date')));
?>
</strong></span>
				</li>
				<li class="utilisateur">
					<span>Utilisateur à l'origine de la campagne</span>
					<span><?php 
echo User::getLoginByID($campaign->get('user'));
?>
</span>
				</li>
				<li class="email">
					<span>Nombre d'envois</span>
					<span><strong><?php 
echo number_format($campaign->get('count'), 0, ',', ' ');
?>
</strong> envoi<?php 
if ($campaign->get('count') > 1) {
    ?>
s<?php 
}
?>
</span>
Example #7
0
		
		<section class="contenu demi">
			<h4>Informations annexes</h4>
			
			<ul class="informations">
				<li class="date">
					<span>Date d'envoi</span>
					<span><strong><?php 
echo strftime('%d %B %Y', strtotime($campagne->get('campagne_date')));
?>
</strong></span>
				</li>
				<li class="utilisateur">
					<span>Utilisateur à l'origine de la campagne</span>
					<span><?php 
echo User::getLoginByID($campagne->get('campagne_createur'));
?>
</span>
				</li>
				<li class="email">
					<span>Nombre d'envois</span>
					<span><strong><?php 
echo number_format($campagne->get('nombre'), 0, ',', ' ');
?>
</strong> envoi<?php 
if ($campagne->get('nombre') > 1) {
    ?>
s<?php 
}
?>
</span>
Example #8
0
            echo 'Type de campagne inconnu';
        }
        ?>
</span>
                </li>
                <li class="courrier">
                    <span>Statut de la campagne</span>
                    <span><?php 
        echo ucfirst(Campaign::displayStatus($data->get('status')));
        ?>
</span>
                </li>
                <li class="responsable">
                    <span>Créateur</span>
                    <span><?php 
        echo User::getLoginByID($data->get('user'));
        ?>
</span>
                </li>
                <?php 
        if ($data->get('type') == 'email' && $data->get('status') != 'open') {
            ?>
                <li class="utilisateurs inscrit">
                    <span>Nombre d'envois</span>
                    <span><strong><?php 
            echo number_format($data->get('count')['items']['all'], 0, ',', ' ');
            ?>
</strong> destinataire<?php 
            echo $data->get('count')['items']['all'] > 1 ? 's' : '';
            ?>
</span>
Example #9
0
    </section>
</div>

<div class="colonne demi droite">
    <section class="contenu demi">
        <h4>Militants invités</h4>
        
        <ul class="listeContacts">
            <a href="<?php 
Core::goPage('mission', array('code' => $data->get('mission_hash'), 'admin' => 'invitations'));
?>
" class="nostyle"><li class="contact ajout">Inviter de nouveaux militants à la mission</li></a>
            <?php 
if ($militants[0]) {
    foreach ($militants[0] as $militant) {
        ?>
			<li class="contact user homme"><?php 
        echo User::getLoginByID($militant['user_id']);
        ?>
</li>
			<?php 
    }
} else {
    ?>
			<li class="contact user homme">Aucun militant invité.</li>
            <?php 
}
?>
        </ul>
    </section>
</div>
Example #10
0
    <?php 
}
?>
	</section>
	
	<section class="contenu demi">
		<h4>Militants inscrits à cette mission</h4>
		
		<ul class="listeContacts">
    <?php 
$comptes = Porte::inscriptions($mission['mission_id']);
if (count($comptes)) {
    foreach ($comptes as $compte) {
        ?>
			<li class="contact homme"><?php 
        echo User::getLoginByID($compte['user_id']);
        ?>
</li>
    <?php 
    }
} else {
    ?>
			<li class="contact homme">Aucune inscription actuellement.</li>
    <?php 
}
?>
		</ul>
	</section>
	
	<section class="contenu demi">
    	<button class="deleting long supprimerMission" style="margin: .25em auto .15em;">Clôture de la mission</button>