getTimeUnit() public method

public getTimeUnit ( ) : string
return string
Beispiel #1
0
// 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');
$Language = Input::Get('Language', 'int', 1, true);

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);
}

$countries = Country::GetCountries($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("Set subscription settings for a country"), array("Pub" => $publicationObj), true, false, $crumbs);
?>

<P>
<FORM METHOD="POST" ACTION="do_countryadd.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
Beispiel #2
0
$TOL_Language = camp_session_get('TOL_Language', 'en');
$f_name = trim(Input::Get('f_name'));
$f_default_alias = Input::Get('f_default_alias', 'int');
$f_language = Input::Get('f_language', 'int');
$f_url_type = Input::Get('f_url_type', 'int');
$publicationObj = new Publication($f_publication_id);
if (Saas::singleton()->hasPermission("ManagePublicationSubscriptions")) {
    $f_time_unit = Input::Get('f_time_unit');
    $f_unit_cost = trim(Input::Get('f_unit_cost', 'float', '0.0'));
    $f_unit_cost_all_lang = trim(Input::Get('f_unit_cost_all_lang', 'float', '0.0'));
    $f_currency = trim(Input::Get('f_currency'));
    $f_paid = Input::Get('f_paid', 'int');
    $f_trial = Input::get('f_trial', 'int');
} else {
    if (isset($publicationObj)) {
        $f_time_unit = $publicationObj->getTimeUnit();
        $f_unit_cost = p($publicationObj->getUnitCost());
        $f_unit_cost_all_lang = p($publicationObj->getUnitCostAllLang());
        $f_currency = p(htmlspecialchars($publicationObj->getCurrency()));
        $f_paid = p($publicationObj->getPaidTime());
        $f_trial = p($publicationObj->getTrialTime());
    } else {
        $f_time_unit = 'D';
        $f_unit_cost = '';
        $f_unit_cost_all_lang = '';
        $f_currency = '';
        $f_paid = '';
        $f_trial = '';
    }
}
$f_comments_enabled = Input::Get('f_comments_enabled', 'checkbox', 'numeric');