\n"
-"Language-Team: Russian \n"
-"Language: ru\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.2-dev\n"
-
-#: plugins/bsc/controllers/bsc_plugin_admin_controller.rb:11
-#, fuzzy
-msgid "Your Bsc was created."
-msgstr "Ваш E-Mail %s активирован"
-
-#: plugins/bsc/controllers/bsc_plugin_admin_controller.rb:21
-#, fuzzy
-msgid "Enterprises validated."
-msgstr "Утвердители компаний"
-
-#: plugins/bsc/controllers/bsc_plugin_admin_controller.rb:24
-#, fuzzy
-msgid "Enterprise validations couldn't be saved."
-msgstr "Утвердители компаний"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:38
-#, fuzzy
-msgid "This Bsc associations were saved successfully."
-msgstr "Все файлы успешно обновлены"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:42
-#, fuzzy
-msgid "This Bsc associations couldn't be saved."
-msgstr "Файл не может быть сохранен"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:71
-#, fuzzy
-msgid "Enterprise ownership transferred."
-msgstr "Домашняя страница компании"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:85
-#, fuzzy
-msgid "Enterprise was created in association with %s."
-msgstr "Регистрация предприятия: \"%s\""
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:117
-#, fuzzy
-msgid "Contract created."
-msgstr "Контактный email"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:120
-msgid "Contract created but some products could not be added."
-msgstr ""
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:131
-msgid "Contract doesn't exists! Maybe it was already removed."
-msgstr ""
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:140
-#, fuzzy
-msgid "Could not edit such contract."
-msgstr "Невозможно обновить продукт"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:170
-#, fuzzy
-msgid "Contract edited."
-msgstr "Контактный email"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:173
-#, fuzzy
-msgid "Contract edited but some products could not be added."
-msgstr "Блок персональной информации"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:183
-#, fuzzy
-msgid "Contract removed."
-msgstr "Тело статьи"
-
-#: plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb:185
-#, fuzzy
-msgid "Contract could not be removed. Sorry! ^^"
-msgstr "Блок персональной информации"
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:10
-#, fuzzy
-msgid "BSC association"
-msgstr "Основная информация"
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:18
-#, fuzzy
-msgid "%{requestor} wants to associate this enterprise with %{linked_subject}."
-msgstr "'%{user} хочет активировать E-Mail '%{email}' "
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:35
-msgid "%{enterprise} accepted your request to associate it with %{bsc}."
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:39
-msgid "%{enterprise} rejected your request to associate it with %{bsc}."
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:41
-msgid ""
-"Here is the reject explanation left by the administrator:\n"
-"\n"
-"%{reject_explanation}"
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin/associate_enterprise.rb:46
-#, fuzzy
-msgid "%{requestor} wants assoaciate %{bsc} as your BSC."
-msgstr "%s хочет быть вашим другом"
-
-#: plugins/bsc/lib/bsc_plugin/mailer.rb:7
-msgid "[%s] Bsc management transferred to you."
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin/bsc.rb:28
-#, fuzzy
-msgid "Bsc info and settings"
-msgstr "Инфо профиля и настройки"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:33
-#, fuzzy
-msgid "Opened"
-msgstr "открыть"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:33
-#, fuzzy
-msgid "Negotiating"
-msgstr "Настройки"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:33
-#, fuzzy
-msgid "Executing"
-msgstr "Редактирование"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:33
-#, fuzzy
-msgid "Closed"
-msgstr "Закрыть"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:46
-#, fuzzy
-msgid "Federal"
-msgstr "Основная задача"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:59
-#, fuzzy
-msgid "ProjectA"
-msgstr "Продукт"
-
-#: plugins/bsc/lib/bsc_plugin/contract.rb:59
-#, fuzzy
-msgid "ProjectB"
-msgstr "Продукт"
-
-#: plugins/bsc/lib/bsc_plugin.rb:10
-#, fuzzy
-msgid "Adds the Bsc feature"
-msgstr "Системные возможности"
-
-#: plugins/bsc/lib/bsc_plugin.rb:14
-#, fuzzy
-msgid "Create Bsc"
-msgstr "Создать"
-
-#: plugins/bsc/lib/bsc_plugin.rb:15
-#, fuzzy
-msgid "Validate Enterprises"
-msgstr "Подтвердить компанию"
-
-#: plugins/bsc/lib/bsc_plugin.rb:20
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb:1
-#, fuzzy
-msgid "Manage associated enterprises"
-msgstr "Verwalte Unternehmensfelder"
-
-#: plugins/bsc/lib/bsc_plugin.rb:21 plugins/bsc/lib/bsc_plugin.rb:27
-msgid "Transfer ownership"
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin.rb:22
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:1
-#, fuzzy
-msgid "Manage contracts"
-msgstr "Управлять контактами"
-
-#: plugins/bsc/lib/bsc_plugin.rb:98
-msgid "Bsc"
-msgstr ""
-
-#: plugins/bsc/lib/bsc_plugin.rb:109
-#: plugins/bsc/views/shared/_fields.html.erb:53
-msgid "Contact"
-msgstr "Контакт"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:5
-#: plugins/bsc/views/shared/_fields.html.erb:5
-msgid "Basic information"
-msgstr "Основная информация"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:7
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:6
-#, fuzzy
-msgid "Client type"
-msgstr "Тип контента"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:8
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:7
-#, fuzzy
-msgid "Business type"
-msgstr "Название работы"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:11
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:5
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:10
-msgid "Status"
-msgstr "Статус"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:12
-#, fuzzy
-msgid "Number of producers"
-msgstr "Количество новостей"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:13
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:35
-#, fuzzy
-msgid "Supply period"
-msgstr "Поставщик: %s"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:27
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:23
-#, fuzzy
-msgid "Quantity"
-msgstr "Качество"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:28
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:24
-#, fuzzy
-msgid "Unit price"
-msgstr "Прайс:"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:38
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:27
-#, fuzzy
-msgid "Total"
-msgstr "Получатель:"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb:48
-#, fuzzy
-msgid "Annotations"
-msgstr "Текст приглашения"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb:4
-msgid "Associations awaiting approval:"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb:16
-#: plugins/bsc/views/bsc_plugin_admin/validate_enterprises.html.erb:5
-#, fuzzy
-msgid "Type in a search term for enterprise"
-msgstr "Отключить поиск по компаниям"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb:19
-#, fuzzy
-msgid "Add new enterprise"
-msgstr "Одна компания"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:17
-#, fuzzy
-msgid "Sort by"
-msgstr "Отправлено %s."
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:18
-msgid "Date(newest first)"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:18
-msgid "Date(oldest first)"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:19
-msgid "Client name(A-Z)"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:19
-msgid "Client name(Z-A)"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:24
-#, fuzzy
-msgid "There are no contracts at all."
-msgstr "У вас еще нет контактов"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:35
-msgid "Are you sure?"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb:45
-#, fuzzy
-msgid "Create new contract"
-msgstr "Создать новое сообщество"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:18
-#, fuzzy
-msgid "Type in search term for enterprise"
-msgstr "Отключить поиск по компаниям"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:31
-#, fuzzy
-msgid "Add new product"
-msgstr "Управление продуктами"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb:57
-#, fuzzy
-msgid "Type in a search term for product"
-msgstr "Отключить поиск по компаниям"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/new_contract.html.erb:1
-#: plugins/bsc/views/bsc_plugin_myprofile/edit_contract.html.erb:1
-#, fuzzy
-msgid "New contract"
-msgstr "Весь контент"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb:2
-#, fuzzy
-msgid "Existing enterprises:"
-msgstr "Unternehmen ändern"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb:3
-msgid ""
-"Were found %{count} enterprises with similar names on the same city, you can "
-"decide to associate one of them or create the new enterprise confirming the "
-"informations you typed in."
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb:20
-#, fuzzy
-msgid "Associate"
-msgstr "Активировать"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb:1
-msgid "Transfer Ownership"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb:4
-msgid ""
-"This option allows you to transfer this enterprise's management to another "
-"user. This action will remove all the current administrators. Be careful "
-"when confirming this procedure."
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb:8
-#, fuzzy
-msgid "Current administrators:"
-msgstr "Текущие участники"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb:19
-#, fuzzy
-msgid "Administrator:"
-msgstr "Администраторы:"
-
-#: plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb:22
-msgid "Type in a search term for the new administrator"
-msgstr ""
-
-#: plugins/bsc/views/bsc_plugin/mailer/admin_notification.html.erb:1
-msgid "The management of %{bsc} was transferred to you."
-msgstr ""
-
-#: plugins/bsc/views/shared/_fields.html.erb:39
-#, fuzzy
-msgid ""
-"You are about to change the address, and this will break external links to "
-"this bsc or to posts inside it. Do you really want to change?"
-msgstr ""
-"Вы собираетесь сменить адрес, это приведет к разрыву всех внешних ссылок, "
-"ведущих на вашу страницу. Вы уверены?"
-
-#: plugins/bsc/views/bsc_plugin_admin/new.html.erb:2
-#, fuzzy
-msgid "BSC registration"
-msgstr "Регистрация предприятия"
-
-#: plugins/bsc/views/bsc_plugin_admin/validate_enterprises.html.erb:1
-#, fuzzy
-msgid "Validate enterprises"
-msgstr "Подтвердить компанию"
-
-#: plugins/bsc/views/profile/_profile_tab.html.erb:2
-#, fuzzy
-msgid "Contact phone: "
-msgstr "Kontakttelefon:"
-
-#: plugins/bsc/views/profile/_profile_tab.html.erb:3
-#, fuzzy
-msgid "Email: "
-msgstr "E-Mail: %s"
diff --git a/plugins/bsc/public/contracts.js b/plugins/bsc/public/contracts.js
deleted file mode 100644
index bf2b1ca..0000000
--- a/plugins/bsc/public/contracts.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var BSCContracts = {};
-
-(function($){
- BSCContracts.onDelete = function(item){
- $('.token-input-dropdown').hide();
- $('#bsc-plugin-row-'+item.sale_id.toString()).remove();
- BSCContracts.updateTotal();
- };
-
- BSCContracts.onAdd = function(item){
- var quantity = $('#bsc-plugin-sale-'+item.sale_id.toString()+'-quantity');
- var price = $('#bsc-plugin-sale-'+item.sale_id.toString()+'-price');
- quantity.addClass('required');
- price.addClass('required');
- quantity.val(1);
- price.val(item.product_price);
- BSCContracts.updateTotal();
- };
-
- BSCContracts.newID = function(){
- if ( !this.idNum ) this.idNum = 0;
- return this.idNum++;
- };
-
- BSCContracts.newProductLine = function(item){
- var id = this.newID();
- var tr = $(' ');
- var tds = $(''+this.currencyUnit+' ').appendTo(tr);
- var input = $(' ').appendTo(tds[0]);
- var searchUrl = this.searchUrl
- .replace('ENTERPRISES', $('#involved-enterprises').val())
- .replace('SALE_ID', id)
- .replace('ADDED_PRODUCTS', $.map($('.search-product-field'), function(item){return item.value}).join(','));
- var prePopulation = [];
- var quantity = '';
- var price = '';
- var required = '';
- if(item) {
- item.sale_id = id;
- prePopulation = [item];
- quantity = item.quantity;
- price = item.product_price;
- required = 'required';
- }
- var opts = $.extend( { prePopulate: prePopulation, queryParam: input[0].name }, this.tokenInputOptions );
-
- input.keydown(function(event){ if(event.keyCode == '13') return false })
- .tokenInput(searchUrl, opts);
- $('#bsc-plugin-contract-total-row').before(tr);
- $(' ').appendTo(tds[1]);
- $(' ').appendTo(tds[2]);
- };
-
- BSCContracts.prePopulate = function(items){
- $(items).each(function(index, item){BSCContracts.newProductLine(item)});
- }
-
- BSCContracts.updateTotal = function(){
- var total = 0;
- var quantity = 0;
- var price = 0;
- $('.bsc-plugin-sales-product').each(function(index){
- quantity = $('#' + $(this).attr('id') + " .bsc-plugin-sales-quantity").val();
- price = $('#'+$(this).attr('id') + " .bsc-plugin-sales-price").val();
- total += quantity*price;
- });
- $('#bsc-plugin-sales-total-value').text(BSCContracts.currencyUnit+' '+total);
- }
-
- $(".bsc-plugin-sales-price, .bsc-plugin-sales-quantity").live('change', function(e){
- BSCContracts.updateTotal();
- });
-
- $("#bsc-plugin-add-new-product").click(function(){
- var last = $('.search-product-field:last');
- if(!last.val() && last.size() != 0){
- last.focus();
- return false;
- }
- var next_id = parseInt(last.attr('data-sale-id'))+1;
- var enterprises = $('#involved-enterprises').val().replace(/,/g,'-');
- BSCContracts.newProductLine();
- return false;
- });
-
-})(jQuery);
diff --git a/plugins/bsc/public/datepicker.js b/plugins/bsc/public/datepicker.js
deleted file mode 100644
index 3e9ff11..0000000
--- a/plugins/bsc/public/datepicker.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var dates = jQuery( "#from, #to" ).datepicker({
- defaultDate: "+1w",
- changeMonth: true,
- dateFormat: 'yy-mm-dd',
- onSelect: function( selectedDate ) {
- var option = this.id == "from" ? "minDate" : "maxDate",
- instance = jQuery( this ).data( "datepicker" ),
- date = jQuery.datepicker.parseDate(
- instance.settings.dateFormat ||
- jQuery.datepicker._defaults.dateFormat,
- selectedDate, instance.settings );
- dates.not( this ).datepicker( "option", option, date );
- }
-});
diff --git a/plugins/bsc/public/images/manage-bsc-enterprises-icon.png b/plugins/bsc/public/images/manage-bsc-enterprises-icon.png
deleted file mode 100644
index a9d92f9..0000000
Binary files a/plugins/bsc/public/images/manage-bsc-enterprises-icon.png and /dev/null differ
diff --git a/plugins/bsc/public/images/manage-bsc-enterprises.gif b/plugins/bsc/public/images/manage-bsc-enterprises.gif
deleted file mode 100644
index 53b5b1a..0000000
Binary files a/plugins/bsc/public/images/manage-bsc-enterprises.gif and /dev/null differ
diff --git a/plugins/bsc/public/images/manage-bsc-enterprises.png b/plugins/bsc/public/images/manage-bsc-enterprises.png
deleted file mode 100644
index f4bd12e..0000000
Binary files a/plugins/bsc/public/images/manage-bsc-enterprises.png and /dev/null differ
diff --git a/plugins/bsc/public/images/manage-bsc-enterprises.svg b/plugins/bsc/public/images/manage-bsc-enterprises.svg
deleted file mode 100644
index d64a42f..0000000
--- a/plugins/bsc/public/images/manage-bsc-enterprises.svg
+++ /dev/null
@@ -1,1309 +0,0 @@
-
-image/svg+xml Jakub Steiner http://jimmac.musichall.cz home return go default user directory Tuomas Kuosmanen
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/plugins/bsc/public/images/transfer-ownership.png b/plugins/bsc/public/images/transfer-ownership.png
deleted file mode 100644
index a04baa5..0000000
Binary files a/plugins/bsc/public/images/transfer-ownership.png and /dev/null differ
diff --git a/plugins/bsc/public/images/transfer-ownership.svg b/plugins/bsc/public/images/transfer-ownership.svg
deleted file mode 100644
index 6d5a653..0000000
--- a/plugins/bsc/public/images/transfer-ownership.svg
+++ /dev/null
@@ -1,1965 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/bsc/public/spinner.js b/plugins/bsc/public/spinner.js
deleted file mode 100644
index 49ad4b5..0000000
--- a/plugins/bsc/public/spinner.js
+++ /dev/null
@@ -1,5 +0,0 @@
-jQuery('#bsc-plugin-contract-spinner').spinner({
- min: 0,
- increment: 'fast',
- mouseWheel: true,
-});
diff --git a/plugins/bsc/public/style.css b/plugins/bsc/public/style.css
deleted file mode 100644
index 63377a8..0000000
--- a/plugins/bsc/public/style.css
+++ /dev/null
@@ -1,182 +0,0 @@
-@import url(jquery.ui.spinner/ui.spinner.css);
-
-.controller-profile_editor a.control-panel-bsc-enterprises {background-image: url(/plugins/bsc/images/manage-bsc-enterprises.png)}
-.controller-profile_editor .msie6 a.control-panel-bsc-enterprises {background-image: url(/plugins/bsc/images/manage-bsc-enterprises.gif)}
-
-.controller-profile_editor a.control-panel-transfer-enterprise-ownership {background-image: url(/plugins/bsc/images/transfer-ownership.png)}
-
-.ui-spinner-up{
- height: 6.5px !important;
-}
-
-.ui-spinner-down{
- height: 8.5px !important;
-}
-
-.ui-icon-triangle-1-n {
- margin-top: -4px !important;
-}
-
-.ui-icon-triangle-1-s {
- margin-left: -1px !important;
- margin-top: -3.5px !important;
-}
-
-.icon-menu-bsc {
- background-image: url(/plugins/bsc/images/manage-bsc-enterprises-icon.png);
-}
-
-#content .token-input-list {
- margin-bottom: 30px;
-}
-
-#bsc-plugin-sorter {
- text-align: right;
- margin: 3px 0px;
-}
-
-#bsc-plugin-sales-table th,
-#bsc-plugin-sales-table td {
- border: 1px solid #000;
- border-collapse: collapse;
- padding: 0px
-}
-
-#content #bsc-plugin-sales-table td .token-input-list{
- margin-bottom: 0px;
-}
-
-#bsc-plugin-sales-table {
- border: 1px solid #000;
- border-collapse: collapse;
-}
-
-#bsc-plugin-sales-table th {
- background-color: #cdcdcd;
- padding: 0px 10px;
-}
-
-.alternate-colors tr:nth-child(odd),
-.alternate-colors tr:nth-child(odd):hover td {
- background-color: #f4f4f4;
-}
-
-.alternate-colors tr:nth-child(even),
-.alternate-colors tr:nth-child(even):hover td {
- background-color: #fff;
-}
-
-#bsc-plugin-sales-table input.error{
- background-color: #F8DBDD;
- border: 1px solid #f5697c;
- margin-left: 2px;
-}
-
-.bsc-plugin-sales-price {
- width: 75%;
-}
-
-.bsc-plugin-sales-products-column {
- width: 70%;
-}
-
-.bsc-plugin-sales-quantity-column {
- width: 10%;
- text-align: center;
-}
-
-.bsc-plugin-sales-price-column {
- width: 18%;
-}
-
-#bsc-plugin-sales-add-new-row {
- padding: 0px 10px;
-}
-
-#bsc-plugin-manage-contracts-table a {
- color: #555753;
-}
-
-#bsc-plugin-manage-contracts-table {
- border:none;
-}
-#bsc-plugin-manage-contracts-table td {
- padding: 5px 10px;
-}
-
-#bsc-plugin-manage-contracts-table td.links {
- text-align: right;
-}
-
-#bsc-plugin-contracts-filter {
- float: left;
- width: 20%;
- height: 100%;
-}
-
-
-#bsc-plugin-contracts-results {
- float: left;
- width: 80%;
-}
-
-#bsc-plugin-contract-total-string,
-#bsc-plugin-contract-total {
- text-align: right;
-}
-
-.bsc-fields-table {
- border: collapse;
- width: 49%;
-}
-
-.bsc-fields-table th{
- font-size: 14px;
- padding: 0px;
-}
-
-.bsc-fields-table td {
- border: none;
- padding: 0px;
-}
-
-.bsc-fields-table tr:hover td {
- background-color: transparent;
-}
-
-.bsc-field-label {
- font-weight: bold;
-}
-
-.bsc-full-table {
- margin: 3px 0px;
-}
-
-.bsc-plugin-view-contract {
- margin-top: 10px;
-}
-
-.bsc-plugin-view-contract td {
- padding: 2px 10px !important;
-}
-
-.bsc-plugin-total {
- font-weight: bold;
-}
-
-.bsc-plugin-annotation {
- background-color: #eeeeec;
- margin: 10px 0px;
- padding: 5px 10px;
- border-radius: 5px;
-}
-
-.bsc-plugin-annotation-title {
- font-weight: bold;
- font-size: 15px;
- margin-bottom: 5px;
-}
-
-.bsc-plugin-annotation-content {
- font-style: italic;
-}
diff --git a/plugins/bsc/public/validation.js b/plugins/bsc/public/validation.js
deleted file mode 100644
index 2060814..0000000
--- a/plugins/bsc/public/validation.js
+++ /dev/null
@@ -1,4 +0,0 @@
-jQuery("#bsc-plugin-sales-form").validate({
- errorPlacement: function(error, element){element.attr('title', error.text())}
-});
-
diff --git a/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb b/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb
deleted file mode 100644
index 1b33d94..0000000
--- a/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../test/test_helper'
-require File.dirname(__FILE__) + '/../../controllers/bsc_plugin_admin_controller'
-
-# Re-raise errors caught by the controller.
-class BscPluginAdminController; def rescue_action(e) raise e end; end
-
-class BscPluginAdminControllerTest < ActionController::TestCase
-
- VALID_CNPJ = '94.132.024/0001-48'
-
- def setup
- @controller = BscPluginAdminController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- user_login = create_admin_user(Environment.default)
- login_as(user_login)
- @admin = User[user_login].person
- e = Environment.default
- e.enabled_plugins = ['BscPlugin']
- e.save!
- end
-
- attr_accessor :admin
-
- should 'create a new bsc' do
- assert_difference BscPlugin::Bsc, :count, 1 do
- post :new, :profile_data => {:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ}
- end
-
- assert_redirected_to :controller => 'profile_editor', :profile => 'sample-bsc'
- end
-
- should 'not create an invalid bsc' do
- assert_difference BscPlugin::Bsc, :count, 0 do
- post :new, :profile_data => {:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => '29837492304'}
- end
-
- assert_response 200
- end
-
- should 'set the current user as the bsc admin' do
- name = 'Sample Bsc'
- post :new, :profile_data => {:business_name => name, :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ}
- bsc = BscPlugin::Bsc.find_by_name(name)
- assert_includes bsc.admins, admin
- end
-
- should 'list correct enterprises on search' do
- # Should list if: not validated AND (name matches OR identifier matches) AND not bsc
- e1 = Enterprise.create!(:name => 'Sample Enterprise 1', :identifier => 'bli', :validated => false)
- e2 = Enterprise.create!(:name => 'Bla', :identifier => 'sample-enterprise-6', :validated => false)
- e3 = Enterprise.create!(:name => 'Blo', :identifier => 'blo', :validated => false)
- e4 = BscPlugin::Bsc.create!(:business_name => "Sample Bsc", :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ, :validated => false)
- e5 = Enterprise.create!(:name => 'Sample Enterprise 5', :identifier => 'sample-enterprise-5')
- e5.validated = true
- e5.save!
-
- get :search_enterprise, :q => 'sampl'
-
- assert_match /#{e1.name}/, @response.body
- assert_match /#{e2.name}/, @response.body
- assert_no_match /#{e3.name}/, @response.body
- assert_no_match /#{e4.name}/, @response.body
- assert_no_match /#{e5.name}/, @response.body
- end
-
- should 'save validations' do
- e1 = fast_create(Enterprise, :validated => false)
- e2 = fast_create(Enterprise, :validated => false)
- e3 = fast_create(Enterprise, :validated => false)
-
- post :save_validations, :q => "#{e1.id},#{e2.id}"
- e1.reload
- e2.reload
- e3.reload
-
- assert e1.validated
- assert e2.validated
- refute e3.validated
- end
-end
diff --git a/plugins/bsc/test/functional/bsc_plugin_myprofile_controller_test.rb b/plugins/bsc/test/functional/bsc_plugin_myprofile_controller_test.rb
deleted file mode 100644
index c99ee67..0000000
--- a/plugins/bsc/test/functional/bsc_plugin_myprofile_controller_test.rb
+++ /dev/null
@@ -1,322 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../test/test_helper'
-require File.dirname(__FILE__) + '/../../controllers/bsc_plugin_myprofile_controller'
-
-# Re-raise errors caught by the controller.
-class BscPluginMyprofileController; def rescue_action(e) raise e end; end
-
-class BscPluginMyprofileControllerTest < ActionController::TestCase
-
- VALID_CNPJ = '94.132.024/0001-48'
-
- def setup
- @controller = BscPluginMyprofileController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @bsc = BscPlugin::Bsc.create!({:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ})
- @admin = create_user('admin').person
- @bsc.add_admin(@admin)
- login_as(@admin.user.login)
- e = Environment.default
- e.enabled_plugins = ['BscPlugin']
- e.save!
- end
-
- attr_accessor :admin, :bsc
-
- should 'list enterprises on search' do
- # Should list if match name
- e1 = Enterprise.create!(:name => 'sample enterprise 1', :identifier => 'sample-enterprise-1')
- # Should be case insensitive
- e2 = Enterprise.create!(:name => 'SaMpLe eNtErPrIsE 2', :identifier => 'sample-enterprise-2')
- # Should not list if don't match name
- e3 = Enterprise.create!(:name => 'blo', :identifier => 'blo')
- # Should not list if is has a bsc
- e4 = Enterprise.create!(:name => 'sample enterprise 4', :identifier => 'sample-enterprise-4', :bsc => bsc)
- # Should not list if is enabled
- e5 = Enterprise.create!(:name => 'sample enterprise 5', :identifier => 'sample-enterprise-5', :enabled => true)
- BscPlugin::AssociateEnterprise.create!(:requestor => admin, :target => e5, :bsc => bsc)
- # Should search by identifier
- e6 = Enterprise.create!(:name => 'Bla', :identifier => 'sample-enterprise-6')
-
- get :search_enterprise, :profile => bsc.identifier, :q => 'sampl'
-
- assert_match /#{e1.name}/, @response.body
- assert_match /#{e2.name}/, @response.body
- assert_no_match /#{e3.name}/, @response.body
- assert_no_match /#{e4.name}/, @response.body
- assert_no_match /#{e5.name}/, @response.body
- assert_no_match /#{bsc.name}/, @response.body
- assert_match /#{e6.name}/, @response.body
- end
-
- should 'do not list profiles template on search' do
- e1 = Enterprise.create!(:name => 'Sample Enterprise 1', :identifier => 'sample-enterprise-1')
- e2 = Enterprise.create!(:name => 'Sample Enterprise 2', :identifier => 'sample-enterprise-2')
- t1 = Enterprise.create!(:name => 'Enterprise template', :identifier => 'enterprise_template')
- t2 = Enterprise.create!(:name => 'Inactive enterprise template', :identifier => 'inactive_enterprise_template')
-
- get :search_enterprise, :profile => bsc.identifier, :q => 'ent'
-
- assert_no_match /#{t1.name}/, @response.body
- assert_no_match /#{t2.name}/, @response.body
- end
-
- should 'save associations' do
- e1 = fast_create(Enterprise, :enabled => false)
- e2 = fast_create(Enterprise, :enabled => false)
-
- post :save_associations, :profile => bsc.identifier, :q => "#{e1.id},#{e2.id}"
- e1.reload
- e2.reload
- assert_equal e1.bsc, bsc
- assert_equal e2.bsc, bsc
-
- post :save_associations, :profile => bsc.identifier, :q => "#{e1.id}"
- e1.reload
- e2.reload
- assert_equal e1.bsc, bsc
- assert_not_equal e2.bsc, bsc
- end
-
- should 'create a task to the enabled enterprise instead of associating it' do
- e = fast_create(Enterprise, :enabled => true)
-
- assert_difference BscPlugin::AssociateEnterprise, :count, 1 do
- post :save_associations, :profile => bsc.identifier, :q => "#{e.id}"
- bsc.reload
- assert_not_includes bsc.enterprises, e
- end
- end
-
- should 'transfer ownership' do
- p1 = create_user('p1').person
- p2 = create_user('p2').person
- p3 = create_user('p3').person
-
- role = Profile::Roles.admin(bsc.environment.id)
-
- bsc.add_admin(p1)
- bsc.add_admin(p2)
-
- post :transfer_ownership, :profile => bsc.identifier, 'q_'+role.key => "#{p3.id}"
-
- assert_response :redirect
-
- assert_not_includes bsc.admins, p1
- assert_not_includes bsc.admins, p2
- assert_includes bsc.admins, p3
- end
-
- should 'create enterprise' do
- assert_difference Enterprise, :count, 1 do
- post :create_enterprise, :profile => bsc.identifier, :create_enterprise => {:name => 'Test Bsc', :identifier => 'test-bsc'}
- end
-
- enterprise = Enterprise.find_by_identifier('test-bsc')
-
- assert_equal true, enterprise.enabled
- assert_equal false, enterprise.validated
- assert_equal enterprise.bsc, bsc
- end
-
- should 'fecth contracts filtered by status' do
- contract0 = BscPlugin::Contract.create!(:bsc => bsc, :status => 0, :client_name => 'Marvin')
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :status => 1, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :status => 2, :client_name => 'Marvin')
- contract3 = BscPlugin::Contract.create!(:bsc => bsc, :status => 3, :client_name => 'Marvin')
-
- get :manage_contracts, :profile => bsc.identifier, :status => ['1', '3']
-
- assert_not_includes assigns(:contracts), contract0
- assert_includes assigns(:contracts), contract1
- assert_not_includes assigns(:contracts), contract2
- assert_includes assigns(:contracts), contract3
- end
-
- should 'manage contracts should have all status marked by default' do
- get :manage_contracts, :profile => bsc.identifier
- assert_equal assigns(:status), BscPlugin::Contract::Status.types.map { |s| s.to_s }
- end
-
- should 'fetch contracts sorted accordingly' do
- contract0 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 1.day.ago, :client_name => 'Eva')
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 2.day.ago, :client_name => 'Adam')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 3.day.ago, :client_name => 'Marvin')
-
- by_date = [contract2, contract1, contract0]
- by_name = [contract1, contract0, contract2]
-
- get :manage_contracts, :profile => bsc.identifier, :sorting => 'created_at asc'
- assert_equal by_date, assigns(:contracts)
-
- get :manage_contracts, :profile => bsc.identifier, :sorting => 'created_at desc'
- assert_equal by_date.reverse, assigns(:contracts)
-
- get :manage_contracts, :profile => bsc.identifier, :sorting => 'client_name asc'
- assert_equal by_name, assigns(:contracts)
-
- get :manage_contracts, :profile => bsc.identifier, :sorting => 'client_name desc'
- assert_equal by_name.reverse, assigns(:contracts)
- end
-
- should 'limit the contracts to defined per page' do
- BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
-
- @controller.stubs(:contracts_per_page).returns(1)
-
- get :manage_contracts, :profile => bsc.identifier
-
- assert_equal 1, assigns(:contracts).count
- end
-
- should 'destroy contract' do
- contract = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
-
- assert_difference BscPlugin::Contract, :count, -1 do
- get :destroy_contract, :profile => bsc.identifier, :contract_id => contract.id
- end
-
- assert_raise ActiveRecord::RecordNotFound do
- BscPlugin::Contract.find(contract.id)
- end
- end
-
- should 'not crash if trying to destroy a contract that does not exists' do
- assert_nothing_raised do
- get :destroy_contract, :profile => bsc.identifier, :contract_id => -1
- end
- assert_redirected_to :action => 'manage_contracts'
- end
-
- should 'not crash if trying to edit a contract that does not exists' do
- assert_nothing_raised do
- get :edit_contract, :profile => bsc.identifier, :contract_id => -1
- end
- assert_redirected_to :action => 'manage_contracts'
- end
-
- should 'create contract associating the enterprises' do
- enterprise1 = fast_create(Enterprise)
- enterprise2 = fast_create(Enterprise)
-
- post :new_contract, :profile => bsc.identifier, :enterprises => "#{enterprise1.id},#{enterprise2.id}", :contract => {:bsc => bsc, :client_name => 'Marvin'}
-
- bsc.reload
- contract = bsc.contracts.last
-
- assert_includes contract.enterprises, enterprise1
- assert_includes contract.enterprises, enterprise2
- end
-
- should 'edit contract adding or removing enterprises accordingly' do
- enterprise1 = fast_create(Enterprise)
- enterprise2 = fast_create(Enterprise)
- enterprise3 = fast_create(Enterprise)
- contract = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- contract.enterprises << enterprise1
- contract.enterprises << enterprise2
-
- post :edit_contract, :profile => bsc.identifier, :contract_id => contract.id, :enterprises => "#{enterprise2.id},#{enterprise3.id}", :contract => {:bsc => bsc}
- contract.reload
-
- assert_not_includes contract.enterprises, enterprise1
- assert_includes contract.enterprises, enterprise2
- assert_includes contract.enterprises, enterprise3
- end
-
- should 'not crash if there is no enterprises on create' do
- assert_nothing_raised do
- post :new_contract, :profile => bsc.identifier, :contract => {:bsc => bsc, :client_name => 'Marvin'}
- end
- end
-
- should 'create contract with associated sales' do
- product1 = fast_create(Product, :price => 2.50)
- product2 = fast_create(Product)
- sale1 = {:product_id => product1.id, :quantity => 2}
- sale2 = {:product_id => product2.id, :quantity => 5, :price => 3.50}
- sales = {1 => sale1, 2 => sale2}
-
- post :new_contract, :profile => bsc.identifier, :sales => sales, :contract => {:bsc => bsc, :client_name => 'Marvin'}
-
- bsc.reload
- contract = bsc.contracts.last
-
- assert_includes contract.products, product1
- assert_includes contract.products, product2
-
- assert_equal sale1[:quantity], contract.sales.find_by_product_id(sale1[:product_id]).quantity
- assert_equal sale2[:quantity], contract.sales.find_by_product_id(sale2[:product_id]).quantity
- assert_equal sale2[:price], contract.sales.find_by_product_id(sale2[:product_id]).price
- end
-
- should 'edit contract adding or removing sales accordingly' do
- product1 = fast_create(Product)
- product2 = fast_create(Product)
- product3 = fast_create(Product)
- contract = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- BscPlugin::Sale.create!(:product => product1, :contract => contract, :quantity => 1)
- BscPlugin::Sale.create!(:product => product2, :contract => contract, :quantity => 1)
- sales = {1 => {:product_id => product2.id, :quantity => 1}, 2 => {:product_id => product3.id, :quantity => 1}}
-
- post :edit_contract, :profile => bsc.identifier, :contract_id => contract.id, :sales => sales , :contract => {:bsc => bsc}
- contract.reload
-
- assert_not_includes contract.products, product1
- assert_includes contract.products, product2
- assert_includes contract.products, product3
- end
-
- should 'edit sales informations' do
- product1 = fast_create(Product)
- product2 = fast_create(Product)
- contract = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- sale1 = BscPlugin::Sale.create!(:product => product1, :contract => contract, :quantity => 1, :price => 1.0)
- sale2 = BscPlugin::Sale.create!(:product => product2, :contract => contract, :quantity => 2, :price => 2.0)
- sale2.save!
- sales = {1 => {:product_id => product1.id, :quantity => 3, :price => 5.0}, 2 => {:product_id => product2.id, :quantity => 4, :price => 10.0}}
-
- post :edit_contract, :profile => bsc.identifier, :contract_id => contract.id, :sales => sales , :contract => {:bsc => bsc}
-
- sale1.reload
- sale2.reload
-
- assert_equal 3, sale1.quantity
- assert_equal 5.0, sale1.price
- assert_equal 4, sale2.quantity
- assert_equal 10.0, sale2.price
- end
-
- should 'redirect to edit contract if some sale could not be created' do
- product = fast_create(Product)
- # sale without quantity
- sales = {1 => {:product_id => product.id, :price => 1.50}}
-
- post :new_contract, :profile => bsc.identifier, :sales => sales, :contract => {:bsc => bsc, :client_name => 'Marvin'}
-
- bsc.reload
- contract = bsc.contracts.last
-
- assert_redirected_to :action => 'edit_contract', :contract_id => contract.id
- end
-
- should 'search for products from the invoved enterprises' do
- # product1 fits
- # product2 doesn't fits because its in added_products
- # product3 doesn't fits because its enterprise is in enterprises
- enterprise1 = fast_create(Enterprise)
- enterprise2 = fast_create(Enterprise)
- enterprise3 = fast_create(Enterprise)
- product1 = fast_create(Product, :profile_id => enterprise1.id, :name => 'Black Bycicle')
- product2 = fast_create(Product, :profile_id => enterprise2.id, :name => 'Black Guitar')
- product3 = fast_create(Product, :profile_id => enterprise3.id, :name => 'Black Notebook')
-
- get :search_sale_product, :profile => bsc.identifier, :enterprises => [enterprise1.id,enterprise2.id].join(','), :added_products => [product2.id].join(','),:sales => {1 => {:product_id => 'black'}}
-
- assert_match /#{product1.name}/, @response.body
- assert_no_match /#{product2.name}/, @response.body
- assert_no_match /#{product3.name}/, @response.body
- end
-end
-
diff --git a/plugins/bsc/test/unit/bsc_plugin/associate_enterprise_test.rb b/plugins/bsc/test/unit/bsc_plugin/associate_enterprise_test.rb
deleted file mode 100644
index 2b4002f..0000000
--- a/plugins/bsc/test/unit/bsc_plugin/associate_enterprise_test.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class BscPlugin::AssociateEnterpriseTest < ActiveSupport::TestCase
- VALID_CNPJ = '94.132.024/0001-48'
-
- def setup
- @enterprise = fast_create(Enterprise)
- @person = create_user('user').person
- @bsc = BscPlugin::Bsc.create!(:business_name => 'Sample Bsc', :company_name => 'Sample Bsc Ltda.', :identifier => 'sample-bsc', :cnpj => VALID_CNPJ)
- end
-
- attr_accessor :enterprise, :person, :bsc
-
- should 'associate enteprise with bsc after perform' do
- task = BscPlugin::AssociateEnterprise.create!(:requestor => person, :target => enterprise, :bsc => bsc)
- task.perform
- bsc.reload
-
- assert_includes bsc.enterprises, enterprise
- end
-
- should 'notify enterprise when some bsc create the request' do
- enterprise.contact_email = 'enterprise@bsc.org'
- enterprise.save!
- assert_difference ActionMailer::Base.deliveries, :count, 1 do
- BscPlugin::AssociateEnterprise.create!(:requestor => person, :target => enterprise, :bsc => bsc)
- end
- assert_includes ActionMailer::Base.deliveries.last.to, enterprise.contact_email
- end
-
- should 'notify requestor when some enterprise reject the request' do
- person.email = 'person@bsc.org'
- person.save!
- task = BscPlugin::AssociateEnterprise.create!(:requestor => person, :target => enterprise, :bsc => bsc)
- assert_difference ActionMailer::Base.deliveries, :count, 1 do
- task.cancel
- end
- assert_includes ActionMailer::Base.deliveries.last.to, person.contact_email
- end
-
- should 'notify requestor when some enterprise accept the request' do
- person.email = 'person@bsc.org'
- person.save!
- task = BscPlugin::AssociateEnterprise.create!(:requestor => person, :target => enterprise, :bsc => bsc)
- assert_difference ActionMailer::Base.deliveries, :count, 1 do
- task.finish
- end
- assert_includes ActionMailer::Base.deliveries.last.to, person.contact_email
- end
-
-end
-
diff --git a/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb b/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb
deleted file mode 100644
index bd48382..0000000
--- a/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class BscPlugin::BscTest < ActiveSupport::TestCase
- VALID_CNPJ = '94.132.024/0001-48'
-
- def setup
- @bsc = BscPlugin::Bsc.create!(:business_name => 'Sample Bsc', :company_name => 'Sample Bsc', :identifier => 'sample-bsc', :cnpj => VALID_CNPJ)
- end
-
- attr_accessor :bsc
-
- should 'validate presence of cnpj' do
- bsc = BscPlugin::Bsc.new()
- bsc.valid?
-
- assert bsc.errors.invalid?(:cnpj)
- end
-
- should 'validate uniqueness of cnpj' do
- bsc1 = bsc
- bsc2 = BscPlugin::Bsc.new(:cnpj => VALID_CNPJ)
- bsc2.valid?
- assert bsc2.errors.invalid?(:cnpj)
- end
-
- should 'have many enterprises' do
- e1 = Enterprise.new(:name => 'Enterprise1', :identifier => 'enterprise1')
- e2 = Enterprise.new(:name => 'Enterprise2', :identifier => 'enterprise2')
- bsc.enterprises << e1
- bsc.enterprises << e2
- bsc.save!
-
- assert_equal e1.bsc, bsc
- assert_equal e2.bsc, bsc
- end
-
- should 'verify already requested enterprises' do
- e1 = fast_create(Enterprise)
- e2 = fast_create(Enterprise)
- task = BscPlugin::AssociateEnterprise.new(:target => e1, :bsc => bsc)
- bsc.enterprise_requests.stubs(:pending).returns([task])
-
- assert bsc.already_requested?(e1)
- refute bsc.already_requested?(e2)
- end
-
- should 'return associated enterprises products' do
- e1 = fast_create(Enterprise)
- e2 = fast_create(Enterprise)
- category = fast_create(ProductCategory)
-
- p1 = fast_create(Product, :product_category_id => category.id)
- p2 = fast_create(Product, :product_category_id => category.id)
- p3 = fast_create(Product, :product_category_id => category.id)
-
- e1.products << p1
- e1.products << p2
- e2.products << p3
-
- bsc.enterprises << e1
- bsc.enterprises << e2
-
- bsc.reload
-
- assert_includes bsc.products, p1
- assert_includes bsc.products, p2
- assert_includes bsc.products, p3
- end
-
- should 'not be able to create product' do
- refute bsc.create_product?
- end
-
- should 'have many contracts' do
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
-
- assert_includes bsc.contracts, contract1
- assert_includes bsc.contracts, contract2
- end
-
-end
diff --git a/plugins/bsc/test/unit/bsc_plugin/contract_test.rb b/plugins/bsc/test/unit/bsc_plugin/contract_test.rb
deleted file mode 100644
index d0611d7..0000000
--- a/plugins/bsc/test/unit/bsc_plugin/contract_test.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class BscPlugin::ContractTest < ActiveSupport::TestCase
- def setup
- @contract = BscPlugin::Contract.new(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- end
-
- attr_accessor :contract
-
- should 'validates presence of bsc' do
- contract.bsc = nil
- contract.valid?
- assert contract.errors.invalid?(:bsc)
-
- contract.bsc = BscPlugin::Bsc.new
- contract.valid?
- refute contract.errors.invalid?(:bsc)
- end
-
- should 'associate contract with products through sales' do
- contract.save!
- product1 = fast_create(Product)
- product2 = fast_create(Product)
- sale1 = BscPlugin::Sale.create!(:product => product1, :contract => contract, :quantity => 3)
- sale2 = BscPlugin::Sale.create!(:product => product2, :contract => contract, :quantity => 5)
-
- assert_includes contract.products, product1
- assert_includes contract.products, product2
- end
-
- should 'have many enterprises' do
- contract.save!
- enterprise1 = fast_create(Enterprise)
- contract.enterprises << enterprise1
- enterprise2 = fast_create(Enterprise)
- contract.enterprises << enterprise2
-
- assert_includes contract.enterprises, enterprise1
- assert_includes contract.enterprises, enterprise2
- end
-
- should 'filter contracts by status' do
- bsc = BscPlugin::Bsc.new
- opened = BscPlugin::Contract::Status::OPENED
- negotiating = BscPlugin::Contract::Status::NEGOTIATING
- executing = BscPlugin::Contract::Status::EXECUTING
- closed = BscPlugin::Contract::Status::CLOSED
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :status => opened, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :status => negotiating, :client_name => 'Marvin')
- contract3 = BscPlugin::Contract.create!(:bsc => bsc, :status => executing, :client_name => 'Marvin')
- contract4 = BscPlugin::Contract.create!(:bsc => bsc, :status => closed, :client_name => 'Marvin')
-
- opened_and_executing = BscPlugin::Contract.status([opened, executing])
- negotiating_and_closed = BscPlugin::Contract.status([negotiating, closed])
- all = BscPlugin::Contract.status([])
-
- assert_includes opened_and_executing, contract1
- assert_not_includes opened_and_executing, contract2
- assert_includes opened_and_executing, contract3
- assert_not_includes opened_and_executing, contract4
-
- assert_not_includes negotiating_and_closed, contract1
- assert_includes negotiating_and_closed, contract2
- assert_not_includes negotiating_and_closed, contract3
- assert_includes negotiating_and_closed, contract4
-
- assert_includes all, contract1
- assert_includes all, contract2
- assert_includes all, contract3
- assert_includes all, contract4
- end
-
- should 'sort contracts by date' do
- bsc = BscPlugin::Bsc.new
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 2.day.ago, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 1.day.ago, :client_name => 'Marvin')
- contract3 = BscPlugin::Contract.create!(:bsc => bsc, :created_at => 3.day.ago, :client_name => 'Marvin')
-
- assert_equal [contract3, contract1, contract2], BscPlugin::Contract.sorted_by('created_at', 'asc')
- end
-
- should 'sort contracts by client name' do
- bsc = BscPlugin::Bsc.new
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvim')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Adam')
- contract3 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Eva')
-
- assert_equal [contract2, contract3, contract1], BscPlugin::Contract.sorted_by('client_name', 'asc')
- end
-
- should 'return contract total price' do
- contract.save!
- price1 = 1
- quantity1 = 3
- price2 = 2
- quantity2 = 5
- total = price1*quantity1 + price2*quantity2
- product1 = fast_create(Product, :price => price1)
- product2 = fast_create(Product, :price => price2)
- sale1 = BscPlugin::Sale.create!(:product => product1, :contract => contract, :quantity => quantity1)
- sale2 = BscPlugin::Sale.create!(:product => product2, :contract => contract, :quantity => quantity2)
-
- contract.reload
-
- assert_equal total, contract.total_price
- end
-end
diff --git a/plugins/bsc/test/unit/bsc_plugin/sale_test.rb b/plugins/bsc/test/unit/bsc_plugin/sale_test.rb
deleted file mode 100644
index 5f8e92f..0000000
--- a/plugins/bsc/test/unit/bsc_plugin/sale_test.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class BscPlugin::SaleTest < ActiveSupport::TestCase
- def setup
- @sale = BscPlugin::Sale.new
- end
-
- attr_accessor :sale
-
- should 'validate presence of product and contract' do
- sale.valid?
-
- assert sale.errors.invalid?(:product)
- assert sale.errors.invalid?(:contract)
-
- product = Product.new
- contract = BscPlugin::Contract.new
- sale.product = product
- sale.contract = contract
-
- refute sale.errors.invalid?(product)
- refute sale.errors.invalid?(contract)
- end
-
- should 'validate uniqueness of product and contract composed' do
- product = fast_create(Product)
- contract = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- sale1 = BscPlugin::Sale.create!(:product => product, :contract => contract, :quantity => 1)
- sale2 = BscPlugin::Sale.new(:product => product, :contract => contract, :quantity => 1)
- sale2.valid?
-
- assert sale2.errors.invalid?(:product_id)
- end
-
- should 'validate quantity as a positive integer' do
- sale.quantity = -1
- sale.valid?
- assert sale.errors.invalid?(:quantity)
-
- sale.quantity = 1.5
- sale.valid?
- assert sale.errors.invalid?(:quantity)
-
- sale.quantity = 3
- sale.valid?
- refute sale.errors.invalid?(:quantity)
- end
-
- should 'set default price as product price if no price indicated' do
- product = fast_create(Product, :price => 3.50)
- contract = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- sale.product = product
- sale.contract = contract
- sale.quantity = 1
- sale.save!
-
- assert_equal product.price, sale.price
- end
-
- should 'not overwrite with the product price if price informed' do
- product = fast_create(Product, :price => 3.50)
- contract = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- sale.product = product
- sale.contract = contract
- sale.quantity = 1
- sale.price = 2.50
- sale.save!
-
- assert_equal 2.50, sale.price
- end
-
- should 'have default value for price' do
- product1 = fast_create(Product, :price => 1)
- product2 = fast_create(Product, :price => 1)
- product3 = fast_create(Product)
- contract = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- sale1 = BscPlugin::Sale.create!(:price => 2, :product => product1, :contract => contract, :quantity => 1)
- sale2 = BscPlugin::Sale.create!(:product => product2, :contract => contract, :quantity => 1)
- sale3 = BscPlugin::Sale.create!(:product => product3, :contract => contract, :quantity => 1)
-
- assert_equal 2, sale1.price
- assert_equal 1, sale2.price
- assert_equal 0, sale3.price
- end
-end
-
diff --git a/plugins/bsc/test/unit/bsc_plugin_test.rb b/plugins/bsc/test/unit/bsc_plugin_test.rb
deleted file mode 100644
index b8bc017..0000000
--- a/plugins/bsc/test/unit/bsc_plugin_test.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../test/test_helper'
-
-class BscPluginTest < ActiveSupport::TestCase
-
- VALID_CNPJ = '94.132.024/0001-48'
-
- should 'add profile controller filter correctly' do
- bsc_plugin = BscPlugin.new
- person = fast_create(Person)
- context = mock()
- context.stubs(:profile).returns(person)
- context.stubs(:params).returns({:profile => person.identifier})
- context.stubs(:user).returns(person)
- context.stubs(:environment).returns(person.environment)
- bsc_plugin.stubs(:context).returns(context)
-
- assert_nil bsc_plugin.profile_controller_filters.first[:block].call
- assert_nil bsc_plugin.content_viewer_controller_filters.first[:block].call
-
- enterprise = fast_create(Enterprise, :validated => false)
- enterprise.bsc = BscPlugin::Bsc.create!({:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ})
- enterprise.save!
- context.stubs(:profile).returns(enterprise)
- context.stubs(:params).returns({:profile => enterprise.identifier})
- context.stubs(:environment).returns(enterprise.environment)
-
- assert_raise NameError do
- bsc_plugin.profile_controller_filters.first[:block].call
- end
- assert_raise NameError do
- bsc_plugin.content_viewer_controller_filters.first[:block].call
- end
- end
-end
diff --git a/plugins/bsc/test/unit/ext/enterprise_test.rb b/plugins/bsc/test/unit/ext/enterprise_test.rb
deleted file mode 100644
index 183000d..0000000
--- a/plugins/bsc/test/unit/ext/enterprise_test.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class EnterpriseTest < ActiveSupport::TestCase
- VALID_CNPJ = '94.132.024/0001-48'
-
- def setup
- @bsc = BscPlugin::Bsc.create!({:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ})
- end
-
- attr_accessor :bsc
-
- should 'belongs to a bsc' do
- enterprise = fast_create(Enterprise, :bsc_id => bsc.id)
- assert_equal bsc, enterprise.bsc
- end
-
- should 'return correct enterprises on validated and not validated namedscopes' do
- validated_enterprise = fast_create(Enterprise, :validated => true)
- not_validated_enterprise = fast_create(Enterprise, :validated => false)
-
- assert_includes Enterprise.validated, validated_enterprise
- assert_not_includes Enterprise.validated, not_validated_enterprise
- assert_not_includes Enterprise.not_validated, validated_enterprise
- assert_includes Enterprise.not_validated, not_validated_enterprise
- end
-
- should 'be involved with many contracts' do
- enterprise = fast_create(Enterprise)
- contract1 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => bsc, :client_name => 'Marvin')
- enterprise.contracts << contract1
- enterprise.contracts << contract2
-
- assert_includes enterprise.contracts, contract1
- assert_includes enterprise.contracts, contract2
- end
-end
-
diff --git a/plugins/bsc/test/unit/ext/product_test.rb b/plugins/bsc/test/unit/ext/product_test.rb
deleted file mode 100644
index 45fa033..0000000
--- a/plugins/bsc/test/unit/ext/product_test.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.dirname(__FILE__) + '/../../../../../test/test_helper'
-
-class ProductTest < ActiveSupport::TestCase
- VALID_CNPJ = '94.132.024/0001-48'
-
- should 'return have bsc' do
- bsc = BscPlugin::Bsc.create!({:business_name => 'Sample Bsc', :identifier => 'sample-bsc', :company_name => 'Sample Bsc Ltda.', :cnpj => VALID_CNPJ})
- enterprise = fast_create(Enterprise, :bsc_id => bsc.id)
- product = fast_create(Product, :profile_id => enterprise.id)
-
- assert_equal bsc, product.bsc
- end
-
- should 'have contracts through sales' do
- product = fast_create(Product)
- contract1 = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- contract2 = BscPlugin::Contract.create!(:bsc => BscPlugin::Bsc.new, :client_name => 'Marvin')
- sale1 = BscPlugin::Sale.create!(:product => product, :contract => contract1, :quantity => 3)
- sale2 = BscPlugin::Sale.create!(:product => product, :contract => contract2, :quantity => 5)
-
- assert_includes product.contracts, contract1
- assert_includes product.contracts, contract2
- end
-end
diff --git a/plugins/bsc/views/bsc_plugin/mailer/admin_notification.html.erb b/plugins/bsc/views/bsc_plugin/mailer/admin_notification.html.erb
deleted file mode 100644
index cd3bfac..0000000
--- a/plugins/bsc/views/bsc_plugin/mailer/admin_notification.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-<%= _('The management of %{bsc} was transferred to you.') % {:bsc => @bsc.name}%>
diff --git a/plugins/bsc/views/bsc_plugin_admin/new.html.erb b/plugins/bsc/views/bsc_plugin_admin/new.html.erb
deleted file mode 100644
index af3baba..0000000
--- a/plugins/bsc/views/bsc_plugin_admin/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<%= error_messages_for :bsc %>
-<%= _('BSC registration') %>
-
-<%= labelled_form_for :profile_data, @bsc do |f| %>
- <%= render :partial => 'shared/fields', :locals => {:f => f, :profile => @bsc} %>
-
- <% button_bar do %>
- <%= submit_button('save', c_('Save')) %>
- <%= button('cancel', c_('Cancel'), {:controller => 'admin_panel'}) %>
- <% end %>
-<% end %>
diff --git a/plugins/bsc/views/bsc_plugin_admin/validate_enterprises.html.erb b/plugins/bsc/views/bsc_plugin_admin/validate_enterprises.html.erb
deleted file mode 100644
index de8a293..0000000
--- a/plugins/bsc/views/bsc_plugin_admin/validate_enterprises.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%= _('Validate enterprises') %>
-
-<% form_tag :action => 'save_validations' do %>
- <%= token_input_field_tag(:q, 'search-enterprises', {:action => 'search_enterprise'},
- { :hint_text => _('Type in a search term for enterprise'),
- :focus => true }) %>
-
- <% button_bar do %>
- <%= submit_button('save', c_('Save'))%>
- <%= button('cancel', c_('Cancel'), {:controller => 'admin_panel'})%>
- <% end %>
-<% end %>
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb
deleted file mode 100644
index e70dd2f..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb
+++ /dev/null
@@ -1,83 +0,0 @@
-<%= error_messages_for :contract %>
-
-<%= labelled_form_for :contract, :html => {:id => 'bsc-plugin-sales-form'} do |f| %>
- <%= hidden_field_tag :contract_id, @contract.id %>
- <%= required f.text_field(:client_name) %>
- <%= labelled_form_field(_('Client type'), f.select(:client_type, BscPlugin::Contract::ClientType.types.map{|type| [BscPlugin::Contract::ClientType.names[type], type]}))%>
- <%= labelled_form_field(_('Business type'), f.select(:business_type, BscPlugin::Contract::BusinessType.types.map{|type| [BscPlugin::Contract::BusinessType.names[type], type]}))%>
- <%= f.text_field(:state) %>
- <%= f.text_field(:city) %>
- <%= labelled_form_field(_('Status'), f.select(:status, BscPlugin::Contract::Status.types.
- map { |s| [BscPlugin::Contract::Status.names[s], s] })) %>
- <%= f.text_field(:number_of_producers, :size => 8, :id => 'bsc-plugin-contract-spinner') %>
- <%= c_('Enterprises')+':' %>
-
- <% search_action = {:action => 'search_contract_enterprises', :profile => profile.identifier} %>
- <%= token_input_field_tag(:enterprises, 'involved-enterprises', search_action,
- { :pre_populate => @contract.enterprises_to_token_input,
- :hint_text => _('Type in search term for enterprise') }) %>
-
-
-
- <%= c_('Products') %>
- <%= _('Quantity') %>
- <%= _('Unit price') %>
-
-
- <%= _('Total')%>
- <%= float_to_currency(@contract.total_price)%>
-
-
- <%= link_to(_('Add new product'), {}, :id => 'bsc-plugin-add-new-product', 'data-bsc' => profile.identifier) %>
-
-
-
- <%= labelled_form_field( _('Supply period'),
- text_field_tag('contract[supply_start]', (@contract.supply_start ? @contract.supply_start.strftime("%Y-%m-%d") : nil), :id => 'from', :size => 9) +
- c_(' to ') +
- text_field_tag('contract[supply_end]', (@contract.supply_end ? @contract.supply_end.strftime("%Y-%m-%d") : nil), :id => 'to', :size => 9) )
- %>
-
- <%= f.text_area(:annotations, :rows => 5, :cols => 68) %>
- <% button_bar do%>
- <%= submit_button(:save, c_('Save'), :cancel => {:action => 'manage_contracts'})%>
- <% end %>
-<% end %>
-
-<% scripts = %w{/plugins/bsc/jquery.ui.spinner/ui.spinner.js
- /plugins/bsc/contracts /plugins/bsc/datepicker
- /plugins/bsc/spinner} %>
-<% scripts.each do |script|%>
- <%= javascript_include_tag script %>
-<% end %>
-
-
-
-<%= javascript_include_tag '/plugins/bsc/validation' %>
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb
deleted file mode 100644
index aaa4f1e..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/_similar_enterprises.html.erb
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
<%= _('Existing enterprises:') %>
-
<%= _('Were found %{count} enterprises with similar names on the same city, you can decide to associate one of them or create the new enterprise confirming the informations you typed in.') % {:count => content_tag('span', '', :id => 'similar-enterprises-count')} %>
-
- <% query = bsc.enterprises.map(&:id).join(',') %>
-
-
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/create_enterprise.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/create_enterprise.html.erb
deleted file mode 100644
index 2ec7a2d..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/create_enterprise.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<%= error_messages_for 'create_enterprise' %>
-
-<%= __('Enterprise registration') %>
-
-<%= required_fields_message %>
-
-<%= labelled_form_for(:create_enterprise) do |f| %>
-
- <%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %>
- <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %>
-
- <%= required labelled_form_field(c_('Address'), content_tag('code', environment.top_url + "/" + text_field(:create_enterprise, 'identifier', :size => 26))) %>
-
- <%= render :partial => 'similar_enterprises', :locals => {:bsc => profile}%>
-
- <% button_bar do %>
- <%= submit_button('save', c_('Save'), :cancel => {:controller => 'profile_editor', :profile => profile.identifier}) %>
- <% end %>
-<% end %>
-
-
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/edit_contract.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/edit_contract.html.erb
deleted file mode 100644
index eb3d638..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/edit_contract.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= _("New contract") %>
-<%= render :partial => 'contract_form', :locals => {:url => {:action => 'update_contract'}}%>
-
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb
deleted file mode 100644
index b56cb50..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/manage_associated_enterprises.html.erb
+++ /dev/null
@@ -1,26 +0,0 @@
-<%= _('Manage associated enterprises') %>
-
-<% if !@pending_enterprises.blank? %>
- <%= _('Associations awaiting approval:') %>
-
- <% @pending_enterprises.each do |enterprise| %>
- <%= enterprise.name %>
- <% end %>
-
-<% end %>
-
-<% form_tag :action => 'save_associations' do %>
- <% search_action = {:action => 'search_enterprise', :profile => profile.identifier} %>
- <%= token_input_field_tag(:q, 'search-enterprises', search_action,
- { :pre_populate => profile.enterprises_to_token_input,
- :hint_text => _('Type in a search term for enterprise'),
- :focus => true }) %>
-
- <%= button('add', _('Add new enterprise'), {:action => 'create_enterprise'}) %>
-
- <% button_bar do %>
- <%= submit_button('save', c_('Save'))%>
- <%= button('cancel', c_('Cancel'), {:controller => 'profile_editor'})%>
- <% end %>
-
-<% end %>
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb
deleted file mode 100644
index c1b3429..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/manage_contracts.html.erb
+++ /dev/null
@@ -1,49 +0,0 @@
-<%= _('Manage contracts') %>
-
-<% form_tag({}, {:id => "bsc-plugin-contracts-form"}) do %>
-
-
<%= _('Status') %>
- <% BscPlugin::Contract::Status.types.each do |status| %>
- <%= check_box_tag('status[]', status, @status.include?(status.to_s), :id => 'status-checkbox-'+status.to_s) %>
- <%= content_tag('label', BscPlugin::Contract::Status.names[status], :for => 'status-checkbox-'+status.to_s) %>
-
- <% end %>
-
- <%= submit_button(:save, c_('Filter')) %>
-
-
-
-
- <%= labelled_select(_('Sort by')+' ', :sorting, :first, :last, @sorting,
- [['created_at asc', _('Date(newest first)')], ['created_at desc', _('Date(oldest first)')],
- ['client_name asc', _('Client name(A-Z)')], ['client_name desc', _('Client name(Z-A)')]],
- :onchange => "jQuery('#bsc-plugin-contracts-form').submit()") %>
-
-
- <% if @contracts.blank? %>
- <%= content_tag('em', _('There are no contracts at all.'))%>
- <% else %>
-
- <% @contracts.each do |contract| %>
-
-
- <%= link_to(content_tag('b', contract.client_name ), :action => 'view_contract', :contract_id => contract.id) %>
- <%= content_tag('i', show_date(contract.created_at)) %>
-
-
- <%= link_to(c_('Edit'), :action => 'edit_contract', :contract_id => contract.id)%>
- <%= link_to(c_('Remove'), {:action => 'destroy_contract', :contract_id => contract.id}, :confirm => _('Are you sure?'))%>
-
-
- <% end %>
-
- <%= pagination_links @contracts %>
- <% end %>
-
- <% button_bar do %>
- <%= button(:back, c_('Go back'), :controller => 'profile_editor') %>
- <%= button(:new, _('Create new contract'), :action => 'new_contract')%>
- <% end %>
-
-<% end %>
-
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/new_contract.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/new_contract.html.erb
deleted file mode 100644
index 988be28..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/new_contract.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= _("New contract") %>
-<%= render :partial => 'contract_form.html.erb', :locals => {:url => {:action => 'create_contract'}}%>
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb
deleted file mode 100644
index 6132bbb..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/transfer_ownership.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%= _('Transfer Ownership') %>
-
-
- <%= _('This option allows you to transfer this enterprise\'s management to another user. This action will remove all the current administrators. Be careful when confirming this procedure.') %>
-
-
-<% if !profile.admins.blank? %>
- <%= _('Current administrators:') %>
-
- <% profile.admins.each do |admin| %>
- <%= link_to(profile_image(admin, :icon, :style => 'margin-right: 3px;'), admin.url) + link_to(admin.name, admin.url, :style => 'margin-top: -3px;') %>
- <% end %>
-
-<% end %>
-
-
-<% form_tag do %>
- <% @roles.each do |role|%>
- <%= content_tag('b', _('Administrator:')) %>
- <% search_action = {:controller => 'profile_members', :action => 'search_user', :role => role.id, :profile => profile.identifier} %>
- <%= token_input_field_tag('q_'+role.key, 'search_'+role.key, search_action,
- { :hint_text => _('Type in a search term for the new administrator'),
- :focus => true,
- :token_limit => 1}) %>
-
- <% end %>
-
- <% button_bar do %>
- <%= submit_button('save', c_('Save'))%>
- <%= button('cancel', c_('Cancel'), {:controller => 'profile_editor'})%>
- <% end %>
-<% end %>
diff --git a/plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb b/plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb
deleted file mode 100644
index d392cc5..0000000
--- a/plugins/bsc/views/bsc_plugin_myprofile/view_contract.html.erb
+++ /dev/null
@@ -1,55 +0,0 @@
-<%= @contract.client_name %>
-
-
-
- <%= _('Basic information') %>
-
- <%= display_text_field(_('Client type'), BscPlugin::Contract::ClientType.names[@contract.client_type]) %>
- <%= display_text_field(_('Business type'), BscPlugin::Contract::BusinessType.names[@contract.business_type]) %>
- <%= display_text_field(c_('State'), @contract.state) %>
- <%= display_text_field(c_('City'), @contract.city) %>
- <%= display_text_field(_('Status'), BscPlugin::Contract::Status.names[@contract.status]) %>
- <%= display_text_field(_('Number of producers'), @contract.number_of_producers) %>
- <%= display_text_field(_('Supply period'), show_period(@contract.supply_start, @contract.supply_end, true)) %>
-
-
-
-
- <%= c_('Enterprises') %>
-
- <%= display_list_field(@contract.enterprises.map {|enterprise| link_to(enterprise.short_name(60), enterprise.url)}) %>
-
-
-<% if !@contract.sales.blank?%>
-
-
- <%= c_('Product') %>
- <%= _('Quantity') %>
- <%= _('Unit price') %>
-
- <% @contract.sales.each do |sale| %>
-
- <%= short_text(product_display_name(Product.find(sale.product_id)), 110) %>
- <%= sale.quantity %>
- <%= float_to_currency(sale.price) %>
-
- <% end %>
-
- <%= _('Total')%>
- <%= float_to_currency(@contract.total_price) %>
-
-
-<% end %>
-
-
-
-<% if !@contract.annotations.blank? %>
-
-
<%= _("Annotations") %>
-
<%= @contract.annotations %>
-
-<% end %>
-
-<% button_bar do %>
- <%= button(:back, c_('Go back'), :action => 'manage_contracts') %>
-<% end %>
diff --git a/plugins/bsc/views/profile/_profile_tab.html.erb b/plugins/bsc/views/profile/_profile_tab.html.erb
deleted file mode 100644
index dd4a969..0000000
--- a/plugins/bsc/views/profile/_profile_tab.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
- <%= content_tag('li', content_tag('b', _('Contact phone: ')) + profile.contact_phone) if !profile.contact_phone.blank? %>
- <%= content_tag('li', content_tag('b', _('Email: ')) + profile.contact_email) if !profile.contact_email.blank? %>
- <%= content_tag('li', content_tag('b', c_('Location: ')) + profile.state) if !profile.state.blank? %>
- <%= content_tag('li', content_tag('b', c_('Address: ')) + profile.address) if !profile.address.blank? %>
-
diff --git a/plugins/bsc/views/profile_editor/bsc_plugin/_bsc.html.erb b/plugins/bsc/views/profile_editor/bsc_plugin/_bsc.html.erb
deleted file mode 100644
index 534f72e..0000000
--- a/plugins/bsc/views/profile_editor/bsc_plugin/_bsc.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= render :partial => 'shared/fields', :locals => {:f => f, :profile => profile} %>
-<%= render :partial => 'moderation', :locals => { :profile => profile } %>
diff --git a/plugins/bsc/views/shared/_fields.html.erb b/plugins/bsc/views/shared/_fields.html.erb
deleted file mode 100644
index ede0eb1..0000000
--- a/plugins/bsc/views/shared/_fields.html.erb
+++ /dev/null
@@ -1,66 +0,0 @@
-
-<%# extend FormerPlugin::FieldHelper %>
-
-
- <%= _('Basic information')%>
- <%= required f.text_field(:business_name, :onchange => "updateUrlField(this, 'profile_data_identifier')") %>
- <%= required f.text_field(:company_name) %>
- <%= required f.text_field(:cnpj) %>
-
- <%#= widgets_for_form(f, :bsc_fields) %>
-
-
-
- <%= hidden_field_tag 'old_bsc_identifier', profile.identifier %>
-
- <%= content_tag('code',
- top_url + '/ ' +
- text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25)
- ) +
- content_tag('div',
- content_tag('strong', c_('WARNING!')) + ' ' +
- _("You are about to change the address, and this will break external links to this bsc or to posts inside it. Do you really want to change?") +
- content_tag('div',
- button_to_function(:ok, c_("Yes"), "confirm_change()") + ' ' +
- button_to_function(:cancel, c_('No'), 'no_change()')
- ),
- :id => 'identifier-change-confirmation',
- :class => 'change-confirmation',
- :style => 'display: none;'
- )
- %>
-
-
-
-
- <%= _('Contact')%>
- <%= f.text_field(:contact_email) %>
- <%= f.text_field(:organization_website) %>
- <%= f.text_field(:contact_phone) %>
-
-
-
- <%= c_('Location')%>
- <%= f.text_field(:address) %>
- <%= f.text_field(:zip_code) %>
- <%= f.text_field(:city) %>
- <%= f.text_field(:state) %>
- <%= select_country(c_('Country'), :profile_data, 'country', {:class => 'type-select'}) %>
-
--
libgit2 0.21.2