CC-1724:Phone home statistics

- Final commit for client side.
This commit is contained in:
james 2011-06-20 17:58:38 -04:00
parent 1fbaa7d5fb
commit e762633405
13 changed files with 383 additions and 265 deletions

View File

@ -21,8 +21,11 @@ class NowplayingController extends Zend_Controller_Action
//popup if previous page was login
$refer_sses = new Zend_Session_Namespace('referrer');
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id);
if($refer_sses->referrer == 'login' && Application_Model_Nowplaying::ShouldShowPopUp()
&& !Application_Model_Preference::GetSupportFeedback()){
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js','text/javascript');
}
}

View File

@ -116,42 +116,6 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetRemindMeDate($now);
die();
}
/*public function registersubmitAction(){
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
$this->view->statusMsg = "";
$form = new Application_Form_RegisterAirtime();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
var_dump($values);
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
Application_Model_Preference::SetPhone($values["Phone"]);
Application_Model_Preference::SetEmail($values["Email"]);
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
Application_Model_Preference::SetPublicise($values["Publicise"]);
$imagePath = $form->Logo->getFileName();
Application_Model_Preference::SetStationCountry($values["Country"]);
Application_Model_Preference::SetStationCity($values["City"]);
Application_Model_Preference::SetStationDescription($values["Description"]);
Application_Model_Preference::SetStationLogo($imagePath);
// unset session
Zend_Session::namespaceUnset('referrer');
}
}
$this->_redirect('Nowplaying');
}*/
}

View File

