mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 05:41:52 +09:00
Merge pull request #602 from samapraku/master
Upgrade to PHP 7.2 and Twig v2.9 @samapraku merging this request. Lets keep in the loop for further issues
This commit is contained in:
137 files changed
+1472
-666
No files matched your search
@@ -7,10 +7,10 @@ Open Source billing software
|
||||
Requirements
|
||||
================================================================================
|
||||
|
||||
* PHP 5.6 | Does not support PHP 7.x
|
||||
* PHP 7.2
|
||||
* Linux Operating System (64-bit) | Does not support Windows Operating Systems.
|
||||
* PHP extensions:
|
||||
* mcrypt
|
||||
* openssl
|
||||
* curl
|
||||
* zlib
|
||||
* PDO
|
||||
@@ -20,10 +20,10 @@ Requirements
|
||||
Recommended
|
||||
================================================================================
|
||||
|
||||
* PHP 5.6
|
||||
* PHP 7.2
|
||||
* CentOS 64-bit Operating System
|
||||
* PHP Extensions
|
||||
* mcrypt
|
||||
* openssl
|
||||
* curl
|
||||
* zlib
|
||||
* PDO
|
||||
|
||||
+14
-10
@@ -139,18 +139,20 @@ $di['twig'] = function () use ($di) {
|
||||
$config = $di['config'];
|
||||
$options = $config['twig'];
|
||||
|
||||
$loader = new Twig_Loader_String();
|
||||
$twig = new Twig_Environment($loader, $options);
|
||||
$loader = new Twig\Loader\ArrayLoader();
|
||||
$twig = new Twig\Environment($loader, $options);
|
||||
|
||||
$box_extensions = new Box_TwigExtensions();
|
||||
$box_extensions->setDi($di);
|
||||
|
||||
$twig->addExtension(new Twig_Extension_Optimizer());
|
||||
$twig->addExtension(new Twig_Extensions_Extension_I18n());
|
||||
$twig->addExtension(new Twig_Extensions_Extension_Debug());
|
||||
//$twig->addExtension(new Twig\Extension\OptimizerExtension());
|
||||
$twig->addExtension(new \Twig\Extension\StringLoaderExtension());
|
||||
$twig->addExtension(new Twig\Extension\DebugExtension());
|
||||
$twig->addExtension(new Twig\Extensions\I18nExtension());
|
||||
$twig->addExtension($box_extensions);
|
||||
$twig->getExtension('core')->setDateFormat($config['locale_date_format']);
|
||||
$twig->getExtension('core')->setTimezone($config['timezone']);
|
||||
$twig->getExtension(Twig\Extension\CoreExtension::class)->setDateFormat($config['locale_date_format']);
|
||||
$twig->getExtension(Twig\Extension\CoreExtension::class)->setTimezone($config['timezone']);
|
||||
|
||||
|
||||
// add globals
|
||||
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
|
||||
@@ -165,6 +167,8 @@ $di['twig'] = function () use ($di) {
|
||||
|
||||
$di['is_client_logged'] = function() use($di) {
|
||||
if(!$di['auth']->isClientLoggedIn()) {
|
||||
$url = $di['url']->link('login');
|
||||
header("Location: $url");
|
||||
throw new Exception('Client is not logged in');
|
||||
}
|
||||
return true;
|
||||
@@ -183,7 +187,7 @@ $di['loggedin_client'] = function() use ($di) {
|
||||
return $di['db']->getExistingModelById('Client', $client_id);
|
||||
};
|
||||
$di['loggedin_admin'] = function() use ($di) {
|
||||
if(php_sapi_name() == 'cli') {
|
||||
if(php_sapi_name() == 'cli' || substr(php_sapi_name(), 0, 3) == 'cgi') {
|
||||
return $di['mod_service']('staff')->getCronAdmin();
|
||||
}
|
||||
|
||||
@@ -338,6 +342,6 @@ $di['translate'] = $di->protect(function($textDomain = '') use ($di) {
|
||||
return $tr;
|
||||
});
|
||||
$di['array_get'] = $di->protect(function (array $array, $key, $default = null) use ($di) {
|
||||
return isset ($array[$key]) ? $array[$key] : $default;
|
||||
return array_key_exists($key, $array) ? $array[$key] : $default;
|
||||
});
|
||||
return $di;
|
||||
return $di;
|
||||
@@ -22,7 +22,7 @@ class Box_AppAdmin extends Box_App
|
||||
|
||||
public function render($fileName, $variableArray = array())
|
||||
{
|
||||
$template = $this->getTwig()->loadTemplate($fileName.'.phtml');
|
||||
$template = $this->getTwig()->load($fileName.'.phtml');
|
||||
return $template->render($variableArray);
|
||||
}
|
||||
|
||||
@@ -56,4 +56,4 @@ class Box_AppAdmin extends Box_App
|
||||
|
||||
return $twig;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,12 @@ class Box_AppClient extends Box_App
|
||||
} catch(Exception $e) {
|
||||
if(BB_DEBUG) error_log($e);
|
||||
}
|
||||
throw new \Box_Exception('Page :url not found', array(':url'=>$page), 404);
|
||||
// throw new \Box_Exception('Page :url not found', array(':url'=>$page), 404);
|
||||
$e = new \Box_Exception('Page :url not found', array(':url'=>$this->url), 404);
|
||||
|
||||
error_log($e->getMessage());
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
return $this->render('404', array('exception'=>$e));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,8 +71,8 @@ class Box_AppClient extends Box_App
|
||||
public function render($fileName, $variableArray = array(), $ext = 'phtml')
|
||||
{
|
||||
try {
|
||||
$template = $this->getTwig()->loadTemplate($fileName.'.'.$ext);
|
||||
} catch (\Twig_Error_Loader $e) {
|
||||
$template = $this->getTwig()->load($fileName.'.'.$ext);
|
||||
} catch (Twig\Error\LoaderError $e) {
|
||||
error_log($e->getMessage());
|
||||
throw new \Box_Exception('Page not found', null, 404);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class Box_BeanHelper extends \RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper imple
|
||||
{
|
||||
$string[0] = strtoupper($string[0]);
|
||||
}
|
||||
$func = create_function('$c', 'return strtoupper($c[1]);');
|
||||
$func = function($c){ return strtoupper($c[1]); };
|
||||
return preg_replace_callback('/_([a-z])/', $func, $string);
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,12 @@ class Box_Crypt implements \Box\InjectionAwareInterface
|
||||
{
|
||||
protected $di = NULL;
|
||||
|
||||
const METHOD = 'aes-256-cbc';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('mcrypt')) {
|
||||
throw new Box_Exception('php mcrypt extension must be enabled on your server');
|
||||
if (!extension_loaded('openssl')) {
|
||||
throw new Box_Exception('php openssl extension must be enabled on your server');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,11 +37,19 @@ class Box_Crypt implements \Box\InjectionAwareInterface
|
||||
public function encrypt($text, $pass = null)
|
||||
{
|
||||
$key = $this->_getSalt($pass);
|
||||
$mode = MCRYPT_MODE_CBC;
|
||||
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, $mode);
|
||||
$iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM);
|
||||
$enc = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, $mode, $iv);
|
||||
return base64_encode($iv . $enc);
|
||||
|
||||
$ivsize = openssl_cipher_iv_length(self::METHOD);
|
||||
$iv = openssl_random_pseudo_bytes($ivsize);
|
||||
|
||||
$ciphertext = openssl_encrypt(
|
||||
$text,
|
||||
self::METHOD,
|
||||
$key,
|
||||
OPENSSL_RAW_DATA,
|
||||
$iv
|
||||
);
|
||||
|
||||
return base64_encode($iv . $ciphertext);
|
||||
}
|
||||
|
||||
public function decrypt($text, $pass = null)
|
||||
@@ -48,17 +58,24 @@ class Box_Crypt implements \Box\InjectionAwareInterface
|
||||
return false;
|
||||
}
|
||||
$key = $this->_getSalt($pass);
|
||||
$mode = MCRYPT_MODE_CBC;
|
||||
$ciphertext_dec = base64_decode($text);
|
||||
|
||||
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, $mode);
|
||||
# retrieves the IV, iv_size should be created using mcrypt_get_iv_size()
|
||||
$iv = substr($ciphertext_dec, 0, $iv_size);
|
||||
# retrieves the cipher text (everything except the $iv_size in the front)
|
||||
$ciphertext_dec = substr($ciphertext_dec, $iv_size);
|
||||
$text = base64_decode($text);
|
||||
|
||||
# may remove 00h valued characters from end of plain text
|
||||
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $ciphertext_dec, $mode, $iv));
|
||||
$ivsize = openssl_cipher_iv_length(self::METHOD);
|
||||
$iv = mb_substr($text, 0, $ivsize, '8bit');
|
||||
$ciphertext = mb_substr($text, $ivsize, null, '8bit');
|
||||
|
||||
$result = openssl_decrypt(
|
||||
$ciphertext,
|
||||
self::METHOD,
|
||||
$key,
|
||||
OPENSSL_RAW_DATA,
|
||||
$iv
|
||||
);
|
||||
|
||||
$result = trim($result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function _getSalt($pass = null)
|
||||
|
||||
@@ -38,10 +38,10 @@ class Box_Requirements implements \Box\InjectionAwareInterface
|
||||
'curl',
|
||||
'zlib',
|
||||
'gettext',
|
||||
'mcrypt',
|
||||
'openssl',
|
||||
),
|
||||
'version' => PHP_VERSION,
|
||||
'min_version' => '5.3',
|
||||
'min_version' => '7.2',
|
||||
'safe_mode' => ini_get('safe_mode'),
|
||||
),
|
||||
'writable_folders' => array(
|
||||
@@ -93,7 +93,7 @@ class Box_Requirements implements \Box\InjectionAwareInterface
|
||||
'pdo_mysql' => extension_loaded('pdo_mysql'),
|
||||
'zlib' => extension_loaded('zlib'),
|
||||
'mbstring' => extension_loaded('mbstring'),
|
||||
'mcrypt' => extension_loaded('mcrypt'),
|
||||
'openssl' => extension_loaded('openssl'),
|
||||
'gettext' => extension_loaded('gettext'),
|
||||
);
|
||||
|
||||
@@ -200,4 +200,4 @@ class Box_Requirements implements \Box\InjectionAwareInterface
|
||||
return ($configmod == $perm);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -246,14 +246,14 @@ class Box_Tools
|
||||
public function autoLinkText($text)
|
||||
{
|
||||
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
|
||||
$callback = create_function('$matches', '
|
||||
$callback = function($matches){
|
||||
$url = array_shift($matches);
|
||||
$url_parts = parse_url($url);
|
||||
if(!isset($url_parts["scheme"])) {
|
||||
$url = "http://".$url;
|
||||
}
|
||||
return sprintf(\'<a target="_blank" href="%s">%s</a>\', $url, $url);
|
||||
');
|
||||
return sprintf('<a target="_blank" href="%s">%s</a>', $url, $url);
|
||||
};
|
||||
return preg_replace_callback($pattern, $callback, $text);
|
||||
}
|
||||
|
||||
@@ -362,13 +362,13 @@ class Box_Tools
|
||||
if($capitalise_first_char) {
|
||||
$str[0] = strtoupper($str[0]);
|
||||
}
|
||||
$func = create_function('$c', 'return strtoupper($c[1]);');
|
||||
$func = function($c){ return strtoupper($c[1]); };
|
||||
return preg_replace_callback('/-([a-z])/', $func, $str);
|
||||
}
|
||||
|
||||
public function from_camel_case($str) {
|
||||
$str[0] = strtolower($str[0]);
|
||||
$func = create_function('$c', 'return "-" . strtolower($c[1]);');
|
||||
$func = function($c){ return "-" . strtolower($c[1]); };
|
||||
return preg_replace_callback('/([A-Z])/', $func, $str);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
|
||||
class Box_TwigExtensions extends Twig_Extension implements \Box\InjectionAwareInterface
|
||||
class Box_TwigExtensions extends Twig\Extension\AbstractExtension implements \Box\InjectionAwareInterface
|
||||
{
|
||||
protected $di;
|
||||
|
||||
@@ -39,34 +39,34 @@ class Box_TwigExtensions extends Twig_Extension implements \Box\InjectionAwareIn
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
'alink' => new Twig_Filter_Function(array($this, 'twig_bb_admin_link_filter'), array('is_safe' => array('html'))),
|
||||
'link' => new Twig_Filter_Function(array($this, 'twig_bb_client_link_filter'), array('is_safe' => array('html'))),
|
||||
'gravatar' => new Twig_Filter_Function('twig_gravatar_filter'),
|
||||
'markdown' => new Twig_Filter_Function('twig_markdown_filter', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'truncate' => new Twig_Filter_Function('twig_truncate_filter', array('needs_environment' => true)),
|
||||
'timeago' => new Twig_Filter_Function('twig_timeago_filter'),
|
||||
'daysleft' => new Twig_Filter_Function('twig_daysleft_filter'),
|
||||
'size' => new Twig_Filter_Function('twig_size_filter'),
|
||||
'ipcountryname' => new Twig_Filter_Function(array($this, 'twig_ipcountryname_filter')),
|
||||
'number' => new Twig_Filter_Function('twig_number_filter'),
|
||||
'period_title' => new Twig_Filter_Function('twig_period_title', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'autolink' => new Twig_Filter_Function('twig_autolink_filter'),
|
||||
'bbmd' => new Twig_Filter_Function('twig_bbmd_filter', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'alink' => new Twig\TwigFilter('alink', array($this, 'twig_bb_admin_link_filter'), array('is_safe' => array('html'))),
|
||||
'link' => new Twig\TwigFilter('link', array($this, 'twig_bb_client_link_filter'), array('is_safe' => array('html'))),
|
||||
'gravatar' => new Twig\TwigFilter('gravatar','twig_gravatar_filter'),
|
||||
'markdown' => new Twig\TwigFilter('markdown','twig_markdown_filter', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'truncate' => new Twig\TwigFilter('truncate','twig_truncate_filter', array('needs_environment' => true)),
|
||||
'timeago' => new Twig\TwigFilter('timeago','twig_timeago_filter'),
|
||||
'daysleft' => new Twig\TwigFilter('daysleft','twig_daysleft_filter'),
|
||||
'size' => new Twig\TwigFilter('size', 'twig_size_filter'),
|
||||
'ipcountryname' => new Twig\TwigFilter('ipcountryname', array($this, 'twig_ipcountryname_filter')),
|
||||
'number' => new Twig\TwigFilter('number', 'twig_number_filter'),
|
||||
'period_title' => new Twig\TwigFilter('period_title', 'twig_period_title', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'autolink' => new Twig\TwigFilter('autolink', 'twig_autolink_filter'),
|
||||
'bbmd' => new Twig\TwigFilter('bbmd', 'twig_bbmd_filter', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
|
||||
'bb_date' => new Twig_Filter_Function(array($this, 'twig_bb_date')),
|
||||
'bb_datetime' => new Twig_Filter_Function(array($this, 'twig_bb_datetime')),
|
||||
'bb_date' => new Twig\TwigFilter('bb_date', array($this, 'twig_bb_date')),
|
||||
'bb_datetime' => new Twig\TwigFilter('bb_datetime', array($this, 'twig_bb_datetime')),
|
||||
|
||||
'img_tag' => new Twig_Filter_Function('twig_img_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
'script_tag' => new Twig_Filter_Function('twig_script_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
'stylesheet_tag' => new Twig_Filter_Function('twig_stylesheet_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
'img_tag' => new Twig\TwigFilter('img_tag', 'twig_img_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
'script_tag' => new Twig\TwigFilter('script_tag', 'twig_script_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
'stylesheet_tag' => new Twig\TwigFilter('stylesheet_tag', 'twig_stylesheet_tag', array('needs_environment' => false, 'is_safe' => array('html'))),
|
||||
|
||||
'mod_asset_url' => new Twig_Filter_Function('twig_mod_asset_url'),
|
||||
'asset_url' => new Twig_Filter_Function('twig_asset_url', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'mod_asset_url' => new Twig\TwigFilter('mod_asset_url', 'twig_mod_asset_url'),
|
||||
'asset_url' => new Twig\TwigFilter('asset_url', 'twig_asset_url', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
|
||||
'money' => new Twig_Filter_Function('twig_money', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_without_currency' => new Twig_Filter_Function('twig_money_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_convert' => new Twig_Filter_Function('twig_money_convert', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_convert_without_currency' => new Twig_Filter_Function('money_convert_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money' => new Twig\TwigFilter('money', 'twig_money', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_without_currency' => new Twig\TwigFilter('money_without_currency','twig_money_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_convert' => new Twig\TwigFilter('money_convert', 'twig_money_convert', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
'money_convert_without_currency' => new Twig\TwigFilter('money_convert_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -107,6 +107,9 @@ class Box_TwigExtensions extends Twig_Extension implements \Box\InjectionAwareIn
|
||||
|
||||
function twig_bb_client_link_filter($link, $params = null)
|
||||
{
|
||||
if($this->di['url'] === null) {
|
||||
return null;
|
||||
}
|
||||
return $this->di['url']->link($link, $params);
|
||||
}
|
||||
|
||||
@@ -117,14 +120,14 @@ class Box_TwigExtensions extends Twig_Extension implements \Box\InjectionAwareIn
|
||||
|
||||
}
|
||||
|
||||
function twig_period_title(Twig_Environment $env, $period)
|
||||
function twig_period_title(Twig\Environment $env, $period)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
$api_guest = $globals['guest'];
|
||||
return $api_guest->system_period_title(array('code'=>$period));
|
||||
}
|
||||
|
||||
function twig_money_convert(Twig_Environment $env, $price, $currency = null)
|
||||
function twig_money_convert(Twig\Environment $env, $price, $currency = null)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
$api_guest = $globals['guest'];
|
||||
@@ -135,7 +138,7 @@ function twig_money_convert(Twig_Environment $env, $price, $currency = null)
|
||||
return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>true));
|
||||
}
|
||||
|
||||
function money_convert_without_currency(Twig_Environment $env, $price, $currency = null, $without_currency = false)
|
||||
function money_convert_without_currency(Twig\Environment $env, $price, $currency = null, $without_currency = false)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
$api_guest = $globals['guest'];
|
||||
@@ -146,14 +149,14 @@ function money_convert_without_currency(Twig_Environment $env, $price, $currency
|
||||
return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>true, 'without_currency'=>true));
|
||||
}
|
||||
|
||||
function twig_money(Twig_Environment $env, $price, $currency = null)
|
||||
function twig_money(Twig\Environment $env, $price, $currency = null)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
$api_guest = $globals['guest'];
|
||||
return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>false));
|
||||
}
|
||||
|
||||
function twig_money_without_currency(Twig_Environment $env, $price, $currency = null)
|
||||
function twig_money_without_currency(Twig\Environment $env, $price, $currency = null)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
$api_guest = $globals['guest'];
|
||||
@@ -165,7 +168,7 @@ function twig_mod_asset_url($asset, $mod)
|
||||
return BB_URL . 'bb-modules/'.ucfirst($mod).'/assets/'.$asset;
|
||||
}
|
||||
|
||||
function twig_asset_url(Twig_Environment $env, $asset)
|
||||
function twig_asset_url(Twig\Environment $env, $asset)
|
||||
{
|
||||
$globals = $env->getGlobals();
|
||||
return BB_URL . 'bb-themes/'.$globals['current_theme'].'/assets/'.$asset;
|
||||
@@ -201,14 +204,18 @@ function twig_gravatar_filter($email, $size = null)
|
||||
function twig_autolink_filter($text)
|
||||
{
|
||||
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
|
||||
$callback = create_function('$matches', '
|
||||
|
||||
$callback = function($matches)
|
||||
{
|
||||
$url = array_shift($matches);
|
||||
$url_parts = parse_url($url);
|
||||
if(!isset($url_parts["scheme"])) {
|
||||
$url = "http://".$url;
|
||||
$url = 'http://' . $url;
|
||||
}
|
||||
return sprintf(\'<a target="_blank" href="%s">%s</a>\', $url, $url);
|
||||
');
|
||||
|
||||
return sprintf('<a target="_blank" href="%s">%s</a>', $url, $url);
|
||||
};
|
||||
|
||||
return preg_replace_callback($pattern, $callback, $text);
|
||||
}
|
||||
|
||||
@@ -251,7 +258,9 @@ function twig_size_filter($value)
|
||||
function twig_markdown_filter(Twig_Environment $env, $value)
|
||||
{
|
||||
$markdownParser = new \Michelf\MarkdownExtra;
|
||||
return $markdownParser->transform(htmlspecialchars($value, ENT_NOQUOTES));
|
||||
// Michelf Markdown version 1.7.0 and up
|
||||
$markdownParser->hard_wrap = true;
|
||||
return $markdownParser->transform($value); //htmlspecialchars($value, ENT_NOQUOTES)
|
||||
}
|
||||
|
||||
function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...')
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
|
||||
class Box_TwigLoader extends Twig_Loader_Filesystem
|
||||
class Box_TwigLoader extends Twig\Loader\FilesystemLoader
|
||||
{
|
||||
protected $options = array();
|
||||
|
||||
@@ -40,7 +40,7 @@ class Box_TwigLoader extends Twig_Loader_Filesystem
|
||||
}
|
||||
|
||||
|
||||
protected function findTemplate($name)
|
||||
protected function findTemplate($name, $throw = true)
|
||||
{
|
||||
// normalize name
|
||||
$name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
|
||||
@@ -63,6 +63,6 @@ class Box_TwigLoader extends Twig_Loader_Filesystem
|
||||
}
|
||||
}
|
||||
|
||||
throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $paths)));
|
||||
throw new \Twig\Error\LoaderError(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $paths)));
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,6 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
{
|
||||
return isset($item['config']['free_transfer']) && $item['config']['free_transfer'];
|
||||
}
|
||||
|
||||
|
||||
public function getPricingArray(Model_Product $product)
|
||||
{
|
||||
@@ -125,7 +124,7 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
return $pricing;
|
||||
}
|
||||
|
||||
public function getProductPrice(Model_Product $product, array $config = array())
|
||||
public function getProductPrice(Model_Product $product, array $config = null)
|
||||
{
|
||||
$rtable = $this->di['mod_service']('servicedomain', 'Tld');
|
||||
$tld = '';
|
||||
@@ -162,7 +161,7 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getProductSetupPrice(Model_Product $product, array $config = array())
|
||||
public function getProductSetupPrice(Model_Product $product, array $config = null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -171,4 +170,4 @@ class Model_ProductDomainTable extends Model_ProductTable
|
||||
{
|
||||
throw new \Box_Exception('Domain product can not be removed.');
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-2
@@ -30,7 +30,8 @@ function handler_error($number, $message, $file, $line)
|
||||
return false;
|
||||
}
|
||||
|
||||
function handler_exception(Exception $e)
|
||||
// Removed Exception type. Some errors are thrown as exceptions causing fatal errors.
|
||||
function handler_exception($e)
|
||||
{
|
||||
if(APPLICATION_ENV == 'testing') {
|
||||
print $e->getMessage() . PHP_EOL;
|
||||
@@ -140,6 +141,8 @@ ini_set('error_log', BB_PATH_LOG . '/php_error.log');
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
|
||||
// Create lamba style unescaping function (for portability)
|
||||
$quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
|
||||
|
||||
/* create_function deprecated in PHP 7.2
|
||||
$unescape_function = (empty($quotes_sybase) || $quotes_sybase === 'off') ? 'stripslashes($value)' : 'str_replace("\'\'","\'",$value)';
|
||||
$stripslashes_deep = create_function('&$value, $fn', '
|
||||
if (is_string($value)) {
|
||||
@@ -147,7 +150,16 @@ if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
|
||||
} else if (is_array($value)) {
|
||||
foreach ($value as &$v) $fn($v, $fn);
|
||||
}
|
||||
');
|
||||
'); */
|
||||
|
||||
$stripslashes_deep = function(&$value, $fn){
|
||||
if (is_string($value)) {
|
||||
$value = (empty($quotes_sybase) || $quotes_sybase === 'off') ? stripslashes($value) : str_replace("\'\'","\'",$value);
|
||||
} else if (is_array($value)) {
|
||||
foreach ($value as &$v) $fn($v, $fn);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Unescape data
|
||||
$stripslashes_deep($_POST, $stripslashes_deep);
|
||||
|
||||
@@ -265,7 +265,7 @@ class Service implements InjectionAwareInterface
|
||||
public function getExpiredPasswordReminders()
|
||||
{
|
||||
$expire_after_hours = 2;
|
||||
$expired = $this->di['db']->find('ClientPasswordReset', 'UNIX_TIMESTAMP() - ? > created_at', array($expire_after_hours * 60 * 60));
|
||||
$expired = $this->di['db']->find('ClientPasswordReset', 'UNIX_TIMESTAMP() - ? > UNIX_TIMESTAMP(created_at)', array($expire_after_hours * 60 * 60));
|
||||
return $expired;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Please confirm your email address {% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
Please verify your email by clicking on the link below:
|
||||
@@ -12,5 +12,5 @@ Edit your profile at {{'client/me'|link}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Password Changed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -18,5 +18,5 @@ Edit your profile at {{ 'client/me'|link }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Confirm Password Reset{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -19,5 +19,5 @@ Edit your profile at {{'client/me'|link}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Welcome {{ c.first_name }}{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
Thank you for signing up with us. Your new account has been setup and you can now login to our client area using the details below.
|
||||
@@ -22,5 +22,5 @@ Edit your profile at {{'client/me'|link}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -107,7 +107,7 @@ class Service implements InjectionAwareInterface
|
||||
$db = $this->di['db'];
|
||||
$default = $db->findOne('Currency', 'is_default = 1');
|
||||
|
||||
if (count($default) == 0) {
|
||||
if (is_array($default) && count($default) == 0) {
|
||||
$default = $db->load('Currency', '1');
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="rowElem">
|
||||
<label>{% trans 'Format' %}:</label>
|
||||
<div class="formRight">
|
||||
<input type="text" name="format" value="{{currency.format}}" required="required" placeholder="$ {%raw%}{{price}}{%endraw%}">
|
||||
<input type="text" name="format" value="{{currency.format}}" required="required" placeholder="$ {{price|raw}}">
|
||||
</div>
|
||||
<div class="fix"></div>
|
||||
</div>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<td>{{ mf.currency_format(1) }} = {{ mf.currency(1, currency.code) }}</td>
|
||||
<td class="actions">
|
||||
<a class="bb-button btn14" href="{{ '/currency/manage'|alink }}/{{currency.code}}"><img src="images/icons/dark/pencil.png" alt=""></a>
|
||||
<a class="bb-button btn14 bb-rm-tr api-link" data-api-redirect="{{extension/settings/currency|alink}}" data-api-confirm="Are you sure?" href="{{'api/admin/currency/delete'|link({'code' : currency.code})}}"><img src="images/icons/dark/trash.png" alt=""></a>
|
||||
<a class="bb-button btn14 bb-rm-tr api-link" data-api-redirect="{{'extension/settings/currency'|alink}}" data-api-confirm="Are you sure?" href="{{'api/admin/currency/delete'|link({'code' : currency.code})}}"><img src="images/icons/dark/trash.png" alt=""></a>
|
||||
{% if not currency.default %}
|
||||
<a class="bb-button btn14 api-link" data-api-redirect="{{'extension/settings/currency'|alink}}" href="{{'api/admin/currency/set_default' | link({'code' : currency.code})}}" title="Set as default" class="rightDir"><img src="images/icons/dark/star.png" alt=""></a>
|
||||
{% endif %}
|
||||
@@ -106,7 +106,7 @@
|
||||
<div class="rowElem">
|
||||
<label>{% trans 'Format' %}:</label>
|
||||
<div class="formRight">
|
||||
<input type="text" name="format" value="{%raw%}{{price}}{%endraw%} $" required="required">
|
||||
<input type="text" name="format" value="{{price|raw}} $" required="required">
|
||||
</div>
|
||||
<div class="fix"></div>
|
||||
</div>
|
||||
|
||||
@@ -315,8 +315,8 @@ class Admin extends \Api_Abstract
|
||||
$t = $this->template_get($data);
|
||||
$vars = $t['vars'];
|
||||
$vars['_tpl'] = $this->di['array_get']($data, '_tpl', $t['content']);
|
||||
|
||||
return $this->di['twig']->render($vars['_tpl'], $vars);
|
||||
$systemService = $this->di['mod_service']('System');
|
||||
return $systemService->renderString($vars['_tpl'], true, $vars);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,11 +38,12 @@ class Service implements \Box\InjectionAwareInterface
|
||||
|
||||
if($search) {
|
||||
$search = "%$search%";
|
||||
$where[] = '(m.sender LIKE :sender OR m.recipients LIKE :recipient OR m.subject LIKE :subject OR m.content_text LIKE :context_text)';
|
||||
$where[] = '(sender LIKE :sender OR recipients LIKE :recipient OR subject LIKE :subject OR content_text LIKE :content_text OR content_html LIKE :content_html)';
|
||||
$bindings[':sender'] = $search;
|
||||
$bindings[':recipient'] = $search;
|
||||
$bindings[':subject'] = $search;
|
||||
$bindings[':content_text'] = $search;
|
||||
$bindings[':content_html'] = $search;
|
||||
}
|
||||
|
||||
if(NULL !== $client_id) {
|
||||
@@ -272,7 +273,7 @@ class Service implements \Box\InjectionAwareInterface
|
||||
|
||||
private function _getVarsString()
|
||||
{
|
||||
$str = '{% filter markdown %}' . PHP_EOL . PHP_EOL;
|
||||
$str = '{% apply markdown %}' . PHP_EOL . PHP_EOL;
|
||||
$str .= 'This email template was automatically generated by BoxBilling extension. ' . PHP_EOL;
|
||||
$str .= 'Template is ready to be modified. ' . PHP_EOL;
|
||||
$str .= 'Email template is just like BoxBilling theme file. ' . PHP_EOL;
|
||||
@@ -280,14 +281,15 @@ class Service implements \Box\InjectionAwareInterface
|
||||
$str .= 'Example API usage in email template:' . PHP_EOL . PHP_EOL;
|
||||
$str .= '{{ guest.system_version }}' . PHP_EOL . PHP_EOL;
|
||||
$str .= "{{ now|date('Y-m-d') }}" . PHP_EOL . PHP_EOL;
|
||||
$str .= '{% endfilter %}';
|
||||
$str .= '{% endapply %}';
|
||||
return $str;
|
||||
}
|
||||
|
||||
private function _parse(\Model_EmailTemplate $t, $vars)
|
||||
{
|
||||
$pc = $this->di['twig']->render($t->content, $vars);
|
||||
$ps = $this->di['twig']->render($t->subject, $vars);
|
||||
$systemService = $this->di['mod_service']('System');
|
||||
$pc = $systemService->renderString($t->content, false, $vars);
|
||||
$ps = $systemService->renderString($t->subject, false, $vars);
|
||||
return array($ps, $pc);
|
||||
}
|
||||
|
||||
@@ -302,8 +304,6 @@ class Service implements \Box\InjectionAwareInterface
|
||||
$mail->setSubject($email->subject);
|
||||
$mail->addTo($email->recipients);
|
||||
|
||||
$this->_logEmailToDb($email); //Logging to DB
|
||||
|
||||
$settings = $this->di['mod_config']('email');
|
||||
$transport = $this->di['array_get']($settings, 'mailer', 'sendmail');
|
||||
|
||||
@@ -323,30 +323,8 @@ class Service implements \Box\InjectionAwareInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
private function _logEmailToDb(\Model_ActivityClientEmail $email)
|
||||
{
|
||||
$query = "INSERT INTO activity_client_email
|
||||
SET client_id = :client_id,
|
||||
sender = :sender,
|
||||
recipients = :recipients,
|
||||
subject = :subject,
|
||||
content_html = :content_html,
|
||||
content_text = :content_text
|
||||
";
|
||||
|
||||
$bindings = array(
|
||||
':client_id' => $email->client_id,
|
||||
':sender' => $email->sender,
|
||||
':recipients' => $email->recipients,
|
||||
':subject' => $email->subject,
|
||||
':content_html' => $email->content_html,
|
||||
':content_text' => $email->content_text
|
||||
);
|
||||
|
||||
$di = $this->getDi();
|
||||
$db = $di['db'];
|
||||
$db->exec($query, $bindings);
|
||||
}
|
||||
|
||||
public function templateGetSearchQuery($data)
|
||||
{
|
||||
@@ -411,13 +389,14 @@ class Service implements \Box\InjectionAwareInterface
|
||||
$model->category = $category;
|
||||
}
|
||||
|
||||
$systemService = $this->di['mod_service']('System');
|
||||
$vars = $this->getVars($model);
|
||||
|
||||
if (isset($subject)) {
|
||||
// check subject syntax before saving
|
||||
// should throw exception if render fails
|
||||
$vars['_tpl'] = $subject;
|
||||
$this->di['twig']->render($subject, $vars);
|
||||
$systemService->renderString($subject, false, $vars);
|
||||
$model->subject = $subject;
|
||||
}
|
||||
|
||||
@@ -425,7 +404,7 @@ class Service implements \Box\InjectionAwareInterface
|
||||
// check content syntax before saving
|
||||
// should throw exception if render fails
|
||||
$vars['_tpl'] = $content;
|
||||
$this->di['twig']->render($content, $vars);
|
||||
$systemService->renderString($content, false, $vars);
|
||||
|
||||
$model->content = $content;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
|
||||
<div class="body mainForm">
|
||||
<div class="formBottom">
|
||||
<textarea cols="5" rows="20" class="example">{% raw %} {% filter markdown %}
|
||||
<textarea cols="5" rows="20" class="example">{% autoescape false %} {% apply markdown %}
|
||||
|
||||
This is an example of markdown syntax in email template
|
||||
|
||||
@@ -195,7 +195,7 @@ Accessing Admin API can get information about your BoxBilling, for example how m
|
||||
{#<pre>{% debug stats %}</pre>#}
|
||||
|
||||
|
||||
{% endfilter %}{% endraw %}</textarea>
|
||||
{% endapply %}{% endautoescape %}</textarea>
|
||||
<input type="button" value="{% trans 'Preview' %}" class="blueBtn mt10 epb"/>
|
||||
<div class="mt20 example-preview" style="padding: 5px; background: white; border: 1px dashed grey; overflow: auto; display: none;"></div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.email-resend').click(function(e){
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.email-resend').click(function(e){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] BoxBilling Email Test{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ staff.name }},
|
||||
|
||||
If you are reading this email, BoxBilling is **configured properly**
|
||||
@@ -8,5 +8,5 @@ and is **able to send emails**.
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
//===== Accordion =====//
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{% block subject %}Example Email Subject{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ c.first_name }},
|
||||
|
||||
This is a test message from BoxBilling.com
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -587,7 +587,7 @@ class Service implements InjectionAwareInterface
|
||||
WHERE extension = :ext
|
||||
AND meta_key = 'config'
|
||||
LIMIT 1;
|
||||
";;
|
||||
";
|
||||
|
||||
$config = json_encode($data);
|
||||
$config = $this->di['crypt']->encrypt($config, $this->_getSalt());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] New Forum Message{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
New message was posted on Forum **{{ topic.forum.title }} > {{ topic.title }}**
|
||||
@@ -17,5 +17,5 @@ To reply to this message or disable notifications, visit the link below:
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -224,7 +224,7 @@ class Service implements InjectionAwareInterface
|
||||
'account_number' => !empty($c['account_number']) ? $c['account_number'] : null,
|
||||
);
|
||||
|
||||
if($identity instanceof \Model_Admin) {
|
||||
if($identity instanceof \Model_Admin){
|
||||
$client = $this->di['db']->load('Client', $row['client_id']);
|
||||
$clientService = $this->di['mod_service']('client');
|
||||
if($client instanceof \Model_Client) {
|
||||
@@ -766,14 +766,14 @@ class Service implements InjectionAwareInterface
|
||||
$model->buyer_phone = $this->di['array_get']($data, 'buyer_phone', $model->buyer_phone);
|
||||
$model->buyer_email = $this->di['array_get']($data, 'buyer_email', $model->buyer_email);
|
||||
|
||||
$paid_at = $this->di['array_get']($data, 'paid_at', null);
|
||||
$paid_at = $this->di['array_get']($data, 'paid_at', $model->paid_at);
|
||||
if(empty($paid_at)) {
|
||||
$model->paid_at = null;
|
||||
} else {
|
||||
$model->paid_at = date('Y-m-d H:i:s', strtotime($paid_at));
|
||||
}
|
||||
|
||||
$due_at = $this->di['array_get']($data, 'due_at', null);
|
||||
$due_at = $this->di['array_get']($data, 'due_at', $model->due_at);
|
||||
if(empty($due_at)) {
|
||||
$model->due_at = null;
|
||||
} else {
|
||||
|
||||
@@ -86,6 +86,11 @@ class ServiceInvoiceItem implements InjectionAwareInterface
|
||||
|
||||
case \Model_InvoiceItem::TASK_RENEW:
|
||||
try {
|
||||
//Unsuspend order if suspended before renew
|
||||
if($order->status == \Model_ClientOrder::STATUS_SUSPENDED) {
|
||||
$orderService->unsuspendFromOrder($order);
|
||||
}
|
||||
|
||||
$order = $this->di['db']->load('ClientOrder', $order_id);
|
||||
$orderService->renewOrder($order);
|
||||
} catch(\Exception $e) {
|
||||
|
||||
@@ -59,6 +59,8 @@ class ServiceTransaction implements InjectionAwareInterface
|
||||
$model->type = $this->di['array_get']($data, 'type', $model->type);
|
||||
$model->note = $this->di['array_get']($data, 'note', $model->note);
|
||||
$model->status = $this->di['array_get']($data, 'status', $model->status);
|
||||
$model->error = $this->di['array_get']($data, 'error', $model->error);
|
||||
$model->error_code = $this->di['array_get']($data, 'error_code', $model->error_code);
|
||||
$model->validate_ipn = $this->di['array_get']($data, 'validate_ipn', $model->validate_ipn);
|
||||
$model->updated_at = date('Y-m-d H:i:s');
|
||||
$this->di['db']->store($model);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Invoice Created{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
This is to notify that proforma invoice {{ invoice.id }} was generated on {{ invoice.created_at|bb_date }}.
|
||||
@@ -13,5 +13,5 @@ Login to members area: {{'login'|link({'email' : c.email }) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Invoice Due{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
This is a payment reminder that your proforma invoice **{{ invoice.serie_nr }}** is already
|
||||
@@ -19,5 +19,5 @@ View and manage invoices: {{'invoice'|link}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Payment Received{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
This is a payment receipt for Invoice **{{ invoice.serie_nr }}** issued on
|
||||
@@ -16,5 +16,5 @@ View invoice: {{'invoice'|link}}/{{invoice.hash}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Payment Reminder{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
This is to remind that your proforma invoice **{{ invoice.serie_nr }}** is due
|
||||
@@ -19,5 +19,5 @@ View and manage invoices: {{'invoice'|link}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -46,7 +46,7 @@ class Service
|
||||
}
|
||||
|
||||
if ($search) {
|
||||
$sql .= " title LIKE :q OR content LIKE :q";
|
||||
$sql .= " AND title LIKE :q OR content LIKE :q";
|
||||
$filter[':q'] = "%$search%";
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class Admin extends \Api_Abstract
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
$default_content = '{% filter markdown %}
|
||||
$default_content = '{% apply markdown %}
|
||||
Hi {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
Your email is: {{ c.email }}
|
||||
@@ -123,7 +123,7 @@ vut amet et nunc! Elementum dolor, dictumst porta ultrices. Rhoncus, amet.
|
||||
Order our services at {{ "order"|link }}
|
||||
|
||||
{{ guest.system_company.name }} - {{ guest.system_company.signature }}
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
';
|
||||
$systemService = $this->di['mod_service']('system');
|
||||
$company = $systemService->getCompany();
|
||||
|
||||
@@ -130,13 +130,13 @@ class Service implements \Box\InjectionAwareInterface
|
||||
$vars['c'] = $clientArr;
|
||||
$vars['_client_id'] = $client->id;
|
||||
$vars['_tpl'] = $model->subject;
|
||||
$ps = $systemService->renderString($vars['_tpl'], false, $vars);
|
||||
$ps = $systemService->renderString($vars['_tpl'], true, $vars);
|
||||
|
||||
$vars = array();
|
||||
$vars['c'] = $clientArr;
|
||||
$vars['_client_id'] = $client->id;
|
||||
$vars['_tpl'] = $model->content;
|
||||
$pc = $systemService->renderString($vars['_tpl'], false, $vars);
|
||||
$pc = $systemService->renderString($vars['_tpl'], true, $vars);
|
||||
|
||||
return array($ps, $pc);
|
||||
}
|
||||
@@ -171,6 +171,19 @@ class Service implements \Box\InjectionAwareInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
By: Samuel A.
|
||||
Modified: 07.07.2019
|
||||
Log email to database
|
||||
*/
|
||||
$mod = $this->di['mod']('email');
|
||||
$settings = $mod->getConfig();
|
||||
|
||||
if (isset($settings['log_enabled']) && $settings['log_enabled']) {
|
||||
$activityService = $this->di['mod_service']('activity');
|
||||
$activityService->logEmail($data['subject'], $client_id, $data['from'], $data['to'], $data['content']);
|
||||
}
|
||||
|
||||
$emailSettings = $this->di['mod_config']('email');
|
||||
$transport = $this->di['array_get']($emailSettings, 'mailer', 'sendmail');
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
function onAfterMessageUpdate()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "layout_default.phtml" %}
|
||||
{% import "macro_functions.phtml" as mf %}
|
||||
{% block meta_title %}{{ post.title}}{% endblock %}
|
||||
{% set active_menu = 'support' %}
|
||||
|
||||
|
||||
@@ -347,6 +347,8 @@ class Service implements InjectionAwareInterface
|
||||
$data['title'] = $model->title;
|
||||
$data['meta'] = $this->di['db']->getAssoc('SELECT name, value FROM client_order_meta WHERE client_order_id = :id', array(':id' => $model->id));
|
||||
$data['active_tickets'] = $supportService->getActiveTicketsCountForOrder($model);
|
||||
$client = $this->di['db']->getExistingModelById('Client', $model->client_id, 'Client not found');
|
||||
$data['client'] = $clientService->toApiArray($client, false);
|
||||
|
||||
if ($identity instanceof \Model_Admin) {
|
||||
$data['config'] = $this->getConfig($model);
|
||||
@@ -356,8 +358,6 @@ class Service implements InjectionAwareInterface
|
||||
}else{
|
||||
$data['plugin'] = null;
|
||||
}
|
||||
$client = $this->di['db']->getExistingModelById('Client', $model->client_id, 'Client not found');
|
||||
$data['client'] = $clientService->toApiArray($client, false);
|
||||
}
|
||||
|
||||
return $data;
|
||||
@@ -656,7 +656,7 @@ class Service implements InjectionAwareInterface
|
||||
try {
|
||||
$this->di['events_manager']->fire(array('event' => 'onBeforeAdminOrderActivate', 'params' => array('id' => $addon->id)));
|
||||
$this->createFromOrder($addon);
|
||||
$this->di['events_manager']->fire(array('event' => 'onBeforeAdminOrderActivate', 'params' => array('id' => $addon->id)));
|
||||
$this->di['events_manager']->fire(array('event' => 'onAfterAdminOrderActivate', 'params' => array('id' => $addon->id)));
|
||||
} catch (\Exception $e) {
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ class Service implements InjectionAwareInterface
|
||||
return $this->di['db']->findOne('ClientOrder', 'id = :id AND client_id = :client_id', $bindings);
|
||||
}
|
||||
|
||||
public function getOrderServiceData(\Model_ClientOrder $order, $identity)
|
||||
public function getOrderServiceData(\Model_ClientOrder $order, $identity = null)
|
||||
{
|
||||
$orderId = $order->id;
|
||||
$service = $this->getOrderService($order);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function resizeIframe(obj) {
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#renewal-button').click(function(e){
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function resizeIframe(obj) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<td class="currency">
|
||||
<label for="addon_{{ addon.id }}">
|
||||
{% if addon.pricing.type is sameas('recurrent') %}
|
||||
{% if addon.pricing.type is same as('recurrent') %}
|
||||
{% set periods = guest.system_periods %}
|
||||
<select name="addons[{{ addon.id }}][period]" rel="addon-periods-{{ addon.id }}">
|
||||
{% for code,prices in addon.pricing.recurrent %}
|
||||
@@ -38,11 +38,11 @@
|
||||
</select>
|
||||
{% endif %}
|
||||
|
||||
{% if addon.pricing.type is sameas('once') %}
|
||||
{% if addon.pricing.type is same as('once') %}
|
||||
{{ (addon.pricing.once.price + addon.pricing.once.setup) | money_convert }}
|
||||
{% endif %}
|
||||
|
||||
{% if addon.pricing.type is sameas('free') %}
|
||||
{% if addon.pricing.type is same as('free') %}
|
||||
{{ 0 | money_convert }}
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
|
||||
function onAfterBecomePartner() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] Radio Control Panel Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
Your Centova Cast credentials:
|
||||
@@ -14,5 +14,5 @@ Control panel link: {{ server.url }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated {% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated {% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }}{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -39,5 +39,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -18,5 +18,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Ready to Download{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Download URL: {{ 'servicedownloadable/get-file'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -141,10 +141,12 @@
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
{% block js %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.domain-tabs a').bind('click',function(e){
|
||||
@@ -187,4 +189,5 @@ $(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -71,5 +71,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -13,5 +13,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -57,7 +57,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
function onAfterImport(result)
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
function onAfterImport(result)
|
||||
{
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{% autoescape true js %}
|
||||
{% autoescape "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#testconnection').click(function(){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Activated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -72,4 +72,4 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Canceled{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Renewed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -17,5 +17,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Suspended{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -16,5 +16,5 @@ Submit support ticket: {{ 'support'|link({'ticket' : 1}) }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ order.title }} Reactivated{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hello {{ c.first_name }} {{ c.last_name }},
|
||||
|
||||
@@ -11,5 +11,5 @@ Manage order: {{ 'order/service/manage'|link }}/{{ order.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -133,7 +133,7 @@ class Service implements InjectionAwareInterface
|
||||
try {
|
||||
$orderModel = $di['db']->load('ClientOrder', $params['id']);
|
||||
$orderTicketService = $di['mod_service']('order');
|
||||
$order = $orderTicketService->toApiArray($orderModel, true, $di['loggedin_admin']);
|
||||
$order = $orderTicketService->toApiArray($orderModel, true);
|
||||
|
||||
$email = array();
|
||||
$email['to_staff'] = true;
|
||||
@@ -157,7 +157,7 @@ class Service implements InjectionAwareInterface
|
||||
try {
|
||||
$supportTicketService = $di['mod_service']('support');
|
||||
$ticketModel = $supportTicketService->getTicketById($params['id']);
|
||||
$ticket = $supportTicketService->toApiArray($ticketModel, true, $di['loggedin_admin']);
|
||||
$ticket = $supportTicketService->toApiArray($ticketModel, true);
|
||||
|
||||
$helpdeskModel = $di['db']->load('SupportHelpdesk', $ticketModel->support_helpdesk_id);
|
||||
$emailService = $di['mod_service']('email');
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "layout_default.phtml" %}
|
||||
{% import "macro_functions.phtml" as mf %}
|
||||
{% block meta_title %}{% trans 'Staff' %}{% endblock %}
|
||||
{% set active_menu = 'system' %}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] New Order Placed{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ staff.name }},
|
||||
|
||||
Client **{{ order.client.first_name }} {{ order.client.last_name }}** placed a new order for **{{ order.title }}** on {{ order.created_at|bb_date }}
|
||||
@@ -9,5 +9,5 @@ Manage order {{'order/manage'|alink}}/{{order.id}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] New Client Signed Up{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ staff.name }},
|
||||
|
||||
*{{ c.first_name }} {{ c.last_name }}* has just signed up with {{ guest.system_company.name }}
|
||||
@@ -9,5 +9,5 @@ Manage client at {{'client/manage'|alink}}/{{c.id}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ticket.subject}} [closed]{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hi {{ staff.name }},
|
||||
|
||||
@@ -8,5 +8,5 @@ Public ticket {{ 'support/public-ticket/'|alink }}/{{ticket.id}} was closed by c
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ ticket.subject }}{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ staff.name }},
|
||||
|
||||
New public ticket received.
|
||||
@@ -11,5 +11,5 @@ Track conversation at: {{'support/contact-us/conversation'|link }}/{{ ticket.ha
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ticket.subject}}{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
|
||||
Hi {{ staff.name }},
|
||||
|
||||
@@ -8,5 +8,5 @@ New reply posted on ticket {{ 'support/public-ticket/'|alink }}/{{ticket.id}}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% block subject %}[{{ guest.system_company.name }}] {{ ticket.subject }}{% endblock %}
|
||||
{% block content %}
|
||||
{% filter markdown %}
|
||||
{% apply markdown %}
|
||||
Hi {{ staff.name }},
|
||||
|
||||
**{{ ticket.client.first_name }} {{ ticket.client.last_name }}** closed support ticket #{{ ticket.id }}
|
||||
@@ -9,5 +9,5 @@ Review the ticket at {{'support/ticket'|alink }}/{{ ticket.id }}
|
||||
|
||||
{{ guest.system_company.signature }}
|
||||
|
||||
{% endfilter %}
|
||||
{% endapply %}
|
||||
{% endblock %}
|
||||
Loaded 100 of 137 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user