From cb37f5e068f1a4bc832203f17b902db1e409d15d Mon Sep 17 00:00:00 2001 From: Jiri Pavlicek Date: Sat, 3 Nov 2012 20:24:11 +0100 Subject: [PATCH 1/9] cs localisation 0.9 --- .../polls/lexicon/cs/default.inc.php | 74 +++++++++++++++++++ .../polls/lexicon/cs/latestpoll.inc.php | 19 +++++ .../polls/lexicon/cs/previouspolls.inc.php | 17 +++++ .../polls/lexicon/cs/tvrenders.inc.php | 16 ++++ 4 files changed, 126 insertions(+) create mode 100644 core/components/polls/lexicon/cs/default.inc.php create mode 100644 core/components/polls/lexicon/cs/latestpoll.inc.php create mode 100644 core/components/polls/lexicon/cs/previouspolls.inc.php create mode 100644 core/components/polls/lexicon/cs/tvrenders.inc.php diff --git a/core/components/polls/lexicon/cs/default.inc.php b/core/components/polls/lexicon/cs/default.inc.php new file mode 100644 index 0000000..70d5f63 --- /dev/null +++ b/core/components/polls/lexicon/cs/default.inc.php @@ -0,0 +1,74 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/cs/latestpoll.inc.php b/core/components/polls/lexicon/cs/latestpoll.inc.php new file mode 100644 index 0000000..8ee675c --- /dev/null +++ b/core/components/polls/lexicon/cs/latestpoll.inc.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/cs/previouspolls.inc.php b/core/components/polls/lexicon/cs/previouspolls.inc.php new file mode 100644 index 0000000..fddc419 --- /dev/null +++ b/core/components/polls/lexicon/cs/previouspolls.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/cs/tvrenders.inc.php b/core/components/polls/lexicon/cs/tvrenders.inc.php new file mode 100644 index 0000000..64ceda0 --- /dev/null +++ b/core/components/polls/lexicon/cs/tvrenders.inc.php @@ -0,0 +1,16 @@ + \ No newline at end of file From 43b8a260e7a49fd1ebd8b866046def394874c554 Mon Sep 17 00:00:00 2001 From: Jiri Pavlicek Date: Sun, 6 Jan 2013 17:19:46 +0100 Subject: [PATCH 2/9] utf8 BOM repair --- core/components/polls/lexicon/cs/default.inc.php | 2 +- core/components/polls/lexicon/cs/latestpoll.inc.php | 2 +- core/components/polls/lexicon/cs/previouspolls.inc.php | 2 +- core/components/polls/lexicon/cs/tvrenders.inc.php | 2 +- core/components/polls/lexicon/de/default.inc.php | 2 +- core/components/polls/lexicon/de/latestpoll.inc.php | 2 +- core/components/polls/lexicon/de/previouspolls.inc.php | 2 +- core/components/polls/lexicon/en/default.inc.php | 2 +- core/components/polls/lexicon/en/latestpoll.inc.php | 2 +- core/components/polls/lexicon/en/previouspolls.inc.php | 2 +- core/components/polls/lexicon/en/tvrenders.inc.php | 2 +- core/components/polls/lexicon/nl/default.inc.php | 2 +- core/components/polls/lexicon/nl/latestpoll.inc.php | 2 +- core/components/polls/lexicon/nl/previouspolls.inc.php | 2 +- core/components/polls/lexicon/ru/default.inc.php | 2 +- core/components/polls/lexicon/ru/latestpoll.inc.php | 2 +- core/components/polls/lexicon/ru/previouspolls.inc.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/components/polls/lexicon/cs/default.inc.php b/core/components/polls/lexicon/cs/default.inc.php index 70d5f63..b9f4490 100644 --- a/core/components/polls/lexicon/cs/default.inc.php +++ b/core/components/polls/lexicon/cs/default.inc.php @@ -1,4 +1,4 @@ - Date: Wed, 16 Jul 2014 17:55:32 +0200 Subject: [PATCH 3/9] Add fr lexicon --- .../polls/lexicon/fr/default.inc.php | 74 +++++++++++++++++++ .../polls/lexicon/fr/latestpoll.inc.php | 19 +++++ .../polls/lexicon/fr/previouspolls.inc.php | 17 +++++ .../polls/lexicon/fr/tvrenders.inc.php | 16 ++++ 4 files changed, 126 insertions(+) create mode 100644 core/components/polls/lexicon/fr/default.inc.php create mode 100644 core/components/polls/lexicon/fr/latestpoll.inc.php create mode 100644 core/components/polls/lexicon/fr/previouspolls.inc.php create mode 100644 core/components/polls/lexicon/fr/tvrenders.inc.php diff --git a/core/components/polls/lexicon/fr/default.inc.php b/core/components/polls/lexicon/fr/default.inc.php new file mode 100644 index 0000000..2b186f6 --- /dev/null +++ b/core/components/polls/lexicon/fr/default.inc.php @@ -0,0 +1,74 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/fr/latestpoll.inc.php b/core/components/polls/lexicon/fr/latestpoll.inc.php new file mode 100644 index 0000000..9216ea8 --- /dev/null +++ b/core/components/polls/lexicon/fr/latestpoll.inc.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/fr/previouspolls.inc.php b/core/components/polls/lexicon/fr/previouspolls.inc.php new file mode 100644 index 0000000..5d6aed0 --- /dev/null +++ b/core/components/polls/lexicon/fr/previouspolls.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/core/components/polls/lexicon/fr/tvrenders.inc.php b/core/components/polls/lexicon/fr/tvrenders.inc.php new file mode 100644 index 0000000..86ebe52 --- /dev/null +++ b/core/components/polls/lexicon/fr/tvrenders.inc.php @@ -0,0 +1,16 @@ + \ No newline at end of file From acf62d7615eb18324a905c608033ef8f57891e0a Mon Sep 17 00:00:00 2001 From: Romain Fallet Date: Thu, 17 Jul 2014 11:15:39 +0200 Subject: [PATCH 4/9] Fr lexicon corrections Corrections of some translation mistakes. --- core/components/polls/lexicon/fr/default.inc.php | 10 +++++----- core/components/polls/lexicon/fr/latestpoll.inc.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/components/polls/lexicon/fr/default.inc.php b/core/components/polls/lexicon/fr/default.inc.php index 2b186f6..fa7af7f 100644 --- a/core/components/polls/lexicon/fr/default.inc.php +++ b/core/components/polls/lexicon/fr/default.inc.php @@ -28,17 +28,17 @@ $_lang['polls.question'] = "Question"; $_lang['polls.questionid'] = "QID"; $_lang['polls.question.nocategory'] = "Pas de catégorie"; -$_lang['polls.questions.desc'] = "Ici vous pouvez gérer toutes les questions que vous voulez voir sur le site. Vous pouvez également cacher les sondages du site ou les publier et les dépublier en spécifiant des dates de publication. Cliquez sur les entrées pour les éditer."; +$_lang['polls.questions.desc'] = "Ici vous pouvez gérer toutes les questions que vous voulez voir sur le site. Vous pouvez également cacher les sondages du site ou les publier et les dé-publier en spécifiant des dates de publication. Cliquez sur les entrées pour les éditer."; $_lang['polls.questions.create'] = "Créer une question"; $_lang['polls.questions.create.error_save'] = "Echec de la sauvegarde de la nouvelle question. Veuillez réessayer."; $_lang['polls.questions.votes'] = "Votes"; $_lang['polls.questions.duplicate'] = "Dupliquer la question et les réponses"; -$_lang['polls.questions.duplicate_confirm'] = "Êtes-vous sûr de vouloir dupliquer la question et les réponses ? Cela ne duliquera pas les statistiques de nombre de votes."; +$_lang['polls.questions.duplicate_confirm'] = "Êtes-vous sûr de vouloir dupliquer la question et les réponses ? Cela ne dupliquera pas les statistiques de nombre de votes."; $_lang['polls.questions.duplicate_error'] = "Echec de la duplication de la question et/ou des réponses. Veuillez réessayer."; $_lang['polls.questions.update'] = "Mettre à jour la question"; $_lang['polls.questions.remove'] = "Supprimer la question"; $_lang['polls.questions.remove_confirm'] = "Êtes-vous sûr de vouloir supprimer cette question ainsi que toutes ses réponses et statistiques ?"; -$_lang['polls.questions.error_remove'] = "Echec de la supprission de cette question. Veuillez réessayer."; +$_lang['polls.questions.error_remove'] = "Echec de la suppression de cette question. Veuillez réessayer."; $_lang['polls.question.update'] = "Mettre à jour la question"; $_lang['polls.question.error_update'] = "Echec de la mise à jour de cette question. Veuillez réessayer."; @@ -63,11 +63,11 @@ $_lang['polls.answers.btnback'] = "Retour aux questions"; $_lang['polls.answers.desc'] = "Gérez ici toutes les réponses de la question sélectionnée. Vous pouvez modifier la réponse en cliquant sur le texte ou changer son ordre en modifiant la valeur du champ « Position ». Notez que les réponses dont la position est : « 0 » seront toujours les dernières dans la liste."; $_lang['polls.answers.votes'] = "Votes"; -$_lang['polls.answers.percents'] = "Pourcents"; +$_lang['polls.answers.percents'] = "Pourcentage"; $_lang['polls.answers.sort'] = "Position"; $_lang['polls.answers.create'] = "Créer une réponse"; $_lang['polls.answers.create.error_save'] = "Impossible de créer la nouvelle réponse. Veuillez réessayer."; -$_lang['polls.answers.remove'] = "Supprimer la réponse."; +$_lang['polls.answers.remove'] = "Supprimer la réponse"; $_lang['polls.answers.remove_confirm'] = "Êtes-vous sûr de vouloir supprimer cette réponse ?"; $_lang['polls.answers.error_remove'] = "Echec de la suppression de cette réponse. Veuillez réessayer."; diff --git a/core/components/polls/lexicon/fr/latestpoll.inc.php b/core/components/polls/lexicon/fr/latestpoll.inc.php index 9216ea8..c6f86dd 100644 --- a/core/components/polls/lexicon/fr/latestpoll.inc.php +++ b/core/components/polls/lexicon/fr/latestpoll.inc.php @@ -11,9 +11,9 @@ $_lang['polls.totalvotes'] = "Total des votes : [[+num]]"; $_lang['polls.vote'] = "Voter"; -$_lang['polls.votedon'] = "Vous avez déjà voté le [[+date]] à [[+time]]!"; +$_lang['polls.votedon'] = "Vous avez déjà voté le [[+date]] à [[+time]]."; $_lang['polls.category'] = "Categorie : [[+name]]"; $_lang['polls.votes'] = "Votes : [[+num]]"; -$_lang['polls.showresults'] = "Montrer les résulats"; +$_lang['polls.showresults'] = "Montrer les résultats"; ?> \ No newline at end of file From 26d8f9a69511bd3c728953c08588507ed84b7de1 Mon Sep 17 00:00:00 2001 From: Fmussoni Date: Tue, 19 Sep 2017 14:54:29 +0200 Subject: [PATCH 5/9] fix schema sql --- core/components/polls/model/schema/polls.mysql.schema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/components/polls/model/schema/polls.mysql.schema.xml b/core/components/polls/model/schema/polls.mysql.schema.xml index cbfada5..6baa0c2 100755 --- a/core/components/polls/model/schema/polls.mysql.schema.xml +++ b/core/components/polls/model/schema/polls.mysql.schema.xml @@ -23,7 +23,7 @@ - + From 3aaf07f82409b474e1ac4330ee4c9bdd4c2659f6 Mon Sep 17 00:00:00 2001 From: Fmussoni Date: Tue, 19 Sep 2017 15:41:08 +0200 Subject: [PATCH 6/9] fix updatefromgrid Category --- .../polls/processors/mgr/categories/updatefromgrid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/components/polls/processors/mgr/categories/updatefromgrid.php b/core/components/polls/processors/mgr/categories/updatefromgrid.php index bf603de..93b8d74 100755 --- a/core/components/polls/processors/mgr/categories/updatefromgrid.php +++ b/core/components/polls/processors/mgr/categories/updatefromgrid.php @@ -17,7 +17,7 @@ return $modx->error->failure($modx->lexicon('polls.error.update')); } -$poll = $modx->getObject('modPollQuestion', $_DATA['id']); +$poll = $modx->getObject('modPollCategory', $_DATA['id']); if(empty($poll)) return $modx->error->failure($modx->lexicon('polls.error.update')); if(isset($_DATA['publishdate']) && empty($_DATA['publishdate'])) { $_DATA['publishdate'] = null; } From 8ae75c06a330e92641c2b727e4c4b4e798dbacbe Mon Sep 17 00:00:00 2001 From: Fmussoni Date: Wed, 20 Sep 2017 08:37:33 +0200 Subject: [PATCH 7/9] fix reference $poll --- core/components/polls/elements/snippets/snippet.polls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/components/polls/elements/snippets/snippet.polls.php b/core/components/polls/elements/snippets/snippet.polls.php index 7810165..74f2481 100755 --- a/core/components/polls/elements/snippets/snippet.polls.php +++ b/core/components/polls/elements/snippets/snippet.polls.php @@ -84,7 +84,7 @@ if($poll->hasVoted()) { - $vote = $latest->getOne('Logs', array('ipaddress:=' => $_SERVER['REMOTE_ADDR'])); + $vote = $poll->getOne('Logs', array('ipaddress:=' => $_SERVER['REMOTE_ADDR'])); $placeholders['logdate'] = $vote->get('logdate'); } From 9e93baf3b39c5e3bfac09a878029627520d55bf5 Mon Sep 17 00:00:00 2001 From: Fmussoni Date: Wed, 20 Sep 2017 08:48:44 +0200 Subject: [PATCH 8/9] fix sort order --- .../polls/elements/snippets/snippet.polls.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/components/polls/elements/snippets/snippet.polls.php b/core/components/polls/elements/snippets/snippet.polls.php index 74f2481..fa2caed 100755 --- a/core/components/polls/elements/snippets/snippet.polls.php +++ b/core/components/polls/elements/snippets/snippet.polls.php @@ -68,8 +68,14 @@ $category = $poll->getOne('Category'); $placeholders['category_name'] = (!empty($category) && is_object($category)) ? $category->get('name') : ''; - - $answers = $poll->getMany('Answers'); + + $ans = $modx->newQuery('modPollAnswer'); + $ans->sortby('sort_order','ASC'); + $ans->where(array( + 'question'=>$poll->id + )); + $answers = $modx->getCollection('modPollAnswer',$ans); + $answersOutput = ''; foreach($answers as $idx => $answer) { $answerParams = array_merge( From eb18842ac87da28220fc7494807e4087580768f0 Mon Sep 17 00:00:00 2001 From: Fmussoni Date: Wed, 20 Sep 2017 10:25:32 +0200 Subject: [PATCH 9/9] fix #36 idx counter --- core/components/polls/elements/snippets/snippet.polls.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/components/polls/elements/snippets/snippet.polls.php b/core/components/polls/elements/snippets/snippet.polls.php index fa2caed..be9a19a 100755 --- a/core/components/polls/elements/snippets/snippet.polls.php +++ b/core/components/polls/elements/snippets/snippet.polls.php @@ -77,12 +77,14 @@ $answers = $modx->getCollection('modPollAnswer',$ans); $answersOutput = ''; - foreach($answers as $idx => $answer) { + $idx = 1; + foreach($answers as $k => $answer) { $answerParams = array_merge( $answer->toArray(), array( 'percent' => $answer->getVotesPercent($placeholders['totalVotes']), 'idx' => $idx )); + $idx++; $answersOutput .= $modx->getChunk((!$poll->hasVoted() ? $tplVoteAnswer : $tplResultAnswer), $answerParams); }