Пример #1
0
 /**
  * Generic request startup work:
  *
  * - Load the Schema Database
  * - Add the LINK HTML HEAD elements
  */
 public function _on_handle($handler, $args)
 {
     org_openpsa_widgets_contact::add_head_elements();
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.projects/projects.css");
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.invoices/invoices.css");
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.sales/sales.css");
     midcom::get('auth')->require_valid_user();
 }
Пример #2
0
 /**
  * The handle callback populates the toolbars.
  */
 public function _on_handle($handler, $args)
 {
     // Always run in uncached mode
     midcom::get('cache')->content->no_cache();
     if ($handler != 'mycontacts_xml') {
         midcom::get('auth')->require_valid_user();
     }
     org_openpsa_widgets_contact::add_head_elements();
 }
Пример #3
0
 private function _send_by_mail(org_openpsa_invoices_invoice_dba $invoice)
 {
     $customerCard = org_openpsa_widgets_contact::get($invoice->customerContact);
     $contactDetails = $customerCard->contact_details;
     $invoice_label = $invoice->get_label();
     $invoice_date = date($this->_l10n_midcom->get('short date'), $invoice->date);
     // generate pdf, only if not existing yet
     $pdf_files = org_openpsa_helpers::get_attachment_urls($invoice, "pdf_file");
     if (count($pdf_files) == 0) {
         org_openpsa_invoices_handler_pdf::render_and_attach_pdf($invoice);
     }
     $mail = new org_openpsa_mail();
     // define replacements for subject / body
     $mail->parameters = array("INVOICE_LABEL" => $invoice_label, "INVOICE_DATE" => $invoice_date, "FIRSTNAME" => $contactDetails["firstname"], "LASTNAME" => $contactDetails["lastname"]);
     $mail->to = $contactDetails["email"];
     $mail->from = $this->_config->get('invoice_mail_from_address');
     $mail->subject = $this->_config->get('invoice_mail_title');
     $mail->body = $this->_config->get('invoice_mail_body');
     // attach pdf to mail
     if ($mail->can_attach()) {
         $pdf_files = org_openpsa_helpers::get_attachment_urls($invoice, "pdf_file");
         if (count($pdf_files) > 0) {
             foreach ($pdf_files as $guid => $url) {
                 $att = array();
                 $att['name'] = basename($url) . ".pdf";
                 $att['mimetype'] = "application/pdf";
                 $fp = fopen($url, "r");
                 if (!$fp) {
                     //Failed to open attachment for reading, skip the file
                     continue;
                 }
                 $att['content'] = '';
                 while (!feof($fp)) {
                     $att['content'] .= fread($fp, 4096);
                 }
                 fclose($fp);
                 debug_add("adding attachment '{$att['name']}' to attachments array of invoice mail");
                 $mail->attachments[] = $att;
                 unset($att);
             }
         }
     }
     if (!$mail->send()) {
         $this->_request_data['message']['message'] = sprintf($this->_l10n->get('unable to deliver mail: %s'), $mail->get_error_message());
         return false;
     } else {
         $invoice->set_parameter($this->_component, 'sent_by_mail', time());
         return $this->_mark_as_sent($invoice);
     }
 }
Пример #4
0
 /**
  * Initializes the class and stores the selected person to be shown
  * The argument should be a MidgardPerson object. In the future DM
  * Array format will also be supported.
  *
  * @param mixed $person Person to display either as MidgardPerson or Datamanager array
  */
 public function __construct($person = null)
 {
     parent::__construct();
     if (null === self::$_contacts_url) {
         $siteconfig = org_openpsa_core_siteconfig::get_instance();
         self::$_contacts_url = $siteconfig->get_node_full_url('org.openpsa.contacts');
     }
     // Read properties of provided person object/DM array
     // TODO: Handle groups as well
     if (is_object($person)) {
         $this->_data_read_ok = $this->read_object($person);
     } else {
         if (is_array($person)) {
             $this->_data_read_ok = $this->read_array($person);
         }
     }
 }
Пример #5
0
 /**
  * Looks up an campaign to display.
  */
 public function _handler_view($handler_id, array $args, array &$data)
 {
     $this->_campaign = $this->_master->load_campaign($args[0]);
     $this->_load_datamanager();
     $this->_datamanager->autoset_storage($this->_campaign);
     $this->set_active_leaf('campaign_' . $this->_campaign->id);
     $this->_request_data['campaign'] =& $this->_campaign;
     $this->_request_data['datamanager'] =& $this->_datamanager;
     org_openpsa_widgets_contact::add_head_elements();
     $this->_populate_toolbar();
     $schemadb_message = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_message'));
     foreach ($schemadb_message as $name => $schema) {
         $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "message/create/{$this->_campaign->guid}/{$name}/", MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('new %s'), $this->_l10n->get($schema->description)), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/' . org_openpsa_directmarketing_viewer::get_messagetype_icon($schema->customdata['org_openpsa_directmarketing_messagetype']), MIDCOM_TOOLBAR_ENABLED => $this->_campaign->can_do('midgard:create')));
     }
     // Populate calendar events for the campaign
     $this->bind_view_to_object($this->_campaign, $this->_datamanager->schema->name);
     midcom::get('metadata')->set_request_metadata($this->_campaign->metadata->revised, $this->_campaign->guid);
     midcom::get('head')->set_pagetitle($this->_campaign->title);
 }
Пример #6
0
    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";
    }
}
Пример #7
0
 /**
  * Add CSS
  *
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_callback($handler_id, array $args, array &$data)
 {
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/legacy.css");
     //need js for chooser-widgets for list of hour - because of dynamic load loading is needed here
     midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/chooser/jquery.chooser_widget.js");
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/chooser/jquery.chooser_widget.css");
     if ($handler_id == 'task_view') {
         org_openpsa_widgets_contact::add_head_elements();
         $data['calendar_node'] = midcom_helper_misc::find_node_by_component('org.openpsa.calendar');
     }
 }
<?php

$prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
$project =& $data['project'];
$manager_card = org_openpsa_widgets_contact::get($project->manager);
?>
<tr>
    <td><?php 
echo "<a href=\"{$prefix}project/{$project->guid}/\">{$project->title}</a>\n";
?>
</td>
    <td><?php 
echo $manager_card->show_inline();
?>
</td>
    <td><?php 
try {
    $customer = new midcom_db_group($project->customer);
    if ($data['contacts_url']) {
        echo "<a href=\"{$data['contacts_url']}group/{$customer->guid}/\">{$customer->official}</a>";
    } else {
        echo $customer->official;
    }
} catch (midcom_error $e) {
    echo $data['l10n']->get('no customer');
}
?>
</td>
    <td>
    <?php 
if (isset($data['priority_array']) && array_key_exists($task->priority, $data['priority_array'])) {
Пример #9
0
<?php

$contactwidget = new org_openpsa_widgets_contact($data['person']);
?>
<div class="org_openpsa_projects_projectbroker_prospect">
    <?php 
echo $contactwidget->show();
?>
    <table class="slots">
        <thead>
            <tr>
                <th><?php 
echo midcom::get('i18n')->get_string('event before', 'org.openpsa.calendar');
?>
</th>
                <th><?php 
echo midcom::get('i18n')->get_string('available slot', 'org.openpsa.calendar');
?>
</th>
                <th><?php 
echo midcom::get('i18n')->get_string('event after', 'org.openpsa.calendar');
?>
</th>
            </tr>
        </thead>
        <tbody>
            <?php 
foreach ($data['slots'] as $k => $slot) {
    $dom_id = "{$data['prospect']->guid}_{$slot['start']}";
    echo "<tr id=\"{$dom_id}_tr\">\n";
    echo "    <td class=\"previous\">\n";
Пример #10
0
        case 'phone':
        case 'fax':
            echo "<div><strong>" . $data['l10n']->get($fieldname) . ": </strong>";
            echo $fielddata . "</div>";
            break;
    }
}
if (array_key_exists('billing_data', $data)) {
    echo "<h2>" . $data['l10n']->get('invoice defaults') . "</h2>\n";
    echo "<div><strong>" . midcom::get('i18n')->get_string('vat', 'org.openpsa.invoices') . ": </strong>";
    echo $data['billing_data']->vat . " %</div>\n";
    echo "<div><strong>" . midcom::get('i18n')->get_string('payment target', 'org.openpsa.invoices') . ": </strong>";
    echo $data['billing_data']->due . "</div>\n";
    $data['billing_data']->render_address();
}
org_openpsa_widgets_contact::show_address_card($data['group'], array('visiting', 'postal'));
echo '<br style="clear:left" />';
$siteconfig = org_openpsa_core_siteconfig::get_instance();
$tabs = array();
if (strpos($data['view']['categories'], $data['l10n']->get('client')) !== false) {
    //TODO: Check for privileges somehow
    $invoices_url = $siteconfig->get_node_relative_url('org.openpsa.invoices');
    if ($invoices_url) {
        $tabs[] = array('url' => $invoices_url . "list/customer/all/{$data['group']->guid}/", 'title' => midcom::get('i18n')->get_string('invoices', 'org.openpsa.invoices'));
    }
    $sales_url = $siteconfig->get_node_relative_url('org.openpsa.sales');
    if ($sales_url) {
        $tabs[] = array('url' => $sales_url . "list/customer/{$data['group']->guid}/", 'title' => midcom::get('i18n')->get_string('salesprojects', 'org.openpsa.sales'));
    }
}
org_openpsa_widgets_ui::render_tabs($data['group']->guid, $tabs);
Пример #11
0
     <td><?php 
echo org_openpsa_helpers::format_number($view['value']);
?>
</td>
    </tr>
    <tr>
     <th><?php 
echo $data['l10n']->get('profit');
?>
</th>
     <td><?php 
echo org_openpsa_helpers::format_number($view['profit']);
?>
</td>
    </tr>
    <?php 
$owner_card = org_openpsa_widgets_contact::get($salesproject->owner);
?>
    <tr>
     <th><?php 
echo $data['l10n']->get('owner');
?>
</th>
     <td><?php 
echo $owner_card->show_inline();
?>
</td>
    </tr>

    </table>
Пример #12
0
 /**
  * Maps the content topic from the request data to local member variables.
  */
 public function _on_initialize()
 {
     org_openpsa_widgets_calendar::add_head_elements();
     org_openpsa_widgets_contact::add_head_elements();
     midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/org.openpsa.projects/projectbroker.js");
 }
Пример #13
0
 public function get_row(midcom_core_dbaobject $task)
 {
     $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
     $task_url = $prefix . "task/{$task->guid}/";
     $celldata = $this->get_table_row_data($task, $this->_request_data);
     $manager_card = org_openpsa_widgets_contact::get($task->manager);
     $entry = array();
     $entry['id'] = $task->id;
     $entry['index_task'] = $task->title;
     $entry['task'] = '<a href="' . $task_url . '"><img class="status-icon" src="' . MIDCOM_STATIC_URL . '/stock-icons/16x16/' . $task->get_icon() . '" /> ' . $task->title . '</a>';
     if ($this->_request_data['view_identifier'] == 'my_tasks' || $this->_request_data['view_identifier'] == 'project_tasks') {
         $entry['status_control'] = org_openpsa_projects_workflow::render_status_control($task);
         $status_type = $this->_get_status_type($task);
         $entry['index_status'] = $this->_status_order[$status_type];
         $entry['status'] = $this->_l10n->get($status_type . ' tasks');
         $controls = $this->_render_workflow_controls($task);
         if ($controls != '') {
             $entry['task'] = '<div class="title">' . $entry['task'] . '</div><div class="details">' . $controls . '</div>';
         }
     }
     $entry['index_project'] = $celldata['index_parent'];
     $entry['project'] = $celldata['parent'];
     $entry['index_priority'] = $task->priority;
     $entry['priority'] = $task->priority;
     if (isset($this->_request_data['priority_array']) && array_key_exists($task->priority, $this->_request_data['priority_array'])) {
         $entry['priority'] = '<span title="' . $this->_l10n->get($this->_request_data['priority_array'][$task->priority]) . '">' . $task->priority . '</span>';
     }
     if ($this->_request_data['view_identifier'] != 'agreement') {
         $entry['index_customer'] = $celldata['index_customer'];
         $entry['customer'] = $celldata['customer'];
     }
     $entry['manager'] = $manager_card->show_inline();
     $entry['index_manager'] = preg_replace('/<span.*?class="uid".*?>.*?<\\/span>/', '', $entry['manager']);
     $entry['index_manager'] = strip_tags($entry['index_manager']);
     $entry['start'] = strftime('%Y-%m-%d', $task->start);
     $entry['end'] = strftime('%Y-%m-%d', $task->end);
     if ($this->_request_data['view_identifier'] != 'project_tasks') {
         $entry['index_reported'] = $task->reportedHours;
         $entry['reported'] = round($task->reportedHours, 2);
         if ($task->plannedHours > 0) {
             $entry['reported'] .= ' / ' . round($task->plannedHours, 2);
         }
     } else {
         $entry['planned_hours'] = $task->plannedHours;
         $entry['invoiced_hours'] = $task->invoicedHours;
         $entry['approved_hours'] = $task->approvedHours;
         $entry['reported_hours'] = $task->reportedHours;
     }
     return $entry;
 }
Пример #14
0
</th>
                    <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";
        }
Пример #15
0
 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_view($handler_id, array $args, array &$data)
 {
     // Get the requested document object
     $this->_document = $this->_load_document($args[0]);
     //If the user hasn't looked at the document since its last update, save the current time as last visit
     $person = midcom::get('auth')->user->get_storage();
     if ((int) $person->get_parameter('org.openpsa.documents_visited', $this->_document->guid) < (int) $this->_document->metadata->revised) {
         $person->set_parameter('org.openpsa.documents_visited', $this->_document->guid, time());
     }
     // Get number of older versions
     $this->_request_data['document_versions'] = 0;
     $qb = org_openpsa_documents_document_dba::new_query_builder();
     $qb->add_constraint('topic', '=', $this->_request_data['directory']->id);
     if ($this->_document->nextVersion == 0) {
         $qb->add_constraint('nextVersion', '=', $this->_document->id);
     } else {
         $qb->add_constraint('nextVersion', '=', $this->_document->nextVersion);
         $qb->add_constraint('metadata.created', '<', gmstrftime('%Y-%m-%d %T', $this->_document->metadata->created));
     }
     $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_DOCUMENT);
     $this->_request_data['document_versions'] = $qb->count();
     $this->set_active_leaf($this->_document->id);
     org_openpsa_widgets_ui::enable_ui_tab();
     org_openpsa_widgets_contact::add_head_elements();
     $this->_request_data['document_dm'] =& $this->_datamanager;
     $this->_request_data['document'] =& $this->_document;
     midcom::get('head')->set_pagetitle($this->_document->title);
     if ($this->_document->nextVersion == 0) {
         $this->_populate_toolbar();
     }
     $this->_add_version_navigation();
     $this->bind_view_to_object($this->_document, $this->_datamanager->schema->name);
 }
Пример #16
0
$event =& $data['other_obj'];
?>

<li class="event" id="org_openpsa_relatedto_line_&(link['guid']);">
  <span class="icon">&(data['icon']:h);</span>
  <span class="title">&(data['title']:h);</span>
  <ul class="metadata">
    <li class="time location"><?php 
echo $event->format_timeframe() . ", {$event->location}";
?>
</li>
    <?php 
// Participants
echo "<li class=\"members\">" . midcom::get('i18n')->get_string('participants', 'org.openpsa.calendar') . ": ";
foreach ($event->participants as $person_id => $confirmed) {
    $participant_card = org_openpsa_widgets_contact::get($person_id);
    echo $participant_card->show_inline() . " ";
}
echo "</li>\n";
?>
  </ul>

  <div id="org_openpsa_relatedto_details_url_&(event.guid);" style="display: none;" title="&(data['raw_url']);"></div>
    <div id="org_openpsa_relatedto_details_&(event.guid);" class="details hidden" style="display: none;">
    </div>
<?php 
//TODO: necessary JS stuff to load details (which should in turn include the events own relatedtos) via AHAH
echo org_openpsa_relatedto_handler_relatedto::render_line_controls($link, $data['other_obj']);
?>
</li>
Пример #17
0
 /**
  * Add toolbar items
  *
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_callback($handler_id, array $args, array &$data)
 {
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/legacy.css");
     if ($handler_id == 'project') {
         org_openpsa_widgets_grid::add_head_elements();
         org_openpsa_widgets_contact::add_head_elements();
         midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . '/org.openpsa.core/filter.js');
         midcom::get('head')->add_stylesheet(MIDCOM_STATIC_URL . '/org.openpsa.core/filter.css');
     }
 }
<?php

$link =& $data['link'];
$page =& $data['other_obj'];
$page_url = $data['page_url'] . $page->name;
$author_card = org_openpsa_widgets_contact::get($page->metadata->creator);
?>
<li class="note" id="org_openpsa_relatedto_line_&(link['guid']);">
  <span class="icon">&(data['icon']:h);</span>
  <span class="title"><a href="&(page_url);" target="wiki_&(page.guid);">&(page.title);</a></span>
    <ul class="metadata">
      <li class="time"><?php 
echo strftime('%x', $page->metadata->created);
?>
</li>
      <li class="members"><?php 
echo midcom::get('i18n')->get_string('author', 'net.nemein.wiki') . ': ';
echo $author_card->show_inline();
?>
      </li>
    </ul>

    <div id="org_openpsa_relatedto_details_url_&(page.guid);" style="display: none;" title="&(data['page_url']);raw/&(page.name);/"></div>
    <div id="org_openpsa_relatedto_details_&(page.guid);" class="details hidden" style="display: none;">
    </div>
    <?php 
echo org_openpsa_relatedto_handler_relatedto::render_line_controls($link, $data['other_obj']);
?>
</li>
Пример #19
0
        $entry['index_customer'] = $customer->official;
        if ($data['invoices_url']) {
            $entry['customer'] = "<a href=\"{$data['invoices_url']}list/customer/all/{$customer->guid}/\" title=\"{$customer->name}: {$customer->official}\">{$customer->official}</a>";
        } else {
            $entry['customer'] = $customer->official;
        }
    } catch (midcom_error $e) {
        $entry['customer'] = '';
        $entry['index_customer'] = '';
    }
    $entry['index_contact'] = '';
    $entry['contact'] = '';
    try {
        $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact);
        $entry['index_contact'] = $contact->rname;
        $contact_card = org_openpsa_widgets_contact::get($invoice->customerContact);
        $entry['contact'] = $contact_card->show_inline();
    } catch (midcom_error $e) {
    }
    $entry['sum'] = $invoice->sum;
    $entry['index_vat'] = $invoice->vat;
    $entry['vat'] = $invoice->vat . ' %';
    $entry['vat_sum'] = $vat_sum;
    $entries[] = $entry;
}
echo '<script type="text/javascript">//<![CDATA[';
echo "\nvar " . $grid_id . '_entries = ' . json_encode($entries);
echo "\n//]]></script>";
?>

<div class="report &(data['table_class']); org_openpsa_invoices full-width">
Пример #20
0
<?php

$link =& $data['link'];
$task =& $data['other_obj'];
?>

<li class="&(data['type']);" id="org_openpsa_relatedto_line_&(link['guid']);">
    <span class="icon">&(data['icon']:h);</span>
    <span class="title">&(data['title']:h);</span>
    <ul class="metadata">
    <?php 
// Deadline
echo "<li>" . midcom::get('i18n')->get_string('deadline', 'org.openpsa.projects') . ": " . strftime('%x', $task->end) . "</li>";
// Resources
echo "<li>" . midcom::get('i18n')->get_string('resources', 'org.openpsa.projects') . ": ";
$task->get_members();
foreach ($task->resources as $resource_id => $confirmed) {
    $resource_card = org_openpsa_widgets_contact::get($resource_id);
    echo $resource_card->show_inline() . " ";
}
echo "</li>\n";
?>
 </ul>
 <div id="org_openpsa_relatedto_details_&(task.guid);" class="details hidden" style="display: none;">
 </div>
<?php 
//TODO: necessary JS stuff to load details (which should in turn include the tasks own relatedtos) via AHAH
org_openpsa_relatedto_handler_relatedto::render_line_controls($link, $data['other_obj']);
?>
</li>
Пример #21
0
    }
} catch (midcom_error $e) {
    $product = false;
    $unit = $data['l10n']->get('unit');
}
?>
<div class="org_openpsa_sales_salesproject_deliverable &(status);">
    <div class="sidebar">
        <div class="contacts area">
            <?php 
echo "<h2>" . $data['l10n']->get('customer') . "</h2>\n";
$customer = $data['salesproject']->get_customer();
echo "<dl>\n<dt>\n" . $customer->render_link() . "</dl>\n</dt>\n";
$contacts = $data['salesproject']->contacts;
foreach ($contacts as $contact_id => $active) {
    $person_card = org_openpsa_widgets_contact::get($contact_id);
    $person_card->show();
}
?>
        </div>

        <?php 
if ($product) {
    ?>
        <div class="products area">
            <?php 
    echo "<h2>" . $data['l10n']->get('product') . "</h2>\n";
    echo $product->render_link() . "\n";
    ?>
        </div>
        <?php 
Пример #22
0
 public function _on_handle($handler, $args)
 {
     org_openpsa_widgets_contact::add_head_elements();
     $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.invoices/invoices.css");
 }
Пример #23
0
$url = midcom_connection::get_url('self') . "midcom-permalink-{$page->guid}";
?>
<tr>
    <td>
        <a rel="note" class="subject url" href="&(url);">&(page.title);</a>
    </td>
    <td>
        &(version_string:h);
    </td>
    <td class="revisor">
        <?php 
if ($history['user']) {
    $user = midcom::get('auth')->get_user($history['user']);
    if (is_object($user)) {
        if (class_exists('org_openpsa_widgets_contact')) {
            $user_card = org_openpsa_widgets_contact::get($user->guid);
            $person_label = $user_card->show_inline();
        } else {
            $person = $user->get_storage();
            $person_label = $person->name;
        }
    }
    echo "                    {$person_label}\n";
} else {
    if ($history['ip']) {
        echo "                    {$history['ip']}\n";
    }
}
?>
    </td>
    <td>
Пример #24
0
<?php

$contact = new org_openpsa_widgets_contact($data['person']);
?>
<tr>
    <td>
        <?php 
echo $contact->show();
?>
    </td>

    <td>
        <?php 
$data['datamanager']->display_view();
?>
    </td>
</tr>
Пример #25
0
 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_latest($handler_id, array $args, array &$data)
 {
     $this->_request_data['latest_pages'] = array();
     $this->_max_pages = $this->_config->get('latest_count');
     // Start by looking for items within last two weeks
     $from = mktime(0, 0, 0, date('m'), date('d') - 14, date('Y'));
     $this->_seek_updated($from);
     $i = 0;
     while ($this->_updated_pages < $this->_max_pages && $i < 20) {
         // Expand seek by another two weeks
         $to = $from;
         $from = mktime(0, 0, 0, date('m', $to), date('d', $to) - 14, date('Y', $to));
         $this->_seek_updated($from, $to);
         $i++;
     }
     $data['view_title'] = sprintf($this->_request_data['l10n']->get('latest updates in %s'), $this->_topic->extra);
     midcom::get('head')->set_pagetitle($data['view_title']);
     $this->add_breadcrumb('latest/', $data['view_title']);
     org_openpsa_widgets_contact::add_head_elements();
 }
Пример #26
0
 /**
  * function to add css & toolbar-items
  */
 private function _prepare_output()
 {
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $this->_relocate_url, MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('back'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png'));
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $this->_request_data['url_prefix'] . "create/" . $this->_current_object->guid . "/", MIDCOM_TOOLBAR_LABEL => midcom::get('i18n')->get_string('add journal entry', 'org.openpsa.relatedto'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new-text.png'));
     org_openpsa_widgets_contact::add_head_elements();
 }
Пример #27
0
<script type="text/javascript">
    <?php 
//add static data to jqgrid if wanted
$start = true;
if (!array_key_exists('dynamic_load', $data) && array_key_exists('entries', $data)) {
    $rows = array();
    foreach ($data['entries'] as $entry) {
        $row = array('id' => $entry->id, 'index_name' => $entry->title, 'description' => $entry->text, 'index_date' => $entry->followUp);
        $link_html = "<a href='" . $data['url_prefix'] . "edit/" . $entry->guid . "/'>";
        $link_html .= "<span >" . $entry->title . "</span></a>";
        $row['name'] = $link_html;
        $row['date'] = date('Y-m-d', $entry->metadata->created);
        try {
            $creator = org_openpsa_contacts_person_dba::get_cached($entry->metadata->creator);
            $row['creator_index'] = $creator->rname;
            $creator_card = org_openpsa_widgets_contact::get($entry->metadata->creator);
            $row['creator'] = $creator_card->show_inline();
        } catch (midcom_error $e) {
            $row['creator_index'] = '';
            $row['creator'] = '';
        }
        if ($entry->closed) {
            $row['closed'] = midcom::get('i18n')->get_string('finished', 'org.openpsa.relatedto');
        } else {
            $row['closed'] = midcom::get('i18n')->get_string('open', 'org.openpsa.relatedto');
        }
        $rows[] = $row;
    }
    echo 'var entries = ' . json_encode($rows) . ";\n";
}
?>
Пример #28
0
 echo "<row>";
 echo "<cell>" . $document->id . "</cell>";
 echo "<cell><![CDATA[" . $document->title . "]]></cell>";
 $class = 'document ' . $document->get_class();
 $link_html = "<![CDATA[";
 $link_html .= "<a href='" . $prefix . $path . "document/" . $document->guid . "/' class='" . $class . "'>";
 $link_html .= "<img class='document_icon' src='" . $icon . "' />";
 $link_html .= "<span>" . $document->title . "</span></a>";
 $link_html .= "]]>";
 echo "<cell>" . $link_html . "</cell>";
 echo "<cell> " . $download_url . "</cell>";
 //set contact-widget
 if (empty($document->author)) {
     $author = org_openpsa_widgets_contact::get($document->metadata->creator);
 } else {
     $author = org_openpsa_widgets_contact::get($document->author);
 }
 // creator_index, creator-vcard & revised date
 echo "<cell>" . $author->contact_details['lastname'] . ", " . $author->contact_details['firstname'] . "</cell>";
 echo "<cell><![CDATA[<span class='jqgrid_person'>" . $author->show_inline() . "</span>]]></cell>";
 echo "<cell> " . $document->metadata->revised . "</cell>";
 echo "<cell><![CDATA[<span class='jqgrid_date'>" . date("d.m.Y H:m", $document->metadata->revised) . "</span>]]></cell>";
 //filesize-index & modified file_size
 echo "<cell>" . $file_size . "</cell>";
 echo "<cell><![CDATA[<span class='jqgrid_size'>" . midcom_helper_misc::filesize_to_string($file_size) . "</span>]]></cell>";
 //level & parent of document
 echo "<cell>" . $level . "</cell>";
 echo "<cell>" . $parent . "</cell>";
 // leaf = true , expanded = false
 echo "<cell>true</cell>";
 echo "<cell>false</cell>";
Пример #29
0
<?php

// Display the member
$contact = new org_openpsa_widgets_contact($data['person']);
$contact->show_groups = false;
$checked = '';
if ($data['subscribed']) {
    $checked = ' checked="checked"';
}
$contact->prefix_html = "<input style=\"float: right;\"{$checked} type=\"checkbox\" class=\"org_openpsa_calendar_filters_person\" id=\"org_openpsa_calendar_filters_{$data['person']->guid}\" title=\"" . $data['l10n']->get('show calendar') . "\" value=\"{$data['person']->guid}\" />";
$contact->show();
Пример #30
0
 public function _on_initialize()
 {
     org_openpsa_widgets_contact::add_head_elements();
     $this->module = 'invoices';
     $this->_initialize_datamanager();
 }