Look and feel v6
This commit is contained in:
parent
80ce8da7a3
commit
cea98ce5cb
@ -40,6 +40,8 @@ ALTER TABLE llx_opensurvey_sondage ADD COLUMN fk_user_creat integer NOT NULL DEF
|
|||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
|
||||||
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_spy tinyint NOT NULL DEFAULT 1 AFTER allow_comments;
|
||||||
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN sujet TEXT;
|
||||||
|
|
||||||
|
|
||||||
create table llx_notify_def_object
|
create table llx_notify_def_object
|
||||||
|
|||||||
@ -212,22 +212,23 @@ print '<input type="hidden" name="action" value="update">';
|
|||||||
$head = opensurvey_prepare_head($object);
|
$head = opensurvey_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head,'general',$langs->trans("Survey"),0,dol_buildpath('/opensurvey/img/object_opensurvey.png',1),1);
|
dol_fiche_head($head,'general',$langs->trans("Survey"), -1, DOL_URL_ROOT.'/opensurvey/img/object_opensurvey.png', 1);
|
||||||
|
|
||||||
|
$morehtmlref = '';
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).'">'.$langs->trans("BackToList").'</a>';
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
$type=($object->format=="A")?'classic':'date';
|
$type=($object->format=="A")?'classic':'date';
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="2">';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="2">';
|
||||||
print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1);
|
print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1);
|
||||||
print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate").'</td></tr>';
|
print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate").'</td></tr>';
|
||||||
|
|
||||||
@ -242,12 +243,6 @@ if ($action == 'edit')
|
|||||||
else print dol_htmlentities($object->titre);
|
else print dol_htmlentities($object->titre);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
print '<tr><td>';
|
|
||||||
print $langs->trans("Status") .'</td><td colspan="2">';
|
|
||||||
print $object->getLibStatut(4);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description") .'</td><td colspan="2">';
|
print '<tr><td class="tdtop">'.$langs->trans("Description") .'</td><td colspan="2">';
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
@ -345,6 +340,8 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
|
|||||||
@ -34,19 +34,20 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
|||||||
*/
|
*/
|
||||||
class Opensurveysondage extends CommonObject
|
class Opensurveysondage extends CommonObject
|
||||||
{
|
{
|
||||||
var $element='opensurvey_sondage'; //!< Id that identify managed objects
|
public $element='opensurvey_sondage'; //!< Id that identify managed objects
|
||||||
var $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored
|
public $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored
|
||||||
|
public $picto = 'opensurvey';
|
||||||
|
|
||||||
var $id_sondage;
|
public $id_sondage;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see description
|
* @see description
|
||||||
*/
|
*/
|
||||||
var $commentaires;
|
public $commentaires;
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
var $mail_admin;
|
public $mail_admin;
|
||||||
var $nom_admin;
|
public $nom_admin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of user author of the poll
|
* Id of user author of the poll
|
||||||
@ -54,11 +55,11 @@ class Opensurveysondage extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_user_creat;
|
public $fk_user_creat;
|
||||||
|
|
||||||
var $titre;
|
public $titre;
|
||||||
var $date_fin='';
|
public $date_fin='';
|
||||||
var $status=1;
|
public $status=1;
|
||||||
var $format;
|
public $format;
|
||||||
var $mailsonde;
|
public $mailsonde;
|
||||||
|
|
||||||
public $sujet;
|
public $sujet;
|
||||||
|
|
||||||
|
|||||||
@ -426,23 +426,23 @@ print '<form name="formulaire4" action="#" method="POST">'."\n";
|
|||||||
|
|
||||||
$head = opensurvey_prepare_head($object);
|
$head = opensurvey_prepare_head($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head,'preview',$langs->trans("Survey"),0,dol_buildpath('/opensurvey/img/object_opensurvey.png',1),1);
|
dol_fiche_head($head,'preview',$langs->trans("Survey"), -1, DOL_URL_ROOT.'/opensurvey/img/object_opensurvey.png', 1);
|
||||||
|
|
||||||
|
$morehtmlref = '';
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/opensurvey/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans('Ref').'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
$type=($object->format=="A")?'classic':'date';
|
$type=($object->format=="A")?'classic':'date';
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="2">';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="2">';
|
||||||
print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1);
|
print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1);
|
||||||
print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate").'</td></tr>';
|
print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate").'</td></tr>';
|
||||||
|
|
||||||
@ -499,6 +499,8 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
@ -1045,7 +1047,7 @@ print '</table>'."\n";
|
|||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|
||||||
|
|
||||||
$toutsujet = explode(",", $object->sujet);
|
$toutsujet = explode(",", $object->sujet); // With old versions, this field was not set
|
||||||
|
|
||||||
$compteursujet = 0;
|
$compteursujet = 0;
|
||||||
$meilleursujet = '';
|
$meilleursujet = '';
|
||||||
@ -1056,7 +1058,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
|
|||||||
if ($object->format == "D") {
|
if ($object->format == "D") {
|
||||||
$meilleursujetexport = $toutsujet[$i];
|
$meilleursujetexport = $toutsujet[$i];
|
||||||
|
|
||||||
if (strpos($toutsujet[$i], '@') !== false) {
|
if (strpos($toutsujet[$i], '@') !== false) {
|
||||||
$toutsujetdate = explode("@", $toutsujet[$i]);
|
$toutsujetdate = explode("@", $toutsujet[$i]);
|
||||||
$meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . ' - ' . $toutsujetdate[1];
|
$meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . ' - ' . $toutsujetdate[1];
|
||||||
} else {
|
} else {
|
||||||
@ -1072,8 +1074,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
|
|||||||
$compteursujet++;
|
$compteursujet++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$meilleursujet = substr($meilleursujet, 1);
|
||||||
$meilleursujet = substr("$meilleursujet", 1);
|
|
||||||
$meilleursujet = str_replace("°", "'", $meilleursujet);
|
$meilleursujet = str_replace("°", "'", $meilleursujet);
|
||||||
|
|
||||||
// Show best choice
|
// Show best choice
|
||||||
@ -1083,9 +1084,9 @@ if ($nbofcheckbox >= 2)
|
|||||||
print '<p class="affichageresultats">'."\n";
|
print '<p class="affichageresultats">'."\n";
|
||||||
|
|
||||||
if (isset($meilleurecolonne) && $compteursujet == "1") {
|
if (isset($meilleurecolonne) && $compteursujet == "1") {
|
||||||
print "<img src=\"".dol_buildpath('/opensurvey/img/medaille.png',1)."\"> " . $langs->trans('TheBestChoice') . ": <b>".$meilleursujet." </b>" . $langs->trans("with") . " <b>$meilleurecolonne </b>" . $vote_str . ".\n";
|
print "<img src=\"".DOL_URL_ROOT.'/opensurvey/img/medaille.png'."\"> " . $langs->trans('TheBestChoice') . ": <b>".$meilleursujet." </b>" . $langs->trans("with") . " <b>".$meilleurecolonne."</b>" . $vote_str . ".\n";
|
||||||
} elseif (isset($meilleurecolonne)) {
|
} elseif (isset($meilleurecolonne)) {
|
||||||
print "<img src=\"".dol_buildpath('/opensurvey/img/medaille.png',1)."\"> " . $langs->trans('TheBestChoices') . ": <b>".$meilleursujet." </b>" . $langs->trans("with") . " <b>$meilleurecolonne </b>" . $vote_str . ".\n";
|
print "<img src=\"".DOL_URL_ROOT.'/opensurvey/img/medaille.png'."\"> " . $langs->trans('TheBestChoices') . ": <b>".$meilleursujet." </b>" . $langs->trans("with") . " <b>".$meilleurecolonne."</b>" . $vote_str . ".\n";
|
||||||
}
|
}
|
||||||
print '<br></p><br>'."\n";
|
print '<br></p><br>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user