Skip to content

Commit

Permalink
Merge pull request #48 from bertoost/release/v1.3.2-pl
Browse files Browse the repository at this point in the history
Release/v1.3.2 pl
  • Loading branch information
solidusite authored Sep 22, 2017
2 parents 7fe6dfb + eb18842 commit da66f84
Show file tree
Hide file tree
Showing 24 changed files with 279 additions and 19 deletions.
16 changes: 12 additions & 4 deletions core/components/polls/elements/snippets/snippet.polls.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,31 @@

$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) {
$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);
}

$placeholders['answers'] = $answersOutput;

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');
}

Expand Down
74 changes: 74 additions & 0 deletions core/components/polls/lexicon/cs/default.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* The default Czech Poll lexicon entries
*
* @package polls
* @subpackage lexicon
* @language: Czech
* @author: Bert Oost
* @translation-date: 2011-01-20
*/

$_lang['polls'] = "Polls";
$_lang['polls.manage'] = "Správa anket";
$_lang['polls.desc'] = "Správa kategorií anket, anketních otázek a odpovědí zde.";
$_lang['polls.search'] = "Hledat...";
$_lang['polls.publishdate'] = "Datum od";
$_lang['polls.unpublishdate'] = "Datum do";
$_lang['polls.hide'] = "Skrýt";
$_lang['polls.duplicate'] = "Duplikovat";

// error strings
$_lang['polls.error.griddata'] = "Nebyla nalezena žádná data!";
$_lang['polls.error.update'] = "Nemohu aktualizovat data, protože není znám záznam!";
$_lang['polls.error.save'] = "Došlo k chybě při ukládání dat!";

// questions part
$_lang['polls.questions'] = "Anketní otázky";
$_lang['polls.question'] = "Anketní otázka";
$_lang['polls.questionid'] = "QID";
$_lang['polls.question.nocategory'] = "kategorie nepřiřazena";
$_lang['polls.questions.desc'] = "Zde můžete spravovat anketní otázky. Máte možnost ankety skrýt z webu nebo jim nastavit datum publikování od-do.";
$_lang['polls.questions.create'] = "Vytvořit anketní otázku";
$_lang['polls.questions.create.error_save'] = "Došlo k chybě při ukládání nové anketní otázky. Zkuste to znovu!";
$_lang['polls.questions.votes'] = "Hlasů";
$_lang['polls.questions.duplicate'] = "Duplikovat anketní otázku a odpovědi";
$_lang['polls.questions.duplicate_confirm'] = "Opravdu chcete duplikovat anketní otázku a odpovědi? Tímto nebudou duplikovány hlasy pro jednotlivé odpovědi.";
$_lang['polls.questions.duplicate_error'] = "Došlo k chybě při duplikování anketní otázky a/nebo odpovědi. Zkuste to znovu!";
$_lang['polls.questions.update'] = "Upravit anketní otázku";
$_lang['polls.questions.remove'] = "Odstranit anketní otázku";
$_lang['polls.questions.remove_confirm'] = "Opravdu chcete odstranit tuto anketní otázku, všechny odpovědi a statistiky?";
$_lang['polls.questions.error_remove'] = "Došlo k chybě při odstranění anketní otázky. Zkuste to znovu!";

$_lang['polls.question.update'] = "Upravit anketní otázku";
$_lang['polls.question.error_update'] = "Došlo k chybě při aktualizaci anketní otázky. Zkuste to znovu!";
$_lang['polls.questions.errorload'] = "Došlo k chybě při načítání anketní otázky!";

// categories part
$_lang['polls.categories'] = "Kategorie";
$_lang['polls.category'] = "Kategorie";
$_lang['polls.category.filter'] = "Filtrovat kategorii";
$_lang['polls.categoryid'] = "ID kategorie";
$_lang['polls.categories.desc'] = "Níže je seznam kategorií do kterých je možné přiřazovat anketní otázky. Kategorie můžete upravovat kliknutím na jméno kategorie pravým tlačítkem myši.";
$_lang['polls.categories.create'] = "Vytvořit kategorii";
$_lang['polls.categories.create.error_save'] = "Došlo k chybě při ukládání nové kategorie. Zkuste to znovu!";
$_lang['polls.categories.remove'] = "Odstranit kategorii";
$_lang['polls.categories.remove_confirm'] = "Opravdu chcete odstranit tuto kategoriee a všechny anketní otázky do ní přiřazené?";
$_lang['polls.categories.error_remove'] = "Došlo k chybě při odstranění kategorie. Zkuste to znovu!";

