本文整理汇总了PHP中Settings::findbyParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::findbyParam方法的具体用法?PHP Settings::findbyParam怎么用?PHP Settings::findbyParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::findbyParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'creationdate', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'expiringdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'title' => $translate->_('eg: 01/11/2011'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Payment Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('select', 'category_id', array('label' => $translate->_('Category'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('category_id')->setAllowEmpty(false)->setMultiOptions(PurchaseCategories::getList());
$this->addElement('select', 'method_id', array('label' => $translate->_('Payment Method'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('method_id')->setAllowEmpty(false)->setMultiOptions(PaymentsMethods::getList());
$this->addElement('text', 'number', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company'), 'required' => true, 'title' => $translate->_('eg: Google inc.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'total_net', array('filters' => array('StringTrim'), 'label' => $translate->_('Total Net'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'total_vat', array('filters' => array('StringTrim'), 'label' => $translate->_('Total VAT'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'total', array('filters' => array('StringTrim'), 'label' => $translate->_('Total'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Note'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control'));
// If the browser client is an Apple client hide the file upload html object
if (false == Shineisp_Commons_Utilities::isAppleClient()) {
$MBlimit = Settings::findbyParam('adminuploadlimit');
$Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
$filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin');
$file = $this->createElement('file', 'document', array('label' => $translate->_('Document'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle'));
$file->addValidator('Extension', false, $filetypes)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
$file->setValueDisabled(true);
$file->setRequired(false);
$this->addElement($file);
}
$this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders'));
$this->addElement('hidden', 'purchase_id');
}
示例2: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'nick', array('filters' => array('StringTrim'), 'required' => true, 'description' => $translate->_('Add your own nickname'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Nick'), 'class' => 'form-control'));
$this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write down a subject of the review'), 'label' => $translate->_('Subject'), 'class' => 'form-control'));
$this->addElement('select', 'referer', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Where did you find us?'), 'label' => $translate->_('Who is Talking About Us?'), 'class' => 'form-control', 'multiOptions' => array('Google' => 'Google', 'Bing' => 'Bing', 'Yahoo' => 'Yahoo', 'Other Search Engine' => 'Other Search Engine', 'Websites' => 'Websites/Blogs', 'Magento Commerce' => 'Magento Commerce', 'Friend suggestion' => 'Friend suggestion')));
$this->addElement('text', 'city', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Which is your own city? If added we will promote your review in our website using Google Maps'), 'label' => $translate->_('City'), 'class' => 'form-control'));
$this->addElement('text', 'email', array('filters' => array('StringTrim'), 'required' => true, 'validators' => array('EmailAddress'), 'decorators' => array('Bootstrap'), 'description' => 'Your email will be not published', 'label' => $translate->_('Email'), 'class' => 'form-control'));
$this->addElement('select', 'stars', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Stars'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multiOptions' => array(1 => '1 ' . $translate->_('Star'), 2 => '2 ' . $translate->_('Stars'), 3 => '3 ' . $translate->_('Stars'), 4 => '4 ' . $translate->_('Stars'), 5 => '5 ' . $translate->_('Stars'))));
$this->addElement('textarea', 'review', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'required' => true, 'description' => $translate->_('Write down your review with details and you will earn points and discounts'), 'label' => $translate->_('Review'), 'class' => 'form-control', 'rows' => '8'));
$privKey = Settings::findbyParam('recaptcha_private_key');
$pubKey = Settings::findbyParam('recaptcha_public_key');
if (!empty($pubKey) && !empty($privKey)) {
$recaptcha = new Zend_Service_ReCaptcha($pubKey, $privKey);
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Captcha Check'), 'description' => $translate->_('Type the characters you see in the picture below.'), 'captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
$this->addElement($captcha);
} else {
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Write the chars to the field'), 'captcha' => array('captcha' => 'Image', 'wordLen' => 6, 'timeout' => 300, 'font' => PUBLIC_PATH . '/resources/fonts/arial.ttf', 'imgDir' => PUBLIC_PATH . '/tmp', 'imgUrl' => '/tmp/')));
$this->addElement($captcha);
}
$this->addElement('submit', 'save', array('required' => false, 'label' => $translate->_('Publish your Review'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary'));
$this->addElement('hidden', 'product_id');
}
示例3: init
public function init()
{
$NS = new Zend_Session_Namespace('Default');
$translate = Shineisp_Registry::get('Zend_Translate');
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$this->addElement('select', 'domain_id', array('decorators' => array('Bootstrap'), 'required' => false, 'label' => $translate->_('Domain'), 'description' => $translate->_('Choose the domain name reference'), 'class' => 'form-control large-input'));
$this->getElement('domain_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList(true, $NS->customer['customer_id']));
$this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'title' => $translate->_('Write here a subject of the issue.'), 'label' => $translate->_('Subject'), 'description' => $translate->_('Write here the domain name or a simple description of the problem.'), 'class' => 'form-control large-input'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Body Message'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here all the information.'), 'rows' => '8', 'class' => 'form-control wysiwyg-simple'));
$this->addElement('select', 'status', array('filters' => array('StringTrim'), 'label' => $translate->_('Set the issue status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'multioptions' => array('' => '', Statuses::id("solved", "tickets") => $translate->_('Solved'), Statuses::id("closed", "tickets") => $translate->_('Closed'))));
$this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'description' => 'Select a category.', 'class' => 'form-control large-input'));
$this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList(true));
if (false == Shineisp_Commons_Utilities::isAppleClient()) {
$MBlimit = Settings::findbyParam('useruploadlimit');
$Types = Settings::findbyParam('useruploadfiletypes');
if (empty($MBlimit)) {
$MBlimit = 1;
}
if (empty($Types)) {
$Types = "zip,jpg";
}
$Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
$file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit))));
$file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
$this->addElement($file);
} else {
$this->addElement('hidden', 'attachments');
}
$this->addElement('submit', 'submit', array('label' => $translate->_('Send help request'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg'));
$this->addElement('hidden', 'ticket_id');
}
示例4: showblock
/**
* showblock
* Handle the XML Blocks
* @param unknown_type $side
*/
public function showblock($side)
{
$ns = new Zend_Session_Namespace('Admin');
$languageID = Languages::get_language_id($ns->lang);
$record = array();
$blocks = array();
// Get the main variables
$module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$customskin = Settings::findbyParam('adminskin');
$skin = !empty($customskin) ? $customskin : "base";
// call the placeholder view helper for each side parsed
echo $this->view->placeholder($side);
// Get all the xml blocks
$xmlblocks = Shineisp_Commons_Layout::getBlocks($module, $side, $controller, $skin);
if (!empty($xmlblocks)) {
$blocks['reference'] = $xmlblocks;
}
if (!empty($blocks['reference'])) {
$blocks['reference'] = Shineisp_Commons_Utilities::columnSort($blocks['reference'], 'position');
}
if (isset($blocks['reference']['block'])) {
$this->Iterator($blocks['reference'], $side);
} elseif (isset($blocks['reference'][0])) {
foreach ($blocks['reference'] as $block) {
$this->Iterator($block, $side);
}
}
$this->view->module = $module;
$this->view->controller = $controller;
$this->view->action = $action;
}
示例5: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$this->addElementPrefixPath('Default', APPLICATION_PATH . '/modules/default/forms/validate/', 'validate');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'fullname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Fullname'), 'title' => $translate->_('Write here your firstname and lastname.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company'), 'title' => $translate->_('Write here your company name.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$email = $this->createElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'title' => $translate->_('Write here your email'), 'class' => 'form-control large-input'));
$this->addElement($email);
$status = $this->addElement('select', 'subject', array('label' => $translate->_('Subject'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$status = $this->getElement('subject')->setAllowEmpty(false)->setMultiOptions(array('Sales Question' => 'Sales Question', 'Billing Question' => 'Billing Question', 'Partnership Inquiry' => 'Partnership Inquiry', 'Website Feedback' => 'Website Feedback'));
$this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'required' => true, 'rows' => 5, 'description' => $translate->_('Write here your message.'), 'label' => $translate->_('Message'), 'class' => 'form-control'));
$privKey = Settings::findbyParam('recaptcha_private_key');
$pubKey = Settings::findbyParam('recaptcha_public_key');
if (!empty($pubKey) && !empty($privKey)) {
$recaptcha = new Zend_Service_ReCaptcha($pubKey, $privKey);
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Captcha Check'), 'description' => $translate->_('Type the characters you see in the picture below.'), 'captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
$this->addElement($captcha);
} else {
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Write the chars to the field'), 'captcha' => array('captcha' => 'Image', 'wordLen' => 6, 'timeout' => 300, 'font' => PUBLIC_PATH . '/resources/fonts/arial.ttf', 'imgDir' => PUBLIC_PATH . '/tmp', 'imgUrl' => '/tmp/')));
$this->addElement($captcha);
}
$this->addElement('submit', 'submit', array('required' => false, 'label' => $translate->_('Submit your request'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary bigbtn'));
}
示例6: preStmtExecute
public function preStmtExecute(Doctrine_Event $event)
{
// Check if the administrator has enabled the query logging feature
if (Settings::findbyParam('debug_queries')) {
$breadcrumps = array();
$query = $event->getQuery();
$params = $event->getParams();
$callers = array_reverse(debug_backtrace(), true);
$callers = array_slice($callers, 4, count($callers) - 10);
foreach ($callers as $caller) {
$class = !empty($caller['class']) ? $caller['class'] : null;
$breadcrumps[] = $class . "->" . $caller['function'];
}
$strBreadcrump = "System: " . implode(" / ", $breadcrumps);
//the below makes some naive assumptions about the queries being logged
while (sizeof($params) > 0) {
$param = array_shift($params);
if (!is_numeric($param)) {
$param = sprintf("'%s'", $param);
}
$query = substr_replace($query, $param, strpos($query, '?'), 1);
}
Shineisp_Commons_Utilities::log($query, "queries.log");
Shineisp_Commons_Utilities::log($strBreadcrump, "debug.log", Zend_Log::DEBUG);
// Increase query counter
$queryCount = Shineisp_Registry::isRegistered('querycount') ? Shineisp_Registry::get('querycount') : 0;
$queryCount = $queryCount + 1;
Shineisp_Registry::set('querycount', $queryCount);
}
}
示例7: querycount
public function querycount()
{
if (Settings::findbyParam('debug_queries')) {
return "Queries: " . Shineisp_Registry::get('querycount');
} else {
return null;
}
}
示例8: paths
/**
*
* @param unknown_type $type
* @return string
*/
public function paths($type = "")
{
switch ($type) {
case "skin":
// Get the custom skin folder path
$skin = Settings::findbyParam('skin');
if (!empty($skin)) {
return "/skins/default/{$skin}/";
} else {
return "/skins/default/base/";
}
break;
case "css":
// Get the custom skin css folder path
$skin = Settings::findbyParam('skin');
if (!empty($skin)) {
return "/skins/default/{$skin}/css/";
} else {
return "/skins/default/base/css/";
}
break;
case "images":
// Get the custom skin images folder path
$skin = Settings::findbyParam('skin');
if (!empty($skin)) {
return "/skins/default/{$skin}/images/";
} else {
return "/skins/default/base/images/";
}
break;
case "js":
// Get the custom skin javascript folder path
$skin = Settings::findbyParam('skin');
if (!empty($skin)) {
return "/skins/default/{$skin}/js/";
} else {
return "/skins/default/base/js/";
}
break;
default:
// Get the custom skin folder path
$skin = Settings::findbyParam('skin');
if (!empty($skin)) {
return "/skins/default/{$skin}/";
} else {
return "/skins/default/base/";
}
break;
}
}
示例9: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'validators' => array('EmailAddress'), 'decorators' => array('Bootstrap'), 'required' => true, 'description' => $translate->_('Write your own email'), 'label' => $translate->_('Email'), 'class' => 'form-control'));
$privKey = Settings::findbyParam('recaptcha_private_key');
$pubKey = Settings::findbyParam('recaptcha_public_key');
if (!empty($pubKey) && !empty($privKey)) {
$recaptcha = new Zend_Service_ReCaptcha($pubKey, $privKey);
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Captcha Check'), 'description' => $translate->_('Type the characters you see in the picture below.'), 'captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
$this->addElement($captcha);
}
$this->addElement('submit', 'submit', array('label' => $translate->_('Reset my password'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-danger'));
}
示例10: productsAction
public function productsAction()
{
$ns = new Zend_Session_Namespace();
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><shineisp></shineisp>');
$localeID = $ns->idlang;
$products = $xml->addChild('products');
try {
// Get all the products
$records = Products::getAll(null, $localeID);
if (!empty($records)) {
foreach ($records as $item) {
$item['ProductsData'][0]['shortdescription'] = strip_tags($item['ProductsData'][0]['shortdescription']);
$item['ProductsData'][0]['description'] = strip_tags($item['ProductsData'][0]['description']);
$item['ProductsData'][0]['shortdescription'] = html_entity_decode($item['ProductsData'][0]['shortdescription'], ENT_NOQUOTES, "UTF-8");
$item['ProductsData'][0]['description'] = html_entity_decode($item['ProductsData'][0]['description'], ENT_NOQUOTES, "UTF-8");
$item['ProductsData'][0]['shortdescription'] = str_replace("&", "", $item['ProductsData'][0]['shortdescription']);
$item['ProductsData'][0]['description'] = str_replace("&", "", $item['ProductsData'][0]['description']);
$categories = products::get_text_categories($item['categories']);
$categories = htmlspecialchars($categories);
$product = $products->addChild('product');
$product->addAttribute('uuid', $item['uuid']);
$product->addAttribute('id', $item['product_id']);
$product->addAttribute('inserted_at', !empty($item['inserted_at']) ? strtotime($item['inserted_at']) : null);
$product->addAttribute('updated_at', !empty($item['updated_at']) ? strtotime($item['updated_at']) : null);
$product->addChild('sku', htmlentities($item['sku']));
if (!empty($item['ProductsMedia'][0]['path']) && file_exists(PUBLIC_PATH . $item['ProductsMedia'][0]['path'])) {
$product->addChild('image', "http://" . $_SERVER['HTTP_HOST'] . $item['ProductsMedia'][0]['path']);
}
$product->addChild('name', !empty($item['ProductsData'][0]['name']) ? $item['ProductsData'][0]['name'] : null);
$product->addChild('shortdescription', !empty($item['ProductsData'][0]['shortdescription']) ? "<![CDATA[" . $item['ProductsData'][0]['shortdescription'] . "]]>" : null);
$product->addChild('description', !empty($item['ProductsData'][0]['description']) ? "<![CDATA[" . $item['ProductsData'][0]['description'] . "]]>" : null);
$product->addChild('categories', $categories);
$price = $product->addChild('price', Products::getPrice($item['product_id']));
$price->addAttribute('taxincluded', 0);
$price->addAttribute('isrecurrent', products::isRecurring($item['product_id']));
$price->addAttribute('currency', Settings::findbyParam('currency'));
}
}
header('Content-Type: text/xml; charset=utf-8');
die($xml->asXML());
} catch (Exception $e) {
Shineisp_Commons_Utilities::log(__CLASS__ . " " . $e->getMessage());
die;
}
}
示例11: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subject'), 'class' => 'form-control'));
$this->addElement('text', 'datetime', array('filters' => array('StringTrim'), 'label' => $translate->_('Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'class' => 'col-lg-12 form-control wysiwyg'));
$this->addElement('select', 'sendemail', array('label' => $translate->_('Send Email'), 'description' => $translate->_('Send an email to the customer.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('1' => $translate->_('Yes'), '0' => $translate->_('No'))));
$this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control'));
$this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList());
$this->addElement('select', 'customer_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Customer'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Customers::getList());
$this->addElement('select', 'category', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control'));
$this->getElement('category')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList());
$this->addElement('select', 'order_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Order reference'), 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Orders::getList(true));
$this->addElement('select', 'sibling_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Relationships'), 'class' => 'form-control'));
$this->getElement('sibling_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false);
$this->addElement('select', 'user_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Operator'), 'class' => 'form-control'));
$this->getElement('user_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(AdminUser::getList());
#->setMultiOptions(AdminUser::getUserbyRoleID(AdminRoles::getIdRoleByName('operator')));
$this->addElement('select', 'status_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Status'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('tickets'));
// If the browser client is an Apple client hide the file upload html object
if (false == Shineisp_Commons_Utilities::isAppleClient()) {
$MBlimit = Settings::findbyParam('adminuploadlimit');
$Types = Settings::findbyParam('adminuploadfiletypes', 'Admin');
if (empty($MBlimit)) {
$MBlimit = 1;
}
if (empty($Types)) {
$Types = "zip,jpg";
}
$Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
$file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle'));
$file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
$this->addElement($file);
} else {
$this->addElement('hidden', 'attachments');
}
$this->addElement('hidden', 'ticket_id');
}
示例12: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('First name'), 'description' => $translate->_('Write here your first name.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Last name'), 'description' => $translate->_('Write here your last name.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'validators' => array(new Zend_Validate_Date('dd/mm/yyyy', 'it')), 'label' => $translate->_('Birthdate'), 'description' => $translate->_('Write here your birthday (eg. dd/mm/yyyy)'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input'));
$this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birthplace'), 'description' => $translate->_('Write here the birthplace.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('select', 'company_type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the company type'), 'class' => 'form-control large-input'));
$this->getElement('company_type_id')->setAllowEmpty(false)->setMultiOptions(CompanyTypes::getList(true));
$this->addElement('select', 'legalform', array('label' => $translate->_('Legal form'), 'required' => true, 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the type of company.'), 'class' => 'form-control large-input'));
$this->getElement('legalform')->setAllowEmpty(false)->setMultiOptions(Legalforms::getList());
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here your company name.'), 'class' => 'form-control large-input'));
$this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth District'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input', 'maxlength' => 2));
$this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Country of Birth'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth Nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
if (Settings::findbyParam('customer_vat')) {
$this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'description' => $translate->_('Write here the VAT number.')));
}
$this->addElement('text', 'area', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input', 'description' => 'Write the area code'));
if (Settings::findbyParam('customer_taxpayernumber')) {
$this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Tax payer number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'description' => 'Write the tax payer number.'));
}
$this->addElement('text', 'address', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write the address'), 'class' => 'form-control large-input'));
$this->addElement('text', 'code', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Zip'), 'description' => 'Write the zip code', 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input'));
$this->addElement('text', 'city', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('City'), 'description' => $translate->_('Write here your city name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'required' => true, 'description' => $translate->_('Select your own country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList())->setRequired(true);
$this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input'));
$this->getElement('gender')->setAllowEmpty(false)->setMultiOptions(array('M' => 'M', 'F' => 'F'))->setRequired(true);
$this->addElement('select', 'newsletter', array('label' => $translate->_('Newsletter'), 'description' => $translate->_('Subscribe to our free content feeds and get all the news for your bought services and products.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control medium-input'));
$this->getElement('newsletter')->setAllowEmpty(false)->setMultiOptions(array('0' => $translate->_('No, I am not interested'), '1' => $translate->_('Yes, please send me your updates')))->setRequired(true);
$this->addElement('select', 'contacttypes', array('label' => $translate->_('Contact Types'), 'required' => true, 'description' => $translate->_('Select the contact type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input'));
$this->getElement('contacttypes')->setAllowEmpty(false)->setMultiOptions(ContactsTypes::getList());
$this->addElement('text', 'contact', array('filters' => array('StringTrim'), 'label' => $translate->_('Contact'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here the contact (eg. +39.98368276)'), 'class' => 'form-control medium-input'));
$this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'required' => true, 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'description' => $translate->_('Write here your email'), 'class' => 'form-control large-input'));
$this->addElement('password', 'password', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'description' => $translate->_('Write here your password. (min.6 chars - max.20 chars)'), 'label' => $translate->_('Password'), 'class' => 'form-control large-input'));
$this->addElement('submit', 'submit', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary'));
$this->addElement('hidden', 'customer_id');
}
示例13: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$this->addElementPrefixPath('Default', APPLICATION_PATH . '/modules/default/forms/validate/', 'validate');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here your company name.'), 'class' => 'form-control'));
$this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('First name'), 'description' => $translate->_('Write here your first name.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Last name'), 'description' => $translate->_('Write here your lastname.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$email = $this->createElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'description' => $translate->_('Write here your email'), 'class' => 'form-control'));
$email->addValidator('UniqueEmail', false, array(new Customers()));
$this->addElement($email);
// Password manager
$passwordConfirmation = new Shineisp_Validate_PasswordConfirmation();
$password = $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here your password. (min.8 chars - max.20 chars)'), 'validators' => array($passwordConfirmation, array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'class' => 'form-control', 'required' => true, 'label' => $translate->_('Password')));
$password_confirm = $this->addElement('password', 'password_confirm', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Please repeat the password'), 'validators' => array($passwordConfirmation, array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'class' => 'form-control', 'required' => true, 'label' => 'Confirm Password'));
if (Settings::findbyParam('customer_vat')) {
#$vatValidator = new Shineisp_Validate_Vat();
$this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'description' => $translate->_('Write here the VAT code. Eg: IT123456789')));
#$this->getElement('vat')->addValidator($vatValidator);
}
$this->addElement('select', 'company_type_id', array('label' => 'Company Type', 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the company type'), 'class' => 'form-control'));
$this->getElement('company_type_id')->setAllowEmpty(false)->setMultiOptions(CompanyTypes::getList(true));
$this->addElement('select', 'legalform', array('label' => $translate->_('Legal form'), 'required' => true, 'decorators' => array('Bootstrap'), 'description' => $translate->_('Select the type of company.'), 'class' => 'form-control'));
$this->getElement('legalform')->setAllowEmpty(false)->setMultiOptions(Legalforms::getList(true))->addValidator(new Shineisp_Validate_Customer());
if (Settings::findbyParam('customer_taxpayernumber')) {
$fiscalcodeValidator = new Shineisp_Validate_Fiscalcode();
$this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Tax payer number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'description' => $translate->_('Write the tax payer number.')));
# TODO: check both fiscalcode for generic person or giuridic person. (XYZYXZ88D22C123X and 1234567890)
#$this->getElement('taxpayernumber')->addValidator($fiscalcodeValidator);
}
$this->addElement('submit', 'signup', array('label' => $translate->_('Create my account'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-success btn-lg'));
$privKey = Settings::findbyParam('recaptcha_private_key');
$pubKey = Settings::findbyParam('recaptcha_public_key');
if (!empty($pubKey) && !empty($privKey)) {
$recaptcha = new Zend_Service_ReCaptcha($pubKey, $privKey);
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $translate->_('Captcha Check'), 'description' => $translate->_('Type the characters you see in the picture below.'), 'captcha' => 'ReCaptcha', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha)));
$this->addElement($captcha);
}
}
示例14: Alerts
public function Alerts()
{
$registry = Shineisp_Registry::getInstance();
$currency = Shineisp_Registry::getInstance()->Zend_Currency;
$translation = $registry->Zend_Translate;
$alerts = array();
$this->view->module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$this->view->controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$this->view->action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$NS = new Zend_Session_Namespace('Default');
if (!empty($NS->customer)) {
$data = $NS->customer;
$orders = Orders::find_all_not_paid_ordersbyCustomerID($data['customer_id']);
$tasks_errors = DomainsTasks::GetIncompleteTask($data['customer_id']);
if (count($tasks_errors) > 0) {
foreach ($tasks_errors as $task) {
if (!empty($task['log'])) {
$alerts[] = array('message' => $task['domain'] . " - " . $translation->_($task['log']), $task['domain_id'], 'link' => '/domains/edit/id/' . $task['domain_id'], 'icon' => 'danger');
}
}
}
if (count($orders) > 0) {
foreach ($orders as $order) {
$order['grandtotal'] = $currency->toCurrency($order['grandtotal'], array('currency' => Settings::findbyParam('currency')));
if (!empty($order['invoice_id'])) {
$alerts[] = array('message' => $translation->_('The invoice %s of %s (%s) has been not payed yet, click here to show more details.', $order['Invoices']['number'], Shineisp_Commons_Utilities::formatDateOut($order['order_date']), $order['grandtotal']), 'link' => '/orders/edit/id/' . $order['order_id'], 'icon' => 'danger');
} else {
$alerts[] = array('message' => $translation->_('The order %s that you have requested the %s with total %s has not been paid yet, click here for more information.', $order['order_number'], Shineisp_Commons_Utilities::formatDateOut($order['order_date']), $order['grandtotal']), 'link' => '/orders/edit/id/' . $order['order_id'], 'icon' => 'danger');
}
}
}
$this->view->alerts = $alerts;
// Path of the template
return $this->view->render('partials/alerts.phtml');
}
}
示例15: indexAction
/**
* The default action - show the home page
*/
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('admin'));
$translator = Shineisp_Registry::getInstance()->Zend_Translate;
if ($auth->hasIdentity()) {
$this->view->show_dashboard = true;
$this->view->user = $auth->getIdentity();
$this->getHelper('layout')->setLayout('1column');
$graph = new Shineisp_Commons_Morris();
// Get the total of the revenues per year
$graphdata = $graph->setType('Area')->setData(Orders::prepareGraphData(array(), 'year'))->setElement('yeargraph')->setXkey('xdata')->setLabels(array($translator->translate('Net Revenue (Taxable Income less Costs)')))->setOptions(array('lineColors' => array('#428BCA'), 'preUnits' => Settings::findbyParam('currency') . " "))->plot();
$this->view->placeholder("admin_endbody")->append($graphdata);
// Get the total of the revenues per quarter of year
$graphdata = $graph->setType('Area')->setData(Orders::prepareGraphData(array(2012, 2013), 'quarter'))->setElement('quartergraph')->setXkey('xdata')->setLabels(array($translator->translate('Net Revenue (Taxable Income less Costs)')))->setOptions(array('lineColors' => array('#428BCA'), 'preUnits' => Settings::findbyParam('currency') . " "))->plot();
$this->view->placeholder("admin_endbody")->append($graphdata);
// Get the total of the revenues per months
$graphdata = $graph->setType('Bar')->setData(Orders::prepareGraphData(array(), 'month'))->setElement('monthgraph')->setXkey('xdata')->setLabels(array($translator->translate('Net Revenue (Taxable Income less Costs)')))->setOptions(array('barColors' => array('#428BCA'), 'preUnits' => Settings::findbyParam('currency') . " "))->plot();
$this->view->placeholder("admin_endbody")->append($graphdata);
} else {
$this->_helper->redirector('index', 'login', 'admin');
// back to login page
}
}