diff --git a/web/yaamp/models/db_marketsModel.php b/web/yaamp/models/db_marketsModel.php index 5d65cc0..694b2b4 100644 --- a/web/yaamp/models/db_marketsModel.php +++ b/web/yaamp/models/db_marketsModel.php @@ -33,6 +33,11 @@ class db_markets extends CActiveRecord public function save($runValidation=true,$attributes=null) { if (empty($this->base_coin)) $this->base_coin = null; + else if ($this->base_coin == 'BTC') $this->base_coin = null; + else if (strpos($this->name, $this->base_coin) === false) { + $parts = explode(' ', $this->name); + $this->name = trim($parts[0].' '.$this->base_coin); + } if (empty($this->message)) $this->message = null; return parent::save($runValidation, $attributes); diff --git a/web/yaamp/modules/market/update.php b/web/yaamp/modules/market/update.php index 84b92f7..132af8f 100644 --- a/web/yaamp/modules/market/update.php +++ b/web/yaamp/modules/market/update.php @@ -15,6 +15,12 @@ echo CUFHtml::activeTextField($market, 'deposit_address', array('maxlength'=>200 echo "

.

"; echo CUFHtml::closeCtrlHolder(); +echo CUFHtml::openActiveCtrlHolder($market, 'base_coin'); +echo CUFHtml::activeLabelEx($market, 'base_coin'); +echo CUFHtml::activeTextField($market, 'base_coin', array('maxlength'=>16,'style'=>'width: 40px;')); +echo "

Default (empty) is BTC

"; +echo CUFHtml::closeCtrlHolder(); + echo CUFHtml::closeTag('fieldset'); showSubmitButton('Save'); echo CUFHtml::endForm();