Jump to content

Adam

Members
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by Adam

  1. 11 hours ago, cats said:

    I had an issue with an invalid timestamp error being returned from Cerb API when viewing the helpdesk link from Blesta client view. The time was set correctly, and I couldn't see a difference in time in the verbose output from CURL. After some digging around, I saw that Cerb looks for X-Date custom header before falling back to $_SERVER['HTTP_DATE']:

    I changed the cerb_api.php for the plugin to add in the custom X-Date:

    This fixed the error.

    Not sure if it is just my setup but I thought I would share in case it is a widespread error or affecting anyone else.

    Cats:

    What version of Blesta and Cerb are you running? I can try and replicate the issue on my end.

    From what you described it appears to be something very specific to your environment. The cerb_api.php file is provided by Cerb as a way for systems to authenticate with Cerb until Oauth Machine-to-Machine is implemented in Cerb. This is code that is provided by Cerb - https://cerb.ai/docs/api/libraries/php/

     

    Part of the secure communication that occurs is that when you issue a request to cerb api, you sign the request with a timestamp as part of the Cerb-Auth header. That timestamp is matched against the request that is made to the cerb ReST endpoint.

    If HTTP_DATE is not being set, then that means the request is coming from non-standard source. Maybe command line PHP program or something like javascript XMLHttpRequests request, etc. Does this occur in your environment?

     

    -Adam

  2. 12 hours ago, cats said:

    Just upgraded to Blesta 5 and latest version of the plugin. 

    In doing some tests, the submit new ticket form doesn't require a client to select a service from the drop down menu. If they don't, submitting a ticket returns an error which is: "Undefined index: service_id."

    Once a service is selected, it cannot be unselected.

    Not sure if it's just my installation that doesn't require a service to be selected, will keep testing variations.

    Edit: quick update; seems to only be a problem for clients with multiple services. For clients with one service, it selects that service by default.

    Hi Cats!

    Running version 5.1.2 of Blesta and Cerb 10.0.5 I was able to reproduce part of your problems. I went ahead and opened an issue on GitHub: https://github.com/SolidNetSoftware/plugin-cerberus/issues/5 and fixed what I could reproduce:

    • Enforce services to be selected by users

    This should remove the "undefined index" error you were getting. 

    I was not able to reproduce any of the other errors you mentioned. I created a client that has 2 services and one that 0 services. The client with 2 services is able to select the services from the drop down without issue and switch between them. The client with 0 services will see an empty dropdown and the Create Ticket button is disabled.

    If you have a custom theme, I am guessing that is what is causing issues. Hopefully the new version I released will offer more compatibility with custom themes.

    Please let me know either way.

    https://github.com/SolidNetSoftware/plugin-cerberus/releases/tag/v1.3.1

    Follow the upgrade process here: https://docs.solidnet.software/blesta-cerb/getting-started/upgrade/

     

    -Adam

  3. On 1/11/2021 at 11:44 PM, Adam said:

    Hi Cats,

    I was able to re-create the issue you described in my staging environment running Cerb 9.6.8. None of the standard bot behaviors that Cerb offers is able to alert workers of the participates in a ticket that one was opened.

    I suspect this is an issue with Cerb as I noticed the activity log does not record the ticket being assigned or moved to any group or bucket. I have sent an email to the Cerb team to see if this is an issue with Cerb or how I am using their ReST API.

    I will let you know the outcome.

     

    Thanks!

    -Adam

    Cats,

    Plugin has been updated to address this issue. v.1.20 has been tested and releasted with the latest version of Cerb and Blesta 4 series. Blesta 5 support is being test now.

    https://github.com/SolidNetSoftware/plugin-cerberus/issues/1

    https://github.com/SolidNetSoftware/plugin-cerberus/releases/tag/v1.2.0

    Follow the upgrade process here: https://docs.solidnet.software/blesta-cerb/getting-started/upgrade/

    Thanks,

    -Adam

  4. 1 hour ago, cats said:

    Hey Adam

    Thanks very much for this plugin, it's great. One thing I can't figure out is the event to use as the trigger in a bot to email staff about a new ticket created and email the client an acknowledgement.

    Cerb doesn't seem to treat a ticket created through the plugin the same event as a new ticket. I've also tried new record or modify record events as the trigger to no avail.

    Any ideas?

    Thanks again for the plugin, much appreciated.

    Hi Cats,

    I was able to re-create the issue you described in my staging environment running Cerb 9.6.8. None of the standard bot behaviors that Cerb offers is able to alert workers of the participates in a ticket that one was opened.

    I suspect this is an issue with Cerb as I noticed the activity log does not record the ticket being assigned or moved to any group or bucket. I have sent an email to the Cerb team to see if this is an issue with Cerb or how I am using their ReST API.

    I will let you know the outcome.

     

    Thanks!

    -Adam

  5. On 9/23/2020 at 12:35 PM, Richzendy said:

    I don't want to change the service price, i only want to add new items to the bill.

     

    Ya, I got that from your first message. My comment regarding invoices and pricing was looking at the API for modules there is no function that delegates invoices or pricing to any module. That is all part of the core components of modules that can not be overwritten. Again, I could not wrong but that is my understanding for things.

    On 9/23/2020 at 12:35 PM, Richzendy said:

    Actually the service to my module create a service bill at the end of the billing cycle and i have a cron to run later and this cron create custom invoices to extra charges like calls and DID numbers, but i want to a unique bill to the service with all items to avoid extra fees if the client use a credit card to pay for all, i want a total amount to all items and a unique payment.

    Yup, that is one way to do it.

    The other way is what we described above to replace your cronjob via a Blesta plugin. The plugin will listen/subscribe to all Invoices.add events and then determine if the invoice needs to have additional line items added and have the total be updated.

     

    Like I previously mentioned, because invoice creation is handled within the core, there is no plugin or module that can modify the behavior.

     

    You could modify Blesta core files as an alternative, but I think subscribing to Invoices.add events is the way to go. Perhaps one of the Blesta Staff might have better ideas. 

     

  6. From what I understand you want each invoice generated for a customer to be charged on usage. For example, used VoIP minutes in your PBX system or bandwidth used on a hosting plan?

    I am not as familiar with modules as I am with plugins but from reading the documentation it does not appear you can control the price of a service once it has been established. I don't think modules can subscribe to event notifications. I also do not think modules are involved in the invoice creation process which makes them easy to write, implement and maintain but in your case has some limitations.

     

    You are correct in that you can use a plugin to overwrite and add this functionality. You can use any module (universal, existing, custom, etc.) and then with your custom plugin subscribe for every Invoices.add event. At that point, your plugin code could get the invoice, client and package information and then connect with your 3rd party system (PBX, port bandwidth usage, etc.) and update the invoice to include the necessary line items.

    The one gotcha that might happen with this solution is that your clients *might* get an email with an invoice and PDF of the amount _before_ your plugin finishes. I have not verified this but taking a quick look at the code I think that is the right behavior. Maybe one of the Blesta devs can confirm this.

     

    Hope this helps.
    -Adam

  7. On 9/6/2020 at 8:29 PM, System Error Message said:

    Hi im comparing between blesta and whmcs. What attracts me to blesta is the open source so that we can easily add the payment gateways that we use which are local which im not sure if possible with WHMCS. We just migrated from CPanel + WHM to directadmin and a different server and any of the freer billing systems just either plainly dont work or require a team of devs to integrate it.

    I'd like to know if there are any limits listed below when purchasing blesta
    - provisioning only on same server?
    - can multiple servers be provisioned from a single license?
    - Are there any limits to how many clients?
    - Are there limits to the type of services we can provision or bill for?

    In our country, datacenters still sell VPS on 1Mb/s connections and dedicated/colocations on 100Mb/s due to them getting the raw end of the deai in bandwidth. Since we arent CPU limited from the way we make websites but rather bandwidth limited, we are stuck with more cheaper and smaller servers than fewer more powerful ones in order to ensure that client websites load fast (yes we do keep the page size down below 1MB where possible) as our configuration is very efficient on CPU and RAM and we are already using CDNs. Renting from neighbours isnt a great idea as most ISPs in our nations have very slow connections outside the country which makes it unsuitable to quickly load a website even with a CDN.
     

    A single Blesta license permits you to install one copy of the Blesta on one domain, e.g., yourdomain.com.  Beyond that, Blesta does not limit you in

    • clients
    • invoices
    • connected servers (cPanel, Direct Admin, etc.)
    • support tickets
    • staff / workers

    For your setup, a single license will work for yourdomain.com which means 1 domain and 1 server. If you run multiple companies, company-a.com and company-b.com as an example, and each want to have Blesta on their own domain, then you need to purchase additional domain license called “Multi-Company” license addons.

    Full information here: https://docs.blesta.com/display/support/End+User+License+Agreement

    Note: You should reach out to Blesta Sales to get an official answer.

    -Adam

  8. Hi Turner!

    The recommend way to download this plugin is via git. Git allows you to:

    • Quickly upgrade by fetching only changed files for the last update
    • Track local changes that you have made
    • Easily revert files back to their default condition
    • See what changes would occur before performing an upgrade
    • Continuously merge your local changes with our future updates.

    If for what ever reason you do not want to use git, then you can download a tagged release as indicated from the documentation: https://docs.solidnet.software/blesta-cerb/getting-started/install/#download-direct

    As mentioned, you will need to name the folder cerberus

     

    I did take your feedback and update documentation website to make sure to emphases to name the folder cerberus within the plugins folder. 

     

    Hope this helps.
    -Adam

  9. On 8/28/2020 at 6:43 AM, Kian said:
    • What about service level agreement? For example client X purchased SLA GOLD hence we must reply to his support tickets within 60 minutes otherwise we pay a penalty of 5%
    • Esitimated response time based on working days, working hours, holidays
    • Premium ticket? Pay for highest priority
    • Emergency ticket? Highest priority but if there was no emergency we hit the customer with a penalty fee of X euro

     

    @Kian

    For these use cases, I suggest you use a 3rd party helpdesk with Blesta. I am going to be bias and recommend Cerb. They are going to have all those features you are asking, and then some.

    I do not work for Cerb but I am the author for the free plugin that integrates Cerb and Blesta. We use both for our company and in fact we run multiple brands. All our staff work and operate out of a single interface which is Cerb for sales/support/billing/etc helpdesk tickets. We then use Blesta for billing, service and client management.

    In my opinion, Cerb has a higher learning curve to get started vs the built in helpdesk with Blesta but it is well worth it in the long run. 

     

    If you have specific questions around this, reach out, happy to help.

    -Adam

  10. Hi All,

    I am proud to announce that first release of Blesta-Cerb plugin.

    What is it?

    This plugin enables Cerb integration with the Blesta clients to create, update, reply, attach files and close tickets in the native Blesta client interface. This plugin replaces the built-in Support Manager with Cerb.

    Why do I want it?

    • What is it good for?: If you receive high volume of emails or helpdesk tickets then replacing Blesta’s helpdesk for Cerb’s would increase productivity and reduce time spent answering emails.

    • What is it not good for?: If the Blesta built-in helpdesk and support system meets your needs then switching to Cerb might add additional complexity. However Cerb’s features are unmatched in the industry.

    • What is it not yet good for?: Cerb offers knowledge base articles that can be viewed by staff and published on its own support center portals. This functionality is not yet integrated into the blesta-cerb plugin.

    • Common use cases for Blesta-Cerb Plugin: If you find that you need to do any of the following then Blesta-Cerb would be a good fit.

      • Email and Helpdesk services are out source
      • Notify workers and staff of new emails and events
      • You offer out source services and need a central place for all support requests
      • Need the ability to automate email and support workflows such as password reset, IP unblocks, etc.
      • Collect Net Promoter Score (NPS), Customer Satisfaction (CSAT) or Customer Effort Score (CES) scores
      • … and so much more with their bots 

    Cost:

    This plugin is 100% open source under the MIT license and is offered at no cost to you. Paid support is available for those who need it. Otherwise support is offered as best effort on the BitBucket issue page.

    Screenshot Tour:

    Visit: https://docs.solidnet.software/blesta-cerb/tour/

    How do I use this plugin?

    Visit our online documentation: https://docs.solidnet.software/blesta-cerb/getting-started/

     

  11. What are you trying to do? Determine if a user exists within Blesta based on their login?

     

    If you are trying to use the Blesta API there is no need to "login" as the API requires Basic Auth with unique API creds, which is what you have done via aUser and aKey.

     

    If you are trying to determine if a user exists within Blesta based on their username and password, use the auth function instead of login. http://source-docs.blesta.com/class-Users.html#_auth

    Post to: api/users/auth.json

    With form data:

    const params = new URLSearchParams({
        "username": vars.username,
        "vars[username]": vars.username,
        "vars[password]": vars.password,
        "type": "any"
    });

    It will return true if the users exists otherwise false if the user does not.

  12. Syleron,

    This is a bug within Blesta and more so with minPHP. Great find.

     

    The issue is within app/controllers/api.php in the preAction function. The function tries to load the model from the url: support_manager.support_manager_tickets. 

    app/controllers/api.php
    // Ensure that the request is formatted correctly
    if (isset($this->get[0]) && isset($this->get[1])) {
        $this->model = Loader::toCamelCase($this->get[0]);

    It calls Loader:toCamelCase which returns

    SupportManager.supportManagerTickets

    What is expected is the following format:

    SupportManager.SupportManagerTickets

    On the surface this should not have caused an issue as if you called a function like get_declared_classes() it would show up as a class that was loaded. However, the problem is the case sensitive does manner when the api class calls method_exists and Router::isCallable. The minPHP function toCamelCase does not account for periods in its algorithm.

        /**
         * Convert a string to "CamelCase" from "file_case"
         *
         * @param string $str the string to convert
         * @return string the converted string           
         */
        public static function toCamelCase($str)
        {
            if (isset($str[0])) {
                $str[0] = strtoupper($str[0]);           
            }                                            
        
            return preg_replace_callback(                
                '/_([a-z])/',
                function ($c) {
                    return strtoupper($c[1]);
                },
                $str
            );
        }

     

     

    The Blesta team will have a permanent fix in place as there are many ways to solve this. For now, the below patch file will get things working on your end. Apply the following patch file with patch(1):

    --- app/controllers/api.php	2017-03-14 10:23:18.000000000 -0700
    +++ app/controllers/api.php	2017-07-05 21:35:18.337455862 -0700
    @@ -68,7 +68,7 @@
     
             // Ensure that the request is formatted correctly
             if (isset($this->get[0]) && isset($this->get[1])) {
    -            $this->model = Loader::toCamelCase($this->get[0]);
    +            $this->model = str_replace('_', '', ucwords($this->get[0], '_.'));
                 $this->model_name = Loader::toCamelCase(
                     strpos($this->model, '.') !== false
                     ? ltrim(strrchr($this->model, '.'), '.')

    -Adam

  13. 7 hours ago, fossxplorer said:

    @NetworkJack i'd like to have client's email address to be part of the POST data.

    Would adding 'client_email' => $client->email, to the  $ServiceMeta array of addService() do it?

     

    EDIT: it obvisouly wouldn't as we need a way of passing a "client" object to be able to access it's properties.

    Any hints about how to achieve this appreciated :=

     

     

    I would avoid modifying any Blesta code as much as possible. If you modify it, you own it. Think about upgrades and merging in requests, etc. Of course, if there is no other way, then go for -- a very nice feature of Blesta.

    The approach I would take is use Blesta's API to get all the information you need via HTTP ReST calls. The information Blesta posts today is enough for you to query the API and get the full record as it exists within Blesta.

    https://docs.blesta.com/display/dev/API

    -Adam

  14. Hello,

    I was following the documentation on how to create a custom cron job for a plugin: https://docs.blesta.com/x/PQEh and I noticed that after I called CronTasks::add() the cron job was not being called by cron or showing up under Company > Automation settings.

    I had to look at the source docs and figure out that in addition to calling CronTasks::add() I need to run CronTasks::addTaskRun().

    May you please update the confluence document to reminder developers to call CronTasks::addTaskRun() after CronTasks:add() during installs?

    Thanks,
    -Adam

  15. On 6/17/2017 at 8:41 AM, fossxplorer said:

    Sorry since i'm cross posting, but i might have posted my question in wrong place. Moderators, feel free to delete one of them.

    But i really need help to figure out how i can add a service option text field to grab a username for a module i've created. It's very simple module, straight from examples https://docs.blesta.com/display/dev/Module+Methods

    In WHMCS it was very easy for me to do so. And i don't any flexibility to add from Manage module like with Universal Module, but just a simple text field and read that service option field to provision users.

     

    Thanks :)

    I do not fully understand your question. Let me try and say it back to you:

    You created a custom module with Blesta in PHP. You would like during the order process for someone to enter a custom field called username (which is not the same and 100% different username of the person logged into Blesta) and you grab that input?

    Have you looked at ModuleFields? https://docs.blesta.com/display/dev/ModuleFields

     

    The other way to do this, is use the Universal Module, add a custom field to the order process. The Universal Module has a very useful option to make external ReST calls when an order is submitted. You would listen for this ReST call and then put all your business logic in that call.

    Blesta Admin -> Modules -> Managed Universal Module -> Edit Product Label (create a product label if you have not already)

    rest-calls.png.d41f1e6c91c11fb2ea84399656da20ee.png

    -Adam

     

  16. 6 hours ago, wmac said:

    Hi,

     

    I have the same problem but I have installed PHP mailparse extension it shows on PHP -m and PHP -i but Blesta still do not see it, I am running VestCP

    Create file called phpinfo.php in the root directory of Blesta and inside of it place:

     

    <?php
    
    phpinfo();
    
    ?>

    When you visit the page in your browser: does it show mailparse on the page?

     

    -Adam

  17. 5 hours ago, fossxplorer said:

    I Thanks @activa.

    I fail to see what the array $var contains reading https://docs.blesta.com/display/dev/Module+Methods#ModuleMethods-addService($package,array$vars=null,$parent_package=null,$parent_service=null,$status="pending")

    But i might get an overview by dumping the $var perhaps and see i guess.

    Also, i need to read in a custom field "username". Is that also something i can do through $var?

     

    http://source-docs.blesta.com/class-Module.html#_addService

    If you click on the description for any function it will expand (its of course not made clear with the template/theme of the page).

     

    -Adam

  18. 6 hours ago, speed2host said:

    Hey good post. But where exactlly should we add this lines? :) Were not all gurus in dev .. i run a Centos 7 on Apache 

     

     

    Best Regards

    This goes in your nginx config file. If you need further help, ask your technical staff or hire a server management company.

    -Adam

×
×
  • Create New...