function printView() { ?> <form method="post" id="add-family"> <input type="hidden" name="new_person_submitted" value="1" /> <input type="hidden" name="familyid" value="<?php echo ents($_REQUEST['familyid']); ?> " /> <h3>New Person Details</h3> <?php $this->_person->printForm(); if ($chooser = Action_Plan::getMultiChooser('execute_plan', 'add_person')) { ?> <h3>Action Plans</h3> <p>Execute the following action plans for the new person:</p> <?php echo $chooser; ?> <p>Reference date for plans: <?php print_widget('plan_reference_date', array('type' => 'date'), NULL); ?> </p> <?php } ?> <button type="submit" class="btn">Add Family Member</button> <a href="<?php echo build_url(array('view' => 'families')); ?> " class="btn">Cancel</a> </form> <?php }
function _printParams() { ?> <form method="get" style="line-height: 200%" class="well well-small form-inline"> <input type="hidden" name="view" value="<?php echo $_REQUEST['view']; ?> " /> <?php echo _('Show the attendance statistics for persons of each (current) status'); ?> <br /> <?php echo _('between'); ?> <?php print_widget('start_date', array('type' => 'date'), $this->_start_date); ?> <?php echo _('and'); ?> <?php print_widget('end_date', array('type' => 'date'), $this->_end_date); ?> <input type="submit" class="btn" value="Go" /> <p class="smallprint"><?php echo _('Note: Any weeks where a person attendance is left blank (neither present nor absent) are ignored when calculating attendance percentages.'); ?> </p> </form> <?php }
function _printParams() { ?> <form method="get" style="line-height: 200%" class="well"> <input type="hidden" name="view" value="<?php echo $_REQUEST['view']; ?> " /> Show the average congregational attendance rate of persons of each status<br /> between <?php print_widget('start_date', array('type' => 'date'), $this->_start_date); ?> and <?php print_widget('end_date', array('type' => 'date'), $this->_end_date); ?> <table> <tr> <td>for members of </td> <td><?php print_widget('congregations', array('type' => 'reference', 'references' => 'congregation', 'allow_multiple' => TRUE), $this->_congregations); ?> </td> </tr> </table> <input type="submit" class="btn" value="Go" /> <p class="smallprint">Note: Any weeks where a person's attendance is left blank (neither present nor absent) are ignored when calculating attendance percentages</p> </form> <?php }
function printView() { ?> <form class="well well-small form-inline"> <input type="hidden" name="view" value="<?php echo $_REQUEST['view']; ?> " /> <?php echo _('Show notes assigned to '); print_widget('assignee', array('type' => 'reference', 'references' => 'staff_member', 'allow_empty' => true, 'empty_text' => 'Anyone', 'filter' => create_function('$x', 'return $x->getValue("active") && (($x->getValue("permissions") & PERM_EDITNOTE) == PERM_EDITNOTE);')), array_get($_REQUEST, 'assignee')); ?> <button type="submit" class="btn"><?php echo _('Go'); ?> </button> </form> <?php $reassigning = $this->_reassigning; if (empty($this->_notes)) { ?> <p><i><?php echo _('There are no notes to show'); ?> </i></p> <?php } else { if (!$reassigning && $GLOBALS['user_system']->havePerm(PERM_BULKNOTE)) { ?> <p class="pull-right"> <a href="<?php echo build_url(array('reassigning' => 1)); ?> "> <i class="icon-wrench""></i> <?php echo _('Edit the assignees for all these notes'); ?> </a> </p> <?php } ?> <p><b><?php echo sprintf(_('%s notes in total'), count($this->_notes)); ?> </b></p> <?php $notes =& $this->_notes; include 'templates/list_notes_assorted.template.php'; } }
function printFieldInterface($name, $prefix = '') { if ($name == 'action_date') { ?> <div class="preserve-value"> <span class="radio-list"> <input type="radio" name="<?php echo $prefix; ?> action_date_type" value="fixed" <?php if ($this->getValue('action_date_type') == 'fixed') { echo 'checked="checked"'; } ?> > <?php echo print_widget($prefix . $name, array('type' => 'date'), $this->getValue('action_date')); ?> </span> <br /> <span class="radio-list"> <input type="radio" name="<?php echo $prefix; ?> action_date_type" value="relative" <?php if ($this->getValue('action_date_type') == 'relative') { echo 'checked="checked"'; } ?> > <?php $this->printFieldInterface('action_date_offset', $prefix); ?> days <?php $this->printFieldInterface('action_date_operator', $prefix); ?> the reference date </span> </div> <?php } else { return parent::printFieldInterface($name, $prefix); } }
function printView() { $attendances = $this->_person->getAttendance($_REQUEST['startdate'], $_REQUEST['enddate'], $_REQUEST['groupid']); $map = array(1 => 'present', '0' => 'absent', '' => 'unknown'); ?> <form method="post"> <table class="table table-bordered table-condensed table-auto-width"> <thead> <tr> <?php foreach ($attendances as $att) { ?> <th> <?php echo format_date($att['date'], FALSE); ?> </th> <?php } ?> </tr> </thead> <tbody> <tr> <?php foreach ($attendances as $att) { ?> <td> <?php print_widget('attendances[' . $att['date'] . ']', array('options' => array('present' => 'Present', 'unknown' => '?', 'absent' => 'Absent'), 'type' => 'select', 'style' => 'colour-buttons', 'class' => 'vertical'), $map[$att['present']]); ?> </td> <?php } ?> </tr> </tbody> </table> <input type="submit" class="btn" value="Save" /> <a class="btn" href="?view=persons&personid=<?php echo $this->_person->id; ?> #attendance">Cancel</a> </form> <?php }
function printFieldInterface($name, $prefix = '') { switch ($name) { case 'password': if ($GLOBALS['user_system']->getCurrentUser('id') == $this->id || $GLOBALS['user_system']->havePerm(PERM_SYSADMIN)) { ?> <input type="password" data-minlength="<?php echo (int) $this->getMinPasswordLength(); ?> " autocomplete="off" name="<?php echo $prefix . $name . '1'; ?> " /><br /> <input type="password" data-minlength="<?php echo (int) $this->getMinPasswordLength(); ?> " autocomplete="off" name="<?php echo $prefix . $name . '2'; ?> " /><br /> <p class="help-inline">Enter once, then again to confirm. Passwords must be at least <?php echo (int) $this->getMinPasswordLength(); ?> characters and contain 2 letters and 2 numbers</p> <?php } else { ?> <p class="small">A user's password can only be edited by system administrators or the user themselves</p> <?php } break; case 'restrictions': $GLOBALS['system']->includeDBClass('person_group'); if ($GLOBALS['user_system']->havePerm(PERM_SYSADMIN)) { ?> <table class="standard"> <tr> <th>Restrict to these congregations: </th> <th>Restrict to these groups:</th> </tr> <tr> <td> <?php print_widget('restrictions[congregation]', array('type' => 'reference', 'references' => 'congregation', 'allow_multiple' => true), array_get($this->_restrictions, 'congregation', array())); ?> </td> <td> <?php Person_Group::printMultiChooser('restrictions[group]', array_get($this->_restrictions, 'group', array()), array(), FALSE); ?> </td> </tr> </table> <p class="help-inline">If you select congregations or groups here, this user will only be able to see persons who belong to one of the selected congregations or groups. It will look like those are the only congregations, groups and persons in the system. Users with congregation or group restrictions cannot add new persons or families. Changes to restrictions take effect immediately.</p> <?php } else { $this->printFieldValue($name); ?> <p class="help-inline">Only system administrators can edit this field</p> <?php } break; case 'permissions': if ($name == 'permissions') { // Subtly display the numeric permission level to help with config.php ?> <div title="This number represents this combination of permissions, and can be used to set the default permissions in the config file" style="color: #ccc; position: absolute; right: 10px; padding: 3px"><?php echo $this->getValue($name); ?> </div> <?php } if ($GLOBALS['user_system']->havePerm(PERM_SYSADMIN)) { parent::printFieldInterface($name, $prefix); ?> <p class="help-inline"><b>Note:</b> Changes to permissions only take effect the next time a user logs in</p> <?php } else { $this->printFieldValue($name); ?> <p class="help-inline">Only system administrators can edit this field</p> <?php } break; default: parent::printFieldInterface($name, $prefix); } }
function _printParams() { $views = $GLOBALS['system']->getDBObjectData('roster_view', array()); if (empty($views)) { print_message("You need to set up some roster views before you can display or edit roster assignments", 'failure'); return; } $viewid = $this->_view ? $this->_view->id : null; ?> <form method="get" class="well well-small no-print"> <input type="hidden" name="view" value="<?php echo ents($_REQUEST['view']); ?> " /> <table> <tr> <th>Roster view</th> <td> <?php print_widget('viewid', array('type' => 'reference', 'references' => 'roster_view', 'order_by' => 'name'), $viewid); ?> </td> <td></td> </tr> <tr> <th class="right">between</th> <td><?php print_widget('start_date', array('type' => 'date'), $this->_start_date); ?> </td> <td></td> </tr> <tr> <th class="right">and</th> <td> <?php print_widget('end_date', array('type' => 'date'), $this->_end_date); ?> <button type="submit" class="btn">Go</button> </td> </tr> </table> </form> <?php if ($viewid) { ?> <p class="no-print"> <?php if ($this->_editing) { echo '<a href="' . build_url(array('view' => 'rosters__display_roster_assignments')) . '"><i class="icon-th"></i>Show the read-only version</a>'; } else { if ($GLOBALS['user_system']->havePerm(PERM_EDITROSTER)) { echo '<a href="' . build_url(array('view' => 'rosters__edit_roster_assignments')) . '"><i class="icon-wrench"></i>Edit these assignments</a> '; } echo '<a target="print-roster" class="med-newwin" href="' . BASE_URL . '?call=display_roster&viewid=' . $viewid . '&start_date=' . $this->_start_date . '&end_date=' . $this->_end_date . '"><i class="icon-print"></i>Show the print/email version</a> '; echo '<a href="?call=roster_csv&roster_view=' . $viewid . '&start_date=' . $this->_start_date . '&end_date=' . $this->_end_date . '" ><i class="icon-download-alt"></i>Download CSV</a> '; echo '<a href="?call=email&roster_view=' . $viewid . '&start_date=' . $this->_start_date . '&end_date=' . $this->_end_date . '" class="hidden-frame"><i class="icon-email">@</i>Email all listed persons</a>'; } ?> </p> <?php } }
public static function printPersonFilters($age_brackets, $statuses) { ?> <div class="row-fluid"> <div class="span6" style="margin-top: 5px"> <label class="checkbox nowrap" > <?php print_widget('age_brackets_all', array('type' => 'checkbox', 'attrs' => array('data-toggle' => "visible", 'data-target' => "#agebrackets")), empty($age_brackets)); ?> All age brackets </label> <div id="agebrackets" style="<?php echo empty($age_brackets) ? 'display: none' : ''; ?> "> <?php print_widget('age_brackets', array('type' => 'select', 'options' => explode(',', AGE_BRACKET_OPTIONS), 'default' => '', 'allow_empty' => true, 'allow_multiple' => true, 'height' => count(explode(',', AGE_BRACKET_OPTIONS))), $age_brackets); ?> </div> </div> <div class="span6" style="margin-top: 5px"> <label class="checkbox nowrap"> <?php print_widget('statuses_all', array('type' => 'checkbox', 'attrs' => array('data-toggle' => "visible", 'data-target' => "#statuses")), empty($statuses)); ?> All statuses </label> <div id="statuses" style="<?php echo empty($statuses) ? 'display: none' : ''; ?> "> <?php $statusOptions = self::getStatusOptions(); print_widget('statuses', array('type' => 'select', 'options' => $statusOptions, 'default' => '', 'allow_empty' => true, 'allow_multiple' => true, 'height' => count($statusOptions)), $statuses); ?> </div> </div> </div> <?php }
function printView() { $congs = $GLOBALS['system']->getDBObjectData('congregation', array('!meeting_time' => ''), 'AND', 'name'); if (empty($congs)) { print_message("To edit services you must first go to admin > congregations and set the 'code name' for the relevant congregations", 'failure'); return; } ?> <form class="well well-small form-inline" style="line-height: 35px"> <input type="hidden" name="view" value="<?php echo ents($_REQUEST['view']); ?> " /> Show components containing <input type="text" name="search" placeholder="Enter search terms" value="<?php echo ents(array_get($_REQUEST, 'search')); ?> "> <span style="white-space: nowrap"> tagged with <?php print_widget('tagid', array('type' => 'reference', 'references' => 'service_component_tag', 'allow_empty' => TRUE, 'empty_text' => '-- Choose Tag --'), array_get($_REQUEST, 'tagid')); ?> </span> used by <?php $options = array('' => 'Any Congregation'); foreach ($congs as $id => $cong) { $options[$id] = $cong['name']; } $options['-'] = 'No congregation'; print_widget('congregationid', array('type' => 'select', 'options' => $options), array_get($_REQUEST, 'congregationid')); ?> <button type="submit" class="btn">Go</button> <a href="?view=<?php echo ents($_REQUEST['view']); ?> " class="btn">Clear</a> </form> <div class="row-fluid"> <div class="span6" id="service-comp-manager"> <?php $cats = $GLOBALS['system']->getDBObjectdata('service_component_category'); $congRestriction = array(); if (!empty($_REQUEST['congregationid'])) { $congRestriction['congregationid'] = (int) $_REQUEST['congregationid']; } ?> <ul class="nav nav-tabs"> <?php $c = ' class="active"'; foreach ($cats as $catid => $cat) { ?> <li<?php echo $c; ?> ><a data-toggle="tab" href="#cat<?php echo $catid; ?> "><?php echo ents($cat['category_name']); ?> </a></li> <?php $c = ''; } ?> </ul> <div class="tab-content anchor-bottom"> <?php $c = ' active'; foreach ($cats as $catid => $cat) { ?> <div class="tab-pane<?php echo $c; ?> " id="cat<?php echo $catid; ?> "> <p class="pull-right"> <a href="?view=_import_service_components&categoryid=<?php echo (int) $catid; ?> "><i class="icon-upload"></i>Import</a> <a href="?view=_add_service_component&categoryid=<?php echo (int) $catid; ?> "><i class="icon-plus-sign"></i>Add</a> </p> <table style="width: 100%;" class="table table-bordered service-comps clickable-rows"> <thead> <tr> <th>Title</th> <?php if (empty($_REQUEST['congregationid'])) { ?> <th>Used By</th> <?php } ?> </tr> </thead> <tbody> <?php $GLOBALS['system']->includeDBClass('service_component'); $comps = Service_Component::search(array_get($_REQUEST, 'search'), array_get($_REQUEST, 'tagid'), array_get($_REQUEST, 'congregationid'), $catid); foreach ($comps as $compid => $comp) { ?> <tr data-id="<?php echo (int) $compid; ?> "> <td> <?php echo ents($comp['title']); if ($comp['alt_title']) { echo ' <span class="alt-title">' . ents($comp['alt_title']) . '</span>'; } ?> </td> <?php if (empty($_REQUEST['congregationid'])) { ?> <td><?php echo ents($comp['congregations']); ?> </td> <?php } ?> </tr> <?php } ?> </tbody> </table> </div> <?php $c = ''; } ?> </div> </div> <div class="span6 well well-small preview-pane anchor-bottom" id="preview"> <p class="center"><i><br /><br />Select a component to view its details here</i></p> </div> <script> $(document).ready(function() { $('.service-comps tr').click(function() { $('#selected').attr('id', ''); $(this).attr('id', 'selected'); $('#preview').load("?call=service_comp_detail&id="+$(this).attr('data-id')); }) }) </script> <?php }
function printForm() { $GLOBALS['system']->includeDBClass('person_group'); $params = $this->getValue('params'); ?> <h3>Find me people...</h3> <h4>whose person/family record matches these rules:</h4> <table class="table table-border table-auto-width indent-left table-condensed"> <?php foreach ($this->_query_fields as $i) { $v = $this->_field_details[$i]; if (in_array($v['type'], array('select', 'reference', 'datetime', 'text')) && !in_array($i, array('p.first_name', 'p.last_name', 'f.family_name', 'p.remarks', 'p.email'))) { ?> <tr> <td> <label class="checkbox"> <input autofocus="1" type="checkbox" name="enable_rule[]" value="<?php echo $i; ?> " id="enable_rule_<?php echo $i; ?> " class="select-rule-toggle" <?php if (isset($params['rules'][$i])) { echo 'checked="checked" '; } ?> /> <strong><?php echo $v['label']; ?> </strong> <?php if ($v['type'] == 'datetime') { echo 'is between...'; } else { echo 'is...'; } ?> </label> </td> <td> <div class="select-rule-options" <?php if (!isset($params['rules'][$i])) { echo 'style="display: none" '; } ?> > <?php $key = str_replace('.', '_', $i); if ($v['type'] == 'datetime') { $value = array_get($params['rules'], $i, array('from' => '2000-01-01', 'to' => date('Y-m-d'))); print_widget('params_' . $key . '_from', array('type' => 'date'), $value['from']); echo ' and '; print_widget('params_' . $i . '_to', array('type' => 'date'), $value['to']); } else { $v['allow_multiple'] = TRUE; print_widget('params_' . $key, $v, array_get($params['rules'], $i, $v['type'] == 'select' ? array() : '')); } ?> </div> </td> </tr> <?php } } ?> </table> <?php // DATE FIELD RULES if ($GLOBALS['system']->featureEnabled('DATES')) { if (empty($params['dates']) && !empty($params['rules']['date'])) { $params['dates'][] = $params['rules']['date'] + array('criteria' => 'between'); unset($params['rules']['date']); } ?> <h4>who have <?php $dlParams = array('type' => 'select', 'options' => array('OR' => 'any', 'AND' => 'all')); print_widget('params_date_logic', $dlParams, array_get($params, 'date_logic', 'AND')); ?> the following date fields...</h4> <table class="table expandable indent-left" id="datefield-rules"> <?php $values = array_get($params, 'dates', array()); if (empty($values)) { $values[] = array('typeid' => NULL, 'criteria' => 'any', 'anniversary' => TRUE, 'from' => '2000-01-01', 'to' => date('Y-m-d')); } foreach ($values as $i => $value) { ?> <tr> <td class="narrow"> <?php print_widget('params_date_' . $i . '_typeid', array('type' => 'select', 'options' => array(0 => '--Choose--') + Person::getDateTypes()), (string) $value['typeid']); ?> </td> <td> <?php // backwards compatibility: if (array_get($value, 'criteria') == 'between') { $value['criteria'] = $value['anniversary'] ? 'anniversary' : 'exact'; } $cparams = array('type' => 'select', 'options' => array('any' => 'filled with any value', 'empty' => 'not filled in', 'exact' => 'with exact value within...', 'anniversary' => 'with exact value or anniversary within...'), 'class' => 'datefield-rule-criteria'); print_widget('params_date_' . $i . '_criteria', $cparams, $value['criteria']); $pts = array('fixed' => '', 'relative' => ''); $pts[array_get($value, 'periodtype', 'fixed')] = 'checked="checked"'; ?> <div class="datefield-rule-period"> <label class="checkbox"> <input type="radio" name="params_date_<?php echo $i; ?> _periodtype" value="fixed" <?php echo $pts['fixed']; ?> /> the period from <?php print_widget('params_date_' . $i . '_from', array('type' => 'date'), $value['from']); ?> to <?php print_widget('params_date_' . $i . '_to', array('type' => 'date'), $value['to']); ?> </label> <label class="checkbox"> <input type="radio" name="params_date_<?php echo $i; ?> _periodtype" value="relative"<?php echo $pts['relative']; ?> /> the <?php print_widget('params_date_' . $i . '_periodlength', array('type' => 'int'), array_get($value, 'periodlength', 14)); ?> day period <?php print_widget('params_date_' . $i . '_periodanchor', array('type' => 'select', 'options' => array('before' => 'before', 'ending' => 'ending on', 'starting' => 'starting on', 'after' => 'after')), array_get($value, 'periodanchor', 'ending')); ?> the day the report is executed </label> </div> </td> </tr> <?php } ?> </table> <?php } ?> <h4>who <strong>are</strong> in one or more of these groups:</h4> <div class="indent-left"> <?php Person_Group::printMultiChooser('include_groupids', array_get($params, 'include_groups', array()), array(), TRUE); ?> <label class="checkbox"> <input type="checkbox" name="enable_group_membership_status" data-toggle="enable" data-target="#group-membership-status *" value="1" <?php if (!empty($params['group_membership_status'])) { echo 'checked="checked"'; } ?> /> with membership status of </label> <span id="group-membership-status"><?php Person_Group::printMembershipStatusChooser('group_membership_status', array_get($params, 'group_membership_status'), true); ?> </span> <label class="checkbox"> <input type="checkbox" name="enable_group_join_date" data-toggle="enable" data-target="#group-join-dates *" value="1" <?php if (!empty($params['group_join_date_from'])) { echo 'checked="checked"'; } ?> /> and joined the group between </label> <span id="group-join-dates"> <?php print_widget('group_join_date_from', array('type' => 'date'), array_get($params, 'group_join_date_from')); ?> and <?php print_widget('group_join_date_to', array('type' => 'date'), array_get($params, 'group_join_date_to')); ?> </span> </div> <h4>who are <strong>not</strong> in any of these groups:</h4> <div class="indent-left"> <?php Person_Group::printMultiChooser('exclude_groupids', array_get($params, 'exclude_groups', array()), array(), TRUE); ?> </div> <?php if ($GLOBALS['user_system']->havePerm(PERM_VIEWNOTE)) { ?> <h4>who have a person note containing the phrase:</h4> <div class="indent-left"> <input type="text" name="note_phrase" size="60" value="<?php echo isset($params["note_phrase"]) ? $params["note_phrase"] : ""; ?> "> </div> <?php } if ($GLOBALS['user_system']->havePerm(PERM_VIEWATTENDANCE)) { ?> <h4>whose attendance...</h4> <div class="indent-left"> at <?php $groupid_params = array('type' => 'select', 'options' => array(null => '(Nothing)', '__cong__' => 'their congregation'), 'attrs' => array('data-toggle' => 'enable', 'data-target' => '.attendance-input')); $groups = $GLOBALS['system']->getDBObjectData('person_group', array('!attendance_recording_days' => 0, 'is_archived' => 0), 'AND'); foreach ($groups as $id => $groupdata) { $groupid_params['options'][$id] = $groupdata['name']; } print_widget('attendance_groupid', $groupid_params, array_get($params, 'attendance_groupid', 0)); ?> <br /> has been <?php $operator_params = array('type' => 'select', 'options' => array('<' => 'less than', '>' => 'more than'), 'class' => 'attendance-input'); print_widget('attendance_operator', $operator_params, array_get($params, 'attendance_operator', '<')); ?> <input name="attendance_percent" type="text" size="2" class="int-box attendance-input" value="<?php echo (int) array_get($params, 'attendance_percent', 50); ?> " />% <br />over the last <input name="attendance_weeks" type="text" size="2" class="int-box attendance-input" value="<?php echo (int) array_get($params, 'attendance_weeks', 2); ?> " /> weeks </div> <?php } ?> <h3>For each person found, show me...</h3> <?php $show_fields = array_get($params, 'show_fields', array()); ?> <table class="table-condensed expandable indent-left"> <?php foreach ($show_fields as $chosen_field) { ?> <tr> <td> <img src="<?php echo BASE_URL; ?> /resources/img/expand_up_down_green_small.png" class="icon insert-row-below" style="position: relative; top: 2ex" title="Create a blank entry here" /> </td> <td> <?php $options = array('' => ''); foreach ($this->_show_fields as $i => $opt) { if (is_null($opt)) { $options['--' . $i] = '-----'; } else { $options[$opt] = $this->_field_details[$opt]['label']; } } if ($GLOBALS['user_system']->havePerm(PERM_VIEWATTENDANCE)) { $options['--Z'] = '-----'; $options['attendance_percent'] = 'Attendance rate during specified period'; $options['attendance_numabsences'] = 'Number of absences since last marked present'; } if ($GLOBALS['user_system']->havePerm(PERM_VIEWNOTE)) { $options['--Y'] = '-----'; $options['notes.subjects'] = 'Notes matching the phrase above'; $options['actionnotes.subjects'] = 'Notes requiring action'; } if ($GLOBALS['system']->featureEnabled('DATES')) { $options['--A'] = '-----'; foreach (Person::getDateTypes() as $typeid => $name) { $options['date---' . $typeid] = ucfirst($name) . ' Date'; } } $options['--B'] = '-----'; if ($GLOBALS['system']->featureEnabled('PHOTOS')) { $options['photo'] = 'Photo'; } $options['groups'] = 'Which of the selected groups they are in'; $options['membershipstatus'] = 'Group membership status'; $options['all_members'] = 'Names of all their family members'; $options['adult_members'] = 'Names of their adult family members'; if ($GLOBALS['system']->featureEnabled('PHOTOS')) { $options['photo'] = 'Photo'; } $options['--D'] = '-----'; $options['view_link'] = 'A link to view their person record'; $options['edit_link'] = 'A link to edit their person record'; $options['checkbox'] = 'A checkbox for bulk actions'; print_widget('show_fields[]', array('options' => $options, 'type' => 'select', 'disabled_prefix' => '--'), $chosen_field); ?> </td> <td class="nowrap"> <img src="<?php echo BASE_URL; ?> /resources/img/arrow_up_thin_black.png" class="icon move-row-up" title="Move this item up" /> <img src="<?php echo BASE_URL; ?> /resources/img/arrow_down_thin_black.png" class="icon move-row-down" title="Move this item down" /> <img src="<?php echo BASE_URL; ?> /resources/img/cross_red.png" class="icon delete-row" title="Delete this item" /> </td> </tr> <?php } ?> </table> <h3>Group the results...</h3> <?php $gb = array_get($params, 'group_by', ''); ?> <div class="indent-left"> <select name="group_by"> <option value=""<?php if ($gb == '') { echo ' selected="selected"'; } ?> >all together</option> <option value="groupid"<?php if ($gb == 'groupid') { echo ' selected="selected"'; } ?> >by group membership</option> <?php foreach ($this->_query_fields as $i) { $v = $this->_field_details[$i]; if (!in_array($v['type'], array('select', 'reference'))) { continue; } ?> <option value="<?php echo $i; ?> "<?php if ($gb == $i) { echo ' selected="selected"'; } ?> >by <?php echo $v['label']; ?> </option> <?php } ?> </select> <p class="smallprint">Note: Result groups that do not contain any persons will not be shown</p> </div> <h3>Sort the results by...</h3> <select name="sort_by" class="indent-left"> <?php $sb = array_get($params, 'sort_by'); foreach ($this->_show_fields as $name) { if (is_null($name)) { ?> <option disabled="disabled">------</option> <?php } else { ?> <option value="<?php echo $name; ?> "<?php if ($sb == $name) { echo ' selected="selected"'; } ?> ><?php echo ents($this->_field_details[$name]['label']); ?> </option> <?php } } ?> <option disabled="disabled">------</option> <option value="attendance_percent"<?php if ($sb == "attendance_percent") { echo ' selected="selected"'; } ?> >Attendance rate during the specified period</option> <option value="attendance_numabsences""<?php if ($sb == "attendance_numabsences") { echo ' selected="selected"'; } ?> >Number of absences since last marked present</option> <?php if ($GLOBALS['system']->featureEnabled('DATES')) { ?> <option disabled="disabled">------</option> <?php foreach (Person::getDateTypes() as $typeid => $name) { ?> <option value="date---<?php echo $typeid; ?> "<?php if ($sb == 'date---' . $typeid) { echo ' selected="selected"'; } ?> ><?php echo ents($name); ?> date</option> <?php } } ?> </select> <?php if ($GLOBALS['user_system']->havePerm(PERM_MANAGEREPORTS)) { ?> <h3>I want to save this report...</h3> <div class="indent-left"> <label type="radio"> <input type="radio" name="save_option" value="new" id="save_option_new" <?php if (empty($this->id)) { echo 'checked="checked"'; } ?> /> as a new report called <input type="text" name="new_query_name" /> </label> <label type="radio"> <input type="radio" name="save_option" value="replace" id="save_option_replace" <?php if ($this->id && $this->id != 'TEMP') { echo 'checked="checked"'; } ?> /> in place of an existing report <?php print_widget('replace_query_id', array('type' => 'reference', 'references' => 'person_query'), $this->id); ?> </label> <label type="radio"> <input type="radio" name="save_option" value="temp" id="save_option_temp"<?php if (empty($this->id) || $this->id == 'TEMP') { echo ' checked="checked"'; } ?> /> only temporarily as an ad-hoc report </label> </div> <?php } }
function printForm() { $GLOBALS['system']->includeDBClass('person_group'); $actions = $this->getValue('actions'); $notes = array_get($actions, 'notes'); if (empty($notes)) { $notes = array(array()); // 1 blank note to start us off } ?> <table class="action-plan"> <tbody> <tr> <th>Name</th> <td><?php $this->printFieldInterface('name'); ?> </td> </tr> <tr> <th>Notes</th> <td> When this plan is executed, add these notes to the person/family: <table class="expandable"> <?php foreach ($notes as $i => $note) { ?> <tr> <td> <div class="well"> <?php $this->_printNoteForm($note, $i); ?> </div> </td> </tr> <?php } ?> </table> </td> </tr> <tr> <th>Groups</th> <td> When this plan is executed, <b>add</b> the persons / famiy members to these groups: <?php Person_Group::printMultiChooser('groups', array_get($actions, 'groups', array()), array(), FALSE); ?> </td> </tr> <tr> <th></th> <td> When this plan is executed, <b>remove</b> the persons / famiy members from these groups: <?php Person_Group::printMultiChooser('groups_remove', array_get($actions, 'groups_remove', array()), array(), FALSE); ?> </td> </tr> <tr> <th>Fields</th> <td> When this plan is executed, for each person / family member: <table class="fields"> <?php $fields = array_get($actions, 'fields', array()); $dummy = new Person(); foreach (array('congregationid', 'status', 'age_bracket') as $field) { $value = ''; $addToExisting = FALSE; $v = array_get($fields, $field); if ($v) { $value = $v['value']; $addToExisting = $v['add']; } $dummy->fields[$field]['allow_empty'] = TRUE; $dummy->fields[$field]['empty_text'] = '(No change)'; if (strlen($value)) { $dummy->setValue($field, $value); } echo '<tr><td>'; print_widget('fields_enabled[' . $field . ']', array('type' => 'checkbox'), strlen($value)); echo 'Set ' . $dummy->getFieldLabel($field) . ' </td><td>'; $dummy->printFieldInterface($field); echo '</td></tr>'; } $customFields = $GLOBALS['system']->getDBObjectData('custom_field', array(), 'OR', 'rank'); $dummy = new Custom_Field(); $addParams = array('type' => 'select', 'options' => array('Replacing existing values ', 'Adding to existing values')); foreach ($customFields as $fieldid => $fieldDetails) { $value = ''; $addToExisting = FALSE; $v = array_get($fields, 'custom_' . $fieldid); if ($v) { $value = $v['value']; $addToExisting = $v['add']; } $dummy->populate($fieldid, $fieldDetails); echo '<tr><td>'; print_widget('fields_enabled[custom_' . $fieldid . ']', array('type' => 'checkbox'), strlen($value)); echo 'Set ' . ents($dummy->getValue('name')) . ' </td><td>'; if ($fieldDetails['type'] == 'date') { // For now, we only support setting date fields to the reference date. // But there is room for future expansion to support fixed dates too. $dateVal = $noteVal = ''; if (strlen($value)) { list($dateVal, $noteVal) = explode('===', $value); } echo 'to the reference date, with note '; print_widget('custom_' . $fieldid . '_note', array('type' => 'text'), $noteVal); } else { $dummy->printWidget($value); } if ($dummy->getValue('allow_multiple')) { print_widget('fields_addvalue[custom_' . $fieldid . ']', $addParams, $addToExisting); } echo '</td></tr>'; } ?> </table> </td> </tr> <tr> <th>Attendance</th> <td> <input type="hidden" name="mark_present" value="0" /> <label class="checkbox"> <input type="checkbox" id="mark_present" name="mark_present" value="1" <?php if (array_get($actions, 'attendance')) { echo 'checked="checked"'; } ?> > When this plan is executed, mark the persons / family members as present at their congregation for the most recent attendance date </label> <p><small>This will only have effect if they are in a congregation. They will be marked present for the most recent date on which attendance has been recorded for that congregation.</small></p> </td> </tr> <tr> <th>Options</th> <td> <input type="hidden" name="default_on_create_family" value="0" /> <label class="checkbox"> <input type="checkbox" id="default_on_create_family" name="default_on_create_family" value="1" <?php if ($this->getValue('default_on_create_family')) { echo 'checked="checked"'; } ?> > By default, execute this plan when creating a new family </label> <input type="hidden" name="default_on_add_person" value="0" /> <label class="checkbox"> <input type="checkbox" id="default_on_add_person" name="default_on_add_person" value="1" <?php if ($this->getValue('default_on_add_person')) { echo 'checked="checked"'; } ?> > By default, execute this plan when adding a new person to an existing family </label> </td> </tr> </tbody> </table> <script> $('form').submit(function() { var ok = true; $('.note').each(function() { var t = $(this); if ((t.find('textarea:first').val() != '') && (t.find('input[name$="_subject"]').val() == '')) { t.find('input[name$="_subject"]').select(); alert("All notes to be added must include a subject"); ok = false; } if (!ok) return false; if (t.find('input[type=radio][value=relative]').attr('checked') && t.find('input[name$=action_date_offset]').val() == '') { t.find('input[name$=action_date_offset]').focus(); alert("If a relative action date is selected you must specify a number of days"); ok = false; } }); return ok; }); </script> <?php }
<span class="furtherspan"><a href="html/year.php?volume=14&year=2013" >೨೦೧೩<br />(ಸಂಪುಟ ೧೪)<br />ವಾರ್ಷಿಕ ಅನುಕ್ರಮಣಿಕೆ</a></span><br /> </div> </div> <div class="art_widget"> <div> <a href="http://www.caminova.net/en/downloads/download.aspx?id=1" ><img src="html/images/djvu.png" alt="cover" title="ಡೆಜವೂ ಪ್ಲಗಿನ್"/></a> </div> <div style="width: 50%;" class="text"> <span class="furtherspan"><a href="http://www.caminova.net/en/downloads/download.aspx?id=1" >ಲೇಖನಗಳನ್ನು ಡೆಜವೂ (DjVu) ರೂಪದಲ್ಲಿಟ್ಟಿದೆ. ಅವುಗಳನ್ನು ನೋಡಲು ಡೆಜವೂ ಪ್ಲಗಿನ್ ಅಗತ್ಯ. ಇದು ಮುಕ್ತವಾಗಿ ಇಲ್ಲಿ ಸಿಗುತ್ತದೆ:</a></span><br /> </div> </div> <div class="art_widget"> <div class="tbar">ವಿಶೇಷ ಸಂಚಿಕೆ</div> <?php print_widget("ಸಂಪಾದಕೀಯ-1"); ?> </div> </div> </div> <div class="footer"> <div class="foot_box"> <div class="left"> <ul> <li><a href="javascript:void()">Terms of Use</a></li> <li>|</li> <li><a href="javascript:void()">Privacy Policy</a></li> <li>|</li> <li><a href="javascript:void()">Contact us</a></li> </ul>
function _printParams() { ?> <form method="get" class="well well-small clearfix"> <input type="hidden" name="view" value="<?php echo $_REQUEST['view']; ?> " /> <table class="attendance-config-table valign-middle"> <tr> <th>Show attendance for</th> <td colspan="2" class="fill-me"> <?php print_widget('age_bracket', array('type' => 'select', 'options' => array('' => 'All age brackets') + explode(',', AGE_BRACKET_OPTIONS), 'default' => '', 'allow_empty' => false), $this->age_bracket); ?> </td> </tr> <tr> <th rowspan="2">at</th> <td class="valign-top"> <label class="radio"> <input type="radio" name="for_type" value="congregationid" id="for_type_congregation" data-toggle="enable" data-target="#congregationchooser select" <?php if (empty($this->groupid)) { echo 'checked="checked"'; } ?> > Congregation(s) </label> </td> <td class="fill-me"> <table id="congregationchooser" class="expandable table-condensed no-padding" cellspacing="0"> <?php $congs = $this->congregationids ? $this->congregationids : array(0); foreach ($congs as $congid) { ?> <tr> <td> <?php print_widget('congregationid[]', array('type' => 'reference', 'references' => 'congregation', 'order_by' => 'name', 'allow_empty' => true, 'empty_text' => '-- Choose --'), $congid); ?> </td> </tr> <?php } ?> </table> </td> </tr> <tr> <td> <label class="radio"> <input type="radio" name="for_type" value="groupid" id="for_type_group" data-toggle="enable" data-target="#groupchooser select" <?php if (!empty($this->groupid)) { echo 'checked="checked"'; } ?> > Group </label> </td> <td class="fill-me" id="groupchooser"> <?php print_widget('groupid', array('type' => 'reference', 'references' => 'person_group', 'filter' => array('can_record_attendance' => '1', 'is_archived' => 0)), $this->groupid); ?> </td> </tr> <tr> <th>between</th> <td colspan="2"> <?php print_widget('start_date', array('type' => 'date'), $this->start_date); ?> </td> </tr> <tr> <th>and</th> <td colspan="2"> <?php print_widget('end_date', array('type' => 'date'), $this->end_date); ?> </td> </tr> </table> <button type="submit" class="btn attendance-config-submit">Go <i class="icon-chevron-right"></i></button> <input type="hidden" name="params_submitted" value="1" /> </form> <?php }
/** * Print an interface for an end user to enter a value for this custom field for a person record * @param mixed $value Existing value * @param array $extraPrams Any extra params to pass to print_widget. */ public function printWidget($value, $extraParams = array()) { print_widget('custom_' . $this->id . '[]', $extraParams + $this->getWidgetParams(), $value); if ($this->getValue('type') == 'date' && !empty($this->values['params']['allow_note'])) { $bits = explode(' ', $value); $note = array_get($bits, 1); print_widget('custom_' . $this->id . '_note[]', array('type' => 'text', 'placeholder' => '(Note)'), $note); } }
function printEditor() { ?> <form method="post" action="<?php echo build_url(array('editfile' => NULL)); ?> "> <?php if ($this->_editfile == '_new_') { $i = 1; while (file_exists($this->_realdir . '/newfile' . $i . '.html')) { $i++; } ?> <p><b>Filename: </b><input name="savefile" class="select-basename" type="text" value="newfile<?php echo $i; ?> .html" /></p> <input type="hidden" name="isnew" value="1" /> <?php $content = ''; } else { ?> <input type="hidden" name="savefile" value="<?php echo $this->_editfile; ?> " /> <h3><?php echo ents($this->_editfile); ?> </h3> <?php $content = file_get_contents($this->_realdir . '/' . $this->_editfile); } print_widget('contents', array('type' => 'html'), $content); ?> <p class="align-right"> <input type="submit" class="btn" value="Save" /> <a class="btn" href="<?php echo build_url(array('editfile' => NULL)); ?> ">Cancel</a> </p> </form> <?php }
public function printView() { if ($this->errors) { echo 'Errors found: <br />'; foreach ($this->errors as $rowNum => $errors) { echo 'Row #' . $rowNum . ':'; echo '<ul><li>' . implode('</li></li>', $errors) . '</li></ul>'; } } ?> <form method="post" enctype="multipart/form-data"> <div class="form-horizontal"> <div class="control-group"> <label class="control-label"> Data file </label> <div class="controls"> <input type="file" name="datafile" /> (<a href="resources/sample_service_comp_import.csv">Sample file</a>) </div> </div> <div class="control-group"> <label class="control-label"> Congregations </label> <div class="controls"> <?php print_widget('congregationids', array('type' => 'reference', 'references' => 'congregation', 'show_id' => FALSE, 'order_by' => 'meeting_time', 'allow_empty' => false, 'allow_multiple' => true, 'filter' => create_function('$x', '$y = $x->getValue("meeting_time"); return !empty($y);')), array()); ?> </div> </div> <div class="control-group"> <label class="control-label"> Duplicate Matching </label> <div class="controls"> <label class="checkbox"> <input type="checkbox" checked="checked" name="dupe-match" value="1">Re-use existing components with matching CCLI numbers</label> <p class="help-inline">This option means that when a row's CCLI number matches an existing component, a new component will not be created. Instead, the existing component will be updated from the CSV and will be linked to the congregations selected above.</p> </label> </div> </div> <div class="control-group"> <div class="controls"> <input type="hidden" name="categoryid" value="<?php echo (int) $this->category->id; ?> " /> <input type="submit" class="btn" value="Import" /> </div> </div> </div> </form> <?php }
public static function printTemplateChooserRow($selectedID) { $templates = $GLOBALS['system']->getDBObjectData('note_template', array(), 'OR', 'name'); if ($templates) { $templateParams = array('type' => 'select', 'options' => array(NULL => '(No template)'), 'attrs' => array('id' => 'note_template_chooser')); foreach ($templates as $id => $tpl) { $templateParams['options'][$id] = $tpl['name']; } ?> <div class="control-group"> <label class="control-label">Note Template</label> <div class="controls"> <?php print_widget('note_template_id', $templateParams, $selectedID); ?> </div> </div> <hr /> <?php } }
private function _printParams() { ?> <form method="get" class="well well-small clearfix form-inline"> <input type="hidden" name="view" value="<?php echo $_REQUEST['view']; ?> " /> <table class="attendance-config-table valign-middle"> <tr> <th>For</th> <td colspan="2" class="fill-me"> <?php print_widget('age_bracket', array('type' => 'select', 'options' => array('' => 'All age brackets') + explode(',', AGE_BRACKET_OPTIONS), 'default' => '', 'allow_empty' => false), $this->age_bracket); ?> </td> </tr> <tr> <th>In</th> <td class="valign-top"> <table class="expandable"> <?php if (empty($this->cohortids)) { Attendance_Record_Set::printCohortChooserRow(NULL); } else { foreach ($this->cohortids as $id) { Attendance_Record_Set::printCohortChooserRow($id); } } ?> </table> </td> </tr> <tr> <th>Between</th> <td colspan="2"> <?php print_widget('start_date', array('type' => 'date'), $this->start_date); ?> </td> </tr> <tr> <th>And</th> <td colspan="2"> <?php print_widget('end_date', array('type' => 'date'), $this->end_date); ?> </td> </tr> <tr> <th>Format</th> <td> <?php print_widget('format', array('type' => 'select', 'options' => array('sequential' => 'Sequential', 'tabular' => 'Tabular', 'totals' => 'Date Totals')), $this->format); ?> </td> </tr> </table> <button type="submit" class="btn attendance-config-submit">Go <i class="icon-chevron-right"></i></button> <input type="hidden" name="params_submitted" value="1" /> </form> <?php }
function printView() { $GLOBALS['system']->includeDBClass('member'); ?> <div class="container" id="member-list"> <form method="get" class="form-inline"> <input type="hidden" name="view" value="<?php echo ents($_REQUEST['view']); ?> " /> <div class="input-append input-prepend"> <span class="add-on"><i class="icon-search"></i></span> <input name="search" type="text" placeholder="Enter name to search" value="<?php echo ents(array_get($_REQUEST, 'search')); ?> "))"> <br class="visible-phone" /> <?php print_widget('congregationid', array('type' => 'select', 'options' => array('' => 'Any congregation') + Member::getCongregations()), array_get($_REQUEST, 'congregationid')); ?> <button data-action="search" class="btn" type="submit">Filter</button> <a class="btn" href="?view=<?php echo ents($_REQUEST['view']); ?> ">Clear</a> </div> </form> <?php $list = Member::getList(array_get($_REQUEST, 'search'), array_get($_REQUEST, 'congregationid')); $lastFamilyID = NULL; $dummy = new Member(); foreach ($list as $id => $member) { $dummy->populate($id, $member); if ($member['familyid'] != $lastFamilyID) { $showAddress = defined('MEMBERS_SHARE_ADDRESS') && MEMBERS_SHARE_ADDRESS && !empty($member['address_suburb']); ?> <div class="row-fluid"> <div class="span12 member-row family-row"> <h3><?php echo ents($member['family_name']); ?> </h3> </div> </div> <?php if ($showAddress || $member['home_tel']) { ?> <div class="row-fluid"> <div class="span12 member-row family-row"> <?php if ($showAddress) { echo nl2br(ents($member['address_street'])) . '<br />'; echo ents($member['address_suburb'] . ' ' . $member['address_state'] . ' ' . $member['address_postcode']); echo '<br />'; } if (!empty($member['home_tel'])) { $dummy->printFieldValue('home_tel'); } ?> </div> </div> <?php } } if ($GLOBALS['system']->featureEnabled('PHOTOS')) { ?> <div class="member-card"> <?php echo '<img src="?call=person_photo&personid=' . $id . '" />'; echo ents($member['first_name'] . ' ' . $member['last_name']); echo '<br />'; if ($member['congregationid']) { $dummy->printFieldValue('congregationid'); echo '<br />'; } if ($member['mobile_tel']) { $dummy->printFieldValue('mobile_tel'); echo '<br />'; } $dummy->printFieldValue('email'); ?> </div> <?php } else { ?> <div class="row-fluid member-row"> <div class="span3"> <?php echo ents($member['first_name'] . ' ' . $member['last_name']); ?> </div> <div class="span3"> <?php $dummy->printFieldValue('congregationid'); ?> </div> <div class="span3"> <?php $dummy->printFieldValue('mobile_tel'); ?> </div> <div class="span3"> <?php $dummy->printFieldValue('email'); ?> </div> </div> <?php } $lastFamilyID = $member['familyid']; } ?> </table> <?php }
public static function printMembershipStatusChooser($name, $value = NULL, $multi = FALSE) { list($options, $default) = self::getMembershipStatusOptionsAndDefault(); $params = array('type' => 'select', 'options' => $options, 'class' => 'autofocus'); if (empty($value)) { $value = $default; } if ($multi) { $params['allow_multiple'] = true; if (substr($name, -2) != '[]') { $name .= '[]'; } } print_widget($name, $params, $value); }
echo (int) $person->id; ?> "> <div class="modal-header"> <h4>Execute Action Plan for <?php $person->printFieldValue('name'); ?> </h4> </div> <div class="modal-body"> <p><?php echo $plan_chooser; ?> </p> <p>Reference date for plans: <?php print_widget('plan_reference_date', array('type' => 'date'), NULL); ?> </p> </div> <div class="modal-footer"> <button type="submit" class="btn" accesskey="s">Go</button> <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> </div> </form> </div> <?php } // -------ADD TO GROUP MODAL --------- // $can_add_group = FALSE; $GLOBALS['system']->includeDBClass('person_group'); $groups = Person_Group::getGroups($person->id);
function print_widget($name, $params, $value) { $classes = array_get($params, 'class', ''); if (!array_get($params, 'allow_empty', 1)) { $classes .= ' compulsory'; } $attrs = array(); foreach (array_get($params, 'attrs', array()) as $attr => $val) { $attrs[] = $attr . '="' . ents($val) . '"'; } $attrs = implode(' ', $attrs); switch ($params['type']) { case 'phone': $lengths = get_valid_phone_number_lengths($params['formats']); $width = max(get_phone_format_lengths($params['formats'])); ?> <input name="<?php echo $name; ?> " type="tel" size="<?php echo $width; ?> " value="<?php echo format_phone_number($value, $params['formats']); ?> " class="phone-number" validlengths="<?php echo implode(',', $lengths); ?> " <?php echo $attrs; ?> /> <?php break; case 'bibleref': require_once 'bible_ref.class.php'; $br = new bible_ref($value); $value = $br->toShortString(); $params['class'] = 'bible-ref'; // fall through // fall through case 'text': case 'email': $maxlength_exp = empty($params['maxlength']) ? '' : 'maxlength="' . $params['maxlength'] . '"'; if (array_get($params, 'height', 1) > 1) { $cols_exp = empty($params['width']) ? '' : 'cols="' . $params['width'] . '"'; ?> <textarea name="<?php echo $name; ?> " rows="<?php echo $params['height']; ?> " <?php echo $cols_exp; ?> class="<?php echo trim($classes); ?> " <?php echo $maxlength_exp; ?> ><?php echo ents($value); ?> </textarea> <?php } else { $width_exp = empty($params['width']) ? '' : 'size="' . $params['width'] . '"'; $regex_exp = empty($params['regex']) ? '' : 'regex="' . trim($params['regex'], '/ ') . '"'; $autocomplete_exp = isset($params['autocomplete']) ? 'autocomplete=' . ($params['autocomplete'] ? 'on' : 'off') . '"' : ''; ?> <input type="<?php echo $params['type']; ?> " name="<?php echo $name; ?> " value="<?php echo ents($value); ?> " class="<?php echo trim($classes); ?> " <?php echo implode(' ', array($maxlength_exp, $width_exp, $regex_exp, $autocomplete_exp)); ?> <?php echo $attrs; ?> /> <?php } break; case 'html': static $includedCK = false; if (!$includedCK) { ?> <script src="<?php echo BASE_URL . 'resources/ckeditor/ckeditor.js'; ?> "></script> <?php } ?> <textarea class="ckeditor" name="<?php echo $name; ?> " <?php echo $attrs; ?> ><?php echo $value; ?> </textarea> <?php break; case 'int': $classes .= ' int-box'; $width_exp = ''; if (!empty($params['width'])) { $width_exp = 'size="' . $params['width'] . '" '; } else { $width_exp = 'size="3" '; } ?> <input type="text" name="<?php echo $name; ?> " value="<?php echo $value; ?> " class="<?php echo trim($classes); ?> " <?php echo $width_exp; ?> <?php echo $attrs; ?> /> <?php break; case 'select': $our_val = is_array($value) ? $value : ($value === '' ? array() : array("{$value}")); foreach ($our_val as $k => $v) { $our_val[$k] = "{$v}"; } if (array_get($params, 'style', 'dropbox') == 'colour-buttons') { ?> <div class="radio-button-group <?php echo array_get($params, 'class', ''); ?> " <?php if (!SizeDetector::isNarrow()) { echo ' tabindex="1"'; } ?> > <input type="hidden" name="<?php echo $name; ?> " value="<?php echo reset($our_val); ?> " /> <?php foreach ($params['options'] as $k => $v) { $classes = 'btn value-' . $k; if (in_array("{$k}", $our_val, true)) { $classes .= ' active'; } ?> <div class="<?php echo $classes; ?> " title="<?php echo $v; ?> " data-val="<?php echo $k; ?> " > <?php echo strtoupper($v[0]); ?> </div> <?php } ?> </div> <?php } else { if (array_get($params, 'allow_multiple')) { $height = array_get($params, 'height', min(count($params['options']), 4)); if (substr($name, -2) != '[]') { $name .= '[]'; } $style = 'height: ' . $height * 1.8 . 'em'; $classes .= ' multi-select'; // the empty onclick below is to make labels work on iOS // see http://stackoverflow.com/questions/5421659/html-label-command-doesnt-work-in-iphone-browser ?> <div class="<?php echo $classes; ?> " style="<?php echo $style; ?> " tabindex="0" onclick="" <?php echo $attrs; ?> > <?php foreach ($params['options'] as $k => $v) { $checked_exp = in_array("{$k}", $our_val, true) ? ' checked="checked"' : ''; $disabled_exp = !empty($params['disabled_prefix']) && strpos($k, $params['disabled_prefix']) === 0 ? ' disabled="disabled" ' : ''; ?> <label class="checkbox" title="<?php echo ents($v); ?> "> <input type="checkbox" name="<?php echo $name; ?> " value="<?php echo $k; ?> " <?php echo $checked_exp . $disabled_exp; ?> > <?php echo ents($v); ?> </label> <?php } ?> </div> <?php } else { ?> <select name="<?php echo $name; ?> " class="<?php echo $classes; ?> " <?php echo $attrs; ?> > <?php if (array_get($params, 'allow_empty') && !array_get($params, 'allow_multiple')) { ?> <option value=""><?php echo array_get($params, 'empty_text', '(None)'); ?> </option> <?php } foreach (array_get($params, 'options', array()) as $k => $v) { $selected_exp = in_array("{$k}", $our_val, true) ? ' selected="selected"' : ''; $disabled_exp = !empty($params['disabled_prefix']) && strpos($k, $params['disabled_prefix']) === 0 ? ' disabled="disabled" ' : ''; ?> <option value="<?php echo $k; ?> "<?php echo $selected_exp . $disabled_exp; ?> ><?php echo ents($v); ?> </option> <?php } ?> </select> <?php } } break; case 'date': $day_year_classes = trim($classes . ' int-box'); if (FALSE === strpos($name, '[')) { $name_template = $name . '%s'; } else { $name_template = substr($name, 0, strpos($name, '[')) . '%s' . substr($name, strpos($name, '[')); } $months = array(); if (array_get($params, 'allow_empty', false)) { $months[''] = '(Month)'; } for ($i = 1; $i < 13; $i++) { $months[$i] = date(array_get($params, 'month_format', 'F'), strtotime("2007-{$i}-01")); } if (empty($value)) { $value = date('Y-m-d'); } // blank dates not allowed list($year_val, $month_val, $day_val) = explode('-', substr($value, 0, 10)); ?> <span class="nowrap" <?php echo $attrs; ?> > <input type="text" name="<?php printf($name_template, '_d'); ?> " class="day-box <?php echo $day_year_classes; ?> " size="2" maxlength="2" value="<?php echo $day_val; ?> " placeholder="DD" /><select name="<?php printf($name_template, '_m'); ?> " class="month-box <?php echo $classes; ?> "> <?php foreach ($months as $i => $month_name) { $selected = $i == $month_val ? ' selected="selected"' : ''; ?> <option value="<?php echo $i; ?> "<?php echo $selected; ?> ><?php echo $month_name; ?> </option> <?php } ?> </select><input type="text" name="<?php printf($name_template, '_y'); ?> " class="year-box <?php echo $day_year_classes; ?> " size="4" maxlength="4" value="<?php echo $year_val; ?> " placeholder="YYYY"/> </span> <?php break; case 'reference': if (!empty($params['references'])) { $where = array(); if (!empty($params['filter']) && is_array($params['filter'])) { $where = $params['filter']; } $where_logic = array_get($params, 'filter_logic', 'AND'); $options = $GLOBALS['system']->getDBObjectData($params['references'], $where, $where_logic, array_get($params, 'order_by')); $dummy = new $params['references'](); $our_val = is_array($value) ? $value : (empty($value) ? array() : array($value)); if (!empty($params['filter']) && is_callable($params['filter'])) { foreach ($options as $i => $o) { $dummy->populate($i, $o); if (!in_array($i, $our_val) && !$params['filter']($dummy)) { unset($options[$i]); } } } $params['options'] = array(); foreach ($options as $k => $details) { $dummy->populate($k, $details); $params['options'][$k] = $dummy->toString(); } $params['type'] = 'select'; print_widget($name, $params, $value); } break; case 'bitmask': $value = (int) $value; ?> <div class="bitmask-boxes"> <?php $percol = false; $cols = 3; require_once 'include/size_detector.class.php'; if (SizeDetector::getWidth()) { if (SizeDetector::isNarrow()) { $cols = 1; } else { if (SizeDetector::isMedium()) { $cols = 2; } } } if ($cols > 1) { $percol = ceil(count($params['options']) / $cols); ?> <div class="bitmask-column" <?php echo $attrs; ?> > <?php } $i = 0; foreach ($params['options'] as $k => $v) { $checked_exp = ($value & (int) $k) == $k ? 'checked="checked"' : ''; // the empty onclick below is to make labels work on iOS // see http://stackoverflow.com/questions/5421659/html-label-command-doesnt-work-in-iphone-browser ?> <label class="checkbox" onclick=""> <input type="checkbox" name="<?php echo ents($name); ?> []" value="<?php echo ents($k); ?> " <?php echo $checked_exp; ?> > <?php echo nbsp(ents($v)); ?> </label> <?php if ($percol && ++$i % $percol == 0) { ?> </div> <div> <?php } } if ($percol) { ?> </div> <?php } ?> </div> <?php break; } }
public function printFieldInterface($name, $prefix = '') { if ($name == 'tags') { $options = $GLOBALS['system']->getDBObjectData('service_component_tag', array(), 'OR', 'tag'); foreach ($options as $k => $v) { $options[$k] = $v['tag']; } $params = array('type' => 'select', 'options' => $options, 'label' => 'Tags', 'references' => 'service_component_tag', 'order_by' => 'tag', 'allow_empty' => FALSE, 'allow_multiple' => FALSE, 'class' => 'tag-chooser', 'empty_text' => '-- Select --'); ?> <table class="expandable"> <?php foreach (array_get($this->values, 'tags', array()) as $tagid) { ?> <tr> <td><?php print_widget('tags[]', $params, $tagid); ?> </td> <td><img src="<?php echo BASE_URL; ?> resources/img/cross_red.png" class="icon delete-row" title="Delete this tag from the list" /></td> </tr> <?php } $params['allow_empty'] = TRUE; $params['options']['_new_'] = '* Add new tag:'; ?> <tr> <td> <?php print_widget('tags[]', $params, NULL); ?> <input style="display: none" placeholder="Type new tag here" type="text" name="new_tags[]" /> </td> <td><img src="<?php echo BASE_URL; ?> resources/img/cross_red.png" class="icon delete-row" title="Delete this tag from the list" /></td> </tr> </table> <p class="help-inline"><a href="?view=_manage_service_component_tags">Manage tag library</a></p> <?php } else { parent::printFieldInterface($name, $prefix); } if ($name == 'ccli_number') { if (defined('CCLI_SEARCH_URL')) { ?> <a class="smallprint ccli-lookup" href="<?php echo CCLI_SEARCH_URL; ?> ">Search CCLI</a> <?php } } }
private function printComponentSelector() { ?> <div class="span6"> <h1>Available Components</h1> <div id="component-search" class="input-append input-prepend"> <span class="add-on"><i class="icon-search"></i></span> <input type="text" placeholder="Enter search terms"> <?php print_widget('tag', array('type' => 'reference', 'references' => 'service_component_tag', 'allow_empty' => TRUE, 'empty_text' => '-- Choose Tag --'), NULL); ?> <button data-action="search" class="btn" type="button">Filter</button> <button data-action="clear" class="btn" type="button">Clear</button> </div> <ul class="nav nav-tabs"> <?php $cats = $GLOBALS['system']->getDBObjectData('service_component_category', array(), 'AND', 'category_name'); $active = 'class="active"'; foreach ($cats as $catid => $cat) { ?> <li <?php echo $active; ?> ><a data-toggle="tab" href="#cat<?php echo (int) $catid; ?> "><?php echo ents($cat['category_name']); ?> </a></li> <?php $active = ''; } ?> </ul> <div class="tab-content" id="service-comps"> <?php $active = 'active'; foreach ($cats as $catid => $cat) { $comps = $GLOBALS['system']->getDBObjectData('service_component', array('cong.id' => $this->congregationid, 'categoryid' => $catid), 'AND', 'usage_12m'); ?> <div class="tab-pane <?php echo $active; ?> " id="cat<?php echo (int) $catid; ?> "> <table class="table table-bordered" title="Double-click or drag to add to service"> <thead> <tr> <th data-sort="string">Title</th> <th data-sort="string" class="narrow" title="Date when this component was last used in a service">Last</th> <th data-sort="int" class="narrow" title="Number of usages in last month">1m</th> <th data-sort="int" class="narrow" title="Number of usages in last 12 months">12m<i class="icon-arrow-up"></i></th> <th class="narrow"></th> </tr> </thead> <tbody> <?php foreach ($comps as $compid => $comp) { $runsheetTitle = $comp['runsheet_title_format']; if (strlen($runsheetTitle)) { $runsheetTitle = str_replace('%title%', $comp['title'], $runsheetTitle); $runsheetTitle = $this->service->replaceKeywords($runsheetTitle); } ?> <tr data-componentid="<?php echo (int) $compid; ?> " data-is_numbered="<?php echo (int) $comp['is_numbered']; ?> " data-length_mins="<?php echo (int) $comp['length_mins']; ?> " data-runsheet_title="<?php echo ents($runsheetTitle); ?> "> <td> <span class="title"><?php echo ents($comp['title']); ?> </span> <?php if ($comp['alt_title']) { echo ' <span class="alt-title">' . ents($comp['alt_title']) . '</span>'; } ?> </td> <td class="hide-in-transit nowrap" data-sort-value="<?php echo ents($comp['lastused']); ?> "> <?php if ($comp['lastused']) { echo format_date($comp['lastused'], FALSE); } ?> </td> <td> <?php echo $comp['usage_1m']; ?> </td> <td> <?php echo $comp['usage_12m']; ?> </td> <td class="tools"> <a href="?call=service_comp_detail&id=<?php echo $compid; ?> &head=1" class="med-popup" title="View component detail"><i class="icon-eye-open"> </i></a> </td> </tr> <?php } ?> </tbody> </table> </div> <?php $active = ''; } ?> </div> </div> <?php }
function printForm() { $GLOBALS['system']->includeDBClass('person'); $person = new Person(); $person->fields['first_name']['width'] = 11; $person->fields['last_name']['width'] = 11; $person->fields['email']['width'] = 25; ?> <form method="post" id="add-family" class="form-horizontal"> <input type="hidden" name="new_family_submitted" value="1" /> <div class=""> <label>Family Name:</label> <?php $this->_family->printFieldInterface('family_name'); ?> </div> <div> <h3>Family Members</h3> <table class="expandable"> <?php include_once 'include/size_detector.class.php'; if (SizeDetector::isNarrow()) { ?> <tr> <td> <div class="compact-2col family-member-box"> <label>First Name</label> <label>Last Name</label> <div><?php $person->printFieldInterface('first_name', 'members_0_'); ?> </div> <div class="last_name preserve-value"><?php $person->printFieldInterface('last_name', 'members_0_'); ?> </div> <label>Gender</label> <label>Age</label> <div><?php $person->printFieldInterface('gender', 'members_0_'); ?> </div> <div><?php $person->printFieldInterface('age_bracket', 'members_0_'); ?> </div> <label>Status</label> <label>Congregation</label> <div class="person-status preserve-value"><?php $person->printFieldInterface('status', 'members_0_'); ?> </div> <div class="congregation"><?php $person->printFieldInterface('congregationid', 'members_0_'); ?> </div> <label>Mobile</label> <label>Email</label> <div><?php $person->printFieldInterface('mobile_tel', 'members_0_'); ?> </div> <div><?php $person->printFieldInterface('email', 'members_0_'); ?> </div> </div> </td> </tr> <?php } else { ?> <thead> <tr> <td>First Name</td> <td>Last Name</td> <td>Gender</td> <td>Age</td> <td>Status</td> <td>Cong.</td> <td>Mobile Tel</td> <td>Email</td> </tr> <thead> <tbody> <tr> <td><?php $person->printFieldInterface('first_name', 'members_0_'); ?> </td> <td class="last_name preserve-value"><?php $person->printFieldInterface('last_name', 'members_0_'); ?> </td> <td><?php $person->printFieldInterface('gender', 'members_0_'); ?> </td> <td><?php $person->printFieldInterface('age_bracket', 'members_0_'); ?> </td> <td class="person-status preserve-value"><?php $person->printFieldInterface('status', 'members_0_'); ?> </td> <td class="congregation preserve-value"><?php $person->printFieldInterface('congregationid', 'members_0_'); ?> </td> <td><?php $person->printFieldInterface('mobile_tel', 'members_0_'); ?> </td> <td><?php $person->printFieldInterface('email', 'members_0_'); ?> </td> </tr> </tbody> <?php } ?> </table> </div> <h3>Family Details <small>(optional)</small></h3> <?php $this->_family->fields['family_name']['readonly'] = 1; $this->_family->printForm(); $this->_family->fields['family_name']['readonly'] = 0; ?> <?php if ($GLOBALS['user_system']->havePerm(PERM_EDITNOTE)) { ?> <div <?php echo REQUIRE_INITIAL_NOTE ? '' : 'class="optional"'; ?> > <h3>Initial Note <small>(<?php echo REQUIRE_INITIAL_NOTE ? 'required' : 'optional'; ?> )</small></h3> <?php $GLOBALS['system']->includeDBClass('family_note'); $note = new Family_Note(); $note->printForm('initial_note_'); ?> </div> <?php } if ($plan_chooser = Action_Plan::getMultiChooser('execute_plan', 'create_family')) { ?> <h3>Action plans <small>(optional)</small></h3> <p>Execute the following action plans for the new family: </p> <div class="indent-left"> <?php echo $plan_chooser; ?> <p>Reference date for plans: <?php print_widget('plan_reference_date', array('type' => 'date'), NULL); ?> </p> </div> <?php } ?> <h3>Create</h3> <div class="align-right"> <input type="submit" class="btn" value="Create Family" /> <input type="button" class="back btn" value="Cancel" /> </div> </form> <?php }
function _printNewServiceRow($i, $running_date) { ?> <tr> <td class="service-date"><?php print_widget('new_service_date[' . $i . ']', array('type' => 'date', 'month_format' => 'M'), $running_date); ?> </td> <?php $j = 0; foreach ($this->_congregations as $congid) { ?> <td class="left-tools"> <?php if ($j != 0) { echo '<img src="' . BASE_URL . '/resources/img/arrow_left_heavy_blue.png" class="clickable copy-left" title="Click to copy this service\'s details to the previous congregation" />'; } ?> </td> <td class="service"> <?php $this->_printServiceEditCell($congid, 'new_' . $i, array()); ?> </td> <td class="right-tools"> <?php if ($j != count($this->_congregations) - 1) { echo '<img src="' . BASE_URL . '/resources/img/arrow_right_heavy_blue.png" class="clickable copy-right" title="Click to copy this service\'s details to the next congregation" />'; } ?> </td> <?php $j++; } ?> </tr> <?php }
public function printFieldInterface($name, $prefix = '') { $value = array_get($this->values, $name); if ($this->id && !$this->haveLock()) { echo $value; } else { print_widget($prefix . $name, $this->fields[$name], $value); } }
private function printParams() { // STEP 1 - choose congregation and date ?> <form method="get" class="well well-small clearfix form-inline"> <input type="hidden" name="view" value="<?php echo ents($_REQUEST['view']); ?> " /> <table class="attendance-config-table"> <tr> <th><?php echo _('For'); ?> </th> <td colspan="2" style="min-width: 240px"> <?php Attendance_Record_Set::printPersonFilters($this->_age_brackets, $this->_statuses); ?> </td> </tr> <tr> <th><?php echo _('In'); ?> </th> <td class="valign-top fill-me"> <table class="expandable"> <?php if (empty($this->_cohortids)) { Attendance_Record_Set::printCohortChooserRow(NULL); } else { foreach ($this->_cohortids as $id) { Attendance_Record_Set::printCohortChooserRow($id); } } ?> </table> </td> <tr> <th><?php echo _('On'); ?> </th> <td colspan="2"> <?php print_widget('attendance_date', array('type' => 'date'), $this->_attendance_date); ?> </td> </tr> <?php if ($GLOBALS['system']->featureEnabled('PHOTOS')) { ?> <tr> <th></th> <td> <label class="checkbox"> <input type="checkbox" name="show_photos" value="1" <?php if ($this->_show_photos) { echo 'checked="checked"'; } ?> /> <?php echo _('Show photos'); ?> </label> <?php if (!SizeDetector::isNarrow()) { ?> <br /> <label class="checkbox" title="Tabular format means that multiple groups/congregations will be shown as columns in a combined table"> <input type="checkbox" name="parallel_mode" value="1" <?php if ($this->_parallel_mode) { echo 'checked="checked"'; } ?> /> <?php echo _('Use tabular format'); ?> </label> <?php } ?> </td> </tr> <?php } ?> </table> <button type="submit" class="btn attendance-config-submit"><?php echo _('Continue'); ?> <i class="icon-chevron-right"></i></button> <input type="hidden" name="params_submitted" value="1" /> </form> <?php }
static function printDatesInterface($prefix, $dates) { if (empty($dates)) { $dates[] = array('id' => '', 'typeid' => null, 'date' => '---', 'note' => ''); } ?> <table class="expandable person-dates"> <thead> <tr> <th>Type</th> <th>Date</th> <th>Note</th> </tr> </thead> <tbody> <?php $params = self::getDateSubfieldParams(); foreach ($dates as $i => $d) { ?> <tr> <td><?php print_widget($prefix . 'date[_' . $i . '_][typeid]', $params['type'], $d['typeid']); ?> </td> <td><?php print_widget($prefix . 'dateval[_' . $i . '_]', $params['date'], $d['date']); ?> </td> <td><?php print_widget($prefix . 'date[_' . $i . '_][note]', $params['note'], $d['note']); ?> </td> </tr> <?php } ?> </tbody> </table> <script> $(document).ready(function() { $('form').submit(function() { var ok = true; $('.person-dates tr').each(function() { var t = $(this); if ((t.find('.day-box').val() != '') && (t.find('.datetype').val() == '') && (t.find('.datenote').val() == '') ) { t.find('.day-box').select(); alert('You must specify a type or a note for each date entry'); ok = false; return; } }); return ok; }); }); </script> <?php }