本文整理汇总了PHP中Gems_Util类的典型用法代码示例。如果您正苦于以下问题:PHP Gems_Util类的具体用法?PHP Gems_Util怎么用?PHP Gems_Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Gems_Util类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setReceptionCode
/**
* Set the reception code for a respondent and cascade non-success codes to the
* tracks / surveys.
*
* @param string $patientId Can be empty if $respondentId is passed
* @param int $organizationId
* @param string $newCode String or \Gems_Util_ReceptionCode
* @param int $respondentId Pass when at hand, is looked up otherwise
* @param string $oldCode Pass when at hand as tring or \Gems_Util_ReceptionCode, is looked up otherwise
* @return \Gems_Util_ReceptionCode The new code reception code object for further processing
*/
public function setReceptionCode($patientId, $organizationId, $newCode, $respondentId = null, $oldCode = null)
{
if ($newCode instanceof \Gems_Util_ReceptionCode) {
$code = $newCode;
$newCode = $code->getCode();
} else {
$code = $this->util->getReceptionCode($newCode);
}
$userId = $this->currentUser->getUserId();
// Perform actual save, but not for simple stop codes.
if ($code->isForRespondents()) {
if (null === $oldCode) {
$oldCode = $this->getReceptionCode($patientId, $organizationId, $respondentId);
}
if ($oldCode instanceof \Gems_Util_ReceptionCode) {
$oldCode = $oldCode->getCode();
}
// If the code wasn't set already
if ($oldCode !== $newCode) {
$values['gr2o_reception_code'] = $newCode;
$values['gr2o_changed'] = new \MUtil_Db_Expr_CurrentTimestamp();
$values['gr2o_changed_by'] = $userId;
if ($patientId) {
// Update though primamry key is prefered
$where = 'gr2o_patient_nr = ? AND gr2o_id_organization = ?';
$where = $this->db->quoteInto($where, $patientId, null, 1);
} else {
$where = 'gr2o_id_user = ? AND gr2o_id_organization = ?';
$where = $this->db->quoteInto($where, $respondentId, null, 1);
}
$where = $this->db->quoteInto($where, $organizationId, null, 1);
$this->db->update('gems__respondent2org', $values, $where);
}
}
// Is the respondent really removed
if (!$code->isSuccess()) {
// Only check for $respondentId when it is really needed
if (null === $respondentId) {
$respondentId = $this->util->getDbLookup()->getRespondentId($patientId, $organizationId);
}
// Cascade to tracks
// the responsiblilty to handle it correctly is on the sub objects now.
$tracks = $this->loader->getTracker()->getRespondentTracks($respondentId, $organizationId);
foreach ($tracks as $track) {
if ($track->setReceptionCode($code, null, $userId)) {
$this->addChanged();
}
}
}
if ($code->isForRespondents()) {
$this->handleRespondentChanged($patientId, $organizationId, $respondentId);
}
return $code;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:65,代码来源:RespondentModel.php
示例2: testConsentRejected
public function testConsentRejected()
{
//Check the ini default
$expected = 'do not use';
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check if we can read from an altered ini file
$project = $this->project;
$expected = 'test';
$project->consentRejected = $expected;
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check for class default when not found in ini
unset($project->consentRejected);
$expected = 'do not use';
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check for incorrect spelling used before 1.5.2
$project->concentRejected = 'test2';
try {
$actual = $this->object->getConsentRejected();
} catch (Exception $e) {
}
$this->assertInstanceOf('Gems_Exception_Coding', $e, 'No failure on misspelled concentRejected in project.ini');
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:25,代码来源:UtilTest.php
示例3: addModelSettings
/**
* Add the model settings like the elementClass for this field.
*
* elementClass is overwritten when this field is read only, unless you override it again in getDataModelSettings()
*
* @param array $settings The settings set so far
*/
protected function addModelSettings(array &$settings)
{
$empty = $this->util->getTranslated()->getEmptyDropdownArray();
$multi = explode(parent::FIELD_SEP, $this->_fieldDefinition['gtf_field_values']);
$settings['elementClass'] = 'Select';
$settings['multiOptions'] = $empty + array_combine($multi, $multi);
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:14,代码来源:SelectField.php
示例4: createModel
/**
* 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)
{
$fields = array();
// Export all
if ('export' === $action) {
$detailed = true;
}
$organizations = $this->util->getDbLookup()->getOrganizations();
$fields[] = 'gtr_track_name';
$sql = "CASE WHEN gtr_organizations LIKE '%%|%s|%%' THEN 1 ELSE 0 END";
foreach ($organizations as $orgId => $orgName) {
$fields['O' . $orgId] = new \Zend_Db_Expr(sprintf($sql, $orgId));
}
$fields['total'] = new \Zend_Db_Expr("(LENGTH(gtr_organizations) - LENGTH(REPLACE(gtr_organizations, '|', ''))-1)");
$fields[] = 'gtr_id_track';
$select = $this->db->select();
$select->from('gems__tracks', $fields);
$model = new \MUtil_Model_SelectModel($select, 'track-verview');
$model->setKeys(array('gtr_id_track'));
$model->resetOrder();
$model->set('gtr_track_name', 'label', $this->_('Track name'));
$model->set('total', 'label', $this->_('Total'));
$model->setOnTextFilter('total', array($this, 'noTextFilter'));
foreach ($organizations as $orgId => $orgName) {
$model->set('O' . $orgId, 'label', $orgName, 'tdClass', 'rightAlign', 'thClass', 'rightAlign');
$model->setOnTextFilter('O' . $orgId, array($this, 'noTextFilter'));
if ($action !== 'export') {
$model->set('O' . $orgId, 'formatFunction', array($this, 'formatCheckmark'));
}
}
// \MUtil_Model::$verbose = true;
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:44,代码来源:TrackOverviewAction.php
示例5: processTokenData
/**
* Process the data and return the answers that should be changed.
*
* Storing the changed values is handled by the calling function.
*
* @param \Gems_Tracker_Token $token Gems token object
* @return array Containing the changed values
*/
public function processTokenData(\Gems_Tracker_Token $token)
{
if (!$token->getReceptionCode()->isSuccess()) {
return;
}
$answers = $token->getRawAnswers();
if (isset($answers['informedconsent'])) {
$consent = $this->util->getConsent($answers['informedconsent']);
if ($consent->exists) {
// Is existing consent description as answer
$consentCode = $consent->getDescription();
} else {
if ($answers['informedconsent']) {
// Uses start of consent description as answer (LS has only 5 chars for an answer option)
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_description LIKE ? ORDER BY gco_order", $answers['informedconsent'] . '%');
} else {
$consentCode = false;
}
if (!$consentCode) {
if ($answers['informedconsent']) {
// Code not found, use first positive consent
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_code != ? ORDER BY gco_order", $this->util->getConsentRejected());
} else {
// Code not found, use first negative consent
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_code = ? ORDER BY gco_order", $this->util->getConsentRejected());
}
}
}
$respondent = $token->getRespondent();
$values = array('gr2o_patient_nr' => $respondent->getPatientNumber(), 'gr2o_id_organization' => $respondent->getOrganizationId(), 'gr2o_consent' => $consentCode);
$respondent->getRespondentModel()->save($values);
}
return false;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:42,代码来源:SetInformedConsent.php
示例6: addTableCells
/**
* Place to set the data to display
*
* @param \MUtil_Model_Bridge_VerticalTableBridge $bridge
* @return void
*/
protected function addTableCells(\MUtil_Model_Bridge_VerticalTableBridge $bridge)
{
$bridge->setColumnCount(1);
$HTML = \MUtil_Html::create();
$bridge->tdh($this->getCaption(), array('colspan' => 2));
// Caption for tracks
$trackLabel = $this->_('Assigned tracks');
if ($menuItem = $this->findMenuItem('track', 'index')) {
$href = $menuItem->toHRefAttribute($this->request, $bridge);
$bridge->tdh(array('class' => 'linked'))->a($href, $trackLabel);
} else {
$bridge->tdh($trackLabel, array('class' => 'linked'));
}
$bridge->tr();
// ROW 1
$bridge->addItem($bridge->gr2o_patient_nr, $this->_('Respondent nr: '));
$rowspan = 10;
// Column for tracks
$tracksModel = $this->model->getRespondentTracksModel();
$tracksData = \MUtil_Lazy::repeat($tracksModel->load(array('gr2o_patient_nr' => $this->repeater->gr2o_patient_nr, 'gr2o_id_organization' => $this->repeater->gr2o_id_organization), array('gr2t_created' => SORT_DESC)));
$tracksList = $HTML->div($tracksData, array('class' => 'tracksList'));
$tracksList->setOnEmpty($this->_('No tracks'));
if ($menuItem = $this->findMenuItem('track', 'show-track')) {
$href = $menuItem->toHRefAttribute($tracksData, array('gr2o_patient_nr' => $this->repeater->gr2o_patient_nr));
$tracksTarget = $tracksList->p()->a($href);
} else {
$tracksTarget = $tracksList->p();
}
$tracksTarget->strong($tracksData->gtr_track_name);
$tracksTarget[] = ' ';
$tracksTarget->em($tracksData->gr2t_track_info, array('renderWithoutContent' => false));
$tracksTarget[] = ' ';
$tracksTarget[] = \MUtil_Lazy::call($this->util->getTranslated()->formatDate, $tracksData->gr2t_created);
$bridge->td($tracksList, array('rowspan' => $rowspan, 'class' => 'linked tracksList'));
// OTHER ROWS
$bridge->addItem($HTML->spaced($bridge->itemIf('grs_last_name', array($bridge->grs_last_name, ',')), $bridge->grs_first_name, $bridge->grs_surname_prefix), $this->_('Respondent'));
$bridge->addItem('grs_gender');
$bridge->addItem('grs_birthday');
$bridge->addItem('grs_email');
$bridge->addItem('gr2o_created');
$bridge->addItem('gr2o_created_by');
if ($this->onclick) {
// TODO: can we not use $repeater?
$href = array('location.href=\'', $this->onclick, '\';');
foreach ($bridge->tbody() as $tr) {
foreach ($tr as $td) {
if (strpos($td->class, 'linked') === false) {
$td->onclick = $href;
} else {
$td->onclick = 'event.cancelBubble=true;';
}
}
}
$bridge->tbody()->onclick = '// Dummy for CSS';
}
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:62,代码来源:DetailsWithAssignmentsSnippet.php
示例7: execute
/**
* Should handle execution of the task, taking as much (optional) parameters as needed
*
* The parameters should be optional and failing to provide them should be handled by
* the task
*/
public function execute($trackId = null, $exportOrganizations = false)
{
$versions = $this->loader->getVersions();
$data = array('gems_version' => $versions->getGemsVersion(), 'project' => $this->project->getName(), 'project_env' => APPLICATION_ENV, 'project_url' => $this->util->getCurrentURI(), 'project_version' => $versions->getProjectVersion());
// Main version data
$this->exportTypeHeader('version', false);
$this->exportFieldHeaders($data);
$this->exportFieldData($data);
$this->exportFlush();
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:16,代码来源:ProjectVersionExportTask.php
示例8: getHtmlOutput
/**
* Create the snippets content
*
* This is a stub function either override getHtmlOutput() or override render()
*
* @param \Zend_View_Abstract $view Just in case it is needed here
* @return \MUtil_Html_HtmlInterface Something that can be rendered
*/
public function getHtmlOutput(\Zend_View_Abstract $view)
{
$tUtil = $this->util->getTokenData();
$repeater = new \MUtil_Lazy_RepeatableByKeyValue($tUtil->getEveryStatus());
$table = new \MUtil_Html_TableElement();
$table->class = 'compliance timeTable rightFloat table table-condensed';
$table->setRepeater($repeater);
$table->throw($this->_('Legend'));
$table->td($repeater->key)->class = array('round', \MUtil_Lazy::method($tUtil, 'getStatusClass', $repeater->key));
$table->td($repeater->value);
return $table;
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:20,代码来源:TokenStatusLegenda.php
示例9: createModel
/**
* 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)
{
// Export all
if ('export' === $action) {
$detailed = true;
}
if ($detailed) {
$year = $this->_('Year');
$month = $this->_('Month');
$fields[$year] = new \Zend_Db_Expr("YEAR(gr2o_created)");
$fields[$month] = new \Zend_Db_Expr("MONTH(gr2o_created)");
}
$consents = $this->util->getDbLookup()->getUserConsents();
$deleteds = array('' => '') + $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes();
$sql = "SUM(CASE WHEN grc_success = 1 AND gr2o_consent = '%s' THEN 1 ELSE 0 END)";
foreach ($consents as $consent => $translated) {
$fields[$translated] = new \Zend_Db_Expr(sprintf($sql, $consent));
}
$fields[$this->_('Total OK')] = new \Zend_Db_Expr("SUM(CASE WHEN grc_success = 1 THEN 1 ELSE 0 END)");
$sql = "SUM(CASE WHEN gr2o_reception_code = '%s' THEN 1 ELSE 0 END)";
foreach ($deleteds as $code => $translated) {
$fields[$translated] = new \Zend_Db_Expr(sprintf($sql, $code));
}
$fields[$this->_('Dropped')] = new \Zend_Db_Expr("SUM(CASE WHEN grc_success = 0 THEN 1 ELSE 0 END)");
$fields[$this->_('Total')] = new \Zend_Db_Expr("COUNT(*)");
$select = $this->db->select();
$select->from('gems__respondent2org', $fields)->joinInner('gems__reception_codes', 'gr2o_reception_code = grc_id_reception_code', array())->joinInner('gems__organizations', 'gr2o_id_organization = gor_id_organization', array('gor_name', 'gor_id_organization'));
$select->group(array('gor_name', 'gor_id_organization'));
if ($detailed) {
$select->group(array($fields[$year], $fields[$month]));
}
$model = new \MUtil_Model_SelectModel($select, 'consent-plan');
$model->setKeys(array('gor_id_organization'));
$model->resetOrder();
$model->set('gor_name', 'label', $this->_('Organization'));
foreach ($fields as $field => $expr) {
$model->set($field, 'label', $field, 'tdClass', 'rightAlign', 'thClass', 'rightAlign');
}
foreach ($deleteds as $code => $translated) {
$model->set($translated, 'tdClass', 'rightAlign smallTime', 'thClass', 'rightAlign smallTime');
}
foreach (array($this->_('Total OK'), $this->_('Dropped'), $this->_('Total')) as $name) {
$model->set($name, 'itemDisplay', \MUtil_Html::create('strong'), 'tableHeaderDisplay', \MUtil_Html::create('em'), 'tdClass', 'rightAlign selectedColumn', 'thClass', 'rightAlign selectedColumn');
}
if ($detailed) {
$model->set($month, 'formatFunction', $this->util->getLocalized()->getMonthName);
}
// Only show organisations the user is allowed to see
$allowed = $this->currentUser->getAllowedOrganizations();
$model->setFilter(array('gr2o_id_organization' => array_keys($allowed)));
// \MUtil_Model::$verbose = true;
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:64,代码来源:ConsentPlanAction.php
示例10: createModel
/**
* Creates the model
*
* @return \MUtil_Model_ModelAbstract
*/
protected function createModel()
{
$model = $this->loader->getTracker()->getRespondentTrackModel();
$model->addColumn('CONCAT(gr2t_completed, \'' . $this->_(' of ') . '\', gr2t_count)', 'progress');
$model->resetOrder();
$model->set('gtr_track_name', 'label', $this->_('Track'));
$model->set('gr2t_track_info', 'label', $this->_('Description'));
$model->set('gr2t_start_date', 'label', $this->_('Start'), 'formatFunction', $this->util->getTranslated()->formatDate, 'default', \MUtil_Date::format(new \Zend_Date(), 'dd-MM-yyyy'));
$model->set('gr2t_reception_code');
$model->set('progress', 'label', $this->_('Progress'));
// , 'tdClass', 'rightAlign', 'thClass', 'rightAlign');
$model->set('assigned_by', 'label', $this->_('Assigned by'));
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:19,代码来源:TracksSnippet.php
示例11: applyFormatting
/**
* Sets the labels, format functions, etc...
*
* @return \Gems_Tracker_Model_StandardTokenModel
*/
public function applyFormatting()
{
$this->resetOrder();
$dbLookup = $this->util->getDbLookup();
$translated = $this->util->getTranslated();
// Token id & respondent
$this->set('gto_id_token', 'label', $this->_('Token'), 'elementClass', 'Exhibitor', 'formatFunction', 'strtoupper');
$this->set('gr2o_patient_nr', 'label', $this->_('Respondent nr'), 'elementClass', 'Exhibitor');
$this->set('respondent_name', 'label', $this->_('Respondent name'), 'elementClass', 'Exhibitor');
$this->set('gto_id_organization', 'label', $this->_('Organization'), 'elementClass', 'Exhibitor', 'multiOptions', $dbLookup->getOrganizationsWithRespondents());
// Track, round & survey
$this->set('gtr_track_name', 'label', $this->_('Track'), 'elementClass', 'Exhibitor');
$this->set('gr2t_track_info', 'label', $this->_('Description'), 'elementClass', 'Exhibitor');
$this->set('gto_round_description', 'label', $this->_('Round'), 'elementClass', 'Exhibitor');
$this->set('gsu_survey_name', 'label', $this->_('Survey'), 'elementClass', 'Exhibitor');
$this->set('ggp_name', 'label', $this->_('Assigned to'), 'elementClass', 'Exhibitor');
// Token, editable part
$manual = $translated->getDateCalculationOptions();
$this->set('gto_valid_from_manual', 'label', $this->_('Set valid from'), 'description', $this->_('Manually set dates are fixed an will never be (re)calculated.'), 'elementClass', 'Radio', 'multiOptions', $manual, 'separator', ' ');
$this->set('gto_valid_from', 'label', $this->_('Valid from'), 'elementClass', 'Date', 'formatFunction', $translated->formatDateNever, 'tdClass', 'date');
$this->set('gto_valid_until_manual', 'label', $this->_('Set valid until'), 'description', $this->_('Manually set dates are fixed an will never be (re)calculated.'), 'elementClass', 'Radio', 'multiOptions', $manual, 'separator', ' ');
$this->set('gto_valid_until', 'label', $this->_('Valid until'), 'elementClass', 'Date', 'formatFunction', $translated->formatDateForever, 'tdClass', 'date');
$this->set('gto_comment', 'label', $this->_('Comments'), 'cols', 50, 'elementClass', 'Textarea', 'rows', 3, 'tdClass', 'pre');
// Token, display part
$this->set('gto_mail_sent_date', 'label', $this->_('Last contact'), 'elementClass', 'Exhibitor', 'formatFunction', $translated->formatDateNever, 'tdClass', 'date');
$this->set('gto_mail_sent_num', 'label', $this->_('Number of contact moments'), 'elementClass', 'Exhibitor');
$this->set('gto_completion_time', 'label', $this->_('Completed'), 'elementClass', 'Exhibitor', 'formatFunction', $translated->formatDateNa, 'tdClass', 'date');
$this->set('gto_duration_in_sec', 'label', $this->_('Duration in seconds'), 'elementClass', 'Exhibitor');
$this->set('gto_result', 'label', $this->_('Score'), 'elementClass', 'Exhibitor');
$this->set('grc_description', 'label', $this->_('Reception code'), 'formatFunction', array($this->translate, '_'), 'elementClass', 'Exhibitor');
$this->set('gto_changed', 'label', $this->_('Changed on'), 'elementClass', 'Exhibitor', 'formatFunction', $translated->formatDateUnknown);
$this->set('assigned_by', 'label', $this->_('Assigned by'), 'elementClass', 'Exhibitor');
return $this;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:39,代码来源:StandardTokenModel.php
示例12: createModel
/**
* 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 = new \MUtil_Model_TableModel('gems__locations');
$yesNo = $this->util->getTranslated()->getYesNo();
\Gems_Model::setChangeFieldsByPrefix($model, 'glo');
$model->setDeleteValues('glo_active', 0);
$model->set('glo_name', 'label', $this->_('Location'), 'required', true);
$model->set('glo_organizations', 'label', $this->_('Organizations'), 'description', $this->_('Checked organizations see this organizations respondents.'), 'elementClass', 'MultiCheckbox', 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'noSort', true);
$tp = new \MUtil_Model_Type_ConcatenatedRow(':', ', ');
$tp->apply($model, 'glo_organizations');
$model->setIfExists('glo_match_to', 'label', $this->_('Import matches'), 'description', $this->_("Split multiple import matches using '|'."));
$model->setIfExists('glo_code', 'label', $this->_('Location code'), 'size', 10, 'description', $this->_('Optional code name to link the location to program code.'));
$model->setIfExists('glo_url', 'label', $this->_('Location url'), 'description', $this->_('Complete url for location: http://www.domain.etc'), 'validator', 'Url');
$model->setIfExists('glo_url_route', 'label', $this->_('Location route url'), 'description', $this->_('Complete url for route to location: http://www.domain.etc'), 'validator', 'Url');
$model->setIfExists('glo_address_1', 'label', $this->_('Street'));
$model->setIfExists('glo_address_2', 'label', ' ');
$model->setIfExists('glo_zipcode', 'label', $this->_('Zipcode'), 'size', 7, 'description', $this->_('E.g.: 0000 AA'), 'filter', new \Gems_Filter_DutchZipcode());
$model->setIfExists('glo_city', 'label', $this->_('City'));
$model->setIfExists('glo_region', 'label', $this->_('Region'));
$model->setIfExists('glo_iso_country', 'label', $this->_('Country'), 'multiOptions', $this->util->getLocalized()->getCountries());
$model->setIfExists('glo_phone_1', 'label', $this->_('Phone'));
$model->setIfExists('glo_phone_2', 'label', $this->_('Phone 2'));
$model->setIfExists('glo_phone_3', 'label', $this->_('Phone 3'));
$model->setIfExists('glo_phone_4', 'label', $this->_('Phone 4'));
$model->setIfExists('glo_active', 'label', $this->_('Active'), 'description', $this->_('Inactive means assignable only through automatich processes.'), 'elementClass', 'Checkbox', 'multiOptions', $yesNo);
$model->setIfExists('glo_filter', 'label', $this->_('Filter'), 'description', $this->_('When checked appointments with these locations are not imported.'), 'elementClass', 'Checkbox', 'multiOptions', $yesNo);
$model->addColumn("CASE WHEN glo_active = 1 THEN '' ELSE 'deleted' END", 'row_class');
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:40,代码来源:LocationAction.php
示例13: loadFormData
/**
* Load extra data not from the model into the form
*/
protected function loadFormData()
{
parent::loadFormData();
$this->loadMailer();
if (isset($this->formData['gctt'])) {
$multi = false;
if (count($this->formData['gctt']) > 1) {
$multi = true;
$allLanguages = $this->util->getLocalized()->getLanguages();
}
$preview = $this->getPreview($this->formData['gctt']);
$this->formData['preview_html'] = $preview['html'];
$this->formData['preview_text'] = $preview['text'];
}
if (!isset($this->formData['to'])) {
$organization = $this->mailer->getOrganization();
$this->formData['to'] = $this->formData['from'] = null;
if ($organization->getEmail()) {
$this->formData['to'] = $this->formData['from'] = $organization->getEmail();
} elseif ($this->project->getSiteEmail()) {
$this->formData['to'] = $this->formData['from'] = $this->project->getSiteEmail();
}
}
$this->formData['available_fields'] = $this->mailElements->displayMailFields($this->mailer->getMailFields());
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:28,代码来源:MailModelFormSnippet.php
示例14: afterRegistry
/**
* Called after the check that all required registry values
* have been set correctly has run.
*
* @return void
* /
public function afterRegistry()
{
parent::afterRegistry();
}
/**
* Creates the model
*
* @return \MUtil_Model_ModelAbstract
*/
protected function createModel()
{
if (!$this->importModel instanceof \MUtil_Model_ModelAbstract) {
$surveyId = $this->request->getParam(\MUtil_Model::REQUEST_ID);
if ($surveyId) {
$this->formData['survey'] = $surveyId;
$this->_survey = $this->loader->getTracker()->getSurvey($surveyId);
$surveys[$surveyId] = $this->_survey->getName();
$elementClass = 'Exhibitor';
$tracks = $this->util->getTranslated()->getEmptyDropdownArray() + $this->util->getTrackData()->getTracksBySurvey($surveyId);
} else {
$empty = $this->util->getTranslated()->getEmptyDropdownArray();
$trackData = $this->util->getTrackData();
$surveys = $empty + $trackData->getActiveSurveys();
$tracks = $empty + $trackData->getAllTracks();
$elementClass = 'Select';
}
parent::createModel();
$order = $this->importModel->getOrder('trans') - 5;
$this->importModel->set('survey', 'label', $this->_('Survey'), 'elementClass', $elementClass, 'multiOptions', $surveys, 'onchange', 'this.form.submit();', 'order', $order, 'required', true);
$this->importModel->set('track', 'label', $this->_('Track'), 'description', $this->_('Optionally assign answers only within a single track'), 'multiOptions', $tracks);
$this->importModel->set('skipUnknownPatients', 'label', $this->_('Skip unknowns'), 'default', 0, 'description', $this->_('What to do when the respondent does not exist'), 'elementClass', 'Checkbox', 'multiOptions', $this->util->getTranslated()->getYesNo());
$tokenCompleted = array(\Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_OVERWRITE => $this->_('Delete old token and create new'), \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_DOUBLE => $this->_('Create new extra set of answers'), \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR => $this->_('Abort the import'), \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_SKIP => $this->_('Skip the token'));
$this->importModel->set('tokenCompleted', 'label', $this->_('When token completed'), 'default', \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR, 'description', $this->_('What to do when an imported token has already been completed'), 'elementClass', 'Radio', 'multiOptions', $tokenCompleted);
$tokenTreatments = array(\Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR => $this->_('Abort the import'), \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_SKIP => $this->_('Skip the token'));
$this->importModel->set('noToken', 'label', $this->_('Token does not exist'), 'default', \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR, 'description', $this->_('What to do when no token exist to import to'), 'elementClass', 'Radio', 'multiOptions', $tokenTreatments);
if (\MUtil_Bootstrap::enabled()) {
$this->importModel->set('tokenCompleted', 'separator', '');
} else {
$this->importModel->set('trans', 'separator', '<br/>');
}
}
return $this->importModel;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:50,代码来源:AnswerImportSnippet.php
示例15: applySetting
/**
*
* @param boolean $detailed True when the current action is not in $summarizedActions.
*/
public function applySetting($detailed = true)
{
if ($detailed) {
$this->addLeftTable('gems__comm_templates', array('grco_id_message' => 'gct_id_template'));
}
$this->resetOrder();
$this->set('grco_created', 'label', $this->_('Date sent'));
if ($detailed) {
$this->set('grco_created', 'formatFunction', $this->util->getTranslated()->formatDate);
}
$this->set('gr2o_patient_nr', 'label', $this->_('Respondent nr'));
$this->set('respondent_name', 'label', $this->_('Receiver'));
$this->set('grco_address', 'label', $this->_('To address'), 'itemDisplay', array('MUtil_Html_AElement', 'ifmail'));
$this->set('assigned_by', 'label', $this->_('Sender'));
$this->set('grco_sender', 'label', $this->_('From address'), 'itemDisplay', array('MUtil_Html_AElement', 'ifmail'));
$this->set('grco_id_token', 'label', $this->_('Token'), 'itemDisplay', array($this, 'displayToken'));
$this->set('grco_topic', 'label', $this->_('Subject'));
$this->set('gtr_track_name', 'label', $this->_('Track'));
$this->set('gsu_survey_name', 'label', $this->_('Survey'));
$this->set('filler', 'label', $this->_('Fill out by'));
$this->set('status', 'label', $this->_('Status'), 'formatFunction', array($this->util->getTokenData(), 'getStatusDescription'));
if ($detailed) {
$this->set('gct_name', 'label', $this->_('Template'));
}
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:29,代码来源:CommLogModel.php
示例16: createModel
/**
* Creates the model
*
* @return \MUtil_Model_ModelAbstract
*/
protected function createModel()
{
$model = parent::createModel();
$translated = $this->util->getTranslated();
$model->set('calc_used_date', 'formatFunction', $translated->formatDateNever, 'tdClass', 'date');
$model->set('gto_changed', 'dateFormat', 'dd-MM-yyyy HH:mm:ss', 'tdClass', 'date');
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:13,代码来源:RoundTokenSnippet.php
示例17: createModel
/**
* 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)
{
$translated = $this->util->getTranslated();
$model = new \MUtil_Model_TableModel('gems__agenda_activities');
\Gems_Model::setChangeFieldsByPrefix($model, 'gaa');
$model->setDeleteValues('gaa_active', 0);
$model->set('gaa_name', 'label', $this->_('Activity'), 'description', $this->_('An activity is a high level description about an appointment:
e.g. consult, check-up, diet, operation, physiotherapy or other.'), 'required', true);
$model->setIfExists('gaa_id_organization', 'label', $this->_('Organization'), 'description', $this->_('Optional, an import match with an organization has priority over those without.'), 'multiOptions', $translated->getEmptyDropdownArray() + $this->util->getDbLookup()->getOrganizations());
$model->setIfExists('gaa_name_for_resp', 'label', $this->_('Respondent explanation'), 'description', $this->_('Alternative description to use with respondents.'));
$model->setIfExists('gaa_match_to', 'label', $this->_('Import matches'), 'description', $this->_("Split multiple import matches using '|'."));
$model->setIfExists('gaa_code', 'label', $this->_('Activity code'), 'size', 10, 'description', $this->_('Optional code name to link the activity to program code.'));
$model->setIfExists('gaa_active', 'label', $this->_('Active'), 'description', $this->_('Inactive means assignable only through automatich processes.'), 'elementClass', 'Checkbox', 'multiOptions', $translated->getYesNo());
$model->setIfExists('gaa_filter', 'label', $this->_('Filter'), 'description', $this->_('When checked appointments with these activities are not imported.'), 'elementClass', 'Checkbox', 'multiOptions', $translated->getYesNo());
$model->addColumn("CASE WHEN gaa_active = 1 THEN '' ELSE 'deleted' END", 'row_class');
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:28,代码来源:AgendaActivityAction.php
示例18: createModel
/**
* 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)
{
$translated = $this->util->getTranslated();
$model = new \MUtil_Model_TableModel('gems__agenda_procedures');
\Gems_Model::setChangeFieldsByPrefix($model, 'gapr');
$model->setDeleteValues('gapr_active', 0);
$model->set('gapr_name', 'label', $this->_('Activity'), 'description', $this->_('A procedure describes an appointments effects on a respondent:
e.g. an excercise, an explanantion, a massage, mindfullness, a (specific) operation, etc...'), 'required', true);
$model->setIfExists('gapr_id_organization', 'label', $this->_('Organization'), 'description', $this->_('Optional, an import match with an organization has priority over those without.'), 'multiOptions', $translated->getEmptyDropdownArray() + $this->util->getDbLookup()->getOrganizations());
$model->setIfExists('gapr_name_for_resp', 'label', $this->_('Respondent explanation'), 'description', $this->_('Alternative description to use with respondents.'));
$model->setIfExists('gapr_match_to', 'label', $this->_('Import matches'), 'description', $this->_("Split multiple import matches using '|'."));
$model->setIfExists('gapr_code', 'label', $this->_('Procedure code'), 'size', 10, 'description', $this->_('Optional code name to link the procedure to program code.'));
$model->setIfExists('gapr_active', 'label', $this->_('Active'), 'description', $this->_('Inactive means assignable only through automatich processes.'), 'elementClass', 'Checkbox', 'multiOptions', $translated->getYesNo());
$model->setIfExists('gapr_filter', 'label', $this->_('Filter'), 'description', $this->_('When checked appointments with these procedures are not imported.'), 'elementClass', 'Checkbox', 'multiOptions', $translated->getYesNo());
$model->addColumn("CASE WHEN gapr_active = 1 THEN '' ELSE 'deleted' END", 'row_class');
return $model;
}
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:28,代码来源:AgendaProcedureAction.php
示例19: getLoginUrl
/**
* Return org dependent login url
*
* @return string
*/
public function getLoginUrl()
{
if ($base = $this->_get('base_url')) {
return $base;
} else {
return $this->util->getCurrentURI();
}
}
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:13,代码来源:Organization.php
示例20: createModel
< |
请发表评论