本文整理汇总了PHP中JobPeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP JobPeer::doSelectOne方法的具体用法?PHP JobPeer::doSelectOne怎么用?PHP JobPeer::doSelectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobPeer
的用法示例。
在下文中一共展示了JobPeer::doSelectOne方法的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_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(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$filters = null;
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', 999);
$pager = new sfPropelPager('AcademicCalendar', $rpp);
$pager->setPeerMethod('doSelectOrdered');
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($filters) {
foreach ($filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
$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_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c = new Criteria();
$c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_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(), 'course'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'course');
$pager = new sfPropelPager('CourseSchedule', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
$this->getUser()->setAttribute('page', $page, 'course');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
$this->actions = $actions;
$this->subtitle = $dept->getName();
$this->counseling = new Counseling();
$this->dept = $dept;
}
示例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());
$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(ColLocationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$c->addJoin(ColItemPeer::COL_LOCATION_ID, ColLocationPeer::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 ($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(), 'col_item'));
$this->getUser()->setAttribute('max_per_page', 12, 'col_item');
$pager = new sfPropelPager('ColItem', 12);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'col_item'));
$this->getUser()->setAttribute('page', $page, 'col_item');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
$this->filter_string = $filter_string;
$this->subtitle = '';
$actions = array(array('name' => 'cetak', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
$this->actions = $actions;
$this->actions3 = array();
}
示例4: executeShowStudent
public function executeShowStudent()
{
$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');
}
$subject = SubjectPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($subject);
$this->subtitle = $subject->toString() . ' - id:' . $subject->getId();
$this->subject = $subject;
}
示例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;
$actions = array();
$this->actions = $actions;
$this->byEmployee = false;
$this->subtitle = 'Riwayat Penilaian';
$this->counseling = new Counseling();
}
示例6: executeListByEmployee
public function executeListByEmployee()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, 'counseling/listByEmployee');
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo');
$actions = array();
$this->actions = $actions;
$this->subtitle = $employee->toString();
$this->employee_id = $employee_id;
$this->employee = $employee;
$this->counseling = new Counseling();
}
示例7: executeEdit
public function executeEdit()
{
$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_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$user_group = UserGroupPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($user_group);
if ($user_group->getJobTemplateId() == 11) {
$c = new Criteria();
$cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN);
$cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 1, Criteria::IN);
$cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 3, Criteria::IN);
$cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN);
$cton3->addOr($cton4);
$cton2->addOr($cton3);
$cton1->addAnd($cton2);
$c->add($cton1);
$c->addAscendingOrderByColumn(JobPeer::MENU_ORDER);
$jobs = JobPeer::doSelect($c);
} else {
$c = new Criteria();
$cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN);
$cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplateId(), Criteria::IN);
$cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplate()->getParent(), Criteria::IN);
$cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN);
$cton3->addOr($cton4);
$cton2->addOr($cton3);
$cton1->addAnd($cton2);
$c->add($cton1);
$c->addAscendingOrderByColumn(JobPeer::MENU_ORDER);
$jobs = JobPeer::doSelect($c);
}
foreach ($jobs as $job) {
$c = new Criteria();
$c->add(JobPeer::PARENT, $job->getId());
$c->add(JobPeer::DISPLAY_MENU, true);
$job->child = JobPeer::doCount($c);
$c = new Criteria();
$c->add(AclPeer::USER_GROUP_ID, $user_group->getId(), Criteria::EQUAL);
$c->add(AclPeer::JOB_ID, $job->getId(), Criteria::EQUAL);
$job->acl = AclPeer::doSelectOne($c);
$job->level = $job->getLevel();
$job->order = $job->getMenuOrderRecursive();
}
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($user_group->getCode() != 'admin' && $user_group->getCode() != 'student' && $user_group->getCode() != 'lector') {
array_push($actions, array('name' => 'delete', 'url' => 'user_group/delete?id=' . $user_group->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'user_group/list', 'color' => 'white'));
$this->subtitle = $user_group->toString() . ' - id:' . $user_group->getId();
$this->type = 'edit';
$this->user_group = $user_group;
$this->icon = 'user_edit.png';
$this->actions = $actions;
$this->jobs = $jobs;
}
示例8: executeListElse
public function executeListElse()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
if ($group == 'lector') {
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) {
$this->can_add == 0;
$this->can_edit == 0;
$this->can_remove == 0;
}
$this->employee = $employee;
} else {
$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;
}
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
$this->forward404Unless($counseling);
$c = new Criteria();
$c->add(VStudentElsePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId(), Criteria::IN);
$c->add(VStudentElsePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$c->add(VStudentElsePeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
$c->add(VStudentElsePeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL);
$this->sortElse($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->filterElse($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'else'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'else');
$pager = new sfPropelPager('VStudentElse', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'else'));
$this->getUser()->setAttribute('page', $page, 'else');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => 'back', 'url' => "student_finance/list", 'color' => 'black'));
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/listElseAsCSV?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/listElseAsPDF?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$this->counseling = $counseling;
$this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString();
$actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例9: executeEdit
public function executeEdit()
{
$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;
$schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($schedule);
$this->setTemplate('edit');
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'extracurricular/delete?id=' . $schedule->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'extracurricular/list', 'color' => 'black'));
$this->subtitle = $schedule->toStringCap() . ' - id:' . $schedule->getId();
$this->type = 'edit';
$this->schedule = $schedule;
$this->actions = $actions;
$c = new Criteria();
$c->add(ScheduleDetailPeer::SCHEDULE_ID, $schedule->getId());
$c->addDescendingOrderByColumn(ScheduleDetailPeer::ID);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule_detail'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'schedule_detail');
$pager = new sfPropelPager('ScheduleDetail', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule_detail'));
$this->getUser()->setAttribute('page', $page, 'schedule_detail');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions2 = array(array('name' => 'add', 'url' => 'extracurricular/createSchedule?schedule_id=' . $schedule->getId(), 'color' => 'black'));
$this->actions2 = $actions2;
}
示例10: executeEdit
public function executeEdit()
{
$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_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$payment_student = PaymentJournalPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($payment_student);
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'payment_student/delete?id=' . $payment_student->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'payment_student/list', 'color' => 'white'));
$this->subtitle = $payment_student->toString() . ' - id:' . $payment_student->getId();
$this->type = 'edit';
$this->payment_student = $payment_student;
$this->actions = $actions;
$dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
$depts = $dept->getChildRecurs(array());
$this->academic_costs = array();
$c = new Criteria();
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $depts, Criteria::IN);
$c->addJoin(AcademicCalendarPeer::ID, VAcademicCostPeer::ACADEMIC_CALENDAR_ID);
$costs = VAcademicCostPeer::doSelect($c);
foreach ($costs as $cost) {
$academic_costs[$cost->getId()] = $cost->toStringCap();
}
$this->academic_costs = $academic_costs;
}
示例11: executeListAbsenceByEmployee
public function executeListAbsenceByEmployee()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, 'counseling/listByEmployee');
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
$this->forward404Unless($counseling);
$accal_id = $this->getRequestParameter('accal_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$this->forward404Unless($academic_calendar);
$month_id = $this->getRequestParameter('month_id');
$title = MonthPeer::retrieveByPK($month_id);
$this->forward404Unless($title);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
$c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL);
$c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$this->sortStudent($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->filterStudent($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "counseling/listAbsenceByEmployeeAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "counseling/listAbsenceByEmployeeAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$bln1 = substr($academic_calendar->getStart(), 5, 2);
$bln2 = substr($academic_calendar->getEnd(), 5, 2);
$cw = new Criteria();
$cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL);
$cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL);
$cton1->addAnd($cton2);
$cw->add($cton1);
$months = MonthPeer::doSelect($cw);
$actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling/listByEmployee', 'color' => 'volcadot'));
foreach ($months as $month) {
if ($month->getId() == $title->getId()) {
array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sky', 'type' => 'direct'));
} else {
array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sun'));
}
}
$this->actions2 = $actions2;
$this->counseling = $counseling;
$this->title = $title;
$this->month = $title;
$this->judul = $title->getName();
$this->tahun = $academic_calendar->getYear();
$this->subtitle = 'Absensi Bulan ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $counseling->getClassGroup()->toString();
$this->employee_id = $employee_id;
$this->academic_calendar = $academic_calendar;
//.........这里部分代码省略.........
示例12: getJob
/**
* Get the associated Job object
*
* @param PropelPDO Optional Connection object.
* @return Job The associated Job object.
* @throws PropelException
*/
public function getJob(PropelPDO $con = null)
{
if ($this->aJob === null && $this->job_id !== null) {
$c = new Criteria(JobPeer::DATABASE_NAME);
$c->add(JobPeer::ID, $this->job_id);
$this->aJob = JobPeer::doSelectOne($c, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aJob->addJobPhotographers($this);
*/
}
return $this->aJob;
}
示例13: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$cw = new Criteria();
$cw->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($cw);
$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);
$c->addJoin(VEmployeePermitPeer::EMPLOYEE_ID, EmployeePeer::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(), 'emp_permit'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'emp_permit');
$pager = new sfPropelPager('VEmployeePermit', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'emp_permit'));
$this->getUser()->setAttribute('page', $page, 'emp_permit');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => 'Print Excel', 'url' => "employee_permit_recapt/listAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_permit_recapt/listAsPDF?{$filter_string}", 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$this->subtitle = '';
}
示例14: executeListStatus
public function executeListStatus()
{
$c = new Criteria();
$c->add(JobPeer::CODE, 'pmb_menu/listStatus');
$job = JobPeer::doSelectOne($c);
$cw = new Criteria();
$cw->add(JobInformationPeer::JOB_ID, $job->getId());
$job_information = JobInformationPeer::doSelectOne($cw);
$public_information = PublicInformationPeer::retrieveByPk($job_information->getPublicInformationId());
$job_category = JobCategoryPeer::retrieveByPk($job_information->getJobCategoryId());
$this->job = $job;
$this->job_information = $job_information;
$this->job_category = $job_category;
$this->public_information = $public_information;
}
示例15: executeEdit
public function executeEdit()
{
$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_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$this->transaction_status = TransactionStatusPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($this->transaction_status);
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
$this->subtitle = $this->transaction_status->toString() . ' - id:' . $this->transaction_status->getId();
$this->type = 'edit';
$this->actions = $actions;
$this->disabled = $this->transaction_status->getChildRecurs();
}