// answers part
$_lang['polls.answers'] = "Odpovědi";
$_lang['polls.answer'] = "Odpověď";
$_lang['polls.answerid'] = "ID odpovědi";
$_lang['polls.answers.btnback'] = "Zpět k anketním otázkám";
$_lang['polls.answers.desc'] = "Zde můžete spravovat odpovědi na zvolenou anketní otázku. Odpověď můžete upravit kliknutím na text a podobně můžete upravit hodnotu pro řazení pozice odpovědi. Hodnota 0 patří poslední odpovědi v seznamu.";
$_lang['polls.answers.votes'] = "Hlasů";
$_lang['polls.answers.percents'] = "Procent";
$_lang['polls.answers.sort'] = "Řazení";
$_lang['polls.answers.create'] = "Vytvořit odpověď";
$_lang['polls.answers.create.error_save'] = "Došlo k chybě při vytváření nové odpovědi. Zkuste to znovu!";
$_lang['polls.answers.remove'] = "Odstranit odpověď";
$_lang['polls.answers.remove_confirm'] = "Opravdu chcete odstranit tuto odpověď?";
$_lang['polls.answers.error_remove'] = "Došlo k chybě při odstraňování odpovědi. Zkuste to znovu!";

?>
19 changes: 19 additions & 0 deletions core/components/polls/lexicon/cs/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* The latest poll Czech Poll lexicon entries
*
* @package polls
* @subpackage lexion
* @language: Czech
* @author: Jiri Pavlicek (jiri@pavlicek.cz)
* @translation-date: 2012-11-02
*/

$_lang['polls.totalvotes'] = "Celkem hlasů: [[+num]]";
$_lang['polls.vote'] = "Hlasovat!";
$_lang['polls.votedon'] = "Z této IP adresy již bylo hlasováno dne [[+date]] v&nbsp;[[+time]]!";
$_lang['polls.category'] = "Kategorie: [[+name]]";
$_lang['polls.votes'] = "Hlasů: [[+num]]";
$_lang['polls.showresults'] = "Zobrazit výsledky";

?>
17 changes: 17 additions & 0 deletions core/components/polls/lexicon/cs/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* The latest poll Czech Poll lexicon entries
*
* @package polls
* @subpackage lexicon
* @language: Czech
* @author: Jiri Pavlicek (jiri@pavlicek.cz)
* @translation-date: 2012-11-02
*/

$_lang['polls.prev.question'] = "Otázka";
$_lang['polls.prev.nranswers'] = "Celkem odpovědí";
$_lang['polls.prev.nrvotes'] = "Celkem hlasů";
$_lang['polls.prev.results'] = "Zobrazit výsledky";

?>
16 changes: 16 additions & 0 deletions core/components/polls/lexicon/cs/tvrenders.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* The latest poll Czech Poll lexicon entries
*
* @package polls
* @subpackage lexicon
* @language: Czech
* @author: Jiri Pavlicek (jiri@pavlicek.cz)
* @translation-date: 2012-11-02
*/

$_lang['pollslist'] = "Seznam otázek anket";
$_lang['pollscategory'] = "Kategorie";
$_lang['pollscategory_desc'] = "Zvolte kategorii pro výpis pouze této kategorie.";

?>
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/de/default.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The default lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/de/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The latest poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/de/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The previous poll English Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/en/default.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The default English Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/en/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The latest poll English Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/en/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The previous poll English Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/en/tvrenders.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The TV render English Poll lexicon entries
*
Expand Down
74 changes: 74 additions & 0 deletions core/components/polls/lexicon/fr/default.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* The default French Poll lexicon entries
*
* @package polls
* @subpackage lexion
* @language: Français
* @author: Romain Fallet
* @translation-date: 2014-07-16
*/

$_lang['polls'] = "Sondages";
$_lang['polls.manage'] = "Gérer les sondages";
$_lang['polls.desc'] = "Gérer les catégories des sondages, des questions et des réponses ici.";
$_lang['polls.search'] = "Rechercher";
$_lang['polls.publishdate'] = "Date de publication";
$_lang['polls.unpublishdate'] = "Date de fin de publication";
$_lang['polls.hide'] = "Cacher";
$_lang['polls.duplicate'] = "Dupliquer";

