Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/13/2015 in all areas

  1. Hi all, Just sharing an approach that can be used in a custom module to check whether a service field value is unique or already in use (e.g. to enforce unique domain names). public function validateService($package, array $vars=null, $edit=false) { if ($package) $module_row_id = $package->module_row; else $module_row_id = isset($vars['module_row']) ? $vars['module_row'] : null; $row = $this->getModuleRow($module_row_id); //get the service id using a known and guaranteed unique field. this is needed to perform a unique validation of service fields without having the same service that may already have the field to cause validation to fail (e.g. when activating a pending service). $service_id = $this->getServiceIDUsingUniqueServiceField('myUniqueServiceUID', $params['myUniqueServiceUID']); $rules = array( 'domain' => array( 'unique' => array( 'final' => true, 'rule' => array(array($this, "checkUniqueDomain"), $service_id), 'negate' => true, 'message' => Language::_("ModuleName.!error.domain_valid.unique", true) ) ) ); $this->Input->setRules($rules); return $this->Input->validates($params); } // check any service field value exists private function checkServiceFieldValueExists($key, $value, $service_id = null) { Loader::loadComponents($this, array("Record")); $exists = false; if (is_null($service_id)) { $service_id = -1; } $this->Record->select() ->from("service_fields") ->where("service_fields.key", "=", $key) ->where("service_fields.value", "=", $value) ->where("service_fields.service_id", "!=", $service_id); if($this->Record->numResults() > 0) { $exists = true; } $this->Record->reset(); return $exists; } // check domain is unique public function checkUniqueDomain($value, $service_id = null) { return $this->checkServiceFieldValueExists('domain', $value, $service_id); }
    1 point
  2. I don't believe so because the Payment received isn't linked to a invoice. See: http://www.blesta.com/forums/index.php?/topic/5129-payment-received-email-does-not-attach-invoice/?hl=payment where it was discussed.
    1 point
  3. After uploading over all the files run /admin/upgrade in your browser to update the database. You may also wish to ensure that your license is covered by support & updates. If you purchased it over a year ago then you'll need a support & updates plan. Unless it's a monthly license, then you're good to go.
    1 point
  4. Thanks for the report. This is assigned CORE-1879. The error is meant to say that the action failed because the category contains articles that do not belong to any other categories. Each article must belong to a category, or you need to set the article to a category of "-- None --" instead.
    1 point
  5. We wish you the best with your new opportunity. If you are considering releasing your cPanel or other Blesta modules as open source, I think that'd be great. In fact, if you want to sign over the rights to us, we'll release it/them as free open source on Github, and consider implementing some of the extra management features into our native cPanel module.
    1 point
×
×
  • Create New...