本文整理汇总了PHP中Customers::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::getList方法的具体用法?PHP Customers::getList怎么用?PHP Customers::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::getList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: customers
public function customers()
{
$registry = Shineisp_Registry::getInstance();
$translator = $registry->Zend_Translate;
$this->view->customers = Customers::getList($translator->translate('Select the customer ...'), array(array('where' => 'u.status_id = ?', 'params' => Statuses::id('active', 'customers'))));
return $this->view->render('partials/customers.phtml');
}
示例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', 'invoice_date', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('select', 'order_id', array('label' => $translate->_('Order No.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setMultiOptions(Orders::getList(true));
$this->addElement('select', 'customer_parent_id', array('label' => $translate->_('Invoice destination'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'disable' => 'true'));
$this->getElement('customer_parent_id')->setAllowEmpty(true)->setMultiOptions(Customers::getList(true));
$this->addElement('text', 'number', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Sequential number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'formatted_number', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Invoice number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Private Notes'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg'));
$this->addElement('hidden', 'invoice_id');
}
示例3: 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');
}
示例4: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Payment date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'reference', array('filters' => array('StringTrim'), 'label' => $translate->_('Transaction Reference'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'income', array('filters' => array('StringTrim'), 'label' => $translate->_('Income'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'outcome', array('filters' => array('StringTrim'), 'label' => $translate->_('Expense'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'confirmed', array('filters' => array('StringTrim'), 'label' => $translate->_('Does the Transaction has been confirmed?'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('confirmed')->setAllowEmpty(false)->setMultiOptions(array('0' => "No, it has been not", '1' => "Yes, it has been"));
$this->addElement('select', 'bank_id', array('decorators' => array('Bootstrap'), 'label' => 'Method of Payments', 'class' => 'form-control'));
$this->getElement('bank_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Banks::getList());
$this->addElement('select', 'order_id', array('decorators' => array('Bootstrap'), 'label' => 'Order', 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Orders::getList());
$this->addElement('select', 'customer_id', array('decorators' => array('Bootstrap'), 'label' => 'Customer', 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Customers::getList());
$this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'id' => 'description', 'rows' => '3', 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control'));
$this->addElement('hidden', 'payment_id');
}
示例5: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'domain', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Domain'), 'description' => $translate->_('Write down the name of the domain without any extension, white spaces, or symbols.'), 'class' => 'form-control updatechkdomain'));
$this->addElement('select', 'tld_id', array('label' => $translate->_('TLD'), 'description' => $translate->_('Select the TLD from the list'), 'decorators' => array('Bootstrap'), 'class' => 'form-control updatechkdomain'));
$this->getElement('tld_id')->setAllowEmpty(false)->setMultiOptions(DomainsTlds::getList())->setRequired(true);
$this->addElement('select', 'registrars_id', array('label' => $translate->_('Registrar'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('registrars_id')->setAllowEmpty(true)->setMultiOptions(Registrars::getList());
// Domain Ownership
$this->addElement('select', 'owner', array('label' => $translate->_('Owner'), 'description' => $translate->_("If the domain owner's profile is not set, the domain customer information will be used."), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('owner')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'admin', array('label' => $translate->_('Admin-C'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('admin')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'tech', array('label' => $translate->_('Tech'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('tech')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'billing', array('label' => $translate->_('Billing'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('billing')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('text', 'creation_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Creation date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'expiring_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'authinfocode', array('filters' => array('StringTrim'), 'label' => $translate->_('AUTHINFO CODE'), 'description' => $translate->_('Write down the Authinfo code in order to transfer the domain to this ISP'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('checkbox', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Auto renewal'), 'class' => 'form-control'));
$this->addElement('select', 'customer_id', array('label' => $translate->_('Customer'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setMultiOptions(Customers::getList())->setRequired(true);
//
$note = $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Private Notes'), 'class' => 'col-lg-12 form-control'));
$note = $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Message'), 'class' => 'col-lg-12 form-control wysiwyg'));
$status = $this->addElement('select', 'status_id', array('label' => 'Status', 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
// DNS SECTION
// ==============
$this->addElement('text', 'subdomain', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subdomain'), 'class' => 'form-control'));
$this->addElement('text', 'target', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Target'), 'class' => 'form-control'));
$this->addElement('select', 'zone', array('label' => $translate->_('Zone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('zone')->setAllowEmpty(false)->setMultiOptions(Dns_Zones_Types::getZones());
$status = $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('domains'));
$save = $this->addElement('submit', 'save', array('required' => false, 'label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn'));
$id = $this->addElement('hidden', 'domain_id');
}
示例6: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('select', 'customer_id', array('label' => $translate->_('Owner of the domain profile'), 'description' => $translate->_('This is the customer who has created the domain profiles.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setMultiOptions(Customers::getList())->setRequired(true);
$this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => $translate->translate('Man'), 'F' => $translate->translate('Female')));
$this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date'));
$this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true));
$this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList());
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'zip', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );'));
$this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true))->setRequired(true);
$this->addElement('text', 'phone', array('filters' => array('StringTrim'), 'label' => $translate->_('Phone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'fax', array('filters' => array('StringTrim'), 'label' => $translate->_('Fax'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control'));
$this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers'));
$this->addElement('hidden', 'profile_id');
}
示例7: doAction
/**
* newAction
* Create the form module in order to create a record
* @return unknown_type
*/
public function doAction()
{
$request = $this->getRequest();
$q = $request->getParam('q');
$q = strtolower($q);
if (!$q) {
return;
}
$q = trim($q);
$customers = Customers::getList();
foreach ($customers as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|customers|" . $this->translator->translate('Customers') . "\n";
}
}
$customers = Customers::getEmailList();
foreach ($customers as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|customers|" . $this->translator->translate('Customer email') . "\n";
}
}
$domains = Domains::getList();
foreach ($domains as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|domains|" . $this->translator->translate('Domains') . "\n";
}
}
$products = Products::getList();
foreach ($products as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|products|" . $this->translator->translate('Products') . "\n";
}
}
$orders = Orders::getList();
foreach ($orders as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|orders|" . $this->translator->translate('Orders') . "\n";
}
}
$wiki = Wiki::getList();
foreach ($wiki as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
echo "{$key}|{$value}|wiki|" . $this->translator->translate('Wiki') . "\n";
}
}
die;
}
示例8: resellerAction
public function resellerAction()
{
$this->session = new Zend_Session_Namespace('Default');
if (!isset($cart->products) || count($cart->products) == 0) {
$this->_helper->redirector('index', 'index', 'default');
}
$request = $this->getRequest();
if (!empty($this->session->customer)) {
$cart->reseller = $this->session->customer;
} else {
unset($cart->reseller);
$this->_helper->redirector('contacts', 'cart', 'default');
}
// Create the sidebar if the cart has products
if (!isset($cart->products)) {
$this->_helper->redirector('index', 'index', 'default');
} else {
$items = $cart->products;
$this->view->placeholder("right")->append($this->view->partial('partials/cartsidebar.phtml', array('items' => $items)));
}
// Create the item for the customers select object
$criteria = array(array('where' => "parent_id = ?", 'params' => $cart->reseller['customer_id']));
// Create the form
$form = new Default_Form_ResellerForm(array('action' => "/cart/reseller", 'method' => 'post'));
// Get the reseller information
// $reseller = array ($cart->reseller ['customer_id'] => $cart->reseller ['firstname'] . " " . $cart->reseller ['lastname'] . " - " . $cart->reseller ['company'] );
// Get the customers connected to the reseller
$customers = Customers::getList(false, $criteria);
$form->getElement('submit')->setLabel('Continue Order');
// Assign the customers to the select object
// $form->getElement ( 'customers' )->setMultiOptions ( $reseller + $customers );
$this->view->form = $form;
// Check if we have a POST request
if ($request->isPost()) {
$params = $request->getPost();
if ($form->isValid($params)) {
$cart->contacts = Customers::getAllInfo($params['customers'], "c.customer_id, a.address_id, cts.type_id, l.legalform_id, ct.country_id, cn.contact_id, s.status_id, c.*, a.*, l.*, cn.*, cts.*, s.*");
$this->_helper->redirector('summary', 'cart', 'default');
}
}
$this->view->reseller = $cart->reseller;
$this->_helper->viewRenderer('reseller');
}
示例9: doAction
/**
* Create the form module in order to create a record
* @return unknown_type
*/
public function doAction()
{
$request = $this->getRequest();
$q = $request->getParam('q');
$results = array();
$q = strtolower($q);
if (empty($q)) {
die(json_encode(array($this->translator->translate('No Records'))));
}
$cms = CmsPages::getList();
foreach ($cms as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-file', 'section' => $this->translator->translate('Cms'), 'value' => $value, 'url' => "/admin/cmspages/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
$customers = Customers::getList();
if (!empty($customers)) {
foreach ($customers as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-user', 'section' => $this->translator->translate('Customer'), 'value' => $value, 'url' => "/admin/customers/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$domains = Domains::getList();
if (!empty($domains)) {
foreach ($domains as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-globe', 'section' => $this->translator->translate('Domain'), 'value' => $value, 'url' => "/admin/domains/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$products = Products::getList();
if (!empty($products)) {
foreach ($products as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-barcode', 'section' => $this->translator->translate('Product'), 'value' => $value, 'url' => "/admin/products/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$orders = Orders::getList();
if (!empty($orders)) {
foreach ($orders as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-briefcase', 'section' => $this->translator->translate('Order'), 'value' => $value, 'url' => "/admin/orders/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$ordersitems = OrdersItems::getItemsListbyDescription($q);
if (!empty($ordersitems)) {
foreach ($ordersitems as $key => $value) {
$results[] = array('icon' => 'glyphicon-briefcase', 'section' => $this->translator->translate('Order Item'), 'value' => $value, 'url' => "/admin/ordersitems/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
$tickets = Tickets::getList();
if (!empty($tickets)) {
foreach ($tickets as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-check', 'section' => $this->translator->translate('Ticket'), 'value' => $value, 'url' => "/admin/tickets/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$wiki = Wiki::getList();
if (!empty($wiki)) {
foreach ($wiki as $key => $value) {
if (strpos(strtolower($value), $q) !== false) {
$results[] = array('icon' => 'glyphicon-question-sign', 'section' => $this->translator->translate('Wiki'), 'value' => $value, 'url' => "/admin/wiki/edit/id/{$key}", 'tokens' => explode(' ', $value));
}
}
}
$ticket = TicketsNotes::getItemsNote($q);
foreach ($ticket as $key => $value) {
$results[] = array('icon' => 'glyphicon-question-sign', 'section' => $this->translator->translate('Ticket Notes'), 'value' => $value, 'url' => "/admin/wiki/tickets/id/{$key}", 'tokens' => explode(' ', $value));
}
die(json_encode($results));
}
示例10: 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->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => 'Man', 'F' => 'Female'));
$this->addElement('select', 'taxfree', array('label' => $translate->_('Tax free'), 'description' => $translate->_('If it is set as Yes all the taxes will be not added in the orders'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('taxfree')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes'));
$this->addElement('select', 'ignore_latefee', array('label' => $translate->_('Ignore late fee'), 'description' => $translate->_('If it is set as Yes this customers is not subject to late fee'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('ignore_latefee')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes'));
$this->addElement('select', 'language_id', array('label' => $translate->_('Default Language'), 'description' => $translate->_('All the messages sent to the customer will be send using the default language selected'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('language_id')->setAllowEmpty(true)->setMultiOptions(Languages::getList());
$this->addElement('select', 'issubscriber', array('label' => $translate->_('Newsletter Subscription'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('issubscriber')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes'));
$this->addElement('select', 'isreseller', array('label' => $translate->_('Is Reseller'), 'description' => 'Set the user as reseller', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('isreseller')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes'));
$this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date'));
$this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'group_id', array('label' => $translate->_('Group'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('group_id')->setAllowEmpty(true)->setMultiOptions(CustomersGroups::getList());
$this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true));
$this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList());
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('button', 'customerupdate', array('label' => 'Customer Update', 'description' => 'Update the customer information retrieving the data from the registrar database.', 'decorators' => array('Bootstrap'), 'class' => 'button red customerupdate'));
$this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => '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', 'admin', Isp::getActiveISPID());
$filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin');
$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', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle'));
if ($filetypes) {
$file->addValidator('Extension', false, $filetypes);
}
if ($Byteslimit) {
$file->addValidator('Size', false, $Byteslimit);
}
$file->addValidator('Count', false, 1);
$this->addElement($file);
$this->addElement('select', 'filecategory', array('label' => $translate->_('File Category'), 'decorators' => array('Bootstrap'), 'class' => 'text-input'));
$this->getElement('filecategory')->setAllowEmpty(true)->setMultiOptions(FilesCategories::getList());
}
$this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'code', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );'));
$this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true));
$this->addElement('select', 'region_id', array('label' => $translate->_('Region'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeRegions( this );'));
$this->getElement('region_id')->setRegisterInArrayValidator(false)->addValidator(new Shineisp_Validate_Regions());
$this->addElement('select', 'contacttypes', array('label' => $translate->_('Contact Types'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('contacttypes')->setAllowEmpty(false)->setMultiOptions(ContactsTypes::getList());
$this->addElement('text', 'contact', array('filters' => array('StringTrim'), 'label' => $translate->_('Contact'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Private Notes'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg'));
$this->addElement('password', 'password', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'description' => 'Write here at least 6 characters.', 'label' => $translate->_('Password'), 'class' => 'form-control'));
$this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers'));
$this->addElement('select', 'parent_id', array('label' => 'Reseller', 'decorators' => array('Bootstrap'), 'description' => 'Select the client who you want to join with the selected customer.', 'class' => 'form-control'));
$criterias = array(array('where' => 'isreseller = ?', 'params' => '1'));
$this->getElement('parent_id')->setAllowEmpty(true)->setMultiOptions(Customers::getList(true, $criterias));
$this->addElement('submit', 'save', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn'));
$this->addElement('hidden', 'customer_id');
}