Debug opensurvey. Look and feel v13. Removed deprecated properties.

This commit is contained in:
Laurent Destailleur
2020-09-07 12:04:50 +02:00
parent 1f58942e11
commit b1e45aef46
15 changed files with 75 additions and 96 deletions

View File

@@ -89,7 +89,6 @@ if ($action == 'update')
$result = $menu->fetch(GETPOST('menuId', 'int'));
if ($result > 0)
{
$menu->titre = GETPOST('titre', 'alpha'); // deprecated
$menu->title = GETPOST('titre', 'alpha');
$menu->leftmenu = GETPOST('leftmenu', 'aZ09');
$menu->url = GETPOST('url', 'alpha');
@@ -200,7 +199,6 @@ if ($action == 'add')
$menu = new Menubase($db);
$menu->menu_handler = preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09'));
$menu->type = GETPOST('type', 'alpha');
$menu->titre = GETPOST('titre', 'alpha'); // deprecated
$menu->title = GETPOST('titre', 'alpha');
$menu->url = GETPOST('url', 'alpha');
$menu->langs = GETPOST('langs', 'alpha');
@@ -478,7 +476,7 @@ if ($action == 'create')
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
// Title
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre ? $menu->titre : $menu->title).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->title).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
// Url
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';

View File

@@ -184,7 +184,7 @@ class Menubase
$this->position = (int) $this->position;
$this->url = trim($this->url);
$this->target = trim($this->target);
$this->titre = trim($this->titre);
$this->title = trim($this->title);
$this->langs = trim($this->langs);
$this->perms = trim($this->perms);
$this->enabled = trim($this->enabled);
@@ -264,7 +264,7 @@ class Menubase
$sql .= " ".((int) $this->position).",";
$sql .= " '".$this->db->escape($this->url)."',";
$sql .= " '".$this->db->escape($this->target)."',";
$sql .= " '".$this->db->escape($this->titre)."',";
$sql .= " '".$this->db->escape($this->title)."',";
$sql .= " '".$this->db->escape($this->langs)."',";
$sql .= " '".$this->db->escape($this->perms)."',";
$sql .= " '".$this->db->escape($this->enabled)."',";
@@ -317,7 +317,7 @@ class Menubase
$this->position = (int) $this->position;
$this->url = trim($this->url);
$this->target = trim($this->target);
$this->titre = trim($this->titre);
$this->title = trim($this->title);
$this->langs = trim($this->langs);
$this->perms = trim($this->perms);
$this->enabled = trim($this->enabled);
@@ -339,7 +339,7 @@ class Menubase
$sql .= " position=".($this->position > 0 ? $this->position : 0).",";
$sql .= " url='".$this->db->escape($this->url)."',";
$sql .= " target='".$this->db->escape($this->target)."',";
$sql .= " titre='".$this->db->escape($this->titre)."',";
$sql .= " titre='".$this->db->escape($this->title)."',";
$sql .= " langs='".$this->db->escape($this->langs)."',";
$sql .= " perms='".$this->db->escape($this->perms)."',";
$sql .= " enabled='".$this->db->escape($this->enabled)."',";
@@ -383,7 +383,7 @@ class Menubase
$sql .= " t.position,";
$sql .= " t.url,";
$sql .= " t.target,";
$sql .= " t.titre,";
$sql .= " t.titre as title,";
$sql .= " t.langs,";
$sql .= " t.perms,";
$sql .= " t.enabled,";
@@ -414,7 +414,7 @@ class Menubase
$this->position = $obj->position;
$this->url = $obj->url;
$this->target = $obj->target;
$this->titre = $obj->titre;
$this->title = $obj->title;
$this->langs = $obj->langs;
$this->perms = $obj->perms;
$this->enabled = str_replace("\"", "'", $obj->enabled);
@@ -475,10 +475,8 @@ class Menubase
$this->position = '';
$this->url = 'http://dummy';
$this->target = '';
$this->titre = 'Specimen menu'; // deprecated
$this->title = 'Specimen menu';
$this->langs = '';
$this->level = '';
$this->leftmenu = '';
$this->perms = '';
$this->enabled = '';

