Source for file add.php
Documentation is available at add.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home'); ?></a></li>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>" class="chemin_rub"> <?php echo _t('menu','project'); ?></a></li>
$mask_statut_P= "checked=\"checked\"";
if(isset ($_POST['enregistrer'])) {
$result= $project_object->AddProject($data_table, $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo;
if(isset ($_POST['valider'])) {
isset ($_POST['choose_sdi']) ? $form_sdi= $_POST['choose_sdi'] : $form_sdi= array();
$table[0]= $_POST['project_name'];
$table[1]= $_POST['project_description'];
$table[2]= $_POST['project_body'];
$table[3]= $_POST['project_parent_id'];
$table[4]= $_POST['project_scale_id'];
$table[5]= $_POST['project_priority_id'];
$table[6]= $_POST['project_begin_date'];
$table[7]= $_POST['project_estimated_date'];
$table[8]= $_POST['project_end_date'];
$table[10]= $_POST['project_statut'];
$table[11]= $_POST['project_theme_id'];
$table[12]= $_POST['project_workshop_id'];
$table[14]= $_POST['project_progression'];
$integrity= $project_object->CheckDataIntegrity($table);
$form_name= formatText($_POST['project_name'], $text_format);
$form_description= formatText($_POST['project_description'], $text_format);
$form_body= formatText($_POST['project_body'], $text_format);
$form_begin_date= $_POST['project_begin_date'];
$form_estimated_date= $_POST['project_estimated_date'];
$form_end_date= $_POST['project_end_date'];
$form_progression= $_POST['project_progression'];
$form_theme_id= $_POST['project_theme_id'];
$form_workshop_id= $_POST['project_workshop_id'];
$form_scale_id= $_POST['project_scale_id'];
$form_parent_id= $_POST['project_parent_id'];
$form_priority_id= $_POST['project_priority_id'];
if($_POST['project_statut']== 'D') $mask_statut_D= "checked=\"checked\""; else $mask_statut_D= '';
if($_POST['project_statut']== 'P') $mask_statut_P= "checked=\"checked\""; else $mask_statut_P= '';
if(!isset ($integrity) || is_string($integrity)) {
include_once("../lib/input_helpers.php");
$data= $sql_object->DBSelect($req_list_theme);
$select_theme= ThemeSelectBox($data, "project_theme_id", $form_theme_id);
// select-box de workshops
$data= $sql_object->DBSelect($req_list_workshop);
// select-box des projets
// select-box des échelles
$data= $sql_object->DBSelect($req_list_scale);
$select_scale= ScaleSelectBox($data, "project_scale_id", $form_scale_id);
// select-box des priorités
$data= $sql_object->DBSelect($req_list_priority);
// select-box des indicateurs
$data= $sql_object->DBSelect($req_list_sdi);
include_once(THEME_ADMIN_PATH. "quickicons.php");
footerAddJS('../lib/js/jquery.datePicker.l10n/jquery.ui.datepicker-'. U_L. '.js');
<script type="text/javascript">
$(document).ready( function()
$("#choose_sdi").multiselect({ noneSelectedText: ' <?php echo _t('divers','select_choice'); ?>', selectedList:2, minWidth:'596px' } ).multiselectfilter();
$( "#project_slider" ).slider({
value: <?php echo $form_progression; ?>,
step: <?php echo PROJECT_STEP; ?>,
slide: function( event, ui ) {
$( "#project_progression" ).val( ui.value );
$( "#progression_value" ).html( ui.value + ' %' );
$( "#project_progression" ).val($( "#project_slider" ).slider( "value" ));
$( "#project_progression" ).hide();
$( "#progression_value" ).html( <?php echo $form_progression; ?> + ' %' );
/** jquery UI datePicker integration
---------------------------------------------------*/
var dateFormat = " <?php echo DATE_FORMAT; ?>";
dateFormat = dateFormat.replace("yyyy", "yy");
$(".date-pick").datepicker({
beforeShow: getAvailableRange,
buttonImage: "../lib/js/calendar.png",
$( ".date-pick" ).datepicker( $.datepicker.regional[ " <?php echo U_L; ?>" ] );
function getAvailableRange(input)
var min = new Date(2000, 1 - 1, 1); //Set this to your absolute minimum date
if (input.id == "project_begin_date")
dateMin = min; // absolute minimum date
else if (input.id == "project_estimated_date")
if ($("#project_begin_date").datepicker("getDate") != null)
dateMin = $("#project_begin_date").datepicker("getDate");
dateMin.setDate(dateMin.getDate() + 1);
else if (input.id == "project_end_date")
if ($("#project_begin_date").datepicker("getDate") != null)
dateMin = $("#project_begin_date").datepicker("getDate");
dateMin.setDate(dateMin.getDate() + 1);
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<form id="addproject" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="project_name"> <?php echo _t('project','name'); ?> : *</label>
<input name="project_name" type="text" maxlength="200" id="project_name" class="textfield" value=" <?php echo $form_name; ?>" />
<label for="project_parent_id"> <?php echo _t('project','parent'); ?> :</label>
<?php echo $select_parent; ?>
<label for="project_description"> <?php echo _t('project','description'); ?> : *</label>
<textarea id="project_description" name="project_description" class="largetextfield" <?php echo AREA_SETTINGS; ?>> <?php echo $form_description; ?></textarea>
<label for="project_body"> <?php echo _t('project','body'); ?> : *</label>
<textarea id="project_body" name="project_body" class="largetextfield" <?php echo AREA_SETTINGS; ?>> <?php echo $form_body; ?></textarea>
<label for="project_begin_date"> <?php echo _t('project','begin_date'); ?> : </label>
<input name="project_begin_date" type="text" maxlength="10" id="project_begin_date" class="date-pick shorttextfield" value=" <?php echo $form_begin_date; ?>" />
<label for="project_estimated_date"> <?php echo _t('project','estimated_date'); ?> : </label>
<input name="project_estimated_date" type="text" maxlength="10" id="project_estimated_date" class="date-pick shorttextfield" value=" <?php echo $form_estimated_date; ?>" />
<label for="project_end_date"> <?php echo _t('project','end_date'); ?> : </label>
<input name="project_end_date" type="text" maxlength="10" id="project_end_date" class="date-pick shorttextfield" value=" <?php echo $form_end_date; ?>" />
<label for="project_progression"> <?php echo _t('project','progression'); ?> : </label>
<div id="project_slider"></div><div id="progression_value"></div>
<input type="text" name="project_progression" id="project_progression" value=" <?php echo $form_progression; ?>" maxlength="3" class="shorttextfield" />
<label for="project_priority_id"> <?php echo _t('project','priority'); ?> : *</label>
<?php echo $select_priority; ?>
<label for="project_theme_id"> <?php echo _t('project','theme'); ?> : </label>
<?php echo $select_theme; ?>
<label for="project_theme_id"> <?php echo _t('project','workshop'); ?> : </label>
<?php echo $select_workshop; ?>
<label for="project_scale_id"> <?php echo _t('project','scale'); ?> : *</label>
<?php echo $select_scale; ?>
<label for="choose_sdi"> <?php echo _t('project','sdi'); ?> : </label>
<?php echo $select_sdi; ?>
<div class="label"> <?php echo _t('project','statut'); ?> : </div>
<input name="project_statut" type="radio" id="statut_P" value="P" <?php echo $mask_statut_P; ?> />
<label for="statut_P"> <?php echo _t('statut','public'); ?></label>
<input name="project_statut" type="radio" id="statut_D" value="D" <?php echo $mask_statut_D; ?> />
<label for="statut_D"> <?php echo _t('statut','draft'); ?></label>
<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>
if($form_theme_id != - 1) {
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $theme_denomination= formatText($result[0]['theme_name'], '2HTML');
} else $theme_denomination= _t('divers','none');
$result= $sql_object->DBSelect($query);
if($result== 0 || count($result)!= 1) exit;
else $scale_denomination= formatText($result[0]['scale_denomination'], '2HTML');
$result= $sql_object->DBSelect($query);
if($result== 0 || count($result)!= 1) exit;
else $priority_name= formatText($result[0]['priority_name'], '2HTML');
if($form_parent_id != - 1) {
$result= $sql_object->DBSelect($query);
if($result== 0 || count($result)!= 1) exit;
else $parent_name= formatText($result[0]['project_name'], '2HTML');
} else $parent_name= _t('divers','none');
if($form_workshop_id != - 1) {
$result= $sql_object->DBSelect($query);
if($result== 0 || count($result)!= 1) exit;
else $workshop_name= formatText($result[0]['workshop_denomination'], '2HTML');
} else $workshop_name= _t('divers','none');
if(count($form_sdi) > 0) {
$sdi_list= '<ul style="padding:0">';
foreach ($form_sdi as &$value) {
$result = $sql_object->DBSelect($query);
if($result== 0 || count($result)!= 1) exit;
} else $sdi_list= _t('divers','none');
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
echo "<dl class=\"dl3\">\n";
echo "<dt>". _t('project','name'). "</dt>\n";
echo "<dd>". $form_name. "</dd>\n";
echo "<dt>". _t('project','parent'). "</dt>\n";
echo "<dd>". $parent_name. "</dd>\n";
echo "<dt>". _t('project','description'). "</dt>\n";
echo "<dt>". _t('project','body'). " :</dt>\n";
echo "<dt>". _t('project','begin_date'). " :</dt>\n";
echo "<dd>". empty_nc($form_begin_date). "</dd>\n";
echo "<dt>". _t('project','estimated_date'). " :</dt>\n";
echo "<dd>". empty_nc($form_estimated_date). "</dd>\n";
echo "<dt>". _t('project','end_date'). " :</dt>\n";
echo "<dd>". empty_nc($form_end_date). "</dd>\n";
echo "<dt>". _t('project','progression'). " :</dt>\n";
echo "<dt>". _t('project','priority'). " :</dt>\n";
echo "<dd>". $priority_name. "</dd>\n";
echo "<dt>". _t('project','theme'). " :</dt>\n";
echo "<dd>". $theme_denomination. "</dd>\n";
echo "<dt>". _t('project','scale'). " :</dt>\n";
echo "<dd>". $scale_denomination. "</dd>\n";
echo "<dt>". _t('project','workshop'). " :</dt>\n";
echo "<dd>". $workshop_name. "</dd>\n";
echo "<dt>". _t('project','sdi'). " :</dt>\n";
echo "<dd>". $sdi_list. "</dd>\n";
echo "<dt>". _t('divers','statut'). "</dt>\n";
<form id="addproject" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<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>
|