You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2013-03-18 13:14:15
|
Revision: 1190 http://sourceforge.net/p/gemstracker/code/1190 Author: matijsdejong Date: 2013-03-18 13:14:10 +0000 (Mon, 18 Mar 2013) Log Message: ----------- First working copy for SSN double input checks Modified Paths: -------------- trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php Modified: trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php 2013-03-18 12:58:11 UTC (rev 1189) +++ trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php 2013-03-18 13:14:10 UTC (rev 1190) @@ -47,6 +47,18 @@ class Gems_Snippets_RespondentFormSnippet extends Gems_Snippets_ModelFormSnippetGeneric { /** + * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * + * @var Gems_Loader + */ + protected $loader; + + /** * When true a tabbed form is used. * * @var boolean @@ -62,10 +74,66 @@ { parent::loadFormData(); - if ($this->createData && $this->request->isPost()) { + if ($this->request->isPost()) { if ((! $this->_saveButton) || (! $this->_saveButton->isChecked())) { if ($this->formData['grs_ssn']) { - // $this->formData['grs_first_name'] = 'Jan'; + $filter = array( + 'grs_ssn' => $this->formData['grs_ssn'], + 'gr2o_id_organization' => true, // Make sure all organisations are checked in RespModel + ); + + if ($this->formData['gr2o_id_organization']) { + $orgId = $this->formData['gr2o_id_organization']; + } else { + $orgId = $this->model->get('gr2o_id_organization', 'default'); + } + $order = array( + $this->db->quoteInto( + "CASE WHEN gr2o_id_organization = ? THEN 1 ELSE 2 END", + $orgId + ) => SORT_ASC + ); + + $data = $this->model->loadFirst($filter, $order); + + if ($data && (! isset($this->formData[$this->saveButtonId]))) { + // MUtil_Echo::track($this->formData); + // MUtil_Echo::track($data); + // Do not use this value + unset($data['grs_ssn']); + + if ($data['gr2o_id_organization'] == $orgId) { + // gr2o_patient_nr + // gr2o_id_organization + + $this->addMessage($this->_('Known respondent.')); + + //* + foreach ($data as $name => $value) { + if ((substr($name, 0, 4) == 'grs_') || (substr($name, 0, 5) == 'gr2o_')) { + if (array_key_exists($name, $this->formData)) { + $this->formData[$name] = $value; + } + $cname = $this->model->getKeyCopyName($name); + if (array_key_exists($cname, $this->formData)) { + $this->formData[$cname] = $value; + } + } + } // */ + } else { + $org = $this->loader->getOrganization($data['gr2o_id_organization']); + $this->addMessage(sprintf( + $this->_('Respondent data retrieved from %s.'), + $org->getName() + )); + + foreach ($data as $name => $value) { + if ((substr($name, 0, 4) == 'grs_') && array_key_exists($name, $this->formData)) { + $this->formData[$name] = $value; + } + } + } + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-18 12:58:16
|
Revision: 1189 http://sourceforge.net/p/gemstracker/code/1189 Author: mennodekker Date: 2013-03-18 12:58:11 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Old style tabforms (BrowseEditAction) had duplicate button row Modified Paths: -------------- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php trunk/library/classes/Gems/TabForm.php Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-18 12:24:26 UTC (rev 1188) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-18 12:58:11 UTC (rev 1189) @@ -200,7 +200,6 @@ ->removeDecorator('HtmlTag') ->removeDecorator('Label') ->removeDecorator('DtDdWrapper'); -; $this->_form->resetContext(); $this->_form->addElement($element); Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-18 12:24:26 UTC (rev 1188) +++ trunk/library/classes/Gems/TabForm.php 2013-03-18 12:58:11 UTC (rev 1189) @@ -111,8 +111,8 @@ $element = $this->getElement($name); } - $this->addToOtherGroup($element); - + //$this->addToOtherGroup($element); // Causes duplicate links on old browse edit + if ($element instanceof Zend_Form_Element_Hidden) { //Remove decorators $element->removeDecorator('HtmlTag'); @@ -122,6 +122,11 @@ } elseif ($element instanceof Zend_Form_Element) { $element->removeDecorator('DtDdWrapper'); + + if ($element instanceof MUtil_Form_Element_Html) { + $element->removeDecorator('HtmlTag'); + $element->removeDecorator('Label'); + } $error = $element->getDecorator('Errors'); if ($error instanceof Zend_Form_Decorator_Errors) { @@ -274,7 +279,7 @@ )); } } - + /** * Reset the currentTab to be the main form again * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-18 12:24:31
|
Revision: 1188 http://sourceforge.net/p/gemstracker/code/1188 Author: matijsdejong Date: 2013-03-18 12:24:26 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Multiple small implementation fixes Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/configs/db/tables/gems__roles.20.sql Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -130,7 +130,13 @@ { $filter = parent::_checkFilterUsed($filter); - if (! isset($filter['gr2o_id_organization'])) { + if (isset($filter['gr2o_id_organization'])) { + // Check for option to check for any organisation + if (true === $filter['gr2o_id_organization']) { + unset($filter['gr2o_id_organization']); + } + } else { + // Add the correct filter if ($this->isMultiOrganization() && !isset($filter['gr2o_patient_nr'])) { $allowed = $this->user->getAllowedOrganizations(); Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -109,7 +109,7 @@ */ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { - if (! $this->_form instanceof Gems_TabForm) { + if (! $bridge->getForm() instanceof Gems_TabForm) { parent::addFormElements($bridge, $model); return; } Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -167,10 +167,7 @@ $select->where($name . ' IS NULL'); } elseif (is_array($value)) { if ($value) { - foreach ($value as $sub) { - $subs[] = $adapter->quote($value); - } - $select->where($name . ' IN (' . implode(', ', $subs) . ')'); + $select->where($name . ' IN (' . $adapter->quote($value) . ')'); } else { // Never a result when a value should be one of an empty set. $select->where('1=0'); Modified: trunk/library/configs/db/tables/gems__roles.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__roles.20.sql 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/configs/db/tables/gems__roles.20.sql 2013-03-18 12:24:26 UTC (rev 1188) @@ -29,8 +29,8 @@ ('guest','guest','pr.ask,pr.contact.bugs,pr.contact.gems,pr.contact.support,pr.islogin,pr.respondent','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('respondent','respondent','','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('security','security','','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.setup,pr.staff,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('researcher','researcher','pr.project-information.changelog,pr.contact,pr.export,pr.plan.token,pr.plan.respondent,pr.plan.overview,pr.option.password,pr.option.edit,pr.organization-switch,pr.islogin','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.language,pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.respondent.multiorg,pr.role.create,pr.role.edit,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 15:49:51
|
Revision: 1187 http://sourceforge.net/p/gemstracker/code/1187 Author: matijsdejong Date: 2013-03-14 15:49:48 +0000 (Thu, 14 Mar 2013) Log Message: ----------- No need to add save button during form construction Modified Paths: -------------- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 15:44:54 UTC (rev 1186) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 15:49:48 UTC (rev 1187) @@ -245,17 +245,10 @@ protected function createForm($options = null) { if ($this->useTabbedForm) { - $form = new Gems_TabForm($options); - $this->_form = $form; - - //Now first add the saveButton as it needs to be outside the tabs - $this->addSaveButton(); - } else { - // $form = new Zend_Form($options); - $form = new Gems_Form($options); + return new Gems_TabForm($options); } - return $form; + return new Gems_Form($options); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 15:44:57
|
Revision: 1186 http://sourceforge.net/p/gemstracker/code/1186 Author: matijsdejong Date: 2013-03-14 15:44:54 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Enable 128 bit hashes for ssn Gems_Snippets_ModelFormSnippetAbstract can now switch between tabbed and non-tabbed mode New JavascriptArrayAttribute simplifies common javascript attribute commands Added onblur to text elements Allow algorithms in the project valueHash function Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentNewAction.php trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Model/RespondentNlModel.php trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php trunk/library/classes/MUtil/Model/FormBridge.php trunk/library/classes/MUtil/Validate/Db/UniqueValue.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__respondents.30.sql Added Paths: ----------- trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php trunk/library/classes/MUtil/Html/JavascriptArrayAttribute.php Modified: trunk/library/classes/Gems/Default/RespondentNewAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -56,14 +56,14 @@ * * @var array Mixed key => value array for snippet initialization */ - protected $createEditParameters = array('resetRoute' => true); + protected $createEditParameters = array('resetRoute' => true, 'useTabbedForm' => true); /** * The snippets used for the create and edit actions. * * @var mixed String or array of snippets name */ - protected $createEditSnippets = 'ModelTabFormSnippetGeneric'; + protected $createEditSnippets = 'RespondentFormSnippet'; /** * The snippets used for the delete action. Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -55,6 +55,15 @@ const SSN_OPEN = 2; /** + * Determines the algorithm used to hash the social security number + * + * Can be changed is derived classes, set to null to use old md5() method + * + * @var int One of the SSN_ constants + */ + public $hashAlgorithm = 'sha512'; + + /** * Determines how the social security number is stored. * * Can be changed is derived classes. @@ -75,6 +84,12 @@ protected $util; /** + * + * @var Zend_View + */ + public $view; + + /** * Self constructor */ public function __construct() @@ -314,7 +329,13 @@ $ucfirst = new Zend_Filter_Callback('ucfirst'); if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { - $this->set('grs_ssn', 'validator[]', $this->createUniqueValidator('grs_ssn')); + $onblur = new MUtil_Html_JavascriptArrayAttribute('onblur'); + $onblur->addSumbitOnChange('this.value'); + + $this->set('grs_ssn', + 'onblur', $onblur->render($this->view), // Render needed as element does not know HtmlInterface + 'validator[]', $this->createUniqueValidator('grs_ssn') + ); } $this->setIfExists('gr2o_patient_nr', @@ -394,7 +415,7 @@ public function applyHash(&$filterValue, $filterKey) { if ('grs_ssn' === $filterKey) { - $filterValue = $this->project->getValueHash($filterValue); + $filterValue = $this->project->getValueHash($filterValue, $this->hashAlgorithm); } } @@ -457,7 +478,7 @@ public function saveSSN($value, $isNew = false, $name = null, array $context = array()) { if ($value) { - return $this->project->getValueHash($value); + return $this->project->getValueHash($value, $this->hashAlgorithm); } } Modified: trunk/library/classes/Gems/Model/RespondentNlModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentNlModel.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Model/RespondentNlModel.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -103,10 +103,16 @@ { $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); + $match = '/[^0-9\*]/'; + /* + $m = preg_quote($model->hideSSN(true)); + $match = '/(?>(?(?=' . $m . ')(?!' . $m . ').|[^0-9]))/'; + MUtil_Echo::track($match); + // */ $model->set($fieldName, 'size', 10, 'maxlength', 12, - 'filter', 'Digits', + 'filter', new Zend_Filter_PregReplace(array('match' => $match)), 'validator[]', $bsn); if (APPLICATION_ENV !== 'production') { Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -94,10 +94,10 @@ } elseif (! is_array($array)) { $array = (array) $array; } - + // Now load default values for (new) keys and merge them with the ones provided by project.ini $projectValues = $array + $this->_getDefaultValues(); - + parent::__construct($projectValues, ArrayObject::ARRAY_AS_PROPS); if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { @@ -106,35 +106,35 @@ $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1)); } - + /** * Set the default values for all keys. - * - * By doing this, we make sure the settings show up in the project information + * + * By doing this, we make sure the settings show up in the project information * with the defaults even if the settings was not present in the project.ini */ public function _getDefaultValues() { - + return array( '>>> defaults <<<' => '>>> Below are default settings, since they were not found in your project.ini <<<', - + // What to do when user is going to or has answered a survey 'askNextDelay' => -1, // No auto advance 'askDelay' => -1, // No auto advance - + // How to react to false token attempts 'askThrottle' => array( 'period' => 15 * 60, // Detection window: 15 minutes 'threshold' => 15 * 20, // Threshold: 20 requests per minute 'delay' => 10 // Delay: 10 seconds ), - + 'cache' => 'apc', // Use apc cache as default - + 'organization' => array( 'default' => -1 // No default organization - ) + ) ); } @@ -309,8 +309,8 @@ return -1; } - + /** * Returns the public description of this project. * @@ -591,12 +591,13 @@ } /** - * Returns a salted hash on the + * Returns a salted hash optionally using the specified hash algorithm * * @param string $value The value to hash - * @return string The salted hash as a 32-character hexadecimal number. + * @param string $algoritm Optional, hash() algorithm; uses md5() otherwise + * @return string The salted hexadecimal hash, length depending on the algorithm (32 for md5, 128 for sha512. */ - public function getValueHash($value) + public function getValueHash($value, $algorithm = null) { $salt = $this->offsetExists('salt') ? $this->offsetGet('salt') : ''; @@ -607,8 +608,11 @@ } // MUtil_Echo::track($value, md5($salted)); + if (null == $algorithm) { + return md5($salted, false); + } - return md5($salted, false); + return hash($algorithm, $value, false); } /** Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -92,6 +92,98 @@ protected $routeAction = 'show'; /** + * When true a tabbed form is used. + * + * @var boolean + */ + protected $useTabbedForm = false; + + /** + * Adds elements from the model to the bridge that creates the form. + * + * Overrule this function to add different elements to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_FormBridge $bridge + * @param MUtil_Model_ModelAbstract $model + */ + protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) + { + if (! $this->_form instanceof Gems_TabForm) { + parent::addFormElements($bridge, $model); + return; + } + + //Get all elements in the model if not already done + $this->initItems(); + + // Add 'tooltip' to the allowed displayoptions + $displayOptions = $bridge->getAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS); + if (!array_search('tooltip', $displayOptions)) { + $displayOptions[] = 'tooltip'; + } + $bridge->setAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS, $displayOptions); + + $tab = 0; + $group = 0; + $oldTab = null; + // MUtil_Echo::track($model->getItemsOrdered()); + foreach ($model->getItemsOrdered() as $name) { + // Get all options at once + $modelOptions = $model->get($name); + $tabName = $model->get($name, 'tab'); + if ($tabName && ($tabName !== $oldTab)) { + $bridge->addTab('tab' . $tab, 'value', $tabName); + $oldTab = $tabName; + $tab++; + } + + if ($model->has($name, 'label')) { + $bridge->add($name); + + if ($theName = $model->get($name, 'startGroup')) { + //We start a new group here! + $groupElements = array(); + $groupElements[] = $name; + $groupName = $theName; + } elseif ($theName = $model->get($name, 'endGroup')) { + //Ok, last element define the group + $groupElements[] = $name; + $bridge->addDisplayGroup('grp_' . $groupElements[0], $groupElements, + 'description', $groupName, + 'showLabels', ($theName == 'showLabels'), + 'class', 'grp' . $group); + $group++; + unset($groupElements); + unset($groupName); + } else { + //If we are in a group, add the elements to the group + if (isset($groupElements)) { + $groupElements[] = $name; + } + } + } else { + $bridge->addHidden($name); + } + unset($this->_items[$name]); + } + } + + /** + * Simple default function for making sure there is a $this->_saveButton. + * + * As the save button is not part of the model - but of the interface - it + * does deserve it's own function. + */ + protected function addSaveButton() + { + if ($this->_form instanceof Gems_TabForm) { + $this->_form->resetContext(); + } + parent::addSaveButton(); + } + + /** * Perform some actions on the form, right before it is displayed but already populated * * Here we add the table display to the form. @@ -100,15 +192,36 @@ */ public function beforeDisplay() { - $table = new MUtil_Html_TableElement(array('class' => $this->class)); - $table->setAsFormLayout($this->_form, true, true); + if ($this->_form instanceof Gems_TabForm) { + if ($links = $this->getMenuList()) { + $element = new MUtil_Form_Element_Html('formLinks'); + $element->setValue($links) + ->setOrder(999) + ->removeDecorator('HtmlTag') + ->removeDecorator('Label') + ->removeDecorator('DtDdWrapper'); +; - // There is only one row with formLayout, so all in output fields get class. - $table['tbody'][0][0]->appendAttrib('class', $this->labelClass); + $this->_form->resetContext(); + $this->_form->addElement($element); - if ($links = $this->getMenuList()) { - $table->tf(); // Add empty cell, no label - $table->tf($links); + if (is_null($this->_form->getDisplayGroup(Gems_TabForm::GROUP_OTHER))) { + $this->_form->addDisplayGroup(array($element), Gems_TabForm::GROUP_OTHER); + } else { + $this->_form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->addElement($element); + } + } + } else { + $table = new MUtil_Html_TableElement(array('class' => $this->class)); + $table->setAsFormLayout($this->_form, true, true); + + // There is only one row with formLayout, so all in output fields get class. + $table['tbody'][0][0]->appendAttrib('class', $this->labelClass); + + if ($links = $this->getMenuList()) { + $table->tf(); // Add empty cell, no label + $table->tf($links); + } } } @@ -131,9 +244,17 @@ */ protected function createForm($options = null) { - // $form = new Zend_Form($options); - $form = new Gems_Form($options); + if ($this->useTabbedForm) { + $form = new Gems_TabForm($options); + $this->_form = $form; + //Now first add the saveButton as it needs to be outside the tabs + $this->addSaveButton(); + } else { + // $form = new Zend_Form($options); + $form = new Gems_Form($options); + } + return $form; } Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -48,134 +48,9 @@ class Gems_Snippets_ModelTabFormSnippetGeneric extends Gems_Snippets_ModelFormSnippetGeneric { /** + * When true a tabbed form is used. * - * @var Gems_TabForm + * @var boolean */ - protected $_form; - - /** - * Adds elements from the model to the bridge that creates the form. - * - * Overrule this function to add different elements to the browse table, without - * having to recode the core table building code. - * - * @param MUtil_Model_FormBridge $bridge - * @param MUtil_Model_ModelAbstract $model - */ - protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) - { - //Get all elements in the model if not already done - $this->initItems(); - - // Add 'tooltip' to the allowed displayoptions - $displayOptions = $bridge->getAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS); - if (!array_search('tooltip', $displayOptions)) { - $displayOptions[] = 'tooltip'; - } - $bridge->setAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS, $displayOptions); - - $tab = 0; - $group = 0; - $oldTab = null; - // MUtil_Echo::track($model->getItemsOrdered()); - foreach ($model->getItemsOrdered() as $name) { - // Get all options at once - $modelOptions = $model->get($name); - $tabName = $model->get($name, 'tab'); - if ($tabName && ($tabName !== $oldTab)) { - $bridge->addTab('tab' . $tab, 'value', $tabName); - $oldTab = $tabName; - $tab++; - } - - if ($model->has($name, 'label')) { - $bridge->add($name); - - if ($theName = $model->get($name, 'startGroup')) { - //We start a new group here! - $groupElements = array(); - $groupElements[] = $name; - $groupName = $theName; - } elseif ($theName = $model->get($name, 'endGroup')) { - //Ok, last element define the group - $groupElements[] = $name; - $bridge->addDisplayGroup('grp_' . $groupElements[0], $groupElements, - 'description', $groupName, - 'showLabels', ($theName == 'showLabels'), - 'class', 'grp' . $group); - $group++; - unset($groupElements); - unset($groupName); - } else { - //If we are in a group, add the elements to the group - if (isset($groupElements)) { - $groupElements[] = $name; - } - } - } else { - $bridge->addHidden($name); - } - unset($this->_items[$name]); - } - } - - /** - * Simple default function for making sure there is a $this->_saveButton. - * - * As the save button is not part of the model - but of the interface - it - * does deserve it's own function. - */ - protected function addSaveButton() - { - $this->_form->resetContext(); - parent::addSaveButton(); - } - - - /** - * Perform some actions on the form, right before it is displayed but already populated - * - * Here we add the table display to the form. - * - * @return Zend_Form - */ - public function beforeDisplay() - { - //If needed, add a row of link buttons to the bottom of the form - $form = $this->_form; - if ($links = $this->getMenuList()) { - $element = new MUtil_Form_Element_Html('formLinks'); - $element->setValue($links); - $element->setOrder(999); - if ($form instanceof Gems_TabForm) { - $form->resetContext(); - } - $form->addElement($element); - $element->removeDecorator('HtmlTag'); - $element->removeDecorator('Label'); - - if (is_null($form->getDisplayGroup(Gems_TabForm::GROUP_OTHER))) { - $form->addDisplayGroup(array($element), Gems_TabForm::GROUP_OTHER); - } else { - $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->addElement($element); - } - } - } - - /** - * Creates an empty form. Allows overruling in sub-classes. - * - * @param mixed $options - * @return Gems_TabForm - */ - protected function createForm($options = null) - { - $form = new Gems_TabForm($options); - $this->_form = $form; - - //Now first add the saveButton as it needs to be outside the tabs - $this->addSaveButton(); - - return $form; - } + protected $useTabbedForm = true; } \ No newline at end of file Added: trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/RespondentFormSnippet.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -0,0 +1,73 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: RespondentFormSnippet.php$ + */ + +/** + * + * + * @package Gems + * @subpackage + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Snippets_RespondentFormSnippet extends Gems_Snippets_ModelFormSnippetGeneric +{ + /** + * When true a tabbed form is used. + * + * @var boolean + */ + protected $useTabbedForm = true; + + /** + * Hook that loads the form data from $_POST or the model + * + * Or from whatever other source you specify here. + */ + protected function loadFormData() + { + parent::loadFormData(); + + if ($this->createData && $this->request->isPost()) { + if ((! $this->_saveButton) || (! $this->_saveButton->isChecked())) { + if ($this->formData['grs_ssn']) { + // $this->formData['grs_first_name'] = 'Jan'; + } + } + } + } +} Copied: trunk/library/classes/MUtil/Html/JavascriptArrayAttribute.php (from rev 1184, trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php) =================================================================== --- trunk/library/classes/MUtil/Html/JavascriptArrayAttribute.php (rev 0) +++ trunk/library/classes/MUtil/Html/JavascriptArrayAttribute.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -0,0 +1,167 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Default attribute for javascript attributes with extra functions for common tasks + * + * @package MUtil + * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version MUtil 1.2 + */ +class MUtil_Html_JavascriptArrayAttribute extends MUtil_Html_ArrayAttribute +{ + /** + * String used to glue items together + * + * Empty string as not each array element corresponds to a single command. + * + * @var string + */ + protected $_separator = ''; + + /** + * Specially treated types for a specific subclass + * + * @var array function name => class + */ + protected $_specialTypes = array( + 'addUrl' => 'MUtil_Html_UrlArrayAttribute', + ); + + /** + * + * @param string $type + * @param mixed $arg_array MUtil_Ra::args + */ + public function __construct($type, $arg_array = null) + { + $args = MUtil_Ra::args(func_get_args(), 1); + parent::__construct($type, 'javascript:', $args); + } + + /** + * Add a cancel bubble command + * + * @param boolean $cancelBubble + * @return MUtil_Html_JavascriptArrayAttribute (continuation pattern) + */ + public function addCancelBubble($cancelBubble = true) + { + if ($cancelBubble) { + $this->add("event.cancelBubble = true;"); + } else { + $this->add("event.cancelBubble = false;"); + } + return $this; + } + + /** + * Add single code line + * + * @param mixed $line + * @return MUtil_Html_JavascriptArrayAttribute (continuation pattern) + */ + public function addLine($line_args) + { + $lines = MUtil_Ra::flatten(func_get_args()); + + foreach ($lines as $line) { + $this->add($line); + } + if (! (isset($line) && (';' == substr($line, -1)))) { + $this->add(';'); + } + + return $this; + } + + /** + * Add a form submit + * + * @param string $condition Optional condition for submit + * @return \MUtil_Html_JavascriptArrayAttribute + */ + public function addSumbit($condition = null) + { + if ($condition) { + $this->add("if ($condition) {this.form.submit();}"); + } else { + $this->add('this.form.submit();'); + } + + return $this; + } + + /** + * Add a form submit when a value has changed + * + * @param string $condition Optional extra condition for submit + * @return \MUtil_Html_JavascriptArrayAttribute + */ + public function addSumbitOnChange($condition = null) + { + if ($condition) { + $this->add("if (($condition) && (this.getAttribute('value') != this.value)) {this.form.submit();}"); + } else { + $this->add("if (this.getAttribute('value') != this.value) {this.form.submit();}"); + } + + return $this; + } + + /** + * Add a url open command by specifying only the link + * + * @param mixed $href Anything, e.g. a MUtil_Html_UrlArrayAttribute that the code will transform to an url + * @return MUtil_Html_JavascriptArrayAttribute (continuation pattern) + */ + public function addUrl($href) + { + $last = is_array($this->_values) ? end($this->_values) : null; + if (false === strpos($last, 'location.href')) { + $this->_values[] = "location.href='"; + $this->_values[] = $href; + $this->_values[] = "';"; + } else { + $this->_values[] = $href; + } + + return $this; + } +} \ No newline at end of file Modified: trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php =================================================================== --- trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -43,28 +42,14 @@ * @subpackage Html * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 + * @since Class available since MUtil version 1.0 */ -class MUtil_Html_OnClickArrayAttribute extends MUtil_Html_ArrayAttribute +class MUtil_Html_OnClickArrayAttribute extends MUtil_Html_JavascriptArrayAttribute { /** - * String used to glue items together * - * Empty string as not each array element corresponds to a single command. - * - * @var string + * @param mixed $arg_array MUtil_Ra::args */ - protected $_separator = ''; - - /** - * Specially treated types for a specific subclass - * - * @var array function name => class - */ - protected $_specialTypes = array( - 'addUrl' => 'MUtil_Html_UrlArrayAttribute', - ); - public function __construct($arg_array = null) { $args = func_get_args(); @@ -72,41 +57,10 @@ } /** - * Add a cancel bubble command - * - * @param boolean $cancelBubble - * @return MUtil_Html_OnClickArrayAttribute (continuation pattern) + * + * @param array $commands + * @return \self */ - public function addCancelBubble($cancelBubble = true) - { - if ($cancelBubble) { - $this->add("event.cancelBubble = true;"); - } else { - $this->add("event.cancelBubble = false;"); - } - return $this; - } - - /** - * Add a url open command by specifying only the link - * - * @param mixed $href Anything, e.g. a MUtil_Html_UrlArrayAttribute that the code will transform to an url - * @return MUtil_Html_OnClickArrayAttribute (continuation pattern) - */ - public function addUrl($href) - { - $last = is_array($this->_values) ? end($this->_values) : null; - if (false === strpos($last, 'location.href')) { - $this->_values[] = "location.href='"; - $this->_values[] = $href; - $this->_values[] = "';"; - } else { - $this->_values[] = $href; - } - - return $this; - } - public static function onclickAttribute(array $commands = null) { return new self($commands); Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -95,7 +95,7 @@ self::MULTI_OPTIONS => array('disable', 'multiOptions', 'onchange', 'separator', 'size', 'disableTranslator'), self::PASSWORD_OPTIONS => array('repeatLabel'), self::TAB_OPTIONS => array('value'), - self::TEXT_OPTIONS => array('maxlength', 'minlength', 'onchange', 'onfocus', 'onselect', 'size'), + self::TEXT_OPTIONS => array('maxlength', 'minlength', 'onblur', 'onchange', 'onfocus', 'onselect', 'size'), self::TEXTAREA_OPTIONS => array('cols', 'rows', 'wrap'), ); Modified: trunk/library/classes/MUtil/Validate/Db/UniqueValue.php =================================================================== --- trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-14 15:44:54 UTC (rev 1186) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,22 +25,24 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** * - * @author Matijs de Jong - * @since 1.0 - * @version 1.1 - * @package MUtil + * + * @package MUtil * @subpackage Validate + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** - * - * @author Matijs de Jong - * @package MUtil + * Unique database validation with provision for the value not being changed + * + * @package MUtil * @subpackage Validate + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since MUtil version 1.0 */ class MUtil_Validate_Db_UniqueValue extends Zend_Validate_Db_NoRecordExists { Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/configs/db/patches.sql 2013-03-14 15:44:54 UTC (rev 1186) @@ -479,3 +479,7 @@ UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.contact.gems') WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.contact%'; + +-- PATCH: Longer SSN hashes +ALTER TABLE gems__respondents CHANGE grs_ssn + grs_ssn varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; Modified: trunk/library/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondents.30.sql 2013-03-14 13:44:56 UTC (rev 1185) +++ trunk/library/configs/db/tables/gems__respondents.30.sql 2013-03-14 15:44:54 UTC (rev 1186) @@ -2,7 +2,7 @@ CREATE TABLE if not exists gems__respondents ( grs_id_user bigint unsigned not null auto_increment references gems__user_ids (gui_id_user), - grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + grs_ssn varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null unique key, grs_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 13:45:00
|
Revision: 1185 http://sourceforge.net/p/gemstracker/code/1185 Author: matijsdejong Date: 2013-03-14 13:44:56 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Enable 128 bit hashes for ssn Modified Paths: -------------- trunk/new_project/application/configs/db/tables/gems__respondents.30.sql Modified: trunk/new_project/application/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/new_project/application/configs/db/tables/gems__respondents.30.sql 2013-03-14 11:52:00 UTC (rev 1184) +++ trunk/new_project/application/configs/db/tables/gems__respondents.30.sql 2013-03-14 13:44:56 UTC (rev 1185) @@ -2,7 +2,7 @@ CREATE TABLE if not exists gems__respondents ( grs_id_user bigint unsigned not null auto_increment references gems__user_ids (gui_id_user), - grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + grs_ssn varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null unique key, grs_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 11:52:03
|
Revision: 1184 http://sourceforge.net/p/gemstracker/code/1184 Author: matijsdejong Date: 2013-03-14 11:52:00 +0000 (Thu, 14 Mar 2013) Log Message: ----------- last table would not upload before Added Paths: ----------- trunk/new_project/application/configs/db/tables/gems__respondents.30.sql Added: trunk/new_project/application/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/new_project/application/configs/db/tables/gems__respondents.30.sql (rev 0) +++ trunk/new_project/application/configs/db/tables/gems__respondents.30.sql 2013-03-14 11:52:00 UTC (rev 1184) @@ -0,0 +1,40 @@ + +CREATE TABLE if not exists gems__respondents ( + grs_id_user bigint unsigned not null auto_increment references gems__user_ids (gui_id_user), + + grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + null unique key, + + grs_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en', + + grs_email varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + + grs_first_name varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_surname_prefix varchar(10) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_last_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_gender char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + not null default 'U', + grs_birthday date, + + grs_address_1 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + -- grs_address_2 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_zipcode varchar(10) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_city varchar(40) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + -- grs_region varchar(40) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + grs_iso_country char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'NL', + grs_phone_1 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + -- grs_phone_2 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + -- grs_phone_3 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + + grs_changed timestamp not null default current_timestamp on update current_timestamp, + grs_changed_by bigint unsigned not null, + grs_created timestamp not null, + grs_created_by bigint unsigned not null, + + PRIMARY KEY(grs_id_user), + INDEX (grs_email) + ) + ENGINE=InnoDB + AUTO_INCREMENT = 30001 + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 11:45:15
|
Revision: 1183 http://sourceforge.net/p/gemstracker/code/1183 Author: matijsdejong Date: 2013-03-14 11:45:12 +0000 (Thu, 14 Mar 2013) Log Message: ----------- The default GemsTracker installation is now international The default NewProject is setup for Dutch respondents Modified Paths: -------------- trunk/library/configs/db/tables/gems__respondent2org.50.sql trunk/library/configs/db/tables/gems__respondents.30.sql trunk/library/controllers/RespondentController.php Added Paths: ----------- trunk/new_project/application/classes/NewProject/Model/ trunk/new_project/application/classes/NewProject/Model/RespondentModel.php trunk/new_project/application/configs/db/ trunk/new_project/application/configs/db/tables/ Modified: trunk/library/configs/db/tables/gems__respondent2org.50.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-14 11:27:20 UTC (rev 1182) +++ trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-14 11:45:12 UTC (rev 1183) @@ -10,7 +10,7 @@ -- gr2o_id_physician bigint unsigned null -- references gems_staff (gsf_id_user), - gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + -- gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gr2o_consent varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'Unknown' Modified: trunk/library/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondents.30.sql 2013-03-14 11:27:20 UTC (rev 1182) +++ trunk/library/configs/db/tables/gems__respondents.30.sql 2013-03-14 11:45:12 UTC (rev 1183) @@ -10,7 +10,7 @@ grs_email varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, grs_first_name varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', - grs_surname_prefix varchar(10) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + -- grs_surname_prefix varchar(10) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_last_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_gender char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'U', Modified: trunk/library/controllers/RespondentController.php =================================================================== --- trunk/library/controllers/RespondentController.php 2013-03-14 11:27:20 UTC (rev 1182) +++ trunk/library/controllers/RespondentController.php 2013-03-14 11:45:12 UTC (rev 1183) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,8 +25,23 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ -class RespondentController extends Gems_Default_RespondentAction +/** + * Stub for RespondentNewAction, that allows overrulling of this controller in a project. + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 + */ +class RespondentController extends Gems_Default_RespondentNewAction { } \ No newline at end of file Added: trunk/new_project/application/classes/NewProject/Model/RespondentModel.php =================================================================== --- trunk/new_project/application/classes/NewProject/Model/RespondentModel.php (rev 0) +++ trunk/new_project/application/classes/NewProject/Model/RespondentModel.php 2013-03-14 11:45:12 UTC (rev 1183) @@ -0,0 +1,77 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Model + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: RespondentModel.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Default inmplementation of Dutch respondent model + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class NewProject_Model_RespondentModel extends Gems_Model_RespondentNlModel +{ + /** + * Set those settings needed for the detailed display + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyDetailSettings($locale = null) + { + parent::applyDetailSettings($locale); + + // $translator = $this->translate->getAdapter(); + // $this->setIfExists('grs_phone_2', 'label', $translator->_('Mobile phone')); + + return $this; + } + + /** + * Set those values needed for editing + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + * / + public function applyEditSettings($locale = null) + { + parent::applyEditSettings($locale); + + return $this; + } // */ +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 11:27:23
|
Revision: 1182 http://sourceforge.net/p/gemstracker/code/1182 Author: mennodekker Date: 2013-03-14 11:27:20 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Added a field to track-maintenance -> show to display what group should answer the survey Modified Paths: -------------- trunk/library/classes/Gems/Default/TrackMaintenanceAction.php trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php trunk/library/classes/Gems/Tracker/Engine/TrackEngineInterface.php Modified: trunk/library/classes/Gems/Default/TrackMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/TrackMaintenanceAction.php 2013-03-14 11:05:26 UTC (rev 1181) +++ trunk/library/classes/Gems/Default/TrackMaintenanceAction.php 2013-03-14 11:27:20 UTC (rev 1182) @@ -309,6 +309,8 @@ $trackId = $this->_getIdParam(); $engine = $tracker->getTrackEngine($trackId); $model = $engine->getRoundModel(false, $action); + $model->addLeftTable('gems__surveys', array('gro_id_survey' => 'gsu_id_survey')); + $model->set('gsu_id_primary_group', 'label', $this->_('Group'), 'multiOptions', $this->util->getDbLookup()->getGroups()); } break; case "fields": { Modified: trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2013-03-14 11:05:26 UTC (rev 1181) +++ trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2013-03-14 11:27:20 UTC (rev 1182) @@ -425,12 +425,11 @@ /** * Create model for rounds. Allowes overriding by sub classes. * - * @return MUtil_Model_ModelAbstract + * @return Gems_Model_JoinModel */ protected function createRoundModel() { - $model = new MUtil_Model_TableModel('gems__rounds'); - Gems_Model::setChangeFieldsByPrefix($model, 'gro'); + $model = new Gems_Model_JoinModel('rounds', 'gems__rounds', 'gro'); return $model; } Modified: trunk/library/classes/Gems/Tracker/Engine/TrackEngineInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/TrackEngineInterface.php 2013-03-14 11:05:26 UTC (rev 1181) +++ trunk/library/classes/Gems/Tracker/Engine/TrackEngineInterface.php 2013-03-14 11:27:20 UTC (rev 1182) @@ -215,7 +215,7 @@ * * @param boolean $detailed Create a model for the display of detailed item data or just a browse table * @param string $action The current action - * @return MUtil_Model_ModelAbstract + * @return Gems_Model_JoinModel */ public function getRoundModel($detailed, $action); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 11:05:30
|
Revision: 1181 http://sourceforge.net/p/gemstracker/code/1181 Author: mennodekker Date: 2013-03-14 11:05:26 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Made default values for project.ini settings visible in project information Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php trunk/new_project/application/configs/project.ini Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2013-03-14 10:43:13 UTC (rev 1180) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2013-03-14 11:05:26 UTC (rev 1181) @@ -94,15 +94,49 @@ } elseif (! is_array($array)) { $array = (array) $array; } + + // Now load default values for (new) keys and merge them with the ones provided by project.ini + $projectValues = $array + $this->_getDefaultValues(); + + parent::__construct($projectValues, ArrayObject::ARRAY_AS_PROPS); - parent::__construct($array, ArrayObject::ARRAY_AS_PROPS); - if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { $this->offsetSet('name', GEMS_PROJECT_NAME); } $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1)); } + + /** + * Set the default values for all keys. + * + * By doing this, we make sure the settings show up in the project information + * with the defaults even if the settings was not present in the project.ini + */ + public function _getDefaultValues() + { + + return array( + '>>> defaults <<<' => '>>> Below are default settings, since they were not found in your project.ini <<<', + + // What to do when user is going to or has answered a survey + 'askNextDelay' => -1, // No auto advance + 'askDelay' => -1, // No auto advance + + // How to react to false token attempts + 'askThrottle' => array( + 'period' => 15 * 60, // Detection window: 15 minutes + 'threshold' => 15 * 20, // Threshold: 20 requests per minute + 'delay' => 10 // Delay: 10 seconds + ), + + 'cache' => 'apc', // Use apc cache as default + + 'organization' => array( + 'default' => -1 // No default organization + ) + ); + } /** * Add recursively the rules active for this specific set of codes. @@ -275,8 +309,8 @@ return -1; } + - /** * Returns the public description of this project. * Modified: trunk/new_project/application/configs/project.ini =================================================================== --- trunk/new_project/application/configs/project.ini 2013-03-14 10:43:13 UTC (rev 1180) +++ trunk/new_project/application/configs/project.ini 2013-03-14 11:05:26 UTC (rev 1181) @@ -87,7 +87,7 @@ ; ; askDelay ; -; When no askDelay is specified the user will see +; When no askDelay is specified or is -1 the user will see ; greeting screen were he or she will a have to click ; on a button to fill in a survey. ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 10:43:18
|
Revision: 1180 http://sourceforge.net/p/gemstracker/code/1180 Author: matijsdejong Date: 2013-03-14 10:43:13 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Fix for incorrect array display in project.ini Modified Paths: -------------- trunk/library/classes/MUtil/Html/TableElement.php Modified: trunk/library/classes/MUtil/Html/TableElement.php =================================================================== --- trunk/library/classes/MUtil/Html/TableElement.php 2013-03-14 08:54:48 UTC (rev 1179) +++ trunk/library/classes/MUtil/Html/TableElement.php 2013-03-14 10:43:13 UTC (rev 1180) @@ -428,7 +428,7 @@ // Check all items foreach ($data as $row) { - if (count($row) !== $count) { + if (is_array($row) || (count($row) !== $count)) { $nested = false; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 08:54:51
|
Revision: 1179 http://sourceforge.net/p/gemstracker/code/1179 Author: mennodekker Date: 2013-03-14 08:54:48 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Added missing gtr_completed_event in patch 48, so the alter statement in patch 49 will work Modified Paths: -------------- trunk/library/configs/db/patches.sql Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2013-03-14 08:42:54 UTC (rev 1178) +++ trunk/library/configs/db/patches.sql 2013-03-14 08:54:48 UTC (rev 1179) @@ -421,6 +421,9 @@ -- PATCH: Assign deletion of track parts to super role UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.track-maintenance.delete') WHERE grl_privileges NOT LIKE '%pr.track-maintenance.edit%' AND grl_privileges NOT LIKE '%pr.track-maintenance.delete%'; +-- PATCH: Add track completion event +ALTER TABLE `gems__tracks` ADD gtr_completed_event varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; + -- GEMS VERSION: 49 -- PATCH: Speed up show respondent ALTER TABLE `gems__respondent2org` ADD INDEX ( `gr2o_reception_code` ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-14 08:42:57
|
Revision: 1178 http://sourceforge.net/p/gemstracker/code/1178 Author: mennodekker Date: 2013-03-14 08:42:54 +0000 (Thu, 14 Mar 2013) Log Message: ----------- Hidden elements should go into the subform so they are available for validation Modified Paths: -------------- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Validate/Db/UniqueValue.php Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-13 16:12:06 UTC (rev 1177) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-14 08:42:54 UTC (rev 1178) @@ -153,8 +153,12 @@ $form->addElement($element); $element->removeDecorator('HtmlTag'); $element->removeDecorator('Label'); - $form->addDisplayGroup(array('formLinks'), 'form_buttons'); - $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->removeElement($element->getName()); + + if (is_null($form->getDisplayGroup(Gems_TabForm::GROUP_OTHER))) { + $form->addDisplayGroup(array($element), Gems_TabForm::GROUP_OTHER); + } else { + $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->addElement($element); + } } } Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-13 16:12:06 UTC (rev 1177) +++ trunk/library/classes/Gems/TabForm.php 2013-03-14 08:42:54 UTC (rev 1178) @@ -102,27 +102,13 @@ */ public function addElement($element, $name = null, $options = null) { - if ($element instanceof Zend_Form_Element_Hidden) { - parent::addElement($element, $name, $options); - - //Remove decorators - $element->removeDecorator('HtmlTag'); - $element->removeDecorator('Label'); - - $this->addToOtherGroup($element); - - $element->removeDecorator('DtDdWrapper'); - - return $this; - } - if ($this->currentTab) { return $this->currentTab->addElement($element, $name, $options); } else { parent::addElement($element, $name, $options); if (is_string($element)) { - $element = $this->getElement($element); + $element = $this->getElement($name); } $this->addToOtherGroup($element); Modified: trunk/library/classes/MUtil/Validate/Db/UniqueValue.php =================================================================== --- trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-13 16:12:06 UTC (rev 1177) +++ trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-14 08:42:54 UTC (rev 1178) @@ -108,8 +108,7 @@ public function isValid($value, $context = array()) { - // Quick fix for context not being complete in subform - $context = $context + $_POST; + $context = $context; /** * Check for an adapter being defined. if not, fetch the default adapter. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-13 16:12:11
|
Revision: 1177 http://sourceforge.net/p/gemstracker/code/1177 Author: matijsdejong Date: 2013-03-13 16:12:06 +0000 (Wed, 13 Mar 2013) Log Message: ----------- Display fix Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-13 15:50:28 UTC (rev 1176) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-13 16:12:06 UTC (rev 1177) @@ -224,18 +224,18 @@ $this->resetOrder(); if ($this->has('gr2o_id_organization')) { + $user = $this->loader->getCurrentUser(); + $this->set('gr2o_id_organization', 'label', $translator->_('Organization'), - 'tab', $translator->_('Identification') + 'tab', $translator->_('Identification'), + 'multiOptions', $user->getRespondentOrganizations() ); - if ($this->isMultiOrganization()) { - $user = $this->loader->getCurrentUser(); + $this->set('gr2o_id_organization', 'default', $user->getCurrentOrganizationId()); - $this->set('gr2o_id_organization', - 'default', $user->getCurrentOrganizationId(), - 'multiOptions', $user->getRespondentOrganizations() - ); + if (count($user->getAllowedOrganizations()) == 1) { + $this->set('gr2o_id_organization', 'elementClass', 'Exhibitor'); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-13 15:50:31
|
Revision: 1176 http://sourceforge.net/p/gemstracker/code/1176 Author: matijsdejong Date: 2013-03-13 15:50:28 +0000 (Wed, 13 Mar 2013) Log Message: ----------- Updated translations Modified Paths: -------------- 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/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-03-13 15:48:13 UTC (rev 1175) +++ trunk/library/languages/default-en.po 2013-03-13 15:50:28 UTC (rev 1176) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-07 18:05+0100\n" +"POT-Creation-Date: 2013-03-13 16:39+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -445,7 +445,7 @@ #: classes/Gems/Default/MailJobAction.php:98 #: classes/Gems/Default/StaffAction.php:347 #: classes/Gems/Model/RespondentModel.php:174 -#: classes/Gems/Model/RespondentModel.php:227 +#: classes/Gems/Model/RespondentModel.php:228 #: classes/Gems/Snippets/Export/ReportHeaderSnippet.php:63 #: classes/Gems/User/Form/LayeredLoginForm.php:254 #: classes/Gems/User/Form/OrganizationFormAbstract.php:166 @@ -454,43 +454,43 @@ msgstr "Organization" #: classes/Gems/Model.php:217 classes/Gems/Model/RespondentModel.php:202 -#: classes/Gems/Model/RespondentModel.php:274 +#: classes/Gems/Model/RespondentModel.php:294 msgid "Opened" msgstr "Opened" #: classes/Gems/Model.php:218 classes/Gems/Model/RespondentModel.php:205 -#: classes/Gems/Model/RespondentModel.php:279 +#: classes/Gems/Model/RespondentModel.php:289 msgid "Consent" msgstr "Consent" #: classes/Gems/Model.php:220 classes/Gems/Default/OptionAction.php:130 #: classes/Gems/Default/StaffAction.php:337 #: classes/Gems/Model/RespondentModel.php:189 -#: classes/Gems/Model/RespondentModel.php:260 +#: classes/Gems/Model/RespondentModel.php:267 msgid "E-Mail" msgstr "E-Mail" #: classes/Gems/Model.php:225 classes/Gems/Default/OptionAction.php:134 #: classes/Gems/Default/StaffAction.php:350 -#: classes/Gems/Model/RespondentModel.php:256 +#: classes/Gems/Model/RespondentModel.php:255 msgid "Gender" msgstr "Gender" #: classes/Gems/Model.php:226 classes/Gems/Default/OptionAction.php:131 #: classes/Gems/Default/StaffAction.php:192 -#: classes/Gems/Model/RespondentModel.php:248 +#: classes/Gems/Model/RespondentModel.php:251 msgid "First name" msgstr "First name" #: classes/Gems/Model.php:227 classes/Gems/Default/OptionAction.php:132 #: classes/Gems/Default/StaffAction.php:194 -#: classes/Gems/Model/RespondentModel.php:250 +#: classes/Gems/Model/RespondentNlModel.php:64 msgid "Surname prefix" msgstr "Surname prefix" #: classes/Gems/Model.php:228 classes/Gems/Default/OptionAction.php:133 #: classes/Gems/Default/StaffAction.php:195 -#: classes/Gems/Model/RespondentModel.php:253 +#: classes/Gems/Model/RespondentModel.php:252 msgid "Last name" msgstr "Last name" @@ -512,31 +512,31 @@ msgstr "Name" #: classes/Gems/Model.php:234 classes/Gems/Model/RespondentModel.php:191 -#: classes/Gems/Model/RespondentModel.php:262 +#: classes/Gems/Model/RespondentModel.php:270 msgid "Street" msgstr "Street" #: classes/Gems/Model.php:235 classes/Gems/Model/RespondentModel.php:192 -#: classes/Gems/Model/RespondentModel.php:263 +#: classes/Gems/Model/RespondentModel.php:276 msgid "Zipcode" msgstr "Zipcode" #: classes/Gems/Model.php:236 #: classes/Gems/Default/RespondentPlanAction.php:134 #: classes/Gems/Model/RespondentModel.php:193 -#: classes/Gems/Model/RespondentModel.php:264 +#: classes/Gems/Model/RespondentModel.php:277 msgid "City" msgstr "City" #: classes/Gems/Model.php:238 classes/Gems/Model/RespondentModel.php:195 -#: classes/Gems/Model/RespondentModel.php:266 +#: classes/Gems/Model/RespondentModel.php:281 msgid "Phone" msgstr "Phone" #: classes/Gems/Model.php:240 #: classes/Gems/Default/RespondentPlanAction.php:133 #: classes/Gems/Model/RespondentModel.php:198 -#: classes/Gems/Model/RespondentModel.php:269 +#: classes/Gems/Model/RespondentModel.php:260 msgid "Birthday" msgstr "Birthday" @@ -1909,6 +1909,7 @@ #: classes/Gems/Default/OrganizationAction.php:147 #: classes/Gems/Default/RespondentAction.php:195 #: classes/Gems/Default/StaffAction.php:359 +#: classes/Gems/Model/RespondentModel.php:285 msgid "Language" msgstr "Language" @@ -2342,23 +2343,25 @@ msgstr[1] "reception codes" #: classes/Gems/Default/RespondentAction.php:127 -#: classes/Gems/Model/RespondentModel.php:320 +#: classes/Gems/Model/RespondentNlModel.php:119 #, php-format msgid "Random Example BSN: %s" msgstr "Random Example BSN: %s" #: classes/Gems/Default/RespondentAction.php:129 -#: classes/Gems/Model/RespondentModel.php:322 +#: classes/Gems/Model/RespondentNlModel.php:121 msgid "Enter a 9-digit SSN number." msgstr "Enter a 9-digit BSN number." #: classes/Gems/Default/RespondentAction.php:143 -#: classes/Gems/Model/RespondentModel.php:228 +#: classes/Gems/Model/RespondentModel.php:229 +#: classes/Gems/Model/RespondentModel.php:245 +#: classes/Gems/Model/RespondentModel.php:249 msgid "Identification" msgstr "Identification" #: classes/Gems/Default/RespondentAction.php:154 -#: classes/Gems/Model/RespondentModel.php:243 +#: classes/Gems/Model/RespondentModel.php:244 msgid "SSN" msgstr "BSN" @@ -2367,46 +2370,54 @@ msgstr "Patient number" #: classes/Gems/Default/RespondentAction.php:167 -#: classes/Gems/Model/RespondentModel.php:342 +#: classes/Gems/Model/RespondentModel.php:352 msgid "Medical data" msgstr "Medical data" #: classes/Gems/Default/RespondentAction.php:174 +#: classes/Gems/Model/RespondentNlModel.php:88 msgid "DBC's, etc..." msgstr "DBC's, etc..." #: classes/Gems/Default/RespondentAction.php:177 +#: classes/Gems/Model/RespondentModel.php:268 msgid "Contact information" msgstr "Contact information" #: classes/Gems/Default/RespondentAction.php:182 +#: classes/Gems/Model/RespondentModel.php:335 +#: classes/Gems/Model/RespondentModel.php:339 msgid "Respondent has no e-mail" msgstr "Patient has no e-mail" #: classes/Gems/Default/RespondentAction.php:183 +#: classes/Gems/Model/RespondentModel.php:365 msgid "With housenumber" msgstr "With housenumber" #: classes/Gems/Default/RespondentAction.php:190 +#: classes/Gems/Model/RespondentModel.php:278 msgid "Country" msgstr "Country" #: classes/Gems/Default/RespondentAction.php:194 +#: classes/Gems/Model/RespondentModel.php:287 msgid "Settings" msgstr "Settings" #: classes/Gems/Default/RespondentAction.php:196 +#: classes/Gems/Model/RespondentModel.php:380 msgid "Has the respondent signed the informed consent letter?" msgstr "Has the patient signed the informed consent letter?" #: classes/Gems/Default/RespondentAction.php:228 -#: classes/Gems/Model/RespondentModel.php:283 +#: classes/Gems/Model/RespondentModel.php:265 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Comments" #: classes/Gems/Default/RespondentAction.php:229 -#: classes/Gems/Model/RespondentModel.php:284 +#: classes/Gems/Model/RespondentModel.php:264 msgid "Treatment" msgstr "Treatment" @@ -3170,7 +3181,7 @@ msgstr "Token planning" #: classes/Gems/Default/TrackAction.php:121 -#: classes/Gems/Model/RespondentModel.php:246 +#: classes/Gems/Model/RespondentModel.php:248 #: snippets/DeleteInSourceTrackSnippet.php:82 snippets/EditTrackSnippet.php:72 msgid "Respondent number" msgstr "Patient number" @@ -3941,10 +3952,26 @@ msgid "No script for %1$s." msgstr "No script for %1$s." -#: classes/Gems/Model/RespondentModel.php:251 +#: classes/Gems/Model/RespondentModel.php:271 +msgid " " +msgstr " " + +#: classes/Gems/Model/RespondentModel.php:282 +msgid "Phone 2" +msgstr "Phone 2" + +#: classes/Gems/Model/RespondentModel.php:283 +msgid "Phone 3" +msgstr "Phone 3" + +#: classes/Gems/Model/RespondentNlModel.php:65 msgid "de, van der, 't, etc..." msgstr "de, van der, 't, etc..." +#: classes/Gems/Model/RespondentNlModel.php:136 +msgid "E.g.: 0000 AA" +msgstr "E.g.: 0000 AA" + #: classes/Gems/Selector/DateSelectorAbstract.php:309 msgid "<<" msgstr "<<" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-03-13 15:48:13 UTC (rev 1175) +++ trunk/library/languages/default-nl.po 2013-03-13 15:50:28 UTC (rev 1176) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-07 18:05+0100\n" +"POT-Creation-Date: 2013-03-13 16:40+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -445,7 +445,7 @@ #: classes/Gems/Default/MailJobAction.php:98 #: classes/Gems/Default/StaffAction.php:347 #: classes/Gems/Model/RespondentModel.php:174 -#: classes/Gems/Model/RespondentModel.php:227 +#: classes/Gems/Model/RespondentModel.php:228 #: classes/Gems/Snippets/Export/ReportHeaderSnippet.php:63 #: classes/Gems/User/Form/LayeredLoginForm.php:254 #: classes/Gems/User/Form/OrganizationFormAbstract.php:166 @@ -454,43 +454,43 @@ msgstr "Organisatie" #: classes/Gems/Model.php:217 classes/Gems/Model/RespondentModel.php:202 -#: classes/Gems/Model/RespondentModel.php:274 +#: classes/Gems/Model/RespondentModel.php:294 msgid "Opened" msgstr "Bekeken op" #: classes/Gems/Model.php:218 classes/Gems/Model/RespondentModel.php:205 -#: classes/Gems/Model/RespondentModel.php:279 +#: classes/Gems/Model/RespondentModel.php:289 msgid "Consent" msgstr "Toestemming" #: classes/Gems/Model.php:220 classes/Gems/Default/OptionAction.php:130 #: classes/Gems/Default/StaffAction.php:337 #: classes/Gems/Model/RespondentModel.php:189 -#: classes/Gems/Model/RespondentModel.php:260 +#: classes/Gems/Model/RespondentModel.php:267 msgid "E-Mail" msgstr "Email" #: classes/Gems/Model.php:225 classes/Gems/Default/OptionAction.php:134 #: classes/Gems/Default/StaffAction.php:350 -#: classes/Gems/Model/RespondentModel.php:256 +#: classes/Gems/Model/RespondentModel.php:255 msgid "Gender" msgstr "Geslacht" #: classes/Gems/Model.php:226 classes/Gems/Default/OptionAction.php:131 #: classes/Gems/Default/StaffAction.php:192 -#: classes/Gems/Model/RespondentModel.php:248 +#: classes/Gems/Model/RespondentModel.php:251 msgid "First name" msgstr "Voornaam" #: classes/Gems/Model.php:227 classes/Gems/Default/OptionAction.php:132 #: classes/Gems/Default/StaffAction.php:194 -#: classes/Gems/Model/RespondentModel.php:250 +#: classes/Gems/Model/RespondentNlModel.php:64 msgid "Surname prefix" msgstr "Tussenvoegsel" #: classes/Gems/Model.php:228 classes/Gems/Default/OptionAction.php:133 #: classes/Gems/Default/StaffAction.php:195 -#: classes/Gems/Model/RespondentModel.php:253 +#: classes/Gems/Model/RespondentModel.php:252 msgid "Last name" msgstr "Achternaam" @@ -512,31 +512,31 @@ msgstr "Naam" #: classes/Gems/Model.php:234 classes/Gems/Model/RespondentModel.php:191 -#: classes/Gems/Model/RespondentModel.php:262 +#: classes/Gems/Model/RespondentModel.php:270 msgid "Street" msgstr "Straat" #: classes/Gems/Model.php:235 classes/Gems/Model/RespondentModel.php:192 -#: classes/Gems/Model/RespondentModel.php:263 +#: classes/Gems/Model/RespondentModel.php:276 msgid "Zipcode" msgstr "Postcode" #: classes/Gems/Model.php:236 #: classes/Gems/Default/RespondentPlanAction.php:134 #: classes/Gems/Model/RespondentModel.php:193 -#: classes/Gems/Model/RespondentModel.php:264 +#: classes/Gems/Model/RespondentModel.php:277 msgid "City" msgstr "Woonplaats" #: classes/Gems/Model.php:238 classes/Gems/Model/RespondentModel.php:195 -#: classes/Gems/Model/RespondentModel.php:266 +#: classes/Gems/Model/RespondentModel.php:281 msgid "Phone" msgstr "Telefoon" #: classes/Gems/Model.php:240 #: classes/Gems/Default/RespondentPlanAction.php:133 #: classes/Gems/Model/RespondentModel.php:198 -#: classes/Gems/Model/RespondentModel.php:269 +#: classes/Gems/Model/RespondentModel.php:260 msgid "Birthday" msgstr "Geboren op" @@ -1916,6 +1916,7 @@ #: classes/Gems/Default/OrganizationAction.php:147 #: classes/Gems/Default/RespondentAction.php:195 #: classes/Gems/Default/StaffAction.php:359 +#: classes/Gems/Model/RespondentModel.php:285 msgid "Language" msgstr "Taal" @@ -2351,23 +2352,25 @@ msgstr[1] "Ontvangst code" #: classes/Gems/Default/RespondentAction.php:127 -#: classes/Gems/Model/RespondentModel.php:320 +#: classes/Gems/Model/RespondentNlModel.php:119 #, php-format msgid "Random Example BSN: %s" msgstr "Willekeurig voorbeeld BSN: %s" #: classes/Gems/Default/RespondentAction.php:129 -#: classes/Gems/Model/RespondentModel.php:322 +#: classes/Gems/Model/RespondentNlModel.php:121 msgid "Enter a 9-digit SSN number." msgstr "Voer een BSN nummer van 9 cijfers in." #: classes/Gems/Default/RespondentAction.php:143 -#: classes/Gems/Model/RespondentModel.php:228 +#: classes/Gems/Model/RespondentModel.php:229 +#: classes/Gems/Model/RespondentModel.php:245 +#: classes/Gems/Model/RespondentModel.php:249 msgid "Identification" msgstr "Identificatie" #: classes/Gems/Default/RespondentAction.php:154 -#: classes/Gems/Model/RespondentModel.php:243 +#: classes/Gems/Model/RespondentModel.php:244 msgid "SSN" msgstr "BSN" @@ -2376,46 +2379,54 @@ msgstr "Patiënt nummer" #: classes/Gems/Default/RespondentAction.php:167 -#: classes/Gems/Model/RespondentModel.php:342 +#: classes/Gems/Model/RespondentModel.php:352 msgid "Medical data" msgstr "Medische gegevens" #: classes/Gems/Default/RespondentAction.php:174 +#: classes/Gems/Model/RespondentNlModel.php:88 msgid "DBC's, etc..." msgstr "DBC's, etc..." #: classes/Gems/Default/RespondentAction.php:177 +#: classes/Gems/Model/RespondentModel.php:268 msgid "Contact information" msgstr "Contact informatie" #: classes/Gems/Default/RespondentAction.php:182 +#: classes/Gems/Model/RespondentModel.php:335 +#: classes/Gems/Model/RespondentModel.php:339 msgid "Respondent has no e-mail" msgstr "Patiënt zonder email" #: classes/Gems/Default/RespondentAction.php:183 +#: classes/Gems/Model/RespondentModel.php:365 msgid "With housenumber" msgstr "Met huisnummer" #: classes/Gems/Default/RespondentAction.php:190 +#: classes/Gems/Model/RespondentModel.php:278 msgid "Country" msgstr "Land" #: classes/Gems/Default/RespondentAction.php:194 +#: classes/Gems/Model/RespondentModel.php:287 msgid "Settings" msgstr "Instellingen" #: classes/Gems/Default/RespondentAction.php:196 +#: classes/Gems/Model/RespondentModel.php:380 msgid "Has the respondent signed the informed consent letter?" msgstr "Heeft de patiënt het \"informed consent\" formulier ondertekend?" #: classes/Gems/Default/RespondentAction.php:228 -#: classes/Gems/Model/RespondentModel.php:283 +#: classes/Gems/Model/RespondentModel.php:265 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Opmerkingen" #: classes/Gems/Default/RespondentAction.php:229 -#: classes/Gems/Model/RespondentModel.php:284 +#: classes/Gems/Model/RespondentModel.php:264 msgid "Treatment" msgstr "Behandeling" @@ -3189,7 +3200,7 @@ msgstr "Per kenmerk plannen" #: classes/Gems/Default/TrackAction.php:121 -#: classes/Gems/Model/RespondentModel.php:246 +#: classes/Gems/Model/RespondentModel.php:248 #: snippets/DeleteInSourceTrackSnippet.php:82 snippets/EditTrackSnippet.php:72 msgid "Respondent number" msgstr "Patiënt nummer" @@ -3969,10 +3980,26 @@ msgid "No script for %1$s." msgstr "Geen script voor %1$s:" -#: classes/Gems/Model/RespondentModel.php:251 +#: classes/Gems/Model/RespondentModel.php:271 +msgid " " +msgstr " " + +#: classes/Gems/Model/RespondentModel.php:282 +msgid "Phone 2" +msgstr "Telefoon 2" + +#: classes/Gems/Model/RespondentModel.php:283 +msgid "Phone 3" +msgstr "Telefoon 3" + +#: classes/Gems/Model/RespondentNlModel.php:65 msgid "de, van der, 't, etc..." msgstr "de, van der, 't, etc..." +#: classes/Gems/Model/RespondentNlModel.php:136 +msgid "E.g.: 0000 AA" +msgstr "Voorbeeld: 0000 AA" + #: classes/Gems/Selector/DateSelectorAbstract.php:309 msgid "<<" msgstr "<<" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-13 15:48:18
|
Revision: 1175 http://sourceforge.net/p/gemstracker/code/1175 Author: matijsdejong Date: 2013-03-13 15:48:13 +0000 (Wed, 13 Mar 2013) Log Message: ----------- RespondentNewAction.php works Getting the current menu is made more simple Fixed some bugs in default project setup Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Default/RespondentNewAction.php trunk/library/classes/Gems/Menu.php trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php trunk/library/snippets/RespondentDetailsSnippet.php Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -182,7 +182,9 @@ $bridge->addCheckBox('calc_email', 'label', $this->_('Respondent has no e-mail')); $bridge->addText( 'grs_address_1', 'size', 40, 'description', $this->_('With housenumber')) ->addFilter( $ucfirst); - $bridge->addText( 'grs_address_2', 'size', 40); + if ($model->has('grs_address_2')) { + $bridge->addText( 'grs_address_2', 'size', 40); + } $bridge->addText( 'grs_zipcode', 'size', 7, 'description', '0000 AA'); $bridge->addFilter( 'grs_zipcode', new Gems_Filter_DutchZipcode()); $bridge->addText( 'grs_city') @@ -252,6 +254,7 @@ $options = $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes(); + $this->useTabbedForms = false; $bridge = new MUtil_Model_FormBridge($model, $this->createForm()); $bridge->addSelect('gr2o_reception_code', 'label', $this->_('Rejection code'), Modified: trunk/library/classes/Gems/Default/RespondentNewAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -47,6 +47,18 @@ abstract class Gems_Default_RespondentNewAction extends Gems_Controller_ModelSnippetActionAbstract { /** + * The parameters used for the create and edit actions. + * + * When the value is a function name of that object, then that functions is executed + * with the array key as single parameter and the return value is set as the used value + * - unless the key is an integer in which case the code is executed but the return value + * is not stored. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $createEditParameters = array('resetRoute' => true); + + /** * The snippets used for the create and edit actions. * * @var mixed String or array of snippets name @@ -54,12 +66,55 @@ protected $createEditSnippets = 'ModelTabFormSnippetGeneric'; /** + * The snippets used for the delete action. * + * @var mixed String or array of snippets name + */ + public $deleteSnippets = array('RespondentDetailsSnippet'); + + /** + * The snippets used for the export action. + * + * @var mixed String or array of snippets name + */ + public $exportSnippets = array('RespondentDetailsSnippet'); + + /** + * * @var Gems_Loader */ public $loader; /** + * The snippets used for the show action + * + * @var mixed String or array of snippets name + */ + protected $showSnippets = array( + 'Generic_ContentTitleSnippet', + 'RespondentDetailsSnippet', + 'AddTracksSnippet', + 'RespondentTokenTabsSnippet', + 'RespondentTokenSnippet', + ); + + /** + * The parameters used for the show action + * + * When the value is a function name of that object, then that functions is executed + * with the array key as single parameter and the return value is set as the used value + * - unless the key is an integer in which case the code is executed but the return value + * is not stored. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $showParameters = array( + 'baseUrl' => 'getItemUrlArray', + 'onclick' => 'getEditLink', + 'respondentData' => 'getRespondentData', + ); + + /** * 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 @@ -89,6 +144,110 @@ } /** + * Adjusted delete action + */ + public function deleteAction() + { + $model = $this->getModel(); + $params = $this->_processParameters($this->showParameters); + $data = $params['respondentData']; + $request = $this->getRequest(); + + $options = $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes(); + + $bridge = new MUtil_Model_FormBridge($model, new Gems_Form()); + $bridge->addSelect('gr2o_reception_code', + 'label', $this->_('Rejection code'), + 'multiOptions', $options, + 'required', true, + 'size', max(7, min(3, count($options) + 1))); + + $form = $bridge->getForm(); + + $save = new Zend_Form_Element_Submit('save_button', array('label' => $this->_('Delete respondent'), 'class' => 'button')); + $form->addElement($save); + + if ($request->isPost()) { + $data = $_POST + $data; + if ($form->isValid($data )) { + + $code = $this->util->getReceptionCode($data['gr2o_reception_code']); + + // Is the respondent really removed + if (! $code->isSuccess()) { + $userId = $this->loader->getCurrentUser()->getUserId(); + + // Cascade to tracks + // the responsiblilty to handle it correctly is on the sub objects now. + $tracks = $this->loader->getTracker()->getRespondentTracks($data['gr2o_id_user'], $data['gr2o_id_organization']); + foreach ($tracks as $track) { + $track->setReceptionCode($code, null, $userId); + } + + // Perform actual save, but not simple stop codes. + if ($code->isForRespondents()) { + $values['gr2o_reception_code'] = $data['gr2o_reception_code']; + $values['gr2o_changed'] = new MUtil_Db_Expr_CurrentTimestamp(); + $values['gr2o_changed_by'] = $userId; + + $where = 'gr2o_id_user = ? AND gr2o_id_organization = ?'; + $where = $this->db->quoteInto($where, $data['gr2o_id_user'], null, 1); + $where = $this->db->quoteInto($where, $data['gr2o_id_organization'], null, 1); + + $this->db->update('gems__respondent2org', $values, $where); + + $this->addMessage($this->_('Respondent deleted.')); + $this->_reroute(array('action' => 'index'), true); + } else { + // Just a stop code + $this->addMessage($this->_('Respondent tracks stopped.')); + $this->_reroute(array('action' => 'show')); + } + } else { + $this->addMessage($this->_('Choose a reception code to delete.')); + } + } else { + $this->addMessage($this->_('Input error! No changes saved!')); + } + } + $form->populate($data); + + $table = new MUtil_Html_TableElement(array('class' => 'formTable')); + $table->setAsFormLayout($form, true, true); + $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. + + $this->addSnippets($this->deleteSnippets, $params); + + $this->html[] = $form; + } + + /** + * Action for dossier export + */ + public function exportAction() + { + $params = $this->_processParameters($this->showParameters); + $data = $params['respondentData']; + + $this->addSnippets($this->exportSnippets, $params); + + //Now show the export form + $export = $this->loader->getRespondentExport($this); + $form = $export->getForm(); + $this->html->h2($this->_('Export respondent archive')); + $div = $this->html->div(array('id' => 'mainform')); + $div[] = $form; + + $request = $this->getRequest(); + + $form->populate($request->getParams()); + + if ($request->isPost()) { + $export->render((array) $data['gr2o_patient_nr'], $this->getRequest()->getParam('group'), $this->getRequest()->getParam('format')); + } + } + + /** * Set column usage to use for the browser. * * Must be an array of arrays containing the input for TableBridge->setMultisort() @@ -122,6 +281,25 @@ } /** + * Get the link to edit respondent + * + * @return MUtil_Html_HrefArrayAttribute + */ + public function getEditLink() + { + $request = $this->getRequest(); + + $item = $this->menu->find(array( + $request->getControllerKey() => $request->getControllerName(), + $request->getActionKey() => 'edit', + 'allowed' => true)); + + if ($item) { + return $item->toHRefAttribute($request); + } + } + + /** * Helper function to get the title for the index action. * * @return $string @@ -132,6 +310,48 @@ } /** + * Return the array with items that should be used to find this item + * + * @return array + */ + public function getItemUrlArray() + { + return array( + MUtil_Model::REQUEST_ID1 => $this->_getParam(MUtil_Model::REQUEST_ID1), + MUtil_Model::REQUEST_ID2 => $this->_getParam(MUtil_Model::REQUEST_ID2) + ); + } + + /** + * Retrieve the respondent data in advance + * (So we don't need to repeat that for every snippet.) + * + * @return array + */ + public function getRespondentData() + { + $model = $this->getModel(); + $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); + + if (! isset($data['grs_id_user'])) { + $this->addMessage(sprintf($this->_('Unknown %s requested'), $this->getTopic())); + $this->_reroute(array('action' => 'index'), true); + return array(); + } + + // Log + $this->openedRespondent($data['gr2o_patient_nr'], $data['gr2o_id_organization'], $data['grs_id_user']); + + // Check for completed tokens + if ($this->loader->getTracker()->processCompletedTokens($data['grs_id_user'], $this->session->user_id, $data['gr2o_id_organization'])) { + //As data might have changed due to token events... reload + $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); + } + + return $data; + } + + /** * Helper function to allow generalized statements about the items in the model. * * @param int $count @@ -156,4 +376,26 @@ $this->addSnippet('Organization_ChooseOrganizationSnippet'); } } + + /** + * Log the respondent opening + * + * @param string $patientId + * @param int $orgId + * @param int $userId + * @return \Gems_Default_RespondentNewAction + */ + protected function openedRespondent($patientId, $orgId = null, $userId = null) + { + if ($patientId) { + $where['gr2o_patient_nr = ?'] = $patientId; + $where['gr2o_id_organization = ?'] = $orgId ? $orgId : $this->escort->getCurrentOrganization(); + $values['gr2o_opened'] = new MUtil_Db_Expr_CurrentTimestamp(); + $values['gr2o_opened_by'] = $this->session->user_id; + + $this->db->update('gems__respondent2org', $values, $where); + } + + return $this; + } } Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Menu.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -137,7 +137,7 @@ $page->addAction(sprintf($this->_('About %s'), $project->getName()), null, 'about'); $page->addAction(sprintf($this->_('About %s'), $this->_('GemsTracker')), 'pr.contact.gems', 'gems'); - + if ($project->hasBugsUrl()) { $page->addAction($this->_('Reporting bugs'), 'pr.contact.bugs', 'bugs'); } @@ -518,7 +518,38 @@ } /** + * Menulist populated with current items * + * @param Zend_Controller_Request_Abstract $request + * @param $parentLabel + * @return Gems_Menu_MenuList + */ + public function getCurrentMenuList(Zend_Controller_Request_Abstract $request, $parentLabel = null) + { + $controller = $request->getControllerName(); + $action = $request->getActionName(); + + $menuList = $this->getMenuList(); + + if ($controller !== 'index') { + $menuList->addByController($controller, 'index', $parentLabel); + } + + foreach ($this->getCurrentParent()->getChildren() as $child) { + if ($child instanceof Gems_Menu_SubMenuItem) { + $chAction = $child->get('action'); + $chContr = $child->get('controller'); + if (! ($controller == $chContr && $action == $chAction)) { + $menuList->addByController($chContr, $chAction); + } + } + } + return $menuList; + } + + + /** + * * @return Gems_Menu_SubMenuItem */ public function getCurrentParent() Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -268,7 +268,7 @@ 'tab', $translator->_('Contact information')); $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); - $this->setIfExists('grs_address_2', 'label', $translator->_(' ')); + $this->setIfExists('grs_address_2', 'label', ' '); // MUtil_Echo::track($this->getItemsOrdered()); //MUtil_Echo::track($this->getItemsOrdered(), $this->getOrder('grs_email')); Modified: trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -173,14 +173,9 @@ */ protected function setShowTableFooter(MUtil_Model_VerticalTableBridge $bridge, MUtil_Model_ModelAbstract $model) { - $controller = $this->request->getControllerName(); + $menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); + $menuList->addParameterSources($bridge); - $menuList = $this->menu->getMenuList(); - $menuList->addParameterSources($bridge) - ->addByController($controller, 'index', $this->_('Cancel')) - ->addByController($controller, 'edit') - ->addByController($controller, 'delete'); - $bridge->tfrow($menuList, array('class' => 'centerAlign')); } } Modified: trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -102,6 +102,11 @@ { if ($this->buttons) { $bridge->tfrow($this->buttons, array('class' => 'centerAlign')); + } else { + $menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); + $menuList->addParameterSources($bridge); + + $bridge->tfrow($menuList, array('class' => 'centerAlign')); } } Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/TabForm.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -112,7 +112,7 @@ $this->addToOtherGroup($element); $element->removeDecorator('DtDdWrapper'); - + return $this; } @@ -127,15 +127,16 @@ $this->addToOtherGroup($element); - $element->removeDecorator('DtDdWrapper'); - if ($element instanceof Zend_Form_Element_Hidden) { //Remove decorators $element->removeDecorator('HtmlTag'); $element->removeDecorator('Label'); + $element->removeDecorator('DtDdWrapper'); } elseif ($element instanceof Zend_Form_Element) { + $element->removeDecorator('DtDdWrapper'); + $error = $element->getDecorator('Errors'); if ($error instanceof Zend_Form_Decorator_Errors) { $element->removeDecorator('Errors'); Modified: trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -52,7 +52,7 @@ * * @var array */ - protected $baseurl = array(); + protected $baseUrl = array(); /** * Shortfix to add class attribute Modified: trunk/library/snippets/RespondentDetailsSnippet.php =================================================================== --- trunk/library/snippets/RespondentDetailsSnippet.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/snippets/RespondentDetailsSnippet.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -61,8 +61,10 @@ $br = $HTML->br(); $address[] = $bridge->grs_address_1; $address[] = $br; - $address[] = $bridge->grs_address_2; - $address[] = $bridge->itemIf('grs_address_2', $br); + if ($this->model->has('grs_address_2')) { + $address[] = $bridge->grs_address_2; + $address[] = $bridge->itemIf('grs_address_2', $br); + } $address[] = $bridge->grs_zipcode; $address[] = $bridge->itemIf('grs_zipcode', new MUtil_Html_Raw(' ')); $address[] = $bridge->grs_city; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-12 20:13:13
|
Revision: 1174 http://sourceforge.net/p/gemstracker/code/1174 Author: matijsdejong Date: 2013-03-12 20:13:10 +0000 (Tue, 12 Mar 2013) Log Message: ----------- New getItemsOrdered caused breaks Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 19:59:39 UTC (rev 1173) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) @@ -712,9 +712,19 @@ */ public function getItemsOrdered() { - asort($this->_model_order); - $order = array_keys($this->_model_order); - return $order + array_diff(array_keys($this->_model), $order); + $order = (array) $this->_model_order; + asort($order); + $result = array_keys($order); + foreach($this->_model as $field => $element) { + if (! array_key_exists($field, $order)) { + $result[] = $field; + } + } + return $result; + + // asort($this->_model_order); + // $order = array_keys($this->_model_order); + // return $order + array_diff(array_keys($this->_model), $order); } public function getItemsUsed() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-12 19:59:44
|
Revision: 1173 http://sourceforge.net/p/gemstracker/code/1173 Author: matijsdejong Date: 2013-03-12 19:59:39 +0000 (Tue, 12 Mar 2013) Log Message: ----------- Separated Dutch settings from main respondent model cleaned up tabform cleaned up Model order fixed bug in OrganizationEditSnippet.php caused by new tabform snippet Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/MUtil/Validate/Db/UniqueValue.php trunk/library/classes/MUtil/Validate/SimpleEmail.php trunk/library/configs/db/tables/gems__respondent2org.50.sql trunk/library/snippets/Organization/OrganizationEditSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Model/RespondentNlModel.php trunk/library/classes/Gems/Validate/OneOf.php Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -97,8 +97,8 @@ } if (self::SSN_HASH === $this->hashSsn) { $this->setSaveWhen('grs_ssn', array($this, 'whenSSN')); - $this->setOnLoad('grs_ssn', array($this, 'saveSSN')); - $this->setOnSave('grs_ssn', array($this, 'formatSSN')); + $this->setOnLoad('grs_ssn', array($this, 'hideSSN')); + $this->setOnSave('grs_ssn', array($this, 'saveSSN')); } } @@ -218,6 +218,7 @@ public function applyDetailSettings($locale = null) { $dbLookup = $this->util->getDbLookup(); + $localized = $this->util->getLocalized(); $translated = $this->util->getTranslated(); $translator = $this->translate->getAdapter(); @@ -240,16 +241,14 @@ // The SSN if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { - $this->set('grs_ssn', 'label', $translator->_('SSN')); + $this->set('grs_ssn', 'label', $translator->_('SSN'), + 'tab', $translator->_('Identification')); } - $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent number')); + $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent number'), + 'tab', $translator->_('Identification')); $this->setIfExists('grs_first_name', 'label', $translator->_('First name')); - $this->setIfExists('grs_surname_prefix', - 'label', $translator->_('Surname prefix'), - 'description', $translator->_('de, van der, \'t, etc...') - ); $this->setIfExists('grs_last_name', 'label', $translator->_('Last name')); $this->setIfExists('grs_gender', @@ -257,17 +256,38 @@ 'multiOptions', $translated->getGenderHello() ); - $this->setIfExists('grs_email', 'label', $translator->_('E-Mail')); + $this->setIfExists('grs_birthday', + 'label', $translator->_('Birthday'), + 'dateFormat', Zend_Date::DATE_MEDIUM + ); + $this->setIfExists('gr2o_treatment', 'label', $translator->_('Treatment')); + $this->setIfExists('gr2o_comments', 'label', $translator->_('Comments')); + + $this->setIfExists('grs_email', 'label', $translator->_('E-Mail'), + 'tab', $translator->_('Contact information')); + $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); + $this->setIfExists('grs_address_2', 'label', $translator->_(' ')); + + // MUtil_Echo::track($this->getItemsOrdered()); + //MUtil_Echo::track($this->getItemsOrdered(), $this->getOrder('grs_email')); + $this->setIfExists('grs_zipcode', 'label', $translator->_('Zipcode')); $this->setIfExists('grs_city', 'label', $translator->_('City')); + $this->setIfExists('grs_iso_country', 'label', $translator->_('Country'), + 'multiOptions', $localized->getCountries()); $this->setIfExists('grs_phone_1', 'label', $translator->_('Phone')); + $this->setIfExists('grs_phone_2', 'label', $translator->_('Phone 2')); + $this->setIfExists('grs_phone_3', 'label', $translator->_('Phone 3')); - $this->setIfExists('grs_birthday', - 'label', $translator->_('Birthday'), - 'dateFormat', Zend_Date::DATE_MEDIUM + $this->setIfExists('grs_iso_lang', 'label', $translator->_('Language'), + 'multiOptions', $localized->getLanguages(), + 'tab', $translator->_('Settings')); + + $this->setIfExists('gr2o_consent', 'label', $translator->_('Consent'), + 'multiOptions', $dbLookup->getUserConsents() ); $this->setIfExists('gr2o_opened', @@ -275,16 +295,6 @@ 'formatFunction', $translated->formatDateTime ); - $this->setIfExists('gr2o_consent', - 'label', $translator->_('Consent'), - 'multiOptions', $dbLookup->getUserConsents() - ); - - $this->set('gr2o_comments', 'label', $translator->_('Comments')); - $this->set('gr2o_treatment', 'label', $translator->_('Treatment')); - - $this->addColumn('CASE WHEN grs_email IS NULL OR LENGTH(TRIM(grs_email)) = 0 THEN 1 ELSE 0 END', 'calc_email'); - return $this; } @@ -304,23 +314,7 @@ $ucfirst = new Zend_Filter_Callback('ucfirst'); if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { - $this->set('grs_ssn', - 'size', 10, - 'maxlength', 12, - 'filter', 'Digits'); - - if (APPLICATION_ENV !== 'production') { - $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); - $num = mt_rand(100000000, 999999999); - - while (! $bsn->isValid($num)) { - $num++; - } - - $this->setIfExists('grs_ssn', 'description', sprintf($translator->_('Random Example BSN: %s'), $num)); - } else { - $this->setIfExists('grs_ssn', 'description', $translator->_('Enter a 9-digit SSN number.')); - } + $this->set('grs_ssn', 'validator[]', $this->createUniqueValidator('grs_ssn')); } $this->setIfExists('gr2o_patient_nr', @@ -331,7 +325,23 @@ array('gr2o_id_user' => 'grs_id_user', 'gr2o_id_organization') ) ); + $this->set('grs_id_user'); + $this->set('grs_email', + 'size', 30, + 'validator', 'SimpleEmail'); + $this->addColumn('CASE WHEN grs_email IS NULL OR LENGTH(TRIM(grs_email)) = 0 THEN 1 ELSE 0 END', 'calc_email'); + $this->set('calc_email', + 'label', $translator->_('Respondent has no e-mail'), + 'elementClass', 'Checkbox', + 'order', $this->getOrder('grs_email') + 1, + 'validator', new Gems_Validate_OneOf( + $translator->_('Respondent has no e-mail'), + 'grs_email', + $this->get('grs_email', 'label') + ) + ); + $this->setIfExists('grs_first_name', 'filter', $ucfirst); $this->setIfExists('grs_last_name', 'filter', $ucfirst, 'required', true); @@ -342,12 +352,34 @@ 'tab', $translator->_('Medical data') ); + $this->setIfExists('grs_birthday', + 'jQueryParams', array('defaultDate' => '-30y', 'maxDate' => 0, 'yearRange' => 'c-130:c0'), + 'elementClass', 'Date', + 'validator', new MUtil_Validate_Date_DateBefore()); + + $this->setIfExists('gr2o_treatment', 'size', 30); + $this->setIfExists('gr2o_comments', 'elementClass', 'Textarea', 'rows', 4, 'cols', 60); + + $this->setIfExists('grs_address_1', + 'size', 40, + 'description', $translator->_('With housenumber'), + 'filter', $ucfirst + ); + $this->setIfExists('grs_address_2', 'size', 40); + $this->setIfExists('grs_city', 'filter', $ucfirst); + $this->setIfExists('grs_phone_1', 'size', 15); + $this->setIfExists('grs_phone_2', 'size', 15); + $this->setIfExists('grs_phone_3', 'size', 15); + $this->setIfExists('gr2o_opened', 'elementClass', 'Exhibitor'); - $this->setIfExists('gr2o_consent', 'default', $this->util->getDefaultConsent()); + $this->setIfExists('gr2o_consent', + 'default', $this->util->getDefaultConsent(), + 'elementClass', 'Radio', + 'separator', '', + 'description', $translator->_('Has the respondent signed the informed consent letter?'), + 'required', true); - $this->setIfExists('grs_iso_lang', 'default', 'nl'); - return $this; } Added: trunk/library/classes/Gems/Model/RespondentNlModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentNlModel.php (rev 0) +++ trunk/library/classes/Gems/Model/RespondentNlModel.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -0,0 +1,140 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Model + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: RespondentNlModel.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Class containing the Netherlands specific model extensions. + * + * Extend your project specific RespondentModel from this model to make it go Dutch. + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class Gems_Model_RespondentNlModel extends Gems_Model_RespondentModel +{ + /** + * Set those settings needed for the detailed display + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyDetailSettings($locale = null) + { + parent::applyDetailSettings($locale); + + $translator = $this->translate->getAdapter(); + + $this->setIfExists('grs_surname_prefix', + 'label', $translator->_('Surname prefix'), + 'description', $translator->_('de, van der, \'t, etc...'), + 'order', $this->getOrder('grs_first_name') + 1 + ); + + return $this; + } + + /** + * Set those values needed for editing + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyEditSettings($locale = null) + { + parent::applyEditSettings($locale); + $translator = $this->translate->getAdapter(); + + if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { + self::setDutchSsn($this, $translator); + } + + $this->setIfExists('grs_iso_lang', 'default', 'nl'); + $this->setIfExists('gr2o_treatment', 'description', $translator->_('DBC\'s, etc...')); + + self::setDutchZipcode($this, $translator); + + return $this; + } + + /** + * Set the field values for a dutch social security number + * + * @param MUtil_Model_ModelAbstract $model + * @param Zend_Translate_Adapter $translator + * @param string $fieldName + */ + public static function setDutchSsn(MUtil_Model_ModelAbstract $model, Zend_Translate_Adapter $translator, $fieldName = 'grs_ssn') + { + $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); + + $model->set($fieldName, + 'size', 10, + 'maxlength', 12, + 'filter', 'Digits', + 'validator[]', $bsn); + + if (APPLICATION_ENV !== 'production') { + $num = mt_rand(100000000, 999999999); + + while (! $bsn->isValid($num)) { + $num++; + } + + $model->set($fieldName, 'description', sprintf($translator->_('Random Example BSN: %s'), $num)); + } else { + $model->set($fieldName, 'description', $translator->_('Enter a 9-digit SSN number.')); + } + } + + /** + * Set the field values for a dutch zipcode + * + * @param MUtil_Model_ModelAbstract $model + * @param Zend_Translate_Adapter $translator + * @param string $fieldName + */ + public static function setDutchZipcode(MUtil_Model_ModelAbstract $model, Zend_Translate_Adapter $translator, $fieldName = 'grs_zipcode') + { + $model->set($fieldName, + 'size', 7, + 'description', $translator->_('E.g.: 0000 AA'), + 'filter', new Gems_Filter_DutchZipcode() + ); + } +} Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -74,25 +74,29 @@ } $bridge->setAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS, $displayOptions); - $tab = 0; - $group = 0; + $tab = 0; + $group = 0; + $oldTab = null; + // MUtil_Echo::track($model->getItemsOrdered()); foreach ($model->getItemsOrdered() as $name) { // Get all options at once $modelOptions = $model->get($name); - if ($tabName = $model->get($name, 'tab')) { + $tabName = $model->get($name, 'tab'); + if ($tabName && ($tabName !== $oldTab)) { $bridge->addTab('tab' . $tab, 'value', $tabName); + $oldTab = $tabName; $tab++; } if ($model->has($name, 'label')) { $bridge->add($name); - - if ($theName = $model->get('startGroup')) { + + if ($theName = $model->get($name, 'startGroup')) { //We start a new group here! $groupElements = array(); $groupElements[] = $name; $groupName = $theName; - } elseif ($theName = $model->get('endGroup')) { + } elseif ($theName = $model->get($name, 'endGroup')) { //Ok, last element define the group $groupElements[] = $name; $bridge->addDisplayGroup('grp_' . $groupElements[0], $groupElements, @@ -111,6 +115,7 @@ } else { $bridge->addHidden($name); } + unset($this->_items[$name]); } } @@ -146,7 +151,10 @@ $form->resetContext(); } $form->addElement($element); + $element->removeDecorator('HtmlTag'); + $element->removeDecorator('Label'); $form->addDisplayGroup(array('formLinks'), 'form_buttons'); + $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->removeElement($element->getName()); } } Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/TabForm.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -43,6 +43,11 @@ class Gems_TabForm extends Gems_Form { /** + * Group ID for elements below form + */ + const GROUP_OTHER = 'not_in_tab'; + + /** * Holds the last tab we added information to * * @var Gems_Form_TabSubForm @@ -97,18 +102,40 @@ */ public function addElement($element, $name = null, $options = null) { + if ($element instanceof Zend_Form_Element_Hidden) { + parent::addElement($element, $name, $options); + + //Remove decorators + $element->removeDecorator('HtmlTag'); + $element->removeDecorator('Label'); + + $this->addToOtherGroup($element); + + $element->removeDecorator('DtDdWrapper'); + + return $this; + } + if ($this->currentTab) { return $this->currentTab->addElement($element, $name, $options); } else { parent::addElement($element, $name, $options); + if (is_string($element)) { $element = $this->getElement($element); } + + $this->addToOtherGroup($element); + + $element->removeDecorator('DtDdWrapper'); + if ($element instanceof Zend_Form_Element_Hidden) { //Remove decorators - $element->removeDecorator('htmlTag'); + $element->removeDecorator('HtmlTag'); $element->removeDecorator('Label'); + } elseif ($element instanceof Zend_Form_Element) { + $error = $element->getDecorator('Errors'); if ($error instanceof Zend_Form_Decorator_Errors) { $element->removeDecorator('Errors'); @@ -138,6 +165,24 @@ } /** + * Add to the group all non-tab elements are in + * + * @param mixed $element + * @return \Gems_TabForm + */ + public function addToOtherGroup($element) + { + if ($element instanceof Zend_Form_Element) { + if ($group = $this->getDisplayGroup(self::GROUP_OTHER)) { + $group->addElement($element); + } else { + $this->addDisplayGroup(array($element), self::GROUP_OTHER); + } + } + return $this; + } + + /** * Add an element to the form, when a tab (subform) had been added, it will return * the subform instead of the form, keep this in mind when chaining methods * Added: trunk/library/classes/Gems/Validate/OneOf.php =================================================================== --- trunk/library/classes/Gems/Validate/OneOf.php (rev 0) +++ trunk/library/classes/Gems/Validate/OneOf.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -0,0 +1,123 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Validate + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: EmailCheck.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Check for one of the two values being filled + * + * @package Gems + * @subpackage Validate + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class Gems_Validate_OneOf extends Zend_Validate_Abstract +{ + /** + * Error codes + * @const string + */ + const NEITHER = 'neither'; + + protected $_messageTemplates = array( + self::NEITHER => "Either '%description%' or '%fieldDescription%' must be entered.", + ); + + /** + * @var array + */ + protected $_messageVariables = array( + 'description' => '_description', + 'fieldDescription' => '_fieldDescription' + ); + + + protected $_description; + + /** + * The field name against which to validate + * @var string + */ + protected $_fieldName; + + /** + * Description of field name against which to validate + * @var string + */ + protected $_fieldDescription; + + /** + * Sets validator options + * + * @param string $fieldName Field name against which to validate + * $param string $fieldDescription Description of field name against which to validate + * @return void + */ + public function __construct($description, $fieldName, $fieldDescription) + { + $this->_description = $description; + $this->_fieldName = $fieldName; + $this->_fieldDescription = $fieldDescription; + } + + /** + * Defined by Zend_Validate_Interface + * + * Returns true if and only if a token has been set and the provided value + * matches that token. + * + * @param mixed $value + * @return boolean + */ + public function isValid($value, $context = array()) + { + $this->_setValue((string) $value); + + $fieldSet = (boolean) isset($context[$this->_fieldName]) && $context[$this->_fieldName]; + $valueSet = (boolean) $value; + + if ($valueSet && (! $fieldSet)) { + return true; + } + + if ((! $valueSet) && $fieldSet) { + return true; + } + + $this->_error(self::NEITHER); + return false; + } +} Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -712,15 +712,9 @@ */ public function getItemsOrdered() { - $order = (array) $this->_model_order; - asort($order); - $result = array_keys($order); - foreach($this->_model as $field => $element) { - if (! array_key_exists($field, $order)) { - $result[] = $field; - } - } - return $result; + asort($this->_model_order); + $order = array_keys($this->_model_order); + return $order + array_diff(array_keys($this->_model), $order); } public function getItemsUsed() Modified: trunk/library/classes/MUtil/Validate/Db/UniqueValue.php =================================================================== --- trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -108,6 +108,9 @@ public function isValid($value, $context = array()) { + // Quick fix for context not being complete in subform + $context = $context + $_POST; + /** * Check for an adapter being defined. if not, fetch the default adapter. */ @@ -180,7 +183,8 @@ } else { $this->_exclude = null; } - + // MUtil_Echo::track($this->_exclude, $this->_checkFields, $this->_keyFields, $context, $_POST); + return parent::isValid($value, $context); } } Modified: trunk/library/classes/MUtil/Validate/SimpleEmail.php =================================================================== --- trunk/library/classes/MUtil/Validate/SimpleEmail.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Validate/SimpleEmail.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -1,47 +1,47 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /** - * - * @author Matijs de Jong - * @since 1.0 - * @version 1.1 - * @package MUtil + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil * @subpackage Validate + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: SimpleEmail.php 203 2012-01-01t 12:51:32Z matijs $ */ /** - * - * @author Matijs de Jong - * @package MUtil + * + * @package MUtil * @subpackage Validate + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Validate_SimpleEmail extends Zend_Validate_Regex { Modified: trunk/library/configs/db/tables/gems__respondent2org.50.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-12 19:59:39 UTC (rev 1173) @@ -10,8 +10,8 @@ -- gr2o_id_physician bigint unsigned null -- references gems_staff (gsf_id_user), - -- gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - -- gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gr2o_consent varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'Unknown' references gems__consents (gco_description), Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -130,7 +130,7 @@ if (count($this->_items)>0 && !($bridge->getTab('other'))) { $bridge->addTab('other', 'value', $this->_('Other')); } - parent::addFormElements($bridge, $model); + parent::addItems($bridge, $this->_items); } public function afterSave($changed) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-07 17:06:57
|
Revision: 1172 http://sourceforge.net/p/gemstracker/code/1172 Author: matijsdejong Date: 2013-03-07 17:06:55 +0000 (Thu, 07 Mar 2013) Log Message: ----------- Allow disable of text search on certain elements Use existing date label for AutosearchFormSnippet.php Modified Paths: -------------- trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/classes/MUtil/Model/Transform/JoinTransformer.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/Snippets/AutosearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-03-06 15:16:41 UTC (rev 1171) +++ trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-03-07 17:06:55 UTC (rev 1172) @@ -102,14 +102,14 @@ protected function _addPeriodSelectors(array &$elements, $dates, $defaultDate = null, $switchToSelect = 4) { if (is_array($dates) && (1 === count($dates))) { - reset($dates); + $fromLabel = reset($dates); $dates = key($dates); + } else { + $fromLabel = $this->_('From'); } if (is_string($dates)) { $element = new Zend_Form_Element_Hidden('dateused'); $element->setValue($dates); - - $fromLabel = $this->_('From'); } else { if (count($dates) >= $switchToSelect) { $element = $this->_createSelectElement('dateused', $dates); Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-06 15:16:41 UTC (rev 1171) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-07 17:06:55 UTC (rev 1172) @@ -865,7 +865,7 @@ $fields = array(); foreach ($this->getItemsUsed() as $name) { - if ($this->get($name, 'label')) { + if ($this->get($name, 'label') && (! $this->get($name, 'no_text_search'))) { if ($expression = $this->get($name, 'column_expression')) { if ($fieldList = $this->get($name, 'fieldlist')) { foreach ((array) $fieldList as $field) { Modified: trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php =================================================================== --- trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-06 15:16:41 UTC (rev 1171) +++ trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-07 17:06:55 UTC (rev 1172) @@ -86,6 +86,7 @@ foreach ($sub->getItemNames() as $name) { if (! $model->has($name)) { $data[$name] = $sub->get($name); + $data[$name]['no_text_search'] = true; // Remove unsuited data unset($data[$name]['table'], $data[$name]['column_expression']); Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-03-06 15:16:41 UTC (rev 1171) +++ trunk/library/languages/default-en.po 2013-03-07 17:06:55 UTC (rev 1172) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-19 18:03+0100\n" +"POT-Creation-Date: 2013-03-07 18:05+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -73,12 +73,12 @@ msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1758 classes/Gems/Default/StaffAction.php:317 +#: classes/GemsEscort.php:1758 classes/Gems/Default/StaffAction.php:324 msgid "No access to page" msgstr "No access to page" #: classes/GemsEscort.php:1760 classes/Gems/Default/OrganizationAction.php:106 -#: classes/Gems/Default/StaffAction.php:318 +#: classes/Gems/Default/StaffAction.php:325 #: classes/Gems/Model/HiddenOrganizationModel.php:115 #, php-format msgid "Access to this page is not allowed for current role: %s." @@ -258,7 +258,7 @@ #: classes/Gems/Menu.php:213 classes/Gems/Default/GroupAction.php:121 #: classes/Gems/Default/LogAction.php:193 -#: classes/Gems/Default/StaffAction.php:470 +#: classes/Gems/Default/StaffAction.php:481 msgid "Staff" msgstr "Staff" @@ -323,8 +323,8 @@ #: classes/Gems/Default/TrackActionAbstract.php:219 #: classes/Gems/Default/TrackFieldsAction.php:96 #: classes/Gems/Email/OneMailForm.php:54 -#: classes/Gems/Export/RespondentExport.php:235 -#: classes/Gems/Export/RespondentExport.php:247 +#: classes/Gems/Export/RespondentExport.php:238 +#: classes/Gems/Export/RespondentExport.php:250 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:728 #: classes/Gems/Tracker/Model/StandardTokenModel.php:216 @@ -400,6 +400,7 @@ #: classes/Gems/Menu.php:586 classes/Gems/Default/GroupAction.php:122 #: classes/Gems/Default/OrganizationAction.php:154 #: classes/Gems/Default/RespondentAction.php:462 +#: classes/Gems/Default/RespondentNewAction.php:131 msgid "Respondents" msgstr "Patients" @@ -419,7 +420,7 @@ msgid "Track Builder" msgstr "Track Builder" -#: classes/Gems/Menu.php:610 classes/Gems/Export/RespondentExport.php:341 +#: classes/Gems/Menu.php:610 classes/Gems/Export/RespondentExport.php:344 msgid "Export" msgstr "Export" @@ -433,6 +434,7 @@ msgstr "Changelog" #: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:93 +#: classes/Gems/Model/RespondentModel.php:179 #: classes/Gems/Tracker/Model/StandardTokenModel.php:213 msgid "Respondent nr" msgstr "Patient nr" @@ -441,7 +443,9 @@ #: classes/Gems/Default/IndexAction.php:229 #: classes/Gems/Default/LogAction.php:197 #: classes/Gems/Default/MailJobAction.php:98 -#: classes/Gems/Default/StaffAction.php:340 +#: classes/Gems/Default/StaffAction.php:347 +#: classes/Gems/Model/RespondentModel.php:174 +#: classes/Gems/Model/RespondentModel.php:227 #: classes/Gems/Snippets/Export/ReportHeaderSnippet.php:63 #: classes/Gems/User/Form/LayeredLoginForm.php:254 #: classes/Gems/User/Form/OrganizationFormAbstract.php:166 @@ -449,36 +453,44 @@ msgid "Organization" msgstr "Organization" -#: classes/Gems/Model.php:217 +#: classes/Gems/Model.php:217 classes/Gems/Model/RespondentModel.php:202 +#: classes/Gems/Model/RespondentModel.php:274 msgid "Opened" msgstr "Opened" -#: classes/Gems/Model.php:218 +#: classes/Gems/Model.php:218 classes/Gems/Model/RespondentModel.php:205 +#: classes/Gems/Model/RespondentModel.php:279 msgid "Consent" msgstr "Consent" #: classes/Gems/Model.php:220 classes/Gems/Default/OptionAction.php:130 -#: classes/Gems/Default/StaffAction.php:330 +#: classes/Gems/Default/StaffAction.php:337 +#: classes/Gems/Model/RespondentModel.php:189 +#: classes/Gems/Model/RespondentModel.php:260 msgid "E-Mail" msgstr "E-Mail" #: classes/Gems/Model.php:225 classes/Gems/Default/OptionAction.php:134 -#: classes/Gems/Default/StaffAction.php:343 +#: classes/Gems/Default/StaffAction.php:350 +#: classes/Gems/Model/RespondentModel.php:256 msgid "Gender" msgstr "Gender" #: classes/Gems/Model.php:226 classes/Gems/Default/OptionAction.php:131 -#: classes/Gems/Default/StaffAction.php:185 +#: classes/Gems/Default/StaffAction.php:192 +#: classes/Gems/Model/RespondentModel.php:248 msgid "First name" msgstr "First name" #: classes/Gems/Model.php:227 classes/Gems/Default/OptionAction.php:132 -#: classes/Gems/Default/StaffAction.php:187 +#: classes/Gems/Default/StaffAction.php:194 +#: classes/Gems/Model/RespondentModel.php:250 msgid "Surname prefix" msgstr "Surname prefix" #: classes/Gems/Model.php:228 classes/Gems/Default/OptionAction.php:133 -#: classes/Gems/Default/StaffAction.php:188 +#: classes/Gems/Default/StaffAction.php:195 +#: classes/Gems/Model/RespondentModel.php:253 msgid "Last name" msgstr "Last name" @@ -488,35 +500,43 @@ #: classes/Gems/Default/OrganizationAction.php:126 #: classes/Gems/Default/RoleAction.php:252 #: classes/Gems/Default/SourceAction.php:195 -#: classes/Gems/Default/StaffAction.php:328 +#: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/SurveyMaintenanceAction.php:435 #: classes/Gems/Default/TokenPlanAction.php:116 #: classes/Gems/Default/TrackFieldsAction.php:98 #: classes/Gems/Default/TrackMaintenanceAction.php:318 +#: classes/Gems/Model/RespondentModel.php:182 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:60 #: classes/Gems/Tracker/Model/TrackModel.php:98 msgid "Name" msgstr "Name" -#: classes/Gems/Model.php:234 +#: classes/Gems/Model.php:234 classes/Gems/Model/RespondentModel.php:191 +#: classes/Gems/Model/RespondentModel.php:262 msgid "Street" msgstr "Street" -#: classes/Gems/Model.php:235 +#: classes/Gems/Model.php:235 classes/Gems/Model/RespondentModel.php:192 +#: classes/Gems/Model/RespondentModel.php:263 msgid "Zipcode" msgstr "Zipcode" #: classes/Gems/Model.php:236 #: classes/Gems/Default/RespondentPlanAction.php:134 +#: classes/Gems/Model/RespondentModel.php:193 +#: classes/Gems/Model/RespondentModel.php:264 msgid "City" msgstr "City" -#: classes/Gems/Model.php:238 +#: classes/Gems/Model.php:238 classes/Gems/Model/RespondentModel.php:195 +#: classes/Gems/Model/RespondentModel.php:266 msgid "Phone" msgstr "Phone" #: classes/Gems/Model.php:240 #: classes/Gems/Default/RespondentPlanAction.php:133 +#: classes/Gems/Model/RespondentModel.php:198 +#: classes/Gems/Model/RespondentModel.php:269 msgid "Birthday" msgstr "Birthday" @@ -540,11 +560,12 @@ msgid "Unable to run PDF conversion (%s): \"%s\"" msgstr "Unable to run PDF conversion (%s): \"%s\"" -#: classes/Gems/Upgrades.php:91 +#: classes/Gems/Upgrades.php:92 msgid "Syncing surveys for all sources" msgstr "Syncing surveys for all sources" -#: classes/Gems/Upgrades.php:151 classes/Gems/Upgrades.php:163 +#: classes/Gems/Upgrades.php:152 classes/Gems/Upgrades.php:164 +#: classes/Gems/Upgrades.php:186 msgid "Make sure to read the changelog as it contains important instructions" msgstr "Make sure to read the changelog as it contains important instructions" @@ -564,7 +585,7 @@ #: classes/Gems/Controller/BrowseEditAction.php:357 #: classes/Gems/Controller/ModelSnippetActionAbstract.php:261 -#: classes/Gems/Default/StaffAction.php:228 +#: classes/Gems/Default/StaffAction.php:235 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:186 #, php-format msgid "New %s..." @@ -631,14 +652,14 @@ #: classes/Gems/Controller/BrowseEditAction.php:821 #: classes/Gems/Default/DatabaseAction.php:187 #: classes/Gems/Default/DatabaseAction.php:499 -#: classes/Gems/Default/StaffAction.php:276 +#: classes/Gems/Default/StaffAction.php:283 #: classes/Gems/Default/TrackAction.php:419 #: classes/Gems/Default/TrackRoundsAction.php:265 #: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:181 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:143 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:147 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:166 -#: classes/Gems/Util/Translated.php:267 +#: classes/Gems/Util/Translated.php:269 #: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:192 #: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:124 msgid "Yes" @@ -647,7 +668,7 @@ #: classes/Gems/Controller/BrowseEditAction.php:822 #: classes/Gems/Default/DatabaseAction.php:188 #: classes/Gems/Default/DatabaseAction.php:500 -#: classes/Gems/Default/StaffAction.php:277 +#: classes/Gems/Default/StaffAction.php:284 #: classes/Gems/Default/TrackAction.php:420 #: classes/Gems/Default/TrackRoundsAction.php:266 #: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:183 @@ -656,7 +677,7 @@ #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:167 #: classes/Gems/Util/ReceptionCodeLibrary.php:99 #: classes/Gems/Util/ReceptionCodeLibrary.php:123 -#: classes/Gems/Util/Translated.php:267 +#: classes/Gems/Util/Translated.php:269 #: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:194 #: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:125 msgid "No" @@ -859,7 +880,7 @@ #: classes/Gems/Default/TrackActionAbstract.php:220 #: classes/Gems/Default/TrackFieldsAction.php:101 #: classes/Gems/Default/UpgradeAction.php:176 -#: classes/Gems/Export/RespondentExport.php:236 +#: classes/Gems/Export/RespondentExport.php:239 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:734 #: classes/Gems/Tracker/Model/StandardTokenModel.php:214 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:150 @@ -1489,7 +1510,7 @@ #: classes/Gems/Default/IndexAction.php:436 #: classes/Gems/Default/OptionAction.php:94 -#: classes/Gems/Default/StaffAction.php:510 +#: classes/Gems/Default/StaffAction.php:521 msgid "New password is active." msgstr "New password is active." @@ -1859,8 +1880,8 @@ #: classes/Gems/Default/MailTemplateAction.php:76 #: classes/Gems/Default/RespondentAction.php:386 -#: classes/Gems/Default/StaffAction.php:335 -#: classes/Gems/Default/StaffAction.php:405 +#: classes/Gems/Default/StaffAction.php:342 +#: classes/Gems/Default/StaffAction.php:416 #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:75 #: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:75 msgid "(all organizations)" @@ -1887,7 +1908,7 @@ #: classes/Gems/Default/OptionAction.php:136 #: classes/Gems/Default/OrganizationAction.php:147 #: classes/Gems/Default/RespondentAction.php:195 -#: classes/Gems/Default/StaffAction.php:351 +#: classes/Gems/Default/StaffAction.php:359 msgid "Language" msgstr "Language" @@ -2019,7 +2040,7 @@ msgstr "This can not be changed yet" #: classes/Gems/Default/OrganizationAction.php:192 -#: classes/Gems/Default/StaffAction.php:158 +#: classes/Gems/Default/StaffAction.php:165 msgid "User Definition" msgstr "User Definition" @@ -2208,7 +2229,7 @@ #: classes/Gems/Email/EmailFormAbstract.php:193 #: classes/Gems/Email/EmailFormAbstract.php:251 #: classes/Gems/Email/MailTemplateForm.php:81 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:112 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:108 #: classes/Gems/Tracker/Model/TrackModel.php:103 msgid "From" msgstr "From" @@ -2321,19 +2342,23 @@ msgstr[1] "reception codes" #: classes/Gems/Default/RespondentAction.php:127 +#: classes/Gems/Model/RespondentModel.php:320 #, php-format msgid "Random Example BSN: %s" msgstr "Random Example BSN: %s" #: classes/Gems/Default/RespondentAction.php:129 +#: classes/Gems/Model/RespondentModel.php:322 msgid "Enter a 9-digit SSN number." msgstr "Enter a 9-digit BSN number." #: classes/Gems/Default/RespondentAction.php:143 +#: classes/Gems/Model/RespondentModel.php:228 msgid "Identification" msgstr "Identification" #: classes/Gems/Default/RespondentAction.php:154 +#: classes/Gems/Model/RespondentModel.php:243 msgid "SSN" msgstr "BSN" @@ -2342,6 +2367,7 @@ msgstr "Patient number" #: classes/Gems/Default/RespondentAction.php:167 +#: classes/Gems/Model/RespondentModel.php:342 msgid "Medical data" msgstr "Medical data" @@ -2374,11 +2400,13 @@ msgstr "Has the patient signed the informed consent letter?" #: classes/Gems/Default/RespondentAction.php:228 +#: classes/Gems/Model/RespondentModel.php:283 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Comments" #: classes/Gems/Default/RespondentAction.php:229 +#: classes/Gems/Model/RespondentModel.php:284 msgid "Treatment" msgstr "Treatment" @@ -2414,6 +2442,7 @@ msgstr "Export patient archive" #: classes/Gems/Default/RespondentAction.php:457 +#: classes/Gems/Default/RespondentNewAction.php:142 msgid "respondent" msgid_plural "respondents" msgstr[0] "patient" @@ -2686,27 +2715,27 @@ msgid "Synchronize all sources." msgstr "Synchronize all sources." -#: classes/Gems/Default/StaffAction.php:122 +#: classes/Gems/Default/StaffAction.php:129 msgid "password" msgstr "password" -#: classes/Gems/Default/StaffAction.php:164 +#: classes/Gems/Default/StaffAction.php:171 msgid "Unsupported User Definition" msgstr "Unsupported User Definition" -#: classes/Gems/Default/StaffAction.php:193 +#: classes/Gems/Default/StaffAction.php:200 msgid "Users can only login when this box is checked." msgstr "Users can only login when this box is checked." -#: classes/Gems/Default/StaffAction.php:194 +#: classes/Gems/Default/StaffAction.php:201 msgid "If checked the user will logoff when answering a survey." msgstr "If checked the user will logoff when answering a survey." -#: classes/Gems/Default/StaffAction.php:211 +#: classes/Gems/Default/StaffAction.php:218 msgid "You are not allowed to edit this staff member." msgstr "You are not allowed to edit this staff member." -#: classes/Gems/Default/StaffAction.php:268 +#: classes/Gems/Default/StaffAction.php:275 #, php-format msgid "" "User with id %s already exists but is deleted, do you want to reactivate the " @@ -2715,35 +2744,35 @@ "User with id %s already exists but is deleted, do you want to reactivate the " "account?" -#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1212 +#: classes/Gems/Default/StaffAction.php:334 classes/Gems/User/User.php:1212 #: classes/Gems/User/Form/OrganizationFormAbstract.php:232 msgid "Username" msgstr "Username" -#: classes/Gems/Default/StaffAction.php:342 +#: classes/Gems/Default/StaffAction.php:349 msgid "Primary function" msgstr "Primary function" -#: classes/Gems/Default/StaffAction.php:352 +#: classes/Gems/Default/StaffAction.php:363 msgid "Can login" msgstr "Can login" -#: classes/Gems/Default/StaffAction.php:353 +#: classes/Gems/Default/StaffAction.php:364 msgid "Logout on survey" msgstr "Logout on survey" -#: classes/Gems/Default/StaffAction.php:465 +#: classes/Gems/Default/StaffAction.php:476 msgid "staff member" msgid_plural "staff members" msgstr[0] "staff member" msgstr[1] "staff members" -#: classes/Gems/Default/StaffAction.php:494 +#: classes/Gems/Default/StaffAction.php:505 #, php-format msgid "Reset password for: %s" msgstr "Reset password for: %s" -#: classes/Gems/Default/StaffAction.php:497 +#: classes/Gems/Default/StaffAction.php:508 msgid "You are not allowed to change this password." msgstr "You are not allowed to change this password." @@ -3141,6 +3170,7 @@ msgstr "Token planning" #: classes/Gems/Default/TrackAction.php:121 +#: classes/Gems/Model/RespondentModel.php:246 #: snippets/DeleteInSourceTrackSnippet.php:82 snippets/EditTrackSnippet.php:72 msgid "Respondent number" msgstr "Patient number" @@ -3245,13 +3275,13 @@ msgstr "Adding the %s track to respondent %s: %s" #: classes/Gems/Default/TrackActionAbstract.php:221 -#: classes/Gems/Export/RespondentExport.php:237 +#: classes/Gems/Export/RespondentExport.php:240 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:148 msgid "Enter the particulars concerning the assignment to this respondent." msgstr "Enter the particulars concerning the assignment to this patient." #: classes/Gems/Default/TrackActionAbstract.php:222 -#: classes/Gems/Export/RespondentExport.php:238 +#: classes/Gems/Export/RespondentExport.php:241 #: classes/Gems/Tracker/Model/StandardTokenModel.php:207 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:151 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:149 @@ -3260,7 +3290,7 @@ msgstr "Assigned by" #: classes/Gems/Default/TrackActionAbstract.php:223 -#: classes/Gems/Export/RespondentExport.php:239 +#: classes/Gems/Export/RespondentExport.php:242 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:152 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:150 msgid "Start" @@ -3272,7 +3302,7 @@ msgstr "Ending on" #: classes/Gems/Default/TrackActionAbstract.php:231 -#: classes/Gems/Export/RespondentExport.php:243 +#: classes/Gems/Export/RespondentExport.php:246 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:161 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:278 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 @@ -3665,7 +3695,7 @@ msgid "Show all answers for this survey type" msgstr "Show all answers for this survey type" -#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:73 +#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:86 msgid "Show all tokens for this survey in this track type" msgstr "Show all tokens for this survey in this track type" @@ -3710,15 +3740,15 @@ msgid "Single Survey" msgstr "Single Survey" -#: classes/Gems/Export/RespondentExport.php:251 +#: classes/Gems/Export/RespondentExport.php:254 msgid "Track information" msgstr "Track information" -#: classes/Gems/Export/RespondentExport.php:326 +#: classes/Gems/Export/RespondentExport.php:329 msgid "Group surveys" msgstr "Group surveys" -#: classes/Gems/Export/RespondentExport.php:331 +#: classes/Gems/Export/RespondentExport.php:334 msgid "Output format" msgstr "Output format" @@ -3911,6 +3941,10 @@ msgid "No script for %1$s." msgstr "No script for %1$s." +#: classes/Gems/Model/RespondentModel.php:251 +msgid "de, van der, 't, etc..." +msgstr "de, van der, 't, etc..." + #: classes/Gems/Selector/DateSelectorAbstract.php:309 msgid "<<" msgstr "<<" @@ -4591,12 +4625,12 @@ msgstr "Decrease" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:157 -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Female" msgstr "Female" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:158 -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Male" msgstr "Male" @@ -4830,11 +4864,11 @@ msgid "User not found or no e-mail address known or user cannot be reset." msgstr "User not found or no e-mail address known or user cannot be reset." -#: classes/Gems/Util/DbLookup.php:452 +#: classes/Gems/Util/DbLookup.php:457 msgid "inactive" msgstr "inactive" -#: classes/Gems/Util/DbLookup.php:453 +#: classes/Gems/Util/DbLookup.php:458 msgid "source inactive" msgstr "source inactive" @@ -4918,88 +4952,88 @@ msgid "never" msgstr "never" -#: classes/Gems/Util/Translated.php:143 +#: classes/Gems/Util/Translated.php:148 msgid "2 days ago" msgstr "2 days ago" -#: classes/Gems/Util/Translated.php:146 +#: classes/Gems/Util/Translated.php:151 msgid "Yesterday" msgstr "Yesterday" -#: classes/Gems/Util/Translated.php:149 +#: classes/Gems/Util/Translated.php:154 msgid "Today" msgstr "Today" -#: classes/Gems/Util/Translated.php:152 +#: classes/Gems/Util/Translated.php:157 msgid "Tomorrow" msgstr "Tomorrow" -#: classes/Gems/Util/Translated.php:155 +#: classes/Gems/Util/Translated.php:160 msgid "Over 2 days" msgstr "Over 2 days" -#: classes/Gems/Util/Translated.php:160 +#: classes/Gems/Util/Translated.php:165 #, php-format msgid "Over %d days" msgstr "Over %d days" -#: classes/Gems/Util/Translated.php:162 +#: classes/Gems/Util/Translated.php:167 #, php-format msgid "%d days ago" msgstr "%d days ago" -#: classes/Gems/Util/Translated.php:190 +#: classes/Gems/Util/Translated.php:192 #, php-format msgid "%d days %d:%s:%s" msgstr "%d days %d:%s:%s" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:194 #, php-format msgid "%d:%s:%s" msgstr "%d:%s:%s" -#: classes/Gems/Util/Translated.php:194 +#: classes/Gems/Util/Translated.php:196 #, php-format msgid "%d:%s" msgstr "%d:%s" -#: classes/Gems/Util/Translated.php:206 +#: classes/Gems/Util/Translated.php:208 msgid "Send multiple mails per respondent, one for each checked token." msgstr "Send multiple mails per patient, one for each checked token." -#: classes/Gems/Util/Translated.php:207 +#: classes/Gems/Util/Translated.php:209 msgid "Send one mail per respondent, mark all checked tokens as send." msgstr "Send one mail per patient, mark all checked tokens as send." -#: classes/Gems/Util/Translated.php:208 +#: classes/Gems/Util/Translated.php:210 msgid "Send one mail per respondent, mark only mailed tokens as send." msgstr "Send one mail per patient, mark only mailed tokens as send." -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Unknown" msgstr "Unknown" -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mr." msgstr "Mr." -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mrs." msgstr "Mrs." -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mr./mrs." msgstr "Mr./Mrs." -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mr." msgstr "Mr." -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mrs." msgstr "Mrs." -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mr./Mrs." msgstr "Mr./Mrs." @@ -5362,7 +5396,7 @@ msgstr "" "This organization cannot have any patients, please choose one that does:" -#: snippets/Organization/ChooseOrganizationSnippet.php:105 +#: snippets/Organization/ChooseOrganizationSnippet.php:101 msgid "This organization cannot have any respondents." msgstr "This organization cannot have any patients." Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-03-06 15:16:41 UTC (rev 1171) +++ trunk/library/languages/default-nl.po 2013-03-07 17:06:55 UTC (rev 1172) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-19 18:03+0100\n" +"POT-Creation-Date: 2013-03-07 18:05+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -73,12 +73,12 @@ msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1758 classes/Gems/Default/StaffAction.php:317 +#: classes/GemsEscort.php:1758 classes/Gems/Default/StaffAction.php:324 msgid "No access to page" msgstr "Geen toegang tot pagina" #: classes/GemsEscort.php:1760 classes/Gems/Default/OrganizationAction.php:106 -#: classes/Gems/Default/StaffAction.php:318 +#: classes/Gems/Default/StaffAction.php:325 #: classes/Gems/Model/HiddenOrganizationModel.php:115 #, php-format msgid "Access to this page is not allowed for current role: %s." @@ -258,7 +258,7 @@ #: classes/Gems/Menu.php:213 classes/Gems/Default/GroupAction.php:121 #: classes/Gems/Default/LogAction.php:193 -#: classes/Gems/Default/StaffAction.php:470 +#: classes/Gems/Default/StaffAction.php:481 msgid "Staff" msgstr "Medewerkers" @@ -323,8 +323,8 @@ #: classes/Gems/Default/TrackActionAbstract.php:219 #: classes/Gems/Default/TrackFieldsAction.php:96 #: classes/Gems/Email/OneMailForm.php:54 -#: classes/Gems/Export/RespondentExport.php:235 -#: classes/Gems/Export/RespondentExport.php:247 +#: classes/Gems/Export/RespondentExport.php:238 +#: classes/Gems/Export/RespondentExport.php:250 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:728 #: classes/Gems/Tracker/Model/StandardTokenModel.php:216 @@ -400,6 +400,7 @@ #: classes/Gems/Menu.php:586 classes/Gems/Default/GroupAction.php:122 #: classes/Gems/Default/OrganizationAction.php:154 #: classes/Gems/Default/RespondentAction.php:462 +#: classes/Gems/Default/RespondentNewAction.php:131 msgid "Respondents" msgstr "Patiënten" @@ -419,7 +420,7 @@ msgid "Track Builder" msgstr "Traject bouwer" -#: classes/Gems/Menu.php:610 classes/Gems/Export/RespondentExport.php:341 +#: classes/Gems/Menu.php:610 classes/Gems/Export/RespondentExport.php:344 msgid "Export" msgstr "Exporteer" @@ -433,6 +434,7 @@ msgstr "Changelog" #: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:93 +#: classes/Gems/Model/RespondentModel.php:179 #: classes/Gems/Tracker/Model/StandardTokenModel.php:213 msgid "Respondent nr" msgstr "Patiënt nr" @@ -441,7 +443,9 @@ #: classes/Gems/Default/IndexAction.php:229 #: classes/Gems/Default/LogAction.php:197 #: classes/Gems/Default/MailJobAction.php:98 -#: classes/Gems/Default/StaffAction.php:340 +#: classes/Gems/Default/StaffAction.php:347 +#: classes/Gems/Model/RespondentModel.php:174 +#: classes/Gems/Model/RespondentModel.php:227 #: classes/Gems/Snippets/Export/ReportHeaderSnippet.php:63 #: classes/Gems/User/Form/LayeredLoginForm.php:254 #: classes/Gems/User/Form/OrganizationFormAbstract.php:166 @@ -449,36 +453,44 @@ msgid "Organization" msgstr "Organisatie" -#: classes/Gems/Model.php:217 +#: classes/Gems/Model.php:217 classes/Gems/Model/RespondentModel.php:202 +#: classes/Gems/Model/RespondentModel.php:274 msgid "Opened" msgstr "Bekeken op" -#: classes/Gems/Model.php:218 +#: classes/Gems/Model.php:218 classes/Gems/Model/RespondentModel.php:205 +#: classes/Gems/Model/RespondentModel.php:279 msgid "Consent" msgstr "Toestemming" #: classes/Gems/Model.php:220 classes/Gems/Default/OptionAction.php:130 -#: classes/Gems/Default/StaffAction.php:330 +#: classes/Gems/Default/StaffAction.php:337 +#: classes/Gems/Model/RespondentModel.php:189 +#: classes/Gems/Model/RespondentModel.php:260 msgid "E-Mail" msgstr "Email" #: classes/Gems/Model.php:225 classes/Gems/Default/OptionAction.php:134 -#: classes/Gems/Default/StaffAction.php:343 +#: classes/Gems/Default/StaffAction.php:350 +#: classes/Gems/Model/RespondentModel.php:256 msgid "Gender" msgstr "Geslacht" #: classes/Gems/Model.php:226 classes/Gems/Default/OptionAction.php:131 -#: classes/Gems/Default/StaffAction.php:185 +#: classes/Gems/Default/StaffAction.php:192 +#: classes/Gems/Model/RespondentModel.php:248 msgid "First name" msgstr "Voornaam" #: classes/Gems/Model.php:227 classes/Gems/Default/OptionAction.php:132 -#: classes/Gems/Default/StaffAction.php:187 +#: classes/Gems/Default/StaffAction.php:194 +#: classes/Gems/Model/RespondentModel.php:250 msgid "Surname prefix" msgstr "Tussenvoegsel" #: classes/Gems/Model.php:228 classes/Gems/Default/OptionAction.php:133 -#: classes/Gems/Default/StaffAction.php:188 +#: classes/Gems/Default/StaffAction.php:195 +#: classes/Gems/Model/RespondentModel.php:253 msgid "Last name" msgstr "Achternaam" @@ -488,35 +500,43 @@ #: classes/Gems/Default/OrganizationAction.php:126 #: classes/Gems/Default/RoleAction.php:252 #: classes/Gems/Default/SourceAction.php:195 -#: classes/Gems/Default/StaffAction.php:328 +#: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/SurveyMaintenanceAction.php:435 #: classes/Gems/Default/TokenPlanAction.php:116 #: classes/Gems/Default/TrackFieldsAction.php:98 #: classes/Gems/Default/TrackMaintenanceAction.php:318 +#: classes/Gems/Model/RespondentModel.php:182 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:60 #: classes/Gems/Tracker/Model/TrackModel.php:98 msgid "Name" msgstr "Naam" -#: classes/Gems/Model.php:234 +#: classes/Gems/Model.php:234 classes/Gems/Model/RespondentModel.php:191 +#: classes/Gems/Model/RespondentModel.php:262 msgid "Street" msgstr "Straat" -#: classes/Gems/Model.php:235 +#: classes/Gems/Model.php:235 classes/Gems/Model/RespondentModel.php:192 +#: classes/Gems/Model/RespondentModel.php:263 msgid "Zipcode" msgstr "Postcode" #: classes/Gems/Model.php:236 #: classes/Gems/Default/RespondentPlanAction.php:134 +#: classes/Gems/Model/RespondentModel.php:193 +#: classes/Gems/Model/RespondentModel.php:264 msgid "City" msgstr "Woonplaats" -#: classes/Gems/Model.php:238 +#: classes/Gems/Model.php:238 classes/Gems/Model/RespondentModel.php:195 +#: classes/Gems/Model/RespondentModel.php:266 msgid "Phone" msgstr "Telefoon" #: classes/Gems/Model.php:240 #: classes/Gems/Default/RespondentPlanAction.php:133 +#: classes/Gems/Model/RespondentModel.php:198 +#: classes/Gems/Model/RespondentModel.php:269 msgid "Birthday" msgstr "Geboren op" @@ -540,11 +560,12 @@ msgid "Unable to run PDF conversion (%s): \"%s\"" msgstr "Kan PDF conversie (%s) niet starten: \"%s\"" -#: classes/Gems/Upgrades.php:91 +#: classes/Gems/Upgrades.php:92 msgid "Syncing surveys for all sources" msgstr "Vragenlijsten synchroniseren voor alle bronnen." -#: classes/Gems/Upgrades.php:151 classes/Gems/Upgrades.php:163 +#: classes/Gems/Upgrades.php:152 classes/Gems/Upgrades.php:164 +#: classes/Gems/Upgrades.php:186 msgid "Make sure to read the changelog as it contains important instructions" msgstr "Lees de wijzigingen, er kunnen belangrijke aanwijzingen in staan" @@ -564,7 +585,7 @@ #: classes/Gems/Controller/BrowseEditAction.php:357 #: classes/Gems/Controller/ModelSnippetActionAbstract.php:261 -#: classes/Gems/Default/StaffAction.php:228 +#: classes/Gems/Default/StaffAction.php:235 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:186 #, php-format msgid "New %s..." @@ -631,14 +652,14 @@ #: classes/Gems/Controller/BrowseEditAction.php:821 #: classes/Gems/Default/DatabaseAction.php:187 #: classes/Gems/Default/DatabaseAction.php:499 -#: classes/Gems/Default/StaffAction.php:276 +#: classes/Gems/Default/StaffAction.php:283 #: classes/Gems/Default/TrackAction.php:419 #: classes/Gems/Default/TrackRoundsAction.php:265 #: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:181 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:143 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:147 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:166 -#: classes/Gems/Util/Translated.php:267 +#: classes/Gems/Util/Translated.php:269 #: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:192 #: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:124 msgid "Yes" @@ -647,7 +668,7 @@ #: classes/Gems/Controller/BrowseEditAction.php:822 #: classes/Gems/Default/DatabaseAction.php:188 #: classes/Gems/Default/DatabaseAction.php:500 -#: classes/Gems/Default/StaffAction.php:277 +#: classes/Gems/Default/StaffAction.php:284 #: classes/Gems/Default/TrackAction.php:420 #: classes/Gems/Default/TrackRoundsAction.php:266 #: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:183 @@ -656,7 +677,7 @@ #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:167 #: classes/Gems/Util/ReceptionCodeLibrary.php:99 #: classes/Gems/Util/ReceptionCodeLibrary.php:123 -#: classes/Gems/Util/Translated.php:267 +#: classes/Gems/Util/Translated.php:269 #: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:194 #: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:125 msgid "No" @@ -861,7 +882,7 @@ #: classes/Gems/Default/TrackActionAbstract.php:220 #: classes/Gems/Default/TrackFieldsAction.php:101 #: classes/Gems/Default/UpgradeAction.php:176 -#: classes/Gems/Export/RespondentExport.php:236 +#: classes/Gems/Export/RespondentExport.php:239 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:734 #: classes/Gems/Tracker/Model/StandardTokenModel.php:214 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:150 @@ -1495,7 +1516,7 @@ #: classes/Gems/Default/IndexAction.php:436 #: classes/Gems/Default/OptionAction.php:94 -#: classes/Gems/Default/StaffAction.php:510 +#: classes/Gems/Default/StaffAction.php:521 msgid "New password is active." msgstr "Nieuwe wachtwoord geactiveerd." @@ -1866,8 +1887,8 @@ #: classes/Gems/Default/MailTemplateAction.php:76 #: classes/Gems/Default/RespondentAction.php:386 -#: classes/Gems/Default/StaffAction.php:335 -#: classes/Gems/Default/StaffAction.php:405 +#: classes/Gems/Default/StaffAction.php:342 +#: classes/Gems/Default/StaffAction.php:416 #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:75 #: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:75 msgid "(all organizations)" @@ -1894,7 +1915,7 @@ #: classes/Gems/Default/OptionAction.php:136 #: classes/Gems/Default/OrganizationAction.php:147 #: classes/Gems/Default/RespondentAction.php:195 -#: classes/Gems/Default/StaffAction.php:351 +#: classes/Gems/Default/StaffAction.php:359 msgid "Language" msgstr "Taal" @@ -2028,7 +2049,7 @@ msgstr "Dit kan nog niet gewijzigd worden" #: classes/Gems/Default/OrganizationAction.php:192 -#: classes/Gems/Default/StaffAction.php:158 +#: classes/Gems/Default/StaffAction.php:165 msgid "User Definition" msgstr "Gebruikers definitie" @@ -2217,7 +2238,7 @@ #: classes/Gems/Email/EmailFormAbstract.php:193 #: classes/Gems/Email/EmailFormAbstract.php:251 #: classes/Gems/Email/MailTemplateForm.php:81 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:112 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:108 #: classes/Gems/Tracker/Model/TrackModel.php:103 msgid "From" msgstr "Van" @@ -2330,19 +2351,23 @@ msgstr[1] "Ontvangst code" #: classes/Gems/Default/RespondentAction.php:127 +#: classes/Gems/Model/RespondentModel.php:320 #, php-format msgid "Random Example BSN: %s" msgstr "Willekeurig voorbeeld BSN: %s" #: classes/Gems/Default/RespondentAction.php:129 +#: classes/Gems/Model/RespondentModel.php:322 msgid "Enter a 9-digit SSN number." msgstr "Voer een BSN nummer van 9 cijfers in." #: classes/Gems/Default/RespondentAction.php:143 +#: classes/Gems/Model/RespondentModel.php:228 msgid "Identification" msgstr "Identificatie" #: classes/Gems/Default/RespondentAction.php:154 +#: classes/Gems/Model/RespondentModel.php:243 msgid "SSN" msgstr "BSN" @@ -2351,6 +2376,7 @@ msgstr "Patiënt nummer" #: classes/Gems/Default/RespondentAction.php:167 +#: classes/Gems/Model/RespondentModel.php:342 msgid "Medical data" msgstr "Medische gegevens" @@ -2383,11 +2409,13 @@ msgstr "Heeft de patiënt het \"informed consent\" formulier ondertekend?" #: classes/Gems/Default/RespondentAction.php:228 +#: classes/Gems/Model/RespondentModel.php:283 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Opmerkingen" #: classes/Gems/Default/RespondentAction.php:229 +#: classes/Gems/Model/RespondentModel.php:284 msgid "Treatment" msgstr "Behandeling" @@ -2423,6 +2451,7 @@ msgstr "Exporteer patiënt dossier" #: classes/Gems/Default/RespondentAction.php:457 +#: classes/Gems/Default/RespondentNewAction.php:142 msgid "respondent" msgid_plural "respondents" msgstr[0] "patiënt" @@ -2700,29 +2729,29 @@ msgid "Synchronize all sources." msgstr "Synchroniseer alle bronnen." -#: classes/Gems/Default/StaffAction.php:122 +#: classes/Gems/Default/StaffAction.php:129 msgid "password" msgstr "wachtwoord" -#: classes/Gems/Default/StaffAction.php:164 +#: classes/Gems/Default/StaffAction.php:171 msgid "Unsupported User Definition" msgstr "Onbekende User Definition" -#: classes/Gems/Default/StaffAction.php:193 +#: classes/Gems/Default/StaffAction.php:200 msgid "Users can only login when this box is checked." msgstr "Gebruikers kunnen alleen inloggen als dit is aangevinkt." -#: classes/Gems/Default/StaffAction.php:194 +#: classes/Gems/Default/StaffAction.php:201 msgid "If checked the user will logoff when answering a survey." msgstr "" "Indien actief, dan logt de gebruiker uit voor het beantwoorden van een " "vragenlijst." -#: classes/Gems/Default/StaffAction.php:211 +#: classes/Gems/Default/StaffAction.php:218 msgid "You are not allowed to edit this staff member." msgstr "U mag deze medewerker niet wijzigen." -#: classes/Gems/Default/StaffAction.php:268 +#: classes/Gems/Default/StaffAction.php:275 #, php-format msgid "" "User with id %s already exists but is deleted, do you want to reactivate the " @@ -2731,35 +2760,35 @@ "Gebruiker met inlognaam %s bestaat al maar is verwijderd, wilt u het account " "opnieuw activeren?" -#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1212 +#: classes/Gems/Default/StaffAction.php:334 classes/Gems/User/User.php:1212 #: classes/Gems/User/Form/OrganizationFormAbstract.php:232 msgid "Username" msgstr "Gebruikersnaam" -#: classes/Gems/Default/StaffAction.php:342 +#: classes/Gems/Default/StaffAction.php:349 msgid "Primary function" msgstr "Primaire functie" -#: classes/Gems/Default/StaffAction.php:352 +#: classes/Gems/Default/StaffAction.php:363 msgid "Can login" msgstr "Kan inloggen" -#: classes/Gems/Default/StaffAction.php:353 +#: classes/Gems/Default/StaffAction.php:364 msgid "Logout on survey" msgstr "Logout bij beantwoorden vragenlijst" -#: classes/Gems/Default/StaffAction.php:465 +#: classes/Gems/Default/StaffAction.php:476 msgid "staff member" msgid_plural "staff members" msgstr[0] "medewerker" msgstr[1] "medewerkers" -#: classes/Gems/Default/StaffAction.php:494 +#: classes/Gems/Default/StaffAction.php:505 #, php-format msgid "Reset password for: %s" msgstr "Verander het wachtwoord voor: %s" -#: classes/Gems/Default/StaffAction.php:497 +#: classes/Gems/Default/StaffAction.php:508 msgid "You are not allowed to change this password." msgstr "U mag dit wachtwoord niet wijzigen." @@ -3160,6 +3189,7 @@ msgstr "Per kenmerk plannen" #: classes/Gems/Default/TrackAction.php:121 +#: classes/Gems/Model/RespondentModel.php:246 #: snippets/DeleteInSourceTrackSnippet.php:82 snippets/EditTrackSnippet.php:72 msgid "Respondent number" msgstr "Patiënt nummer" @@ -3264,13 +3294,13 @@ msgstr "Traject %s toewijzen aan patiënt %s: %s" #: classes/Gems/Default/TrackActionAbstract.php:221 -#: classes/Gems/Export/RespondentExport.php:237 +#: classes/Gems/Export/RespondentExport.php:240 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:148 msgid "Enter the particulars concerning the assignment to this respondent." msgstr "Beschrijf de redenen om dit aan deze patiënt toe te wijzen." #: classes/Gems/Default/TrackActionAbstract.php:222 -#: classes/Gems/Export/RespondentExport.php:238 +#: classes/Gems/Export/RespondentExport.php:241 #: classes/Gems/Tracker/Model/StandardTokenModel.php:207 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:151 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:149 @@ -3279,7 +3309,7 @@ msgstr "Toewijzer" #: classes/Gems/Default/TrackActionAbstract.php:223 -#: classes/Gems/Export/RespondentExport.php:239 +#: classes/Gems/Export/RespondentExport.php:242 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:152 #: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:150 msgid "Start" @@ -3291,7 +3321,7 @@ msgstr "Afgelopen op" #: classes/Gems/Default/TrackActionAbstract.php:231 -#: classes/Gems/Export/RespondentExport.php:243 +#: classes/Gems/Export/RespondentExport.php:246 #: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:161 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:278 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 @@ -3692,7 +3722,7 @@ msgid "Show all answers for this survey type" msgstr "Toon alle antwoorden voor deze vragenlijst" -#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:73 +#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:86 msgid "Show all tokens for this survey in this track type" msgstr "Toon alle antwoorden voor deze vragenlijst in dit traject type" @@ -3737,15 +3767,15 @@ msgid "Single Survey" msgstr "Losse vragenlijst" -#: classes/Gems/Export/RespondentExport.php:251 +#: classes/Gems/Export/RespondentExport.php:254 msgid "Track information" msgstr "Traject informatie" -#: classes/Gems/Export/RespondentExport.php:326 +#: classes/Gems/Export/RespondentExport.php:329 msgid "Group surveys" msgstr "Groepeer vragenlijsten" -#: classes/Gems/Export/RespondentExport.php:331 +#: classes/Gems/Export/RespondentExport.php:334 msgid "Output format" msgstr "Uitvoerformaat" @@ -3939,6 +3969,10 @@ msgid "No script for %1$s." msgstr "Geen script voor %1$s:" +#: classes/Gems/Model/RespondentModel.php:251 +msgid "de, van der, 't, etc..." +msgstr "de, van der, 't, etc..." + #: classes/Gems/Selector/DateSelectorAbstract.php:309 msgid "<<" msgstr "<<" @@ -4629,12 +4663,12 @@ msgstr "Afnemend" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:157 -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Female" msgstr "Vrouw" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:158 -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Male" msgstr "Man" @@ -4875,11 +4909,11 @@ "Gebruiker niet gevonden of email adres onbekend of gebruiker kan niet " "gereset worden." -#: classes/Gems/Util/DbLookup.php:452 +#: classes/Gems/Util/DbLookup.php:457 msgid "inactive" msgstr "inactief" -#: classes/Gems/Util/DbLookup.php:453 +#: classes/Gems/Util/DbLookup.php:458 msgid "source inactive" msgstr "bron inactief" @@ -4963,91 +4997,91 @@ msgid "never" msgstr "nooit" -#: classes/Gems/Util/Translated.php:143 +#: classes/Gems/Util/Translated.php:148 msgid "2 days ago" msgstr "Eergisteren" -#: classes/Gems/Util/Translated.php:146 +#: classes/Gems/Util/Translated.php:151 msgid "Yesterday" msgstr "Gisteren" -#: classes/Gems/Util/Translated.php:149 +#: classes/Gems/Util/Translated.php:154 msgid "Today" msgstr "Vandaag" -#: classes/Gems/Util/Translated.php:152 +#: classes/Gems/Util/Translated.php:157 msgid "Tomorrow" msgstr "Morgen" -#: classes/Gems/Util/Translated.php:155 +#: classes/Gems/Util/Translated.php:160 msgid "Over 2 days" msgstr "Overmorgen" -#: classes/Gems/Util/Translated.php:160 +#: classes/Gems/Util/Translated.php:165 #, php-format msgid "Over %d days" msgstr "Over %d dagen" -#: classes/Gems/Util/Translated.php:162 +#: classes/Gems/Util/Translated.php:167 #, php-format msgid "%d days ago" msgstr "%d dagen terug" -#: classes/Gems/Util/Translated.php:190 +#: classes/Gems/Util/Translated.php:192 #, php-format msgid "%d days %d:%s:%s" msgstr "%d dagen %d:%s:%s" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:194 #, php-format msgid "%d:%s:%s" msgstr "%d:%s:%s" -#: classes/Gems/Util/Translated.php:194 +#: classes/Gems/Util/Translated.php:196 #, php-format msgid "%d:%s" msgstr "%d:%s" -#: classes/Gems/Util/Translated.php:206 +#: classes/Gems/Util/Translated.php:208 msgid "Send multiple mails per respondent, one for each checked token." msgstr "Verstuur meerdere emails per patiënt, één per gekozen kenmerk." -#: classes/Gems/Util/Translated.php:207 +#: classes/Gems/Util/Translated.php:209 msgid "Send one mail per respondent, mark all checked tokens as send." msgstr "" "Verstuur één email per patiënt, zet alle gekozen kenmerken op verzonden." -#: classes/Gems/Util/Translated.php:208 +#: classes/Gems/Util/Translated.php:210 msgid "Send one mail per respondent, mark only mailed tokens as send." msgstr "" "Verstuur één email per patiënt, zet alleen de verzonden kenmerken op " "verzonden." -#: classes/Gems/Util/Translated.php:233 +#: classes/Gems/Util/Translated.php:235 msgid "Unknown" msgstr "Onbekend" -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mr." msgstr "meneer" -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mrs." msgstr "mevrouw" -#: classes/Gems/Util/Translated.php:246 +#: classes/Gems/Util/Translated.php:248 msgid "mr./mrs." msgstr "heer/mevrouw" -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mr." msgstr "De heer" -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mrs." msgstr "Mevrouw" -#: classes/Gems/Util/Translated.php:259 +#: classes/Gems/Util/Translated.php:261 msgid "Mr./Mrs." msgstr "De heer/Mevrouw" @@ -5416,7 +5450,7 @@ msgstr "" "Deze organisatie heeft geen patiënten. Kies een organisatie met patiënten." -#: snippets/Organization/ChooseOrganizationSnippet.php:105 +#: snippets/Organization/ChooseOrganizationSnippet.php:101 msgid "This organization cannot have any respondents." msgstr "Deze organisatie heeft geen patiënten." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-06 15:16:44
|
Revision: 1171 http://sourceforge.net/p/gemstracker/code/1171 Author: matijsdejong Date: 2013-03-06 15:16:41 +0000 (Wed, 06 Mar 2013) Log Message: ----------- Spell correction Modified Paths: -------------- trunk/library/classes/Gems/Event/RoundChangedEventInterface.php Modified: trunk/library/classes/Gems/Event/RoundChangedEventInterface.php =================================================================== --- trunk/library/classes/Gems/Event/RoundChangedEventInterface.php 2013-03-05 17:53:39 UTC (rev 1170) +++ trunk/library/classes/Gems/Event/RoundChangedEventInterface.php 2013-03-06 15:16:41 UTC (rev 1171) @@ -37,7 +37,7 @@ /** * After a round has changed/completed run this code. * - * As it passes Gemns_Tracker objects it is more powerfull than survey completion events, + * As it passes Gems_Tracker objects it is more powerfull than survey completion events, * but then the code may be more difficult to implement. * * @package Gems This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-05 17:53:43
|
Revision: 1170 http://sourceforge.net/p/gemstracker/code/1170 Author: matijsdejong Date: 2013-03-05 17:53:39 +0000 (Tue, 05 Mar 2013) Log Message: ----------- Made JoinTransformer.php easier to extend in specialized circumstances The from Html element now returns the added Html element on __call instead of the object itself Organization_ChooseOrganizationSnippet uses .larger class instead of inline stle attribute Sorted functions in TrackData.php Modified Paths: -------------- trunk/library/classes/Gems/Util/TrackData.php trunk/library/classes/MUtil/Form/Element/Html.php trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php trunk/library/snippets/Organization/ChooseOrganizationSnippet.php Modified: trunk/library/classes/Gems/Util/TrackData.php =================================================================== --- trunk/library/classes/Gems/Util/TrackData.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/Gems/Util/TrackData.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -204,6 +204,22 @@ } /** + * Returns array (id => name) of all 'T' tracks, sorted alphabetically + * @return array + */ + public function getSteppedTracks() + { + static $tracks; + + if (! $tracks) { + $tracks = $this->db->fetchPairs("SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_track_type = 'T' ORDER BY gtr_track_name"); + } + + return $tracks; + } + + /** + * Get all the surveys for a certain code * * @param string $code * @return array survey id => survey name @@ -228,22 +244,6 @@ } /** - * Returns array (id => name) of all 'T' tracks, sorted alphabetically - * @return array - */ - public function getSteppedTracks() - { - static $tracks; - - if (! $tracks) { - $tracks = $this->db->fetchPairs("SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_track_type = 'T' ORDER BY gtr_track_name"); - } - - return $tracks; - } - - - /** * Returns array (id => name) of the track date fields for this track, sorted by order * * @param int $trackId Modified: trunk/library/classes/MUtil/Form/Element/Html.php =================================================================== --- trunk/library/classes/MUtil/Form/Element/Html.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/MUtil/Form/Element/Html.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -51,7 +51,7 @@ * * @param string $method * @param array $args - * @return string + * @return MUtil_Html_HtmlElement or at least something that implements the MUtil_Html_HtmlInterface interface * @throws Zend_Form_Exception for invalid decorator or invalid method call */ public function __call($method, $args) @@ -70,7 +70,7 @@ $value->append($elem); $this->setValue($value); - return $this; + return $elem; } /** Modified: trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php =================================================================== --- trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -133,63 +133,75 @@ } foreach ($this->_subModels as $name => $sub) { - /* @var $sub MUtil_Model_ModelAbstract */ + $this->transformSubModel($model, $sub, $data, $name); + } + // MUtil_Echo::track($data); - if (1 === count($this->_joins[$name])) { - $mkey = key($this->_joins[$name]); - $skey = reset($this->_joins[$name]); + return $data; + } - $mfor = MUtil_Ra::column($mkey, $data); + /** + * Function to allow overruling of transform for certain models + * + * @param MUtil_Model_ModelAbstract $model + * @param MUtil_Model_ModelAbstract $sub + * @param array $data + * @param string $name + */ + protected function transformSubModel + (MUtil_Model_ModelAbstract $model, MUtil_Model_ModelAbstract $sub, array &$data, $name) + { + if (1 === count($this->_joins[$name])) { + $mkey = key($this->_joins[$name]); + $skey = reset($this->_joins[$name]); - // MUtil_Echo::track($mfor); + $mfor = MUtil_Ra::column($mkey, $data); - $sdata = $sub->load(array($skey => $mfor)); - // MUtil_Echo::track($sdata); + // MUtil_Echo::track($mfor); - if ($sdata) { - $skeys = array_flip(MUtil_Ra::column($skey, $sdata)); - $empty = array_fill_keys(array_keys(reset($sdata)), null); + $sdata = $sub->load(array($skey => $mfor)); + // MUtil_Echo::track($sdata); - foreach ($data as &$mrow) { - $mfind = $mrow[$mkey]; + if ($sdata) { + $skeys = array_flip(MUtil_Ra::column($skey, $sdata)); + $empty = array_fill_keys(array_keys(reset($sdata)), null); - if (isset($skeys[$mfind])) { - $mrow += $sdata[$skeys[$mfind]]; - } else { - $mrow += $empty; - } - } - } else { - $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { + $mfind = $mrow[$mkey]; - foreach ($data as &$mrow) { + if (isset($skeys[$mfind])) { + $mrow += $sdata[$skeys[$mfind]]; + } else { $mrow += $empty; } } } else { $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { - $filter = $sub->getFilter(); - foreach ($this->_joins[$name] as $from => $to) { - if (isset($mrow[$from])) { - $filter[$to] = $mrow[$from]; - } + $mrow += $empty; + } + } + } else { + $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { + $filter = $sub->getFilter(); + foreach ($this->_joins[$name] as $from => $to) { + if (isset($mrow[$from])) { + $filter[$to] = $mrow[$from]; } + } - $sdata = $sub->loadFirst($filter); + $sdata = $sub->loadFirst($filter); - if ($sdata) { - $mrow += $sdata; - } else { - $mrow += $empty; - } + if ($sdata) { + $mrow += $sdata; + } else { + $mrow += $empty; + } - // MUtil_Echo::track($sdata, $mrow); - } + // MUtil_Echo::track($sdata, $mrow); } } - // MUtil_Echo::track($data); - - return $data; } } Modified: trunk/library/snippets/Organization/ChooseOrganizationSnippet.php =================================================================== --- trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -95,7 +95,7 @@ foreach ($orgs as $orgId => $name) { $url['org'] = $orgId; - $html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); + $html->pInfo()->actionLink($url, $name)->appendAttrib('class', 'larger'); } } else { $html->pInfo($this->_('This organization cannot have any respondents.')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-05 17:51:14
|
Revision: 1169 http://sourceforge.net/p/gemstracker/code/1169 Author: matijsdejong Date: 2013-03-05 17:51:12 +0000 (Tue, 05 Mar 2013) Log Message: ----------- Added .larger class for displaying objects slightly larger Modified Paths: -------------- trunk/new_project/htdocs/gems/css/gems-fluid.css trunk/new_project/htdocs/gems/css/gems-new.css trunk/new_project/htdocs/gems/css/gems.css Modified: trunk/new_project/htdocs/gems/css/gems-fluid.css =================================================================== --- trunk/new_project/htdocs/gems/css/gems-fluid.css 2013-03-04 19:47:58 UTC (rev 1168) +++ trunk/new_project/htdocs/gems/css/gems-fluid.css 2013-03-05 17:51:12 UTC (rev 1169) @@ -255,6 +255,10 @@ font-weight: bold; } +.larger { + font-size: 120% !important; +} + .leftFloat { float: left; margin-right: 0.4em; Modified: trunk/new_project/htdocs/gems/css/gems-new.css =================================================================== --- trunk/new_project/htdocs/gems/css/gems-new.css 2013-03-04 19:47:58 UTC (rev 1168) +++ trunk/new_project/htdocs/gems/css/gems-new.css 2013-03-05 17:51:12 UTC (rev 1169) @@ -311,6 +311,10 @@ font-weight: bold; } +.larger { + font-size: 120% !important; +} + .leftFloat { float: left; margin-right: 0.4em; Modified: trunk/new_project/htdocs/gems/css/gems.css =================================================================== --- trunk/new_project/htdocs/gems/css/gems.css 2013-03-04 19:47:58 UTC (rev 1168) +++ trunk/new_project/htdocs/gems/css/gems.css 2013-03-05 17:51:12 UTC (rev 1169) @@ -238,6 +238,10 @@ font-weight: bold; } +.larger { + font-size: 120% !important; +} + .leftFloat { float: left; margin-right: 0.4em; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-04 19:48:01
|
Revision: 1168 http://sourceforge.net/p/gemstracker/code/1168 Author: matijsdejong Date: 2013-03-04 19:47:58 +0000 (Mon, 04 Mar 2013) Log Message: ----------- Moved updated versions of these documents to the Wiki Removed Paths: ------------- trunk/library/docs/gems_defintions.doc trunk/library/docs/gems_survey_activation.doc Deleted: trunk/library/docs/gems_defintions.doc =================================================================== (Binary files differ) Deleted: trunk/library/docs/gems_survey_activation.doc =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-28 17:40:34
|
Revision: 1167 http://sourceforge.net/p/gemstracker/code/1167 Author: matijsdejong Date: 2013-02-28 17:40:31 +0000 (Thu, 28 Feb 2013) Log Message: ----------- FormBridge.php supports FakeSubmit elements ModelSnippetActionAbstract can now apply multicolumn display through getBrowseColumns() Moving RespondentModel.php settings to object itself ModelTabFormSnippetGeneric.php now knows how to generate tabbed forms from the Model/RespondentModel.php Small generalization of TabForm.php DbLookup->getOrganizationsWithRespondents() shows all organizations that could have a respondent Translated->formatDateTime returns null when the date input is not a real date Started on RespondentNewAction.php Modified Paths: -------------- trunk/library/classes/Gems/Communication/RespondentModelWriter.php trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/Gems/Util/Translated.php trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php trunk/library/classes/MUtil/Model/FormBridge.php trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php trunk/library/snippets/Organization/ChooseOrganizationSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Default/RespondentNewAction.php Modified: trunk/library/classes/Gems/Communication/RespondentModelWriter.php =================================================================== --- trunk/library/classes/Gems/Communication/RespondentModelWriter.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/Communication/RespondentModelWriter.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -3,7 +3,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -32,7 +32,7 @@ /** * Writer implementation to save respondents to the database - * + * * @author Michiel Rook <mi...@to...> * @version $Id$ * @package Gems @@ -44,22 +44,22 @@ * @var Gems_Model_RespondentModel */ private $_model = null; - + public function __construct() { - $this->_model = GemsEscort::getInstance()->getLoader()->getModels()->getRespondentModel(true); + $this->_model = GemsEscort::getInstance()->getLoader()->getModels()->createRespondentModel(); } - + /** * - Fetches respondent based on bsn / reception code and patient nr * - Creates the respondent if it does not exist, updates otherwise - * + * * @see Gems_Model_RespondentModel * @see Gems_Communication_RespondentWriter::writeRespondent() * * @param Gems_Communication_RespondentContainer $respondent * @param int $userId - * @return boolean True if a new respondent was added, false if one was updated + * @return boolean True if a new respondent was added, false if one was updated */ public function writeRespondent(Gems_Communication_RespondentContainer $respondent, &$userId) { @@ -70,17 +70,17 @@ 'gr2o_patient_nr' => $respondent->getPatientId() ) ); - + $data = $this->_model->loadFirst(); $isNew = false; - + if (empty($data)) { $isNew = true; $data = $this->_model->loadNew(); } - + unset($data['grs_email']); - + $data['gr2o_patient_nr'] = $respondent->getPatientId(); $data['grs_first_name'] = $respondent->getFirstName(); $data['grs_last_name'] = $respondent->getLastName(); @@ -88,11 +88,11 @@ $data['grs_ssn'] = $respondent->getBsn(); $data['grs_gender'] = $respondent->getGender(); $data['grs_birthday'] = $respondent->getBirthday(); - + $data = $this->_model->save($data); - + $userId = $data['grs_id_user']; - + return $isNew; } } \ No newline at end of file Added: trunk/library/classes/Gems/Default/RespondentNewAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentNewAction.php (rev 0) +++ trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -0,0 +1,159 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: RespondentNewAction.php$ + */ + +/** + * + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +abstract class Gems_Default_RespondentNewAction extends Gems_Controller_ModelSnippetActionAbstract +{ + /** + * The snippets used for the create and edit actions. + * + * @var mixed String or array of snippets name + */ + protected $createEditSnippets = 'ModelTabFormSnippetGeneric'; + + /** + * + * @var Gems_Loader + */ + public $loader; + + /** + * 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 MUtil_Model_ModelAbstract + */ + protected function createModel($detailed, $action) + { + $model = $this->loader->getModels()->createRespondentModel(); + + if (! $detailed) { + return $model->applyBrowseSettings(); + } + + switch ($action) { + case 'create': + case 'edit': + return $model->applyEditSettings(); + + default: + return $model->applyDetailSettings(); + } + } + + /** + * Set column usage to use for the browser. + * + * Must be an array of arrays containing the input for TableBridge->setMultisort() + * + * @return array or false + */ + public function getBrowseColumns() + { + $model = $this->getModel(); + + $model->setIfExists('gr2o_opened', 'tableDisplay', 'small'); + $model->setIfExists('grs_email', 'formatFunction', 'MUtil_Html_AElement::ifmail'); + + // Newline placeholder + $br = MUtil_Html::create('br'); + + // Display separator and phone sign only if phone exist. + $phonesep = MUtil_Html::raw('☏ '); // $bridge->itemIf($bridge->grs_phone_1, MUtil_Html::raw('☏ ')); + $citysep = MUtil_Html::raw(' '); // $bridge->itemIf($bridge->grs_zipcode, MUtil_Html::raw(' ')); + + if ($this->loader->getCurrentUser()->hasPrivilege('pr.respondent.multiorg')) { + $columns[] = array('gr2o_patient_nr', $br, 'gr2o_id_organization'); + } else { + $columns[] = array('gr2o_patient_nr', $br, 'gr2o_opened'); + } + $columns[] = array('name', $br, 'grs_email'); + $columns[] = array('grs_address_1', $br, 'grs_zipcode', $citysep, 'grs_city'); + $columns[] = array('grs_birthday', $br, $phonesep, 'grs_phone_1'); + + return $columns; + } + + /** + * Helper function to get the title for the index action. + * + * @return $string + */ + public function getIndexTitle() + { + return $this->_('Respondents'); + } + + /** + * Helper function to allow generalized statements about the items in the model. + * + * @param int $count + * @return $string + */ + public function getTopic($count = 1) + { + return $this->plural('respondent', 'respondents', $count);; + } + + /** + * Overrule default index for the case that the current + * organization cannot have users. + */ + public function indexAction() + { + $user = $this->loader->getCurrentUser(); + + if ($user->hasPrivilege('pr.respondent.multiorg') || $user->getCurrentOrganization()->canHaveRespondents()) { + parent::indexAction(); + } else { + $this->addSnippet('Organization_ChooseOrganizationSnippet'); + } + } +} Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -69,6 +69,14 @@ */ protected $project; + /** + * @var Gems_Util + */ + protected $util; + + /** + * Self constructor + */ public function __construct() { // gems__respondents MUST be first table for INSERTS!! @@ -84,8 +92,12 @@ $this->setOnSave('gr2o_opened_by', GemsEscort::getInstance()->session->user_id); $this->setSaveOnChange('gr2o_opened_by'); + if (! $this->has('grs_ssn')) { + $this->hashSsn = self::SSN_HIDE; + } if (self::SSN_HASH === $this->hashSsn) { - $this->setSaveWhenNotNull('grs_ssn'); + $this->setSaveWhen('grs_ssn', array($this, 'whenSSN')); + $this->setOnLoad('grs_ssn', array($this, 'saveSSN')); $this->setOnSave('grs_ssn', array($this, 'formatSSN')); } } @@ -145,6 +157,201 @@ } /** + * Set those settings needed for the browse display + * + * @return \Gems_Model_RespondentModel + */ + public function applyBrowseSettings() + { + $dbLookup = $this->util->getDbLookup(); + $translated = $this->util->getTranslated(); + $translator = $this->translate->getAdapter(); + + $this->resetOrder(); + + if ($this->has('gr2o_id_organization') && $this->isMultiOrganization()) { + $this->set('gr2o_id_organization', + 'label', $translator->_('Organization'), + 'multiOptions', $dbLookup->getOrganizationsWithRespondents() + ); + } + + $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent nr')); + + $this->set('name', + 'label', $translator->_('Name'), + 'column_expression', "CONCAT( + COALESCE(CONCAT(grs_last_name, ', '), '-, '), + COALESCE(CONCAT(grs_first_name, ' '), ''), + COALESCE(grs_surname_prefix, ''))", + 'fieldlist', array('grs_last_name', 'grs_first_name', 'grs_surname_prefix')); + + $this->setIfExists('grs_email', 'label', $translator->_('E-Mail')); + + $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); + $this->setIfExists('grs_zipcode', 'label', $translator->_('Zipcode')); + $this->setIfExists('grs_city', 'label', $translator->_('City')); + + $this->setIfExists('grs_phone_1', 'label', $translator->_('Phone')); + + $this->setIfExists('grs_birthday', + 'label', $translator->_('Birthday'), + 'dateFormat', Zend_Date::DATE_MEDIUM); + + $this->setIfExists('gr2o_opened', + 'label', $translator->_('Opened'), + 'formatFunction', $translated->formatDateTime); + $this->setIfExists('gr2o_consent', + 'label', $translator->_('Consent'), + 'multiOptions', $dbLookup->getUserConsents() + ); + + return $this; + } + + /** + * Set those settings needed for the detailed display + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyDetailSettings($locale = null) + { + $dbLookup = $this->util->getDbLookup(); + $translated = $this->util->getTranslated(); + $translator = $this->translate->getAdapter(); + + $this->resetOrder(); + if ($this->has('gr2o_id_organization')) { + $this->set('gr2o_id_organization', + 'label', $translator->_('Organization'), + 'tab', $translator->_('Identification') + ); + + if ($this->isMultiOrganization()) { + $user = $this->loader->getCurrentUser(); + + $this->set('gr2o_id_organization', + 'default', $user->getCurrentOrganizationId(), + 'multiOptions', $user->getRespondentOrganizations() + ); + } + } + + // The SSN + if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { + $this->set('grs_ssn', 'label', $translator->_('SSN')); + } + + $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent number')); + + $this->setIfExists('grs_first_name', 'label', $translator->_('First name')); + $this->setIfExists('grs_surname_prefix', + 'label', $translator->_('Surname prefix'), + 'description', $translator->_('de, van der, \'t, etc...') + ); + $this->setIfExists('grs_last_name', 'label', $translator->_('Last name')); + + $this->setIfExists('grs_gender', + 'label', $translator->_('Gender'), + 'multiOptions', $translated->getGenderHello() + ); + + $this->setIfExists('grs_email', 'label', $translator->_('E-Mail')); + + $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); + $this->setIfExists('grs_zipcode', 'label', $translator->_('Zipcode')); + $this->setIfExists('grs_city', 'label', $translator->_('City')); + + $this->setIfExists('grs_phone_1', 'label', $translator->_('Phone')); + + $this->setIfExists('grs_birthday', + 'label', $translator->_('Birthday'), + 'dateFormat', Zend_Date::DATE_MEDIUM + ); + + $this->setIfExists('gr2o_opened', + 'label', $translator->_('Opened'), + 'formatFunction', $translated->formatDateTime + ); + + $this->setIfExists('gr2o_consent', + 'label', $translator->_('Consent'), + 'multiOptions', $dbLookup->getUserConsents() + ); + + $this->set('gr2o_comments', 'label', $translator->_('Comments')); + $this->set('gr2o_treatment', 'label', $translator->_('Treatment')); + + $this->addColumn('CASE WHEN grs_email IS NULL OR LENGTH(TRIM(grs_email)) = 0 THEN 1 ELSE 0 END', 'calc_email'); + + return $this; + } + + /** + * Set those values needed for editing + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyEditSettings($locale = null) + { + $this->applyDetailSettings($locale); + $this->copyKeys(); // The user can edit the keys. + + $translated = $this->util->getTranslated(); + $translator = $this->translate->getAdapter(); + $ucfirst = new Zend_Filter_Callback('ucfirst'); + + if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { + $this->set('grs_ssn', + 'size', 10, + 'maxlength', 12, + 'filter', 'Digits'); + + if (APPLICATION_ENV !== 'production') { + $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); + $num = mt_rand(100000000, 999999999); + + while (! $bsn->isValid($num)) { + $num++; + } + + $this->setIfExists('grs_ssn', 'description', sprintf($translator->_('Random Example BSN: %s'), $num)); + } else { + $this->setIfExists('grs_ssn', 'description', $translator->_('Enter a 9-digit SSN number.')); + } + } + + $this->setIfExists('gr2o_patient_nr', + 'size', 15, + 'minlength', 4, + 'validator', $this->createUniqueValidator( + array('gr2o_patient_nr', 'gr2o_id_organization'), + array('gr2o_id_user' => 'grs_id_user', 'gr2o_id_organization') + ) + ); + + $this->setIfExists('grs_first_name', 'filter', $ucfirst); + $this->setIfExists('grs_last_name', 'filter', $ucfirst, 'required', true); + + $this->setIfExists('grs_gender', + 'elementClass', 'Radio', + 'separator', '', + 'multiOptions', $translated->getGenders(), + 'tab', $translator->_('Medical data') + ); + + $this->setIfExists('gr2o_opened', 'elementClass', 'Exhibitor'); + + $this->setIfExists('gr2o_consent', 'default', $this->util->getDefaultConsent()); + + $this->setIfExists('grs_iso_lang', 'default', 'nl'); + + return $this; + } + + /** * Apply hash function for array_walk_recursive in _checkFilterUsed() * * @see _checkFilterUsed() @@ -159,22 +366,6 @@ } } - /** - * Return a hashed version of the input value. - * - * @param mixed $value The value being saved - * @param boolean $isNew True when a new item is being saved - * @param string $name The name of the current field - * @param array $context Optional, the other values being saved - * @return string The salted hash as a 32-character hexadecimal number. - */ - public function formatSSN($value, $isNew = false, $name = null, array $context = array()) - { - if ($value) { - return $this->project->getValueHash($value); - } - } - public function copyKeys($reset = false) { $keys = $this->_getKeysFor('gems__respondent2org'); @@ -196,6 +387,22 @@ } /** + * Return a hashed version of the input value. + * + * @param mixed $value The value being saved + * @param boolean $isNew True when a new item is being saved + * @param string $name The name of the current field + * @param array $context Optional, the other values being saved + * @return string The output to display + */ + public function hideSSN($value, $isNew = false, $name = null, array $context = array()) + { + if ($value) { + return str_repeat('*', 9); + } + } + + /** * True when the default filter can contain multiple organizations * * @return boolean @@ -205,5 +412,35 @@ // return ($this->user->hasPrivilege('pr.respondent.multiorg') && (! $this->user->getCurrentOrganization()->canHaveRespondents())); return $this->user->hasPrivilege('pr.respondent.multiorg'); } + + /** + * Return a hashed version of the input value. + * + * @param mixed $value The value being saved + * @param boolean $isNew True when a new item is being saved + * @param string $name The name of the current field + * @param array $context Optional, the other values being saved + * @return string The salted hash as a 32-character hexadecimal number. + */ + public function saveSSN($value, $isNew = false, $name = null, array $context = array()) + { + if ($value) { + return $this->project->getValueHash($value); + } + } + + /** + * Return a hashed version of the input value. + * + * @param mixed $value The value being saved + * @param boolean $isNew True when a new item is being saved + * @param string $name The name of the current field + * @param array $context Optional, the other values being saved + * @return boolean + */ + public function whenSSN($value, $isNew = false, $name = null, array $context = array()) + { + return $value && ($value !== $this->hideSSN($value, $isNew, $name, $context)); + } } Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -54,6 +54,67 @@ protected $_form; /** + * Adds elements from the model to the bridge that creates the form. + * + * Overrule this function to add different elements to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_FormBridge $bridge + * @param MUtil_Model_ModelAbstract $model + */ + protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) + { + //Get all elements in the model if not already done + $this->initItems(); + + // Add 'tooltip' to the allowed displayoptions + $displayOptions = $bridge->getAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS); + if (!array_search('tooltip', $displayOptions)) { + $displayOptions[] = 'tooltip'; + } + $bridge->setAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS, $displayOptions); + + $tab = 0; + $group = 0; + foreach ($model->getItemsOrdered() as $name) { + // Get all options at once + $modelOptions = $model->get($name); + if ($tabName = $model->get($name, 'tab')) { + $bridge->addTab('tab' . $tab, 'value', $tabName); + $tab++; + } + + if ($model->has($name, 'label')) { + $bridge->add($name); + + if ($theName = $model->get('startGroup')) { + //We start a new group here! + $groupElements = array(); + $groupElements[] = $name; + $groupName = $theName; + } elseif ($theName = $model->get('endGroup')) { + //Ok, last element define the group + $groupElements[] = $name; + $bridge->addDisplayGroup('grp_' . $groupElements[0], $groupElements, + 'description', $groupName, + 'showLabels', ($theName == 'showLabels'), + 'class', 'grp' . $group); + $group++; + unset($groupElements); + unset($groupName); + } else { + //If we are in a group, add the elements to the group + if (isset($groupElements)) { + $groupElements[] = $name; + } + } + } else { + $bridge->addHidden($name); + } + } + } + + /** * Simple default function for making sure there is a $this->_saveButton. * * As the save button is not part of the model - but of the interface - it Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/TabForm.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -128,7 +128,9 @@ */ public function addTab($name, $title) { - if ($title instanceof MUtil_Html_Sequence) $title = $title->render($form->getView()); + if ($title instanceof MUtil_Html_HtmlInterface) { + $title = $title->render($this->getView()); + } $tab = new Gems_Form_TabSubForm(array('name' => $name, 'title' => strip_tags($title))); $this->currentTab = $tab; $this->addSubForm($tab, $name); @@ -247,13 +249,13 @@ * As addElement and addDisplayGroup provide a fluent way of working with subforms * we need to provide a method to skip back to the main form again. */ - public function resetContext() { + public function resetContext() { $this->currentTab = null; } /** * Select a tab by it's numerical index - * + * * @param int $tabIdx */ public function selectTab($tabIdx) { @@ -276,7 +278,7 @@ } parent::setView($view); - + if ($this->_view !== $view) { $this->activateJQuery(); if (false === $view->getPluginLoader('helper')->getPaths('Gems_JQuery_View_Helper')) { Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/Util/DbLookup.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -337,7 +337,12 @@ static $organizations; if (! $organizations) { - $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 AND gor_has_respondents=1 ORDER BY gor_name'); + $organizations = $this->db->fetchPairs( + 'SELECT gor_id_organization, gor_name + FROM gems__organizations + WHERE gor_active = 1 AND (gor_has_respondents = 1 OR gor_add_respondents = 1) + ORDER BY gor_name' + ); natsort($organizations); } Modified: trunk/library/classes/Gems/Util/Translated.php =================================================================== --- trunk/library/classes/Gems/Util/Translated.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/Gems/Util/Translated.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -126,48 +126,50 @@ public function formatDateTime($dateTimeValue) { - if ($dateTimeValue) { - //$dateTime = strtotime($dateTimeValue); - // MUtil_Echo::track($dateTimeValue, date('c', $dateTime), $dateTime / 86400, date('c', time()), time() / 86400); - // TODO: Timezone seems to screw this one up - //$days = floor($dateTime / 86400) - floor(time() / 86400); // 86400 = 24*60*60 - if ($dateTimeValue instanceof MUtil_Date) { - $dateTime = clone $dateTimeValue; - } else { - $dateTime = new MUtil_Date($dateTimeValue, Zend_Date::ISO_8601); - } - $days = $dateTime->diffDays(); + if (! $dateTimeValue) { + return null; + } - switch ($days) { - case -2: - return $this->_('2 days ago'); + //$dateTime = strtotime($dateTimeValue); + // MUtil_Echo::track($dateTimeValue, date('c', $dateTime), $dateTime / 86400, date('c', time()), time() / 86400); + // TODO: Timezone seems to screw this one up + //$days = floor($dateTime / 86400) - floor(time() / 86400); // 86400 = 24*60*60 + if ($dateTimeValue instanceof MUtil_Date) { + $dateTime = clone $dateTimeValue; + } elseif (MUtil_Date::isDate($dateTimeValue, Zend_Date::ISO_8601)) { + $dateTime = new MUtil_Date($dateTimeValue, Zend_Date::ISO_8601); + } else { + return null; + } + $days = $dateTime->diffDays(); - case -1: - return $this->_('Yesterday'); + switch ($days) { + case -2: + return $this->_('2 days ago'); - case 0: - return $this->_('Today'); + case -1: + return $this->_('Yesterday'); - case 1: - return $this->_('Tomorrow'); + case 0: + return $this->_('Today'); - case 2: - return $this->_('Over 2 days'); + case 1: + return $this->_('Tomorrow'); - default: - if (($days > -14) && ($days < 14)) { - if ($days > 0) { - return sprintf($this->_('Over %d days'), $days); - } else { - return sprintf($this->_('%d days ago'), -$days); - } + case 2: + return $this->_('Over 2 days'); + + default: + if (($days > -14) && ($days < 14)) { + if ($days > 0) { + return sprintf($this->_('Over %d days'), $days); + } else { + return sprintf($this->_('%d days ago'), -$days); } + } - return date($this->phpDateFormatString, $dateTime->getTimestamp()); // . ' (' . $days . ')'; - } + return date($this->phpDateFormatString, $dateTime->getTimestamp()); // . ' (' . $days . ')'; } - - return null; } /** Modified: trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -113,7 +113,7 @@ * * @var array Mixed key => value array for snippet initialization */ - protected $autofilterParameters = array(); + protected $autofilterParameters = array('columns' => 'getBrowseColumns'); /** * The snippets used for the autofilter action. @@ -380,6 +380,18 @@ } /** + * Set column usage to use for the browser. + * + * Must be an array of arrays containing the input for TableBridge->setMultisort() + * + * @return array or false + */ + public function getBrowseColumns() + { + return false; + } + + /** * Returns the model for the current $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -50,19 +50,20 @@ */ class MUtil_Model_FormBridge { - const AUTO_OPTIONS = 'auto'; - const CHECK_OPTIONS = 'check'; - const DATE_OPTIONS = 'date'; - const DISPLAY_OPTIONS = 'display'; - const EXHIBIT_OPTIONS = 'exhibit'; - const FILE_OPTIONS = 'file'; - const GROUP_OPTIONS = 'displaygroup'; - const JQUERY_OPTIONS = 'jquery'; - const MULTI_OPTIONS = 'multi'; - const PASSWORD_OPTIONS = 'password'; - const TAB_OPTIONS = 'tab'; - const TEXT_OPTIONS = 'text'; - const TEXTAREA_OPTIONS = 'textarea'; + const AUTO_OPTIONS = 'auto'; + const CHECK_OPTIONS = 'check'; + const DATE_OPTIONS = 'date'; + const DISPLAY_OPTIONS = 'display'; + const EXHIBIT_OPTIONS = 'exhibit'; + const FAKESUBMIT_OPTIONS = 'fakesubmit'; + const FILE_OPTIONS = 'file'; + const GROUP_OPTIONS = 'displaygroup'; + const JQUERY_OPTIONS = 'jquery'; + const MULTI_OPTIONS = 'multi'; + const PASSWORD_OPTIONS = 'password'; + const TAB_OPTIONS = 'tab'; + const TEXT_OPTIONS = 'text'; + const TEXTAREA_OPTIONS = 'textarea'; /** * The key to use in the Zend_Registry to store global fixed options @@ -82,19 +83,20 @@ // First list html attributes, then Zend attributes, lastly own attributes private $_allowedOptions = array( - self::AUTO_OPTIONS => array('elementClass', 'multiOptions'), - self::CHECK_OPTIONS => array('checkedValue', 'uncheckedValue'), - self::DATE_OPTIONS => array('dateFormat', 'storageFormat'), - self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex', 'value', 'showLabels', 'labelplacement'), - self::EXHIBIT_OPTIONS => array('formatFunction'), - self::FILE_OPTIONS => array('accept', 'count', 'destination', 'valueDisabled'), - self::GROUP_OPTIONS => array('elements', 'legend', 'separator'), - self::JQUERY_OPTIONS => array('jQueryParams'), - self::MULTI_OPTIONS => array('disable', 'multiOptions', 'onchange', 'separator', 'size', 'disableTranslator'), - self::PASSWORD_OPTIONS => array('repeatLabel'), - self::TAB_OPTIONS => array('value'), - self::TEXT_OPTIONS => array('maxlength', 'minlength', 'onchange', 'onfocus', 'onselect', 'size'), - self::TEXTAREA_OPTIONS => array('cols', 'rows', 'wrap'), + self::AUTO_OPTIONS => array('elementClass', 'multiOptions'), + self::CHECK_OPTIONS => array('checkedValue', 'uncheckedValue'), + self::DATE_OPTIONS => array('dateFormat', 'storageFormat'), + self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex', 'value', 'showLabels', 'labelplacement'), + self::EXHIBIT_OPTIONS => array('formatFunction'), + self::FAKESUBMIT_OPTIONS => array('label', 'tabindex', 'disabled'), + self::FILE_OPTIONS => array('accept', 'count', 'destination', 'valueDisabled'), + self::GROUP_OPTIONS => array('elements', 'legend', 'separator'), + self::JQUERY_OPTIONS => array('jQueryParams'), + self::MULTI_OPTIONS => array('disable', 'multiOptions', 'onchange', 'separator', 'size', 'disableTranslator'), + self::PASSWORD_OPTIONS => array('repeatLabel'), + self::TAB_OPTIONS => array('value'), + self::TEXT_OPTIONS => array('maxlength', 'minlength', 'onchange', 'onfocus', 'onselect', 'size'), + self::TEXTAREA_OPTIONS => array('cols', 'rows', 'wrap'), ); public function __construct(MUtil_Model_ModelAbstract $model, Zend_Form $form) @@ -402,14 +404,24 @@ return $this->_addToForm($element->getName(), $element); } + /** + * Add an element that just displays the value to the user + * + * @param string $name Name of element + * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array + * @return \MUtil_Form_Element_Exhibitor + */ public function addExhibitor($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) { - $options = func_get_args(); - $options = MUtil_Ra::pairs($options, 1); + $options = $this->_mergeOptions( + $name, + MUtil_Ra::pairs(func_get_args(), 1), + self::DATE_OPTIONS, + self::DISPLAY_OPTIONS, + self::EXHIBIT_OPTIONS, + self::MULTI_OPTIONS + ); - $options = $this->_mergeOptions($name, $options, - self::DATE_OPTIONS, self::DISPLAY_OPTIONS, self::EXHIBIT_OPTIONS, self::MULTI_OPTIONS); - $element = new MUtil_Form_Element_Exhibitor($name, $options); $this->form->addElement($element); @@ -418,6 +430,29 @@ return $element; } + /** + * Add an element that just displays the value to the user + * + * @param string $name Name of element + * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array + * @return \MUtil_Form_Element_FakeSubmit + */ + public function addFakeSubmit($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) + { + $options = $this->_mergeOptions( + $name, + MUtil_Ra::pairs(func_get_args(), 1), + self::FAKESUBMIT_OPTIONS + ); + + $element = new MUtil_Form_Element_FakeSubmit($name, $options); + + $this->form->addElement($element); + // MUtil_Echo::r($element->getOrder(), $element->getName()); + + return $element; + } + public function addFile($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) { $options = func_get_args(); @@ -523,6 +558,52 @@ return $this->_addToForm($name, 'Select', $options); } + + /** + * Adds a group of checkboxes (multicheckbox) + * + * @see Zend_Form_Element_MultiCheckbox + * + * @param string $name Name of element + * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array + * @return Zend_Form_Element_MultiCheckbox + */ + public function addMultiCheckbox($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) + { + $options = func_get_args(); + $options = MUtil_Ra::pairs($options, 1); + + // Is often added automatically, but should not be used here + $this->_moveOption('maxlength', $options); + + $options = $this->_mergeOptions($name, $options, + self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); + + return $this->_addToForm($name, 'MultiCheckbox', $options); + } + + /** + * Adds a select box with multiple options + * + * @see Zend_Form_Element_Multiselect + * + * @param string $name Name of element + * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array + */ + public function addMultiSelect($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) + { + $options = func_get_args(); + $options = MUtil_Ra::pairs($options, 1); + + // Is often added automatically, but should not be used here + $this->_moveOption('maxlength', $options); + + $options = $this->_mergeOptions($name, $options, + self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); + + return $this->_addToForm($name, 'Multiselect', $options); + } + public function addPassword($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) { $options = func_get_args(); @@ -592,53 +673,7 @@ return $this->_addToForm($name, 'Select', $options); } - /** - * Adds a group of checkboxes (multicheckbox) - * - * @see Zend_Form_Element_MultiCheckbox - * - * @param string $name Name of element - * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array - * @return Zend_Form_Element_MultiCheckbox - */ - public function addMultiCheckbox($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) - { - $options = func_get_args(); - $options = MUtil_Ra::pairs($options, 1); - - // Is often added automatically, but should not be used here - $this->_moveOption('maxlength', $options); - - $options = $this->_mergeOptions($name, $options, - self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); - - return $this->_addToForm($name, 'MultiCheckbox', $options); - } - - /** - * Adds a select box with multiple options - * - * @see Zend_Form_Element_Multiselect - * - * @param string $name Name of element - * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array - */ - public function addMultiSelect($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) - { - $options = func_get_args(); - $options = MUtil_Ra::pairs($options, 1); - - // Is often added automatically, but should not be used here - $this->_moveOption('maxlength', $options); - - $options = $this->_mergeOptions($name, $options, - self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); - - return $this->_addToForm($name, 'Multiselect', $options); - } - - /** * Start a tab after this element, with the given name / title * * Can ofcourse only be used in tabbed forms. @@ -676,12 +711,13 @@ public function addText($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) { - $options = func_get_args(); - $options = MUtil_Ra::pairs($options, 1); + $options = $this->_mergeOptions( + $name, + MUtil_Ra::pairs(func_get_args(), 1), + self::DISPLAY_OPTIONS, + self::TEXT_OPTIONS + ); - $options = $this->_mergeOptions($name, $options, - self::DISPLAY_OPTIONS, self::TEXT_OPTIONS); - $stringlength = $this->_getStringLength($options); if ($stringlength) { Modified: trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -78,6 +78,13 @@ public $caption; /** + * An array of nested arrays, each defining the input for setMultiSort + * + * @var array + */ + public $columns; + + /** * Content to show when there are no rows. * * Null shows '…' @@ -112,7 +119,11 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { - if ($this->sortableLinks) { + if ($this->columns) { + foreach ($this->columns as $column) { + call_user_func_array(array($bridge, 'addMultiSort'), $column); + } + } elseif ($this->sortableLinks) { foreach($model->getItemsOrdered() as $name) { if ($label = $model->get($name, 'label')) { $bridge->addSortable($name, $label); Modified: trunk/library/snippets/Organization/ChooseOrganizationSnippet.php =================================================================== --- trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-02-28 15:13:09 UTC (rev 1166) +++ trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-02-28 17:40:31 UTC (rev 1167) @@ -89,17 +89,13 @@ $url[$this->request->getControllerKey()] = 'organization'; $url[$this->request->getActionKey()] = 'change-ui'; - if ($orgs = $user->getAllowedOrganizations()) { + if ($orgs = $user->getRespondentOrganizations()) { $html->pInfo($this->_('This organization cannot have any respondents, please choose one that does:')); foreach ($orgs as $orgId => $name) { - $org = $this->loader->getOrganization($orgId); + $url['org'] = $orgId; - if ($org->canHaveRespondents()) { - $url['org'] = $orgId; - - $html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); - } + $html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); } } else { $html->pInfo($this->_('This organization cannot have any respondents.')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-28 16:24:45
|
Revision: 1166 http://sourceforge.net/p/gemstracker/code/1166 Author: mennodekker Date: 2013-02-28 15:13:09 +0000 (Thu, 28 Feb 2013) Log Message: ----------- show empty subquestions (common abuse of the array question type in limesurvey) Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php Modified: trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2013-02-28 11:02:53 UTC (rev 1165) +++ trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2013-02-28 15:13:09 UTC (rev 1166) @@ -175,7 +175,7 @@ foreach($answerNames as $name) { $label = $model->get($name, 'label'); - if (strlen($label)) { + if (!is_null($label)) { // Was strlen($label), but this ruled out empty sub-questions $bridge->thd($label, array('class' => $model->get($name, 'thClass'))); $td = $bridge->td($bridge->$name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |