Skip to content

Commit

Permalink
Merge branch 'opensurvey-improvements' of
Browse files Browse the repository at this point in the history
https://github.com/marcosgdf/dolibarr into
marcosgdf-opensurvey-improvements

Conflicts:
	ChangeLog
  • Loading branch information
eldy committed Jan 12, 2014
2 parents 02989b9 + 2313ea0 commit 06aa3b8
Show file tree
Hide file tree
Showing 91 changed files with 1,208 additions and 1,646 deletions.
3 changes: 3 additions & 0 deletions COPYRIGHT
Expand Up @@ -50,6 +50,9 @@ http://www.fsf.org/licensing/licenses/index_html
Copyright
---------

Copyright (C) 2014
- Marcos García <marcosgdf@gmail.com>

Copyright (C) 2013
- Christophe Battarel <christophe.battarel@altairis.fr>
- Laurent Destailleur <eldy@users.sourceforge.net>
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -12,6 +12,8 @@ For users:
- New: Add option MAIN_AUTO_TIMESTAMP_IN_NOTES to automatically add timestamp
and user line into editionf field when editing a note.
- New: Add button cancel into edition of notes.
- New: Improved Opensurvey module and added options to disable comments and disable
public votes

For translators:
- Update language files.
Expand All @@ -20,6 +22,7 @@ For developers:
- New: Add path file of trigger into admin trigger list page.
- New: More phpunit tests.
- New: Payments and supplier payment pages tabs can now be extended from modules.
<<<<<<< HEAD
- New: Add option 'aZ' into GETPOST function to check parameters contains
only a to z or A to Z characters.

Expand All @@ -29,6 +32,10 @@ Dolibarr better:
- The deprecated way (with 4 parameters) to declare a new tab into a module descriptor file has been
removed. You must now use the 6 parameters way. See file modMyModule.class.php for example.

=======
- New: Opensurvey polls tab cards can now be extended from external modules.
- New: Triggers OPENSURVEY_CREATE, OPENSURVEY_DELETE
>>>>>>> 2313ea01dda16f3dc73c718bee2bf1c38291fa49

***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
Expand Down
1 change: 1 addition & 0 deletions dev/skeletons/modMyModule.class.php
Expand Up @@ -134,6 +134,7 @@ function __construct($db)
// 'payment' to add a tab in payment view
// 'payment_supplier' to add a tab in supplier payment view
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
// 'opensurveypoll' to add a tab in opensurvey poll view
$this->tabs = array();

// Dictionnaries
Expand Down
18 changes: 7 additions & 11 deletions htdocs/core/modules/modOpenSurvey.class.php
@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -74,9 +75,6 @@ function __construct($db)
//$this->dirs[0] = DOL_DATA_ROOT.'/mymodule;
//$this->dirs[1] = DOL_DATA_ROOT.'/mymodule/temp;

// Config pages. Put here list of php page names stored in admin directory used to setup module
$this->config_page_url = array("index.php@opensurvey");

// Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
Expand Down Expand Up @@ -110,8 +108,7 @@ function __construct($db)
$this->rights[$r][1] = 'Read surveys'; // Permission label
$this->rights[$r][2] = 'r'; // Permission by default for new user (0/1)
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;

// Add here list of permission defined by an id, a label, a boolean and two constant strings.
Expand All @@ -120,8 +117,7 @@ function __construct($db)
$this->rights[$r][1] = 'Create/modify surveys'; // Permission label
$this->rights[$r][2] = 'w'; // Permission by default for new user (0/1)
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;


Expand All @@ -137,7 +133,7 @@ function __construct($db)
'langs'=>'opensurvey',
'position'=>200,
'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->opensurvey->survey->read',
'perms'=>'$user->rights->opensurvey->read',
'target'=>'',
'user'=>0);
$r++;
Expand All @@ -161,12 +157,12 @@ function __construct($db)
'titre'=>'NewSurvey',
'mainmenu'=>'opensurvey',
'leftmenu'=>'opensurvey_new',
'url'=>'/opensurvey/public/index.php?origin=dolibarr',
'url'=>'/opensurvey/wizard/index.php',
'langs'=>'opensurvey',
'position'=>210,
'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled.
'perms'=>'',
'target'=>'_blank',
'perms'=>'$user->rights->opensurvey->write',
'target'=>'',
'user'=>0);
$r++;

