Jump to content

Rodrigo

Members
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Rodrigo

  1. Hi, Currently i'm working with Holistics.io, where I connect it to Blesta DB via remote mysql and it shows me a full B.I dashboard with awesome statistics and charts. I would like to know if Blesta model does support a query to be able to retrieve how many services where active at a certain date. We can't rely on Canceled or Suspended dates of 'services' table as the former can occur much later after the service was suspended, and the latter disappears when a service is unsuspended. I'm thinking about writing a small script that logs this value every day to a database in order to be able to have this value from now on, but I would like to know if I have been missing a table that might have this information (directly or via an specific query). Thanks! Rodrigo
  2. I confirm that the business and receiver_email are equal, so I'll check the patch you suggested and see if it works
  3. Hi, It seems that Paypal payments are no longer working on my install. I'm not sure if it makes the difference whether the user choose one time pay or a recurring one, but paypal is showing me successful payments on their dashboard that blesta doesn't seem to register. Where should I start looking to troubleshoot this issue? At payment gateway log it shows "failed". This is how the callback log looks like (I tried to hide personal/transaction info): http://prntscr.com/dobmeq What should I do in this case?
  4. Mate, I want to try this plugin but I can't find the download link. I tried registering on your website but them it won't show me the download link neither :/
  5. Hi, I've changed the following change to fix the issue: Before: $row = $this->getModuleRow(); After: $row = $this->getModuleRow($package->module_row); As package gets changed when using upgrade I can get the current API URL for the location of the service. I haven't implemented automatic migration between locations yet, but I think in that case would be recommended to assign a service field to store the location right? Thanks! Rodrigo
  6. Hi, I've been using 2 packages from the same module to offer services in different locations. Each module row has the API URL that blesta should use to manage the service. When I change the package from an existing service using "Upgrade/Downgrade", the service keeps using the old API URL instead of changing to the new module row from the new selected package. I'm currently using Blesta 3.5.1 and have this strange bug preventing me from implementing auto-cancel. Can this be fixed from the Module code or is it a Blesta bug? Thanks, Rodrigo
  7. Hi, As Cody suggested in my previous post about MySQL queries that might give you some insights about critical situations, now I'm making custom report to make it easy to use and export from Blesta admin interface. Output Preview (CSV data): Setup 1. Create a new custom report 2. Put the name you want to the report 3. Paste the following code in Query: SELECT DATE(invoices.date_closed) Day, count(*) "Paid invoices", GROUP_CONCAT(invoices.id SEPARATOR ', ') "Invoices ID", SUM(invoices.paid) "Total Paid" from invoices where invoices.date_closed IS NOT NULL AND MONTH(invoices.date_closed) = MONTH(:chosen_date) AND YEAR(invoices.date_closed) = YEAR(:chosen_date) AND currency = ":currency" GROUP BY DAY(invoices.date_closed); 4. Add the following fields: --- Label: Month Name: chosen_date Type: Date Required: Yes --- Label: Currency Name: currency Type: Text Required: Yes --- 5. Click on Save and now it's ready to be used You can also put the currency field as a Select field with the currency codes you use instead of having to write "USD" (or whatever you use) every time. I'm using this query to get the invoices ID to look and generate e-invoices with a 3rd party API, which is required in my country.
  8. When you have a blesta setup with relatively high client volume, you may want to periodically check if everything is OK, or clean up things that should not be there (i.e: data that is not automatically removed by blesta/plugins). I've come up to this queries which I use periodically: - Show users that have at least 1 active service and more than 3 unpaid invoices: This may happen when a provision plugin is not suspending a service, or just human mistake (useful to find customers that are not paying because of not having their services suspended) SELECT many_invoices_customers.id 'customer_id', services.id_value 'service_id' from (SELECT i.client_id 'id', count(*) 'c' FROM invoices i, clients c WHERE c.id = i.client_id AND i.status != 'void' and i.paid != i.total GROUP BY i.client_id HAVING c > 3) many_invoices_customers, services WHERE services.client_id = many_invoices_customers.id AND services.status = 'active'; - Show users that have more than 3 unpaid invoices and at least 1 suspended service: let's you clean up users that don't pay anymore (and manually cancel them) SELECT many_invoices_customers.id 'customer_id', services.id_value 'service_id', many_invoices_customers.c 'invoices_number' from (SELECT i.client_id 'id', count(*) 'c' FROM invoices i, clients c WHERE c.id = i.client_id AND i.status != 'void' and i.paid != i.total GROUP BY i.client_id HAVING c > 3) many_invoices_customers, services WHERE services.client_id = many_invoices_customers.id AND services.status = 'suspended' ORDER BY many_invoices_customers.c DESC; I haven't implemented auto service cancel yet, but maybe is useful to someone here *Those queries are meant to be executed directly into your blesta MySQL DB.
  9. Just a heads up, I'm upgraded my blesta installation from 3.3.0 to 3.5.1, and I noted that the services tab at client/admin user dashboard view disappeared. By checking the network section of google chrome developer tools, I found that it was an error with loading a vendor class "PricingsFactory". Class 'PricingFactory' not found on line 3405 in/[..blestadir..]/public_html/app/models/invoices.php I tried putting the original Blesta 3.5.1 index.php into the installation and it worked fine. When I tried to use the Vqmod installer the problem came back. So there is a problem with the Vqmod installer, introduced in some blesta version between 3.3.0b2 and 3.5.1.
  10. Hi, I'm thinking about making a custom provisioning module for my game servers since I don't use any known game server panel. Since there may be some deployments that are not so fast, it's not possible to return the server data in the same call to the backend API (like multicraft does). Along with this, I want to implement a deployment queue at backend, so if 10 clients rent a server at the same time, Blesta will add a job to the backend's queue (via POST to an API) and then a job processor at backend will poll every 10 seconds for a new game-server install job. The part that i'm not sure how to do is how the backend notify Blesta that the service has been activated, considering that in a worst case scenario deployment can be done 999 days later after blesta POSTed the job into backend's queue. So I've been thinking about some ways to do this: 1) Magic blesta API call that I don't discover yet which allows to set service field data and mark service as active so the welcome e-mail is sent 2) Make the backend send the e-mail with service field data generated at deployment (i.e the IP address of a virtual machine, or a gameserver port ). In this case, I don't know how to send this data back to blesta, so custom data is shown at service tab. Does anybody have a suggestion or maybe had experience developing a similar module? Thanks!
  11. You can try my workaround to this issue at using Universal Module for dedicated servers for instance (you need to let the user know what's their IP address, assigned after the order is done) [blesta 3.2.1] Universal Module Workaround: Show Service Fields At Client Panel [blesta 3.2.1/3.3] Universal Module Workaround 2: Hide Certain Service Fields From Being Shown On Order Page Both should work with blesta 3.3
  12. Bump. I think I posted on the wrong section and the thread got moved.
  13. Hello, I have a game server hosting company and I'm using blesta as my billing and management platform. It's common at game server rental to have a base price and charge per server slot. At Blesta 3.3 prorate was introduced for upgrading packages and payment terms, but it's not included when an user wants to keep the same payment term but have a higher slot count, which is set-up as a configurable option with many options (from 10 to 60 players, but it can be up to 500 with a step of 5 slots). I don't think that the slot options should be added as different packages, so I think it would be very useful to be able to upgrade configurable options with prorate feature. Considering that blesta is preparing to enter to the game server hosting area with the inclusion of Multicraft module and the development of TCAdmin, I think that you should also consider implementing this. (Please correct me if it's already implemented, I haven't tested all the new features yet) Thanks! Rodrigo
  14. That's pretty necessary! When I found that problem I just did it the hard way (deleting lines and stuff). Thanks for your contribution
  15. Thanks! After reading your post I noticed that I forgot a lot of the steps that I actually did. Does your method solves what I posted here?: http://www.blesta.com/forums/index.php?/topic/2961-select-specific-outer-template-for-order-pages/#entry21226 For who may be reading my post, note that I just put the steps to modify the content outside the container, so you need to make a new order page template as usual, and then apply what I did (or flangefrog's method if it does the same, in that case, you should proceed without doubt with his method). Also, thanks for the vQmod! I'll look to convert my patches as possible (hint to myself: download original blesta 3.2.1 and do a diff between the two install folders )
  16. Sorry, I haven't noticed about the new posts. It has been a while since I have done this design and hack, I'll check out which changes I did. I really doubt that my developing tools are the most effective. Currently I only use SSH to connect to my remote development web server and edit everything with "nano" console text editor, nothing fancy. Doing this allows me to do a change in the blesta dev setup and be able to see it instantly on the browser without having to upload anything. When I need to upload something I use "sftp" (something like FTP over SSH) command. I guess it starts to be more comfortable to use console commands when you are used to them. Also, when designing a web page I just use google chrome's element inspector, and I start to poke around and make all the changes I want until I get something I like. After that, I start to do the real changes to the template files. Surely my development environment is not the best for large projects, but I find it useful for doing minor changes or when I want to do quick experiments. For the ones asking for the hack I did, I don't remember quite every step that I've done (this is a disadvantage of not using version control system like GIT). First, duplicate an existing template folder at app/views/client/ , I named the duplicated folder "ts3" (you will see the reference to this folder name at the code) Here's the change that I did at plugins/order/order_form_controller.php , I don't remember which part came with the original code, but I think if you look a bit into the file you will get how to implement it if (($structure_dir = $this->getViewDir(null, true)) && substr($structure_dir, 0, 6) == "client") $this->structure->setDefaultView(APPDIR); if(strpos($this->getViewDir(), "ts3") !== false) { $this->structure->setView(null, "client/ts3"); } else { $this->structure->setView(null, $structure_dir); } I sincerely don't remember how this hack works, but by reading the code above I think $this->getViewDir() may show something related to the URL, so I try to match the word "ts3", and if it's found, then apply the template at client/ts3 instead of the default one. This is clearly not the best way to do this (and it will never be), and that's why I didn't shared it as my other patches (which are somewhat acceptable compared to this one). Note that if you do file changes you will have to re-apply the patches when you upgrade blesta (I'll have a hard time doing this when the new blesta stable goes out, my blesta install is full of patches that I did without version control, and I didn't took the time to learn to use Vqmod :oops: Good luck!
  17. Hi, Finally I've managed to make the custom order page design by applying a hack to order form controller that let me to assign an specific blesta template for this order page without changing the template of any other page. Maybe this would apply for a feature request, because with the current system we can't do a full order page customization
  18. After developing a blesta payment gateway and modifying multicraft module enough for making a provisioning module for a totally different service, I think that blesta is a *very* powerful platform for managing service from the service itself to the billing. I have a custom made GSP panel for my services, but as I'm preparing blesta for putting it to my production environment, I find that migrating the whole panel as a blesta module is a very attractive choice, as it can be more comfortable for users (less login combinations to remember (if you don't do something like a shared login), a single portal to manage all. You should really consider doing a module instead of a whole panel, but if you are going to sell and license your panel, you might want to keep it standalone. As a tip for developing, just be paranoid about user input, it always work lol (and you should consider using a WAF like apache's mod security just for prevention)
  19. I agree with your explanation, there should be no reason to change the key, but someone might do it and have bad consequences on his installation. I don't know if the data gets to a blackhole, or it just keeps saved on the database without reference in the code, but putting a real life case as example, if someone wants to change a service field key from "ip" to "host" because he wants to put FQDNs in some cases (so "ip" would not represent the field anymore), he will have a bad time with the data loss/dereference. I know that in that case changing the service field key is not necessary, but I think you should protect customers from themselves (As an hosting company owner I have to deal a lot with layer 8-made issues). It's not urgent, but I think it's necessary to at least include a warning to prevent users from incurring in bad practices.
  20. Hello, When I was making some patches to the module, I noticed that when you have a Package with Universal Module, which have active services on clients, and you go to module configuration and change the name of a service field, the value of the active clients will disappear. Example: Before changes, looking at a client's service: Package: Foo (using universal module) Service Fields: 'bar' => "barcustomvalue23443" 'baz' => "bazcustomvalue2353454562" Now, let's change the service field names at admin CP: 'bar' gets renamed to 'bar1' 'baz' gets renamed to 'baz1' After changing service field names, looking at a client's service: Package: Foo (using universal module) Service Fields: 'bar1' => "" 'baz1' => "" So, after the service field name change the values won't be preserved. This could be a problem for an installation with many field Expected Behavior: Current services should maintain their values, but get the service name changed as well: 'bar1' => "barcustomvalue23443" 'baz1' => "bazcustomvalue2353454562" *Using Blesta 3.2.1
  21. Order plugin views let you modify only what's inside the container, not the background and stuff. Maybe I'll make a patch for allow selecting outside template, but I think this should be a feature request.
  22. Hi, I managed to get a cool design by messing with the browser's Web Inspector, but when I was about to apply the changes to the order page design I've found out that I need to modify content outside of the order page views, but I don't want to change the rest of my pages. Should I place a feature request? It would be great to be able to create order pages where you can manipulate every aspect of the design. This is what I managed to get before I realized that I couldn't make an order page like this: For doing this design without changing the other order pages or the rest of blesta system we would need to have access to the whole design (or be able to select an specific template for the order page, then make a client template just for using with the order page). Main changes: tiled background, container set to have some padding, margins and transparent background Has anyone run into the same problem?
  23. This patch should help to use the Universal Module for manually provisioning services that need administrators to fill service fields with data after they do the activation. e.g. dedicated servers, IP needs to be shown at control panel after the service is activated, but it shouldn't be asked at order page. Requirements. - Blesta 3.2.1 Update: I Upgraded to Blesta 3.5.1 and It worked fine Instructions: 1. Open components/modules/universal_module/universal_module.php Find: public function getClientAddFields($package, $vars=null) { // Same as admin return $this->getAdminAddFields($package, $vars); } Replace with: public function getClientAddFields($package, $vars=null) { $fields = new ModuleFields(); if (!isset($vars->meta)) $vars->meta = array(); if (isset($package->module_row) && $package->module_row > 0) { $row = $this->getModuleRow($package->module_row); // Set the module row, which will allow us to reference it later when getName() is invoked $this->setModuleRow($row); $row_fields = array(); if ($row->meta) { $row_fields = $this->formatModuleRowFields($row->meta); $field_data = array(); // Reformat package fields into a more usable format foreach ($row_fields['service_fields'] as $key => $values) { foreach ($values as $i => $value) { $field_data[$i][$key] = $value; } } $newfield_data = array(); foreach($field_data as $field) { if(strpos($field['name'], "dontask_") !== false) { continue; } $newfield_data[] = $field; } $this->setModuleFields($fields, $newfield_data, $vars); } } return $fields; } 2. Add "_dontask" in any part of the service field name 3. Protip: you should combine this patch with Universal Module Workaround: Show Service Fields At Client Panel , for best experience. Preview (Using both patches): Setting up Universal Module for showing certain service fields in Client's Manage Service (Workaround 1) and Hiding some service fields from being asked at order page Order Page with hidden fields Admin CP: Manually activating service, all fields being shown Fields Shown to Client (Workaround 1 + 2) Download universal_module.php with both workarounds applied (Only for Blesta 3.2.1): universal_module.php
  24. Rodrigo

    Package Custom Fields

    Hello, I've made a patch for Blesta 3.2.1 for showing many service fields into clients panel, and you can choose which ones to show by adding "public_" prefix Check it out: [blesta 3.2.1] Universal Module Workaround: Show Service Fields At Client Panel
  25. Hello, As other users reported in the forum, this issue is making troubles for services that doesn't have proper provisioning modules. By doing the following changes, a Tab will appear at client's manage service page, showing all the service fields that have the public_ tag on their name. Instructions: 1. Open components/modules/universal_module/universal_module.php Find: private function isUrl($str) { return preg_match("#^\S+://\S+\.\S+.+$#", $str); } Add After: /** * Returns all tabs to display to a client when managing a service whose * package uses this module * * @param stdClass $package A stdClass object representing the selected package * @return array An array of tabs in the format of method => title. Example: array('methodName' => "Title", 'methodName2' => "Title2") */ public function getClientTabs($package) { return array( 'moreinfo' => array('name' => "More Info", 'icon' => "fa fa-gears") ); } /** * The More Info tab * * @param stdClass $package A stdClass object representing the current package * @param stdClass $service A stdClass object representing the current service * @param array $get Any GET parameters * @param array $post Any POST parameters * @param array $files Any FILES parameters * @return string The string representing the contents of this tab */ public function moreinfo($package, $service, array $get=null, array $post=null, array $files=null) { $row = $this->getModuleRow($package->module_row); $out = ''; $servicefields = array(); foreach ($row->meta as $key=>$value ) { if (strpos($key, "service_field_name") !== false) { // Here we match the service field label with their key and value foreach($service->fields as $field) { if($field->key == $value) { $name = 'service_field_label_' . str_replace('service_field_name_', '', $key); $servicefields[] = array("label" => $row->meta->$name, "key" => $value, "value" => $field->value); } } } } foreach($servicefields as $field) { // Filter out for showing only public fields if(strpos($field['key'], "public_") === 0 ) { $out .= "<p><b>". $field['label'] . ":</b> " . $field['value'] . "</p>"; } } return "<h4>Service Information</h4><br />" . $out ; } 2. Make sure that the service fields that you want to show to the client start with "public_" prefix Preview Setting up public service fields Service fields being shown on client's "Manage Service" page Download drop-in replacement file (if you don't want to manually add the above lines) (Only for Blesta 3.2.1): universal_module.php Caution: This file will be overwritten if you update Blesta and the Tab will disappear (there is no other risk or any service data loss). If you change the service field name of a existing field, the data will not be preserved (bug?) EDIT: This still works for Blesta 3.5.1. I'm not sure if it's still needed, but I'm already using it for my production blesta website so there's no way back
×
×
  • Create New...