Revamping invoice PDF rendering and standardisation work

This commit is contained in:
Deon George
2016-08-10 16:07:00 +10:00
parent a560c5f4fa
commit 24bb4a701b
27 changed files with 229 additions and 475 deletions

View File

@@ -33,21 +33,33 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
protected $_save_message = TRUE;
// Required abstract functions
/** REQUIRED ABSTRACT METHODS **/
public function attributes($variable=NULL) {
return array(
'SSL DN'=>$this->namesub($variable),
'Valid From'=>$this->ca->valid_from(TRUE),
'Valid To'=>$this->ca->valid_to(TRUE),
);
}
public function expire($format=FALSE) {
return $this->_so->get_valid_to($format);
return (! $this->_so) ? ($format ? 'Not Issued' : 0) : $this->_so->get_valid_to($format);
}
public function name($variable=NULL) {
return ($this->cert AND $this->ca->loaded()) ? sprintf('%s:%s',$this->ca->subject(),$this->display('cert')) : $this->display('csr');
}
public function namesub($variable=NULL) {
return $this->ca->dn();
}
public function password() {} // Not used
public function username() {} // Not used
// Local functions
/** LOCAL METHODS **/
private $_so = NULL;
@@ -204,23 +216,5 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
return $this;
}
/**
* Get specific service details for use in other modules
* For Example: Invoice
*
* @todo Make the rendered items configurable
* @todo Change this method name, now that it is public
*/
// @todo This needs to be validated for this model
public function _details($type) {
switch ($type) {
case 'invoice_detail_items':
return array();
break;
default:
return parent::$_details($type);
}
}
}
?>