|
From: <gem...@li...> - 2012-07-20 16:58:04
|
Revision: 864
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=864&view=rev
Author: matijsdejong
Date: 2012-07-20 16:57:56 +0000 (Fri, 20 Jul 2012)
Log Message:
-----------
Some more last minute issues for #366
Fixed #367 survey and track screens now have more powerfull selection tools
Modified Paths:
--------------
trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php
trunk/library/classes/Gems/Default/TrackFieldsAction.php
trunk/library/classes/Gems/Default/TrackMaintenanceAction.php
trunk/library/classes/Gems/Default/TrackRoundsAction.php
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php
===================================================================
--- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-07-20 16:57:56 UTC (rev 864)
@@ -454,6 +454,73 @@
return MUtil_Html::raw(strip_tags($value));
}
+ /**
+ * Returns a text element for autosearch. Can be overruled.
+ *
+ * The form / html elements to search on. Elements can be grouped by inserting null's between them.
+ * That creates a distinct group of elements
+ *
+ * @param MUtil_Model_ModelAbstract $model
+ * @param array $data The $form field values (can be usefull, but no need to set them)
+ * @return array Of Zend_Form_Element's or static tekst to add to the html or null for group breaks.
+ */
+ protected function getAutoSearchElements(MUtil_Model_ModelAbstract $model, array $data)
+ {
+ $elements = parent::getAutoSearchElements($model, $data);
+
+ if ($elements) {
+ $br = MUtil_Html::create('br');
+ $elements[] = $this->_createSelectElement('gsu_id_primary_group', $model, $this->_('(all groups)'));
+
+ $elements[] = $br;
+
+ $states = array(
+ 'act' => $this->_('Active'),
+ 'sok' => $this->_('OK in source, not active'),
+ 'nok' => $this->_('Blocked in source'),
+ );
+ $element = $this->_createSelectElement('status', $states, $this->_('(every state)'));
+ // $element->setLabel($this->_('Status'));
+ $elements[] = $element;
+
+ }
+
+ return $elements;
+ }
+
+ /**
+ * Additional data filter statements for the user input.
+ *
+ * User input that has the same name as a model field is automatically
+ * used as a filter, but if the name is different processing is needed.
+ * That processing should happen here.
+ *
+ * @param array $data The current user input
+ * @return array New filter statements
+ */
+ protected function getDataFilter(array $data)
+ {
+ $filter = parent::getDataFilter($data);
+
+ if (isset($data['status']) && strlen($data['status'])) {
+ switch ($data['status']) {
+ case 'sok':
+ $filter['gsu_active'] = 0;
+ $filter[] = "(gsu_status IS NULL OR LENGTH(gsu_status) = 0)";
+ break;
+
+ case 'nok':
+ $filter[] = "(gsu_status IS NOT NULL AND gsu_status NOT IN ('', 'OK'))";
+ break;
+
+ default:
+ $filter['gsu_active'] = 1;
+ }
+ }
+
+ return $filter;
+ }
+
public function getTrackCount($currentId)
{
$singleTrack = ($this->escort instanceof Gems_Project_Tracks_SingleTrackInterface) ? $this->escort->getTrackId() : null;
Modified: trunk/library/classes/Gems/Default/TrackFieldsAction.php
===================================================================
--- trunk/library/classes/Gems/Default/TrackFieldsAction.php 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/classes/Gems/Default/TrackFieldsAction.php 2012-07-20 16:57:56 UTC (rev 864)
@@ -76,6 +76,47 @@
}
/**
+ * Creates a model for getModel(). Called only for each new $action.
+ *
+ * The parameters allow you to easily adapt the model to the current action. The $detailed
+ * parameter was added, because the most common use of action is a split between detailed
+ * and summarized actions.
+ *
+ * @param boolean $detailed True when the current action is not in $summarizedActions.
+ * @param string $action The current action.
+ * @return Gems_Model_TrackModel
+ */
+ public function createModel($detailed, $action)
+ {
+ $trackId = $this->_getIdParam();
+ $types = array('select' => $this->_('Select one'), 'multiselect' => $this->_('Select multiple'), 'date' => $this->_('Date'), 'text' => $this->_('Free text'));
+
+ $model = new MUtil_Model_TableModel('gems__track_fields');
+ $model->setKeys(array('fid' => 'gtf_id_field', MUtil_Model::REQUEST_ID => 'gtf_id_track'));
+ $model->set('gtf_id_track', 'label', $this->_('Track'), 'multiOptions', $this->util->getTrackData()->getAllTracks());
+ $model->set('gtf_id_order', 'label', $this->_('Order'));
+ $model->set('gtf_field_name', 'label', $this->_('Name'));
+ if ($detailed) {
+ $model->set('gtf_field_code', 'label', $this->_('Code Name'));
+ $model->set('gtf_field_description', 'label', $this->_('Description'));
+ }
+ $model->set('gtf_field_values', 'label', $this->_('Values'));
+ $model->set('gtf_field_type', 'label', $this->_('Type'), 'multiOptions', $types);
+ $model->set('gtf_required', 'label', $this->_('Required'), 'multiOptions', $this->util->getTranslated()->getYesNo());
+ if ($detailed) {
+ $model->set('gtf_readonly', 'label', $this->_('Readonly'), 'multiOptions', $this->util->getTranslated()->getYesNo());
+ }
+
+ Gems_Model::setChangeFieldsByPrefix($model, 'gtf');
+
+ if ($trackId) {
+ $model->set('gtf_id_track', 'default', $trackId);
+ }
+
+ return $model;
+ }
+
+ /**
* Creates a form to delete a record
*
* Uses $this->getModel()
@@ -124,47 +165,6 @@
return $elements;
}
- /**
- * Creates a model for getModel(). Called only for each new $action.
- *
- * The parameters allow you to easily adapt the model to the current action. The $detailed
- * parameter was added, because the most common use of action is a split between detailed
- * and summarized actions.
- *
- * @param boolean $detailed True when the current action is not in $summarizedActions.
- * @param string $action The current action.
- * @return Gems_Model_TrackModel
- */
- public function createModel($detailed, $action)
- {
- $trackId = $this->_getIdParam();
- $types = array('select' => $this->_('Select one'), 'multiselect' => $this->_('Select multiple'), 'date' => $this->_('Date'), 'text' => $this->_('Free text'));
-
- $model = new MUtil_Model_TableModel('gems__track_fields');
- $model->setKeys(array('fid' => 'gtf_id_field', MUtil_Model::REQUEST_ID => 'gtf_id_track'));
- $model->set('gtf_id_track', 'label', $this->_('Track'), 'multiOptions', $this->util->getTrackData()->getAllTracks());
- $model->set('gtf_id_order', 'label', $this->_('Order'));
- $model->set('gtf_field_name', 'label', $this->_('Name'));
- if ($detailed) {
- $model->set('gtf_field_code', 'label', $this->_('Code Name'));
- $model->set('gtf_field_description', 'label', $this->_('Description'));
- }
- $model->set('gtf_field_values', 'label', $this->_('Values'));
- $model->set('gtf_field_type', 'label', $this->_('Type'), 'multiOptions', $types);
- $model->set('gtf_required', 'label', $this->_('Required'), 'multiOptions', $this->util->getTranslated()->getYesNo());
- if ($detailed) {
- $model->set('gtf_readonly', 'label', $this->_('Readonly'), 'multiOptions', $this->util->getTranslated()->getYesNo());
- }
-
- Gems_Model::setChangeFieldsByPrefix($model, 'gtf');
-
- if ($trackId) {
- $model->set('gtf_id_track', 'default', $trackId);
- }
-
- return $model;
- }
-
public function getTopic($count = 1)
{
return $this->plural('field', 'fields', $count);
Modified: trunk/library/classes/Gems/Default/TrackMaintenanceAction.php
===================================================================
--- trunk/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-07-20 16:57:56 UTC (rev 864)
@@ -184,6 +184,7 @@
{
$id = $this->_getIdParam();
$track = $this->loader->getTracker()->getTrackEngine($id);
+ $track->applyToMenuSource($this->menu->getParameterSource());
$where = $this->db->quoteInto('gr2t_id_track = ?', $id);
$batch = $this->loader->getTracker()->checkTrackRounds('trackCheckRounds' . $id, $this->loader->getCurrentUser()->getUserId(), $where);
@@ -339,7 +340,7 @@
* @param string $mode
* @param array $keys
*/
- private function showList($mode, array $keys, $rowclassField)
+ private function showList($mode, array $keys, $rowclassField = null)
{
$action = $this->getRequest()->getActionName();
$this->getRequest()->setActionName($mode);
Modified: trunk/library/classes/Gems/Default/TrackRoundsAction.php
===================================================================
--- trunk/library/classes/Gems/Default/TrackRoundsAction.php 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/classes/Gems/Default/TrackRoundsAction.php 2012-07-20 16:57:56 UTC (rev 864)
@@ -180,7 +180,15 @@
$model = $this->getModel();
$deleted = $model->delete();
+ // Always perform delete, tokens may not be in use
+ $tokens = $this->db->delete('gems__tokens', $this->db->quoteInto('gto_id_round = ?', $roundId));
+
$this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted));
+
+ if ($tokens) {
+ $this->addMessage(sprintf($this->plural('Also deleted %s unanswered token.', 'Also deleted %s unanswered tokens.', $tokens), $tokens));
+ }
+
$this->_reroute(array('action' => 'index', MUtil_Model::REQUEST_ID => $this->_getIdParam()), true);
}
} elseif ($used) {
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/languages/default-en.po 2012-07-20 16:57:56 UTC (rev 864)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-07-20 18:30+0100\n"
+"POT-Creation-Date: 2012-07-20 18:36+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -2633,50 +2633,50 @@
msgid "Check this box if this field is always set by code instead of the user."
msgstr "Check this box if this field is always set by code instead of the user."
-#: classes/Gems/Default/TrackFieldsAction.php:99
-#, php-format
-msgid "Field also deleted from %s assigned track."
-msgid_plural "Field also deleted from %s assigned tracks."
-msgstr[0] "Field also deleted from %s assigned track."
-msgstr[1] "Field also deleted from %s assigned tracks."
-
-#: classes/Gems/Default/TrackFieldsAction.php:105
-#, php-format
-msgid "This field will be deleted from %s assigned track."
-msgid_plural "This field will be deleted from %s assigned tracks."
-msgstr[0] "This field will be deleted from %s assigned track."
-msgstr[1] "This field will be deleted from %s assigned tracks."
-
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Select one"
msgstr "Select one"
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Select multiple"
msgstr "Select multiple"
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Free text"
msgstr "Free text"
-#: classes/Gems/Default/TrackFieldsAction.php:149
+#: classes/Gems/Default/TrackFieldsAction.php:100
msgid "Code Name"
msgstr "Code Name"
-#: classes/Gems/Default/TrackFieldsAction.php:152
+#: classes/Gems/Default/TrackFieldsAction.php:103
#: classes/Gems/Default/TrackMaintenanceAction.php:227
msgid "Values"
msgstr "Values"
-#: classes/Gems/Default/TrackFieldsAction.php:154
+#: classes/Gems/Default/TrackFieldsAction.php:105
#: classes/Gems/Default/TrackMaintenanceAction.php:229
msgid "Required"
msgstr "Required"
-#: classes/Gems/Default/TrackFieldsAction.php:156
+#: classes/Gems/Default/TrackFieldsAction.php:107
msgid "Readonly"
msgstr "Readonly"
+#: classes/Gems/Default/TrackFieldsAction.php:140
+#, php-format
+msgid "Field also deleted from %s assigned track."
+msgid_plural "Field also deleted from %s assigned tracks."
+msgstr[0] "Field also deleted from %s assigned track."
+msgstr[1] "Field also deleted from %s assigned tracks."
+
+#: classes/Gems/Default/TrackFieldsAction.php:146
+#, php-format
+msgid "This field will be deleted from %s assigned track."
+msgid_plural "This field will be deleted from %s assigned tracks."
+msgstr[0] "This field will be deleted from %s assigned track."
+msgstr[1] "This field will be deleted from %s assigned tracks."
+
#: classes/Gems/Default/TrackFieldsAction.php:170
msgid "field"
msgid_plural "fields"
@@ -2752,9 +2752,9 @@
#: classes/Gems/Default/TrackRoundAction.php:89
#: classes/Gems/Default/TrackRoundsAction.php:103
#: classes/Gems/Default/TrackRoundsAction.php:130
-#: classes/Gems/Default/TrackRoundsAction.php:201
-#: classes/Gems/Default/TrackRoundsAction.php:228
-#: classes/Gems/Default/TrackRoundsAction.php:272
+#: classes/Gems/Default/TrackRoundsAction.php:209
+#: classes/Gems/Default/TrackRoundsAction.php:236
+#: classes/Gems/Default/TrackRoundsAction.php:280
msgid "Missing track identifier."
msgstr "Missing track identifier."
@@ -2768,24 +2768,31 @@
msgid "%2$u %1$s deactivated"
msgstr "%2$u %1$s deactivated"
-#: classes/Gems/Default/TrackRoundsAction.php:187
+#: classes/Gems/Default/TrackRoundsAction.php:189
#, php-format
+msgid "Also deleted %s unanswered token."
+msgid_plural "Also deleted %s unanswered tokens."
+msgstr[0] "Also deleted %s unanswered token."
+msgstr[1] "Also deleted %s unanswered tokens."
+
+#: classes/Gems/Default/TrackRoundsAction.php:195
+#, php-format
msgid "This round has been completed %s time."
msgid_plural "This round has been completed %s times."
msgstr[0] "This round has been completed %s time."
msgstr[1] "This round has been completed %s times."
-#: classes/Gems/Default/TrackRoundsAction.php:188
+#: classes/Gems/Default/TrackRoundsAction.php:196
msgid "This round cannot be deleted, only deactivated."
msgstr "This round cannot be deleted, only deactivated."
-#: classes/Gems/Default/TrackRoundsAction.php:214
+#: classes/Gems/Default/TrackRoundsAction.php:222
msgid "round"
msgid_plural "rounds"
msgstr[0] "round"
msgstr[1] "rounds"
-#: classes/Gems/Default/TrackRoundsAction.php:219
+#: classes/Gems/Default/TrackRoundsAction.php:227
msgid "Rounds"
msgstr "Rounds"
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-07-20 16:33:41 UTC (rev 863)
+++ trunk/library/languages/default-nl.po 2012-07-20 16:57:56 UTC (rev 864)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-07-20 18:24+0100\n"
+"POT-Creation-Date: 2012-07-20 18:37+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -2633,50 +2633,50 @@
msgid "Check this box if this field is always set by code instead of the user."
msgstr "Vink aan als dit veld altijd vanuit de code ingesteld wordt, in plaats van door gebruikers."
-#: classes/Gems/Default/TrackFieldsAction.php:99
-#, php-format
-msgid "Field also deleted from %s assigned track."
-msgid_plural "Field also deleted from %s assigned tracks."
-msgstr[0] "Veld ook verwijderd bij %s toegewezen traject."
-msgstr[1] "Veld ook verwijderd bij %s toegewezen trajecten."
-
-#: classes/Gems/Default/TrackFieldsAction.php:105
-#, php-format
-msgid "This field will be deleted from %s assigned track."
-msgid_plural "This field will be deleted from %s assigned tracks."
-msgstr[0] "Dit veld wordt bij %s toegewezen traject gebruikt en zal daar ook verwijderd worden."
-msgstr[1] "Dit veld wordt bij %s toegewezen trajecten gebruikt en zal daar ook verwijderd worden."
-
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Select one"
msgstr "Kies één"
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Select multiple"
msgstr "Meerkeuze vraag"
-#: classes/Gems/Default/TrackFieldsAction.php:141
+#: classes/Gems/Default/TrackFieldsAction.php:92
msgid "Free text"
msgstr "Vrije tekst"
-#: classes/Gems/Default/TrackFieldsAction.php:149
+#: classes/Gems/Default/TrackFieldsAction.php:100
msgid "Code Name"
msgstr "Code Naam"
-#: classes/Gems/Default/TrackFieldsAction.php:152
+#: classes/Gems/Default/TrackFieldsAction.php:103
#: classes/Gems/Default/TrackMaintenanceAction.php:227
msgid "Values"
msgstr "Waarden"
-#: classes/Gems/Default/TrackFieldsAction.php:154
+#: classes/Gems/Default/TrackFieldsAction.php:105
#: classes/Gems/Default/TrackMaintenanceAction.php:229
msgid "Required"
msgstr "Verplicht"
-#: classes/Gems/Default/TrackFieldsAction.php:156
+#: classes/Gems/Default/TrackFieldsAction.php:107
msgid "Readonly"
msgstr "Alleen lezen"
+#: classes/Gems/Default/TrackFieldsAction.php:140
+#, php-format
+msgid "Field also deleted from %s assigned track."
+msgid_plural "Field also deleted from %s assigned tracks."
+msgstr[0] "Veld ook verwijderd bij %s toegewezen traject."
+msgstr[1] "Veld ook verwijderd bij %s toegewezen trajecten."
+
+#: classes/Gems/Default/TrackFieldsAction.php:146
+#, php-format
+msgid "This field will be deleted from %s assigned track."
+msgid_plural "This field will be deleted from %s assigned tracks."
+msgstr[0] "Dit veld wordt bij %s toegewezen traject gebruikt en zal daar ook verwijderd worden."
+msgstr[1] "Dit veld wordt bij %s toegewezen trajecten gebruikt en zal daar ook verwijderd worden."
+
#: classes/Gems/Default/TrackFieldsAction.php:170
msgid "field"
msgid_plural "fields"
@@ -2752,9 +2752,9 @@
#: classes/Gems/Default/TrackRoundAction.php:89
#: classes/Gems/Default/TrackRoundsAction.php:103
#: classes/Gems/Default/TrackRoundsAction.php:130
-#: classes/Gems/Default/TrackRoundsAction.php:201
-#: classes/Gems/Default/TrackRoundsAction.php:228
-#: classes/Gems/Default/TrackRoundsAction.php:267
+#: classes/Gems/Default/TrackRoundsAction.php:209
+#: classes/Gems/Default/TrackRoundsAction.php:236
+#: classes/Gems/Default/TrackRoundsAction.php:280
msgid "Missing track identifier."
msgstr "Ontbrekende traject identificatie."
@@ -2768,24 +2768,31 @@
msgid "%2$u %1$s deactivated"
msgstr "%2$u %1$s gedeactiveerd"
-#: classes/Gems/Default/TrackRoundsAction.php:187
+#: classes/Gems/Default/TrackRoundsAction.php:189
#, php-format
+msgid "Also deleted %s unanswered token."
+msgid_plural "Also deleted %s unanswered tokens."
+msgstr[0] "Ook %s onbeantwoord kenmerk is verwijderd."
+msgstr[1] "Ook %s onbeantwoorde kenmerken zijn verwijderd."
+
+#: classes/Gems/Default/TrackRoundsAction.php:195
+#, php-format
msgid "This round has been completed %s time."
msgid_plural "This round has been completed %s times."
msgstr[0] "Deze ronde is al %s keer afgerond."
msgstr[1] "Deze ronde is al %s keren afgerond."
-#: classes/Gems/Default/TrackRoundsAction.php:188
+#: classes/Gems/Default/TrackRoundsAction.php:196
msgid "This round cannot be deleted, only deactivated."
msgstr "Dit kenmerk kan niet (meer) verwijderd worden, alleen gedeactiveerd."
-#: classes/Gems/Default/TrackRoundsAction.php:251
+#: classes/Gems/Default/TrackRoundsAction.php:222
msgid "round"
msgid_plural "rounds"
msgstr[0] "ronde"
msgstr[1] "rondes"
-#: classes/Gems/Default/TrackRoundsAction.php:256
+#: classes/Gems/Default/TrackRoundsAction.php:227
msgid "Rounds"
msgstr "Rondes"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|