View File

@@ -3011,7 +3011,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'accountancy', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes',
'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'email', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help',
@@ -3052,7 +3052,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = str_replace('object_', '', $pictowithouttext);
$arrayconvpictotofa = array(
'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book',
'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book',
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',

View File

@@ -1867,7 +1867,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$menu->type = $this->menu[$key]['type'];
$menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : '');
$menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : '';
$menu->titre = $this->menu[$key]['titre']; // deprecated
$menu->title = $this->menu[$key]['titre'];
$menu->url = $this->menu[$key]['url'];
$menu->langs = $this->menu[$key]['langs'];

View File

@@ -112,8 +112,7 @@ if (empty($reshook))
if (!$error)
{
$object->titre = GETPOST('nouveautitre', 'nohtml');
$object->commentaires = GETPOST('nouveauxcommentaires', 'restricthtml');
$object->title = GETPOST('nouveautitre', 'nohtml');
$object->description = GETPOST('nouveauxcommentaires', 'restricthtml');
$object->mail_admin = GETPOST('nouvelleadresse', 'alpha');
$object->date_fin = $expiredate;
@@ -189,7 +188,7 @@ if ($object->fk_user_creat)
$userstatic->fetch($object->fk_user_creat);
}
$title = $object->titre." - ".$langs->trans('Card');
$title = $object->title." - ".$langs->trans('Card');
$helpurl = '';
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
@@ -240,8 +239,8 @@ $adresseadmin = $object->mail_admin;
print $langs->trans("Title").'</td><td colspan="2">';
if ($action == 'edit')
{
print '<input type="text" name="nouveautitre" style="width: 95%" value="'.dol_escape_htmltag(dol_htmlentities($object->titre)).'">';
} else print dol_htmlentities($object->titre);
print '<input type="text" name="nouveautitre" style="width: 95%" value="'.dol_escape_htmltag(dol_htmlentities($object->title)).'">';
} else print dol_htmlentities($object->title);
print '</td></tr>';
// Description
@@ -402,7 +401,7 @@ if ($comments) {
print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))." <br>";
}
} else {
print $langs->trans("NoCommentYet").'<br>';
print '<span class="opacitymedium">'.$langs->trans("NoCommentYet").'</span><br>';
}
print '<br>';

View File