@ -17,7 +17,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
// Station Name
$stnName = new Zend_Form_Element_Text("stnName");
$stnName->setLabel("Station Name:")
$stnName->setLabel("Station Name:(*)")
->setRequired(true)
->setValue(Application_Model_Preference::GetStationName())
->setDecorators(array('ViewHelper'));
@ -27,7 +27,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
$this->addElement('text', 'Phone', array(
'class' => 'input_text',
'label' => 'Phone:',
'required' => true,
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetPhone(),
'decorators' => array(
@ -38,7 +38,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
//Email
$this->addElement('text', 'Email', array(
'class' => 'input_text',
'label' => 'Email:',
'label' => 'Email:(*)',
'required' => true,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetEmail(),
@ -61,7 +61,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
// county list dropdown
$this->addElement('select', 'Country', array(
'label' => 'Country:',
'required' => true,
'required' => false,
'value' => Application_Model_Preference::GetStationCountry(),
'multiOptions' => $country_list,
'decorators' => array(
@ -72,7 +72,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
// Station city
$this->addElement('text', 'City', array(
'label' => 'City:',
'required' => true,
'required' => false,
'class' => 'input_text',
'value' => Application_Model_Preference::GetStationCity(),
'decorators' => array(
@ -84,7 +84,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
$description = new Zend_Form_Element_Textarea('Description');
$description->class = 'input_text_area';
$description->setLabel('Station Description:')
->setRequired(true)
->setRequired(false)
->setValue(Application_Model_Preference::GetStationDescription())
->setDecorators(array('ViewHelper'))
->setAttrib('ROWS','2')
@ -99,17 +99,17 @@ class Application_Form_RegisterAirtime extends Zend_Form
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,png,gif')
->addValidator('ImageSize', false, array(
'minwidth' => 180,
'minheight' => 180,
'maxwidth' => 1000,
'maxheight' => 1000));
'minwidth' => 200,
'minheight' => 200,
'maxwidth' => 600,
'maxheight' => 600));
$this->addElement($upload);
//enable support feedback
$this->addElement('checkbox', 'SupportFeedback', array(
'label' => 'Send support feedback',
'required' => false,
'value' => Application_Model_Preference::GetSupportFeedback(),
'value' => 1,
'decorators' => array(
'ViewHelper'
)
@ -121,9 +121,6 @@ class Application_Form_RegisterAirtime extends Zend_Form
->setRequired(false)
->setDecorators(array('ViewHelper'))
->setValue(Application_Model_Preference::GetPublicise());
if(!Application_Model_Preference::GetSupportFeedback()){
$checkboxPublicise->setAttrib("disabled", "disabled");
}
$this->addElement($checkboxPublicise);
// text area for sending detail
@ -132,7 +129,8 @@ class Application_Form_RegisterAirtime extends Zend_Form
'required' => false,
'filters' => array('StringTrim'),
'readonly' => true,
'rows' => 24,
'rows' => 5,
'cols' => 61,
'value' => Application_Model_Preference::GetSystemInfo(),
'decorators' => array(
'ViewHelper'

View File

@ -16,7 +16,7 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
$this->addElement('text', 'Phone', array(
'class' => 'input_text',
'label' => 'Phone:',
'required' => true,
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetPhone(),
'decorators' => array(
@ -50,7 +50,7 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
// county list dropdown
$this->addElement('select', 'Country', array(
'label' => 'Country:',
'required' => true,
'required' => false,
'value' => Application_Model_Preference::GetStationCountry(),
'multiOptions' => $country_list,
'decorators' => array(
@ -61,7 +61,7 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
// Station city
$this->addElement('text', 'City', array(
'label' => 'City:',
'required' => true,
'required' => false,
'class' => 'input_text',
'value' => Application_Model_Preference::GetStationCity(),
'decorators' => array(
@ -72,7 +72,7 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
// Station Description
$this->addElement('textarea', 'Description', array(
'label' => 'Station Description:',
'required' => true,
'required' => false,
'class' => 'input_text_area',
'value' => Application_Model_Preference::GetStationDescription(),
'decorators' => array(

View File

@ -288,7 +288,7 @@ class Application_Model_Preference
return $out;
}
public static function GetSystemInfo(){
public static function GetSystemInfo($returnArray=false){
exec('/usr/bin/airtime-check-system', $output);
$output = preg_replace('/\s+/', ' ', $output);
@ -297,7 +297,7 @@ class Application_Model_Preference
foreach( $output as $key => &$out){
$info = explode('=', $out);
if(isset($info[1])){
$key = str_replace(' ', '_', $info[0]);
$key = str_replace(' ', '_', trim($info[0]));
$key = strtoupper($key);
$systemInfoArray[$key] = $info[1];
}
@ -306,17 +306,26 @@ class Application_Model_Preference
$outputArray = array();
$outputArray['STATION_NAME'] = Application_Model_Preference::GetStationName();
$outputArray['PHONE'] = Application_Model_Preference::GetPhone();
$outputArray['EMAIL'] = Application_Model_Preference::GetEmail();
$outputArray['STATION_WEB_SITE'] = Application_Model_Preference::GetStationWebSite();
$outputArray['STATION_COUNTRY'] = Application_Model_Preference::GetStationCountry();
$outputArray['STATION_CITY'] = Application_Model_Preference::GetStationCity();
$outputArrat['STATION_DESCRIPTION'] = Application_Model_Preference::GetStationDescription();
//$outputArray['Version'] = $systemInfoArray['AIRTIME_VERSION'];
$outputArray['WEB_SERVER'] = php_sapi_name();
//$outputArray['OS Info'] = $systemInfoArray['OS'];
// get web server info
$url = $systemInfoArray["AIRTIME_VERSION_URL"];
$index = strpos($url,'/api/');
$url = substr($url, 0, $index);
$headerInfo = get_headers(trim($url),1);
$outputArray['WEB_SERVER'] = $headerInfo['Server'][0];
$outputArray['NUM_OF_USERS'] = User::getUserCount();
$outputArray['NUM_OF_SONGS'] = StoredFile::getFileCount();
$outputArray['NUM_OF_PLAYLISTS'] = Playlist::getPlaylistCount();
$outputArray['NUM_OF_SCHEDULED_PLAYLIST'] = Schedule::getSchduledPlaylistCount();
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Schedule::getSchduledPlaylistCount();
$outputArray['NUM_OF_PAST_SHOWS'] = ShowInstance::GetShowInstanceCount(date("Y-m-d H:i:s"));
$outputArray['UNIQUE_ID'] = Application_Model_Preference::GetUniqueId();
$outputArray = array_merge($outputArray, $systemInfoArray);
@ -325,8 +334,11 @@ class Application_Model_Preference
foreach($outputArray as $key => $out){
$outputString .= $key.' : '.$out."\n";
}
return $outputString;
if($returnArray){
return $outputArray;
}else{
return $outputString;
}
}
public static function SetRemindMeDate($now){

View File

@ -1866,6 +1866,13 @@ class ShowInstance {
return new ShowInstance($id);
}
}
// returns number of show instances that ends later than $day
public static function GetShowInstanceCount($day){
global $CC_CONFIG, $CC_DBC;
$sql = "SELECT count(*) as cnt FROM $CC_CONFIG[showInstances] WHERE ends < '$day'";
return $CC_DBC->GetOne($sql);
}
}
/* Show Data Access Layer */

View File

@ -1,162 +1,164 @@
<div class="dialogPopup register-dialog" title="Register Airtime">
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
<dl class="zend_form">
<div class="info-text">
<p>Help Airtime improve by letting us know you are using it. This info
will be collected regularly in order to improve your user experience.</p>
</div>
<dd id="SupportFeedback-element">
<label class="optional" for="SupportFeedback">
<?php echo $this->element->getElement('SupportFeedback') ?>
<strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong>
</label>
<?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<div class="info-text">
<p>Click the box below to advertise your station on Sourcefabric.org.</p>
</div>
<dd id="publicize-element">
<label class="optional" for="Publicise">
<?php echo $this->element->getElement('Publicise') ?>
<strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong>
</label>
<?php if($this->element->getElement('Publicise')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<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 id="public-info" style="display:none;">
<dt id="stnName-label" class="block-display">
<label class="optional" for="stnName"><?php echo $this->element->getElement('stnName')->getLabel() ?></label>
</dt>
<dd id="stnName-element" class="block-display">
<?php echo $this->element->getElement('stnName') ?>
<?php if($this->element->getElement('stnName')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stnName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Phone-label" class="block-display">
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
</dt>
<dd id="Phone-element" class="block-display">
<?php echo $this->element->getElement('Phone') ?>
<?php if($this->element->getElement('Phone')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Phone')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Email-label" class="block-display">
<label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label>
</dt>
<dd id="Email-element" class="block-display">
<?php echo $this->element->getElement('Email') ?>
<?php if($this->element->getElement('Email')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Email')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="StationWebSite-label" class="block-display">
<label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label>
</dt>
<dd id="StationWebSite-element" class="block-display clearfix">
<?php echo $this->element->getElement('StationWebSite') ?>
<?php if($this->element->getElement('StationWebSite')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('StationWebSite')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Country-label" class="block-display">
<label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label>
</dt>
<dd id="Country-element" class="block-display clearfix">
<?php echo $this->element->getElement('Country') ?>
<?php if($this->element->getElement('Country')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Country')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="City-label" class="block-display">
<label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label>
</dt>
<dd id="City-element" class="block-display clearfix">
<?php echo $this->element->getElement('City') ?>
<?php if($this->element->getElement('City')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('City')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Description-label" class="block-display">
<label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label>
</dt>
<dd id="Description-element" class="block-display clearfix">
<?php echo $this->element->getElement('Description') ?>
<?php if($this->element->getElement('Description')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Description')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Logo-label" class="block-display">
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
</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">
<?php echo $this->element->getElement('Logo') ?>
<div class="info-text"><p>Min. size: 180x180 Max. size: 600x600</p></div>
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</div>
</dl>
<h3 class="collapsible-header">
<span class="arrow-icon"></span>Show me what I am sending
</h3>
<div class="collapsible-content" id="show_what_sending" style="display: none;">
<fieldset class="display_field">
<dl>
<?php echo $this->element->getElement('SendInfo') ?>
</dl>
</fieldset>
</div>
</form>
<div class="dialogPopup register-dialog" title="Register Airtime">
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
<fieldset>
<dl class="zend_form">
<dt class="block-display 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.
</dt>
<dd id="SupportFeedback-element" class="block-display">
<label class="optional" for="SupportFeedback">
<?php echo $this->element->getElement('SupportFeedback') ?>
<strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong>
</label>
<?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt class="block-display info-text">
Click the box below to advertise your station on Sourcefabric.org. In order to publicise your station, "Send support feedback" must be enabled
</dt>
<dd id="publicize-element" class="block-display">
<label class="optional" for="Publicise">
<?php echo $this->element->getElement('Publicise') ?>
<strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong>
</label>
<?php if($this->element->getElement('Publicise')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
<dl id="public-info" style="display:none;">
<dt id="stnName-label">
<label class="optional" for="stnName"><?php echo $this->element->getElement('stnName')->getLabel() ?></label>
</dt>
<dd id="stnName-element">
<?php echo $this->element->getElement('stnName') ?>
<?php if($this->element->getElement('stnName')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('stnName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Phone-label">
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
</dt>
<dd id="Phone-element">
<?php echo $this->element->getElement('Phone') ?>
<?php if($this->element->getElement('Phone')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Phone')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Email-label">
<label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label>
</dt>
<dd id="Email-element">
<?php echo $this->element->getElement('Email') ?>
<?php if($this->element->getElement('Email')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Email')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="StationWebSite-label">
<label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label>
</dt>
<dd id="StationWebSite-element">
<?php echo $this->element->getElement('StationWebSite') ?>
<?php if($this->element->getElement('StationWebSite')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('StationWebSite')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Country-label">
<label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label>
</dt>
<dd id="Country-element">
<?php echo $this->element->getElement('Country') ?>
<?php if($this->element->getElement('Country')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Country')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="City-label">
<label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label>
</dt>
<dd id="City-element">
<?php echo $this->element->getElement('City') ?>
<?php if($this->element->getElement('City')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('City')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Description-label">
<label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label>
</dt>
<dd id="Description-element">
<?php echo $this->element->getElement('Description') ?>
<?php if($this->element->getElement('Description')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Description')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="Logo-label" class="block-display">
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
</dt>
<dd id="Logo-element">
<?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') ?>
<p class="info-text">Min. size: 180x180 Max. size: 600x600</p>
<?php if($this->element->getElement('Logo')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
</fieldset>
<h3 class="collapsible-header">
<span class="arrow-icon"></span>Show me what I am sending
</h3>
<div class="collapsible-content" id="show_what_sending" style="display: none;">
<fieldset class="display_field">
<dl>
<?php echo $this->element->getElement('SendInfo') ?>
</dl>
</fieldset>
</div>
</form>
</div>

View File

@ -357,10 +357,11 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus, .input_t
border: 1px solid #5b5b5b;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2) inset;
font-size: 13px;
text-indent: 3px;
margin:0;
}
.input_select {
.input_select, select {
background-color: #DDDDDD;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2) inset;
border: 1px solid #5b5b5b;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
@ -1639,10 +1640,6 @@ dd.radio-inline-list, .preferences dd.radio-inline-list {
height: 120px;
}
.preferences dd#Description-element.block-display .input_text_area {
height: 60px;
}
#show_time_info {
font-size:12px;
height:30px;
@ -1669,43 +1666,73 @@ button.ui-button.md-cancel {
.dialogPopup dl {
margin:0;
padding:0;
}
.dialogPopup dt {
margin:0;
padding: 0 0 5px;
}
.dialogPopup dt label {
font-weight: bold;
}
.dialogPopup dd {
margin:0 0 4px 0;
padding: 0 0 5px;
}
.dialogPopup dd input[type="text"]{
clear:both;
width:100%;
}
.dialogPopup dt {
clear: left;
padding: 0;
float:left;
width:35%;
}
.info-text p {
.dialogPopup dt.block-display {
float:none;
width:100%;
padding: 0 0 10px;
}
.dialogPopup dt label {
font-weight: bold;
line-height:24px;
}
.dialogPopup dd {
padding: 0;
float:left;
width:65%;
margin:0 0 6px 0;
}
.dialogPopup dd.block-display {
float:none;
width:100%;
padding: 0 0 10px;
margin:0 0 8px 0;
}
.dialogPopup fieldset dt:last-child, .dialogPopup fieldset dd:last-child {
margin:0;
}
.info-text {
font-size:12px;
color:#5b5b5b;
line-height:150%;
margin-top:0;
}
padding:0 0 6px;
margin:0;
}
.dialogPopup label input[type="checkbox"] {
float:left;
margin-right:6px;
}
.dialogPopup fieldset {
padding: 10px;
padding: 0;
clear:both;
border:none;
}
.dialogPopup fieldset dd input[type="text"] {
width:99%;
.dialogPopup fieldset dd input[type="text"], .dialogPopup fieldset dd textarea {
width:99.5%;
padding:0;
}
.dialogPopup fieldset dd select {
width:100%;
}
fieldset.display_field {
background-color:#d5d5d5;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2) inset;
padding:10px;
border: 1px solid #8F8F8F;
}
label span {
font-weight:normal;
@ -1720,7 +1747,6 @@ label span {
padding: 6px 0;
text-align: left;
width:60%;
}
.dialogPopup .display_field dt {
@ -1728,8 +1754,3 @@ label span {
font-weight:bold;
width:40%;
}
.sending_textarea {
width: 100%;
resize: none;
}

View File

@ -4,10 +4,10 @@ $(document).ready(function(){
dialog.dialog({
autoOpen: false,
width: 450,
width: 500,
resizable: false,
modal: true,
position:'center',
position:['center',50],
buttons: {
"Remind me in 1 week": function() {
var url = '/Preference/remindme';
@ -55,22 +55,20 @@ $(document).ready(function(){
$("#public-info").hide();
}
});
$("#link_to_whos_using").live('click', function(){
window.open("http://sourcefabric.org/en/products/airtime_whosusing");
});
});
function validateFields(){
var stnName = $("#stnName");
var phone = $("#Phone");
var email = $("#Email");
var city = $("#City");
var description = $("#Description");
var errors = new Array();
errors[0] = displayError(stnName);
errors[1] = displayError(phone);
errors[2] = displayError(email);
errors[3] = displayError(city);
errors[4] = displayError(description);
errors[1] = displayError(email);
for( e in errors ){
if(errors[e]){

View File

@ -127,5 +127,11 @@ AirtimeInstall::CreateZendPhpLogFile();
AirtimeInstall::SetUniqueId();
$h = rand(0,23);
$m = rand(0,59);
$fp = fopen('/etc/cron.d/airtime-crons','a');
fwrite($fp, "$m $h * * * root /usr/lib/airtime/utils/phone_home_stat\n");
fclose($fp);
/* FINISHED AIRTIME PHP INSTALLER */

View File

@ -89,4 +89,6 @@ AirtimeInstall::RemoveSymlinks();
AirtimeInstall::UninstallBinaries();
AirtimeInstall::RemoveLogDirectories();
unlink('/etc/cron.d/airtime-crons');
/* FINISHED AIRTIME PHP UNINSTALLER */

34
utils/phone_home_stat Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
#-------------------------------------------------------------------------------
# Copyright (c) 2010 Sourcefabric O.P.S.
#
# This file is part of the Airtime project.
# http://airtime.sourcefabric.org/
#
# Airtime is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Airtime is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Airtime; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This script cleans audio files in Airtime.
#
# Absolute path to this script
SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`
invokePwd=$PWD
cd $SCRIPTPATH
php -q phone_home_stat.php "$@" || exit 1

71
utils/phone_home_stat.php Normal file
View File

@ -0,0 +1,71 @@
#!/usr/bin/env php
<?php
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
// Name of the web server user
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
$CC_CONFIG['basePort'] = $values['general']['base_port'];
$CC_CONFIG['baseFilesDir'] = $values['general']['base_files_dir'];
// main directory for storing binary media files
$CC_CONFIG['storageDir'] = $values['general']['base_files_dir']."/stor";
// Database config
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
$CC_CONFIG['dsn']['phptype'] = 'pgsql';
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
$CC_CONFIG['apiKey'] = array($values['general']['api_key']);
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php');
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
require_once($CC_CONFIG['phpDir'].'/application/models/Users.php');
require_once($CC_CONFIG['phpDir'].'/application/models/StoredFile.php');
require_once($CC_CONFIG['phpDir'].'/application/models/Playlist.php');
require_once($CC_CONFIG['phpDir'].'/application/models/Schedule.php');
require_once($CC_CONFIG['phpDir'].'/application/models/Shows.php');
require_once($CC_CONFIG['phpDir'].'/application/models/Preference.php');
//Pear classes.
set_include_path($CC_CONFIG['phpDir'].'/library/pear' . PATH_SEPARATOR . get_include_path());
require_once('DB.php');
$CC_DBC = DB::connect($CC_CONFIG['dsn'], FALSE);
if (PEAR::isError($CC_DBC)) {
echo $CC_DBC->getMessage().PHP_EOL;
echo $CC_DBC->getUserInfo().PHP_EOL;
echo "Database connection problem.".PHP_EOL;
echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists".
" with corresponding permissions.".PHP_EOL;
if ($p_exitOnError) {
exit(1);
}
} else {
echo "* Connected to database".PHP_EOL;
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
}
$infoArray = Application_Model_Preference::GetSystemInfo(true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, 'http://stat.sourcefabric.org/index.php?p=airtime');
$data = json_encode($infoArray);
$dataArray = array("data" => $data );
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray);
$result = curl_exec($ch);
?>