Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r313 - in registry/trunk/app: Controller Model

Subject: COmanage Developers List

List archive

[comanage-dev] r313 - in registry/trunk/app: Controller Model


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r313 - in registry/trunk/app: Controller Model
  • Date: Sat, 14 Jul 2012 23:16:19 -0400

Author: benno
Date: 2012-07-14 23:16:19 -0400 (Sat, 14 Jul 2012)
New Revision: 313

Modified:
registry/trunk/app/Controller/CoExtendedTypesController.php
registry/trunk/app/Model/AppModel.php
Log:
Additional fixes for CO-362

Modified: registry/trunk/app/Controller/CoExtendedTypesController.php
===================================================================
--- registry/trunk/app/Controller/CoExtendedTypesController.php 2012-07-15
02:57:29 UTC (rev 312)
+++ registry/trunk/app/Controller/CoExtendedTypesController.php 2012-07-15
03:16:19 UTC (rev 313)
@@ -256,11 +256,19 @@
*/

function paginationConditions() {
- // Only retrieve types for the current attribute
+ // Only retrieve types for the current attribute and for the current CO

- return(array(
- 'CoExtendedType.attribute' => $this->request->params['named']['attr']
- ));
+ $ret = array();
+
+ if(isset($this->cur_co)) {
+ $ret['CoExtendedType.co_id'] = $this->cur_co['Co']['id'];
+ }
+
+ if(isset($this->request->params['named']['attr'])) {
+ $ret['CoExtendedType.attribute'] =
$this->request->params['named']['attr'];
+ }
+
+ return $ret;
}

/**

Modified: registry/trunk/app/Model/AppModel.php
===================================================================
--- registry/trunk/app/Model/AppModel.php 2012-07-15 02:57:29 UTC (rev
312)
+++ registry/trunk/app/Model/AppModel.php 2012-07-15 03:16:19 UTC (rev
313)
@@ -48,12 +48,13 @@
if(isset($this->validate['type']['rule'])
&& is_array($this->validate['type']['rule'])
&& $this->validate['type']['rule'][0] == 'validateExtendedType'
- && is_array($this->validate['type']['rule'][1])) {
+ && is_array($this->validate['type']['rule'][1])
+ && isset($this->validate['type']['rule'][1]['default'])) {
// Figure out which language key to use. Note 'en' is the prefix for
'enum'
// and NOT an abbreviation for 'english'.
$langKey = 'en.' . Inflector::underscore($this->name);

- foreach($this->validate['type']['rule'][1] as $name) {
+ foreach($this->validate['type']['rule'][1]['default'] as $name) {
$ret[$name] = _txt($langKey, null, $name);
}
}
@@ -209,7 +210,7 @@

$CoExtendedType = ClassRegistry::init('CoExtendedType');

- $extTypes = $CoExtendedType->active($this->coId, $this->name, 'all');
+ $extTypes = $CoExtendedType->active($coId, $this->name, 'all');

if(!empty($extTypes)) {
foreach($extTypes as $t) {
@@ -229,7 +230,7 @@
*
* @since COmanage Registry v0.6
* @param array Array of fields to validate
- * @param array Array of default values, if no extended types are defined
+ * @param array Array with two keys: 'attribute' holding the attribute
model name, and 'default' holding an Array of default values (for use if no
extended types are defined)
* @return boolean True if all field strings parses to a valid timestamp,
false otherwise
*/

@@ -248,7 +249,7 @@
if(isset($this->coId)) {
$CoExtendedType = ClassRegistry::init('CoExtendedType');

- $extTypes = $CoExtendedType->active($this->coId, $this->name);
+ $extTypes = $CoExtendedType->active($this->coId, $d['attribute']);
}
// else some models can be used with Org Identities (ie: MVPA
controllers). When used
// with org identities, we currently don't support extended types.
@@ -256,7 +257,7 @@
if(empty($extTypes)) {
// Use the default values

- $extTypes = $d;
+ $extTypes = $d['default'];
}

foreach(array_keys($a) as $f) {



  • [comanage-dev] r313 - in registry/trunk/app: Controller Model, svnlog, 07/14/2012

Archive powered by MHonArc 2.6.16.

Top of Page