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...> - 2012-02-07 11:12:54
|
Revision: 456
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=456&view=rev
Author: mennodekker
Date: 2012-02-07 11:12:45 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
Release 1.5.0 version (internal number 1.5)
Added Paths:
-----------
tags/1.5.0/
Property changes on: tags/1.5.0
___________________________________________________________________
Added: svn:ignore
+ nbproject
Added: svn:mergeinfo
+ /branches/1.5.0-pulse:306-430
/tags/1.5.0beta1:305
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-07 10:43:36
|
Revision: 454
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=454&view=rev
Author: mennodekker
Date: 2012-02-07 10:43:29 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
A little more verbose upgrade script
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Upgrades.php
Modified: branches/1.5.x/library/classes/Gems/Upgrades.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-07 08:33:44 UTC (rev 453)
+++ branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-07 10:43:29 UTC (rev 454)
@@ -65,16 +65,20 @@
* 2. create new tables
*/
public function Upgrade143to15()
- {
+ {
+ $this->addMessage($this->_('Executing patchlevel 42'));
$this->patcher->executePatch(42);
+ $this->addMessage($this->_('Executing patchlevel 43'));
$this->patcher->executePatch(43);
$this->invalidateCache();
+ $this->addMessage($this->_('Creating new tables'));
$this->createNewTables();
$this->invalidateCache();
+ $this->addMessage($this->_('Syncing surveys for all sources'));
//Now sync the db sources to allow limesurvey source to add a field to the tokentable
$model = new MUtil_Model_TableModel('gems__sources');
$data = $model->load(false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-07 08:33:54
|
Revision: 453
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=453&view=rev
Author: mennodekker
Date: 2012-02-07 08:33:44 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
Doc fixes
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php
branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
Modified: branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-06 16:17:09 UTC (rev 452)
+++ branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-07 08:33:44 UTC (rev 453)
@@ -95,7 +95,7 @@
* Sets the labels, format functions, etc...
*
* @param boolean $detailed True when shopwing detailed information
- * @return Gems_Tracker_Model_StandardTokenModel
+ * @return Gems_Tracker_Model_TrackModel
*/
public function applyFormatting($detailed = false)
{
Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-06 16:17:09 UTC (rev 452)
+++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-07 08:33:44 UTC (rev 453)
@@ -288,7 +288,7 @@
*
* @param string $name Name of element
* @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array
- * @return ZendX_JQuery_Form_Element_ColorPicker
+ * @return ZendX_JQuery_Form_Element_DatePicker
*/
public function addDate($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-06 16:17:19
|
Revision: 452
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=452&view=rev
Author: matijsdejong
Date: 2012-02-06 16:17:09 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
Small display and usability changes
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Default/SurveyMaintenanceAction.php
branches/1.5.x/library/classes/Gems/Default/TrackAction.php
branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php
branches/1.5.x/library/classes/MUtil/Html/ImgElement.php
Modified: branches/1.5.x/library/classes/Gems/Default/SurveyMaintenanceAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-02-06 12:39:20 UTC (rev 451)
+++ branches/1.5.x/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-02-06 16:17:09 UTC (rev 452)
@@ -69,7 +69,7 @@
// Add pdf button if allowed
if ($menuItem = $this->findAllowedMenuItem('pdf')) {
- $bridge->addItemLink(iif($bridge->gsu_has_pdf,$menuItem->toActionLinkLower($this->getRequest(), $bridge)));
+ $bridge->addItemLink(MUtil_Lazy::iif($bridge->gsu_has_pdf, $menuItem->toActionLinkLower($this->getRequest(), $bridge)));
}
}
Modified: branches/1.5.x/library/classes/Gems/Default/TrackAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 12:39:20 UTC (rev 451)
+++ branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 16:17:09 UTC (rev 452)
@@ -502,9 +502,9 @@
$fieldValues = $this->db->fetchAll($sql, array('gr2t2f_id_respondent_track' => $data['gr2t_id_respondent_track']));
foreach ($fieldValues as $field) {
+ $table->tr();
$table->tdh($field['gtf_field_name']);
$table->td($field['gr2t2f_value']);
- $table->tr();
}
$this->html[] = $table;
Modified: branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 12:39:20 UTC (rev 451)
+++ branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 16:17:09 UTC (rev 452)
@@ -1,6 +1,5 @@
<?php
-
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -46,6 +45,13 @@
*/
class Gems_Default_TrackMaintenanceAction extends Gems_Controller_BrowseEditAction
{
+ /**
+ * Mode for the current addBrowse drawing.
+ *
+ * @var string
+ */
+ protected $browseMode;
+
public $sortKey = array('gtr_track_name' => SORT_ASC);
public $summarizedActions = array('index', 'autofilter', 'check-all');
@@ -63,16 +69,16 @@
{
$request = $this->getRequest();
- if ($request->getActionName() == 'index') {
- if ($menuItem = $this->findAllowedMenuItem('show')) {
- $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
- }
+ $actionKey = $request->getActionKey();
+ $contrKey = $request->getControllerKey();
+ $controller = $this->browseMode ? $this->browseMode : $request->getControllerName();
- $menuItem = $this->findAllowedMenuItem('edit');
- } else {
- $menuItem = null;
+ if ($menuItem = $this->menu->find(array($contrKey => $controller, $actionKey => 'show'))) {
+ $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
}
+ $menuItem = $this->menu->find(array($contrKey => $controller, $actionKey => 'edit'));
+
foreach($model->getItemsOrdered() as $name) {
if ($label = $model->get($name, 'label')) {
$bridge->addSortable($name, $label);
@@ -290,24 +296,13 @@
$model = $this->getModel();
$repeatable = $model->loadRepeatable();
+ $this->browseMode = 'track-' . $mode;
+
$table = $this->getBrowseTable($baseurl);
$table->setOnEmpty(sprintf($this->_('No %s found'), $this->_($mode)));
$table->getOnEmpty()->class = 'centerAlign';
$table->setRepeater($repeatable);
- $url = array(
- 'controller' => 'track-' . $mode,
- 'action' => 'edit'
- );
-
- foreach ($keys as $idx => $key) {
- $url[$idx] = $repeatable->$key;
- }
-
- $href = new MUtil_Html_HrefArrayAttribute($url);
- $body = $table->tbody();
- $body[0]->onclick = array('location.href=\'', $href, '\';');
-
$this->html->h3(sprintf($this->_('%s in track'), $this->_(ucfirst($mode))));
$this->html[] = $table;
$this->html->actionLink(array('controller' => 'track-' . $mode, 'action' => 'create', 'id' => $this->getRequest()->getParam(MUtil_Model::REQUEST_ID)), $this->_('Add'));
Modified: branches/1.5.x/library/classes/MUtil/Html/ImgElement.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Html/ImgElement.php 2012-02-06 12:39:20 UTC (rev 451)
+++ branches/1.5.x/library/classes/MUtil/Html/ImgElement.php 2012-02-06 16:17:09 UTC (rev 452)
@@ -1,57 +1,59 @@
<?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.1
- * @version 1.4
- * @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 Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
/**
- * An image element with added functionality to automatically add with and height
+ * An image element with added functionality to automatically add with and height
* to the attributes.
- *
- * When the 'src' attribute does not start with a '/' or with http or https a list
+ *
+ * When the 'src' attribute does not start with a '/' or with http or https a list
* of directories is searched.
- *
- * The default list of directories is '/' and '/images/' but you can change the
+ *
+ * The default list of directories is '/' and '/images/' but you can change the
* directories using addImageDir() or setImaageDir().
- *
+ *
* The class assumes the current working directory (getcwd()) is the web root
* directory. When this is not the case use the setWebRoot() method.
- *
- * @author Matijs de Jong
- * @package MUtil
+ *
+ * @package MUtil
* @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.1
*/
class MUtil_Html_ImgElement extends MUtil_Html_HtmlElement
{
@@ -59,7 +61,7 @@
* @var array List of directory names where img looks for images.
*/
private static $_imageDirs = array('/', '/images/');
-
+
/**
*
* @var string The current web directory. Defaults to getcwd().
@@ -72,8 +74,49 @@
protected $_contentToTag = 'alt';
/**
+ * Converts an associative array to a string of tag attributes.
+ *
+ * @access public
+ *
+ * @param array $attribs From this array, each key-value pair is
+ * converted to an attribute name and value.
+ *
+ * @return string The XHTML for the attributes.
+ */
+ protected function _htmlAttribs($attribs)
+ {
+ if (isset($attribs['src'])) {
+ $filename = MUtil_Lazy::rise($attribs['src']);
+
+ if ($dir = self::getImageDir($filename)) {
+ if (! isset($attribs['width'], $attribs['height'])) {
+ try {
+ $info = getimagesize(self::getWebRoot() . $dir . $filename);
+
+ if (! isset($attribs['width'])) {
+ $attribs['width'] = $info[0];
+ }
+ if (! isset($attribs['height'])) {
+ $attribs['height'] = $info[1];
+ }
+ } catch (Exception $e) {
+ if (MUtil_Html::$verbose) {
+ MUtil_Echo::track($e);
+ }
+ }
+ }
+
+ $attribs['src'] = $this->view->baseUrl() . $dir . $filename;
+ }
+ // MUtil_Echo::r($attribs['src']);
+ }
+
+ return parent::_htmlAttribs($attribs);
+ }
+
+ /**
* Add a directory to the front of the list of search directories.
- *
+ *
* @param string $dir Directory name. Slashes added when needed.
*/
public static function addImageDir($dir)
@@ -91,24 +134,24 @@
array_unshift(self::$_imageDirs, $dir);
}
}
-
+
/**
* Searches for a matching image location and returns that location when found.
- *
+ *
* $filenames starting with a '/' or with http or https are skipped.
- *
+ *
* @param type $filename The src attribute as filename
* @return string When a directory matches
*/
- public static function getImageDir($filename)
+ public static function getImageDir($filename)
{
- if ($filename
- && ('/' != $filename[0])
- && ('http://' != substr($filename, 0, 7))
+ if ($filename
+ && ('/' != $filename[0])
+ && ('http://' != substr($filename, 0, 7))
&& ('https://' != substr($filename, 0, 8))) {
$webRoot = self::getWebRoot();
-
+
foreach (self::$_imageDirs as $dir) {
if (file_exists($webRoot . $dir . $filename)) {
return $dir;
@@ -122,7 +165,7 @@
/**
* Returns the list of search directories. The first directory in the list is the first directory searched.
- *
+ *
* @return array Directory names with slashes added when needed.
*/
public static function getImageDirs()
@@ -132,7 +175,7 @@
/**
* Use this function to set the web root directory if your application uses chdir() anywhere.
- *
+ *
* @param string $webRoot The current webroot
*/
public static function getWebRoot()
@@ -140,13 +183,13 @@
if (! self::$_webRoot) {
self::$_webRoot = getcwd();
}
-
+
return self::$_webRoot;
}
/**
* Static helper function for creation, used by @see MUtil_Html_Creator.
- *
+ *
* @param mixed $arg_array Optional MUtil_Ra::args processed settings
* @return MUtil_Html_ImgElement
*/
@@ -157,49 +200,27 @@
}
/**
- * Function to allow overloading of tag rendering only
- *
- * Renders the element tag with it's content into a html string
- *
- * The $view is used to correctly encode and escape the output
+ * Static helper function for creation, used by @see MUtil_Html_Creator.
*
- * @param Zend_View_Abstract $view
- * @return string Correctly encoded and escaped html output
+ * @param string $src The source
+ * @param mixed $arg_array Optional MUtil_Ra::args processed settings
+ * @return MUtil_Html_ImgElement
*/
- protected function renderElement(Zend_View_Abstract $view)
+ public static function imgFile($src, $arg_array = null)
{
- if (isset($this->_attribs['src'])) {
- $filename = $this->_attribs['src'];
+ $args = MUtil_Ra::args(func_get_args(), 1);
- if ($dir = self::getImageDir($filename)) {
- if (! isset($this->_attribs['width'], $this->_attribs['height'])) {
- try {
- $info = getimagesize(self::getWebRoot() . $dir . $filename);
-
- if (! isset($this->_attribs['width'])) {
- $this->_attribs['width'] = $info[0];
- }
- if (! isset($this->_attribs['height'])) {
- $this->_attribs['height'] = $info[1];
- }
- } catch (Exception $e) {
- if (MUtil_Html::$verbose) {
- MUtil_Echo::track($e);
- }
- }
- }
-
- $this->_attribs['src'] = $view->baseUrl() . $dir . $filename;
- }
- // MUtil_Echo::r($this->_attribs['src']);
+ $args['src'] = $src;
+ if (! isset($args['alt'])) {
+ $args['alt'] = '';
}
- return parent::renderElement($view);
+ return new self('img', $args);
}
/**
* Sets the list of search directories. The last directory in the list is the first directory searched for the file.
- *
+ *
* @param array $dirs Directory names. Slashes added when needed.
*/
public static function setImageDirs(array $dirs)
@@ -213,7 +234,7 @@
/**
* Use this function to set the web root directory if your application uses chdir() anywhere.
- *
+ *
* @param string $webRoot The current webroot
*/
public static function setWebRoot($webRoot)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-06 12:39:32
|
Revision: 451
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=451&view=rev
Author: matijsdejong
Date: 2012-02-06 12:39:20 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
Extended HtmlElement with getFirst() and getLast() for ease of manipulation.
VerticalTableBridge.php no longer adds an empty row to the end of the table
EditTrackEnigineSnippet now has a parent object for ease of inheritance
Added documentation
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Default/TrackAction.php
branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php
branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php
branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php
branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php
branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php
branches/1.5.x/library/classes/MUtil/Lazy.php
branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php
branches/1.5.x/library/snippets/EditTrackEngineSnippet.php
Added Paths:
-----------
branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php
Modified: branches/1.5.x/library/classes/Gems/Default/TrackAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -71,8 +71,9 @@
protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model)
{
$bridge->gr2t_id_respondent_track; //For show and edit button
- $bridge->tr()->appendAttrib('class', $bridge->row_class);
+ $bridge->tbody()->getFirst(true)->appendAttrib('class', $bridge->row_class);
+
// Add edit button if allowed, otherwise show, again if allowed
if ($menuItem = $this->findAllowedMenuItem('show-track')) {
$bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
@@ -461,6 +462,9 @@
}
}
+ /**
+ * Show information on a single track assigned to a respondent
+ */
public function showTrackAction()
{
$request = $this->getRequest();
Modified: branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -203,6 +203,7 @@
{
$model = $this->loader->getTracker()->getRespondentTrackModel();
+ $model->resetOrder();
$model->set('gtr_track_name', 'label', $this->_('Track'));
$model->set('gr2t_track_info', 'label', $this->_('Description'),
'description', $this->_('Enter the particulars concerning the assignment to this respondent.'));
Modified: branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -61,13 +61,16 @@
*/
protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model)
{
- if ($this->getRequest()->getActionName() == 'index') {
+ $request = $this->getRequest();
+
+ if ($request->getActionName() == 'index') {
if ($menuItem = $this->findAllowedMenuItem('show')) {
$bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
}
- if ($menuItem = $this->findAllowedMenuItem('edit')) {
- $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
- }
+
+ $menuItem = $this->findAllowedMenuItem('edit');
+ } else {
+ $menuItem = null;
}
foreach($model->getItemsOrdered() as $name) {
@@ -75,6 +78,10 @@
$bridge->addSortable($name, $label);
}
}
+
+ if ($menuItem) {
+ $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge));
+ }
}
/**
Modified: branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -110,6 +110,8 @@
$this->set('gtr_active', 'label', $this->translate->_('Active'), 'multiOptions', $translated->getYesNo());
$this->set('gtr_date_start', 'label', $this->translate->_('From'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDate);
$this->set('gtr_date_until', 'label', $this->translate->_('Use until'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDateForever);
+
+ return $this;
}
/**
Added: branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php (rev 0)
+++ branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -0,0 +1,304 @@
+<?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 Tracker
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: EditTrackEngineSnippetGeneric.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ * Basic snippet for editing track engines instances
+ *
+ * @package Gems
+ * @subpackage Tracker
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5
+ */
+class Gems_Tracker_Snippets_EditTrackEngineSnippetGeneric extends Gems_Snippets_ModelFormSnippetAbstract
+{
+ /**
+ *
+ * @var string Field for storing the old track class
+ */
+ protected $_oldClassName = 'old__gtr_track_class';
+
+ /**
+ *
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $db;
+
+ /**
+ * Required
+ *
+ * @var Gems_Loader
+ */
+ protected $loader;
+
+ /**
+ * Optional, required when creating or $trackId should be set
+ *
+ * @var Gems_Tracker_Engine_TrackEngineInterface
+ */
+ protected $trackEngine;
+
+ /**
+ * Optional, required when creating or $engine should be set
+ *
+ * @var int Track Id
+ */
+ protected $trackId;
+
+ /**
+ * @var Gems_Util
+ */
+ protected $util;
+
+ /**
+ * 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->createData) {
+ $bridge->addHidden('gtr_id_track');
+ }
+ $bridge->addText('gtr_track_name', 'size', 30, 'minlength', 4, 'validator', $model->createUniqueValidator('gtr_track_name'));
+
+ // gtr_track_class
+ if ($this->trackEngine) {
+ $options = $model->get('gtr_track_class', 'multiOptions');
+ $alternatives = $this->trackEngine->getConversionTargets($options);
+ if (count($alternatives) > 1) {
+ $options = $alternatives;
+
+ $bridge->addHidden($this->_oldClassName);
+
+ if (! isset($this->formData[$this->_oldClassName])) {
+ $this->formData[$this->_oldClassName] = $this->formData['gtr_track_class'];
+ }
+
+ $classEdit = true;
+ } else {
+ $classEdit = false;
+ }
+ } else {
+ $tracker = $this->loader->getTracker();
+ $options = $tracker->getTrackEngineList(true, true);
+ $classEdit = true;
+ }
+ $model->set('gtr_track_class', 'multiOptions', $options, 'escape', false);
+ if ($classEdit) {
+ $bridge->addRadio( 'gtr_track_class');
+ } else {
+ $bridge->addExhibitor('gtr_track_class');
+ }
+
+ $bridge->addDate('gtr_date_start');
+ $bridge->addDate('gtr_date_until');
+ if (! $this->createData) {
+ $bridge->addCheckbox('gtr_active');
+ }
+ $bridge->addMultiCheckbox('gtr_organizations', 'label', $this->_('Organizations'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'required', true);
+ }
+
+ /**
+ * Should be called after answering the request to allow the Target
+ * to check if all required registry values have been set correctly.
+ *
+ * @return boolean False if required are missing.
+ */
+ public function checkRegistryRequestsAnswers()
+ {
+ return $this->db && $this->loader && parent::checkRegistryRequestsAnswers();
+ }
+
+ /**
+ * Creates the model
+ *
+ * @return MUtil_Model_ModelAbstract
+ */
+ protected function createModel()
+ {
+ $model = $this->loader->getTracker()->getTrackModel();
+ $model->applyFormatting(true);
+
+ return $model;
+ }
+
+ /**
+ *
+ * @return Gems_Menu_MenuList
+ * /
+ protected function getMenuList()
+ {
+ $links = $this->menu->getMenuList();
+ $links->addParameterSources($this->request, $this->menu->getParameterSource());
+
+ $links->addByController('track', 'show-track', $this->_('Show track'))
+ ->addByController('track', 'index', $this->_('Show tracks'))
+ ->addByController('respondent', 'show', $this->_('Show respondent'));
+
+ return $links;
+ } // */
+
+ /**
+ * Helper function to allow generalized statements about the items in the model to used specific item names.
+ *
+ * @param int $count
+ * @return $string
+ */
+ public function getTopic($count = 1)
+ {
+ return $this->plural('track', 'tracks', $count);
+ }
+
+ /**
+ *
+ * @return string The header title to display
+ */
+ protected function getTitle()
+ {
+ if ($this->createData) {
+ return $this->_('Add new track');
+ } else {
+ return parent::getTitle();
+ }
+ }
+
+ /**
+ * The place to check if the data set in the snippet is valid
+ * to generate the snippet.
+ *
+ * When invalid data should result in an error, you can throw it
+ * here but you can also perform the check in the
+ * checkRegistryRequestsAnswers() function from the
+ * {@see MUtil_Registry_TargetInterface}.
+ *
+ * @return boolean
+ */
+ public function hasHtmlOutput()
+ {
+ if ($this->trackEngine && (! $this->trackId)) {
+ $this->trackId = $this->trackEngine->getTrackId();
+ }
+
+ if ($this->trackId) {
+ // We are updating
+ $this->createData = false;
+
+ // Try to get $this->trackEngine filled
+ if (! $this->trackEngine) {
+ // Set the engine used
+ $this->trackEngine = $this->loader->getTracker()->getTrackEngine($this->trackId);
+ }
+
+ } else {
+ // We are inserting
+ $this->createData = true;
+ $this->saveLabel = $this->_($this->_('Add new track'));
+ }
+
+ return parent::hasHtmlOutput();
+ }
+
+ /**
+ * Hook that loads the form data from $_POST or the model
+ *
+ * Or from whatever other source you specify here.
+ */
+ protected function loadFormData()
+ {
+ parent::loadFormData();
+
+ // feature request #200
+ if (isset($this->formData['gtr_organizations']) && (! is_array($this->formData['gtr_organizations']))) {
+ $this->formData['gtr_organizations'] = explode('|', trim($this->formData['gtr_organizations'], '|'));
+ }
+ }
+
+ /**
+ * Hook containing the actual save code.
+ *
+ * Call's afterSave() for user interaction.
+ *
+ * @see afterSave()
+ */
+ protected function saveData()
+ {
+ // feature request #200
+ if (isset($this->formData['gtr_organizations']) && is_array($this->formData['gtr_organizations'])) {
+ $this->formData['gtr_organizations'] = '|' . implode('|', $this->formData['gtr_organizations']) . '|';
+ }
+ if ($this->trackEngine) {
+ $this->formData['gtr_survey_rounds'] = $this->trackEngine->calculateRoundCount();
+ } else {
+ $this->formData['gtr_survey_rounds'] = 0;
+ }
+
+ parent::saveData();
+
+ // Check for creation
+ if ($this->createData) {
+ if (isset($this->formData['gtr_id_track'])) {
+ $this->trackId = $this->formData['gtr_id_track'];
+ }
+ } elseif ($this->trackEngine &&
+ isset($this->formData[$this->_oldClassName], $this->formData['gtr_track_class']) &&
+ $this->formData[$this->_oldClassName] != $this->formData['gtr_track_class']) {
+
+ // Track conversion
+ $this->trackEngine->convertTo($this->formData['gtr_track_class']);
+ }
+ }
+
+ /**
+ * Set what to do when the form is 'finished'.
+ *
+ * @return EditTrackEngineSnippet (continuation pattern)
+ */
+ protected function setAfterSaveRoute()
+ {
+ // Default is just go to the index
+ if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
+ $this->afterSaveRouteUrl = array($this->request->getActionKey() => $this->routeAction, MUtil_Model::REQUEST_ID => $this->trackId);
+ }
+
+ return $this;
+ }
+}
Modified: branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -646,6 +646,18 @@
}
}
+ /**
+ * Make sure a default child tag element exists.
+ */
+ protected function _ensureDefaultTag()
+ {
+ if ($this->_defaultChildTag && (! $this->_content)) {
+ $value = MUtil_Html::create($this->_defaultChildTag);
+ $this->_lastChild = $value;
+ $this->_content[] = $value;
+ }
+ }
+
private function _notAllowedChild($element)
{
if ($this->_allowedChildTags) {
@@ -858,11 +870,43 @@
return $this->_defaultChildTag;
}
+ /**
+ * Get the first child element.
+ *
+ * @param boolean $create A default child tag is created if the element does not exist and has a default child tag
+ * @return MUtil_Html_HtmlElement or another MUtil_Html_HtmlInterface element
+ */
+ public function getFirst($create = false)
+ {
+ if ($create && (! $this->_content)) {
+ $this->_ensureDefaultTag();
+ }
+ if ($this->_content) {
+ return reset($this->_content);
+ }
+ }
+
public function getIterator()
{
return new ArrayIterator($this->_content);
}
+ /**
+ * Get the last child element.
+ *
+ * @param boolean $create A default child tag is created if the element does not exist
+ * @return MUtil_Html_HtmlElement or another MUtil_Html_HtmlInterface element
+ */
+ public function getLast($create = false)
+ {
+ if ($create && (! $this->_content)) {
+ $this->_ensureDefaultTag();
+ }
+ if ($this->_content) {
+ return end($this->_content);
+ }
+ }
+
public function getOnEmpty()
{
if (! $this->_onEmptyContent) {
Modified: branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -89,6 +89,18 @@
}
/**
+ * Make sure a default child tag element exists.
+ *
+ * Overruled because of the extra actions in $this->tr()
+ */
+ protected function _ensureDefaultTag()
+ {
+ if ($this->_defaultChildTag && (! $this->_content)) {
+ $this->tr();
+ }
+ }
+
+ /**
* Returns the cell or a MUtil_MultiWrapper containing cells that occupy the column position, taking colspan and other functions into account.
*
* @param int $col The numeric column position, starting at 0;
@@ -241,28 +253,7 @@
return $this;
}
- public function tr($arg_array = null)
- {
- $args = func_get_args();
- // Set default child tag first and het because otherwise
- // the children are created first and the default child tag
- // is set afterwards.
- if (! array_key_exists('DefaultChildTag', $args)) {
- array_unshift($args, array('DefaultChildTag' => $this->getDefaultRowChildTag()));
- }
-
- $tr = MUtil_Html::createArray('tr', $args);
-
- $this[] = $tr;
-
- if ((! isset($tr->class)) && ($class = $this->getDefaultRowClass())) {
- $tr->class = $class;
- }
-
- return $tr;
- }
-
/**
* Static helper function for creation, used by @see MUtil_Html_Creator.
*
@@ -298,4 +289,32 @@
$args = func_get_args();
return new self(__FUNCTION__, array('DefaultRowChildTag' => 'th'), $args);
}
+
+ /**
+ * Add a row with a class and the correct type of default child tag to this element
+ *
+ * @param mixed $arg_array MUtil::args() values
+ * @return MUtil_Html_TrElement
+ */
+ public function tr($arg_array = null)
+ {
+ $args = func_get_args();
+
+ // Set default child tag first and het because otherwise
+ // the children are created first and the default child tag
+ // is set afterwards.
+ if (! array_key_exists('DefaultChildTag', $args)) {
+ array_unshift($args, array('DefaultChildTag' => $this->getDefaultRowChildTag()));
+ }
+
+ $tr = MUtil_Html::createArray('tr', $args);
+
+ $this[] = $tr;
+
+ if ((! isset($tr->class)) && ($class = $this->getDefaultRowClass())) {
+ $tr->class = $class;
+ }
+
+ return $tr;
+ }
}
\ No newline at end of file
Modified: branches/1.5.x/library/classes/MUtil/Lazy.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -100,11 +100,27 @@
return $result;
}
+ /**
+ * Lazy if statement
+ *
+ * @param mixed $if The value tested during raise
+ * @param mixed $then The value after raise when $if is true
+ * @param mixed $else The value after raise when $if is false
+ * @return MUtil_Lazy_Call
+ */
public static function iff($if, $then, $else = null)
{
return new MUtil_Lazy_Call(array($if, 'if'), array($then, $else));
}
+ /**
+ * Lazy if statement
+ *
+ * @param mixed $if The value tested during raise
+ * @param mixed $then The value after raise when $if is true
+ * @param mixed $else The value after raise when $if is false
+ * @return MUtil_Lazy_Call
+ */
public static function iif($if, $then, $else = null)
{
return new MUtil_Lazy_Call(array($if, 'if'), array($then, $else));
Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -172,7 +172,7 @@
{
$args = func_get_args();
$allowedOptionsKeys = MUtil_Ra::args($args, 2);
-
+
$allowedOptions = array();
foreach ($allowedOptionsKeys as $allowedOptionsKey) {
if (is_array($allowedOptionsKey)) {
@@ -202,7 +202,7 @@
// Remove options already filled. Using simple array addition
// might trigger a lot of lazy calculations that are not needed.
- //First strip the options that are not allowed
+ //First strip the options that are not allowed
if (MUtil_Model::$verbose) {
$strippedKeys = array_keys(array_diff_key($options, array_flip($allowedOptions)));
if (!empty($strippedKeys)) {
@@ -283,6 +283,13 @@
return $this->_addToForm($name, $element);
}
+ /**
+ * Add a ZendX date picker to the form
+ *
+ * @param string $name Name of element
+ * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array
+ * @return ZendX_JQuery_Form_Element_ColorPicker
+ */
public function addDate($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null)
{
$options = func_get_args();
Modified: branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -215,10 +215,6 @@
$this->table->td();
$this->currentColumn++;
}
-
- // Reset row
- $this->table->tr();
- $this->currentColumn = 0;
}
}
Modified: branches/1.5.x/library/snippets/EditTrackEngineSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/EditTrackEngineSnippet.php 2012-02-06 10:32:06 UTC (rev 450)
+++ branches/1.5.x/library/snippets/EditTrackEngineSnippet.php 2012-02-06 12:39:20 UTC (rev 451)
@@ -36,7 +36,7 @@
*/
/**
- * Snippet for editing track engines instances
+ * Default snippet for editing track engines instances
*
* @package Gems
* @subpackage Snippets
@@ -44,261 +44,6 @@
* @license New BSD License
* @since Class available since version 1.4
*/
-class EditTrackEngineSnippet extends Gems_Snippets_ModelFormSnippetAbstract
+class EditTrackEngineSnippet extends Gems_Tracker_Snippets_EditTrackEngineSnippetGeneric
{
- /**
- *
- * @var string Field for storing the old track class
- */
- protected $_oldClassName = 'old__gtr_track_class';
-
- /**
- *
- * @var Zend_Db_Adapter_Abstract
- */
- protected $db;
-
- /**
- * Required
- *
- * @var Gems_Loader
- */
- protected $loader;
-
- /**
- * Optional, required when creating or $trackId should be set
- *
- * @var Gems_Tracker_Engine_TrackEngineInterface
- */
- protected $trackEngine;
-
- /**
- * Optional, required when creating or $engine should be set
- *
- * @var int Track Id
- */
- protected $trackId;
-
- /**
- * @var Gems_Util
- */
- protected $util;
-
- /**
- * 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->createData) {
- $bridge->addHidden('gtr_id_track');
- }
- $bridge->addText('gtr_track_name', 'size', 30, 'minlength', 4, 'validator', $model->createUniqueValidator('gtr_track_name'));
-
- // gtr_track_class
- if ($this->trackEngine) {
- $options = $model->get('gtr_track_class', 'multiOptions');
- $alternatives = $this->trackEngine->getConversionTargets($options);
- if (count($alternatives) > 1) {
- $options = $alternatives;
-
- $bridge->addHidden($this->_oldClassName);
-
- if (! isset($this->formData[$this->_oldClassName])) {
- $this->formData[$this->_oldClassName] = $this->formData['gtr_track_class'];
- }
-
- $classEdit = true;
- } else {
- $classEdit = false;
- }
- } else {
- $tracker = $this->loader->getTracker();
- $options = $tracker->getTrackEngineList(true, true);
- $classEdit = true;
- }
- $model->set('gtr_track_class', 'multiOptions', $options, 'escape', false);
- if ($classEdit) {
- $bridge->addRadio( 'gtr_track_class');
- } else {
- $bridge->addExhibitor('gtr_track_class');
- }
-
- $bridge->addDate('gtr_date_start');
- $bridge->addDate('gtr_date_until');
- if (! $this->createData) {
- $bridge->addCheckbox('gtr_active');
- }
- $bridge->addMultiCheckbox('gtr_organizations', 'label', $this->_('Organizations'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'required', true);
- }
-
- /**
- * Should be called after answering the request to allow the Target
- * to check if all required registry values have been set correctly.
- *
- * @return boolean False if required are missing.
- */
- public function checkRegistryRequestsAnswers()
- {
- return $this->db && $this->loader && parent::checkRegistryRequestsAnswers();
- }
-
- /**
- * Creates the model
- *
- * @return MUtil_Model_ModelAbstract
- */
- protected function createModel()
- {
- $model = $this->loader->getTracker()->getTrackModel();
- $model->applyFormatting(true);
-
- return $model;
- }
-
- /**
- *
- * @return Gems_Menu_MenuList
- * /
- protected function getMenuList()
- {
- $links = $this->menu->getMenuList();
- $links->addParameterSources($this->request, $this->menu->getParameterSource());
-
- $links->addByController('track', 'show-track', $this->_('Show track'))
- ->addByController('track', 'index', $this->_('Show tracks'))
- ->addByController('respondent', 'show', $this->_('Show respondent'));
-
- return $links;
- } // */
-
- /**
- * Helper function to allow generalized statements about the items in the model to used specific item names.
- *
- * @param int $count
- * @return $string
- */
- public function getTopic($count = 1)
- {
- return $this->plural('track', 'tracks', $count);
- }
-
- /**
- *
- * @return string The header title to display
- */
- protected function getTitle()
- {
- if ($this->createData) {
- return $this->_('Add new track');
- } else {
- return parent::getTitle();
- }
- }
-
- /**
- * The place to check if the data set in the snippet is valid
- * to generate the snippet.
- *
- * When invalid data should result in an error, you can throw it
- * here but you can also perform the check in the
- * checkRegistryRequestsAnswers() function from the
- * {@see MUtil_Registry_TargetInterface}.
- *
- * @return boolean
- */
- public function hasHtmlOutput()
- {
- if ($this->trackEngine && (! $this->trackId)) {
- $this->trackId = $this->trackEngine->getTrackId();
- }
-
- if ($this->trackId) {
- // We are updating
- $this->createData = false;
-
- // Try to get $this->trackEngine filled
- if (! $this->trackEngine) {
- // Set the engine used
- $this->trackEngine = $this->loader->getTracker()->getTrackEngine($this->trackId);
- }
-
- } else {
- // We are inserting
- $this->createData = true;
- $this->saveLabel = $this->_($this->_('Add new track'));
- }
-
- return parent::hasHtmlOutput();
- }
-
- /**
- * Hook that loads the form data from $_POST or the model
- *
- * Or from whatever other source you specify here.
- */
- protected function loadFormData()
- {
- parent::loadFormData();
-
- // feature request #200
- if (isset($this->formData['gtr_organizations']) && (! is_array($this->formData['gtr_organizations']))) {
- $this->formData['gtr_organizations'] = explode('|', trim($this->formData['gtr_organizations'], '|'));
- }
- }
-
- /**
- * Hook containing the actual save code.
- *
- * Call's afterSave() for user interaction.
- *
- * @see afterSave()
- */
- protected function saveData()
- {
- // feature request #200
- if (isset($this->formData['gtr_organizations']) && is_array($this->formData['gtr_organizations'])) {
- $this->formData['gtr_organizations'] = '|' . implode('|', $this->formData['gtr_organizations']) . '|';
- }
- if ($this->trackEngine) {
- $this->formData['gtr_survey_rounds'] = $this->trackEngine->calculateRoundCount();
- } else {
- $this->formData['gtr_survey_rounds'] = 0;
- }
-
- parent::saveData();
-
- // Check for creation
- if ($this->createData) {
- if (isset($this->formData['gtr_id_track'])) {
- $this->trackId = $this->formData['gtr_id_track'];
- }
- } elseif ($this->trackEngine &&
- isset($this->formData[$this->_oldClassName], $this->formData['gtr_track_class']) &&
- $this->formData[$this->_oldClassName] != $this->formData['gtr_track_class']) {
-
- // Track conversion
- $this->trackEngine->convertTo($this->formData['gtr_track_class']);
- }
- }
-
- /**
- * Set what to do when the form is 'finished'.
- *
- * @return EditTrackEngineSnippet (continuation pattern)
- */
- protected function setAfterSaveRoute()
- {
- // Default is just go to the index
- if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
- $this->afterSaveRouteUrl = array($this->request->getActionKey() => $this->routeAction, MUtil_Model::REQUEST_ID => $this->trackId);
- }
-
- return $this;
- }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-06 10:32:18
|
Revision: 450
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=450&view=rev
Author: mennodekker
Date: 2012-02-06 10:32:06 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
Fixed noticed for missing project setting account.delayFactor
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
Modified: branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-02-05 16:22:26 UTC (rev 449)
+++ branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-02-06 10:32:06 UTC (rev 450)
@@ -193,7 +193,7 @@
*/
public function getAccountDelayFactor()
{
- if (isset($this->account['delayFactor'])) {
+ if (isset($this->account) && isset($this->account['delayFactor'])) {
return intval($this->account['delayFactor']);
} else {
return 4;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-05 16:22:32
|
Revision: 449
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=449&view=rev
Author: matijsdejong
Date: 2012-02-05 16:22:26 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
RespondentTokenSnippet filters on the current organization
AddTracksSnippet and AnswerModelSnippetGeneric parts can be turned on or off
Extra Lazy concat function
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php
branches/1.5.x/library/classes/MUtil/Lazy.php
branches/1.5.x/library/snippets/AddTracksSnippet.php
branches/1.5.x/library/snippets/RespondentTokenSnippet.php
Modified: branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2012-02-02 17:01:28 UTC (rev 448)
+++ branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2012-02-05 16:22:26 UTC (rev 449)
@@ -90,6 +90,13 @@
protected $showButtons = true;
/**
+ * Switch to put the display of the headers on or off
+ *
+ * @var boolean
+ */
+ protected $showHeaders = true;
+
+ /**
* Switch to put the display of the current token as select to true or false.
*
* @var boolean
@@ -204,14 +211,16 @@
if ($this->tokenId) {
if ($this->token->exists) {
- $htmlDiv->h3(sprintf($this->_('%s answers for patient number %s'), $this->token->getSurveyName(), $this->token->getPatientNumber()));
+ if ($this->showHeaders) {
+ $htmlDiv->h3(sprintf($this->_('%s answers for patient number %s'), $this->token->getSurveyName(), $this->token->getPatientNumber()));
- $htmlDiv->pInfo(sprintf(
- $this->_('Answers for token %s, patient number %s: %s.'),
- strtoupper($this->tokenId),
- $this->token->getPatientNumber(),
- $this->token->getRespondentName()))
- ->appendAttrib('class', 'noprint');
+ $htmlDiv->pInfo(sprintf(
+ $this->_('Answers for token %s, patient number %s: %s.'),
+ strtoupper($this->tokenId),
+ $this->token->getPatientNumber(),
+ $this->token->getRespondentName()))
+ ->appendAttrib('class', 'noprint');
+ }
$table = parent::getHtmlOutput($view);
$table->setPivot(true, 2, 1);
Modified: branches/1.5.x/library/classes/MUtil/Lazy.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-02 17:01:28 UTC (rev 448)
+++ branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-05 16:22:26 UTC (rev 449)
@@ -73,6 +73,20 @@
return new MUtil_Lazy_Call($lambda, array($opLeft, $opRight));
}
+ /**
+ * The arguments are flattened lazily into one single array
+ * and then joined together without separator.
+ *
+ * @param mixed $arg_array
+ * @return MUtil_Lazy_Call
+ */
+ public static function concat($arg_array = null)
+ {
+ $args = func_get_args();
+
+ return new MUtil_Lazy_Call('implode', array('', new MUtil_Lazy_Call('MUtil_Ra::flatten', $args)));
+ }
+
public static function first($args_array)
{
$args = func_get_args();
Modified: branches/1.5.x/library/snippets/AddTracksSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/AddTracksSnippet.php 2012-02-02 17:01:28 UTC (rev 448)
+++ branches/1.5.x/library/snippets/AddTracksSnippet.php 2012-02-05 16:22:26 UTC (rev 449)
@@ -84,6 +84,28 @@
*/
public $session;
+ /**
+ * Switch to set display of respondent dropdown on or off
+ *
+ * @var boolean
+ */
+ public $showForRespondents = true;
+
+ /**
+ * Switch to set display of staff dropdown on or off
+ *
+ * @var boolean
+ */
+ public $showForStaff = true;
+
+
+ /**
+ * Switch to set display of track dropdown on or off
+ *
+ * @var boolean
+ */
+ public $showForTracks = true;
+
protected function _getTracks($trackType, $pageRef)
{
switch ($trackType) {
@@ -193,6 +215,10 @@
*/
public function getHtmlOutput(Zend_View_Abstract $view)
{
+ if (! $this->escort) {
+ $this->escort = GemsEscort::getInstance();
+ }
+
if ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface ||
$this->escort instanceof Gems_Project_Tracks_StandAloneSurveysInterface) {
@@ -200,12 +226,16 @@
$addToLists = MUtil_Html::create()->div(array('class' => 'tooldock'));
$addToLists->strong($this->_('Add'));
- if ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface) {
+ if ($this->showForTracks && ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface)) {
$addToLists[] = $this->_getTracks('T', $pageRef);
}
if ($this->escort instanceof Gems_Project_Tracks_StandAloneSurveysInterface) {
- $addToLists[] = $this->_getTracks('S', $pageRef);
- $addToLists[] = $this->_getTracks('M', $pageRef);
+ if ($this->showForRespondents) {
+ $addToLists[] = $this->_getTracks('S', $pageRef);
+ }
+ if ($this->showForStaff) {
+ $addToLists[] = $this->_getTracks('M', $pageRef);
+ }
}
return $addToLists;
Modified: branches/1.5.x/library/snippets/RespondentTokenSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-02 17:01:28 UTC (rev 448)
+++ branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-05 16:22:26 UTC (rev 449)
@@ -186,7 +186,8 @@
*/
protected function processFilterAndSort(MUtil_Model_ModelAbstract $model)
{
- $filter['gto_id_respondent'] = $this->respondentData['grs_id_user'];
+ $filter['gto_id_respondent'] = $this->respondentData['grs_id_user'];
+ $filter['gto_id_organization'] = $this->respondentData['gr2o_id_organization'];
$filter[] = 'gr2t_reception_code IN (SELECT grc_id_reception_code FROM gems__reception_codes WHERE grc_success = 1)';
$filter['grc_success'] = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 17:01:38
|
Revision: 448
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=448&view=rev
Author: matijsdejong
Date: 2012-02-02 17:01:28 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
$html->snippet() adds a snippet to the content of the element
Added documentation
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php
branches/1.5.x/library/classes/MUtil/Controller/Action.php
branches/1.5.x/library/classes/MUtil/Html/Creator.php
branches/1.5.x/library/classes/MUtil/Html.php
Modified: branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-02-02 15:02:24 UTC (rev 447)
+++ branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-02-02 17:01:28 UTC (rev 448)
@@ -310,7 +310,7 @@
$form->addElement($element);
$form->addDisplayGroup(array('formLinks'), 'form_buttons');
}
- } else {
+ } else {
$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.
Modified: branches/1.5.x/library/classes/MUtil/Controller/Action.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Controller/Action.php 2012-02-02 15:02:24 UTC (rev 447)
+++ branches/1.5.x/library/classes/MUtil/Controller/Action.php 2012-02-02 17:01:28 UTC (rev 448)
@@ -397,6 +397,8 @@
public function initHtml($reset = false)
{
if ($reset || (! $this->html)) {
+ MUtil_Html::setSnippetLoader($this->getSnippetLoader());
+
$this->html = new MUtil_Html_Sequence();
// Add this variable to the view.
Modified: branches/1.5.x/library/classes/MUtil/Html/Creator.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Html/Creator.php 2012-02-02 15:02:24 UTC (rev 447)
+++ branches/1.5.x/library/classes/MUtil/Html/Creator.php 2012-02-02 17:01:28 UTC (rev 448)
@@ -1,6 +1,5 @@
<?php
-
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -26,27 +25,56 @@
* 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: Creator.php 362 2011-12-15 17:21:17Z matijsdejong $
*/
/**
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
+ * Class for storing references for creating html attributes, elements and other objects.
+ *
+ * Basically this class stores list of element and attributes names that should be treated
+ * in different from just creating the most basic of element types.
+ *
+ * @package MUtil
* @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
*/
class MUtil_Html_Creator
{
+ /**
+ *
+ * @var MUtil_Util_LookupList
+ */
protected $_attributeFunctionList;
+
+ /**
+ *
+ * @var MUtil_Util_LookupList
+ */
protected $_elementFunctionList;
+ /**
+ *
+ * @var array
+ */
protected $_initialAttributeFunctions = array(
'href' => 'MUtil_Html_HrefArrayAttribute::hrefAttribute',
'onclick' => 'MUtil_Html_OnClickArrayAttribute::onclickAttribute',
'style' => 'MUtil_Html_StyleArrayAttribute::styleAttribute',
);
+ /**
+ *
+ * @var array
+ */
protected $_initalElementFunctions = array(
'a' => 'MUtil_Html_AElement::a',
'array' => 'MUtil_Html_Sequence::createSequence',
@@ -86,6 +114,7 @@
'raw' => 'MUtil_Html_Raw::raw',
'seq' => 'MUtil_Html_Sequence::createSequence',
'sequence' => 'MUtil_Html_Sequence::createSequence', // A sequence can contain another sequence, so other function name used
+ 'snippet' => 'MUtil_Html::snippet',
'spaced' => 'MUtil_Html_Sequence::createSpaced', // A sequence can contain another sequence, so other function name used
'table' => 'MUtil_Html_TableElement::table',
'tbody' => 'MUtil_Html_TBodyElement::tbody',
Modified: branches/1.5.x/library/classes/MUtil/Html.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Html.php 2012-02-02 15:02:24 UTC (rev 447)
+++ branches/1.5.x/library/classes/MUtil/Html.php 2012-02-02 17:01:28 UTC (rev 448)
@@ -1,55 +1,69 @@
<?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 Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $id: Html.php 362 2011-12-15 17:21:17Z matijsdejong $
*/
/**
* Collections of static function for using the Html subpackage.
- *
- * @author Matijs de Jong
- * @package MUtil
+ *
+ * @package MUtil
* @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
*/
class MUtil_Html
{
+ /**
+ *
+ * @var MUtil_Html_Creator
+ */
private static $_creator;
+
+ /**
+ *
+ * @var MUtil_Html_Renderer
+ */
private static $_renderer;
/**
+ *
+ * @var type MUtil_Snippets_SnippetLoader
+ */
+ private static $_snippetLoader;
+
+ /**
* Static variable for debuggging purposes. Toggles the echoing of e.g. of sql
* select statements, using MUtil_Echo.
*
@@ -65,9 +79,10 @@
*/
public static $verbose = false;
- public static function canRender($value)
+ public static function addUrl2Page(Zend_Navigation_Container $menu, $label, $arg_array = null)
{
- return self::getRenderer()->canRender($value);
+ $args = array_slice(func_get_args(), 2);
+ $menu->addPage(self::url($args)->toPage($label));
}
public static function attrib($attributeName, $args_array = null)
@@ -77,6 +92,11 @@
return self::getCreator()->createAttribute($attributeName, $args);
}
+ public static function canRender($value)
+ {
+ return self::getRenderer()->canRender($value);
+ }
+
/**
*
* @param string $tagName Optional tag to create
@@ -101,7 +121,7 @@
/**
* Creates a new HtmlElement with the arguments specfied in a single array.
- *
+ *
* @param string $tagName (or a Lazy object)
* @param array $args
* @return MUtil_Html_ElementInterface
@@ -118,17 +138,17 @@
/**
* Creates a div element
- *
+ *
* @param mixed $arg_array Optional MUtil_Ra::args processed settings
* @return MUtil_Html_HtmlElement (with div tagName)
*/
public static function div($arg_array = null)
{
$args = func_get_args();
-
+
return self::getCreator()->create('div', $args);
}
-
+
public static function element2id(Zend_Form_Element $element)
{
return self::name2id($element->getName(), $element->getBelongsTo());
@@ -152,6 +172,19 @@
return self::$_renderer;
}
+ /**
+ * Get the snippet loader for use by self::snippet().
+ *
+ * @return MUtil_Snippets_SnippetLoader
+ */
+ public static function getSnippetLoader()
+ {
+ if (! self::$_snippetLoader) {
+ self::setSnippetLoader(new MUtil_Snippets_SnippetLoader());
+ }
+ return self::$_snippetLoader;
+ }
+
public static function name2id($name, $belongsTo = null)
{
return preg_replace('/\[([^\]]+)\]/', '-$1', $name . '-' . $belongsTo);
@@ -183,17 +216,17 @@
/**
* Creates a table element
- *
+ *
* @param mixed $arg_array Optional MUtil_Ra::args processed settings
* @return MUtil_Html_TableElement
*/
public static function table($arg_array = null)
{
$args = func_get_args();
-
+
return self::getCreator()->create('table', $args);
}
-
+
public static function setCreator(MUtil_Html_Creator $creator)
{
self::$_creator = $creator;
@@ -206,15 +239,40 @@
return self::$_renderer;
}
+ /**
+ * Set the snippet loader for use by self::snippet().
+ *
+ * @param MUtil_Snippets_SnippetLoader $snippetLoader
+ * @return MUtil_Snippets_SnippetLoader
+ */
+ public static function setSnippetLoader(MUtil_Snippets_SnippetLoader $snippetLoader)
+ {
+ self::$_snippetLoader = $snippetLoader;
+ return self::$_snippetLoader;
+ }
+
+ /**
+ *
+ * @param string $name Snippet name
+ * @param MUtil_Ra::pairs $parameter_value_pairs Optional extra snippets
+ * @return
+ */
+ public static function snippet($name, $parameter_value_pairs = null)
+ {
+ if (func_num_args() > 1) {
+ $extraSourceParameters = MUtil_Ra::pairs(func_get_args(), 1);
+ } else {
+ $extraSourceParameters = array();
+ }
+
+ $loader = self::getSnippetLoader();
+
+ return $loader->getSnippet($name, $extraSourceParameters);
+ }
+
public static function url($arg_array = null)
{
$args = func_get_args();
return new MUtil_Html_HrefArrayAttribute($args);
}
-
- public static function addUrl2Page(Zend_Navigation_Container $menu, $label, $arg_array = null)
- {
- $args = array_slice(func_get_args(), 2);
- $menu->addPage(self::url($args)->toPage($label));
- }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 15:02:35
|
Revision: 447
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=447&view=rev
Author: roelfaber
Date: 2012-02-02 15:02:24 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
remark added about using quotes in setting
Modified Paths:
--------------
trunk/new_project/application/configs/project.ini
Modified: trunk/new_project/application/configs/project.ini
===================================================================
--- trunk/new_project/application/configs/project.ini 2012-02-02 14:48:27 UTC (rev 446)
+++ trunk/new_project/application/configs/project.ini 2012-02-02 15:02:24 UTC (rev 447)
@@ -15,7 +15,8 @@
;----------------------------------------------------------
; The non database super user
;
-; On production pwd should be empty or langer than 10 chars
+; On production pwd should be empty or longer than 10 chars
+; and quoted if it contains special characters.
;----------------------------------------------------------
admin.user = superadmin
admin.pwd =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 14:48:33
|
Revision: 446
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=446&view=rev
Author: matijsdejong
Date: 2012-02-02 14:48:27 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Fixes + small extensions
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php
branches/1.5.x/library/snippets/EditTrackSnippet.php
Modified: branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-02 14:47:15 UTC (rev 445)
+++ branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-02 14:48:27 UTC (rev 446)
@@ -201,7 +201,7 @@
/**
* Makes sure the respondent data is part of the $this->_respTrackData
*/
- private function _ensureRespondentData()
+ protected function _ensureRespondentData()
{
if (! isset($this->_respTrackData['grs_id_user'], $this->_respTrackData['gr2o_id_user'], $this->_respTrackData['gco_code'])) {
$sql = "SELECT *
@@ -452,6 +452,16 @@
}
/**
+ * Returns the description of this track as stored in the fields.
+ *
+ * @return string
+ */
+ public function getFieldsInfo()
+ {
+ return $this->_respTrackData['gr2t_track_info'];
+ }
+
+ /**
* Returns the first token in this track
*
* @return Gems_Tracker_Token
Modified: branches/1.5.x/library/snippets/EditTrackSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/EditTrackSnippet.php 2012-02-02 14:47:15 UTC (rev 445)
+++ branches/1.5.x/library/snippets/EditTrackSnippet.php 2012-02-02 14:48:27 UTC (rev 446)
@@ -153,7 +153,6 @@
}
if ($refresh) {
- Gems_Tracker::$verbose;
// Perform a refresh from the database, to avoid date trouble
$this->respondentTrack->refresh();
$this->respondentTrack->checkTrackTokens($this->userId);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 14:47:24
|
Revision: 445
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=445&view=rev
Author: mennodekker
Date: 2012-02-02 14:47:15 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Make upgrade action create new tables and run the sync sources + removed reference to session for userid
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Default/SourceAction.php
branches/1.5.x/library/classes/Gems/Upgrades.php
branches/1.5.x/library/classes/Gems/UpgradesAbstract.php
Modified: branches/1.5.x/library/classes/Gems/Default/SourceAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/SourceAction.php 2012-02-02 13:59:06 UTC (rev 444)
+++ branches/1.5.x/library/classes/Gems/Default/SourceAction.php 2012-02-02 14:47:15 UTC (rev 445)
@@ -231,7 +231,7 @@
{
$source = $this->getSourceById();
- if ($source->checkSourceActive($this->session->user_id)) {
+ if ($source->checkSourceActive($this->loader->getCurrentUser()->getUserId())) {
$this->addMessage($this->_('This installation is active.'));
} else {
$this->addMessage($this->_('Inactive installation.'));
@@ -244,7 +244,7 @@
{
$source = $this->getSourceById();
- if ($messages = $source->synchronizeSurveys($this->session->user_id)) {
+ if ($messages = $source->synchronizeSurveys($this->loader->getCurrentUser()->getUserId())) {
$this->addMessage($messages);
} else {
$this->addMessage($this->_('No changes.'));
@@ -263,7 +263,7 @@
$source = $this->getSourceById($row['gso_id_source']);
$this->addMessage(sprintf($this->_('Synchronization of source %s:'), $row['gso_source_name']));
- if ($messages = $source->synchronizeSurveys($this->session->user_id)) {
+ if ($messages = $source->synchronizeSurveys($this->loader->getCurrentUser()->getUserId())) {
$this->addMessage($messages);
} else {
$this->addMessage($this->_('No changes.'));
Modified: branches/1.5.x/library/classes/Gems/Upgrades.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-02 13:59:06 UTC (rev 444)
+++ branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-02 14:47:15 UTC (rev 445)
@@ -61,16 +61,38 @@
/**
* To upgrade from 143 to 15 we need to do some work:
- * 1. execute db patches
+ * 1. execute db patches 42 and 43
+ * 2. create new tables
*/
public function Upgrade143to15()
- {
+ {
$this->patcher->executePatch(42);
$this->patcher->executePatch(43);
- //Also create new tables or do so in patches...
-
+
$this->invalidateCache();
+ $this->createNewTables();
+
+ $this->invalidateCache();
+
+ //Now sync the db sources to allow limesurvey source to add a field to the tokentable
+ $model = new MUtil_Model_TableModel('gems__sources');
+ $data = $model->load(false);
+
+ $tracker = $this->loader->getTracker();
+
+ foreach ($data as $row) {
+ $source = $tracker->getSource($row['gso_id_source']);
+
+ if ($messages = $source->synchronizeSurveys($this->loader->getCurrentUser()->getUserId())) {
+ foreach ($messages as $message) {
+ $this->addMessage($message);
+ }
+ }
+ }
+
+ $this->invalidateCache();
+
return true;
}
}
\ No newline at end of file
Modified: branches/1.5.x/library/classes/Gems/UpgradesAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/UpgradesAbstract.php 2012-02-02 13:59:06 UTC (rev 444)
+++ branches/1.5.x/library/classes/Gems/UpgradesAbstract.php 2012-02-02 14:47:15 UTC (rev 445)
@@ -64,6 +64,11 @@
public $db;
/**
+ * @var Gems_Model_DbaModel
+ */
+ public $dbaModel;
+
+ /**
* @var GemsEscort
*/
public $escort;
@@ -80,6 +85,11 @@
public $patcher;
/**
+ * @var Gems_Project_ProjectSettings
+ */
+ public $project;
+
+ /**
* @var Zend_Translate_Adapter
*/
public $translate;
@@ -126,9 +136,18 @@
public function checkRegistryRequestsAnswers() {
//As an upgrade almost always includes executing db patches, make a DatabasePatcher object available
$this->patcher = new Gems_Util_DatabasePatcher($this->db, 'patches.sql', $this->escort->getDatabasePaths());
- //No load all patches, and save the resulting changed patches for later (not used yet)
+ //Now load all patches, and save the resulting changed patches for later (not used yet)
$changed = $this->patcher->uploadPatches($this->loader->getVersions()->getBuild());
+ //Load the dbaModel
+ $paths = $this->escort->getDatabasePaths();
+ $model = new Gems_Model_DbaModel($this->db, array_values($paths));
+ $model->setLocations(array_keys($paths));
+ if ($this->project->databaseFileEncoding) {
+ $model->setFileEncoding($this->project->databaseFileEncoding);
+ }
+ $this->dbaModel = $model;
+
return true;
}
@@ -141,6 +160,29 @@
}
/**
+ * Create all new tables according to the dba model
+ */
+ protected function createNewTables()
+ {
+ //Now create all new tables
+ $todo = $this->dbaModel->load(array('state'=> Gems_Model_DbaModel::STATE_DEFINED));
+ $i = 1;
+ $oCount = count($todo);
+ $results = array();
+ foreach($todo as $tableData) {
+ $result = $this->dbaModel->runScript($tableData);
+ $results = array_merge($results, $result);
+ $results[] = sprintf($this->_('Finished %s creation script for object %d of %d'), $this->_(strtolower($tableData['type'])), $i, $oCount) . '<br/>';
+ $i++;
+ }
+
+ foreach ($results as $result)
+ {
+ $this->addMessage($result);
+ }
+ }
+
+ /**
* Execute upgrades for the given $context
*
* When no $to or $from are given, the given $context will be upgraded from the current level
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 13:59:12
|
Revision: 444
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=444&view=rev
Author: mennodekker
Date: 2012-02-02 13:59:06 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Extracted _runScript and _runScripts methods to the DbaModel to allow usage outside the DatabaseAction
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Default/DatabaseAction.php
branches/1.5.x/library/classes/Gems/Model/DbaModel.php
Modified: branches/1.5.x/library/classes/Gems/Default/DatabaseAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/DatabaseAction.php 2012-02-02 12:39:24 UTC (rev 443)
+++ branches/1.5.x/library/classes/Gems/Default/DatabaseAction.php 2012-02-02 13:59:06 UTC (rev 444)
@@ -48,50 +48,6 @@
{
public $sortKey = array('group' => SORT_ASC, 'type' => SORT_ASC, 'name' => SORT_ASC);
- private function _runScript(array $data, $includeResultSets = false)
- {
- $results = array();
- $this->_runScripts($data, $results, $includeResultSets);
- return $results;
- }
-
- private function _runScripts(array $data, array &$results, $includeResultSets = false)
- {
- if ($data['script']) {
- $queries = MUtil_Parser_Sql_WordsParser::splitStatements($data['script'], false);
- $qCount = count($queries);
-
- $results[] = sprintf($this->_('Executed %2$s creation script %1$s:'), $data['name'], $this->_(strtolower($data['type'])));
- $i = 1;
- $resultSet = 1;
-
- foreach ($queries as $query) {
- $sql = (string) $query;
- try {
- $stmt = $this->db->query($sql);
- if ($rows = $stmt->rowCount()) {
- if ($includeResultSets && ($data = $stmt->fetchAll())) {
- $results[] = sprintf($this->_('%d record(s) returned as result set %d in step %d of %d.'), $rows, $resultSet, $i, $qCount);
- $results[] = $data;
- $resultSet++;
- } else {
- $results[] = sprintf($this->_('%d record(s) updated in step %d of %d.'), $rows, $i, $qCount);
- }
- } else {
- $results[] = sprintf($this->_('Script ran step %d of %d succesfully.'), $i, $qCount);
- }
- } catch (Zend_Db_Statement_Exception $e) {
- $results[] = $e->getMessage() . $this->_(' in step ') . $i . ':<pre>' . $sql . '</pre>';
- }
- $i++;
- }
- } else {
- $results[] = sprintf($this->_('No script for %1$s.'), $data['name']);
- }
-
- return $results;
- }
-
/**
* Set the parameters needed by the menu.
*
@@ -168,10 +124,7 @@
$model->set('location', 'label', $this->_('Location'));
}
// $model->set('path', 'label', $this->_('Path'));
- $model->set('state', 'label', $this->_('Status'), 'multiOptions', array(
- Gems_Model_DbaModel::STATE_CREATED => $this->_('created'),
- Gems_Model_DbaModel::STATE_DEFINED => $this->_('not created'),
- Gems_Model_DbaModel::STATE_UNKNOWN => $this->_('unknown')));
+ $model->set('state', 'label', $this->_('Status'));
if ($detailed) {
$model->set('script', 'label', $this->_('Script'), 'itemDisplay', 'pre');
@@ -482,7 +435,7 @@
$model = $this->getModel();
$data = $model->loadFirst();
- $results = $this->_runScript($data);
+ $results = $model->runScript($data);
$this->addMessage($results);
$this->_reroute(array('action' => 'show'));
@@ -497,11 +450,13 @@
if ($this->_getParam('confirmed')) {
if ($objects) {
+ $results = array();
$results[] = sprintf($this->_('Starting %d object creation scripts.'), $oCount) . '<br/>';
$i = 1;
foreach ($objects as $data) {
- $this->_runScripts($data, $results);
+ $result = $model->runScript($data);
+ $results = array_merge($results, $result);
$results[] = sprintf($this->_('Finished %s creation script for object %d of %d'), $this->_(strtolower($data['type'])), $i, $oCount) . '<br/>';
$i++;
}
@@ -559,7 +514,8 @@
$data['name'] = '';
$data['type'] = $this->_('raw');
- $results = $this->_runScript($data, true);
+ $model = $this->getModel();
+ $results = $model->runScript($data, true);
$resultSet = 1;
$echos = MUtil_Html::create()->array();
foreach ($results as $result) {
Modified: branches/1.5.x/library/classes/Gems/Model/DbaModel.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Model/DbaModel.php 2012-02-02 12:39:24 UTC (rev 443)
+++ branches/1.5.x/library/classes/Gems/Model/DbaModel.php 2012-02-02 13:59:06 UTC (rev 444)
@@ -60,6 +60,10 @@
protected $file_encoding;
protected $locations;
protected $mainDirectory;
+ /**
+ * @var Zend_Translate_Adapter
+ */
+ protected $translate;
private $_sorts;
@@ -73,6 +77,9 @@
$this->db = $db;
+ //Grab translate object from the Escort
+ $this->translate = GemsEscort::getInstance()->translate;
+
$this->set('group', 'maxlength', 40, 'type', MUtil_Model::TYPE_STRING);
$this->set('name', 'key', true, 'maxlength', 40, 'type', MUtil_Model::TYPE_STRING);
$this->set('type', 'maxlength', 40, 'type', MUtil_Model::TYPE_STRING);
@@ -86,8 +93,25 @@
$this->set('script', 'type', MUtil_Model::TYPE_STRING);
$this->set('lastChanged', 'type', MUtil_Model::TYPE_DATETIME);
$this->set('location', 'maxlength', 12, 'type', MUtil_Model::TYPE_STRING);
+ $this->set('state', 'multiOptions', array(
+ Gems_Model_DbaModel::STATE_CREATED => $this->_('created'),
+ Gems_Model_DbaModel::STATE_DEFINED => $this->_('not created'),
+ Gems_Model_DbaModel::STATE_UNKNOWN => $this->_('unknown')));
}
+ /**
+ * proxy for easy access to translations
+ *
+ * @param string $messageId Translation string
+ * @param string|Zend_Locale $locale (optional) Locale/Language to use, identical with locale
+ * identifier, @see Zend_Locale for more information
+ * @return string
+ */
+ private function _($messageId, $locale = null)
+ {
+ return $this->translate->_($messageId, $locale);
+ }
+
private function _getGroupName($name)
{
if ($pos = strpos($name, '__')) {
@@ -374,6 +398,56 @@
return $this->loadFirst(array('name' => $tableName), false);
}
+ /**
+ * Run a sql statement from an object loaded through this model
+ *
+ * $data is an array with the following keys:
+ * script The sql statement to be executed
+ * name The name of the table, used in messages
+ * type Type of db element (table or view), used in messages
+ *
+ * @param array $data
+ * @param type $includeResultSets
+ * @return type
+ */
+ public function runScript(array $data, $includeResultSets = false)
+ {
+ $results = array();
+ if ($data['script']) {
+ $queries = MUtil_Parser_Sql_WordsParser::splitStatements($data['script'], false);
+ $qCount = count($queries);
+
+ $results[] = sprintf($this->_('Executed %2$s creation script %1$s:'), $data['name'], $this->_(strtolower($data['type'])));
+ $i = 1;
+ $resultSet = 1;
+
+ foreach ($queries as $query) {
+ $sql = (string) $query;
+ try {
+ $stmt = $this->db->query($sql);
+ if ($rows = $stmt->rowCount()) {
+ if ($includeResultSets && ($data = $stmt->fetchAll())) {
+ $results[] = sprintf($this->_('%d record(s) returned as result set %d in step %d of %d.'), $rows, $resultSet, $i, $qCount);
+ $results[] = $data;
+ $resultSet++;
+ } else {
+ $results[] = sprintf($this->_('%d record(s) updated in step %d of %d.'), $rows, $i, $qCount);
+ }
+ } else {
+ $results[] = sprintf($this->_('Script ran step %d of %d succesfully.'), $i, $qCount);
+ }
+ } catch (Zend_Db_Statement_Exception $e) {
+ $results[] = $e->getMessage() . $this->_(' in step ') . $i . ':<pre>' . $sql . '</pre>';
+ }
+ $i++;
+ }
+ } else {
+ $results[] = sprintf($this->_('No script for %1$s.'), $data['name']);
+ }
+
+ return $results;
+ }
+
public function save(array $newValues, array $filter = null)
{
// TODO: Save of data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-02-02 12:39:31
|
Revision: 443
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=443&view=rev
Author: matijsdejong
Date: 2012-02-02 12:39:24 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Fix for spaces around super username/password
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
Modified: branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-01-31 15:41:22 UTC (rev 442)
+++ branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-02-02 12:39:24 UTC (rev 443)
@@ -293,7 +293,7 @@
public function getSuperAdminName()
{
if (isset($this->admin) && isset($this->admin['user'])) {
- return $this->admin['user'];
+ return trim($this->admin['user']);
}
}
@@ -305,7 +305,7 @@
protected function getSuperAdminPassword()
{
if (isset($this->admin) && isset($this->admin['pwd'])) {
- return $this->admin['pwd'];
+ return trim($this->admin['pwd']);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 15:41:34
|
Revision: 442
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=442&view=rev
Author: matijsdejong
Date: 2012-01-31 15:41:22 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Added 'default organization' for login to single organization projects
Modified Paths:
--------------
trunk/new_project/application/configs/project.ini
Modified: trunk/new_project/application/configs/project.ini
===================================================================
--- trunk/new_project/application/configs/project.ini 2012-01-31 15:35:59 UTC (rev 441)
+++ trunk/new_project/application/configs/project.ini 2012-01-31 15:41:22 UTC (rev 442)
@@ -202,6 +202,15 @@
locales.en = "en"
locales.nl = "nl"
+;-------------------------------------------------------
+; ORGANIZATION SECTION
+;
+; Specify a default organization for a project. Allows
+; all user to login when this organization is choosen.
+;-------------------------------------------------------
+
+; organization.default = 70
+
;----------------------------------------------------------------------
; PASSWORDS SECTION
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 15:36:10
|
Revision: 441
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=441&view=rev
Author: matijsdejong
Date: 2012-01-31 15:35:59 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Added 'default organization' for login to single organization projects
ModelSnippetActionAbstract.php pages now also show menu position in the document title
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php
branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php
branches/1.5.x/library/classes/Gems/Menu.php
branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
branches/1.5.x/library/classes/Gems/User/UserLoader.php
branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php
Modified: branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -147,13 +147,30 @@
}
}
+ /**
+ * Return the current request ID, if any.
+ *
+ * Overrule this function if the last item in the page title
+ * should be something other than te value of
+ * MUtil_Model::REQUEST_ID.
+ *
+ * @return mixed
+ */
public function getInstanceId()
{
- if ($id = $this->request->getParam(MUtil_Model::REQUEST_ID)) {
+ if ($id = $this->_getParam(MUtil_Model::REQUEST_ID)) {
return $id;
}
}
+ /**
+ * Returns the current html/head/title for this page.
+ *
+ * If the title is an array the seperator concatenates the parts.
+ *
+ * @param string $separator
+ * @return string
+ */
public function getTitle($separator = null)
{
if ($title_set = parent::getTitle($separator)) {
Modified: branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -208,6 +208,47 @@
}
/**
+ * Return the current request ID, if any.
+ *
+ * Overrule this function if the last item in the page title
+ * should be something other than te value of
+ * MUtil_Model::REQUEST_ID.
+ *
+ * @return mixed
+ */
+ public function getInstanceId()
+ {
+ if ($id = $this->_getParam(MUtil_Model::REQUEST_ID)) {
+ return $id;
+ }
+ }
+
+ /**
+ * Returns the current html/head/title for this page.
+ *
+ * If the title is an array the seperator concatenates the parts.
+ *
+ * @param string $separator
+ * @return string
+ */
+ public function getTitle($separator = null)
+ {
+ if ($title_set = parent::getTitle($separator)) {
+ return $title_set;
+ }
+
+ $title = array();
+ foreach($this->menu->getActivePath($this->getRequest()) as $menuItem) {
+ $title[] = $menuItem->get('label');
+ }
+ if ($id = $this->getInstanceId()) {
+ $title[] = $id;
+ }
+
+ return implode($separator, $title);
+ }
+
+ /**
* Intializes the html component.
*
* @param boolean $reset Throws away any existing html output when true
Modified: branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -166,7 +166,8 @@
if($model->has('gor_user_class')) {
$definitions = $this->loader->getUserLoader()->getAvailableStaffDefinitions();
//Use first element as default
- $default = array_shift(array_keys($definitions));
+ $tmp = array_keys($definitions);
+ $default = array_shift($tmp);
$model->set('gor_user_class', 'default', $default);
if (count($definitions)>1) {
if ($action !== 'create') {
Modified: branches/1.5.x/library/classes/Gems/Menu.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Menu.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/Menu.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -282,7 +282,7 @@
$trType = 'T';
$subPage = $page->addPage($this->_('Track'), 'pr.track', 'track', 'show-track')
->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr')
- ->addHiddenParameter(Gems_Model::TRACK_ID, $this->escort->getTrackId(), 'gtr_track_type', 'T');
+ ->addHiddenParameter(Gems_Model::TRACK_ID, $this->escort->getTrackId(), 'gtr_track_type', $trType);
$tkPages[$trType] = $subPage->addAction($this->_('Token'), 'pr.token', 'show')
->addNamedParameters(MUtil_Model::REQUEST_ID, 'gto_id_token')
Modified: branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -225,6 +225,24 @@
}
/**
+ * Returns an (optional) default organization from the project settings
+ *
+ * @return int Organization number or -1 when not set
+ */
+ public function getDefaultOrganization()
+ {
+ if ($this->offsetExists('organization')) {
+ $orgs = $this->offsetGet('organization');
+
+ if (isset($orgs['default'])) {
+ return $orgs['default'];
+ }
+ }
+
+ return -1;
+ }
+
+ /**
* Returns the public name of this project.
* @return string
*/
Modified: branches/1.5.x/library/classes/Gems/User/UserLoader.php
===================================================================
--- branches/1.5.x/library/classes/Gems/User/UserLoader.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/classes/Gems/User/UserLoader.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -321,6 +321,23 @@
$row = $this->db->fetchRow($sql, $params, Zend_Db::FETCH_NUM);
}
+ if ((! $row) && ($organization == $this->project->getDefaultOrganization())) {
+ // Check for the current organization being the default one
+ //
+ // For optimization do set the allowed organizations
+ // Try to get see if this is another allowed organization for this user
+ $sql = "SELECT CONCAT(gul_user_class, 'Definition'), gul_id_organization
+ FROM gems__user_logins INNER JOIN gems__organizations ON gor_id_organization != gul_id_organization
+ WHERE gor_active = 1 AND
+ gul_can_login = 1 AND
+ gul_login = ?
+ LIMIT 1";
+
+ // MUtil_Echo::track($sql, $login_name);
+
+ $row = $this->db->fetchRow($sql, $login_name, Zend_Db::FETCH_NUM);
+ }
+
if ($row) {
// MUtil_Echo::track($row);
return $row;
@@ -338,7 +355,20 @@
gems__organizations ON gsf_id_organization = gor_id_organization
WHERE gor_active = 1 AND gsf_active = 1 AND gsf_login = ? AND gsf_id_organization = ?";
- if ($user_id = $this->db->fetchOne($sql, array($login_name, $organization))) {
+ $user_id = $this->db->fetchOne($sql, $params);
+
+ if ((! $user_id) && ($organization == $this->project->getDefaultOrganization())) {
+ $sql = "SELECT gsf_id_user
+ FROM gems__staff INNER JOIN
+ gems__organizations ON gsf_id_organization = gor_id_organization
+ WHERE gor_active = 1 AND gsf_active = 1 AND gsf_login = ?";
+
+ // MUtil_Echo::track($sql, $login_name);
+
+ $user_id = $this->db->fetchOne($sql, $login_name);
+ }
+
+ if ($user_id) {
// Move user to new staff.
$values['gul_login'] = $login_name;
$values['gul_id_organization'] = $organization;
Modified: branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php 2012-01-31 12:30:08 UTC (rev 440)
+++ branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php 2012-01-31 15:35:59 UTC (rev 441)
@@ -72,7 +72,7 @@
$bridge->addItem('gto_id_token', null, array('colspan' => 1.5));
$buttons = $links->getActionLinks(true, 'ask', 'take', 'pdf', 'show', $controller, 'questions', $controller, 'answer');
- if ($buttons) {
+ if (count($buttons)) {
$bridge->tr();
$bridge->tdh($this->_('Actions'));
$bridge->td($buttons, array('colspan' => 2, 'skiprowclass' => true));
@@ -144,8 +144,11 @@
->addByController('respondent', 'show', $this->_('Show respondent'))
->addByController('track', 'index', $this->_('Show tracks'))
->addCurrentSiblings()
+ ->addCurrentChildren()
->showDisabled();
+ MUtil_Echo::track($links->count());
+
return $links;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 12:30:18
|
Revision: 440
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=440&view=rev
Author: mennodekker
Date: 2012-01-31 12:30:08 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
another doc fix
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2012-01-31 11:46:11 UTC (rev 439)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2012-01-31 12:30:08 UTC (rev 440)
@@ -88,7 +88,7 @@
* Overrule this function to add different columns to the browse table, without
* having to recode the core table building code.
*
- * @param MUtil_Model_TableBridge $bridge
+ * @param MUtil_Model_VerticalTableBridge $bridge
* @param MUtil_Model_ModelAbstract $model
* @return void
*/
@@ -167,7 +167,7 @@
* Overrule this function to set the header differently, without
* having to recode the core table building code.
*
- * @param MUtil_Model_TableBridge $bridge
+ * @param MUtil_Model_VerticalTableBridge $bridge
* @param MUtil_Model_ModelAbstract $model
* @return void
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 11:46:23
|
Revision: 439
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=439&view=rev
Author: mennodekker
Date: 2012-01-31 11:46:11 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Various doc fixes
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php
branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php
branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php
branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php
branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php
branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php
branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php
branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php
branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php
branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php
branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php
branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -27,7 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
@@ -44,7 +44,7 @@
* their naming conventions, but exists only to make it simple to extend this class
* for a specific implementation.
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -27,7 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
@@ -45,7 +45,7 @@
* their naming conventions, but exists only to make it simple to extend this class
* for a specific implementation.
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -27,7 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
@@ -46,7 +46,7 @@
* their naming conventions, but exists only to make it simple to extend this class
* for a specific implementation.
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -27,7 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
@@ -45,7 +45,7 @@
* their naming conventions, but exists only to make it simple to extend this class
* for a specific implementation.
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -27,7 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
@@ -40,7 +40,7 @@
*
* Usage snippet for Gems_Snippets_ModelTableSnippetGeneric
*
- * @package MUtil
+ * @package Gems
* @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
Modified: branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Mail\Log
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -40,7 +40,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Mail\Log
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.4
Modified: branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -39,7 +39,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.5
Modified: branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -39,7 +39,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.5
Modified: branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -39,7 +39,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Organization
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.5
Modified: branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php
===================================================================
--- branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Respondent
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -39,7 +39,7 @@
* Displays tabs for multiple organizations.
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Respondent
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.5
Modified: branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php
===================================================================
--- branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php 2012-01-31 11:38:20 UTC (rev 438)
+++ branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php 2012-01-31 11:46:11 UTC (rev 439)
@@ -29,7 +29,7 @@
* Short description of file
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Track
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -42,7 +42,7 @@
* Long description for class (if any)...
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Track
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 11:38:32
|
Revision: 438
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=438&view=rev
Author: mennodekker
Date: 2012-01-31 11:38:20 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Various doc fixes
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php
branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php
branches/1.5.x/library/classes/Gems/Form/TableForm.php
branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
branches/1.5.x/library/classes/Gems/TabForm.php
branches/1.5.x/library/snippets/Generic/AutosearchForm.php
branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php
branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php
branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php
branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php
branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php
branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php
Modified: branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -43,8 +43,25 @@
*/
class Gems_Auth_Adapter_Callback implements Zend_Auth_Adapter_Interface
{
+ /**
+ * The callback to use
+ *
+ * @var callback
+ */
private $_callback;
+
+ /**
+ * The identity to check
+ *
+ * @var string
+ */
private $_identity;
+
+ /**
+ * The optional parameters to pass to the callback
+ *
+ * @var array
+ */
private $_params;
/**
@@ -54,9 +71,9 @@
* return true or false and in that case this adapter will wrap the result
* in a Zend_Auth_Result
*
- * @param type $callback A valid callback
- * @param type $identity The identity to use
- * @param type $params Array of parameters needed for the callback
+ * @param callback $callback A valid callback
+ * @param string $identity The identity to use
+ * @param array $params Array of parameters needed for the callback
*/
public function __construct($callback, $identity, $params)
{
Modified: branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -41,9 +41,11 @@
interface Gems_Communication_RespondentWriter
{
/**
- * Writes the respondent
+ * Writes the respondent, creating a new one or updating the existing record
+ *
* @param Gems_Communication_RespondentContainer $respondent
- * @return int The internal id of the created/updated respondent
+ * @param int $userId
+ * @return boolean True if a new respondent was added, false if one was updated
* @throws Gems_Communication_Exception
*/
public function writeRespondent(Gems_Communication_RespondentContainer $respondent, &$userId);
Modified: branches/1.5.x/library/classes/Gems/Form/TableForm.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Form/TableForm.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/classes/Gems/Form/TableForm.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -28,7 +28,7 @@
* Short description of file
*
* @package Gems
- * @subpackage
+ * @subpackage Form
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @version $Id$
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -167,8 +167,9 @@
}
/**
+ * Retrieve the header title to display
*
- * @return string The header title to display
+ * @return string
*/
protected function getTitle()
{
Modified: branches/1.5.x/library/classes/Gems/TabForm.php
===================================================================
--- branches/1.5.x/library/classes/Gems/TabForm.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/classes/Gems/TabForm.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -33,6 +33,8 @@
*/
/**
+ * Creates a form using tab-layout where each tab is a subform
+ *
* @package Gems
* @subpackage Form
* @copyright Copyright (c) 2011 Erasmus MC
@@ -41,6 +43,8 @@
class Gems_TabForm extends Gems_Form
{
/**
+ * Holds the last tab we added information to
+ *
* @var Gems_Form_TabSubForm
*/
private $currentTab = null;
@@ -168,7 +172,7 @@
/**
* Retrieve a named tab (subform) and set the active tab to this one
*
- * @param type $name
+ * @param string $name
* @return Gems_Form_TabSubForm
*/
public function getTab($name)
@@ -316,6 +320,11 @@
$jquery->addOnLoad($js);
}
+ /**
+ * Load the default decorators
+ *
+ * @return void
+ */
public function loadDefaultDecorators() {
if ($this->loadDefaultDecoratorsIsDisabled()) {
return;
@@ -335,6 +344,8 @@
}
/**
+ * Reset the currentTab to be the main form again
+ *
* 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.
*/
@@ -342,6 +353,11 @@
$this->currentTab = null;
}
+ /**
+ * Select a tab by it's numerical index
+ *
+ * @param int $tabIdx
+ */
public function selectTab($tabIdx) {
$this->getElement('tab')->setValue($tabIdx);
$this->setAttrib('selected', $tabIdx);
Modified: branches/1.5.x/library/snippets/Generic/AutosearchForm.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -29,7 +29,7 @@
* Short description of file
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -42,7 +42,7 @@
* Long description for class (if any)...
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.2
Modified: branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -29,7 +29,7 @@
* Short description of file
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -42,7 +42,7 @@
* Long description for class (if any)...
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.2
Modified: branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -28,7 +28,7 @@
*
*
* @package MUtil
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -41,7 +41,7 @@
* Usage snippet for Gems_Snippets_ModelTableSnippetGeneric
*
* @package MUtil
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4
Modified: branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -28,7 +28,7 @@
*
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -40,7 +40,7 @@
* the model set through the $model snippet parameter.
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.4
Modified: branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -40,7 +40,7 @@
* the model set through the $model snippet parameter.
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.4
Modified: branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -26,7 +26,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -39,7 +39,7 @@
* Usage snippet for Gems_Snippets_ModelTabFormSnippetGeneric
*
* @package Gems
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.5
Modified: branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php 2012-01-31 10:53:47 UTC (rev 437)
+++ branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438)
@@ -28,7 +28,7 @@
*
*
* @package MUtil
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -42,7 +42,7 @@
* Usage snippet for Gems_Snippets_ModelTableSnippetGeneric
*
* @package MUtil
- * @subpackage Snippets
+ * @subpackage Snippets\Generic
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 10:53:57
|
Revision: 437
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=437&view=rev
Author: mennodekker
Date: 2012-01-31 10:53:47 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
ported last browseedit fix to tabformsnippet, although it didn't seem necessary there?!
fixed typo
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php
branches/1.5.x/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php
Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2012-01-31 09:59:43 UTC (rev 436)
+++ branches/1.5.x/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2012-01-31 10:53:47 UTC (rev 437)
@@ -56,6 +56,19 @@
protected $_form;
/**
+ * 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.
Modified: branches/1.5.x/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-31 09:59:43 UTC (rev 436)
+++ branches/1.5.x/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-31 10:53:47 UTC (rev 437)
@@ -175,7 +175,7 @@
{
$args = func_get_args();
if (count($args)<2) {
- throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more idividual items');
+ throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more individual items');
}
$bridge = array_shift($args);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 09:59:54
|
Revision: 436
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=436&view=rev
Author: mennodekker
Date: 2012-01-31 09:59:43 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Doc fix
Modified Paths:
--------------
branches/1.5.x/library/snippets/Generic/AutosearchForm.php
Modified: branches/1.5.x/library/snippets/Generic/AutosearchForm.php
===================================================================
--- branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 08:51:12 UTC (rev 435)
+++ branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 09:59:43 UTC (rev 436)
@@ -29,7 +29,7 @@
* Short description of file
*
* @package Gems
- * @subpackage
+ * @subpackage Snippets
* @author Matijs de Jong <mj...@ma...>
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
@@ -42,7 +42,7 @@
* Long description for class (if any)...
*
* @package Gems
- * @subpackage
+ * @subpackage Snippets
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
* @since Class available since version 1.4.2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 08:51:21
|
Revision: 435
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=435&view=rev
Author: mennodekker
Date: 2012-01-31 08:51:12 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Fxing 'save' button in last tab error
Modified Paths:
--------------
branches/1.5.x/new_project/htdocs/gems/css/gems-new.css
branches/1.5.x/new_project/htdocs/gems/css/gems.css
Modified: branches/1.5.x/new_project/htdocs/gems/css/gems-new.css
===================================================================
--- branches/1.5.x/new_project/htdocs/gems/css/gems-new.css 2012-01-31 08:50:45 UTC (rev 434)
+++ branches/1.5.x/new_project/htdocs/gems/css/gems-new.css 2012-01-31 08:51:12 UTC (rev 435)
@@ -490,6 +490,10 @@
vertical-align: top;
}
+table.formTable td[colspan="2"].label {
+ text-align: left;
+}
+
table tr[onclick]:hover,
table td[onclick]:hover,
table th[onclick]:hover {
@@ -674,4 +678,4 @@
span.thetooltip {
display: none;
-}
+}
\ No newline at end of file
Modified: branches/1.5.x/new_project/htdocs/gems/css/gems.css
===================================================================
--- branches/1.5.x/new_project/htdocs/gems/css/gems.css 2012-01-31 08:50:45 UTC (rev 434)
+++ branches/1.5.x/new_project/htdocs/gems/css/gems.css 2012-01-31 08:51:12 UTC (rev 435)
@@ -452,6 +452,10 @@
vertical-align: top;
}
+table.formTable td[colspan="2"].label {
+ text-align: left;
+}
+
table .question {
text-indent: -1em;
padding-left: 1em;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-31 08:50:54
|
Revision: 434
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=434&view=rev
Author: mennodekker
Date: 2012-01-31 08:50:45 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Fxing 'save' button in last tab error
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php
branches/1.5.x/library/layouts/scripts/gemsnew.phtml
Modified: branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-01-30 15:39:44 UTC (rev 433)
+++ branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-01-31 08:50:45 UTC (rev 434)
@@ -292,7 +292,7 @@
*/
public function beforeFormDisplay ($form, $isNew)
{
- if ($this->useTabbedForms) {
+ if ($this->useTabbedForms || $form instanceof Gems_Form_TableForm) {
/* Not needed anymore @@TODO: Remove when proven, as there is a set tab
//Create the tabs tried in $form->render() but somehow that is never reached
if ($form instanceof Gems_TabForm) {
@@ -304,10 +304,13 @@
$element = new MUtil_Form_Element_Html('formLinks');
$element->setValue($links);
$element->setOrder(999);
- $form->resetContext();
+ if ($form instanceof Gems_TabForm) {
+ $form->resetContext();
+ }
$form->addElement($element);
+ $form->addDisplayGroup(array('formLinks'), 'form_buttons');
}
- } else {
+ } else {
$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.
@@ -359,6 +362,7 @@
$form = new Gems_TabForm($options);
} else {
$form = parent::createForm($options);
+ //$form = new Gems_Form_TableForm($options);
}
return $form;
@@ -713,6 +717,9 @@
$data = $newData + $data;
}
+ if ($form instanceof Gems_TabForm) {
+ $form->resetContext();
+ }
return $form;
}
Modified: branches/1.5.x/library/layouts/scripts/gemsnew.phtml
===================================================================
--- branches/1.5.x/library/layouts/scripts/gemsnew.phtml 2012-01-30 15:39:44 UTC (rev 433)
+++ branches/1.5.x/library/layouts/scripts/gemsnew.phtml 2012-01-31 08:50:45 UTC (rev 434)
@@ -9,6 +9,12 @@
// Check if jQuery library is needed
if ($this->jQuery) {
echo $this->jQuery();
+ //Error message for when jQuery can not be loaded
+ /*echo "<script>
+ if (typeof jQuery == 'undefined') {
+ document.writeln('<div class=\"errors\">The site requires external JavaScript from another domain, which is blocked or failed to load.</div>');
+ }
+ </script>";*/
}
// Check if dojo library is needed
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-30 15:39:51
|
Revision: 433
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=433&view=rev
Author: mennodekker
Date: 2012-01-30 15:39:44 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Fix for 'empty' track (no tokens present)
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php
Modified: branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-01-30 15:04:13 UTC (rev 432)
+++ branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-01-30 15:39:44 UTC (rev 433)
@@ -311,7 +311,12 @@
*/
public function checkTokensFromStart(Gems_Tracker_RespondentTrack $respTrack, $userId)
{
- return $this->checkTokensFrom($respTrack, $respTrack->getFirstToken(), $userId);
+ $token = $respTrack->getFirstToken();
+ if ($token instanceof Gems_Tracker_Token) {
+ return $this->checkTokensFrom($respTrack, $respTrack->getFirstToken(), $userId);
+ } else {
+ return 0;
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-30 15:04:24
|
Revision: 432
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=432&view=rev
Author: mennodekker
Date: 2012-01-30 15:04:13 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Final fix to formbridge + removed obsolete statement from staffaction
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/Default/StaffAction.php
branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
Modified: branches/1.5.x/library/classes/Gems/Default/StaffAction.php
===================================================================
--- branches/1.5.x/library/classes/Gems/Default/StaffAction.php 2012-01-30 13:36:35 UTC (rev 431)
+++ branches/1.5.x/library/classes/Gems/Default/StaffAction.php 2012-01-30 15:04:13 UTC (rev 432)
@@ -188,9 +188,6 @@
$this->_instanceId = $data['gsf_login'];
}
- $sql = "SELECT ggp_id_group,ggp_role FROM gems__groups WHERE ggp_id_group = " . (int) $data['gsf_id_primary_group'];
- $groups = $this->db->fetchPairs($sql);
-
if (!isset($data['gsf_id_organization']) || empty($data['gsf_id_organization'])) {
$data['gsf_id_organization'] = $this->menu->getParameterSource()->getMenuParameter('gsf_id_organization', $this->loader->getCurrentUser()->getCurrentOrganizationId());
}
Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php
===================================================================
--- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-01-30 13:36:35 UTC (rev 431)
+++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-01-30 15:04:13 UTC (rev 432)
@@ -243,7 +243,11 @@
$options = func_get_args();
$options = MUtil_Ra::pairs($options, 1);
- $options = $this->_mergeOptions($name, $options, self::AUTO_OPTIONS);
+ /**
+ * As this method redirects to the correct 'add' method, we preserve the original options
+ * while trying to find the needed ones in the model
+ */
+ $options = $options + $this->_mergeOptions($name, $options, self::AUTO_OPTIONS);
if (isset($options['elementClass'])) {
$method = 'add' . $options['elementClass'];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-01-30 13:36:46
|
Revision: 431
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=431&view=rev
Author: michieltcs
Date: 2012-01-30 13:36:35 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Merge r351 from branch 1.5.0-pulse
Revision Links:
--------------
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=351&view=rev
Modified Paths:
--------------
branches/1.5.x/library/classes/Gems/User/OldStaffUserDefinition.php
Property Changed:
----------------
branches/1.5.x/
Property changes on: branches/1.5.x
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-342,344,346
/tags/1.5.0beta1:305
+ /branches/1.5.0-pulse:306-430
/tags/1.5.0beta1:305
Modified: branches/1.5.x/library/classes/Gems/User/OldStaffUserDefinition.php
===================================================================
--- branches/1.5.x/library/classes/Gems/User/OldStaffUserDefinition.php 2012-01-30 10:04:25 UTC (rev 430)
+++ branches/1.5.x/library/classes/Gems/User/OldStaffUserDefinition.php 2012-01-30 13:36:35 UTC (rev 431)
@@ -111,6 +111,7 @@
$this->db->update('gems__staff', $values, $this->db->quoteInto('gsf_id_user = ?', $staff_id));
} catch (Zend_Db_Exception $e) {
+ GemsEscort::getInstance()->logger->log($e->getMessage(), Zend_Log::ERR);
// Fall through as this does not work if the database upgrade did not run
// MUtil_Echo::r($e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|