<th></th> </tr> </thead> <tbody> <?php foreach ($history as $rev => $history) { echo " <tr>\n"; echo " <td><a href='{$prefix}__ais/rcs/preview/{$guid}/{$rev}'>{$rev}</a></td>\n"; echo " <td>" . strftime('%x %X Z', $history['date']) . "</td>\n"; if ($history['user']) { $user = midcom::get('auth')->get_user($history['user']); if (is_object($user)) { $person = $user->get_storage(); if (midcom::get('componentloader')->load_library('org.openpsa.widgets')) { $user_card = new org_openpsa_widgets_contact($person); $person_label = $user_card->show_inline(); } else { $person_label = $person->name; } echo " <td>{$person_label}</td>\n"; } elseif ($history['ip']) { echo " <td>{$history['ip']}</td>\n"; } else { echo " <td></td>\n"; } } elseif ($history['ip']) { echo " <td>{$history['ip']}</td>\n"; } else { echo " <td></td>\n"; } echo " <td>{$history['lines']}</td>\n";
/** * Helper to load the data linked to the hour reports * * @param array $hours the hour reports we're working with */ private function _load_hour_data(array $hours) { $reports = array('invoiceable' => array('hours' => 0, 'reports' => array()), 'uninvoiceable' => array('hours' => 0, 'reports' => array()), 'invoiced' => array('hours' => 0, 'reports' => array())); $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); foreach ($hours as $report) { if (!array_key_exists($report->person, $this->reporters)) { try { $reporter = new midcom_db_person($report->person); $reporter_card = new org_openpsa_widgets_contact($reporter); $this->reporters[$report->person] = $reporter_card->show_inline(); } catch (midcom_error $e) { $e->log(); $this->reporters[$report->person] = ''; } } if (!array_key_exists($report->task, $this->tasks)) { $task = new org_openpsa_projects_task_dba($report->task); $task_html = "<a href=\"{$prefix}hours/task/{$task->guid}/\">" . $task->get_label() . "</a>"; $this->tasks[$report->task] = $task_html; } switch (true) { case $report->invoice: $category = 'invoiced'; break; case $report->invoiceable: $category = 'invoiceable'; break; default: $category = 'uninvoiceable'; break; } $reports[$category]['reports'][] = $report; $reports[$category]['hours'] += $report->hours; } $this->_request_data['sorted_reports'] = $reports; }
if ($data[$type]) { echo "<div class=\"area\">\n"; echo "<h2>" . sprintf($data['l10n']->get("updated %s"), $type) . "</h2>\n"; echo "<ul class=\"updated\">\n"; foreach ($data[$type] as $document) { $class = explode('.', $document->_fields['__COMPONENT']['content']); $class = $class[count($class) - 1]; $onclick = ''; switch ($class) { case "calendar": $url = "#"; $onclick = " onclick=\"javascript:window.open('{$document->document_url}', 'event', 'toolbar=0,location=0,status=0,height=600,width=300,resizable=1');\""; break; default: $url = $document->document_url; break; } try { if ($document->_fields['__EDITOR']['content']) { $editor = new midcom_db_person($document->_fields['__EDITOR']['content']); } else { $editor = new midcom_db_person($document->_fields['__CREATOR']['content']); } $contact = new org_openpsa_widgets_contact($editor); echo "<li class=\"updated-{$class}\"><a href=\"{$url}\"{$onclick}>{$document->title}</a> <div class=\"metadata\">" . strftime("%x %X", $document->_fields['__EDITED_TS']['content']) . " (" . $contact->show_inline() . ")</div></li>\n"; } catch (midcom_error $e) { } } echo "</ul></div>\n"; } }
private static function _render_line_wikipage_email_recipients($page) { $seen_emails = array(); $qb = org_openpsa_relatedto_dba::new_query_builder(); $qb->add_constraint('fromGuid', '=', $page->guid); $qb->add_constraint('fromComponent', '=', 'net.nemein.wiki'); $qb->add_constraint('toComponent', '=', 'org.openpsa.contacts'); $qb->begin_group('OR'); $qb->add_constraint('toClass', '=', 'midcom_db_person'); $qb->add_constraint('toClass', '=', 'org_openpsa_contacts_person_dba'); $qb->end_group(); $qb->add_constraint('status', '<>', org_openpsa_relatedto_dba::NOTRELATED); $recipients = $qb->execute(); echo " <li class=\"members\">" . midcom::get('i18n')->get_string('recipients', 'net.nemein.wiki') . ": "; foreach ($recipients as $recipient_link) { try { $recipient = new midcom_db_person($recipient_link->toGuid); $seen_emails[$recipient->email] = true; } catch (midcom_error $e) { continue; } $recipient_card = new org_openpsa_widgets_contact($recipient); echo $recipient_card->show_inline() . " "; } $other_emails = $page->listparameters('net.nemein.wiki:emailimport_recipients'); if ($other_emails) { while ($other_emails->fetch()) { $email = $other_emails->name; if (isset($seen_emails[$email])) { continue; } echo $email . ' '; $seen_emails[$email] = true; } } echo " </li>\n"; }