diff --git a/language/en-GB/en-GB.ini b/language/en-GB/en-GB.ini index a7ce1a11..e976c847 100644 --- a/language/en-GB/en-GB.ini +++ b/language/en-GB/en-GB.ini @@ -58,6 +58,7 @@ COBALT_COMPANY_DEAL_PERSON = "Company, Deal, Person" COBALT_ASSOCIATE = "Associate to" COBALT_ASSOCIATED_DEALS = "Associated Deals" COBALT_HELLO = "Hello" +COBALT_COMPANY_WEBSITE="Website" COBALT_DEAL_HEADER="Add Deal" COBALT_DEAL_NAME="Name" @@ -1719,3 +1720,18 @@ POSTGRESQL="PostgreSQL" SQLAZURE="Microsoft SQL Azure" SQLITE="SQLite" SQLSRV="Microsoft SQL Server" + +; Edit page for custom fields +COBALT_EDITING_CUSTOM_FIELD_SELECT_TYPE="Select Custom Field Type" +COBALT_EDITING_CUSTOM_FIELD_INFORMATION="Field Information" +COBALT_EDITING_CUSTOM_FIELD_NUMERIC_FIELD_DESC="Numeric Fields can be used to capture items such as product units or other numeric values related to your companies." +COBALT_EDITING_CUSTOM_FIELD_REQUIRED="Make this field a required entry." +COBALT_EDITING_CUSTOM_FIELD_TEXT_FIELD_DESC="Text Fields are used to capture free form text. Examples: Billing Street Address, Email Address." +COBALT_EDITING_CUSTOM_FIELD_CURRENCY_FIELD="Currency Fields are used to capture items that have a $ monetary value. Examples: Service Revenue $, Product Sales $" +COBALT_EDITING_CUSTOM_FIELD_PICKLIST_FIELD_DESC="Picklist fields allow you to specify a list of pre-defined values for a user to pick from. Examples: Industry, Competitor, Regions, Product or Service Interest." +COBALT_EDITING_CUSTOM_FIELD_ENTER_CHOICE="Enter Choice" +COBALT_EDITING_CUSTOM_FIELD_REMOVE="Remove" +COBALT_EDITING_CUSTOM_FIELD_ADD_MORE_CHOICES="Add More Choices" +COBALT_EDITING_CUSTOM_FIELD_SELECT_MORE_THAN_ONE="Users can select more than one value" +COBALT_EDITING_CUSTOM_FIELD_DATE_FIELD_DESC="Date fields allow you to capture important dates related to your companies." +COBALT_PERSON_CUSTOM_FIELDS_DISPLAY="Custom fields" diff --git a/src/Cobalt/Helper/CobaltHelper.php b/src/Cobalt/Helper/CobaltHelper.php index 154203f4..da567ad0 100644 --- a/src/Cobalt/Helper/CobaltHelper.php +++ b/src/Cobalt/Helper/CobaltHelper.php @@ -84,7 +84,9 @@ public static function storeCustomCf($id,$cf_data,$type) $date = DateHelper::formatDBDate(date('Y-m-d H:i:s')); //Loop through $cf_data array to update/insert - for ( $i=0; $i $value) { if (strstr($name, 'custom_') && !strstr($name, '_input') && !strstr($name, "_hidden")) @@ -182,14 +182,11 @@ public function store($data = null) //bind to cf tables for deal & person association if (isset($data['deal_id']) && $data['deal_id']) { - $deal = array( - 'association_id = ' . $data['deal_id'], - 'association_type="deal"', - 'person_id = ' . $row->id, - "created = '$date'" - ); + $columns = array('association_id', 'association_type', 'person_id', 'created'); + + $values = array($data['deal_id'], $this->getDb()->quote('deal'), $row->id, $this->getDb()->quote($date)); - if (!$this->dealsPeople($deal)) + if (!$this->dealsPeople($columns, $values)) { return false; } @@ -239,16 +236,16 @@ public function associateJoomlaUser($email) /* * Method to link deals and people in cf tables */ - public function dealsPeople($cfdata) + public function dealsPeople($columns, $values) { $db = $this->getDb(); - // TODO - Refactor to use insert/columns/values methods instead - return $db->setQuery( - $db->getQuery(true) - ->insert('#__people_cf') - ->set($cfdata) - )->execute(); + $query + ->insert($db->quoteName('#__people_cf')) + ->columns($db->quoteName($columns)) + ->values(implode(',', $values)); + + return $db->setQuery($query)->execute(); } /** diff --git a/src/Cobalt/View/Companies/tmpl/company.php b/src/Cobalt/View/Companies/tmpl/company.php index cde10c85..8d07119d 100644 --- a/src/Cobalt/View/Companies/tmpl/company.php +++ b/src/Cobalt/View/Companies/tmpl/company.php @@ -266,7 +266,8 @@ twitter_user) { ?>