Expand Down
12 changes: 12 additions & 0 deletions htdocs/install/mysql/migration/3.5.0-3.6.0.sql
Expand Up @@ -18,3 +18,15 @@
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);

ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT 1 AFTER canedit ;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible ;
ALTER TABLE llx_opensurvey_sondage DROP INDEX idx_id_sondage_admin ;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN id_sondage_admin ;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN canedit ;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_spy TINYINT( 1 ) UNSIGNED NOT NULL AFTER allow_comments ;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN origin ;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN fk_user_creat INT( 11 ) UNSIGNED NOT NULL AFTER nom_admin ;
ALTER TABLE llx_opensurvey_sondage CHANGE COLUMN mailsonde mailsonde TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE llx_opensurvey_sondage CHANGE COLUMN titre titre TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE llx_opensurvey_sondage CHANGE COLUMN date_fin date_fin DATETIME NOT NULL;
ALTER TABLE llx_opensurvey_sondage CHANGE COLUMN format format VARCHAR( 2 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
1 change: 0 additions & 1 deletion htdocs/install/mysql/tables/llx_opensurvey_sondage.key.sql
Expand Up @@ -15,5 +15,4 @@
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- ============================================================================

ALTER TABLE llx_opensurvey_sondage ADD INDEX idx_id_sondage_admin (id_sondage_admin);
ALTER TABLE llx_opensurvey_sondage ADD INDEX idx_date_fin (date_fin);
17 changes: 8 additions & 9 deletions htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
Expand Up @@ -17,17 +17,16 @@

CREATE TABLE llx_opensurvey_sondage (
id_sondage VARCHAR(16) PRIMARY KEY,
id_sondage_admin VARCHAR(24),
commentaires text,
mail_admin VARCHAR(128),
nom_admin VARCHAR(64),
titre TEXT,
date_fin DATETIME,
format VARCHAR(2),
mailsonde varchar(2) DEFAULT '0',
survey_link_visible integer DEFAULT 1,
canedit integer DEFAULT 0,
origin VARCHAR(64),
fk_user_creat INT(11) UNSIGNED NOT NULL,
titre TEXT NOT NULL,
date_fin DATETIME NOT NULL,
format VARCHAR(2) NOT NULL,
mailsonde TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',
allow_comments TINYINT(1) unsigned NOT NULL DEFAULT 1,
allow_spy TINYINT(1) unsigned NOT NULL DEFAULT 1,
tms TIMESTAMP,
sujet TEXT
) ENGINE=InnoDB;
) ENGINE=InnoDB;
7 changes: 0 additions & 7 deletions htdocs/langs/ar_SA/opensurvey.lang
Expand Up @@ -11,14 +11,10 @@
# PollTitle=Poll title
# OpenSurveyYourName=Your name
# OpenSurveyYourEMail=Your email address
# VotersCanModify=Voters can modify vote of others
# ToReceiveEMailForEachVote=To receive an email for each vote
# TypeDate=Type date
# TypeClassic=Type standard
# YouAreInPollCreateArea=You are in the poll creation section
# FieldMandatory=Field mandatory
# OpenSurveyDesc=Online service to plan a rendez-vous or do a survey quickly and easily.
# OpenSurveyNoRegistration=No registration required.
# OpenSurveyStep2=Select your dates amoung the free days (green). The selected days are in blue. You can unselect a day previously selected by clicking again on it
# RemoveAllDays=Remove all days
# CopyHoursOfFirstDay=Copy hours of first day
Expand All @@ -43,7 +39,6 @@
# PourContreList=List (empty/for/against)
# AddNewColumn=Add new column
# TitleChoice=Choice label
# InfoAfterCreate=Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.<br>You should also receive an email with link to your poll for sending it to the voters.
# ExportSpreadsheet=Export result spreadsheet
ExpireDate=الحد من التاريخ
# NbOfVoters=Nb of voters
Expand All @@ -57,7 +52,6 @@ ExpireDate=الحد من التاريخ
# ErrorPollDoesNotExists=Error, poll <strong>%s</strong> does not exists.
# OpenSurveyNothingToSetup=There is no specific setup to do.
# PollWillExpire=Your poll will expire automatically <strong>%s</strong> days after the last date of your poll.
# RemovalDate=Removal date
# AddADate=Add a date
# AddStartHour=Add start hour
# AddEndHour=Add end hour
Expand All @@ -66,4 +60,3 @@ ExpireDate=الحد من التاريخ
# CanEditVotes=Can change vote of others
# SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format :<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
# BackToCurrentMonth=Back to current month
# PublicLinkToCreateSurvey=Public link to allow everybody to create a survey
7 changes: 0 additions & 7 deletions htdocs/langs/bg_BG/opensurvey.lang
Expand Up @@ -11,14 +11,10 @@
# PollTitle=Poll title
# OpenSurveyYourName=Your name
# OpenSurveyYourEMail=Your email address
# VotersCanModify=Voters can modify vote of others
# ToReceiveEMailForEachVote=To receive an email for each vote
# TypeDate=Type date
# TypeClassic=Type standard
# YouAreInPollCreateArea=You are in the poll creation section
# FieldMandatory=Field mandatory
# OpenSurveyDesc=Online service to plan a rendez-vous or do a survey quickly and easily.
# OpenSurveyNoRegistration=No registration required.
# OpenSurveyStep2=Select your dates amoung the free days (green). The selected days are in blue. You can unselect a day previously selected by clicking again on it
# RemoveAllDays=Remove all days
# CopyHoursOfFirstDay=Copy hours of first day
Expand All @@ -43,7 +39,6 @@
# PourContreList=List (empty/for/against)
# AddNewColumn=Add new column
# TitleChoice=Choice label
# InfoAfterCreate=Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.<br>You should also receive an email with link to your poll for sending it to the voters.
# ExportSpreadsheet=Export result spreadsheet
ExpireDate=Крайната дата
# NbOfVoters=Nb of voters
Expand All @@ -57,7 +52,6 @@ ExpireDate=Крайната дата
# ErrorPollDoesNotExists=Error, poll <strong>%s</strong> does not exists.
# OpenSurveyNothingToSetup=There is no specific setup to do.
# PollWillExpire=Your poll will expire automatically <strong>%s</strong> days after the last date of your poll.
# RemovalDate=Removal date
# AddADate=Add a date
# AddStartHour=Add start hour
# AddEndHour=Add end hour
Expand All @@ -66,4 +60,3 @@ ExpireDate=Крайната дата
# CanEditVotes=Can change vote of others
# SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format :<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
# BackToCurrentMonth=Back to current month
# PublicLinkToCreateSurvey=Public link to allow everybody to create a survey
7 changes: 0 additions & 7 deletions htdocs/langs/ca_ES/opensurvey.lang
Expand Up @@ -11,14 +11,10 @@ CreatePoll=Crear enquesta
PollTitle=Títol de l'enquesta
OpenSurveyYourName=El seu nom
OpenSurveyYourEMail=La seva adreça de correu electrònic
VotersCanModify=Els votants poden modificar el vot d'altres
ToReceiveEMailForEachVote=Per rebre un email per cada vot
TypeDate=Tipus de data
TypeClassic=Tipus estándar
YouAreInPollCreateArea=Està a la secció de creació d'enquestes
FieldMandatory=Camp obligatori
OpenSurveyDesc=Servei online per planificar una cita o elaborar una enquesta de forma fàcil i ràpida
OpenSurveyNoRegistration=SSense registre requerit.
OpenSurveyStep2=Seleccioneu les dates entre els dies lliures (verds). Els dies seleccionats són de color blau. Pot seleccionar un dia prèviament seleccionat fent clic de nou en ell
RemoveAllDays=Eliminar tots els dies
CopyHoursOfFirstDay=Copia hores del primer dia
Expand All @@ -43,7 +39,6 @@ YesNoList=Llista (buit/sí/no)
PourContreList=Llista (buit/a favor/en contra)
AddNewColumn=Afegir nova columna
TitleChoice=Títol de l'opció
InfoAfterCreate=Un cop hagi confirmat la creació de la seva enquesta, passareu automàticament a la pàgina de la seva enquesta.<br>També rebrà un email amb un enllaç a la seva enquesta per enviar als votants.
ExportSpreadsheet=Exportar resultats a un full de càlcul
ExpireDate=Data límit
NbOfVoters=Núm. de votants
Expand All @@ -57,7 +52,6 @@ VoteNameAlreadyExists=Aquest nom ja havia estat usat per a aquesta enquesta
ErrorPollDoesNotExists=Error, l'enquesta <strong>%s</strong> no existeix.
OpenSurveyNothingToSetup=No hi ha una configuració específica que fer.
PollWillExpire=La seva enquesta expirarà automàticament <strong>%s</strong> dies després de l'última data de la seva enquesta.
RemovalDate=Data d'eliminació
AddADate=Afegir una data
AddStartHour=Afegir hora d'inici
AddEndHour=Afegir hora de fi
Expand All @@ -66,4 +60,3 @@ NoCommentYet=Cap comentari ha estat publicat per a aquesta enquesta
CanEditVotes=Podeu canviar el vot d'altres
SelectDayDesc=Per a cada dia seleccionat, pot triar, o no, les hores de reunió en el següent format:<br>- buit,<br>- "8h", "8H" o "8:00" per proporcionar una hora d'inici de la reunió,<br>- "8-11", "8h-11h", "8H-11H" o "8:00-11:00" per proporcionar una hora d'inici i de fi de la reunió,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" per el mateix però amb minuts.
BackToCurrentMonth=Tornar al mes actual
PublicLinkToCreateSurvey=Enllaç públic que permet a qualsevol crear una enquesta
7 changes: 0 additions & 7 deletions htdocs/langs/cs_CZ/opensurvey.lang
Expand Up @@ -11,14 +11,10 @@ CreatePoll=Vytvoření ankety
PollTitle=Anketa titul
OpenSurveyYourName=Vaše jméno
OpenSurveyYourEMail=Vaše e-mailová adresa
VotersCanModify=Voliči mohou změnit hlas ostatních
ToReceiveEMailForEachVote=Chcete-li obdržet e-mail pro každé hlasování
TypeDate=Zadejte datum
TypeClassic=Typ standardní
YouAreInPollCreateArea=Nacházíte se v sekci pro vytvoření hlasování
FieldMandatory=Pole povinné
OpenSurveyDesc=Online služby naplánovat rendez-vous nebo udělat průzkum snadno a rychle.
OpenSurveyNoRegistration=Ne nutná registrace.
OpenSurveyStep2=Zvolte termín Vašeho amoung volné dny (zelená). Vybrané dny jsou v modré barvě. Můžete zrušit výběr den předem zvolenou opětovným kliknutím na něj
RemoveAllDays=Odstraňte všechny dny
CopyHoursOfFirstDay=Kopírování hodin prvního dne
Expand All @@ -43,7 +39,6 @@ YesNoList=List (prázdný / ano / ne)
PourContreList=List (prázdný / pro / proti)
AddNewColumn=Přidat nový sloupec
TitleChoice=Volba štítek
InfoAfterCreate=Poté, co jste potvrdili vytvoření vašeho hlasování, budete automaticky přesměrováni na stránku vašeho hlasování. <br> Také byste měli obdržet e-mail s odkazem na vaše hlasování pro odeslání do voličů.
ExportSpreadsheet=Export výsledků tabulku
ExpireDate=Omezit datum
NbOfVoters=Nb voličů
Expand All @@ -57,7 +52,6 @@ VoteNameAlreadyExists=Tento název již byl použit při tomto hlasování
ErrorPollDoesNotExists=Chyba hlasování <strong>%s</strong> neexistuje.
OpenSurveyNothingToSetup=Neexistuje žádné specifické nastavení dělat.
PollWillExpire=Váš průzkum skončí automaticky <strong>%s</strong> dní po posledním dni svého hlasování.
RemovalDate=Odstranění data
AddADate=Přidat datum
AddStartHour=Přidat začít hodinu
AddEndHour=Přidat end hodinu
Expand All @@ -66,4 +60,3 @@ NoCommentYet=Žádné komentáře byly zveřejněny na tuto anketu ještě
CanEditVotes=Může změnit hlas ostatních
SelectDayDesc=Pro každý vybraný den, můžete si vybrat, zda se mají splnit hodin v následujícím formátu: <br> - Prázdné, <br> - &quot;8h&quot;, &quot;8H&quot; nebo &quot;8:00&quot; dát schůzku v úvodní hodinu, <br> - &quot;8-11&quot;, &quot;8h-11h&quot;, &quot;8H-11H&quot; nebo &quot;08:00-11:00&quot; dát schůzku je začátek a konec hodiny, <br> - &quot;8h15-11h15&quot;, &quot;8H15-11h15&quot; nebo &quot;08:15-11:15&quot; to samé, ale v minutách.
BackToCurrentMonth=Zpět na aktuální měsíc
PublicLinkToCreateSurvey=Veřejné odkaz dovolit každý vytvořit průzkum
7 changes: 0 additions & 7 deletions htdocs/langs/da_DK/opensurvey.lang
Expand Up @@ -11,14 +11,10 @@
# PollTitle=Poll title
# OpenSurveyYourName=Your name
# OpenSurveyYourEMail=Your email address
# VotersCanModify=Voters can modify vote of others
# ToReceiveEMailForEachVote=To receive an email for each vote
# TypeDate=Type date
# TypeClassic=Type standard
# YouAreInPollCreateArea=You are in the poll creation section
# FieldMandatory=Field mandatory
# OpenSurveyDesc=Online service to plan a rendez-vous or do a survey quickly and easily.
# OpenSurveyNoRegistration=No registration required.
# OpenSurveyStep2=Select your dates amoung the free days (green). The selected days are in blue. You can unselect a day previously selected by clicking again on it
# RemoveAllDays=Remove all days
# CopyHoursOfFirstDay=Copy hours of first day
Expand All @@ -43,7 +39,6 @@
# PourContreList=List (empty/for/against)
# AddNewColumn=Add new column
# TitleChoice=Choice label
# InfoAfterCreate=Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.<br>You should also receive an email with link to your poll for sending it to the voters.
# ExportSpreadsheet=Export result spreadsheet
ExpireDate=Limit dato
# NbOfVoters=Nb of voters
Expand All @@ -57,7 +52,6 @@ ExpireDate=Limit dato
# ErrorPollDoesNotExists=Error, poll <strong>%s</strong> does not exists.
# OpenSurveyNothingToSetup=There is no specific setup to do.
# PollWillExpire=Your poll will expire automatically <strong>%s</strong> days after the last date of your poll.
# RemovalDate=Removal date
# AddADate=Add a date
# AddStartHour=Add start hour
# AddEndHour=Add end hour
Expand All @@ -66,4 +60,3 @@ ExpireDate=Limit dato
# CanEditVotes=Can change vote of others
# SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format :<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
# BackToCurrentMonth=Back to current month
# PublicLinkToCreateSurvey=Public link to allow everybody to create a survey

0 comments on commit 06aa3b8

Please sign in to comment.