当前位置: 首页>>代码示例>>PHP>>正文


PHP FWUser::getUserLiveSearch方法代码示例

本文整理汇总了PHP中FWUser::getUserLiveSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP FWUser::getUserLiveSearch方法的具体用法?PHP FWUser::getUserLiveSearch怎么用?PHP FWUser::getUserLiveSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FWUser的用法示例。


在下文中一共展示了FWUser::getUserLiveSearch方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: modifyEntry


//.........这里部分代码省略.........
                 }
             }
             //get inputfield object
             $objInputfields = new MediaDirectoryInputfield($intFormId, false, null, $this->moduleName);
             //list inputfields
             $objInputfields->listInputfields($this->_objTpl, 2, $intEntryId);
             //get translation status date
             if ($this->arrSettings['settingsTranslationStatus'] == 1) {
                 $ownerRowClass = "row1";
                 foreach ($this->arrFrontendLanguages as $key => $arrLang) {
                     $strLangStatus = '';
                     if ($intEntryId != 0) {
                         if (in_array($arrLang['id'], $objEntry->arrEntries[$intEntryId]['entryTranslationStatus'])) {
                             $strLangStatus = 'checked="checked"';
                         }
                     }
                     $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_TRANSLATION_LANG_NAME' => htmlspecialchars($arrLang['name'], ENT_QUOTES, CONTREXX_CHARSET), $this->moduleLangVar . '_TRANSLATION_LANG_ID' => intval($arrLang['id']), $this->moduleLangVar . '_TRANSLATION_LANG_STATUS' => $strLangStatus));
                     $this->_objTpl->parse($this->moduleNameLC . 'TranslationLangList');
                 }
                 $this->_objTpl->parse($this->moduleNameLC . 'TranslationStatus');
             } else {
                 $ownerRowClass = "row2";
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'TranslationStatus');
             }
             //get user data
             $objFWUser = \FWUser::getFWUserObject();
             $addedBy = isset($objEntry) ? $objEntry->arrEntries[$intEntryId]['entryAddedBy'] : '';
             if (!empty($addedBy) && ($objUser = $objFWUser->objUser->getUser($addedBy))) {
                 $userId = $objUser->getId();
             } else {
                 $userId = $objFWUser->objUser->getId();
             }
             $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_OWNER' => $_ARRAYLANG['TXT_MEDIADIR_OWNER'], $this->moduleLangVar . '_OWNER_ROW' => $ownerRowClass, $this->moduleLangVar . '_OWNER_ID' => $userId));
             \FWUser::getUserLiveSearch();
             if ($intEntryId != 0) {
                 $intEntryDourationStart = 1;
                 $intEntryDourationEnd = 2;
                 //parse contact data
                 $objUser = $objFWUser->objUser;
                 $intUserId = intval($objUser->getId());
                 $strUserMail = '<a href="mailto:' . contrexx_raw2xhtml($objUser->getEmail()) . '">' . contrexx_raw2xhtml($objUser->getEmail()) . '</a>';
                 $intUserLang = intval($objUser->getFrontendLanguage());
                 if ($objUser = $objUser->getUser($id = $intUserId)) {
                     //get lang
                     foreach ($this->arrFrontendLanguages as $intKey => $arrLang) {
                         if ($arrLang['id'] == $intUserLang) {
                             $strUserLang = $arrLang['name'];
                         }
                     }
                     //get country
                     $arrCountry = \Cx\Core\Country\Controller\Country::getById(intval($objUser->getProfileAttribute('country')));
                     $strCountry = $arrCountry['name'];
                     //get title
                     $objTitle = $objDatabase->Execute("SELECT `title` FROM " . DBPREFIX . "access_user_title WHERE id = '" . intval($objUser->getProfileAttribute('title')) . "' LIMIT 1");
                     $strTitle = $objTitle->fields['title'];
                     $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_CONTACT_DATA' => "Kontaktangaben", $this->moduleLangVar . '_CONTACT_ATTRIBUT_TITLE' => contrexx_raw2xhtml($strTitle), $this->moduleLangVar . '_CONTACT_ATTRIBUT_FIRSTNAME' => contrexx_raw2xhtml($objUser->getProfileAttribute('firstname')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_LASTNAME' => contrexx_raw2xhtml($objUser->getProfileAttribute('lastname')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_COMPANY' => contrexx_raw2xhtml($objUser->getProfileAttribute('company')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_ADRESS' => contrexx_raw2xhtml($objUser->getProfileAttribute('address')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_CITY' => contrexx_raw2xhtml($objUser->getProfileAttribute('city')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_ZIP' => contrexx_raw2xhtml($objUser->getProfileAttribute('zip')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_COUNTRY' => contrexx_raw2xhtml($strCountry), $this->moduleLangVar . '_CONTACT_ATTRIBUT_PHONE' => contrexx_raw2xhtml($objUser->getProfileAttribute('phone_office')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_FAX' => contrexx_raw2xhtml($objUser->getProfileAttribute('phone_fax')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_WEBSITE' => '<a href="' . contrexx_raw2xhtml($objUser->getProfileAttribute('website')) . '" target="_blank">' . contrexx_raw2xhtml($objUser->getProfileAttribute('website')) . '</a>', $this->moduleLangVar . '_CONTACT_ATTRIBUT_MAIL' => $strUserMail, $this->moduleLangVar . '_CONTACT_ATTRIBUT_LANG' => $strUserLang));
                 }
                 $this->_objTpl->parse($this->moduleNameLC . 'ContactData');
             } else {
                 $intEntryDourationStart = 1;
                 $intEntryDourationEnd = 2;
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'ContactData');
             }
             //get display duration  data
             switch ($this->arrSettings['settingsEntryDisplaydurationValueType']) {
                 case 1:
开发者ID:Niggu,项目名称:cloudrexx,代码行数:67,代码来源:MediaDirectoryManager.class.php

示例2: edit


//.........这里部分代码省略.........
     $payment_id = empty($_POST['payment_id']) ? 0 : intval($_POST['payment_id']);
     $start_time = empty($_POST['start_date']) ? 0 : strtotime(contrexx_input2raw($_POST['start_date']));
     $end_time = empty($_POST['end_date_unlimited']) ? empty($_POST['end_date']) ? 0 : strtotime(contrexx_input2raw($_POST['end_date'])) : 0;
     $coupon_type = empty($_POST['coupon_type']) ? null : contrexx_input2raw($_POST['coupon_type']);
     $discount_rate = intval(empty($_POST['discount_rate']) ? 0 : floatval($_POST['discount_rate']));
     $discount_amount = Currency::formatPrice(empty($_POST['discount_amount']) ? 0 : floatval($_POST['discount_amount']));
     if ($coupon_type == 'rate') {
         $discount_amount = 0;
     }
     if ($coupon_type == 'amount') {
         $discount_rate = 0;
     }
     $minimum_amount = Currency::formatPrice(empty($_POST['minimum_amount']) ? 0 : floatval($_POST['minimum_amount']));
     $uses = empty($_POST['unlimited']) ? empty($_POST['uses']) ? 1 : intval($_POST['uses']) : self::USES_UNLIMITED;
     $customer_id = empty($_POST['customer_id']) ? 0 : intval($_POST['customer_id']);
     $product_id = empty($_POST['product_id']) ? 0 : intval($_POST['product_id']);
     $global = !empty($_POST['global_or_customer']);
     //DBG::log("code $code, start_time $start_time, end_time $end_time, minimum amount $minimum_amount, discount_rate $discount_rate, discount_amount $discount_amount, uses $uses, customer_id $customer_id");
     if (isset($code)) {
         $result &= self::storeCode($code, $payment_id, $minimum_amount, $discount_rate, $discount_amount, $start_time, $end_time, $uses, $global, $customer_id, $product_id, $edit);
         if ($result) {
             $code = $edit = null;
         } else {
             if (empty($edit)) {
                 $edit = "{$code}-{$customer_id}";
             }
         }
     }
     // Reset the end time if it's in the past
     if ($end_time < time()) {
         $end_time = 0;
     }
     $uri = \Html::getRelativeUri();
     \Html::stripUriParam($uri, 'view');
     \Html::stripUriParam($uri, 'edit');
     \Html::stripUriParam($uri, 'order_coupon');
     $arrSortingFields = array('code' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODE'], 'start_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_START_TIME'], 'end_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME'], 'minimum_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'discount_rate' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_RATE'], 'discount_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'uses' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES'], 'global' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_SCOPE'], 'customer_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CUSTOMER'], 'product_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT'], 'payment_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT']);
     $objSorting = new \Sorting($uri, $arrSortingFields, true, 'order_coupon');
     $objTemplate->setGlobalVariable($_ARRAYLANG + array('TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_ADD_OR_EDIT' => $_ARRAYLANG[$edit ? 'TXT_SHOP_DISCOUNT_COUPON_EDIT' : 'TXT_SHOP_DISCOUNT_COUPON_ADD'], 'SHOP_DISCOUNT_COUPON_VIEW_ACTIVE' => $edit ? '' : 'active', 'SHOP_DISCOUNT_COUPON_EDIT_ACTIVE' => $edit ? 'active' : '', 'SHOP_DISCOUNT_COUPON_VIEW_DISPLAY' => $edit ? 'none' : 'block', 'SHOP_DISCOUNT_COUPON_EDIT_DISPLAY' => $edit ? 'block' : 'none', 'HEADER_SHOP_DISCOUNT_COUPON_CODE' => $objSorting->getHeaderForField('code'), 'HEADER_SHOP_DISCOUNT_COUPON_START_TIME' => $objSorting->getHeaderForField('start_time'), 'HEADER_SHOP_DISCOUNT_COUPON_END_TIME' => $objSorting->getHeaderForField('end_time'), 'HEADER_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('minimum_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_RATE' => $objSorting->getHeaderForField('discount_rate'), 'HEADER_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('discount_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_USES' => $objSorting->getHeaderForField('uses'), 'HEADER_SHOP_DISCOUNT_COUPON_SCOPE' => $objSorting->getHeaderForField('global'), 'HEADER_SHOP_DISCOUNT_COUPON_CUSTOMER' => $objSorting->getHeaderForField('customer_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PRODUCT' => $objSorting->getHeaderForField('product_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PAYMENT' => $objSorting->getHeaderForField('payment_id')));
     $count = 0;
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_coupon_per_page_backend', 'Shop');
     if (empty($limit)) {
         self::errorHandler();
     }
     $arrCoupons = self::getArray(\Paging::getPosition(), $limit, $count, $objSorting->getOrder());
     $arrProductName = Products::getNameArray(true, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_FORMAT']);
     $arrPaymentName = Payment::getNameArray();
     $i = 0;
     $row = 0;
     $objCouponEdit = new Coupon();
     $objCouponEdit->code($code);
     $objCouponEdit->payment_id($payment_id);
     $objCouponEdit->minimum_amount($minimum_amount);
     $objCouponEdit->discount_rate($discount_rate);
     $objCouponEdit->discount_amount($discount_amount);
     $objCouponEdit->start_time($start_time);
     $objCouponEdit->end_time($end_time);
     $objCouponEdit->uses($uses);
     $objCouponEdit->is_global($global);
     $objCouponEdit->customer_id($customer_id);
     $objCouponEdit->product_id($product_id);
     global $_CONFIG;
     foreach ($arrCoupons as $index => $objCoupon) {
         $coupon_uri_id = 'coupon_uri_' . $index;
         $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$row % 2 + 1), 'SHOP_DISCOUNT_COUPON_CODE' => $objCoupon->code, 'SHOP_DISCOUNT_COUPON_URI_ICON' => '<div class="icon_url"' . '>&nbsp;</div>', 'SHOP_DISCOUNT_COUPON_URI_INPUT' => '<div class="layer_url" id="' . $coupon_uri_id . '">' . \Html::getInputText('dummy', 'http://' . $_CONFIG['domainUrl'] . \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Shop' . MODULE_INDEX . '&coupon_code=' . $objCoupon->code, false, 'readonly="readonly"' . ' style="width: 200px;"' . ' onfocus="this.select();"' . ' onblur="cx.jQuery(\'#' . $coupon_uri_id . '\').hide();"') . '</div>', 'SHOP_DISCOUNT_COUPON_START_TIME' => $objCoupon->start_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->start_time) : $_ARRAYLANG['TXT_SHOP_DATE_NONE'], 'SHOP_DISCOUNT_COUPON_END_TIME' => $objCoupon->end_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->end_time) : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME_UNLIMITED'], 'SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT' => $objCoupon->minimum_amount > 0 ? $objCoupon->minimum_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_RATE' => $objCoupon->discount_rate > 0 ? $objCoupon->discount_rate : $_ARRAYLANG['TXT_SHOP_RATE_NONE'], 'SHOP_DISCOUNT_COUPON_AMOUNT' => $objCoupon->discount_amount > 0 ? $objCoupon->discount_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_USES' => sprintf($_ARRAYLANG['TXT_SHOP_COUPON_USES_FORMAT'], $objCoupon->used, $objCoupon->uses < 1000000000.0 ? $objCoupon->uses : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES_UNLIMITED']), 'SHOP_DISCOUNT_COUPON_SCOPE' => $objCoupon->global ? $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_GLOBALLY'] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PER_CUSTOMER'], 'SHOP_DISCOUNT_COUPON_PER_CUSTOMER' => !$objCoupon->global ? \Html::getRadio('foo_' . ++$i, '', false, true, '', \Html::ATTRIBUTE_DISABLED) : '&nbsp;', 'SHOP_DISCOUNT_COUPON_CUSTOMER' => $objCoupon->customer_id ? Customers::getNameById($objCoupon->customer_id, '%4$s (%3$u)') : $_ARRAYLANG['TXT_SHOP_CUSTOMER_ANY'], 'SHOP_DISCOUNT_COUPON_PRODUCT' => $objCoupon->product_id ? isset($arrProductName[$objCoupon->product_id]) ? $arrProductName[$objCoupon->product_id] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_INVALID'] : $_ARRAYLANG['TXT_SHOP_PRODUCT_ANY'], 'SHOP_DISCOUNT_COUPON_PAYMENT' => $objCoupon->payment_id ? sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT_FORMAT'], $objCoupon->payment_id, $arrPaymentName[$objCoupon->payment_id]) : $_ARRAYLANG['TXT_SHOP_PAYMENT_ANY'], 'SHOP_DISCOUNT_COUPON_FUNCTIONS' => \Html::getBackendFunctions(array('edit' => ADMIN_SCRIPT_PATH . '?cmd=Shop&amp;act=settings&amp;tpl=coupon&amp;edit=' . urlencode($index), 'delete' => "javascript:delete_coupon('" . urlencode($index) . "');"))));
         $objTemplate->parse('shopDiscountCouponView');
         if ($index === $edit) {
             $objCouponEdit = $objCoupon;
         }
     }
     $objTemplate->replaceBlock('shopDiscountCouponView', '', true);
     $paging = \Paging::get($uri, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODES'], $count, $limit);
     //DBG::log("Paging: $paging");
     $objTemplate->setVariable('SHOP_PAGING', $paging);
     $attribute_code = 'style="width: 230px; text-align: left;" maxlength="20"';
     $attribute_time = 'style="width: 230px; text-align: left;" maxlength="10"';
     $attribute_discount_rate = 'style="width: 230px; text-align: right;" maxlength="3"';
     $attribute_discount_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_minimum_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_uses = 'style="width: 230px; text-align: right;" maxlength="6"';
     // Superseded by the widget, see below
     //        $attribute_customer = 'style="width: 230px;"';
     $attribute_product = 'style="width: 230px;"';
     $attribute_payment = 'style="width: 230px;"';
     $type = $objCouponEdit->discount_rate > 0 ? 'rate' : 'amount';
     $customer_name = '';
     //reset the add view
     if (!$edit) {
         $objCouponEdit = new Coupon();
     }
     if ($objCouponEdit->customer_id) {
         $customer_name = Customers::getNameById($objCouponEdit->customer_id, '%4$s (%3$u)');
         //DBG::log("Customer ID ".$objCouponEdit->customer_id.": name $customer_name");
     }
     $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$row % 2 + 1), 'SHOP_DISCOUNT_COUPON_INDEX' => $objCouponEdit->getIndex(), 'SHOP_DISCOUNT_COUPON_CODE' => \Html::getInputText('code', $objCouponEdit->code, '', $attribute_code), 'SHOP_DISCOUNT_COUPON_CODE_CREATE' => \Html::getInputButton('code_create', $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODE_NEW'], 'button', false, 'onclick="cx.jQuery(\'#code\').val(\'' . Coupon::getNewCode() . '\');' . 'cx.jQuery(this).css(\'display\', \'none\');"'), 'SHOP_DISCOUNT_COUPON_START_TIME' => \Html::getDatepicker('start_date', array('defaultDate' => date(ASCMS_DATE_FORMAT_DATE, $objCouponEdit->start_time ? $objCouponEdit->start_time : time())), $attribute_time), 'SHOP_DISCOUNT_COUPON_END_TIME' => \Html::getDatepicker('end_date', array('defaultDate' => $objCouponEdit->end_time ? date(ASCMS_DATE_FORMAT_DATE, $objCouponEdit->end_time) : ''), $attribute_time), 'SHOP_DISCOUNT_COUPON_END_TIME_UNLIMITED' => \Html::getCheckbox('end_time_unlimited', 1, '', $objCouponEdit->end_time ? '' : \Html::ATTRIBUTE_CHECKED) . \Html::getLabel('end_time_unlimited', $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME_UNLIMITED']), 'SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT' => \Html::getInputText('minimum_amount', $objCouponEdit->minimum_amount, false, $attribute_minimum_amount), 'SHOP_DISCOUNT_COUPON_TYPE' => \Html::getRadioGroup('coupon_type', array('rate' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_TYPE_RATE'], 'amount' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_TYPE_AMOUNT']), $type), 'SHOP_DISCOUNT_COUPON_TYPE_SELECTED' => $type, 'SHOP_DISCOUNT_COUPON_RATE' => \Html::getInputText('discount_rate', $objCouponEdit->discount_rate, false, $attribute_discount_rate), 'SHOP_DISCOUNT_COUPON_AMOUNT' => \Html::getInputText('discount_amount', number_format($objCouponEdit->discount_amount, 2, '.', ''), false, $attribute_discount_amount), 'SHOP_DISCOUNT_COUPON_USES' => \Html::getInputText('uses', $objCouponEdit->uses < 1000000000.0 ? $objCouponEdit->uses : '', 'uses', $attribute_uses), 'SHOP_DISCOUNT_COUPON_USES_UNLIMITED' => \Html::getCheckbox('unlimited', 1, 'unlimited', $objCouponEdit->uses > 1000000000.0) . \Html::getLabel('unlimited', $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES_UNLIMITED']), 'SHOP_DISCOUNT_COUPON_GLOBALLY' => \Html::getRadio('global_or_customer', '1', 'global', $objCouponEdit->global) . \Html::getLabel('global', $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_GLOBALLY']), 'SHOP_DISCOUNT_COUPON_PER_CUSTOMER' => \Html::getRadio('global_or_customer', '0', 'customer', !$objCouponEdit->global) . \Html::getLabel('customer', $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PER_CUSTOMER']), 'SHOP_DISCOUNT_COUPON_CUSTOMER_ID' => $objCouponEdit->customer_id, 'SHOP_DISCOUNT_COUPON_CUSTOMER_NAME' => $customer_name, 'SHOP_DISCOUNT_COUPON_PRODUCT' => \Html::getSelect('product_id', array(0 => $_ARRAYLANG['TXT_SHOP_PRODUCT_ANY']) + $arrProductName, $objCouponEdit->product_id, false, '', $attribute_product), 'SHOP_DISCOUNT_COUPON_PAYMENT' => \Html::getSelect('payment_id', array(0 => $_ARRAYLANG['TXT_SHOP_PAYMENT_ANY']) + $arrPaymentName, $objCouponEdit->payment_id, false, '', $attribute_payment), 'SHOP_DISCOUNT_COUPON_CUSTOMER_WIDGET_DISPLAY' => $objCouponEdit->global ? \Html::CSS_DISPLAY_NONE : \Html::CSS_DISPLAY_INLINE));
     $objTemplate->parse('shopDiscountCouponEdit');
     // Depends on, and thus implies loading jQuery as well!
     \FWUser::getUserLiveSearch(array('minLength' => 3, 'canCancel' => true, 'canClear' => true));
     return $result;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Coupon.class.php

示例3: edit

 /**
  * Edit the news, or if $copy is true, it copies an entry
  *
  * @global    ADONewConnection
  * @global    array
  * @global    array
  * @param     string     $pageContent
  */
 function edit($copy = false)
 {
     global $objDatabase, $_ARRAYLANG, $_CONFIG;
     \JS::activate('cx');
     if (!empty($this->arrSettings['news_use_tags'])) {
         \JS::registerJS('lib/javascript/tag-it/js/tag-it.min.js');
         \JS::registerCss('lib/javascript/tag-it/css/tag-it.css');
     }
     $newsTagId = 'newsTags';
     \FWUser::getUserLiveSearch();
     if (!$this->hasCategories()) {
         return $this->manageCategories();
     }
     $objFWUser = \FWUser::getFWUserObject();
     $status = '';
     $this->_objTpl->loadTemplateFile('module_news_modify.html', true, true);
     $this->pageTitle = $copy ? $_ARRAYLANG['TXT_CREATE_NEWS'] : $_ARRAYLANG['TXT_EDIT_NEWS_CONTENT'];
     $catrow = 'row2';
     if ($this->arrSettings['news_use_types'] == 1) {
         $catrow = 'row1';
     }
     $this->_objTpl->setGlobalVariable(array('TXT_CATEGORY_SELECT' => $_ARRAYLANG['TXT_CATEGORY_SELECT'], 'TXT_COPY' => $_ARRAYLANG['TXT_NEWS_COPY'], 'TXT_NEWS_MESSAGE' => $_ARRAYLANG['TXT_NEWS_MESSAGE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_CATEGORY' => $_ARRAYLANG['TXT_CATEGORY'], 'TXT_NEWS_AUTHOR' => $_ARRAYLANG['TXT_NEWS_AUTHOR'], 'TXT_NEWS_PUBLISHER' => $_ARRAYLANG['TXT_NEWS_PUBLISHER'], 'TXT_CORE_SEARCH_USER' => $_ARRAYLANG['TXT_CORE_SEARCH_USER'], 'NEWS_FORM_CAT_ROW' => $catrow, 'TXT_NEWS_TYPE' => $_ARRAYLANG['TXT_NEWS_TYPE'], 'TXT_EXTERNAL_SOURCE' => $_ARRAYLANG['TXT_EXTERNAL_SOURCE'], 'TXT_LINK' => $_ARRAYLANG['TXT_LINK'], 'TXT_NEWS_NEWS_CONTENT' => $_ARRAYLANG['TXT_NEWS_NEWS_CONTENT'], 'TXT_PUBLISHING' => $_ARRAYLANG['TXT_PUBLISHING'], 'TXT_STARTDATE' => $_ARRAYLANG['TXT_STARTDATE'], 'TXT_ENDDATE' => $_ARRAYLANG['TXT_ENDDATE'], 'TXT_OPTIONAL' => $_ARRAYLANG['TXT_OPTIONAL'], 'TXT_ACTIVE' => $_ARRAYLANG['TXT_ACTIVE'], 'TXT_SCHEDULED_PUBLICATION' => $_ARRAYLANG['TXT_SCHEDULED_PUBLICATION'], 'TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_HEADLINES' => $_ARRAYLANG['TXT_HEADLINES'], 'TXT_TOPNEWS' => $_ARRAYLANG['TXT_TOPNEWS'], 'TXT_TEASERS' => $_ARRAYLANG['TXT_TEASERS'], 'TXT_NEWS_TEASER_TEXT' => $_ARRAYLANG['TXT_NEWS_TEASER_TEXT'], 'TXT_IMAGE' => $_ARRAYLANG['TXT_IMAGE'], 'TXT_NEWS_THUMBNAIL' => $_ARRAYLANG['TXT_NEWS_THUMBNAIL'], 'TXT_BROWSE' => $_ARRAYLANG['TXT_BROWSE'], 'TXT_NUMBER_OF_CHARS' => $_ARRAYLANG['TXT_NUMBER_OF_CHARS'], 'TXT_TEASER_SHOW_NEWS_LINK' => $_ARRAYLANG['TXT_TEASER_SHOW_NEWS_LINK'], 'TXT_NEWS_DEFINE_LINK_ALT_TEXT' => $_ARRAYLANG['TXT_NEWS_DEFINE_LINK_ALT_TEXT'], 'TXT_NEWS_INSERT_LINK' => $_ARRAYLANG['TXT_NEWS_INSERT_LINK'], 'TXT_NEWS_REDIRECT_TITLE' => $_ARRAYLANG['TXT_NEWS_REDIRECT_TITLE'], 'TXT_NEWS_MESSAGE_TYPE' => $_ARRAYLANG['TXT_NEWS_MESSAGE_TYPE'], 'TXT_NEWS_TYPE_REDIRECT' => $_ARRAYLANG['TXT_NEWS_REDIRECT_TITLE'], 'TXT_NEWS_TYPE_REDIRECT_HELP' => $_ARRAYLANG['TXT_NEWS_TYPE_REDIRECT_HELP'], 'TXT_NEWS_TYPE_DEFAULT' => $_ARRAYLANG['TXT_NEWS_TYPE_DEFAULT'], 'TXT_NEWS_BASIC_DATA' => $_ARRAYLANG['TXT_BASIC_DATA'], 'TXT_NEWS_MORE_OPTIONS' => $_ARRAYLANG['TXT_MORE_OPTIONS'], 'TXT_NEWS_PERMISSIONS' => $_ARRAYLANG['TXT_NEWS_PERMISSIONS'], 'TXT_NEWS_READ_ACCESS' => $_ARRAYLANG['TXT_NEWS_READ_ACCESS'], 'TXT_NEWS_MODIFY_ACCESS' => $_ARRAYLANG['TXT_NEWS_MODIFY_ACCESS'], 'TXT_NEWS_AVAILABLE_USER_GROUPS' => $_ARRAYLANG['TXT_NEWS_AVAILABLE_USER_GROUPS'], 'TXT_NEWS_ASSIGNED_USER_GROUPS' => $_ARRAYLANG['TXT_NEWS_ASSIGNED_USER_GROUPS'], 'TXT_NEWS_CHECK_ALL' => $_ARRAYLANG['TXT_NEWS_CHECK_ALL'], 'TXT_NEWS_UNCHECK_ALL' => $_ARRAYLANG['TXT_NEWS_UNCHECK_ALL'], 'TXT_NEWS_READ_ALL_ACCESS_DESC' => $_ARRAYLANG['TXT_NEWS_READ_ALL_ACCESS_DESC'], 'TXT_NEWS_RELATED_NEWS' => $_ARRAYLANG['TXT_NEWS_RELATED_NEWS'], 'TXT_NEWS_INCLUDE_NEWS' => $_ARRAYLANG['TXT_NEWS_INCLUDE_NEWS'], 'TXT_NEWS_INCLUDE_RELATED_NEWS_DESC' => $_ARRAYLANG['TXT_NEWS_INCLUDE_RELATED_NEWS_DESC'], 'TXT_NEWS_SEARCH_INFO' => $_ARRAYLANG['TXT_NEWS_SEARCH_INFO'], 'TXT_NEWS_SEARCH_PLACEHOLDER' => $_ARRAYLANG['TXT_NEWS_SEARCH_PLACEHOLDER'], 'TXT_NEWS_READ_SELECTED_ACCESS_DESC' => $_ARRAYLANG['TXT_NEWS_READ_SELECTED_ACCESS_DESC'], 'TXT_NEWS_AVAILABLE_USER_GROUPS' => $_ARRAYLANG['TXT_NEWS_AVAILABLE_USER_GROUPS'], 'TXT_NEWS_ASSIGNED_USER_GROUPS' => $_ARRAYLANG['TXT_NEWS_ASSIGNED_USER_GROUPS'], 'TXT_NEWS_MODIFY_ALL_ACCESS_DESC' => $_ARRAYLANG['TXT_NEWS_MODIFY_ALL_ACCESS_DESC'], 'TXT_NEWS_MODIFY_SELECTED_ACCESS_DESC' => $_ARRAYLANG['TXT_NEWS_MODIFY_SELECTED_ACCESS_DESC'], 'TXT_NEWS_TAGS' => $_ARRAYLANG['TXT_NEWS_TAGS'], 'TXT_NEWS_TAGS_ENABLE' => $_ARRAYLANG['TXT_NEWS_TAGS_ENABLE'], 'NEWS_TAG_ID' => $newsTagId));
     $newsid = intval($_REQUEST['newsId']);
     $objResult = $objDatabase->SelectLimit("SELECT  typeid,\n                                                        date,\n                                                        id,\n                                                        redirect,\n                                                        source,\n                                                        url1,\n                                                        url2,\n                                                        publisher,\n                                                        publisher_id,\n                                                        author,\n                                                        author_id,\n                                                        startdate,\n                                                        enddate,\n                                                        status,\n                                                        userid,\n                                                        frontend_access_id,\n                                                        backend_access_id,\n                                                        teaser_only,\n                                                        teaser_show_link,\n                                                        teaser_image_path,\n                                                        teaser_image_thumbnail_path,\n                                                        allow_comments,\n                                                        enable_related_news,\n                                                        enable_tags\n                                                FROM    " . DBPREFIX . "module_news\n                                                WHERE   id = '" . $newsid . "'", 1);
     if ($objResult !== false && !$objResult->EOF && ($this->arrSettings['news_message_protection'] != '1' || \Permission::hasAllAccess() || !$objResult->fields['backend_access_id'] || \Permission::checkAccess($objResult->fields['backend_access_id'], 'dynamic', true) || $objResult->fields['userid'] == $objFWUser->objUser->getId())) {
         $newsType = $objResult->fields['typeid'];
         $id = $objResult->fields['id'];
         $arrLanguages = \FWLanguage::getLanguageArray();
         $langData = $this->getLangData($id);
         $newsComment = $objResult->fields['allow_comments'];
         $newsAuthorName = $objResult->fields['author'];
         $newsAuthorId = $objResult->fields['author_id'];
         $newsPublisherName = $objResult->fields['publisher'];
         $newsPublisherId = $objResult->fields['publisher_id'];
         if ($newsPublisherId != 0 && ($objUser = $objFWUser->objUser->getUser($newsPublisherId))) {
             $newsPublisherName = \FWUser::getParsedUserTitle($objUser);
         } else {
             $newsPublisherId = 0;
         }
         if ($newsAuthorId != 0 && ($objUser = $objFWUser->objUser->getUser($newsAuthorId))) {
             $newsAuthorName = \FWUser::getParsedUserTitle($objUser);
         } else {
             $newsAuthorId = 0;
         }
         $active_lang = array();
         $activeLanguage = null;
         if (isset($_GET['langId']) && in_array($_GET['langId'], \FWLanguage::getIdArray())) {
             if (!in_array($_GET['langId'], $active_lang)) {
                 $active_lang[] = contrexx_input2raw($_GET['langId']);
             }
             $activeLanguage = contrexx_input2raw($_GET['langId']);
         }
         if (count($arrLanguages) > 0) {
             $intLanguageCounter = 0;
             $arrActiveLang = array(0 => '', 1 => '', 2 => '');
             $strJsTabToDiv = '';
             $query = "SELECT `lang_id` FROM `" . DBPREFIX . "module_news_locale`\n                                WHERE `news_id` = " . $newsid . "\n                                AND `is_active` = '1'";
             $activeLangResult = $objDatabase->Execute($query);
             while (!$activeLangResult->EOF) {
                 $active_lang[] = $activeLangResult->fields['lang_id'];
                 $activeLangResult->MoveNext();
             }
             if (isset($_POST['newsManagerLanguages'])) {
                 $active_lang = array_keys($_POST['newsManagerLanguages']);
             }
             foreach ($arrLanguages as $intId => $arrLanguage) {
                 if ($arrLanguage['frontend'] == 1) {
                     $intLanguageId = $arrLanguage['id'];
                     $arrActiveLang[$intLanguageCounter % 3] .= '<input id="languagebar_' . $intLanguageId . '" class="langCheckboxes" ' . (in_array($intLanguageId, $active_lang) ? 'checked="checked"' : '') . ' type="checkbox" name="newsManagerLanguages[' . $intLanguageId . ']" value="1" onclick="switchBoxAndTab(this, \'news_lang_tab_' . $intLanguageId . '\');" /><label for="languagebar_' . $intLanguageId . '">' . $arrLanguage['name'] . ' [' . $arrLanguage['lang'] . ']</label><br />';
                     ++$intLanguageCounter;
                 }
             }
             $this->_objTpl->setVariable(array('TXT_LANGUAGE' => $_ARRAYLANG['TXT_LANGUAGE'], 'EDIT_LANGUAGES_1' => $arrActiveLang[0], 'EDIT_LANGUAGES_2' => $arrActiveLang[1], 'EDIT_LANGUAGES_3' => $arrActiveLang[2]));
         }
         $first = true;
         if (!$activeLanguage) {
             $activeLanguage = current($active_lang);
         }
         foreach ($arrLanguages as $langId => $arrLanguage) {
             if ($arrLanguage['frontend'] == 1) {
                 $isActive = isset($langData[$langId]) && $langData[$langId]['active'] == 1;
                 $display = $langId == $activeLanguage;
                 // parse tabs
                 $this->_objTpl->setVariable(array('NEWS_LANG_ID' => $langId, 'NEWS_LANG_DISPLAY_STATUS' => $display ? 'active' : 'inactive', 'NEWS_LANG_DISPLAY_STYLE' => in_array($arrLanguage['id'], $active_lang) ? 'inline' : 'none', 'NEWS_LANG_NAME' => contrexx_raw2xhtml($arrLanguage['name'])));
                 $this->_objTpl->parse('news_lang_list');
                 // parse title
                 $title = isset($_POST['newsTitle'][$langId]) ? contrexx_input2raw($_POST['newsTitle'][$langId]) : '';
                 if (empty($title)) {
                     $title = isset($langData[$langId]['title']) ? $langData[$langId]['title'] : '';
                 }
                 $this->_objTpl->setVariable(array('NEWS_LANG_ID' => $langId, 'NEWS_TITLE' => contrexx_raw2xhtml($title), 'NEWS_TITLE_DISPLAY' => $display ? 'block' : 'none'));
                 $this->_objTpl->parse('news_title_list');
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:NewsManager.class.php

示例4: showOrders

 public function showOrders()
 {
     global $_ARRAYLANG;
     $term = isset($_GET['filter-term']) ? contrexx_input2raw($_GET['filter-term']) : '';
     $filterUserId = isset($_GET['filter-user-id']) ? contrexx_input2raw($_GET['filter-user-id']) : 0;
     $objFilterUser = null;
     if (!empty($term) || !empty($filterUserId)) {
         if ($filterUserId) {
             $objFilterUser = \FWUser::getFWUserObject()->objUser->getUser($filterUserId);
         }
         $orders = $this->orderRepository->findOrdersBySearchTerm($term, $objFilterUser);
     } else {
         $orders = $this->orderRepository->getAllByDesc();
     }
     $view = new \Cx\Core\Html\Controller\ViewGenerator($orders, array('header' => $_ARRAYLANG['TXT_MODULE_ORDER_ACT_DEFAULT'], 'functions' => array('add' => true, 'edit' => true, 'delete' => true, 'sorting' => true, 'paging' => true, 'filtering' => false), 'fields' => array('contactId' => array('header' => 'contactId', 'table' => array('parse' => function ($value) {
         global $_ARRAYLANG;
         $userId = \Cx\Modules\Crm\Controller\CrmLibrary::getUserIdByCrmUserId($value);
         $userName = \FWUser::getParsedUserTitle($userId);
         $crmDetailLink = "<a href='index.php?cmd=Crm&amp;act=customers&amp;tpl=showcustdetail&amp;id={$value}' \n                                                    title='{$_ARRAYLANG['TXT_MODULE_ORDER_CRM_CONTACT']}'>\n                                                    <img \n                                                        src='" . \Env::get('cx')->getCodeBaseCoreWebPath() . "/Core/View/Media/navigation_level_1_189.png' \n                                                        width='16' height='16' \n                                                        alt='{$_ARRAYLANG['TXT_MODULE_ORDER_CRM_CONTACT']}'\n                                                    />\n                                                </a>";
         $url = "<a href='index.php?cmd=Access&amp;act=user&amp;tpl=modify&amp;id={$userId}'\n                                       title='{$_ARRAYLANG['TXT_MODULE_ORDER_MODIY_USER_ACCOUNT']}'>" . $userName . "</a>" . $crmDetailLink;
         return $url;
     })), 'subscriptions' => array('header' => 'subscriptions', 'table' => array('parse' => function ($subscriptions) {
         $result = array();
         foreach ($subscriptions as $subscription) {
             $productEntity = $subscription->getProductEntity();
             $productEntityName = $subscription->getProduct()->getName();
             if (!$productEntity) {
                 continue;
             }
             $productEditLink = $productEntity;
             if (method_exists($productEntity, 'getEditLink')) {
                 $productEditLink = $productEntity->getEditLink();
             }
             $subscriptionEditUrl = '<a href=​index.php?cmd=Order&act=subscription&editid=' . $subscription->getId() . '>' . $productEntityName . '</a>';
             $result[] = $subscriptionEditUrl . ' (' . $productEditLink . ')';
         }
         return implode(', ', $result);
     })))));
     if (isset($_GET['editid']) && !empty($_GET['editid']) || isset($_GET['add']) && !empty($_GET['add'])) {
         $this->template->hideBlock("order_filter");
     } else {
         \FWUser::getUserLiveSearch(array('minLength' => 1, 'canCancel' => true, 'canClear' => true));
         $this->template->setVariable(array('TXT_MODULE_ORDER_SEARCH' => $_ARRAYLANG['TXT_MODULE_ORDER_SEARCH'], 'TXT_MODULE_ORDER_FILTER' => $_ARRAYLANG['TXT_MODULE_ORDER_FILTER'], 'TXT_MODULE_ORDER_SEARCH_TERM' => $_ARRAYLANG['TXT_MODULE_ORDER_SEARCH_TERM'], 'ORDER_SEARCH_VALUE' => isset($_GET['filter-term']) ? contrexx_input2xhtml($_GET['filter-term']) : '', 'ORDER_USER_ID' => contrexx_raw2xhtml($filterUserId), 'ORDER_USER_NAME' => $objFilterUser ? contrexx_raw2xhtml(\FWUser::getParsedUserTitle($objFilterUser)) : ''));
     }
     $this->template->setVariable('ORDERS_CONTENT', $view->render());
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:46,代码来源:DefaultController.class.php

示例5: _modifyContact

 /**
  * add or edit contact
  *
  * @global array $_ARRAYLANG
  * @global object $objDatabase
  * @return true
  */
 function _modifyContact()
 {
     global $_ARRAYLANG, $objDatabase, $objJs, $objResult, $_LANGID, $_CORELANG;
     \JS::activate('cx');
     \JS::activate("jquery");
     \JS::activate("jqueryui");
     $objFWUser = \FWUser::getFWUserObject();
     \FWUser::getUserLiveSearch(array('minLength' => 3, 'canCancel' => true, 'canClear' => true));
     \JS::registerJS("modules/Crm/View/Script/main.js");
     \JS::registerJS("modules/Crm/View/Script/contact.js");
     \JS::registerCSS("modules/Crm/View/Style/main.css");
     \JS::registerCSS("modules/Crm/View/Style/contact.css");
     \JS::registerCSS("lib/javascript/chosen/chosen.css");
     \JS::registerJS("lib/javascript/chosen/chosen.jquery.js");
     $cxjs = \ContrexxJavascript::getInstance();
     $cxjs->setVariable('TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT', $_ARRAYLANG['TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT'], 'modifyContact');
     $mes = isset($_REQUEST['mes']) ? base64_decode($_REQUEST['mes']) : '';
     if (!empty($mes)) {
         switch ($mes) {
             case "customerupdated":
                 $this->_strOkMessage = $_ARRAYLANG['TXT_CRM_CUSTOMER_DETAILS_UPDATED_SUCCESSFULLY'];
                 break;
             case "customeradded":
                 $this->_strOkMessage = $_ARRAYLANG['TXT_CRM_CUSTOMER_ADDED_SUCCESSFULLY'];
                 break;
             case "contactupdated":
                 $this->_strOkMessage = $_ARRAYLANG['TXT_CRM_CUSTOMER_CONTACT_UPDATED_SUCCESSFULLY'];
                 break;
             case "contactadded":
                 $this->_strOkMessage = $_ARRAYLANG['TXT_CRM_CUSTOMER_CONTACT_ADDED_SUCCESSFULLY'];
                 break;
         }
     }
     $settings = $this->getSettings();
     $_GET['type'] = isset($_GET['type']) ? $_GET['type'] : 'customer';
     $redirect = isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : base64_decode('&act=customers');
     $this->_pageTitle = isset($_REQUEST['id']) ? $_ARRAYLANG["TXT_CRM_EDIT_" . strtoupper($_GET['type'])] : $_ARRAYLANG["TXT_CRM_ADD_" . strtoupper($_GET['type'])];
     $this->_objTpl->loadTemplateFile('module_' . $this->moduleNameLC . '_customer_modify.html');
     $this->_objTpl->setGlobalVariable("MODULE_NAME", $this->moduleName);
     $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
     $this->contact = new \Cx\Modules\Crm\Model\Entity\CrmContact();
     !empty($id) ? $this->contact->id = $id : '';
     $contactType = isset($_GET['type']) && $_GET['type'] == 'contact' ? 2 : 1;
     //person
     $this->contact->family_name = isset($_POST['family_name']) ? contrexx_input2raw($_POST['family_name']) : '';
     $this->contact->contact_role = isset($_POST['contact_role']) ? contrexx_input2raw($_POST['contact_role']) : '';
     $this->contact->contact_language = isset($_POST['contact_language']) ? (int) $_POST['contact_language'] : (empty($id) ? $_LANGID : 0);
     $this->contact->contact_customer = isset($_POST['company']) ? (int) $_POST['company'] : (isset($_GET['custId']) ? (int) $_GET['custId'] : 0);
     $this->contact->contactType = $contactType;
     $this->contact->companySize = isset($_POST['companySize']) ? contrexx_input2raw($_POST['companySize']) : 0;
     $this->contact->contact_gender = isset($_POST['contact_gender']) ? (int) $_POST['contact_gender'] : 0;
     $this->contact->emailDelivery = empty($_POST) || isset($_POST['emailDelivery']) ? 1 : 0;
     $accountUserID = isset($_POST['contactId']) ? intVal($_POST['contactId']) : 0;
     $accountUserEmail = isset($_POST['contact_email']) ? contrexx_input2raw($_POST['contact_email']) : '';
     $accountUserPassword = isset($_POST['contact_password']) ? contrexx_input2raw($_POST['contact_password']) : '';
     $sendLoginDetails = isset($_POST['send_account_notification']);
     $this->contact->account_id = 0;
     // customer
     $tpl = isset($_REQUEST['tpl']) ? contrexx_input2db($_REQUEST['tpl']) : '';
     if (isset($_GET['design']) && $_GET['design'] == 'custom') {
         $this->_objTpl->setVariable(array('PM_REMOVE_BACKGROUND_STYLE' => $this->pmRemoveStylesAddcustomer(), 'PM_AJAX_SAVE_FROM_SHADOWBOX_JAVASCRIPT' => $objJs->pmAjaxformSubmitForShadowbox($tpl)));
     }
     $defaultTypeId = $objDatabase->getOne('SELECT `id` FROM ' . DBPREFIX . 'module_' . $this->moduleNameLC . '_customer_types WHERE `default` = 1');
     $this->contact->customerId = isset($_POST['customerId']) ? contrexx_input2raw($_POST['customerId']) : '';
     $this->contact->customerType = isset($_POST['customer_type']) ? (int) $_POST['customer_type'] : (empty($id) ? $defaultTypeId : '');
     $this->contact->customerName = isset($_POST['companyName']) ? contrexx_input2raw($_POST['companyName']) : '';
     $this->contact->addedUser = $objFWUser->objUser->getId();
     $this->contact->currency = isset($_POST['currency']) ? (int) $_POST['currency'] : '';
     $this->contact->datasource = 1;
     $customerContacts = isset($_POST['companyContacts']) ? array_map('intval', (array) $_POST['companyContacts']) : array();
     $assignedMembersShip = isset($_POST['assigned_memberships']) ? array_map('intval', (array) $_POST['assigned_memberships']) : array();
     $this->contact->notes = isset($_POST['notes']) ? contrexx_input2raw($_POST['notes']) : '';
     $this->contact->industryType = isset($_POST['industryType']) ? (int) $_POST['industryType'] : 0;
     $this->contact->user_name = isset($_POST['contact_username']) ? contrexx_input2raw($_POST['contact_username']) : '';
     if (isset($_POST['save_contact']) || isset($_POST['save_add_new_contact'])) {
         $msg = '';
         switch (true) {
             case $contactType == 1 && !empty($id):
                 $msg = "customerupdated";
                 break;
             case $contactType == 2 && !empty($id):
                 $msg = "contactupdated";
                 break;
             case $contactType == 1:
                 $msg = "customeradded";
                 break;
             case $contactType == 2:
                 $msg = "contactadded";
                 break;
             default:
                 break;
         }
         $result = $this->parseContacts($_POST);
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:CrmManager.class.php

示例6: showOrders

 public function showOrders()
 {
     global $_ARRAYLANG;
     $term = isset($_GET['filter-term']) ? contrexx_input2raw($_GET['filter-term']) : '';
     $filterUserId = isset($_GET['filter-user-id']) ? contrexx_input2raw($_GET['filter-user-id']) : 0;
     $objFilterUser = null;
     if (!empty($term) || !empty($filterUserId)) {
         if ($filterUserId) {
             $objFilterUser = \FWUser::getFWUserObject()->objUser->getUser($filterUserId);
         }
         $orders = $this->orderRepository->findOrdersBySearchTerm($term, $objFilterUser);
     } else {
         $orders = $this->orderRepository->getAllByDesc();
     }
     $orders = new \Cx\Core_Modules\Listing\Model\Entity\DataSet($orders);
     // setDataType is used to make the ViewGenerator load the proper options if $orders is empty
     $orders->setDataType('Cx\\Modules\\Order\\Model\\Entity\\Order');
     $options = $this->getController('Backend')->getAllViewGeneratorOptions();
     $view = new \Cx\Core\Html\Controller\ViewGenerator($orders, $options);
     if (isset($_GET['editid']) && !empty($_GET['editid']) || isset($_GET['add']) && !empty($_GET['add'])) {
         $this->template->hideBlock("order_filter");
     } else {
         \FWUser::getUserLiveSearch(array('minLength' => 1, 'canCancel' => true, 'canClear' => true));
         $this->template->setVariable(array('TXT_MODULE_ORDER_SEARCH' => $_ARRAYLANG['TXT_MODULE_ORDER_SEARCH'], 'TXT_MODULE_ORDER_FILTER' => $_ARRAYLANG['TXT_MODULE_ORDER_FILTER'], 'TXT_MODULE_ORDER_SEARCH_TERM' => $_ARRAYLANG['TXT_MODULE_ORDER_SEARCH_TERM'], 'ORDER_SEARCH_VALUE' => isset($_GET['filter-term']) ? contrexx_input2xhtml($_GET['filter-term']) : '', 'ORDER_USER_ID' => contrexx_raw2xhtml($filterUserId), 'ORDER_USER_NAME' => $objFilterUser ? contrexx_raw2xhtml(\FWUser::getParsedUserTitle($objFilterUser)) : ''));
     }
     $this->template->setVariable('ORDERS_CONTENT', $view->render());
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:27,代码来源:DefaultController.class.php


注:本文中的FWUser::getUserLiveSearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。