- tweets) ){ for ($i = 0; $i < count($company->tweets); $i++) { + tweets); + if ( isset($company->tweets) ){ for ($i = 0; $i < $total; $i++) { $tweet = $company->tweets[$i]; ?>
diff --git a/src/Cobalt/View/Companies/tmpl/edit.php b/src/Cobalt/View/Companies/tmpl/edit.php index 58148161..bc0737a5 100644 --- a/src/Cobalt/View/Companies/tmpl/edit.php +++ b/src/Cobalt/View/Companies/tmpl/edit.php @@ -315,11 +315,7 @@ class="form-control"
- - edit_custom_fields_view->display(); ?> - + edit_custom_fields_view->render(); ?>
company->id) && $this->company->id) { ?> diff --git a/src/Cobalt/View/Companycustom/tmpl/edit.php b/src/Cobalt/View/Companycustom/tmpl/edit.php index 8036b6fd..6f77719e 100644 --- a/src/Cobalt/View/Companycustom/tmpl/edit.php +++ b/src/Cobalt/View/Companycustom/tmpl/edit.php @@ -45,13 +45,13 @@
- Field Information +
@@ -68,40 +68,40 @@
    -
  • Numeric Fields can be used to capture items such as product units or other numeric values related to your companies.
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Text Fields are used to capture free form text. Examples: Billing Street Address, Email Address.
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Currency Fields are used to capture items that have a $ monetary value. Examples: Service Revenue $, Product Sales $
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Picklist fields allow you to specify a list of pre-defined values for a user to pick from. Examples: Industry, Competitor, Regions, Product or Service Interest.
  • +
custom->values) && $this->custom->values != null) { @@ -111,7 +111,7 @@
- + @@ -122,9 +122,9 @@
Enter Choice Remove
- + - +
Enter Choice Remove
@@ -132,17 +132,17 @@
- +
Add More Choices
- + - +
custom->multiple_selections) echo 'checked'; ?> />Users can select more than one value
custom->required) echo 'checked'; ?> />Make this field a required entry.
@@ -150,21 +150,21 @@
- + - +
Enter Choice Remove
    -
  • Date fields allow you to capture important dates related to your companies.
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
diff --git a/src/Cobalt/View/Custom/tmpl/default.php b/src/Cobalt/View/Custom/tmpl/default.php index 88d8adeb..a8733e02 100644 --- a/src/Cobalt/View/Custom/tmpl/default.php +++ b/src/Cobalt/View/Custom/tmpl/default.php @@ -10,11 +10,16 @@ // no direct access defined( '_CEXEC' ) or die( 'Restricted access' ); +echo '
'; +echo '
'; + $custom = DropdownHelper::generateCustom($this->type, is_array($this->item) ? $this->item['id'] : $this->item->id ); $count = 0; echo '
'; echo ''; +$item_id = is_array($this->item) ? $this->item['id'] : $this->item->id; + if (count($custom) > 0) { foreach ($custom as $field => $value) @@ -57,18 +62,18 @@
- Field Information +
- + custom->id) { ?> + + @@ -65,40 +67,40 @@
    -
  • Numeric Fields can be used to capture items such as product units or other numeric values related to your companies.
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Text Fields are used to capture free form text. Examples: Billing Street Address, Email Address.
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Currency Fields are used to capture items that have a $ monetary value. Examples: Service Revenue $, Product Sales $
  • +
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
    -
  • Picklist fields allow you to specify a list of pre-defined values for a user to pick from. Examples: Industry, Competitor, Regions, Product or Service Interest.
  • +
custom->values) && $this->custom->values != null) { @@ -108,9 +110,9 @@
- + - +
Enter Choice Remove
@@ -119,9 +121,9 @@
- + - +
Enter Choice Remove
@@ -129,17 +131,17 @@
- +
Add More Choices
- + - +
custom->multiple_selections) echo 'checked'; ?> />Users can select more than one value
custom->required) echo 'checked'; ?> />Make this field a required entry.
@@ -147,21 +149,21 @@
- + - +
Enter Choice Remove
- +
custom->required) echo 'checked'; ?> />Make this field a required entry.
diff --git a/src/Cobalt/View/Import/Html.php b/src/Cobalt/View/Import/Html.php index cedea048..4d1e1cab 100644 --- a/src/Cobalt/View/Import/Html.php +++ b/src/Cobalt/View/Import/Html.php @@ -28,14 +28,13 @@ public function render($tpl = null) $doc = $app->getDocument(); $doc->addScript($app->get('uri.media.full').'js/import_manager.js'); - if (count($_FILES) > 0) - { - $model = new ImportModel; + $file = $app->input->files->get('document'); - foreach ($_FILES as $file) - { - $import_data = $model->readCSVFile($file['tmp_name']); - } + if (!empty($file) && $file['error']==0) + { + $model = new ImportModel; + + $import_data = $model->readCSVFile($file['tmp_name']); $this->headers = $import_data['headers']; unset($import_data['headers']); diff --git a/src/Cobalt/View/Import/tmpl/review.php b/src/Cobalt/View/Import/tmpl/review.php index ad55b32f..5784fc71 100644 --- a/src/Cobalt/View/Import/tmpl/review.php +++ b/src/Cobalt/View/Import/tmpl/review.php @@ -10,6 +10,8 @@ // no direct access defined( '_CEXEC' ) or die( 'Restricted access' ); ?> +$memoryFlag = false; +

import_data) > 0 ) { ?>

diff --git a/src/Cobalt/View/People/tmpl/edit.php b/src/Cobalt/View/People/tmpl/edit.php index 24eff352..49bce5dd 100644 --- a/src/Cobalt/View/People/tmpl/edit.php +++ b/src/Cobalt/View/People/tmpl/edit.php @@ -21,6 +21,12 @@ $person['status_id'] = ''; } +$isLeadChecked = ''; +if ( !empty($person['type']) ) +{ + if ( $person['type'] == "Lead" ) $isLeadChecked = 'checked'; +} + if ( array_key_exists('company_id',$person) ) { $company_id = $person['company_id']; } elseif ($app->input->get('company_id')) { $company_id = $app->input->get('company_id');} else {$company_id = "";} ?>