@@ -54,11 +54,6 @@ class Opensurveysondage extends CommonObject
* @var string ID survey
*/
public $id_sondage;
/**
* @deprecated
* @see $description
*/
public $commentaires;
/**
* @var string description
@@ -74,7 +69,11 @@ class Opensurveysondage extends CommonObject
*/
public $fk_user_creat;
public $titre;
/**
* @var string Title
*/
public $title;
public $date_fin = '';
public $status = 1;
public $format;
@@ -156,9 +155,9 @@ class Opensurveysondage extends CommonObject
$sql .= "sujet";
$sql .= ") VALUES (";
$sql .= "'".$this->db->escape($this->id_sondage)."',";
$sql .= " ".(empty($this->commentaires) ? 'NULL' : "'".$this->db->escape($this->commentaires)."'").",";
$sql .= " ".(empty($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").",";
$sql .= " ".$user->id.",";
$sql .= " '".$this->db->escape($this->titre)."',";
$sql .= " '".$this->db->escape($this->title)."',";
$sql .= " '".$this->db->idate($this->date_fin)."',";
$sql .= " ".$this->status.",";
$sql .= " '".$this->db->escape($this->format)."',";
@@ -215,11 +214,11 @@ class Opensurveysondage extends CommonObject
{
$sql = "SELECT";
$sql .= " t.id_sondage,";
$sql .= " t.titre as title,";
$sql .= " t.commentaires as description,";
$sql .= " t.mail_admin,";
$sql .= " t.nom_admin,";
$sql .= " t.fk_user_creat,";
$sql .= " t.titre,";
$sql .= " t.date_fin,";
$sql .= " t.status,";
$sql .= " t.format,";
@@ -242,11 +241,10 @@ class Opensurveysondage extends CommonObject
$this->id_sondage = $obj->id_sondage;
$this->ref = $this->id_sondage; //For compatibility
$this->commentaires = $obj->description; // deprecated
$this->description = $obj->description;
$this->mail_admin = $obj->mail_admin;
$this->nom_admin = $obj->nom_admin;
$this->titre = $obj->titre;
$this->title = $obj->title;
$this->date_fin = $this->db->jdate($obj->date_fin);
$this->status = $obj->status;
$this->format = $obj->format;
@@ -295,19 +293,17 @@ class Opensurveysondage extends CommonObject
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."opensurvey_sondage SET";
$sql .= " id_sondage=".(isset($this->id_sondage) ? "'".$this->db->escape($this->id_sondage)."'" : "null").",";
$sql .= " commentaires=".(isset($this->commentaires) ? "'".$this->db->escape($this->commentaires)."'" : "null").",";
$sql .= " commentaires=".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "null").",";
$sql .= " mail_admin=".(isset($this->mail_admin) ? "'".$this->db->escape($this->mail_admin)."'" : "null").",";
$sql .= " nom_admin=".(isset($this->nom_admin) ? "'".$this->db->escape($this->nom_admin)."'" : "null").",";
$sql .= " titre=".(isset($this->titre) ? "'".$this->db->escape($this->titre)."'" : "null").",";
$sql .= " titre=".(isset($this->title) ? "'".$this->db->escape($this->title)."'" : "null").",";
$sql .= " date_fin=".(dol_strlen($this->date_fin) != 0 ? "'".$this->db->idate($this->date_fin)."'" : 'null').",";
$sql .= " status=".(isset($this->status) ? "'".$this->db->escape($this->status)."'" : "null").",";
$sql .= " format=".(isset($this->format) ? "'".$this->db->escape($this->format)."'" : "null").",";
$sql .= " mailsonde=".(isset($this->mailsonde) ? $this->db->escape($this->mailsonde) : "null").",";
$sql .= " allow_comments=".$this->db->escape($this->allow_comments).",";
$sql .= " allow_spy=".$this->db->escape($this->allow_spy);
$sql .= " WHERE id_sondage='".$this->db->escape($this->id_sondage)."'";
$this->db->begin();
@@ -505,11 +501,10 @@ class Opensurveysondage extends CommonObject
$this->id = 0;
$this->id_sondage = '';
$this->commentaires = 'Comment of the specimen survey';
$this->description = 'Comment of the specimen survey';
$this->description = 'Description of the specimen survey';
$this->mail_admin = '';
$this->nom_admin = '';
$this->titre = 'This is a specimen survey';
$this->title = 'This is a specimen survey';
$this->date_fin = dol_now() + 3600 * 24 * 10;
$this->status = 1;
$this->format = 'classic';
@@ -593,11 +588,10 @@ class Opensurveysondage extends CommonObject
private function cleanParameters()
{
$this->id_sondage = trim($this->id_sondage);
$this->commentaires = trim($this->commentaires);
$this->description = trim($this->description);
$this->mail_admin = trim($this->mail_admin);
$this->nom_admin = trim($this->nom_admin);
$this->titre = trim($this->titre);
$this->title = trim($this->title);
$this->status = trim($this->status);
$this->format = trim($this->format);
$this->mailsonde = ($this->mailsonde ? 1 : 0);

View File

@@ -363,6 +363,7 @@ div.cadre td.non {
div.cadre td.vide {
background-color: #DDDDDD;
text-align:center;
padding: 4px;
}
/*Case de tableau contenant les noms dans affichage de sondage*/
div.cadre td.nom {
@@ -403,17 +404,6 @@ div.cadre td.mois {
padding:1px 5px;
}
/*affichage du calendrier*/
div.calendrier {
padding:10px;
background-color: #AAA;
width:490px;
font-size:12px;
font-family:arial, sans-serif;
margin-left: 30%;
margin-right: 30%;
position:static;
}
/*jour de la semaine dans calendrier*/
div.calendrier td.joursemaine {
width:65px;
@@ -432,19 +422,16 @@ div.calendrier td.jourwe {
background-color: #C0C0C0;
}
/*jour avant le premier jour du mois dans calendrier*/
div.calendrier td.avant {
div.calendrier td.avant, div.calendrier td.libre {
width:65px;
text-align: center;
border: 2px;
font-family:arial, sans-serif;
font-size:13px;
font-size: 1.1em;
background-color: #DDDDDD;
}
/*jour libre dans calendrier*/
div.calendrier td.libre {
width:65px;
text-align: center;
border: 2px;
background-color: #66FF99;
}
/*jour deja selectionné dans calendrier*/
@@ -458,7 +445,6 @@ div.calendrier td.choisi {
p.affichageresultats{
text-align: center;
font-family:arial, sans-serif;
font-size:13px;
}
div.comment{
@@ -485,13 +471,16 @@ div.titregestionadmin{
.bouton {
width: 65px;
/* width: 65px; */
border:0;
padding:0 0 0 0;
margin:0;
cursor:pointer;
font-family:arial, sans-serif;
font-size:13px;
background: transparent !important;
}
.choisi .bouton {
color: #fff;
}
/*les boutons pour choisir un jour non selectionné*/
.ON {

View File

@@ -238,11 +238,10 @@ function ajouter_sondage()
// Insert survey
$opensurveysondage = new Opensurveysondage($db);
$opensurveysondage->id_sondage = $sondage;
$opensurveysondage->commentaires = $_SESSION['commentaires'];
$opensurveysondage->description = $_SESSION['commentaires'];
$opensurveysondage->description = $_SESSION['description'];
$opensurveysondage->mail_admin = $_SESSION['adresse'];
$opensurveysondage->nom_admin = $_SESSION['nom'];
$opensurveysondage->titre = $_SESSION['titre'];
$opensurveysondage->title = $_SESSION['title'];
$opensurveysondage->date_fin = $_SESSION['champdatefin'];
$opensurveysondage->format = $_SESSION['formatsondage'];
$opensurveysondage->mailsonde = $_SESSION['mailsonde'];
@@ -256,10 +255,10 @@ function ajouter_sondage()
dol_print_error($db);
}
unset($_SESSION["titre"]);
unset($_SESSION["title"]);
unset($_SESSION["nom"]);
unset($_SESSION["adresse"]);
unset($_SESSION["commentaires"]);
unset($_SESSION["description"]);
unset($_SESSION["mailsonde"]);
unset($_SESSION['allow_comments']);
unset($_SESSION['allow_spy']);

View File

@@ -155,7 +155,7 @@ $help_url = '';
$title = $langs->trans('OpenSurveyArea');
$sql = "SELECT p.id_sondage as rowid, p.fk_user_creat, p.format, p.date_fin, p.status, p.titre, p.nom_admin,";
$sql = "SELECT p.id_sondage as rowid, p.fk_user_creat, p.format, p.date_fin, p.status, p.titre as title, p.nom_admin,";
$sql .= " u.login, u.firstname, u.lastname";
$sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat";
@@ -359,7 +359,7 @@ while ($i < min($num, $limit))
$opensurvey_static->id = $obj->rowid;
$opensurvey_static->ref = $obj->rowid;
$opensurvey_static->title = $obj->titre;
$opensurvey_static->title = $obj->title;
$opensurvey_static->status = $obj->status;
$opensurvey_static->date_fin = $db->jdate($obj->date_fin);
@@ -373,7 +373,7 @@ while ($i < min($num, $limit))
if (!$i) $totalarray['nbfield']++;
// Title
print '<td>'.dol_htmlentities($obj->titre).'</td>';
print '<td>'.dol_htmlentities($obj->title).'</td>';
if (!$i) $totalarray['nbfield']++;
// Type

View File

@@ -393,7 +393,7 @@ if ($result <= 0)
exit;
}
$title = $object->titre." - ".$langs->trans('Card');
$title = $object->title." - ".$langs->trans('Card');
$helpurl = '';
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
@@ -441,10 +441,11 @@ print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").'</td><
print '<tr><td>';
$adresseadmin = $object->mail_admin;
print $langs->trans("Title").'</td><td colspan="2">';
if ($action == 'edit')
{
print '<input type="text" name="nouveautitre" size="40" value="'.dol_escape_htmltag(dol_htmlentities($object->titre)).'">';
} else print dol_htmlentities($object->titre);
if ($action == 'edit') {
print '<input type="text" name="nouveautitre" size="40" value="'.dol_escape_htmltag(dol_htmlentities($object->title)).'">';
} else {
print dol_htmlentities($object->title);
}
print '</td></tr>';
// Expire date
@@ -954,7 +955,7 @@ if (empty($testligneamodifier))
}
// Affichage du bouton de formulaire pour inscrire un nouvel utilisateur dans la base
print '<td><input type="image" name="boutonp" value="'.$langs->trans("Vote").'" src="'.dol_buildpath('/opensurvey/img/add-24.png', 1).'"></td>'."\n";
print '<td><input type="image" name="boutonp" class="borderimp" value="'.$langs->trans("Vote").'" src="'.img_picto('', 'edit_add', '', false, 1).'"></td>'."\n";
print '</tr>'."\n";
}

View File

@@ -107,7 +107,7 @@ $arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss);
if (empty($_SESSION['titre']))
if (empty($_SESSION['title']))
{
dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection'));
llxFooter();

View File

@@ -195,7 +195,7 @@ if (GETPOST('reset'))
* View
*/
if (!isset($_SESSION['commentaires']) && !isset($_SESSION['mail']))
if (!isset($_SESSION['description']) && !isset($_SESSION['mail']))
{
dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection'));
exit;
@@ -347,7 +347,7 @@ print '</td></tr>'."\n";
print '</table>'."\n";
print '</div>'."\n";
print '<div class="center">'."\n";
print '<div class="center calendrier">'."\n";
print '<table align="center">'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table
print '<tr>'."\n";

View File

@@ -37,14 +37,14 @@ $langs->load("opensurvey");
// On teste toutes les variables pour supprimer l'ensemble des warnings PHP
// On transforme en entites html les données afin éviter les failles XSS
$post_var = array('titre', 'commentaires', 'mailsonde', 'creation_sondage_date', 'creation_sondage_autre');
$post_var = array('title', 'description', 'mailsonde', 'creation_sondage_date', 'creation_sondage_autre');
foreach ($post_var as $var)
{
$$var = GETPOST($var);
}
// On initialise egalement la session car sinon bonjour les warning :-)
$session_var = array('titre', 'commentaires', 'mailsonde');
$session_var = array('title', 'description', 'mailsonde');
foreach ($session_var as $var)
{
if (isset($_SESSION[$var])) $_SESSION[$var] = null;
@@ -57,8 +57,8 @@ $cochemail = '';
// Jump to correct page
if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
{
$_SESSION["titre"] = $titre;
$_SESSION["commentaires"] = $commentaires;
$_SESSION["title"] = $title;
$_SESSION["description"] = $description;
if (GETPOST('mailsonde') == 'on') {
$_SESSION["mailsonde"] = true;
@@ -101,7 +101,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("ExpireDate")), null, 'errors');
}
if ($titre && $testdate)
if ($title && $testdate)
{
if (!empty($creation_sondage_date))
{
@@ -141,15 +141,15 @@ dol_fiche_head();
// Affichage des différents champs textes a remplir
print '<table class="border centpercent">'."\n";
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("PollTitle").'</td><td><input type="text" name="titre" size="40" maxlength="80" value="'.$_SESSION["titre"].'"></td>'."\n";
if (!$_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre')))
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("PollTitle").'</td><td><input type="text" name="title" class="minwidth300" maxlength="80" value="'.$_SESSION["title"].'"></td>'."\n";
if (!$_SESSION["title"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre')))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors');
}
print '</tr>'."\n";
print '<tr><td>'.$langs->trans("Description").'</td><td>';
$doleditor = new DolEditor('commentaires', $_SESSION["commentaires"], '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
$doleditor = new DolEditor('description', $_SESSION["description"], '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
$doleditor->Create(0, '');
print '</td>'."\n";
print '</tr>'."\n";

View File

@@ -77,7 +77,7 @@ if (GETPOST('ajoutcomment', 'alpha'))
if (!$comment_user)
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors');
}
if (!in_array($comment_user, $listofvoters))
@@ -161,7 +161,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
$body = str_replace('\n', '<br>', $langs->transnoentities('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true)));
//var_dump($body);exit;
$cmailfile = new CMailFile("[".$application."] ".$langs->trans("Poll").': '.$object->titre, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body, null, null, null, '', '', 0, -1);
$cmailfile = new CMailFile("[".$application."] ".$langs->trans("Poll").': '.$object->title, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body, null, null, null, '', '', 0, -1);
$result = $cmailfile->sendfile();
}
}
@@ -242,7 +242,7 @@ $form = new Form($db);
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage);
llxHeaderSurvey($object->title, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage);
if (empty($object->ref)) // For survey, id is a hex string
{
@@ -272,14 +272,14 @@ print $langs->trans("OpenSurveyHowTo").'<br><br>';
print '<div class="corps"> '."\n";
//affichage du titre du sondage
$titre = str_replace("\\", "", $object->titre);
// show title of survey
$titre = str_replace("\\", "", $object->title);
print '<strong>'.dol_htmlentities($titre).'</strong><br><br>'."\n";
//affichage des commentaires du sondage
if ($object->commentaires)
// show description of survey
if ($object->description)
{
print dol_htmlentitiesbr($object->commentaires);
print dol_htmlentitiesbr($object->description);
print '<br>'."\n";
}
@@ -598,7 +598,7 @@ if ($ligneamodifier < 0 && (!isset($_SESSION['nom'])))
}
// Affichage du bouton de formulaire pour inscrire un nouvel utilisateur dans la base
print '<td><input type="image" name="boutonp" value="'.$langs->trans("Vote").'" src="'.dol_buildpath('/opensurvey/img/add-24.png', 1).'"></td>'."\n";
print '<td><input type="image" class="borderimp" name="boutonp" value="'.$langs->trans("Vote").'" src="'.img_picto('', 'edit_add', '', false, 1).'"></td>'."\n";
print '</tr>'."\n";
}
@@ -716,7 +716,7 @@ $comments = $object->getComments();
if ($comments)
{
print "<br><b>".$langs->trans("CommentsOfVoters").":</b><br>\n";
print '<br><u><span class="bold opacitymedium">'.$langs->trans("CommentsOfVoters").':</span></u><br>'."\n";
foreach ($comments as $obj) {
// ligne d'un usager pré-authentifié
@@ -731,7 +731,7 @@ if ($comments)
// Form to add comment
if ($object->allow_comments) {
print '<div class="addcomment">'.$langs->trans("AddACommentForPoll")."<br>\n";
print '<div class="addcomment"><span class="opacitymedium">'.$langs->trans("AddACommentForPoll")."</span><br>\n";
print '<textarea name="comment" rows="'.ROWS_2.'" class="quatrevingtpercent">'.dol_escape_htmltag(GETPOST('comment', 'none'), 0, 1).'</textarea><br>'."\n";
print $langs->trans("Name").': ';

View File

@@ -695,7 +695,9 @@ textarea.centpercent {
font-size: 0.85em;
opacity: 0.7;
}
.borderimp {
border: 1px solid #888 !important;
}
.text-warning{
color : <?php print $textWarning; ?>
}