Jump to content

AllToolKits.com

Members
  • Posts

    139
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by AllToolKits.com

  1. Assume that customer bought a packgae of cost $40 per month. Using cron we are generating monthly invoice for this package. But we need to add some extra amount to this. We have to check cdr table and see cost of calls in the current month. If it's $12 in the last month, the invoice should show total as $40 + $12 = $52. How i can do that ?
  2. Hi all, Worked with some of the blesta customers to build modules and plugins for them. If you are looking for a blesta module or plugin development, please PM me and we could have a discussion. Thanks.
  3. From module i am adding a domain. When adding i check weather the domain already exist or not $details = $this->Services-> searchServiceFields($module_id, "serv_options1", $domain); if($add) { $rules['serv_opt1']['unique'] = array( 'rule' => empty($details) ? true:false , 'message' => "Domain " . $domain . " already exist" ); } I don't want the above rule if the status is changing, so need a way to know that fresh creation of service or status change is going on.
  4. Hi, addService method of Module is getting called when i create a new service and also when i change status of a service from pending to activate. Is there a way i can distinguish between those two calls ? That's i would like to know weather the addService is called to add a new service or it's called to change status. How i can understand that ?
  5. Can we make the status of an order active by default?
  6. Hi, after placing an order from client side of the blesta, it's not listing under services section. But if i create a service from admin section, i can see those services listed from admin section. Any idea why it's so?
  7. Hi, Is there anyway to hide check box that prsent in the add service page? Service feilds section also do have this check box, is there anyway to hide it?
  8. I got what i want now $params = $event->getParams(); $service_id = (int) $params['service_id']; Loader::loadModels($this, array("Services", "Packages")); $details = $this->Services->get( $service_id); $package_id = (int) $details->package->id; $p_details = $this->Packages->get($package_id); $meta_array = array(); $meta_array = $p_details->meta;
  9. From the Services.add section in the page http://docs.blesta.com/display/dev/Event+Handlers it has below information configoptions - An array of key/value pairs of package options where the key is the package option ID and the value is the option value (any other service field data passed to the module) But that part is missing in the $params. Everything else is there. everything else is there.
  10. Hi, In a plugin i have below code public function getEvents() { return array( array( 'event' => "Services.add", 'callback' => array("this", "myAction") ) ); } public function myAction($event) { $params = $event->getParams(); echo "<pre>"; print_r($params); } This code is calling when a new service is added. $params do have many details like service id and many other info. I need package details too here. When adding a package i am giving few informations under module options, but i can't see that in $params . How i can get those package details in the function myAction?
  11. Can cron trigger when we add a service to a customer?
  12. I would like to use some standard method. If nothing work, will use mysql triggers.
  13. Is there any module function that will be called when adding a service to a customer? addService function will be called when we create a service, right? Any way to call some function when we add an existing service to a customer?
  14. Tyson and naja7host, thanks for your answers. It worked well now I had to uninstall and then install plugin to work code changes.
  15. My aim was not send an email, i just want to know weather the event is working or not. I added your code. after invoice edit even now no mail was sent. Is there any other wahy to know wetaher the event is working or not?
  16. I created a plugin, in that i wrote public function getEvents() { return array( array( 'event' => "Invoices.edit", 'callback' => array("this", "mailme") ) // Add multiple events here ); } and function mailme as below public function mailme($event) { // This will execute when the "Appcontroller.preAction" event is triggered mail("me@mydomain.com", "invoice edit", "An invoice is editted!!!"); } But i am not getting any email when an editting. Why it will be so? I logged in as admin and editted some invoices and no email yet in my inbox.
  17. Hi, I am developing a module, i want to call an api from module after the order is placed. How i can do that from module? Also is there anyway to call an api before checkout is done ?
  18. Hi, I need to add an extra field in Module Options of Universal Module in Blesta.(below the Name field). But it doesn't save the value when add a new field in add_row.php file (view part). How to add a new field in Module Options of Universal Module for Blesta. I can't see how it's creating table for it, there is no install function. usually i had seen code like this to create a table. $this->Record-> setField("set_id", array('type' => "int", 'size' => 10, 'unsigned' => true, 'auto_increment' => true))-> setField("set_key", array('type' => "varchar", 'size' => 256))-> setField("set_value", array('type' => "varchar", 'size' => 256))-> setField("set_status", array('type' => "int", 'size' => 1))-> setKey(array("set_id"), "primary")-> create("synergy_settings", true); But there is no such code in Universal Module, how it's creating a table?
  19. When adding a new row from my module, i am adding Service Options. But they are not coming in order form. Any idea why it's so? I am developing a plugin similar to universal module.
  20. Hi, When creating a package, in Module Options section, i have a server drop down with name of the server in it. On selecting a server, i must be able to call some api with the server details and the response i get should display in text boxes in the Module Options section under the server dropdown. How i can do it?
  21. I got it working I was trying with primary key of the table as below public function moduleRowMetaKey() { return "server_id"; } When i changed to public function moduleRowMetaKey() { return "server_name"; } it worked.
  22. Hi Blesta Mates, Please see the attached shot. When creating the package, i selected my Module, but servers added are not listed in the drop down. What's the procedure to get that displayed in the dropdown?
  23. I fixed it I thought $vars will have the data, but it was not there. So added below code if (empty($vars)) $vars = $this->formatModuleRowFields($module_row->meta); private function formatModuleRowFields($module_row_meta) { foreach ($module_row_meta as $key => $value) { $fields[$key] = $value; } return $fields; }
×
×
  • Create New...