CC-2704: Support Setting UI tweak

Merge branch '1.9.1' into devel

Conflicts:
	airtime_mvc/application/forms/GeneralPreferences.php
This commit is contained in:
James 2011-08-19 12:22:08 -04:00
commit 8e0496d8c1
6 changed files with 36 additions and 37 deletions

View file

@ -30,7 +30,6 @@ class PreferenceController extends Zend_Controller_Action
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
@ -65,6 +64,7 @@ class PreferenceController extends Zend_Controller_Action
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
Application_Model_Preference::SetPhone($values["Phone"]);
Application_Model_Preference::SetEmail($values["Email"]);
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);

View file

@ -9,17 +9,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
));
//Station name
$this->addElement('text', 'stationName', array(
'class' => 'input_text',
'label' => 'Station Name',
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetValue("station_name"),
'decorators' => array(
'ViewHelper'
)
));
$defaultFade = Application_Model_Preference::GetDefaultFade();
if($defaultFade == ""){
$defaultFade = '00:00:00.000000';

View file

@ -12,6 +12,18 @@ class Application_Form_SupportSettings extends Zend_Form
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
);
//Station name
$this->addElement('text', 'stationName', array(
'class' => 'input_text',
'label' => 'Station Name',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetValue("station_name"),
'decorators' => array(
'ViewHelper'
)
));
// Phone number
$this->addElement('text', 'Phone', array(
'class' => 'input_text',
@ -147,13 +159,13 @@ class Application_Form_SupportSettings extends Zend_Form
// overwriting isValid function
public function isValid ($data)
{
parent::isValid($data);
$isValid = parent::isValid($data);
$checkPrivacy = $this->getElement('Privacy');
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
$checkPrivacy->addError("You have to agree to privacy policy.");
return false;
$isValid = false;
}
return true;
return $isValid;
}
}

View file

@ -1,21 +1,5 @@
<fieldset class="padded">
<dl class="zend_form">
<dt id="stationName-label" class="block-display">
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
<span class="info-text-small">(Required)</span> :
</label>
</dt>
<dd id="stationName-element" class="block-display">
<?php echo $this->element->getElement('stationName') ?>
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="stationDefaultFade-label" class="block-display">
<label class="optional" for="stationDefaultFade"><?php echo $this->element->getElement('stationDefaultFade')->getLabel() ?></label>
</dt>

View file

@ -1,5 +1,19 @@
<fieldset class="padded">
<dl class="zend_form">
<dt id="stationName-label" class="block-display">
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?> :
</label>
</dt>
<dd id="stationName-element" class="block-display">
<?php echo $this->element->getElement('stationName') ?>
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dd id="SupportFeedback-element" style="width:90%;">
<div class="info-text">Help Airtime improve by letting us know you are using it. This info
will be collected regularly in order to improve your user experience.</div>

View file

@ -1,12 +1,12 @@
#!/usr/bin/php
<?php
set_include_path('../application/models' . PATH_SEPARATOR . get_include_path());
require_once(__DIR__.'/../library/propel/runtime/lib/Propel.php');
Propel::init(__DIR__.'/../application/configs/airtime-conf.php');
set_include_path('../airtime_mvc/application/models' . PATH_SEPARATOR . get_include_path());
require_once(__DIR__.'/../airtime_mvc/library/propel/runtime/lib/Propel.php');
Propel::init(__DIR__.'/../airtime_mvc/application/configs/airtime-conf.php');
require_once(dirname(__FILE__).'/../application/configs/conf.php');
require_once(dirname(__FILE__).'/../application/models/Users.php');
require_once(dirname(__FILE__).'/../airtime_mvc/application/configs/conf.php');
require_once(dirname(__FILE__).'/../airtime_mvc/application/models/Users.php');
require_once('DB.php');
require_once('Console/Getopt.php');