Jump to content

bobs@sectorlink

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Flint, MI

bobs@sectorlink's Achievements

Newbie

Newbie (1/14)

5

Reputation

  1. I'm following what Tyson said....So basically, I'm fetching the following: SELECT `value` FROM `service_fields` WHERE `service_id`=:sid && `serialized`='1'....I then unserialize it, to get an array, at that point I add a label to the array and serialize it back up and update the database. Super, that creates the label in the DB, where is the MVC for /admin/clients/view/ Services, so I can display my new label?? Not sure, if this matters, but this is on the Proxmox V2 module, but we use other modules as well... Thanks, for all the excellent support.
  2. I figured it out... /var/www/blesta/app/controllers/client_services.php in the method: review I added $this->set("client", $this->client); and now it works.
  3. Manage Configurable Options for ...VPS, then click Review.This is where the client_serivces_review is loaded. FYI: I'm not sure if this is part of Proxmox V2 (version:1.7.0 by Mohamed Anouar Achoukhy)? I think the template is loaded before that module gets added in...? I would think it lives in, /var/www/blesta/app/controllers/client_services.php, I've tried to add $this->set("client", $this->client); to a few methods, but still I get an error that $client is not defined...
  4. I've tried to do a full search for client_services_review on all files, but end up with no results in NetBeans. I also, did a debug_print_backtrace in the template file, but am still not sure where the controller for this template exists: debug_print_backtrace(); #0 include() called at [/var/www/blesta/vqmod/vqcache/vq2-lib_view.php:124] #1 View->fetch(client_services_review, ) called at [/var/www/blesta/lib/controller.php:277] #2 Controller->render() called at [/var/www/blesta/lib/dispatcher.php:128] #3 Dispatcher::dispatch(/client/services/review/6) called at [/var/www/blesta/index.php:27] I want to use $this->client->id (the client ID) or $client, but cannot since $this and $client are not in scope in the template file: /var/www/blesta/app/views/client/bootstrap/client_services_review.pdt url = https://XXX.com/client/services/review/6 All I want to do is add one line of code to the controller file (I just cannot find which controller/method I need to add to) via vqmod: $this->set("client", $this->client); Thanks.
  5. Thanks, Nelsa. I was able to make my plugin work via the site now, but am stuck on how to get it to work on the Console (Command Line Interface for Linux). What should I try for the /usr/bin/php index.php [PATH to the controller]? /plugin/hourly/main/invoices/ works on the site, but I'm not familiar enough with how Blesta routes the plugin via command line.
  6. Very good, I've used vQmod before with OpenCart, so that will work just fine. I've already did some testing and got it to override the view.... Thanks, for the link to the download. Have a great day
  7. I've made a plugin that does Hourly billing and it needs to override how the built in controller for client/services/review/ works, so it will also display some new features. It is possible to do this without changing the core (controller or views) files for it, in other-words: I want to be able to do updates without re-copying over files to the core system. I was told that the new invoice plugin does this somehow, but I haven't had a chance to look at the code.... Right now the only way I've got it to work is by adding an include (in the core view file /var/www/blesta/app/views/client/bootstrap/client_services_review.pdt) to my plugin view, which is not what I want, as I will have other things I will also need to hack in that way as well. I hope its possible, to override how the tab for client/services/review page works, with some controller logic of my plugin. How would you go about extending a plugin to override the main controller file? Thanks, in advance. Also, has anyone already made an hourly plugin I could use, just checking...I could not find one in the forums... Sincerely, Bob
  8. So I was able to create a email template, but I am not sure how you set the name and description for this temploate. Also, how do I remove the Email/Group, so I can rename it? ---------------------------------------------------------------------------------------------------------------------------------------------------------- /plugins/my_plugin/controllers/admin_main.php <?php class AdminMain extends MyPluginController { public function index() { $this->uses(array("Emails", "EmailGroups")); $group = array( 'action' => "MyPlugin.custom_action", 'type' => "staff", 'plugin_dir' => "my_plugin", 'tags' => "first_name,last_name" ); // Add the custom group $group_id = $this->EmailGroups->add($group); $email = array( 'email_group_id' => $group_id, 'company_id' => $this->company_id, 'lang' => "en_us", 'from' => "no-reply@mydomain.com", 'from_name' => "My Company", 'subject' => "Subject of the email", 'text' => "Hi {first_name}, This is the text version of your email", 'html' => "<p>Hi {first_name},</p> <p>This is the HTML version of your email</p>" ); // Add an email to the group $this->Emails->add($email); } } ?>
  9. Thanks, that did the trick. Have a Great Day, Sincerely, Bob
  10. Thanks for the Error handler, I see the issue is with my client_id - the system says it is incorrect. public function testing() { Loader::loadModels($this, array("Invoices")); $now = date("c"); $lines[] = array( 'description' => 'Test #1 worked.', 'qty' => 1, 'amount' => '2.33', ); $lines[] = array( 'description' => 'Line Item #2 worked.', 'qty' => 2, 'amount' => '1.33' ); $vars = array( 'client_id' => '1500', 'date_billed' => $now, 'date_due' => $now, 'date_autodebit' => $now, 'status' => 'void', 'currency' => 'USD', 'note_public' => 'Pub note1', 'note_privote' => 'Pri note1.', 'term' => '', 'delivery' => array('email'), 'lines' => $lines ); $invoice_id = $this->Invoices->add($vars); // Errors? if (($errors = $this->Invoices->errors())) { print_r($errors); } else { echo 'Worked #' . $invoice_id; } }
  11. I found some examples by searching for "Invoices->Add(", with my IDE. I changed now to: $now = date("c"); I see that delivery should have a numerically indexed array of delivery methods: $a_i['delivery'] = array(0=>'email'); Form looking at the invoice method and comments, but still I get the message: Failed!!!
  12. I'm doing a test method for invoices, but it echos Failed and I see no new invoices. What parameters am I missing or doing wrong? Here is the method inside of my plugin: public function testing() { Loader::loadModels($this, array("Invoices")); $now = date("Y-m-d H:m:s"); $a_i['client_id'] = 1500; $a_i['date_billed'] = $now; $a_i['date_due'] = $now; // The date the invoice is due // $a_i['date_closed'] = ''; // The date the invoice was closed $a_i['date_autodebit'] = $now; // The date the invoice should be autodebited $a_i['status'] = 'void'; // 'active','draft','proforma', or 'void' $a_i['currency'] = 'USD'; $a_i['note_public'] = 'Pub note1.'; $a_i['note_private'] = 'Pri note1.'; $a_i['term'] = ''; // Leave blank for non recurring invoice! $a_i['delivery'] = array('method'=>'email'); // $a_line['service_id'] = ''; // The service ID attached to this line item (optional) $a_line['description'] = 'Test #1 worked.'; $a_line['qty'] = 1; $a_line['amount'] = 2.33; $lines[] = $a_line; $a_line2['description'] = 'Line Item #2 worked.'; $a_line2['qty'] = 2; $a_line2['amount'] = 1.33; $lines[] = $a_line2; $a_i['lines'] = $lines; $invoice_id = $this->Invoices->add($a_i); if (isset($invoice_id) && $invoice_id > 0) { echo "Worked # " . $invoice_id; } else { echo "Failed!!!"; } }
  13. I found articles: https://docs.blesta.com/display/dev/Plugin+Cron+Tasks and https://docs.blesta.com/display/user/System+%3E+Automation#System>Automation-RunningtheCronManually and I see example code from /var/www/blesta/plugins/auto_cancel/auto_cancel_plugin.php . I don't want to run a job every day and don't want to bother with the install code for this.... I've got a plugin working via the web site, but need to run it from CLI (Command Line Interface). I just want to create my own Linux Cron job that runs once a month, so I am wondering what I need for the command line [sudo crontab -e]: @monthly "/usr/bin/php index.php /plugin/hourly/main/invoices/" Sorry, I don't have direct access to the server to play with the path, or I wound not be asking how to do this. I've looked at the file /var/www/blesta/config/routes.php, but an stuck... It looks like the path may need to be something like: admin/api/plugin/hourly/main/invoices/ ? Any pointers on this? Here is my /var/www/blesta/plugins/hourly/controllers/main.php controller file: class Main extends HourlyController { public function preAction() { parent::preAction(); } public function invoices() { Loader::loadModels($this, array("Hourly.HourlyInvoice")); $this->HourlyInvoice->start_invoices(); } }
×
×
  • Create New...