Source for file tpl_wg-subscription.php
Documentation is available at tpl_wg-subscription.php
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
include_once('../class/system/class.form.php');
isset ($_COOKIE['linea21']['login']) ? $isAuthentified = true : $isAuthentified = false;
if(isset ($_REQUEST['id'])) {
$_POST['workgroup_'. $_REQUEST['id']] = true;
$link_back = HrefMaker(array('rub'=> $GLOBALS['links'][U_L]['workgroup']['linkvalue'], 'id'=> $_REQUEST['id']));
$link_registration = array('rub'=> $GLOBALS['links'][U_L]['user-registration']['linkvalue']);
$link_account = array('rub'=> $GLOBALS['links'][U_L]['user-prefs']['linkvalue']);
if(isset ($_POST['workgroup_'. $id])) return true;
for($i= 0; $i< count($workgroups); $i++ ) {
$var = 'workgroup_'. $workgroups[$i]->workshop_id;
if(isset ($_POST[$var])) return true;
for($i= 0; $i< count($workgroups); $i++ ) {
$var = 'workgroup_'. $workgroups[$i]->workshop_id;
if(isset ($_POST[$var])) array_push($a, $workgroups[$i]->workshop_id);
// we init an array to see if user has already subscribed all groups
for($i= 0; $i< count($workgroups); $i++ ) {
<?php echo _t('workshop','get_involve_long'); ?></h1>
if(isset ($_POST['comment'])) {
// sélection d'au moins un groupe
if (!isWgselected($workgroups)) $msg.= _t('workshop','nogroup_selected'). '<br />';
$groups.= " - ". $el->workshop_denomination. " <i>(id: ". $el->workshop_id. ")</i><br />\n";
$msg .= _t('workshop', 'confirm_request');
if(isset ($link_back)) $msg .= ' <a href="'. $link_back. '" title="'. _t('workshop','workshop_back'). '" >'. _t('workshop','workshop_back'). '</a>.'. END_LINE;
$linkuser = 'index.php?rub=user&todo=mod&id='. $_COOKIE['linea21']['id']. '#groups';
/** include email template */
$a['action']= 'workgroup_request';
include_once(themePath('../workshop/mail_actions.php'));
include_once(themePath('../mail/template.php'));
if(isset ($passed)) echo '<div class="'. $class. '">'. $msg. '</div>';
echo '<p class="warning">'. _t('workshop','note_account'). ' ' . '<a href="'. HrefMaker($link_account). '" title="'. formatText(_t('divers','auth'), '2ATT'). '" >'. _t('divers','auth'). '</a>.<br />'. END_LINE;
echo '<a href="'. HrefMaker($link_registration). '">'. _t('user','info_inscription2'). ' </a></p>';
// affichage s'il manque un champs
if(!isset ($passed) || $passed== false) {
// the user has not subscribed all groups, we display the form
$form->startForm('index.php', '#wg-subscription');
$form->insertHTML('<div id="choosegdt">'. _t('workshop','subscribe_to'). ' : </div>');
$form->insertHTML('<div class="label-leftmargin">');
for($i= 0; $i< count($workgroups); $i++ ) {
// we remove the workgroups user already belongs to
$form->checkboxInput('checkbox','workgroup_'. $workgroups[$i]->workshop_id, $workgroups[$i]->workshop_id, $workgroups[$i]->workshop_denomination, ischecked($workgroups[$i]->workshop_id), 'after', 'cb', 'labelised autowidth');
$form->insertHTML('</div>');
$form->textareaInput('comment',ucfirst(_t('divers', 'comment')). ' ('. _t('divers', 'optional'). ') : ',false,'labelised', false, $comment, 60, 10);
$form->submitButton(false, _t('btn', 'valid'), true, 'submitbut');
$form->hiddenInput('rub', $_REQUEST['rub']);
if(isset ($_REQUEST['id'])) $form->hiddenInput('id', $_REQUEST['id']);
if(!$output = $form->getForm()) {
die("error: " . $form->error);
// the user already subscribed all groups, we display a warning
echo '<p class="warning">'. _t('workshop', 'allgroups_subscribed'). '</p>'. END_LINE;
|