Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/31/2014 in all areas

  1. Hello Blestars Today we show you how to add a new option called "My Private Notes" to your "My Info" option on Blesta (We hope Blesta added this to Core ) This option encrypts all info into the database, so its a secured way to, for exemple add your passwords, links or outher info you like to your personall use Like on WHMCS, we use a lot the "Notes" to save some info to remember later, but Blesta didnt have until today If Blesta add this to core, on WHMCS import script, also can import the Notes from your WHMCS into your Blesta Teaser: How to install (its simple) Open your phpMyAdmin and on the left select your Blesta Data Base, and on the right select "SQL" and execute: ALTER TABLE `staff` ADD `notes` TEXT NOT NULL AFTER `email_mobile`; Download and upload this file (blesta_file_private_notes.zip) into your blesta instalation in app/views/admin/default/ Open the file languages/[your language]/admin_myinfo.php find on line 14: $lang['AdminMyinfo.!success.notices_updated'] = "Your notice settings were successfully updated."; replace: $lang['AdminMyinfo.!success.notices_updated'] = "Your notice settings were successfully updated."; $lang['AdminMyinfo.!success.notes_updated'] = "Your private notes were successfully updated."; find on line 20: $lang['AdminMyinfo.gettabnames.text_notices'] = "Notices"; replace: $lang['AdminMyinfo.gettabnames.text_notices'] = "Notices"; $lang['AdminMyinfo.gettabnames.text_notes'] = "Private Notes"; find on line 51: $lang['AdminMyinfo.notices.no_subscription_results'] = "There are no subscription notices available to your staff group."; replace: $lang['AdminMyinfo.notices.no_subscription_results'] = "There are no subscription notices available to your staff group."; // Private Notes $lang['AdminMyinfo.notes.page_title'] = "My Information > Private Notes"; $lang['AdminMyinfo.notes.heading_notes'] = "My Private Notes"; $lang['AdminMyinfo.notes.field_notessubmit'] = "Update Notes"; open file app/models/staff.php find on line 906: public function validateNoticeActionExists($action, $staff_group_id) { $count = $this->Record->select()->from("staff_group_notices")-> where("staff_group_id", "=", $staff_group_id)-> where("action", "=", $action)-> numResults(); return ($count > 0); } replace: public function validateNoticeActionExists($action, $staff_group_id) { $count = $this->Record->select()->from("staff_group_notices")-> where("staff_group_id", "=", $staff_group_id)-> where("action", "=", $action)-> numResults(); return ($count > 0); } /** * Updates the given staff member private notes * * @param int $staff_id The ID of the staff member to update * @param array $vars An array of staff member info including */ public function editNotes($staff_id, array $vars) { // Update staff private notes //$vars["notes"] = systemEncrypt($vars["notes"]); $fields = array("notes"); $this->Record->where("id", "=", $staff_id)->update("staff", $vars, $fields); } /** * Fetches a staff member notes * * @param int $staff_id The ID of the staff member * @param int $company_id The ID of the company to set staff settings for (optional, if null, no settings will be set) * @return mixed An array of objects or false if no results. * @see Staff::getByUserId() */ public function getNotes($staff_id, $company_id=null) { $fields = array("staff.id", "staff.user_id", "staff.notes"); $staff = $this->Record->select($fields)->from("staff")-> where("staff.id", "=", $staff_id)->fetch(); return $staff; } open file app/controllers/admin_myinfo.php find on line 147: private function getGroupNotices($staff_group_id, $type) { $this->uses(array("StaffGroups")); // Get staff group notices $group_notices = $this->StaffGroups->getNotices($staff_group_id); if (!empty($group_notices)) { // Get all client email groups $this->uses(array("EmailGroups")); Language::loadLang("admin_company_emails"); $email_groups = $this->EmailGroups->getAllByNoticeType($type); // Create a list of email groups by action $groups = array(); foreach ($email_groups as &$email_group) { // Load plugin language if ($email_group->plugin_dir !== null) Language::loadLang("admin_company_emails", null, PLUGINDIR . $email_group->plugin_dir . DS . "language" . DS); $email_group->lang = Language::_("AdminCompanyEmails.templates." . $email_group->action . "_name", true); $email_group->lang_description = Language::_("AdminCompanyEmails.templates." . $email_group->action . "_desc", true); // Set only those notices available to this staff group foreach ($group_notices as $notice) { if ($notice->action == $email_group->action) { $groups[] = $email_group; break; } } } return $groups; } return array(); } /** * Retrieves a list of link tabs for use in templates * * @return array A list of tab names */ private function getTabNames() { return array( array('name'=>Language::_("AdminMyinfo.gettabnames.text_index", true), 'uri'=>"index"), array('name'=>Language::_("AdminMyinfo.gettabnames.text_notices", true), 'uri'=>"notices") ); } replace: private function getGroupNotices($staff_group_id, $type) { $this->uses(array("StaffGroups")); // Get staff group notices $group_notices = $this->StaffGroups->getNotices($staff_group_id); if (!empty($group_notices)) { // Get all client email groups $this->uses(array("EmailGroups")); Language::loadLang("admin_company_emails"); $email_groups = $this->EmailGroups->getAllByNoticeType($type); // Create a list of email groups by action $groups = array(); foreach ($email_groups as &$email_group) { // Load plugin language if ($email_group->plugin_dir !== null) Language::loadLang("admin_company_emails", null, PLUGINDIR . $email_group->plugin_dir . DS . "language" . DS); $email_group->lang = Language::_("AdminCompanyEmails.templates." . $email_group->action . "_name", true); $email_group->lang_description = Language::_("AdminCompanyEmails.templates." . $email_group->action . "_desc", true); // Set only those notices available to this staff group foreach ($group_notices as $notice) { if ($notice->action == $email_group->action) { $groups[] = $email_group; break; } } } return $groups; } return array(); } /** * Update this staff members private notes */ public function notes() { $this->uses(array("Users")); // Get staff and user IDs $user_id = $this->Session->read("blesta_id"); $staff_id = $this->Session->read("blesta_staff_id"); $vars = array(); // Update the users' info if (!empty($this->post)) { $errors = array(); // Begin transaction $this->post["notes"] = $this->Users->systemEncrypt($this->post["notes"]); $this->Staff->editNotes($staff_id, $this->post); $staff_errors = $this->Staff->errors(); $errors = $this->Staff->errors(); if (!empty($errors)) { $this->setMessage("error", $errors); $vars = (object)$this->post; } else { // Success, commit $this->flashMessage("message", Language::_("AdminMyinfo.!success.notes_updated", true)); $this->redirect($this->base_uri); } } // Set my info notes if (empty($vars)) { $staff = $this->Staff->getNotes($staff_id, $this->company_id); $staff->notes = $this->Users->systemDecrypt($staff->notes); $vars = (object)(array)$staff; } $this->set("vars", $vars); $this->set("link_tabs", $this->getTabNames()); return $this->renderAjaxWidgetIfAsync(); } /** * Retrieves a list of link tabs for use in templates * * @return array A list of tab names */ private function getTabNames() { return array( array('name'=>Language::_("AdminMyinfo.gettabnames.text_index", true), 'uri'=>"index"), array('name'=>Language::_("AdminMyinfo.gettabnames.text_notices", true), 'uri'=>"notices"), array('name'=>Language::_("AdminMyinfo.gettabnames.text_notes", true), 'uri'=>"notes") ); } Note: You can add the "My Private Notes" as a "Quick Link" to show on Blesta Admin Front Page, just click on "My Info" on the Top Right, then click on "Private Notes", and then click on the "Litle Star" above to add as a Quick Link If you dont whant do all the above work (you still have to execute the SQL qwery above), and you use the latest 3.1.3 Blesta, just download this file here, and upload to your Blesta Instalation We hope you enjoyit Regards, PV
    1 point
  2. Most people are running older versions of the Ioncube loaders, and PHP 5.5 supported builds of Blesta are not backwards compatible with these legacy loaders. Additionally, Blesta must be encoded for PHP 5.3 or 5.4 support in order to work with PHP 5.5, per this thread on Ioncube's forums, quoted below -- But, the minimum requirement for Blesta is PHP 5.1.3, so we have been releasing builds that are compatible for the majority (PHP 5.1.3 through 5.4.x), but not compatible with PHP 5.5. Adoption rates for PHP 5.5 are increasing, and we recognize the need to support it. At this time, due to Ioncube's limitations, we would be required to have 2 separate builds in order to support PHP 5.1.3-5.4.x and PHP 5.5. We are releasing this hotfix to allow PHP 5.5 support for Blesta 3.1.3. The zip contains only the 3 files we encode, to protect licensing. If you are not running Blesta 3.1.3 DO NOT apply the hotfix. blesta-3.1.3-php-5.5-hotfix.zip If you are doing a fresh install, first download blesta-3.1.3.zip and overwrite the files in 3.1.3 from the hotfix above before attempting the installation. If you are planning to upgrade your existing server to PHP 5.5 and have Blesta 3.1.3 installed, overwrite the files in the hotfix above after you upgrade your PHP.
    1 point
  3. Paul

    Parallel Payment Optimizer

    Parallel Payment Optimizer, or “Parallel” for short is a revolutionary new way to increase revenue and lower customer attrition. Parallel is a free plugin for Blesta. How does it do it? Parallel utilizes a global cloud of specialized helper bots to send friendly little signals to nonpaying customers. These signals softly nudge your customers into logging in and making payment where other methods of collection typically fail. We're already working on ideas for the next revision of the plugin. One idea is to automate the parallel process by identifying nonpaying customers automatically. Watch the video and download the plugin from the original blog post at http://www.blesta.com/2014/03/31/parallel-payment-optimizer-video-free-plugin/, then come back here and tell us what you think.
    1 point
  4. Not a bad idea! Nice work!
    1 point
  5. Yes when 3.2 comes out as it is responsive anyway, I will continue to work on this because it will be easier for everyone .
    1 point
  6. I'm planning to release a hotfix for 3.1.3 tomorrow for PHP 5.5 support.
    1 point
  7. Paul

    Release 3.1.3

    Haha, I think so! To be honest, I'm ready for it too.
    1 point
  8. Paul

    Release 3.1.3

    This is a bug fix release, the next feature release is 3.2.0 which is nearing beta.
    1 point
×
×
  • Create New...