Inheritance: extends DatabaseObject
Beispiel #1
1
require_once($GLOBALS['g_campsiteDir']."/classes/Country.php");

if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
	camp_html_display_error(getGS("You do not have the right to manage publications."));
	exit;
}

$Pub = Input::Get('Pub', 'int', 0);
$Language = Input::Get('Language', 'int', 1, true);
$CountryCode = Input::Get('CountryCode');

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$publicationObj = new Publication($Pub);
$defaultTime = new SubscriptionDefaultTime($CountryCode, $Pub);
$defaultTime->delete();

$logtext = getGS('Subscription default time for "$1":$2 deleted', $publicationObj->getName(), $CountryCode);
Log::Message($logtext, $g_user->getUserId(), 5);
camp_html_add_msg(getGS("Country subscription settings deleted."), "ok");
camp_html_goto_page("/$ADMIN/pub/deftime.php?Pub=$Pub&Language=$Language");
?>
Beispiel #2
1
if (!$g_user->hasPermission('ManagePub')) {
    camp_html_display_error(getGS("You do not have the right to manage publications."));
    exit;
}
$Pub = Input::Get('Pub', 'int');
$Language = Input::Get('Language', 'int', 1);
if (!Input::IsValid()) {
    camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
    exit;
}
$publicationObj = new Publication($Pub);
$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), $publicationObj->getLanguageId());
if (!$pubTimeUnit->exists()) {
    $pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), 1);
}
$defaultTimes = SubscriptionDefaultTime::GetSubscriptionDefaultTimes(null, $Pub);
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
camp_html_content_top(getGS("Subscription Settings by Country"), array("Pub" => $publicationObj));
?>
<p>
<TABLE class="action_buttons">
<TR>
    <TD><A HREF="/<?php 
echo $ADMIN;
?>
/pub/countryadd.php?Pub=<?php 
p($Pub);
?>
&Language=<?php 
p($Language);
?>
Beispiel #3
1
$Pub = Input::Get('Pub', 'int');
$Language = Input::Get('Language', 'int', 1, true);
$CountryCode = Input::Get('CountryCode');

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$publicationObj = new Publication($Pub);
$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), $publicationObj->getLanguageId());
if (!$pubTimeUnit->exists()) {
	$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), 1);
}

$defaultTime = new SubscriptionDefaultTime($CountryCode, $Pub);
$country = new Country($CountryCode, $Language);

include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");

$crumbs = array(getGS("Subscriptions") => "deftime.php?Pub=$Pub&Language=$Language");
camp_html_content_top(getGS("Change country subscription settings"), array("Pub" => $publicationObj), true, false, $crumbs);

?>
<P>
<FORM NAME="subscription_settings" METHOD="POST" ACTION="do_editdeftime.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<INPUT TYPE="HIDDEN" NAME="Pub" VALUE="<?php p($Pub); ?>">
<INPUT TYPE="HIDDEN" NAME="CountryCode" VALUE="<?php p($CountryCode); ?>">
<INPUT TYPE="HIDDEN" NAME="Language" VALUE="<?php p($Language); ?>">
Beispiel #4
0
$cPaidTime = Input::Get('cPaidTime', 'int', 0);

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$backLink = "/$ADMIN/pub/countryadd.php?Pub=$cPub&Language=$Language";
$publicationObj = new Publication($cPub);

if (empty($cCountryCode)) {
	camp_html_add_msg(getGS('You must select a country.'));
	camp_html_goto_page($backLink);
}

$values = array('TrialTime' => $cTrialTime,
				'PaidTime' => $cPaidTime);
$defaultTime = new SubscriptionDefaultTime($cCountryCode, $cPub);
if ($defaultTime->exists()) {
	$defaultTime->update($values);
} else {
	$created = $defaultTime->create($values);
	if (!$created) {
    	camp_html_add_msg(getGS("The subscription settings for '$1' could not be added.", $publicationObj->getName().':'.$cCountryCode));
    	camp_html_goto_page($backLink);
	}
}
camp_html_add_msg(getGS("Country subscription settings updated."), "ok");
camp_html_goto_page("/$ADMIN/pub/deftime.php?Pub=$cPub&Language=$Language");

?>
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
	camp_html_display_error(getGS("You do not have the right to change publication information."));
	exit;
}

$Pub = Input::Get('Pub', 'int', 0);
$Language = Input::Get('Language', 'int', 1, true);
$CountryCode = Input::Get('CountryCode');
$cPaidTime = Input::Get('cPaidTime', 'int', 0);
$cTrialTime = Input::Get('cTrialTime', 'int', 0);

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
	exit;
}

$publicationObj = new Publication($Pub);
$defaultTime = new SubscriptionDefaultTime($CountryCode, $Pub);

$defaultTime->setTrialTime($cTrialTime);
$defaultTime->setPaidTime($cPaidTime);
camp_html_add_msg(getGS("Country subscription settings updated."), "ok");
$logtext = getGS('Default subscription time for "$1":$2 changed', $publicationObj->getName(), $CountryCode);
Log::Message($logtext, $g_user->getUserId(), 6);
camp_html_goto_page("/$ADMIN/pub/deftime.php?Pub=$Pub&Language=$Language");
?>
Beispiel #6
0
    camp_html_display_error(getGS("You do not have the right to edit publication information."));
    exit;
}
$Pub = Input::Get('Pub', 'int');
$Language = Input::Get('Language', 'int', 1, true);
$CountryCode = Input::Get('CountryCode');
if (!Input::IsValid()) {
    camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
    exit;
}
$publicationObj = new Publication($Pub);
$pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), $publicationObj->getLanguageId());
if (!$pubTimeUnit->exists()) {
    $pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), 1);
}
$defaultTime = new SubscriptionDefaultTime($CountryCode, $Pub);
$country = new Country($CountryCode, $Language);
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
$crumbs = array(getGS("Subscriptions") => "deftime.php?Pub={$Pub}&Language={$Language}");
camp_html_content_top(getGS("Change country subscription settings"), array("Pub" => $publicationObj), true, false, $crumbs);
?>
<P>
<FORM NAME="subscription_settings" METHOD="POST" ACTION="/<?php 
echo $ADMIN;
?>
/pub/do_editdeftime.php" onsubmit="return <?php 
camp_html_fvalidate();
?>
;">
<?php 
echo SecurityToken::FormParameter();