本文整理汇总了PHP中getRenderer函数的典型用法代码示例。如果您正苦于以下问题:PHP getRenderer函数的具体用法?PHP getRenderer怎么用?PHP getRenderer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRenderer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hourIndex
function hourIndex($d)
{
$r =& getRenderer();
$new_hour_forms = $r->view('jsHideable', array('Log Project Hour' => $r->view('projectHourLoggerForm', $d->new_hour), 'Log Support Hour' => $r->view('supporthourNewForm', $d->new_support_hour)));
$hour_table_html = $r->view('hourSearch', $d->hours, array('ajax_target_id' => 'hour-search-1'));
return array('title' => 'Listing All Hours', 'controls' => '', 'body' => $new_hour_forms . $hour_table_html);
}
示例2: chargeSearch
function chargeSearch($charges, $o)
{
$r = getRenderer();
$type = isset($o['type']) ? $o['type'] : '';
$company_id = isset($o['company_id']) ? $o['company_id'] : '';
$start_date = isset($o['date_range']['start_date']) ? $o['date_range']['start_date'] : '';
$end_date = isset($o['date_range']['end_date']) ? $o['date_range']['end_date'] : '';
$form = new Form(array('controller' => 'Charge', 'action' => 'search', 'method' => 'get', 'auto_submit' => array('company_id', 'type', 'start_date', 'end_date'), 'ajax_target_id' => 'charges-table'));
$charge = new Charge();
$charge->set(array('type' => $type));
$fs = $form->getFieldSetFor($charge);
$form->content .= $fs->field('type', array('title' => 'Type', 'name' => 'type'));
$form->content .= $r->classSelect('Company', array('title' => 'Client', 'name' => 'company_id', 'id' => 'company_id', 'selected_value' => $company_id));
$form->content .= '<div class="search-input">
<label for="charge_search_start">Start Date</label>
' . $r->input('date', array('name' => 'date_range[start_date]', 'value' => $start_date, 'id' => 'charge_search_start')) . '
</div>
<div class="search-input">
<label for="charge_search_end">End Date</label>
' . $r->input('date', array('name' => 'date_range[end_date]', 'value' => $end_date, 'id' => 'charge_search_end')) . '
</div>
';
$o['search'] = $form->html;
return $r->view('chargeTable', $charges, $o);
}
示例3: invoiceBatchIndex
function invoiceBatchIndex($d, $o = array())
{
$r = getRenderer();
$hidden_forms = $r->view('jsMultipleButtons', array('Create Single Invoice' => $r->view('invoiceNewForm', $d->new_invoice), 'Create Quarterly Invoices' => $r->view('invoicebatchNewForm', $d->new_batch), 'Create Stand-Alone Invoice' => $r->view('invoiceStandNewForm', $d->new_stand_invoice)));
$invoice_table = $r->view('invoiceTable', $d->invoices, array('search_invoice' => $d->search_invoice));
return array('title' => 'Show Invoices', 'body' => $hidden_forms . $invoice_table);
}
示例4: clientuserIndex
function clientuserIndex($d)
{
$r = getRenderer();
$clientuser_new = $r->view('jsHideable', array('Create New Client User' => $r->view('clientuserNewForm', $d->new_clientuser)));
$clientuser_table = $r->view('clientuserTable', $d->clientusers);
return array('title' => 'Client Users', 'body' => $clientuser_new . $clientuser_table);
}
示例5: projectIndex
function projectIndex($d)
{
$r = getRenderer();
$new_project_form = $r->view('jsHideable', array('Create New Project' => $r->view('projectNewForm', $d->new_project)));
$project_table = $r->view('projectTable', $d->projects, array('id' => 'project', 'search_project' => $d->search_project));
return array('title' => 'All Projects', 'controls' => '', 'body' => $new_project_form . $project_table);
}
示例6: hourListItem
/**
hour list item
renders list display for a singe Hour objects
*/
function hourListItem($hour, $o)
{
$r = getRenderer();
$data = array('Hours' => $hour->getHours(), 'Discount' => $hour->getDiscount(), 'Name' => $hour->getName(), 'Staff' => $hour->getStaffName());
$options = array('class' => 'hour-list-item');
return $r->view('basicListItem', $data, $options);
}
示例7: invoiceShow
function invoiceShow($d, $o = array())
{
$r = getRenderer();
if ($d->invoice->getData('type') == 'dated') {
$invoice_date = $d->invoice->getEndDate();
} else {
$invoice_date = $d->invoice->getDate();
}
$invoice_period = $d->invoice->getStartDate() . " through " . $d->invoice->getEndDate();
$banner = array('Invoice Date' => $invoice_date, 'Invoice Number' => "#" . $d->invoice->getData('id'));
$client = $d->company->getDisplayName();
$billing_contact_emails = $d->company->getBillingEmailAddress();
$additional_recipients = $d->invoice->getAdditionalRecipients();
$send_button = UI::button(array('controller' => 'Invoice', 'action' => 'email', 'id' => $d->invoice->getData('id')));
if ($d->invoice->getData('type') == 'dated') {
$items = array('Items for Period' => $invoice_period, 'Previous Balance' => "\$ " . number_format($d->invoice->getPreviousBalance(), 2), 'New Payments in Period' => "\$ " . number_format($d->invoice->getNewPaymentsTotal(), 2), 'New Charges in Period' => "\$ " . number_format($d->invoice->getNewCosts(), 2), 'Total Due' => "\$ " . number_format($d->invoice->getAmountDue(), 2), 'Net 30 Terms' => ' ');
} else {
$items = array('Total Due' => "\$ " . number_format($d->invoice->getAmountDue(), 2), 'Net 30 Terms' => ' ');
}
$summary = '
<div id="banner">' . $r->view('basicList', $banner) . '</div>
<h2 id="invoice-client">' . $client . '</h2>
<div id="billing-contact">Billing Contact Email: ' . $billing_contact_emails . $additional_recipients . '<br>
</div>
<div id="billing-send-invoice">' . $send_button . '</div>
<div id="invoice-summary">';
if ($d->invoice->getData('details')) {
$summary .= '<div id="details"><strong>Details</strong>: ' . nl2br($d->invoice->getData('details')) . '</div>';
}
$summary .= $r->view('basicList', $items) . '
</div>';
$history = $r->view('companyLineItems', array('company' => $d->company, 'months' => Util::month_range($d->invoice->getStartDate(), $d->invoice->getEndDate())));
return array('template' => 'invoice', 'title' => 'Show Invoice', 'body' => $summary, 'history' => $history);
}
示例8: hourSearch
function hourSearch($hours, $o = array())
{
$r = getRenderer();
$start_date = isset($o['hour_search']['start_date']) ? $o['hour_search']['start_date'] : '';
$end_date = isset($o['hour_search']['end_date']) ? $o['hour_search']['end_date'] : '';
$company_id = isset($o['company']) ? $o['company'] : '';
$staff_name = isset($o['staff']) ? $o['staff'] : '';
unset($o['hour_search']);
$search_form = new Form(array_merge(array('method' => 'get', 'controller' => 'Hour', 'action' => 'search', 'ajax_target_id' => 'hour_table', 'auto_submit' => array('company', 'staff')), $o));
$search_form->content = '
<div class="search-input">
' . $r->classSelect('Company', array('name' => 'company', 'id' => 'hour_search_company_id', 'title' => 'Client', 'selected_value' => $company_id)) . '
</div>
<div class="search-input">
<label for="hour_search_start">Start Date</label>
' . $r->input('date', array('name' => 'hour_search[start_date]', 'value' => $start_date, 'id' => 'hour_search_start')) . '
</div>
<div class="search-input">
<label for="hour_search_end">End Date</label>
' . $r->input('date', array('name' => 'hour_search[end_date]', 'value' => $end_date, 'id' => 'hour_search_end')) . '
</div>
' . $r->classSelect('Staff', array('name' => 'staff_id', 'id' => 'hour_search_staff_id', 'title' => 'Staff', 'selected_value' => $staff_name));
$hours_table = $r->view('hourTable', $hours, array('search' => $search_form->html));
return '<div id="' . $o['ajax_target_id'] . '" class="hour-search clear-left">
' . $hours_table . '
</div>';
}
示例9: jumpSelect
function jumpSelect($sample_object, $criteria = array())
{
$r = getRenderer();
$form = new Form(array('method' => 'get', 'action' => 'show', 'controller' => get_class($sample_object)));
$form->content = $r->objectSelect($sample_object, array('name' => 'id'), $criteria);
return $form->html;
}
示例10: companyTable
function companyTable($companies, $o = array())
{
$r = getRenderer();
$search_form = '';
if (!empty($o['search_company']) && is_a($o['search_company'], 'Company')) {
$form = new Form(array('controller' => 'Company', 'action' => 'index', 'method' => 'get', 'auto_submit' => array('org_type', 'country', 'status')));
$f = $form->getFieldSetFor($o['search_company']);
$form_content = $f->field('org_type', array('title' => 'Organization Type'));
$form_content .= $f->field('country', array('title' => 'Country'));
$form_content .= $f->field('status', array('title' => 'Status'));
$form->content = $form_content;
$search_form = $form->html;
}
$table = array();
$table['headers'] = array('Client', 'Primary Contact', 'Status', 'Last Payment', 'Billing Status', 'Balance');
$table['rows'] = array();
foreach ($companies as $c) {
$link = $r->link('Company', array('action' => 'show', 'id' => $c->id), $c->getName());
if ($c->getPrimaryContact()) {
$contact_link = $r->link('Contact', array('action' => 'show', 'id' => $c->getPrimaryContact()->id), $c->getPrimaryContactName());
} else {
$contact_link = '';
}
$table['rows'][] = array($link, $contact_link, $c->get('status'), $c->getLastPaymentDate(), $c->get('billing_status'), $c->calculateBalance(array('end_date' => Util::date_format_from_time())));
}
return $r->view('basicTable', $table, array('title' => 'Search Clients', 'search' => $search_form, 'pager' => true));
}
示例11: supportcontractIndex
function supportcontractIndex($d)
{
$r = getRenderer();
$hidden_forms = $r->view('jsHideable', array('Create New Support Contract' => $r->view('supportcontractNewForm', $d->new_contract), 'Log Support Hour' => $r->view('supporthourNewForm', $d->new_hour)));
$contract_table = $r->view('supportcontractTable', $d->contracts);
return array('title' => 'Support Contracts', 'body' => $hidden_forms . $contract_table);
}
示例12: chargeIndex
function chargeIndex($d)
{
$r = getRenderer();
$hidden_forms = $r->view('jsHideable', array('Create New Charge' => $r->view('chargeNewForm', $d->new_charge)), array('open_by_default' => array('Create New Charge')));
$charge_table = $r->view('chargeSearch', $d->charges);
return array('title' => 'Charge', 'body' => $hidden_forms . $charge_table);
}
示例13: invoiceEmailPlain
function invoiceEmailPlain($d, $o = array())
{
$r = getRenderer();
if ($d->invoice->getData('type') == 'dated') {
$invoice_date = $d->invoice->getEndDate();
} else {
$invoice_date = $d->invoice->getDate();
}
$invoice_period = $d->invoice->getStartDate() . " through " . $d->invoice->getEndDate();
$client = $d->company->getName();
$summary = "\n\nRadical Designs Invoice\n Invoice Date " . $invoice_date . "\n Invoice Number #" . $d->invoice->getData("id") . "\n Your New Radical Designs Invoice: " . $client . "\n\n ";
if ($d->invoice->getData('type') == 'dated') {
$summary .= "Invoice for Period " . $invoice_period . "\n\n Starting Balance on " . $d->invoice->getStartDate() . ":\n \$ " . number_format($d->invoice->getPreviousBalance(), 2) . " New Charges in Period:\n \$ " . number_format($d->invoice->getNewCosts(), 2) . "\n\n Less Payments in Period:\n \$ " . number_format($d->invoice->getNewPaymentsTotal(), 2) . "\n";
}
if ($d->invoice->getData('details')) {
$summary .= "Details: " . $d->invoice->getData("details") . "\n";
}
$summary .= " Current Total Due: \$ " . number_format($d->invoice->getAmountDue(), 2) . "\n\nNet 30 Terms\n\nPayment Information:\n\n";
if ($d->invoice->getAmountDue() < 1000) {
$summary .= "Radical Designs accepts online payments at https://payments.rdsecure.org/payments for amounts less than \$1000.\n\n";
}
$summary .= "Send checks to:\n Radical Designs\n 1201 Martin Luther King Jr. Way, Suite 200 \n Oakland, CA\n 94612\n \n Make your check payable to Radical Designs. \n For questions about your contract or bill please email billing@radicaldesigns.org\n For questions about support please email help@radicaldesigns.org\n Or you can call us at 415-738-0456";
$summary .= $r->view('companyLineItemsPlain', array('company' => $d->company, 'months' => Util::month_range($d->invoice->getStartDate(), $d->invoice->getEndDate())));
return array('template' => 'invoice', 'title' => 'Show Invoice', 'body' => $summary);
}
示例14: companyIndex
function companyIndex($d)
{
$r = getRenderer();
$company_new_html = $r->view('jsHideable', array('Create New Client' => $r->view('companyNewForm', $d->new_company)));
$company_table_html = $r->view('companyTable', $d->companies, array('id' => 'company', 'search_company' => $d->search_company));
return array('title' => 'Listing All Clients', 'controls' => '', 'body' => $company_new_html . $company_table_html);
}
示例15: estimateInfo
function estimateInfo($estimate, $o = array())
{
$r = getRenderer();
$project = new Project($estimate->get('project_id'));
$project_link = $r->link('Project', array('action' => 'show', 'id' => $project->id), $project->get('name'));
$list_items = array('Estimate' => $estimate->getName(), 'Project' => $project_link, 'Due Date' => $estimate->getData('due_date'), 'High Estimate' => $estimate->getHighEstimate(), 'Low Estimate' => $estimate->getLowEstimate(), 'Total Hours' => $estimate->getTotalHours(), 'Billable Hours' => $estimate->getBillableHours(), 'Completed' => $estimate->getData('completed') ? 'yes' : 'no', 'Notes' => $estimate->getData('notes'), 'Category' => $estimate->get('category'));
return $r->view('basicList', $list_items);
}