comanage-dev - [comanage-dev] r615 - in registry/trunk/app: Config/Schema Controller Model View/CoLocalizations
Subject: COmanage Developers List
List archive
[comanage-dev] r615 - in registry/trunk/app: Config/Schema Controller Model View/CoLocalizations
Chronological Thread
- From:
- To:
- Subject: [comanage-dev] r615 - in registry/trunk/app: Config/Schema Controller Model View/CoLocalizations
- Date: Mon, 7 Oct 2013 16:05:43 -0400
Author: benno
Date: 2013-10-07 16:05:43 -0400 (Mon, 07 Oct 2013)
New Revision: 615
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoLocalizationsController.php
registry/trunk/app/Model/CoLocalization.php
registry/trunk/app/View/CoLocalizations/fields.inc
registry/trunk/app/View/CoLocalizations/index.ctp
Log:
Update for CO-707 since mysql does not want a column called key
Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2013-10-07 19:07:22 UTC (rev
614)
+++ registry/trunk/app/Config/Schema/schema.xml 2013-10-07 20:05:43 UTC (rev
615)
@@ -991,7 +991,8 @@
<field name="co_id" type="I">
<constraint>REFERENCES cm_cos(id)</constraint>
</field>
- <field name="key" type="C" size="40" />
+ <!-- mysql doesn't want a column called "key" -->
+ <field name="lkey" type="C" size="40" />
<field name="language" type="C" size="16" />
<field name="text" type="C" size="256" />
@@ -1004,7 +1005,7 @@
</index>
<index name="co_localizations_i3">
<col>co_id</col>
- <col>key</col>
+ <col>lkey</col>
<col>language</col>
<unique />
</index>
Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2013-10-07 19:07:22
UTC (rev 614)
+++ registry/trunk/app/Controller/AppController.php 2013-10-07 20:05:43
UTC (rev 615)
@@ -206,7 +206,7 @@
$args = array();
$args['conditions']['CoLocalization.co_id'] = $coid;
$args['conditions']['CoLocalization.language'] = $cm_lang;
- $args['fields'] = array('CoLocalization.key',
'CoLocalization.text');
+ $args['fields'] = array('CoLocalization.lkey',
'CoLocalization.text');
$args['contain'] = false;
$ls = $this->CoLocalization->find('list', $args);
Modified: registry/trunk/app/Controller/CoLocalizationsController.php
===================================================================
--- registry/trunk/app/Controller/CoLocalizationsController.php 2013-10-07
19:07:22 UTC (rev 614)
+++ registry/trunk/app/Controller/CoLocalizationsController.php 2013-10-07
20:05:43 UTC (rev 615)
@@ -32,7 +32,7 @@
public $paginate = array(
'limit' => 25,
'order' => array(
- 'CoLocalizations.key' => 'asc'
+ 'CoLocalizations.lkey' => 'asc'
)
);
@@ -89,7 +89,7 @@
$args = array();
$args['conditions']['CoLocalization.co_id'] =
$reqdata['CoLocalization']['co_id'];
- $args['conditions']['CoLocalization.key'] =
$reqdata['CoLocalization']['key'];
+ $args['conditions']['CoLocalization.lkey'] =
$reqdata['CoLocalization']['lkey'];
$args['conditions']['CoLocalization.language'] =
$reqdata['CoLocalization']['language'];
$args['contain'] = false;
@@ -99,7 +99,7 @@
//$this->restResultHeader(403, "Identifier In Use");
} else {
$this->Session->setFlash(_txt('er.loc.exists',
-
array(Sanitize::html($reqdata['CoLocalization']['key']),
+
array(Sanitize::html($reqdata['CoLocalization']['lkey']),
Sanitize::html($reqdata['CoLocalization']['language']))),
'', array(), 'error');
}
Modified: registry/trunk/app/Model/CoLocalization.php
===================================================================
--- registry/trunk/app/Model/CoLocalization.php 2013-10-07 19:07:22 UTC (rev
614)
+++ registry/trunk/app/Model/CoLocalization.php 2013-10-07 20:05:43 UTC (rev
615)
@@ -33,7 +33,7 @@
public $belongsTo = array("Co");
// Default display field for cake generated views
- public $displayField = "key";
+ public $displayField = "lkey";
public $actsAs = array('Containable');
@@ -45,7 +45,7 @@
'allowEmpty' => false,
'message' => 'A CO ID must be provided'
),
- 'key' => array(
+ 'lkey' => array(
'rule' => '/.*/',
'required' => true,
'allowEmpty' => false
Modified: registry/trunk/app/View/CoLocalizations/fields.inc
===================================================================
--- registry/trunk/app/View/CoLocalizations/fields.inc 2013-10-07 19:07:22
UTC (rev 614)
+++ registry/trunk/app/View/CoLocalizations/fields.inc 2013-10-07 20:05:43
UTC (rev 615)
@@ -48,7 +48,7 @@
}
?>
-
$("#original").text(cm_texts[document.getElementById('CoLocalizationKey').value]);
+
$("#original").text(cm_texts[document.getElementById('CoLocalizationLkey').value]);
}
function js_local_onload() {
@@ -64,8 +64,8 @@
<td>
<?php
global $cm_lang, $cm_texts;
- $attrs['value'] =
(isset($co_localizations[0]['CoLocalization']['key'])
- ? $co_localizations[0]['CoLocalization']['key']
+ $attrs['value'] =
(isset($co_localizations[0]['CoLocalization']['lkey'])
+ ? $co_localizations[0]['CoLocalization']['lkey']
: "");
$attrs['empty'] = false;
$attrs['onChange'] = 'populate_default_text()';
@@ -74,15 +74,15 @@
// Make sure both the value and the displayed text are the key
$keys = array_keys($vv_cm_texts);
- print $this->Form->select('key',
+ print $this->Form->select('lkey',
array_combine($keys, $keys),
$attrs);
- if($this->Form->isFieldError('key')) {
- print $this->Form->error('key');
+ if($this->Form->isFieldError('lkey')) {
+ print $this->Form->error('lkey');
}
} else {
- print $co_localizations[0]['CoLocalization']['key'];
+ print $co_localizations[0]['CoLocalization']['lkey'];
}
?>
</td>
Modified: registry/trunk/app/View/CoLocalizations/index.ctp
===================================================================
--- registry/trunk/app/View/CoLocalizations/index.ctp 2013-10-07 19:07:22
UTC (rev 614)
+++ registry/trunk/app/View/CoLocalizations/index.ctp 2013-10-07 20:05:43
UTC (rev 615)
@@ -46,7 +46,7 @@
<table id="co_localizations" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php print $this->Paginator->sort('key', _txt('fd.key')); ?></th>
+ <th><?php print $this->Paginator->sort('lkey', _txt('fd.key')); ?></th>
<th><?php print $this->Paginator->sort('language',
_txt('fd.language')); ?></th>
<th><?php print $this->Paginator->sort('text', _txt('fd.text'));
?></th>
<th><?php print _txt('fd.actions'); ?></th>
@@ -59,7 +59,7 @@
<tr class="line<?php print ($i % 2)+1; ?>">
<td>
<?php
- print $this->Html->link($c['CoLocalization']['key'],
+ print $this->Html->link($c['CoLocalization']['lkey'],
array('controller' => 'co_localizations',
'action' => ($permissions['edit'] ?
'edit' : ($permissions['view'] ? 'view' : '')),
$c['CoLocalization']['id'],
@@ -79,7 +79,7 @@
array('class' => 'editbutton')) . "\n";
if($permissions['delete'])
- print '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($c['CoLocalization']['key'])) . '\', \'' .
$this->Html->url(array('controller' => 'co_localizations', 'action' =>
'delete', $c['CoLocalization']['id'], 'co' => $cur_co['Co']['id'])) .
'\')";>' . _txt('op.delete') . '</button>';
+ print '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($c['CoLocalization']['lkey'])) . '\', \'' .
$this->Html->url(array('controller' => 'co_localizations', 'action' =>
'delete', $c['CoLocalization']['id'], 'co' => $cur_co['Co']['id'])) .
'\')";>' . _txt('op.delete') . '</button>';
?>
<?php ; ?>
</td>
- [comanage-dev] r615 - in registry/trunk/app: Config/Schema Controller Model View/CoLocalizations, svnlog, 10/07/2013
Archive powered by MHonArc 2.6.16.