本文整理汇总了PHP中ParamsPeer::retrieveByCode方法的典型用法代码示例。如果您正苦于以下问题:PHP ParamsPeer::retrieveByCode方法的具体用法?PHP ParamsPeer::retrieveByCode怎么用?PHP ParamsPeer::retrieveByCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamsPeer
的用法示例。
在下文中一共展示了ParamsPeer::retrieveByCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
// filter out graduated alumni
$cton1 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::EQUAL);
$cton2 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_OVERDUE, Criteria::EQUAL);
$cton1->addOr($cton2);
$c->add($cton1);
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'alumni'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'alumni');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'alumni'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
#if ($acl->getAddPriv()) array_unshift($actions, array('name'=>'add','url'=>'student/create', 'color'=>'green'));
$this->actions = $actions;
}
示例2: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'academic_cost_component'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'academic_cost_component');
$pager = new sfPropelPager('AcademicCostComponent', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'academic_cost_component'));
$this->getUser()->setAttribute('page', $page, 'academic_cost_component');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'academic_cost_component/create', 'color' => 'black'));
}
$this->actions = $actions;
$cw = new Criteria();
$cw->add(JobPeer::PARENT, $job->getId());
$modules = JobPeer::doSelect($cw);
$this->modules = $modules;
$actions2 = array(array('name' => '<span>Komponen Biaya Sekolah</span>', 'url' => $job->getCode(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例3: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$subject_curr_id = $this->getRequestParameter('subject_curr_id');
$subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id);
$this->forward404Unless($subject_curr);
$this->subject_curr = $subject_curr;
$c = new Criteria();
$c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $subject_curr_id);
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject_grading'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'subject_grading');
$pager = new sfPropelPager('SubjectGrading', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_grading'));
$this->getUser()->setAttribute('page', $page, 'subject_grading');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'subject_grading/create?subject_curr_id=' . $subject_curr->getId(), 'color' => 'black'));
}
array_unshift($actions, array('name' => 'back', 'url' => 'subject_curriculum/list', 'color' => 'black'));
$this->actions = $actions;
}
示例4: executeList
public function executeList(Criteria $crit = null)
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
if ($crit == null) {
$crit = new Criteria();
}
$this->sort($crit);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($crit, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), ' payment_journal_s'));
$this->getUser()->setAttribute('max_per_page', $rpp, ' payment_journal_s');
$pager = new sfPropelPager('PaymentJournal', $rpp);
$pager->setCriteria($crit);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, ' payment_journal_s'));
$this->getUser()->setAttribute('page', $page, ' payment_journal_s');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => ' payment_journal_s/create', 'color' => 'green'));
}
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => ' payment_journal_s/listAsCSV', 'color' => 'white', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => ' payment_journal_s/listAsPDF', 'color' => 'white', 'type' => 'direct'));
$this->actions = $actions;
$this->subtitle = '';
$this->byStudent = true;
}
示例5: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
$this->forward404Unless($student);
$this->student = $student;
$c = new Criteria();
$c->add(StudentLeavePeer::STUDENT_ID, $student->getId());
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_leave_by_student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student_leave_by_student');
$pager = new sfPropelPager('StudentLeave', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_leave_by_student'));
$this->getUser()->setAttribute('page', $page, 'student_leave_by_student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'student_leave_by_student/create?student_id=' . $student->getId(), 'color' => 'green'));
}
array_unshift($actions, array('type' => 'direct', 'name' => 'paymentSlip', 'url' => 'student_leave_by_student/paymentSlip?student_id=' . $student->getId(), 'color' => 'white'));
$this->actions = $actions;
$this->subtitle = $student->toString();
}
示例6: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$ct = new Criteria();
$ct->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($ct);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$c->add(GradeSpecPeer::TYPE_SPEC, GradeSpec::OTHERS, Criteria::NOT_EQUAL);
$c->add(GradeSpecPeer::PARENT, 0, Criteria::IN);
$this->sort($c);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'grade_spec'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'grade_spec');
$pager = new sfPropelPager('GradeSpec', $rpp);
#$pager->setPeerMethod('doSelectOrdered');
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'grade_spec'));
$this->getUser()->setAttribute('page', $page, 'grade_spec');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'grade_spec_new/create', 'color' => 'black'));
}
$this->actions = $actions;
$this->subtitle = '';
}
示例7: generateApplicantCode
public function generateApplicantCode($status, $department)
{
$year = date('Y');
$month = date('m');
if ($status != NgStatusApplicant::CONFIRMED) {
$code_appl = 'REG';
} else {
$code_appl = 'FRM';
}
$dept_code = DepartmentPeer::retrieveByPK($department)->getNumCode() . '-';
$stu_code = ParamsPeer::retrieveByCode('applicant_code');
$sc = $stu_code->getValue();
$sc = explode('$', $sc);
array_shift($sc);
$code_len = 0;
$code = '';
foreach ($sc as $k => $v) {
$v = explode('#', $v);
if ($v[0] == 'app') {
$code_len += $v[1];
$code .= str_pad($code_appl, $v[1], '0', STR_PAD_LEFT);
} elseif ($v[0] == 'dept') {
$code .= str_pad($dept_code, $v[1], '0', STR_PAD_LEFT);
$code_len += $v[1];
} elseif ($v[0] == 'year') {
if (strlen($year) <= $v[1]) {
$code .= str_pad($year, $v[1], '0', STR_PAD_LEFT);
} else {
$code .= substr($year, strlen($year) - $v[1]);
}
$code_len += $v[1];
} elseif ($v[0] == 'month') {
if (strlen($month) <= $v[1]) {
$code .= str_pad($month, $v[1], '0', STR_PAD_LEFT);
} else {
$code .= substr($month, strlen($month) - $v[1]);
}
$code_len += $v[1];
} elseif ($v[0] == 'seq') {
$c = new Criteria();
$c->add(NgTestApplicantPeer::CODE, $code . '%', Criteria::LIKE);
$c->addDescendingOrderByColumn(NgTestApplicantPeer::CODE);
$c->setLimit(1);
$last_applicant = NgTestApplicantPeer::doSelectOne($c);
if ($last_applicant) {
$lap = $last_applicant->getCode();
$lap = substr_replace($lap, '', 0, $code_len);
$lap = substr($lap, 0, $v[1]);
$lap++;
$code .= str_pad($lap, $v[1], '0', STR_PAD_LEFT);
} else {
$code .= str_pad(1, $v[1], '0', STR_PAD_LEFT);
break;
}
}
$sc[$k] = $v;
}
return $code;
}
示例8: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'sm_outgoing')) {
$c->addDescendingOrderByColumn(SmOutgoingPeer::OUTGOING_DATE);
}
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'sm_outgoing'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'sm_outgoing');
$pager = new sfPropelPager('SmOutgoing', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'sm_outgoing'));
$this->getUser()->setAttribute('page', $page, 'sm_outgoing');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'sm_outgoing/create', 'color' => 'green'));
}
$this->actions = $actions;
$this->subtitle = '';
}
示例9: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(CurriculumPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$c->addJoin(StudentPeer::CURRICULUM_ID, CurriculumPeer::ID);
$c->addJoin(ComprehensiveExamPeer::STUDENT_ID, StudentPeer::ID);
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'comprehensive_exam'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'comprehensive_exam');
$pager = new sfPropelPager('ComprehensiveExam', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'comprehensive_exam'));
$this->getUser()->setAttribute('page', $page, 'comprehensive_exam');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'comprehensive_exam/create', 'color' => 'green'));
}
$this->actions = $actions;
}
示例10: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(EmployeePeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'employee'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'employee');
$pager = new sfPropelPager('Employee', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'employee'));
$this->getUser()->setAttribute('page', $page, 'employee');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
array_unshift($actions, array('name' => 'Print Excel', 'url' => "employee/listAsCSV", 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee/listAsPDF", 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
}
示例11: valueAsTree
public function valueAsTree()
{
$level_code = '';
for ($i = 1; $i < $this->getLevel(); $i++) {
$level_code .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
}
if ($this->getName()) {
return $level_code . $this->getName();
} else {
return '-';
}
}
示例12: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$test_applicant = TestApplicantPeer::retrieveByPK($this->getRequestParameter('test_applicant_id'));
$this->forward404Unless($test_applicant);
$c = new Criteria();
$c->add(SubjectTransferPeer::TEST_APPLICANT_ID, $test_applicant->getId());
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'subject_transfer'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'subject_transfer');
$pager = new sfPropelPager('SubjectTransfer', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_transfer'));
$this->getUser()->setAttribute('page', $page, 'subject_transfer');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$this->test_applicant = $test_applicant;
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'subject_transfer/create?test_applicant_id=' . $test_applicant->getId(), 'color' => 'green'));
}
$this->actions = $actions;
}
示例13: executeList
public function executeList()
{
$group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
if ($group != 'root') {
$this->forward('default', 'index');
}
$c = new Criteria();
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'menu_template'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'menu_template');
$pager = new sfPropelPager('JobTemplate', $rpp);
$pager->setPeerMethod('doSelectOrdered');
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'menu_template'));
$this->getUser()->setAttribute('page', $page, 'menu_template');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
array_unshift($actions, array('name' => 'add', 'url' => 'menu_template/create', 'color' => 'black'));
$this->actions = $actions;
$this->subtitle = '';
}
示例14: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
$this->can_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(CirRegulationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'cir_regulation'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'cir_regulation');
$pager = new sfPropelPager('CirRegulation', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'cir_regulation'));
$this->getUser()->setAttribute('page', $page, 'cir_regulation');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'cir_regulation/create', 'color' => 'black'));
}
$this->actions = $actions;
$this->subtitle = '';
}
示例15: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
if ($group == 'root') {
$c = new Criteria();
} else {
$c = new Criteria();
$c->add(UserGroupPeer::ID, 1, Criteria::NOT_IN);
}
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'user_group'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'user_group');
$pager = new sfPropelPager('UserGroup', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'user_group'));
$this->getUser()->setAttribute('page', $page, 'user_group');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
}