From: <gem...@li...> - 2011-12-07 14:06:42
|
Revision: 346 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=346&view=rev Author: michieltcs Date: 2011-12-07 14:06:31 +0000 (Wed, 07 Dec 2011) Log Message: ----------- Refs #470 - add gr2t_comment field Modified Paths: -------------- branches/1.5.0-pulse/library/classes/Gems/Default/TrackActionAbstract.php branches/1.5.0-pulse/library/classes/Gems/Tracker/RespondentTrack.php branches/1.5.0-pulse/library/classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php branches/1.5.0-pulse/library/configs/db/patches.sql branches/1.5.0-pulse/library/snippets/DeleteInSourceTrackSnippet.php Modified: branches/1.5.0-pulse/library/classes/Gems/Default/TrackActionAbstract.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Default/TrackActionAbstract.php 2011-12-07 11:27:48 UTC (rev 345) +++ branches/1.5.0-pulse/library/classes/Gems/Default/TrackActionAbstract.php 2011-12-07 14:06:31 UTC (rev 346) @@ -211,6 +211,7 @@ 'formatFunction', $this->util->getTranslated()->formatDate, 'default', MUtil_Date::format(new Zend_date(), 'dd-MM-yyyy')); $model->set('gr2t_reception_code'); + $model->set('gr2t_comment', 'label', $this->_('Comment')); return $model; } Modified: branches/1.5.0-pulse/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Tracker/RespondentTrack.php 2011-12-07 11:27:48 UTC (rev 345) +++ branches/1.5.0-pulse/library/classes/Gems/Tracker/RespondentTrack.php 2011-12-07 14:06:31 UTC (rev 346) @@ -674,15 +674,17 @@ // be overwritten, e.g. when cooperation is retracted. if ($code->isForTracks() || $code->isOverwriter()) { $values['gr2t_reception_code'] = $code->getCode(); + } - $changed = $this->_updateTrack($values, $userId); + $values['gr2t_comment'] = $comment; - if ($changed) { - // Reload reception code values - $this->_ensureReceptionCode($code->getAllData()); - } + $changed = $this->_updateTrack($values, $userId); + + if ($changed) { + // Reload reception code values + $this->_ensureReceptionCode($code->getAllData()); } - + // Stopcodes have a different logic. if ($code->isStopCode()) { // Cascade stop to tokens Modified: branches/1.5.0-pulse/library/classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php 2011-12-07 11:27:48 UTC (rev 345) +++ branches/1.5.0-pulse/library/classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php 2011-12-07 14:06:31 UTC (rev 346) @@ -154,6 +154,7 @@ 'formatFunction', $this->loader->getUtil()->getTranslated()->formatDate, 'default', MUtil_Date::format(new Zend_date(), 'dd-MM-yyyy')); $model->set('gr2t_reception_code'); + $model->set('gr2t_comment', 'label', $this->_('Comment')); return $model; } Modified: branches/1.5.0-pulse/library/configs/db/patches.sql =================================================================== --- branches/1.5.0-pulse/library/configs/db/patches.sql 2011-12-07 11:27:48 UTC (rev 345) +++ branches/1.5.0-pulse/library/configs/db/patches.sql 2011-12-07 14:06:31 UTC (rev 346) @@ -353,3 +353,7 @@ grc_changed, grc_changed_by, grc_created, grc_created_by) VALUES ('stop', 'Stop surveys', 0, 2, 0, 0, 0, 0, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + +-- GEMS VERSION: 43 +-- PATCH: Add comment field to respondent tracks +ALTER TABLE `gems__respondent2track` ADD gr2t_comment varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER `gr2t_reception_code`; Modified: branches/1.5.0-pulse/library/snippets/DeleteInSourceTrackSnippet.php =================================================================== --- branches/1.5.0-pulse/library/snippets/DeleteInSourceTrackSnippet.php 2011-12-07 11:27:48 UTC (rev 345) +++ branches/1.5.0-pulse/library/snippets/DeleteInSourceTrackSnippet.php 2011-12-07 14:06:31 UTC (rev 346) @@ -89,6 +89,9 @@ // The edit element $bridge->addList('gr2t_reception_code'); + + // Comment text + $bridge->addTextarea('gr2t_comment', 'rows', 3, 'cols', 50); // Change the button $this->saveLabel = $this->getTitle(); @@ -170,7 +173,7 @@ protected function saveData() { // Use the repesondent track function as that cascades the consent code - $changed = $this->respondentTrack->setReceptionCode($this->formData['gr2t_reception_code'], $this->_('Track deleted.'), $this->session->user_id); + $changed = $this->respondentTrack->setReceptionCode($this->formData['gr2t_reception_code'], $this->formData['gr2t_comment'], $this->session->user_id); // Tell the user what happened $this->afterSave($changed); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |