Пример #1
0
 protected function propertiesList($contact_id = null)
 {
     \PHPWS_Core::initModClass('properties', 'Property.php');
     $this->title = 'Property listing';
     $pager = new \DBPager('properties', 'Properties\\Property');
     if ($contact_id) {
         $pager->addWhere('contact_id', $contact_id);
         $data['is_contact'] = 1;
         $page_tags['new'] = \PHPWS_Text::moduleLink('<i class="fa fa-plus"></i> Add new property', 'properties', array('cop' => 'edit_property', 'k' => $this->contact->getKey()), null, null, 'btn btn-success');
     } else {
         $page_tags['new'] = \PHPWS_Text::secureLink('<i class="fa fa-plus"></i> Add new property', 'properties', array('aop' => 'edit_property'), null, null, 'btn btn-success');
     }
     // photo was previously uploaded
     if (!empty($_GET['pid'])) {
         $data['pid'] = $_GET['pid'];
     } else {
         $data['pid'] = 0;
     }
     javascriptMod('properties', 'photo_upload', $data);
     $pager->setSearch('name', 'company_name');
     $pager->addSortHeader('name', 'Name of property');
     $pager->addSortHeader('company_name', 'Management company');
     $pager->addSortHeader('timeout', 'Time until purge');
     $pager->setModule('properties');
     $pager->setTemplate('properties_list.tpl');
     $pager->addRowTags('row_tags', (bool) $contact_id);
     $pager->joinResult('contact_id', 'prop_contacts', 'id', 'company_name', null, true);
     $pager->addPageTags($page_tags);
     $pager->cacheQueries();
     $this->content = $pager->get();
 }
Пример #2
0
 public static function shortcuts()
 {
     if (!Current_User::allow('access')) {
         Current_User::disallow();
         return;
     }
     $modal = new Modal('access-shortcut', null, dgettext('access', 'Shortcuts'));
     $modal->sizeSmall();
     $button = '<button class="btn btn-success" id="save-shortcut">Save</button>';
     $modal->addButton($button);
     \Layout::add((string) $modal);
     javascript('jquery');
     \Layout::includeJavascript('mod/access/javascript/access.min.js');
     PHPWS_Core::initModClass('access', 'Shortcut.php');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('access_shortcuts', 'Access_Shortcut');
     $pager->setModule('access');
     $pager->setTemplate('forms/shortcut_list.tpl');
     $pager->setLink('index.php?module=access&amp;tab=shortcuts');
     $pager->addToggle('class="bgcolor1"');
     $pager->setSearch('keyword');
     $form = new PHPWS_Form('shortcut_list');
     $form->addHidden('module', 'access');
     $form->addHidden('command', 'post_shortcut_list');
     $options['none'] = '';
     if (Current_User::allow('access', 'admin_options')) {
         $options['active'] = dgettext('access', 'Activate');
         $options['deactive'] = dgettext('access', 'Deactivate');
     }
     $options['delete'] = dgettext('access', 'Delete');
     $form->addSelect('list_action', $options);
     $page_tags = $form->getTemplate();
     $page_tags['MENU_FIX'] = PHPWS_Text::secureLink(dgettext('access', 'Update menu links'), 'access', array('command' => 'menu_fix'));
     $page_tags['PAGE_FIX'] = PHPWS_Text::secureLink(dgettext('access', 'Shortcut all pages'), 'access', array('command' => 'page_fix'));
     if (PHPWS_Settings::get('access', 'forward_ids')) {
         $page_tags['PAGE_FORWARDING'] = PHPWS_Text::secureLink(dgettext('access', 'Turn OFF autoforwarding of Pagesmith id pages'), 'access', array('command' => 'autoforward_off'));
     } else {
         $page_tags['PAGE_FORWARDING'] = PHPWS_Text::secureLink(dgettext('access', 'Turn ON autoforwarding of Pagesmith id pages'), 'access', array('command' => 'autoforward_on'));
     }
     $page_tags['MENU_WARNING'] = dgettext('menu', 'This change is irreversable. Please backup menu_links prior to running it.');
     $page_tags['URL_LABEL'] = dgettext('access', 'Url');
     $page_tags['ACTIVE_LABEL'] = dgettext('access', 'Active?');
     $page_tags['ACTION_LABEL'] = dgettext('access', 'Action');
     $page_tags['CHECK_ALL_SHORTCUTS'] = javascript('check_all', array('checkbox_name' => 'shortcut[]'));
     $js_vars['value'] = dgettext('access', 'Go');
     $js_vars['select_id'] = $form->getId('list_action');
     $js_vars['action_match'] = 'delete';
     $js_vars['message'] = dgettext('access', 'Are you sure you want to delete the checked shortcuts?');
     $page_tags['SUBMIT'] = javascript('select_confirm', $js_vars);
     $pager->addPageTags($page_tags);
     $pager->addRowTags('rowTags');
     $content = $pager->get();
     return $content;
 }
Пример #3
0
 public function __construct(ReportController $reportCtrl)
 {
     parent::__construct('hms_report', 'GenericReport');
     $this->reportCtrl = $reportCtrl;
     $this->addWhere('report', $this->reportCtrl->getReportClassName());
     $this->addWhere('completed_timestamp', null, 'IS');
     $this->setOrder('scheduled_exec_time', 'ASC', true);
     $this->setModule('hms');
     $this->setTemplate('admin/reports/reportSchedulePager.tpl');
     $this->setLink('index.php?module=hms');
     $this->setEmptyMessage('No scheduled reports found.');
     $this->addRowTags('schedulePagerRowTags');
 }
Пример #4
0
 public function show()
 {
     $pager = new DBPager('hms_roommate', 'HMS_Roommate');
     $pager->db->addWhere('confirmed', 1);
     $pager->db->addWhere('term', Term::getSelectedTerm());
     $pager->setModule('hms');
     $pager->setTemplate('admin/roommate_pager.tpl');
     $pager->addRowTags('get_roommate_pager_tags');
     $pager->setEmptyMessage('No roommate groups found.');
     # Setup searching on the requestor and requestee columns
     $pager->setSearch('requestor', 'requestee');
     return $pager->get();
 }
 public static function doPager()
 {
     $pager = new \DBPager('intern_grad_prog', '\\Intern\\GradProgram');
     $pager->db->addOrder('name asc');
     $pager->setModule('intern');
     $pager->setTemplate('grad_pager.tpl');
     $pager->setEmptyMessage('No Graduate Programs Found.');
     $pager->addRowTags('getRowTags');
     return $pager->get();
 }
Пример #6
0
 public static function doPager()
 {
     $pager = new \DBPager('intern_department', 'Intern\\Department');
     $pager->db->addOrder('name asc');
     $pager->setModule('intern');
     $pager->setTemplate('department_pager.tpl');
     $pager->setEmptyMessage('No Departments Found.');
     $pager->addRowTags('getRowTags');
     return $pager->get();
 }
Пример #7
0
 public static function doPager()
 {
     $pager = new \DBPager('intern_major', '\\Intern\\Major');
     $pager->db->addOrder('name asc');
     $pager->setModule('intern');
     $pager->setTemplate('major_pager.tpl');
     $pager->setEmptyMessage('No Majors Found.');
     $pager->addRowTags('getRowTags');
     return $pager->get();
 }
Пример #8
0
 public function __construct(ReportController $reportCtrl)
 {
     parent::__construct('hms_report', 'GenericReport');
     $this->reportCtrl = $reportCtrl;
     $this->addWhere('report', $this->reportCtrl->getReportClassName());
     $this->addWhere('completed_timestamp', null, 'IS NOT');
     $this->setOrder('completed_timestamp', 'DESC', true);
     $this->setModule('hms');
     $this->setTemplate('admin/reports/reportHistoryPager.tpl');
     $this->setLink('index.php?module=hms');
     $this->setEmptyMessage('No previous reports found.');
     $this->addRowTags('historyPagerRowTags');
     // Increase this limit because, by default, the DBPager limit is too small
     $this->default_limit = 1000;
     $this->limitList = array(1000);
 }
Пример #9
0
 public static function doPager()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('intern', 'Major.php');
     $pager = new DBPager('intern_major', 'Major');
     $pager->db->addOrder('name asc');
     $pager->setModule('intern');
     $pager->setTemplate('major_pager.tpl');
     $pager->setEmptyMessage('No Majors Found.');
     $pager->addRowTags('getRowTags');
     return $pager->get();
 }
 public static function doPager()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('intern', 'GradProgram.php');
     $pager = new DBPager('intern_grad_prog', 'GradProgram');
     $pager->db->addOrder('name asc');
     $pager->setModule('intern');
     $pager->setTemplate('grad_pager.tpl');
     $pager->setEmptyMessage('No Graduate Programs Found.');
     $pager->addRowTags('getRowTags');
     return $pager->get();
 }
Пример #11
0
 public function show()
 {
     $pager = new DBPager('hms_learning_communities', 'HMS_Learning_Community');
     $pager->db->addOrder('community_name ASC');
     $pager->setModule('hms');
     $pager->setTemplate('admin/rlc_edit_list.tpl');
     $pager->addRowTags('rowTags');
     $addCmd = CommandFactory::getCommand('ShowAddRlc');
     $pageTags = array();
     $pageTags['ADD_LINK'] = $addCmd->getURI();
     $pager->addPageTags($pageTags);
     $this->setTitle('Edit Learning Communities');
     return $pager->get();
 }
Пример #12
0
 public function __construct(HMS_Learning_Community $rlc)
 {
     parent::__construct('hms_learning_community_applications', 'HMS_RLC_Application');
     $this->rlc = $rlc;
     $tags = array();
     $tags['TITLE'] = $this->rlc->get_community_name() . ' Assignments ' . Term::toString(Term::getSelectedTerm());
     $backCmd = CommandFactory::getCommand('ShowSearchByRlc');
     $tags['BACK_LINK'] = $backCmd->getURI();
     $adminAddCmd = CommandFactory::getCommand('ShowAdminAddRlcMember');
     $adminAddCmd->setCommunity($this->rlc);
     $tags['ADD_URI'] = $adminAddCmd->getURI();
     $this->db->addJoin('LEFT', 'hms_learning_community_assignment', 'hms_learning_community_applications', 'application_id', 'id');
     //$this->db->addJoin('LEFT OUTER', 'hms_learning_community_applications', 'hms_new_application', 'username', 'username AND hms_new_application.term=hms_learning_community_applications.term');
     //$this->db->addJoin('LEFT OUTER', 'hms_learning_community_applications', 'hms_roommate', 'username', 'requestor OR hms_learning_community_applications.username = hms_roommate.requestee AND hms_roommate.confirmed = \'1\'');
     $this->db->addWhere('hms_learning_community_applications.term', Term::getSelectedTerm());
     $this->db->addWhere('hms_learning_community_assignment.rlc_id', $this->rlc->get_id());
     $this->db->addColumn('hms_learning_community_applications.*');
     //$this->db->addColumn('hms_learning_community_assignment.*');
     //$this->db->addColumn('hms_roommate.*');
     $this->joinResult('username', 'hms_new_application', 'username AND dbp1.term=hms_learning_community_applications.term', 'student_type', 's_type');
     $this->joinResult('username', 'hms_roommate', 'requestee OR hms_learning_community_applications.username = dbp2.requestor', 'confirmed', 'conf');
     $this->joinResult('username', 'hms_assignment', 'asu_username AND dbp3.term = hms_learning_community_applications.term', 'bed_id', 'bed_assignment');
     $this->joinResult('id', 'hms_learning_community_assignment', 'application_id', 'gender');
     $this->joinResult('id', 'hms_learning_community_assignment', 'application_id', 'state');
     //$this->db->setTestMode();
     //var_dump($this->db->select());
     //exit;
     $this->setModule('hms');
     $this->setTemplate('admin/view_by_rlc_pager.tpl');
     $this->setLink('index.php?module=hms&action=ViewByRlc&rlc=' . $this->rlc->get_id());
     $this->setEmptyMessage('There are no students assigned to this learning community.');
     $this->addPageTags($tags);
     $this->addRowTags('viewByRLCPagerTags');
     $this->setReportRow('viewByRLCExportFields');
     //$this->get();
     //$this->initialize();
     //var_dump($this->row_query);exit;
     //var_dump($this->getFinalTemplate());
     //exit();
 }
Пример #13
0
 /**
  * Waiting List pager for On-campus Waiting List
  * @return string HTML for pager
  */
 public static function waitingListPager()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     $pager = new DBPager('hms_new_application', 'LotteryApplication');
     $pager->db->addColumn('hms_new_application.*');
     $pager->db->addColumn('hms_lottery_application.*');
     $pager->db->addJoin('LEFT', 'hms_new_application', 'hms_lottery_application', 'id', 'id');
     $pager->db->addJoin('LEFT OUTER', 'hms_new_application', 'hms_assignment', 'username', 'asu_username AND hms_new_application.term = hms_assignment.term');
     $pager->db->addWhere('hms_assignment.asu_username', 'NULL');
     $pager->db->addWhere('hms_new_application.term', $term);
     $pager->db->addWhere('hms_new_application.cancelled', 0);
     $pager->db->addWhere('hms_lottery_application.special_interest', 'NULL');
     $pager->db->addWhere('hms_lottery_application.waiting_list_date', 'NULL', '!=');
     // Order by class, then by application ID in order to keep a fixed order
     // This accounts for the 'you are x of y students' message on the student's menu
     $pager->db->addOrder(array('application_term DESC', 'hms_new_application.id ASC'));
     $pager->setModule('hms');
     $pager->setTemplate('admin/lottery_wait_list_pager.tpl');
     $pager->setEmptyMessage('No students found.');
     $pager->addPageTags(array('TITLE' => 'Re-application Waiting List - ' . Term::toString($term)));
     $pager->addRowTags('waitingListTags');
     $pager->setReportRow('waitingListCsvTags');
     $pager->setSearch('hms_new_application.username', 'hms_new_application.banner_id');
     return $pager->get();
 }
Пример #14
0
 public static function blockList()
 {
     Layout::addStyle('block');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pageTags['NEW_BLOCK'] = PHPWS_Text::secureLink(dgettext('block', 'Create new block'), 'block', array('action' => 'new'), null, dgettext('block', 'Create new block'), 'button');
     $pageTags['NEW_BLOCK_URI'] = PHPWS_Text::linkAddress('block', array('action' => 'new'), true);
     $pageTags['CONTENT'] = dgettext('block', 'Content');
     $pageTags['ACTION'] = dgettext('block', 'Action');
     $pager = new DBPager('block', 'Block_Item');
     $pager->setModule('block');
     $pager->setTemplate('list.tpl');
     $pager->addToggle('class="bgcolor1"');
     $pager->addPageTags($pageTags);
     $pager->addRowTags('getTpl');
     $pager->addSortHeader('title', dgettext('block', 'Title'));
     $content = $pager->get();
     return $content;
 }
Пример #15
0
 /**
  * *******************
  * Static UI Methods *
  * *******************
  */
 public static function bed_pager_by_room($room_id)
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('hms_bed', 'HMS_Bed');
     $pager->db->addJoin('LEFT OUTER', 'hms_bed', 'hms_room', 'room_id', 'id');
     $pager->addWhere('hms_room.id', $room_id);
     $pager->db->addOrder('hms_bed.bedroom_label');
     $pager->db->addOrder('hms_bed.bed_letter');
     $page_tags = array();
     $page_tags['BEDROOM_LABEL'] = 'Bedroom';
     $page_tags['BED_LETTER_LABEL'] = 'Bed';
     $page_tags['ASSIGNED_TO_LABEL'] = 'Assigned to';
     $page_tags['RA_LABEL'] = 'RA Roommate bed';
     $pager->setDefaultLimit(50);
     if (Current_User::allow('hms', 'bed_structure') && UserStatus::isAdmin()) {
         $addBedCmd = CommandFactory::getCommand('ShowAddBed');
         $addBedCmd->setRoomId($room_id);
         $page_tags['ADD_BED_URI'] = $addBedCmd->getURI();
     }
     $pager->setModule('hms');
     $pager->setTemplate('admin/bed_pager_by_room.tpl');
     $pager->setLink('index.php?module=hms');
     $pager->setEmptyMessage("No beds found.");
     $pager->addRowTags('getPagerByRoomTags');
     $pager->addPageTags($page_tags);
     return $pager->get();
 }
Пример #16
0
 /**
  * Lists the branches on the system
  */
 public function listBranches()
 {
     $page_tags['BRANCH_NAME_LABEL'] = dgettext('branch', 'Branch name');
     $page_tags['DIRECTORY_LABEL'] = dgettext('branch', 'Directory');
     $page_tags['URL_LABEL'] = dgettext('branch', 'Url');
     $page_tags['ACTION_LABEL'] = dgettext('branch', 'Action');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('branch_sites', 'Branch');
     $pager->setModule('branch');
     $pager->setTemplate('branch_list.tpl');
     $pager->addPageTags($page_tags);
     $pager->addToggle('class="toggle1"');
     $pager->addRowTags('getTpl');
     $pager->setSearch('branch_name');
     $this->title = dgettext('branch', 'Branch List');
     $this->content = $pager->get();
 }
Пример #17
0
 public static function denied_pager()
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('hms_learning_community_applications', 'HMS_RLC_Application');
     $pager->db->addWhere('term', Term::getSelectedTerm());
     $pager->db->addWhere('denied', 1);
     // show only denied applications
     $pager->db->addColumn('hms_learning_community_applications.*');
     $pager->db->addColumn('hms_learning_communities.abbreviation');
     $pager->db->addWhere('hms_learning_community_applications.rlc_first_choice_id', 'hms_learning_communities.id', '=');
     $pager->setModule('hms');
     $pager->setTemplate('admin/denied_rlc_app_pager.tpl');
     $pager->setEmptyMessage("No denied RLC applications exist.");
     $pager->addRowTags('getDeniedPagerTags');
     return $pager->get();
 }
Пример #18
0
 public function scheduleListing()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('calendar', 'Schedule.php');
     require_once PHPWS_SOURCE_DIR . 'mod/calendar/class/Event.php';
     self::includeScheduleJS();
     self::includeEventJS();
     $schedule = new Calendar_Schedule();
     $schedule->id = 1;
     $this->title = dgettext('calendar', 'Schedules');
     $event = new Calendar_Event(0, $schedule);
     $page_tags['EVENT_FORM'] = self::eventModal($event);
     $page_tags['DESCRIPTION_LABEL'] = dgettext('calendar', 'Description');
     $page_tags['PUBLIC_LABEL'] = dgettext('calendar', 'Public');
     $page_tags['DISPLAY_NAME_LABEL'] = dgettext('calendar', 'User');
     $page_tags['AVAILABILITY_LABEL'] = dgettext('calendar', 'Availability');
     $page_tags['ADD_CALENDAR'] = '<button id="create-schedule" class="btn btn-success"><i class="fa fa-file-text"></i> ' . dgettext('calendar', 'Create schedule') . '</button>';
     $schedule_form = $this->calendar->schedule->form();
     $schedule_modal = new \Modal('schedule-modal', $schedule_form, 'Create schedule');
     $schedule_modal->sizeLarge();
     $page_tags['SCHEDULE_FORM'] = $schedule_modal->__toString();
     $page_tags['ADMIN_LABEL'] = dgettext('calendar', 'Options');
     $pager = new DBPager('calendar_schedule', 'Calendar_Schedule');
     $pager->setModule('calendar');
     $pager->setTemplate('admin/schedules.tpl');
     $pager->addPageTags($page_tags);
     $pager->addRowTags('rowTags');
     $pager->addToggle('class="bgcolor1"');
     $pager->setEmptyMessage(dgettext('calendar', 'No schedules have been created.'));
     $pager->addSortHeader('title', dgettext('calendar', 'Title'));
     $pager->addSortHeader('public', dgettext('calendar', 'Availability'));
     $pager->db->addWhere('user_id', 0);
     $pager->db->addWhere('user_id', 'users.id', '=', 'or');
     $pager->db->addColumn('*');
     $pager->db->addColumn('users.display_name');
     $pager->db->addJoin('left', 'calendar_schedule', 'users', 'user_id', 'id');
     $pager->initialize();
     $this->content = $pager->get();
 }
Пример #19
0
 public static function getAdminPager()
 {
     $pager = new \DBPager('intern_admin', '\\Intern\\Admin');
     $pager->setModule('intern');
     $pager->setTemplate('admin_pager.tpl');
     $pager->setEmptyMessage('No admins found.');
     $pager->addRowTags('rowTags');
     $pager->joinResult('department_id', 'intern_department', 'id', 'name', 'department_name');
     //$pager->db->setTestMode();
     // Set a default order
     if (!isset($_REQUEST['orderby'])) {
         $pager->setOrder('department_name');
     }
     /***** Row Background Color Toggles ******/
     $pager->addToggle('tablerow-bg-color1');
     $pager->addToggle('tablerow-bg-color2');
     // Search
     $pager->setSearch('username');
     return $pager->get();
 }
Пример #20
0
 public static function listTrackers()
 {
     PHPWS_Core::initModClass('analytics', 'GenericTracker.php');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('analytics_tracker', 'GenericTracker');
     $pager->addSortHeader('name', dgettext('analytics', 'Name'));
     $pager->addSortHeader('type', dgettext('analytics', 'Type'));
     $pager->addSortHeader('active', dgettext('analytics', 'Active'));
     $pageTags = array();
     $pageTags['ACTION'] = dgettext('analytics', 'Action');
     $pageTags['ACCOUNT'] = dgettext('analytics', 'Account ID');
     $pager->setModule('analytics');
     $pager->setTemplate('list.tpl');
     $pager->addToggle('class="toggle1"');
     $pager->addRowTags('getPagerTags');
     $pager->addPageTags($pageTags);
     $pager->setSearch('name');
     $pager->setDefaultOrder('name', 'asc');
     $pager->cacheQueries();
     return $pager->get();
 }
Пример #21
0
 public static function get_movein_times_pager()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('hms_movein_time', 'HMS_Movein_Time');
     $pager->addWhere('term', Term::getSelectedTerm());
     $pager->db->addOrder('begin_timestamp', 'DESC');
     $pager_tags = array();
     $pager_tags['BEGIN_TIMESTAMP_LABEL'] = 'Begin Date & Time';
     $pager_tags['END_TIMESTAMP_LABEL'] = 'End Date & Time';
     $pager_tags['ACTION_LABEL'] = 'Action';
     $pager->setModule('hms');
     $pager->setTemplate('admin/movein_time_pager.tpl');
     $pager->setLink('index.php?module=hms');
     $pager->setEmptyMessage("No move-in times found.");
     $pager->addRowTags('getRowTags');
     $pager->addPageTags($pager_tags);
     return $pager->get();
 }
Пример #22
0
 public function listSignup()
 {
     $ptags['TITLE_HEADER'] = dgettext('signup', 'Title');
     $ptags['START_TIME_HEADER'] = dgettext('signup', 'Start Time');
     $ptags['END_TIME_HEADER'] = dgettext('signup', 'End Time');
     PHPWS_Core::initModClass('signup', 'Sheet.php');
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('signup_sheet', 'Signup_Sheet');
     $pager->setModule('signup');
     $pager->setTemplate('sheet_list.tpl');
     $pager->addRowTags('rowTag');
     $pager->addPageTags($ptags);
     Key::restrictEdit($pager->db, 'signup', 'edit_sheet');
     $this->signup->content = $pager->get();
     $this->signup->title = dgettext('signup', 'Signup Sheets');
 }
Пример #23
0
 /**
  * Recent Changes
  *
  * @author Greg Meiste <*****@*****.**>
  */
 function recentChanges()
 {
     PHPWS_Core::initModClass('wiki', 'OldWikiPage.php');
     PHPWS_Core::initCoreClass('DBPager.php');
     $tags['BACK'] = PHPWS_Text::moduleLink(dgettext('wiki', 'Back to Wiki'), 'wiki');
     $tags['PAGE'] = dgettext('wiki', 'Page Name');
     $tags['UPDATED'] = dgettext('wiki', 'Updated');
     $tags['EDITOR'] = dgettext('wiki', 'Editor');
     $tags['COMMENT'] = dgettext('wiki', 'Comment');
     $tags['VIEW'] = dgettext('wiki', 'View');
     $pager = new DBPager('wiki_pages_version', 'OldWikiPage');
     $pager->setModule('wiki');
     $pager->setTemplate('recentchanges/list.tpl');
     $pager->addToggle(PHPWS_LIST_TOGGLE_CLASS);
     $pager->addPageTags($tags);
     $pager->addRowTags('getRecentChangesTpl');
     $pager->setSearch('pagetext', 'comment');
     $pager->setDefaultOrder('id', 'desc');
     $pager->setLimitList(array(10, 25, 50, 75, 100));
     return $pager->get();
 }
 /**
  * Sets up the pager object for searching questionnairs.
  *
  * @return String HTML output
  */
 public static function profile_search_pager($term)
 {
     // get the current student's gender
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), Term::getCurrentTerm());
     $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $student->getApplicationTerm());
     $gender = $student->getGender();
     PHPWS_Core::initCoreClass('DBPager.php');
     $pageTags = array();
     $pageTags['USERNAME'] = _('Email');
     $pageTags['FIRST_NAME'] = _('First Name');
     $pageTags['LAST_NAME'] = _('Last Name');
     $pageTags['ACTIONS'] = _('Action');
     $pager = new DBPager('hms_student_profiles', 'RoommateProfile');
     $pager->db->addWhere('term', $term);
     // Check to see if user is assigned to an RLC
     $rlc_assignment = HMS_RLC_Assignment::checkForAssignment($student->getUsername(), $student->getApplicationTerm());
     if ($rlc_assignment != false) {
         // User is assigned to an RLC, only show results from other students in the same RLC
         $pager->db->addJoin('LEFT OUTER', 'hms_student_profiles', 'hms_learning_community_applications', 'username', 'username');
         $pager->db->addJoin('LEFT OUTER', 'hms_learning_community_assignment', 'hms_learning_community_applications', 'application_id', 'id');
         $pager->db->addWhere('hms_learning_community_assignment.rlc_id', $rlc_assignment['rlc_id']);
         // $pager->db->setTestMode();
     }
     // If an ASU username was entered, just use that. Otherwise, use the rest of the fields.
     if (isset($_REQUEST['asu_username']) && $_REQUEST['asu_username'] != '') {
         $pager->addWhere('hms_student_profiles.username', $_REQUEST['asu_username'], 'ILIKE');
         $_SESSION['profile_search_asu_username'] = $_REQUEST['asu_username'];
     } else {
         $m = new RoommateProfile();
         $hobbiesCount = count($m->hobbies_array);
         // Hobby check boxes
         for ($x = 0; $x < $hobbiesCount; $x++) {
             if (isset($_REQUEST['hobbies_checkbox'][$m->hobbies_array[$x]])) {
                 $pager->addWhere('hms_student_profiles.' . $m->hobbies_array[$x], 1, '=');
                 $_SESSION['hobbies_checkbox'][$m->hobbies_array[$x]] = 1;
             }
         }
         $musicCount = count($m->music_array);
         // Music check boxes
         for ($x = 0; $x < $musicCount; $x++) {
             if (isset($_REQUEST['music_checkbox'][$m->music_array[$x]])) {
                 $pager->addWhere('hms_student_profiles.' . $m->music_array[$x], 1, '=');
                 $_SESSION['hobbies_checkbox'][$m->music_array[$x]] = 1;
             }
         }
         $studyCount = count($m->study_array);
         // Study times
         for ($x = 0; $x < $studyCount; $x++) {
             if (isset($_REQUEST['study_times'][$m->study_array[$x]])) {
                 $pager->addWhere('hms_student_profiles.' . $m->study_array[$x], 1, '=');
                 $_SESSION['study_times'][$m->study_array[$x]] = 1;
             }
         }
         $dropDownCount = count($m->drop_down_array);
         // Drop downs
         for ($x = 0; $x < $dropDownCount; $x++) {
             if (isset($_REQUEST[$m->drop_down_array[$x]]) && $_REQUEST[$m->drop_down_array[$x]] != 0) {
                 $pager->addWhere('hms_student_profiles.' . $m->drop_down_array[$x], $_REQUEST[$m->drop_down_array[$x]], '=');
                 $_SESSION[$m->drop_down_array[$x]] = $_REQUEST[$m->drop_down_array[$x]];
             }
         }
         $langCount = count($m->lang_array);
         // Spoken Languages
         for ($x = 0; $x < $langCount; $x++) {
             if (isset($_REQUEST['language_checkbox'][$m->lang_array[$x]])) {
                 $pager->addWhere('hms_student_profiles.' . $m->lang_array[$x], 1, '=');
                 $_SESSION['language_checkbox'][$m->lang_array[$x]] = 1;
             }
         }
     }
     // Join with hms_application table on username to make sure genders match.
     $pager->db->addJoin('LEFT OUTER', 'hms_student_profiles', 'hms_new_application', 'username', 'username');
     // $pager->addWhere('hms_student_profiles.user_id','hms_application.asu_username','ILIKE');
     $pager->addWhere('hms_new_application.gender', $gender, '=');
     // Don't list the current user as a match
     $pager->addWhere('hms_student_profiles.username', UserStatus::getUsername(), 'NOT LIKE');
     $pager->db->addOrder('username', 'ASC');
     $pager->setModule('hms');
     $pager->setTemplate('student/profile_search_pager.tpl');
     $pager->setLink('index.php?module=hms');
     $pager->setEmptyMessage("No matches found. Try broadening your search by selecting fewer criteria.");
     $pager->addRowTags('getPagerTags');
     $pager->addPageTags($pageTags);
     return $pager->get();
 }
