当前位置: 首页>>代码示例>>PHP>>正文


PHP Period::select_postal方法代码示例

本文整理汇总了PHP中Period::select_postal方法的典型用法代码示例。如果您正苦于以下问题:PHP Period::select_postal方法的具体用法?PHP Period::select_postal怎么用?PHP Period::select_postal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Period的用法示例。


在下文中一共展示了Period::select_postal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_participant

/**
 * create a new member and let it become participant of the supplied ballot
 *
 * @param Period  $period
 * @param mixed   $ballot Ballot, true or null
 * @param integer $case
 * @param string  $i
 */
function add_participant(Period $period, $ballot, $case, $i) {
	global $date, $password;

	Login::$member = new Member;
	Login::$member->invite = Login::generate_token(24);
	Login::$member->eligible = true;
	Login::$member->verified = true;
	Login::$member->create();
	Login::$member->username = "t".$date."c".$case."p".(is_object($ballot)?$ballot->id:$ballot).$i;
	Login::$member->password = $password;
	$update_fields = array('username', 'password', 'eligible');

	// Enable this only in local development environment, because it may lead to a lot if notification mails!
	//Login::$member->mail = ERROR_MAIL;
	//$update_fields[] = "mail";

	Login::$member->update($update_fields, 'activated=now()');
	Login::$member->update_ngroups([1]);
	if ($ballot) {
		if (is_object($ballot)) $period->select_ballot($ballot); else $period->select_postal();
	}
}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:30,代码来源:test_ballots.php

示例2:

			redirect();
		}
		if ($period->state=="ballot_assignment" and !$ballot->approved) {
			warning(_("In ballot assignment phase it is only allowed to select approved ballots."));
			redirect();
		}
		$period->select_ballot($ballot);
		redirect();
		break;
	case "select_postal":
		Login::access_action("entitled", $_SESSION['ngroup']);
		if ($period->state=="ballot_preparation") {
			warning(_("In ballot preparation phase it is not allowed anymore to select postal voting."));
			redirect();
		}
		$period->select_postal();
		redirect();
		break;
	case "unselect":
		Login::access_action("entitled", $_SESSION['ngroup']);
		if ($period->state=="ballot_preparation") {
			warning(_("In ballot preparation phase it is not allowed anymore to change the ballot choice."));
			redirect();
		}
		$period->unselect_ballot();
		redirect();
		break;
	case "save_approved":
		Login::access_action("admin");
		action_required_parameters('approved_id');
		if ($period->state!="ballot_application") {
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:31,代码来源:ballots.php


注:本文中的Period::select_postal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。