// error strings
$_lang['polls.error.griddata'] = "Aucune donnée n'a été trouvée.";
$_lang['polls.error.update'] = "Echec de la mise à jour de cette entrée, l'entrée spécifiée est introuvable.";
$_lang['polls.error.save'] = "Echec de la sauvegarde des données spécifiées.";

// questions part
$_lang['polls.questions'] = "Questions";
$_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.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 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 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.";
$_lang['polls.questions.errorload'] = "Echec du chargement de la question.";

// categories part
$_lang['polls.categories'] = "Catégories";
$_lang['polls.category'] = "Catégorie";
$_lang['polls.category.filter'] = "Filtrer par catégorie";
$_lang['polls.categoryid'] = "ID de la catégorie";
$_lang['polls.categories.desc'] = "Ci-dessous la liste des catégories disponibles pour les questions. Vous pouvez éditer une catégorie en cliquant simplement sur le nom de la catégorie et la supprimer en faisant un clic droit.";
$_lang['polls.categories.create'] = "Créer une catégorie";
$_lang['polls.categories.create.error_save'] = "Echec de la sauvegarde de la nouvelle catégorie. Veuillez réessayer.";
$_lang['polls.categories.remove'] = "Supprimer la catégorie.";
$_lang['polls.categories.remove_confirm'] = "Êtes-vous sûr de vouloir supprimer cette catégorie ainsi que toutes les questions qui y sont affiliées ?";
$_lang['polls.categories.error_remove'] = "Echec de la suppression de cette catégorie. Veuillez réessayer.";

// answers part
$_lang['polls.answers'] = "Réponses";
$_lang['polls.answer'] = "Réponse";
$_lang['polls.answerid'] = "ID de la réponse";
$_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'] = "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_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.";

?>
19 changes: 19 additions & 0 deletions core/components/polls/lexicon/fr/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* The latest poll French Poll lexicon entries
*
* @package polls
* @subpackage lexion
* @language: Français
* @author: Romain Fallet
* @translation-date: 2014-07-16
*/

$_lang['polls.totalvotes'] = "Total des votes : [[+num]]";
$_lang['polls.vote'] = "Voter";
$_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ésultats";

?>
17 changes: 17 additions & 0 deletions core/components/polls/lexicon/fr/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* The previous poll French Poll lexicon entries
*
* @package polls
* @subpackage lexion
* @language: Français
* @author: Romain Fallet
* @translation-date: 2014-07-16
*/

$_lang['polls.prev.question'] = "Question";
$_lang['polls.prev.nranswers'] = "Total des réponses";
$_lang['polls.prev.nrvotes'] = "Total des votes";
$_lang['polls.prev.results'] = "Voir les résultats";

?>
16 changes: 16 additions & 0 deletions core/components/polls/lexicon/fr/tvrenders.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* The TV render French Poll lexicon entries
*
* @package polls
* @subpackage lexion
* @language: Français
* @author: Romain Fallet
* @translation-date: 2014-07-16
*/

$_lang['pollslist'] = "Listes de question des sondages";
$_lang['pollscategory'] = "Categorie";
$_lang['pollscategory_desc'] = "Spécifiez une catégorie pour lister les question de cette catégorie.";

?>
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/nl/default.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The default Dutch Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/nl/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The latest poll Dutch Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/nl/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The previous poll Dutch Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/ru/default.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
$_lang['polls'] = 'Опросы';
$_lang['polls.manage'] = 'Управление опросами';
$_lang['polls.desc'] = 'Управление категориями опросов, вопросами и ответами.';
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/ru/latestpoll.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
$_lang['polls.totalvotes'] = 'Всего голосов: [[+num]]';
$_lang['polls.vote'] = 'Голосовать!';
$_lang['polls.votedon'] = 'Вы уже голосовали [[+date]] в [[+time]]!';
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/lexicon/ru/previouspolls.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* The previous poll English Poll lexicon entries
*
Expand Down
2 changes: 1 addition & 1 deletion core/components/polls/model/schema/polls.mysql.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<field key="question" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" index="index" />
<field key="answer" dbtype="varchar" precision="255" phptype="string" null="false" index="index" />
<field key="votes" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="sort_order" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" defaukt="0" />
<field key="sort_order" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />

<aggregate alias="Question" class="modPollQuestion" local="question" foreign="id" cardinality="one" owner="foreign" />
<composite alias="Logs" class="modPollLog" local="id" foreign="answer" cardinality="many" owner="local" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit da66f84

Please sign in to comment.