diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index a21c340b556..6c71f279867 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -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 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_spy tinyint NOT NULL DEFAULT 1 AFTER allow_comments; +ALTER TABLE llx_opensurvey_sondage ADD COLUMN sujet TEXT; create table llx_notify_def_object diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index d7a466a5217..707af9f7115 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -212,22 +212,23 @@ print ''; $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 = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref); + + +print '
'; +print '
'; print ''; -$linkback = ''.$langs->trans("BackToList").''; - -// Ref -print ''; -print ''; -print ''; - // Type $type=($object->format=="A")?'classic':'date'; -print ''; @@ -242,12 +243,6 @@ if ($action == 'edit') else print dol_htmlentities($object->titre); print ''; -// Status -print ''; - // Description print ''; print '
'.$langs->trans('Ref').''; -print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage'); -print '
'.$langs->trans("Type").''; +print '
'.$langs->trans("Type").''; 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").'
'; -print $langs->trans("Status") .''; -print $object->getLibStatut(4); -print '
'.$langs->trans("Description") .''; if ($action == 'edit') @@ -345,6 +340,8 @@ print '
'; +print '
'; + dol_fiche_end(); if ($action == 'edit') diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 5ad27731d88..95af2b130d5 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -34,19 +34,20 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Opensurveysondage extends CommonObject { - var $element='opensurvey_sondage'; //!< Id that identify managed objects - var $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored - - var $id_sondage; + public $element='opensurvey_sondage'; //!< Id that identify managed objects + public $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored + public $picto = 'opensurvey'; + + public $id_sondage; /** * @deprecated * @see description */ - var $commentaires; + public $commentaires; public $description; - var $mail_admin; - var $nom_admin; + public $mail_admin; + public $nom_admin; /** * Id of user author of the poll @@ -54,11 +55,11 @@ class Opensurveysondage extends CommonObject */ public $fk_user_creat; - var $titre; - var $date_fin=''; - var $status=1; - var $format; - var $mailsonde; + public $titre; + public $date_fin=''; + public $status=1; + public $format; + public $mailsonde; public $sujet; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index f10e21effe1..9bfb15b2c24 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -426,23 +426,23 @@ print '
'."\n"; $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 = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtmlref); + + +print '
'; +print '
'; print ''; -$linkback = ''.$langs->trans("BackToList").''; - -// Ref -print ''; -print ''; -print ''; - // Type $type=($object->format=="A")?'classic':'date'; -print ''; @@ -499,6 +499,8 @@ print ''; print '
'.$langs->trans('Ref').''; -print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage'); -print '
'.$langs->trans("Type").''; +print '
'.$langs->trans("Type").''; 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").'
'; +print '
'; + dol_fiche_end(); print '
'."\n"; @@ -1045,7 +1047,7 @@ print ''."\n"; print ''."\n"; -$toutsujet = explode(",", $object->sujet); +$toutsujet = explode(",", $object->sujet); // With old versions, this field was not set $compteursujet = 0; $meilleursujet = ''; @@ -1056,7 +1058,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { if ($object->format == "D") { $meilleursujetexport = $toutsujet[$i]; - if (strpos($toutsujet[$i], '@') !== false) { + if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . ' - ' . $toutsujetdate[1]; } else { @@ -1072,8 +1074,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { $compteursujet++; } } - -$meilleursujet = substr("$meilleursujet", 1); +$meilleursujet = substr($meilleursujet, 1); $meilleursujet = str_replace("°", "'", $meilleursujet); // Show best choice @@ -1083,9 +1084,9 @@ if ($nbofcheckbox >= 2) print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; } elseif (isset($meilleurecolonne)) { - print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; } print '


'."\n"; }