Source for file add_cal.php
Documentation is available at add_cal.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
if(isset ($_POST['id'])) $id= $_POST['id'];
if(isset ($_GET['id'])) $id= $_GET['id'];
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
include_once("../lib/input_helpers.php");
$link_add_cal = $rub_link . "&todo=add_cal&id=";
$link_det = $rub_link . "&todo=det&id=";
$result_workshop= $sql_object->DBSelect($req_det_workshop);
$workshop_denomination= formatText($result_workshop[0]['workshop_denomination'], '2HTML');
$link_cancel= $rub_link. "&todo=list_cal&id=". $id;
if(isset ($_POST['enregistrer'])) {
$result= $calendar_object->AddTask($data_table, $sql_object);
//faire l'ajout de user avec AddUserWorkshop
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo. "&id=". $id;
if(isset ($_POST['valider'])) {
$table[0] = $_POST['date'];
$table[1] = $_POST['task'];
$table[2] = $_POST['task_details'];
$table[3] = $_POST['id'];
$table[4] = $_POST['author'];
isset ($_POST['is_common']) ? $table[5] = 1 : $table[5] = 0;
$integrity= $calendar_object->CheckDataIntegrity($table, $sql_object);
$form_task= formatText($_POST['task'], $text_format);
$form_task_details= formatText($_POST['task_details'], $text_format);
$form_date = $_POST['date'];
if(isset ($_POST['is_common'])) {
$mask = 'checked="checked"';
$form_common = _t('divers', 'yes');
$form_common = _t('divers', 'no');
include_once(THEME_ADMIN_PATH. "quickicons.php");
$navtitle= _t('workshop','add_cal'). " : ". $workshop_denomination;
footerAddJS('../lib/js/jquery.datePicker.l10n/jquery.ui.datepicker-'. U_L. '.js');
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home') ?></a>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>"
class="chemin_rub"> <?php echo _t('menu','workshop')?></a></li>
<li><span> <?php echo formatnavTitle($navtitle); ?></span></li>
<script type="text/javascript">
var dateFormat = " <?php echo DATE_FORMAT; ?>";
dateFormat = dateFormat.replace("yyyy", "yy");
$(".date-pick").datepicker({
buttonImage: "../lib/js/calendar.png",
dateMin: new Date(2000, 1 - 1, 1)
$( "#datepicker" ).datepicker( $.datepicker.regional[ " <?php echo U_L; ?>" ] );
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<h2> <?php echo formatTitleh2(_t('workshop','name'). " : ". $workshop_denomination); ?></h2>
<form id="addtask" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="task"> <?php echo ucfirst(_t('workshop','task')); ?> * : </label>
<input name="task" type="text" class="textfield" id="task" maxlength="200" value=" <?php echo $form_task; ?>" />
<label for="task_details"> <?php echo ucfirst(_t('workshop','task_details')); ?> * : </label>
<textarea id="task_details" name="task_details" <?php echo AREA_SETTINGS; ?> class="largetextfield"> <?php echo $form_task_details; ?></textarea>
<label for="date"> <?php echo ucfirst(_t('workshop','date')); ?> *:</label>
<input name="date" type="text" maxlength="10" id="date" class="date-pick shorttextfield" value=" <?php echo $form_date; ?>" /><br />
<label for="is_common"> <?php echo ucfirst(_t('workshop','task_common')); ?> :</label>
<input name="is_common" type="checkbox" maxlength="10" id="is_common" value="1" <?php echo $mask; ?> />
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="author" type="hidden" value=" <?php echo $author; ?>" id="author" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="valider" type="submit" value=" <?php echo _t('btn','valid') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<div id="content"> <?php afflinkbar($todo,$id, $lang); ?>
<h2> <?php echo _t('recap','title') ?></h2>
echo "<dl class=\"dl3\">\n";
echo "<dt>". ucfirst(_t('workshop','task')). "</dt>\n";
echo "<dd>". $display_form_task. "</dd>\n";
echo "<dt>". ucfirst(_t('workshop','task_details')). "</dt>\n";
echo "<dd>". $display_form_task_details. "</dd>\n";
echo "<dt>". ucfirst(_t('workshop','date')). " :</dt>\n";
echo "<dd>". $form_date. "</dd>\n";
echo "<dt>". ucfirst(_t('workshop','task_common')). " :</dt>\n";
echo "<dd>". $form_common. "</dd>\n";
<form id="addtask" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="data_table" type="hidden" value=" <?php echo $table; ?>" id="data_table" />
<input name="retour" type="button" value=" <?php echo _t('btn','preview') ?>" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value=" <?php echo _t('btn','save') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
|