Пример #25
0
 public static function import()
 {
     PHPWS_Core::requireConfig('rss');
     if (!ini_get('allow_url_fopen')) {
         $tpl['TITLE'] = dgettext('rss', 'Sorry');
         $tpl['CONTENT'] = dgettext('rss', 'You must enable allow_url_fopen in your php.ini file.');
         return $tpl;
     }
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('rss', 'Feed.php');
     $content = NULL;
     $vars['address'] = 'index.php?module=rss&command=add_feed';
     $vars['label'] = dgettext('rss', 'Add feed');
     $vars['width'] = '450';
     $vars['height'] = '350';
     $template['ADD_LINK'] = javascript('open_window', $vars);
     $template['TITLE_LABEL'] = dgettext('rss', 'Title');
     $template['ADDRESS_LABEL'] = dgettext('rss', 'Address');
     $template['DISPLAY_LABEL'] = dgettext('rss', 'Display?');
     $template['ACTION_LABEL'] = dgettext('rss', 'Action');
     $template['REFRESH_TIME_LABEL'] = dgettext('rss', 'Refresh feed');
     $pager = new DBPager('rss_feeds', 'RSS_Feed');
     $pager->setModule('rss');
     $pager->setTemplate('admin_feeds.tpl');
     $pager->addPageTags($template);
     $pager->addRowTags('pagerTags');
     $content = $pager->get();
     $tpl['TITLE'] = dgettext('rss', 'Import RSS Feeds');
     $tpl['CONTENT'] = $content;
     if (!defined('ALLOW_CACHE_LITE') || !ALLOW_CACHE_LITE) {
         $tpl['MESSAGE'] = dgettext('rss', 'Please enable Cache Lite in your config/core/config.php file.');
     }
     return $tpl;
 }
Пример #26
0
 private function viewReported()
 {
     javascriptMod('properties', 'report');
     javascript('confirm');
     \PHPWS_Core::initModClass('properties', 'Report.php');
     $this->title = 'Reported messages';
     $pager = new \DBPager('prop_report', 'Properties\\Report');
     if (!isset($_SESSION['prop_show_blocked'])) {
         $vars['aop'] = 'show_blocked';
         $tags['BLOCKED'] = \PHPWS_Text::secureLink('Show blocked', 'properties', $vars, null, null, 'btn btn-default');
         $pager->db->addWhere('prop_report.block', 0);
     } else {
         $vars['aop'] = 'hide_blocked';
         $tags['BLOCKED'] = \PHPWS_Text::secureLink('Hide blocked', 'properties', $vars, null, null, 'btn btn-default');
     }
     $pager->addPageTags($tags);
     $pager->addSortHeader('date_sent', 'Date reported');
     $pager->joinResult('message_id', 'prop_messages', 'id', 'body', 'message');
     $pager->db->addJoin('left', 'prop_report', 'prop_messages', 'message_id', 'id');
     $pager->setModule('properties');
     $pager->setTemplate('reported_list.tpl');
     $pager->addRowTags('row');
     $this->content = $pager->get();
 }
 /**
  * Returns the content of the the pager object
  */
 public function get($return_blank_results = true)
 {
     $template = array();
     if (empty($this->display_rows)) {
         $result = $this->initialize();
         if (PHPWS_Error::isError($result)) {
             throw new \Exception($result->toString());
             return $result;
         }
     }
     // Report ends the function call
     if ($this->report_type && $this->report_row) {
         $this->createReport();
         exit;
     }
     if (!isset($this->module)) {
         return PHPWS_Error::get(DBPAGER_MODULE_NOT_SET, 'core', 'DBPager::get');
     }
     if (!isset($this->template)) {
         return PHPWS_Error::get(DBPAGER_TEMPLATE_NOT_SET, 'core', 'DBPager::get');
     }
     $rows = $this->getPageRows();
     if (PHPWS_Error::isError($rows)) {
         throw new Exception($rows);
         return $rows;
     }
     if (isset($this->toggles)) {
         $max_tog = count($this->toggles);
     }
     $count = 0;
     $this->getNavigation($template);
     $this->getSortButtons($template);
     if (isset($rows)) {
         foreach ($rows as $rowitem) {
             if (isset($max_tog)) {
                 if ($max_tog == 1) {
                     if ($count % 2) {
                         $rowitem['TOGGLE'] = $this->toggles[0];
                     } else {
                         $rowitem['TOGGLE'] = null;
                     }
                     $count++;
                 } else {
                     $rowitem['TOGGLE'] = $this->toggles[$count];
                     $count++;
                     if ($count >= $max_tog) {
                         $count = 0;
                     }
                 }
             } else {
                 $rowitem['TOGGLE'] = null;
             }
             $template['listrows'][] = $rowitem;
         }
     } elseif (!$return_blank_results) {
         return null;
     } else {
         $template['EMPTY_MESSAGE'] = $this->empty_message;
     }
     DBPager::plugPageTags($template);
     $this->final_template =& $template;
     return PHPWS_Template::process($template, $this->module, $this->template);
 }
Пример #28
0
 public static function manageGroups()
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     Layout::addStyle('users');
     $pageTags['MEMBERS_LABEL'] = dgettext('users', 'Members');
     $pageTags['ACTIONS_LABEL'] = dgettext('users', 'Actions');
     $pageTags['NEW_GROUP'] = PHPWS_Text::secureLink(dgettext('users', 'Create new group'), 'users', array('action' => 'admin', 'command' => 'new_group'), null, dgettext('users', 'Create new group'), 'btn btn-success');
     $pageTags['ADD_GROUP_URI'] = PHPWS_Text::linkAddress('users', array('action' => 'admin', 'command' => 'new_group'));
     $pager = new DBPager('users_groups', 'PHPWS_Group');
     $pager->setModule('users');
     $pager->setTemplate('manager/groups.tpl');
     $pager->setLink('index.php?module=users&amp;action=admin&amp;tab=manage_groups&amp;authkey=' . Current_User::getAuthKey());
     // If no order was set, then set it to default by user name
     if (!isset($pager->orderby)) {
         $pager->orderby = 'name';
         $pager->orderby_dir = 'asc';
     }
     $pager->addPageTags($pageTags);
     $pager->addRowTags('getTplTags');
     $pager->addToggle('class="toggle1"');
     $pager->addToggle('class="toggle2"');
     $pager->addSortHeader('name', dgettext('users', 'Group Name'));
     $pager->addWhere('user_id', 0);
     $pager->setSearch('name');
     $pager->cacheQueries();
     return $pager->get();
 }
Пример #29
0
 public static function import()
 {
     $source_http = PHPWS_SOURCE_HTTP;
     $script = "<script src='{$source_http}mod/rss/javascript/feed.js'></script>";
     javascript('jquery');
     \Layout::addJSHeader($script);
     PHPWS_Core::requireConfig('rss');
     if (!ini_get('allow_url_fopen')) {
         $tpl['TITLE'] = dgettext('rss', 'Sorry');
         $tpl['CONTENT'] = dgettext('rss', 'You must enable allow_url_fopen in your php.ini file.');
         return $tpl;
     }
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('rss', 'Feed.php');
     $content = NULL;
     $template['ADD_LINK'] = '<button class="btn btn-success edit-feed"><i></i> Add Feed</button>';
     /*
      $vars['address'] = 'index.php?module=rss&command=add_feed';
      $vars['label'] = dgettext('rss', 'Add feed');
      $vars['width'] = '450';
      $vars['height'] = '350';
      $template['ADD_LINK'] = javascript('open_window', $vars);
     * 
     */
     $template['TITLE_LABEL'] = dgettext('rss', 'Title');
     $template['ADDRESS_LABEL'] = dgettext('rss', 'Address');
     $template['DISPLAY_LABEL'] = dgettext('rss', 'Display?');
     $template['ACTION_LABEL'] = dgettext('rss', 'Action');
     $template['REFRESH_TIME_LABEL'] = dgettext('rss', 'Refresh feed');
     $modal = new \Modal('rss-modal');
     $modal->addButton('<button class="btn btn-primary" id="save-feed"><i class="fa fa-save"></i> Save</button>');
     $modal_content = RSS_Admin::editFeed();
     $modal->setContent($modal_content);
     $modal->setTitle('Edit feed');
     $modal->setWidthPixel('400');
     $template['MODAL'] = $modal->get();
     $pager = new DBPager('rss_feeds', 'RSS_Feed');
     $pager->setModule('rss');
     $pager->setTemplate('admin_feeds.tpl');
     $pager->addPageTags($template);
     $pager->addRowTags('pagerTags');
     $content = $pager->get();
     $tpl['TITLE'] = dgettext('rss', 'Import RSS Feeds');
     $tpl['CONTENT'] = $content;
     if (!defined('ALLOW_CACHE_LITE') || !ALLOW_CACHE_LITE) {
         $tpl['MESSAGE'] = dgettext('rss', 'Please enable Cache Lite in your config/core/config.php file.');
     }
     return $tpl;
 }
Пример #30
0
 public static function get_pager_by_hall($hall_id)
 {
     PHPWS_Core::initCoreClass('DBPager.php');
     $pager = new DBPager('hms_floor', 'HMS_Floor');
     $pager->addWhere('hms_floor.residence_hall_id', $hall_id);
     $pager->db->addOrder('hms_floor.floor_number');
     $pager->setModule('hms');
     $pager->setTemplate('admin/floor_pager_by_hall.tpl');
     $pager->setLink('index.php?module=hms');
     $pager->setEmptyMessage("No floors found.");
     $pager->addRowTags('get_pager_by_hall_tags');
     return $pager->get();
 }