CC-2425:Tweak phone home
- privacy check box is uncheck by defalut - 'Yes' button is disabled on popup form by default - custom error msg is added for privacy checkbox on preference form - promote form is hidden by default
This commit is contained in:
parent
1243c60442
commit
c5ec6b5a53
6 changed files with 52 additions and 14 deletions
|
@ -25,13 +25,11 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->statusMsg = "";
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
$form = new Application_Form_Preferences();
|
$form = new Application_Form_Preferences();
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
|
|
||||||
if ($form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
|
|
||||||
$values = $form->getValues();
|
$values = $form->getValues();
|
||||||
|
|
||||||
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
||||||
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
||||||
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
||||||
|
@ -60,10 +58,8 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetStationLogo($imagePath);
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
|
|
||||||
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->view->supportFeedback = Application_Model_Preference::GetSupportFeedback();
|
|
||||||
$logo = Application_Model_Preference::GetStationLogo();
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
if($logo){
|
if($logo){
|
||||||
$this->view->logoImg = $logo;
|
$this->view->logoImg = $logo;
|
||||||
|
|
|
@ -140,8 +140,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
// checkbox for privacy policy
|
// checkbox for privacy policy
|
||||||
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||||
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"\">privacy policy</a>.")
|
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"\">privacy policy</a>.")
|
||||||
->setDecorators(array('ViewHelper'))
|
->setDecorators(array('ViewHelper'));
|
||||||
->setValue(1);
|
|
||||||
$this->addElement($checkboxPrivacy);
|
$this->addElement($checkboxPrivacy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,24 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// checkbox for privacy policy
|
||||||
|
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||||
|
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"\">privacy policy</a>.")
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($checkboxPrivacy);
|
||||||
|
}
|
||||||
|
|
||||||
|
// overwriting isValid function
|
||||||
|
public function isValid ($data)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="info-text">By checking this box, I agree to Sourcefabric's <a id="link_to_privacy" href="">privacy policy</a>.</div>
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd id="publicize-element">
|
<dd id="publicize-element">
|
||||||
<label class="optional" for="Publicise">
|
<label class="optional" for="Publicise">
|
||||||
|
@ -30,7 +29,9 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to publicise your station, "Send support feedback" must be enabled</p></div>
|
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to publicise your station, "Send support feedback" must be enabled</p></div>
|
||||||
|
<dl id="public-info" style="display:none;">
|
||||||
<dt id="Phone-label" class="block-display">
|
<dt id="Phone-label" class="block-display">
|
||||||
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
@ -112,10 +113,11 @@
|
||||||
<dt id="Logo-label" class="block-display">
|
<dt id="Logo-label" class="block-display">
|
||||||
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
|
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
<?php if($this->element->getView()->logoImg){?>
|
|
||||||
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
|
|
||||||
<?php }?>
|
|
||||||
<dd id="Logo-element" class="block-display clearfix">
|
<dd id="Logo-element" class="block-display clearfix">
|
||||||
|
<?php if($this->element->getView()->logoImg){?>
|
||||||
|
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
<?php echo $this->element->getElement('Logo') ?>
|
<?php echo $this->element->getElement('Logo') ?>
|
||||||
<div class="info-text"><p>Min. size: 200x200 Max. size: 600x600</p></div>
|
<div class="info-text"><p>Min. size: 200x200 Max. size: 600x600</p></div>
|
||||||
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
|
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
|
||||||
|
@ -126,7 +128,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<h3 class="collapsible-header">
|
<h3 class="collapsible-header">
|
||||||
<span class="arrow-icon"></span>Show me what I am sending
|
<span class="arrow-icon"></span>Show me what I am sending
|
||||||
|
@ -139,4 +140,18 @@
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<br>
|
||||||
|
<label class="optional" for="Privacy">
|
||||||
|
<?php echo $this->element->getElement('Privacy') ?>
|
||||||
|
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||||
|
</label>
|
||||||
|
<?php if($this->element->getElement('Privacy')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('Privacy')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -37,7 +37,9 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var button = $("#help_airtime");
|
||||||
|
button.attr('disabled', 'disabled').addClass('ui-state-disabled');
|
||||||
dialog.dialog('open');
|
dialog.dialog('open');
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,14 @@ $(document).ready(function() {
|
||||||
pub.removeAttr("disabled");
|
pub.removeAttr("disabled");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#Publicise").live('click', function(){
|
||||||
|
if($(this).is(':checked')){
|
||||||
|
$("#public-info").show();
|
||||||
|
}else{
|
||||||
|
$("#public-info").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
showErrorSections();
|
showErrorSections();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue