Exemplo n.º 1
0
 $do_user = new User();
 $do_user->get_all_users();
 $group_transfer = false;
 $do_group = new Group();
 $do_group->get_all_groups();
 //if there is no group then there is no group to trasfer data
 if ($do_group->getNumRows() > 0) {
     $group_transfer = true;
 }
 if (true === $hide_group) {
     $group_transfer = false;
 }
 $do_fields = new CRMFields();
 $do_fields->query("select `idfields` from `fields` where `field_name` = 'assigned_to' AND `idmodule` = ?", array($module_id));
 $fieldid = 0;
 if ($do_fields->getNumRows() > 0) {
     $do_fields->next();
     $fieldid = $do_fields->idfields;
 }
 $e_change = new Event("CRMEntity->eventChangeAssignedToEntity");
 $e_change->addParam("ids", $ids);
 $e_change->addParam("module", $module);
 $e_change->addParam("module_id", $module_id);
 $e_change->addParam("fieldid", $fieldid);
 $e_change->addParam("next_page", NavigationControl::getNavigationLink($obj, $return_page));
 if ($group_transfer === true) {
     $e_change->addParam("group_transfer_opt", "yes");
 } else {
     $e_change->addParam("group_transfer_opt", "no");
 }
 echo '<form class="form-horizontal" id="CRMEntity__eventChangeAssignedToEntity" name="CRMEntity__eventChangeAssignedToEntity" action="/eventcontroler.php" method="post">';
Exemplo n.º 2
0
 /**
  * function to get data history display text
  * @param object $obj
  * @param boolean $link
  * @param boolean $user_history
  * @return array $ret_array
  */
 public function get_data_history_display_text($obj, $link = false, $user_history = false)
 {
     $row1 = '<strong>' . $obj->firstname . ' ' . $obj->lastname . '</strong> ' . _('on ') . '<i>' . i18nDate::i18n_long_time(TimeZoneUtil::convert_to_user_timezone($obj->date_modified, true)) . '</i>';
     switch ($obj->action) {
         case 'add':
             if ($user_history === true) {
                 $row2 = _('Added') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
             } else {
                 $row2 = _('Added the record');
             }
             break;
         case 'delete':
             if ($user_history === true) {
                 $row2 = _('Deleted') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
             } else {
                 $row2 = _('Deleted the record');
             }
             break;
         case 'edit':
             if ($user_history === true) {
                 $row2 = _('Updated') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
             } else {
                 $row2 = _('Updated the record');
             }
             break;
         case 'value_changes':
             $do_crm_fields = new CRMFields();
             $do_crm_fields->getId($obj->idfields);
             if ($do_crm_fields->getNumRows() > 0) {
                 $field_label = $do_crm_fields->field_label;
                 $old_value = $obj->old_value;
                 $new_value = $obj->new_value;
                 if ($do_crm_fields->field_type == 9) {
                     $old_value = FieldType9::display_value($old_value);
                     $new_value = FieldType9::display_value($new_value);
                 }
                 if ($user_history === true) {
                     $row2 = _('Changed value in') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule) . ' , ' . $field_label . ' :: ' . $old_value . ' >>> ' . $new_value;
                 } else {
                     $row2 = _('Changed') . ' ' . $field_label . ' :: ' . $old_value . ' >>> ' . $new_value;
                 }
             }
             $do_crm_fields->free();
             break;
     }
     if ($obj->user_avatar != '') {
         $avatar_path = $GLOBALS['AVATAR_DISPLAY_PATH'];
         $thumb = $avatar_path . '/ths_' . $obj->user_avatar . '.' . $obj->file_extension;
     }
     if ($link === true) {
         $detail_url = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$obj->idmodule]["name"], "detail", $obj->id_referrer);
         $row2 .= '&nbsp;<a href="' . $GLOBALS['SITE_URL'] . $detail_url . '">' . $GLOBALS['SITE_URL'] . $detail_url . '</a>';
     }
     $ret_array = array("avatar" => $thumb, "row1" => $row1, "row2" => $row2);
     return $ret_array;
 }
Exemplo n.º 3
0
    /**
     * function to export list data as PDF
     * @param string $file_name
     * @param array $fields_info
     * @param integer $module_id
     * Library used for PDF generation is tcpdf http://www.tcpdf.org/
     * @see http://www.tcpdf.org/performances.php
     */
    public function export_detail_data_pdf($module, $module_id, $record_id)
    {
        $do_crmfields = new CRMFields();
        $do_block = new Block();
        $do_block->get_block_by_module($module_id);
        $module_obj = new $module();
        $module_obj->getId($record_id);
        if ($module_obj->getNumRows() > 0) {
            $do_crmfields = new CRMFields();
            include_once THIRD_PARTY_LIB_PATH . "/mpdf/mpdf.php";
            $pdf = new mPDF();
            $do_crm_entity = new CRMEntity();
            $entity_identity = $do_crm_entity->get_entity_identifier($record_id, $module, $module_obj);
            $html = '';
            $html .= '<div style="float:left"><h3>' . $entity_identity . '</h3></div><div style="clear:both;"></div>';
            while ($do_block->next()) {
                $html .= '
				<table cellspacing="0" cellpadding="1" border="1" width="800px;">
					<tbody>
						<tr style="background-color:#eeeeee;line-height:100%;">
							<td colspan="4" height="35"><b>' . $do_block->block_label . '</b></td>
						</tr>';
                $do_crmfields->get_form_fields_information($do_block->idblock, $module_id);
                $num_fields = $do_crmfields->getNumRows();
                $tot_count = 0;
                while ($do_crmfields->next()) {
                    $fieldobject = 'FieldType' . $do_crmfields->field_type;
                    $fields_count++;
                    $tot_count++;
                    if ($tot_count == 1 || $tot_count % 2 != 0) {
                        $html .= '<tr>';
                    }
                    $html .= '<td style="background-color:#FDFFBD;width:25%;" height="20">' . $do_crmfields->field_label . '</td>';
                    $fld_name = $do_crmfields->field_name;
                    $field_value = '';
                    if ($do_crmfields->field_type == 12) {
                        $field_value = $fieldobject::display_value($module_obj->{$fld_name}, 'l');
                    } elseif ($do_crmfields->field_type == 11) {
                        $field_value = $fieldobject::display_value($module_obj->{$fld_name}, $module, $sqcrm_record_id, $fld_name, true);
                    } else {
                        $field_value = $do_crmfields->display_field_value($module_obj->{$fld_name}, $do_crmfields->field_type, $fieldobject, $module_obj, $module_id, false);
                    }
                    $html .= '<td height="20" style="width:25%;">' . $field_value . '</td>';
                    if ($tot_count != 1 && $tot_count % 2 == 0) {
                        $html .= '</tr>';
                    }
                    if ($num_fields == $tot_count && $tot_count % 2 != 0) {
                        $html .= '
							<td style="background-color:#FDFFBD;width:25%" height="20">&nbsp;</td>
							<td height="20" style="width:25%">&nbsp;</td>
						</tr>';
                    }
                }
                $html .= '</tbody></table>';
                $html .= '<br>';
            }
            $pdf->WriteHTML($html);
            $pdf->Output($module . '_' . $record_id . '.pdf', 'D');
            exit;
        }
    }
Exemplo n.º 4
0
echo _('Save');
?>
"/>
						</div>
						<div class="clear_float"></div>
						<hr class="form_hr">
						<?php 
while ($do_block->next()) {
    ?>
							<div class="box_content_header"><?php 
    echo $do_block->block_label;
    ?>
</div>
							<?php 
    $do_crmfields->get_form_fields_information($do_block->idblock, $module_id);
    $num_fields = $do_crmfields->getNumRows();
    $tot_count = 0;
    while ($do_crmfields->next()) {
        $fieldobject = 'FieldType' . $do_crmfields->field_type;
        $tot_count++;
        if ($tot_count == 1 || $tot_count % 2 != 0) {
            ?>
								<div class="row-fluid">
								<?php 
        }
        ?>
									<div class="span6">
										<div class="control-group">  
											<label class="control-label" for="<?php 
        echo $do_crmfields->field_name;
        ?>
Exemplo n.º 5
0
         $product_service_tax = $tax_settings->product_service_tax();
         if (is_array($product_service_tax) && count($product_service_tax) > 0) {
             foreach ($product_service_tax as $key => $val) {
                 $module_fields[$val["tax_name"]] = array("field_name" => $val["tax_name"], "field_label" => $val["tax_name"], "field_validation" => '');
             }
             continue;
         }
     }
     $data = array("field_name" => $do_crmfields->field_name, "field_label" => $do_crmfields->field_label, "field_validation" => $do_crmfields->field_validation);
     $module_fields[$do_crmfields->idfields] = $data;
 }
 $row_length = sizeof($mapping_first_row);
 $_SESSION["do_import"]->set_csv_row_length($row_length);
 $mandatory_fields = array();
 $do_crmfields->get_field_validation_info($import_module_id);
 if ($do_crmfields->getNumRows() > 0) {
     while ($do_crmfields->next()) {
         if ($do_crmfields->field_name == 'assigned_to') {
             continue;
         }
         if ($do_crmfields->field_name == 'related_to' && $import_module_id == 5) {
             $related_to_contact = $do_crmfields->field_label . ' (' . $_SESSION["do_module"]->modules_full_details[4]["name"] . ')';
             $related_to_org = $do_crmfields->field_label . ' (' . $_SESSION["do_module"]->modules_full_details[6]["name"] . ')';
             $field_label = $related_to_contact . ' ' . _('or') . ' ' . $related_to_org;
             $data = array("field_name" => $do_crmfields->field_name, "field_label" => $field_label, "field_type" => $do_crmfields->field_type, "field_validation" => $do_crmfields->field_validation);
         } else {
             $data = array("field_name" => $do_crmfields->field_name, "field_label" => $do_crmfields->field_label, "field_type" => $do_crmfields->field_type, "field_validation" => $do_crmfields->field_validation);
         }
         $mandatory_fields[] = $data;
     }
 }