コード例 #1
0
		public static function getByCodeName($code) {
			$sel = new selector('objects');
			$sel->types('object-type')->name('social_networks','network');
			$sel->where('social_id')->equals($code);

			return self::get($sel->first);
		}
コード例 #2
0
 public static function getList($discountTypeId = false)
 {
     $objectTypeId = self::getRuleType()->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->id($objectTypeId);
     if ($discountTypeId) {
         $sel->where('rule_discount_types')->equals($discountTypeId);
     }
     return $sel->result();
 }
コード例 #3
0
		public function onDispatchChanges(iUmiEventPoint $oEvent) {
			$sTemplate = "default";

			try {
				list($sTemplateSubject, $sTemplateMessage) = def_module::loadTemplatesForMail("forum/mails/".$sTemplate, "mail_subject", "mail_message");
			} catch (publicException $e) {
				return false;
			}

			$iTopicId = $oEvent->getParam("topic_id");
			$iMessageId = $oEvent->getParam("message_id");
			$message = umiHierarchy::getInstance()->getElement($iMessageId);

			$sel = new selector('objects');
			$sel->types('object-type')->name("users", "user");
			$sel->where('subscribed_pages')->equals($iTopicId);
			
			if (!$sel->length()) return false;

			$hierarchy = umiHierarchy::getInstance();

			$block_arr = Array();

			$sTemplateSubject = def_module::parseTemplateForMail($sTemplateSubject, $block_arr, $iMessageId);
			
			$sFromEmail = regedit::getInstance()->getVal("//settings/email_from");
			$sFromFio = regedit::getInstance()->getVal("//settings/fio_from");

			$oMail = new umiMail();
			$oMail->setFrom($sFromEmail, $sFromFio);
			$oMail->setSubject($sTemplateSubject);

			foreach($sel->result() as $oUser) {
				$oMailUser = clone $oMail;
				$sUserMail = $oUser->getValue('e-mail');
				$block_arr['h1'] = $message->getValue('h1');
				$block_arr['message'] = $message->getValue('message');

				$hierarchy->forceAbsolutePath(true);
				$block_arr['unsubscribe_link'] = $hierarchy->getPathById($iTopicId) . "?unsubscribe=" . base64_encode($iUserId);
				$sTemplateMessageUser = def_module::parseTemplateForMail($sTemplateMessage, $block_arr, $iMessageId);
				$oMailUser->setContent($sTemplateMessageUser);
				$hierarchy->forceAbsolutePath(false);

				if (umiMail::checkEmail($sUserMail)) {
					$sUserFio = $oUser->getValue('lname') . " ". $oUser->getValue('fname') . " " . $oUser->getValue('father_name');
					$oMailUser->addRecipient($sUserMail, $sUserFio);
					$oMailUser->commit();
					$oMailUser->send();
				}
				else continue;
			}
			return true;
		}
コード例 #4
0
ファイル: vacancies.php プロジェクト: sd-studio/nz
function customContent($page, &$vars)
{
    $items = new \selector('pages');
    $items->types('hierarchy-type')->name('content', 'page');
    $items->where('hierarchy')->page($page->id)->childs(1);
    $pages = array();
    foreach ($items as $item) {
        $p = array('id' => $item->id, 'name' => $item->getName(), 'content' => $item->getValue('content'));
        $pages[] = $p;
    }
    $vars['vacancies'] = $pages;
}
コード例 #5
0
 public function search_by_size()
 {
     $pages = new selector('objects');
     $pages->types('object-type')->name('guide', 'guide');
     $pages->where('id')->equals('125');
     //$pages->limit(0,3);
     $res = '';
     foreach ($pages as $page) {
         print_r($page);
         die;
     }
     return $res;
 }
コード例 #6
0
 public function number()
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->order('number')->desc();
     $sel->limit(0, 1);
     $number = $sel->first ? $sel->first->number + 1 : 1;
     $order = $this->order;
     $order->name = getLabel('order-name-prefix', 'emarket', $number);
     $order->number = $number;
     $order->commit();
     return $number;
 }
コード例 #7
0
		public function getReleaseMessages($iReleaseId = false) {
			$iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId();
			$iMsgTypeId =  umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId);
			$oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId);

			$sel = new selector('objects');
			$sel->types('object-type')->name('dispatches', 'message');
			if($iReleaseId) {
				$sel->where('release_reference')->equals($iReleaseId);
			}
			selectorHelper::detectFilters($sel);
			return $sel->result;
		}
コード例 #8
0
 public function export($v01af57e4ae6d799566f5695b3679756b)
 {
     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
     if (is_array($v01af57e4ae6d799566f5695b3679756b) && count($v01af57e4ae6d799566f5695b3679756b)) {
         foreach ($v01af57e4ae6d799566f5695b3679756b as $ve730db5c29b7ba34f4d465b01bd33c5e) {
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page($ve730db5c29b7ba34f4d465b01bd33c5e->getId())->childs(100);
         }
     } else {
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(100);
     }
     $v6a7f245843454cf4f28ad7c5e2572aa2 = array_merge($v8be74552df93e31bbdd6b36ed74bdb6a->result, $v01af57e4ae6d799566f5695b3679756b);
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDump($v6a7f245843454cf4f28ad7c5e2572aa2);
     return $vbbd738a112791dd1d0cb6bd0d61d878f;
 }
コード例 #9
0
ファイル: gallery.php プロジェクト: sd-studio/nz
 public static function images($albumId)
 {
     $photos = new selector('pages');
     $photos->types('hierarchy-type')->name('photoalbum', 'photo');
     $photos->where('hierarchy')->page($albumId)->childs(1);
     $images = array();
     foreach ($photos as $photo) {
         $image = $photo->getObject()->getPropByName('photo')->getValue();
         if ($image) {
             $images[] = array('id' => $photo->id, 'name' => $photo->getName(), 'link' => $image->getFilePath(true));
         }
     }
     return $images;
 }
コード例 #10
0
 public static function clearPrimary($except = 0)
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'store');
     $stores = $sel->result;
     foreach ($stores as $v) {
         if ($except == $v->getId()) {
             continue;
         }
         $v->setValue('primary', 0);
         $v->commit();
     }
     return true;
 }
コード例 #11
0
 public function places()
 {
     $mode = (string) getRequest('param0');
     if ($mode == "do") {
         $this->saveEditedList("objects", array('type' => 'place'));
         $this->chooseRedirect();
     }
     $sel = new selector('objects');
     $sel->types('object-type')->name('banners', 'place');
     $this->setDataType("list");
     $this->setActionType("modify");
     $data = $this->prepareData($sel->result, "objects");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
コード例 #12
0
 public function getSystemEventRecipients()
 {
     $permissions = permissionsCollection::getInstance();
     $currentUserId = $permissions->getUserId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('users', 'user');
     $sel->where('groups')->equals(SV_GROUP_ID);
     $result = array(SV_USER_ID);
     foreach ($sel as $user) {
         if ($user->id != $currentUserId) {
             $result[] = $user->id;
         }
     }
     return $result;
 }
コード例 #13
0
 public function profile($template = "default", $user_id = false)
 {
     if (!$template) {
         $template = "default";
     }
     list($template_block, $template_bad_user_block) = def_module::loadTemplates("users/profile/" . $template, "profile_block", "bad_user_block");
     $block_arr = array();
     if (!$user_id) {
         $user_id = (int) getRequest('param0');
     }
     if (!$user_id) {
         $permissions = permissionsCollection::getInstance();
         if ($permissions->isAuth()) {
             $user_id = $permissions->getUserId();
         }
     }
     if ($user = selector::get('object')->id($user_id)) {
         $this->validateEntityByTypes($user, array('module' => 'users', 'method' => 'user'));
         $block_arr['xlink:href'] = "uobject://" . $user_id;
         $userTypeId = $user->getTypeId();
         if ($userType = umiObjectTypesCollection::getInstance()->getType($userTypeId)) {
             $userHierarchyTypeId = $userType->getHierarchyTypeId();
             if ($userHierarchyType = umiHierarchyTypesCollection::getInstance()->getType($userHierarchyTypeId)) {
                 if ($userHierarchyType->getName() == "users" && $userHierarchyType->getExt() == "user") {
                     $block_arr['id'] = $user_id;
                     return def_module::parseTemplate($template_block, $block_arr, false, $user_id);
                 }
             }
         }
     } else {
         throw new publicException(getLabel('error-object-does-not-exist', null, $user_id));
     }
     return def_module::parseTemplate($template_bad_user_block, $block_arr);
 }
コード例 #14
0
 protected function getCustomerOrders()
 {
     static $customerOrders = null;
     if (!is_null($customerOrders)) {
         return $customerOrders;
     }
     $customer = customer::get();
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals($customer->id);
     $sel->where('domain_id')->equals($domainId);
     $sel->where('status_id')->equals(order::getStatusByCode('ready'));
     return $customerOrders = $sel->result;
 }
コード例 #15
0
 public function orders()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = (int) getRequest('p');
     $offset = $limit * $curr_page;
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('status_id')->isNull(false);
     $sel->where('name')->notequals('dummy');
     $sel->limit($offset, $limit);
     if (!getRequest('order_filter')) {
         $sel->order('order_date')->desc();
     }
     selectorHelper::detectFilters($sel);
     $domains = getRequest('domain_id');
     if (is_array($domains) && sizeof($domains)) {
         $domainsCollection = domainsCollection::getInstance();
         if (sizeof($domainsCollection->getList()) > 1) {
             $sel->where('domain_id')->equals($domains[0]);
         }
     }
     $this->setDataRange($limit, $offset);
     $data = $this->prepareData($sel->result, "objects");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
コード例 #16
0
 /**
  * Функция рисует список заказов пользователя
  * @param string $template Название шаблона
  * @return mixed Список заказов пользователя
  */
 public function show_user_orders($template = 'default')
 {
     list($tpl_block, $tpl_block_empty, $tpl_item, $tpl_order_item) = def_module::loadTemplates("emarket/" . $template, 'orders_block', 'orders_block_empty', 'orders_item', 'orders_order_item');
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals(customer::get()->id);
     $sel->where('name')->isNull(false);
     $sel->where('domain_id')->equals($domainId);
     if ($sel->length == 0) {
         $tpl_block = $tpl_block_empty;
     }
     $items_arr = array();
     foreach ($sel->result as $selOrder) {
         $order = order::get($selOrder->id);
         $item_arr['attribute:id'] = $order->id;
         $item_arr['attribute:name'] = $order->name;
         $item_arr['attribute:type-id'] = $order->typeId;
         $item_arr['attribute:guid'] = $order->GUID;
         $item_arr['attribute:type-guid'] = $order->typeGUID;
         $item_arr['attribute:ownerId'] = $order->ownerId;
         $item_arr['xlink:href'] = $order->xlink;
         $item_arr['attribute:delivery_allow_date'] = date('d.m.Y', $order->getValue('delivery_allow_date')->timestamp);
         //print_r($order->getValue('order_items'));
         //Получаем список товаров заказа
         $items = array();
         foreach ($order->getItems() as $orderItem) {
             //					print_r($order_item); die;
             $item_line = array();
             //					print_r(umiHierarchy::getInstance()->getObjectInstances($orderItem->id));
             $item_line['attribute:element_id'] = $orderItem->id;
             $item_line['attribute:name'] = $orderItem->name;
             $item_line['attribute:item_amount'] = $orderItem->getAmount();
             //					$item_line['attribute:options'] = $orderItem->getOptions();
             //						print_r($order_item->options);
             $items[] = def_module::parseTemplate($tpl_order_item, $item_line, false, $iOrderItemId);
             umiObjectsCollection::getInstance()->unloadObject($iOrderItemId);
         }
         $item_arr['subnodes:order_items'] = $items;
         $items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $order->id);
     }
     return def_module::parseTemplate($tpl_block, array('subnodes:items' => $items_arr));
 }
コード例 #17
0
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     if (!count($v92ec19ffde05e15769b1bb3ee05ad745)) {
         $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(0);
         $v92ec19ffde05e15769b1bb3ee05ad745 = $v8be74552df93e31bbdd6b36ed74bdb6a->result();
     }
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDump($v92ec19ffde05e15769b1bb3ee05ad745, "commerceML2");
     $vd0c75bac742760cf71fd76cd75d0c02a = './xsl/export/' . $this->type . '.xsl';
     if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
         throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
     }
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f);
     $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
     return $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
 }
コード例 #18
0
 public function checkAllMessages()
 {
     $service = antiSpamService::get();
     if (!$service) {
         return;
     }
     $sel = new selector('pages');
     $sel->types->name('comments', 'comment');
     $sel->types->name('forum', 'message');
     $sel->where('is_spam')->isNull();
     foreach ($sel->result() as $page) {
         $service->setNick(null);
         $service->setLink($page->link);
         $service->setContent($page->content);
         $page->is_spam = $service->isSpam() ? 2 : 1;
         $page->commit();
     }
 }
コード例 #19
0
 public function export($v01af57e4ae6d799566f5695b3679756b)
 {
     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('objects');
     $v8be74552df93e31bbdd6b36ed74bdb6a->types('object-type')->name('emarket', 'order');
     $v8be74552df93e31bbdd6b36ed74bdb6a->where('need_export')->equals(1);
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDumpObjects($v8be74552df93e31bbdd6b36ed74bdb6a->result, "CommerceML2");
     $vd0c75bac742760cf71fd76cd75d0c02a = './xsl/export/' . $this->type . '.xsl';
     if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
         throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
     }
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f);
     $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
     $result = $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
     $result = str_replace('<?xml version="1.0" encoding="utf-8"?>', '<?xml version="1.0" encoding="windows-1251"?>', $result);
     $result = iconv("UTF-8", "CP1251//IGNORE", $result);
     return $result;
 }
コード例 #20
0
 public function normalizeIn($v2063c1608d6e0baf80249c42e2be5804, $v16b2b26000987faccb260b9d39df1269 = false)
 {
     $vad5f82e879a9c5d6b5b442eb37e50551 = null;
     if (is_numeric($v2063c1608d6e0baf80249c42e2be5804)) {
         $vad5f82e879a9c5d6b5b442eb37e50551 = selector::get('domain')->id($v2063c1608d6e0baf80249c42e2be5804);
     } else {
         $vad5f82e879a9c5d6b5b442eb37e50551 = selector::get('domain')->host($v2063c1608d6e0baf80249c42e2be5804);
     }
     return $vad5f82e879a9c5d6b5b442eb37e50551 instanceof iDomain ? (int) $vad5f82e879a9c5d6b5b442eb37e50551->getId() : null;
 }
コード例 #21
0
 public function lists()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = (int) getRequest('p');
     $offset = $limit * $curr_page;
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('vote', 'poll');
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $this->setDataRange($limit, $offset);
     $data = $this->prepareData($sel->result, "pages");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
コード例 #22
0
ファイル: where.php プロジェクト: BGCX261/zimmerli-svn-to-git
 public function __call($vea9f6aca279138c58f705c8d4cb4b8ce, $args)
 {
     $vea9f6aca279138c58f705c8d4cb4b8ce = strtolower($vea9f6aca279138c58f705c8d4cb4b8ce);
     if (in_array($vea9f6aca279138c58f705c8d4cb4b8ce, $this->modes)) {
         $v2063c1608d6e0baf80249c42e2be5804 = sizeof($args) ? $args[0] : null;
         if ($v2063c1608d6e0baf80249c42e2be5804 instanceof iUmiEntinty) {
             $v2063c1608d6e0baf80249c42e2be5804 = $v2063c1608d6e0baf80249c42e2be5804->getId();
         }
         if (isset($this->fieldId)) {
             $v06e3d36fa30cea095545139854ad1fb9 = selector::get('field')->id($this->fieldId);
             if ($v6b1a57fa235477758817df3c91158006 = $v06e3d36fa30cea095545139854ad1fb9->getRestrictionId()) {
                 $v3dadfaeb46ec74762b37de11fea7605c = baseRestriction::get($v6b1a57fa235477758817df3c91158006);
                 if ($v3dadfaeb46ec74762b37de11fea7605c instanceof iNormalizeInRestriction) {
                     $v2063c1608d6e0baf80249c42e2be5804 = $v3dadfaeb46ec74762b37de11fea7605c->normalizeIn($v2063c1608d6e0baf80249c42e2be5804);
                 }
             }
             if (is_numeric($v2063c1608d6e0baf80249c42e2be5804) && substr($v2063c1608d6e0baf80249c42e2be5804, 0, 1) !== "0") {
                 $v2063c1608d6e0baf80249c42e2be5804 = (double) $v2063c1608d6e0baf80249c42e2be5804;
             }
             if ($v06e3d36fa30cea095545139854ad1fb9->getDataType() == 'relation' && is_string($v2063c1608d6e0baf80249c42e2be5804)) {
                 if ($v52eb29c6d8ea0d3a5bb3654f49bbd7c7 = $v06e3d36fa30cea095545139854ad1fb9->getGuideId()) {
                     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('objects');
                     $v8be74552df93e31bbdd6b36ed74bdb6a->types('object-type')->id($v52eb29c6d8ea0d3a5bb3654f49bbd7c7);
                     $v8be74552df93e31bbdd6b36ed74bdb6a->where('*')->ilike($v2063c1608d6e0baf80249c42e2be5804);
                     $v2fa47f7c65fec19cc163b195725e3844 = sizeof($v8be74552df93e31bbdd6b36ed74bdb6a->result);
                     if ($v2fa47f7c65fec19cc163b195725e3844 > 0 && $v2fa47f7c65fec19cc163b195725e3844 < 100) {
                         $v2063c1608d6e0baf80249c42e2be5804 = $v8be74552df93e31bbdd6b36ed74bdb6a->result;
                     }
                 }
             }
             if ($v06e3d36fa30cea095545139854ad1fb9->getDataType() == 'date' && is_string($v2063c1608d6e0baf80249c42e2be5804)) {
                 $v5fc732311905cb27e82d67f4f6511f7f = new umiDate();
                 $v5fc732311905cb27e82d67f4f6511f7f->setDateByString(trim($v2063c1608d6e0baf80249c42e2be5804, ' %'));
                 $v2063c1608d6e0baf80249c42e2be5804 = $v5fc732311905cb27e82d67f4f6511f7f->getDateTimeStamp();
             }
         }
         $this->value = $v2063c1608d6e0baf80249c42e2be5804;
         $this->mode = $vea9f6aca279138c58f705c8d4cb4b8ce;
     } else {
         throw new selectorException("This property doesn't support \"{$vea9f6aca279138c58f705c8d4cb4b8ce}\" method");
     }
 }
コード例 #23
0
 public function removeDeliveryAddress($addressId = false)
 {
     if (!$addressId) {
         $addressId = getRequest("param0");
     }
     $addressId = (int) $addressId;
     $collection = umiObjectsCollection::getInstance();
     if (!$collection->isExists($addressId)) {
         throw new publicException("Wrong address id passed");
     }
     $customer = customer::get();
     $customer->delivery_addresses = array_filter($customer->delivery_addresses, create_function("\$v", "return (\$v != {$addressId});"));
     $sel = new selector("objects");
     $sel->types("object-type")->name("emarket", "order");
     $sel->where("delivery_address")->equals($addressId);
     if (!$sel->length) {
         $collection->delObject($addressId);
     }
     $this->redirect(getServer("HTTP_REFERER"));
 }
コード例 #24
0
		private static function checkPaymentProps(iUmiObject $object) {
			if($object->payment_type_id) {
				$types = umiObjectTypesCollection::getInstance();
				$typeObject = selector::get('object')->id($object->payment_type_id);
				$typeId = $types->getTypeIdByGUID($typeObject->payment_type_guid);
				if($typeId != $object->getTypeId()) {
					$object->setTypeId($typeId);
					$object->commit();
				}
			}
		}
コード例 #25
0
 public function last_messages()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = getRequest('p');
     $offset = $curr_page * $limit;
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('forum', 'message');
     $sel->order('publish_time')->desc();
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $data = $this->prepareData($sel->result, "pages");
     $this->setData($data, $sel->length);
     $this->setDataRangeByPerPage($limit, $curr_page);
     return $this->doData();
 }
コード例 #26
0
		public function notifyOrderStatusChange(order $order, $changedProperty) {
			$order->need_export = true;
			if($changedProperty == "status_id") {
				$order->status_change_date = new umiDate();
			}
			if(order::getCodeByStatus($order->getPaymentStatus()) == "accepted" && !$order->delivery_allow_date) {
				$sel = new selector('objects');
				$sel->types('object-type')->name('emarket', 'delivery');
				if($sel->length) {
					$order->delivery_allow_date = new umiDate();
				}
			}
			$statusId = $order->getValue($changedProperty);
			$codeName = order::getCodeByStatus($statusId);
			if($changedProperty == 'status_id' && (!$statusId || $codeName == 'payment')) return;
			$this->sendCustomerNotification($order, $changedProperty, $codeName);
			if($changedProperty == 'status_id' && $codeName == 'waiting') {
				$this->sendManagerNotification($order);
			}
		}
コード例 #27
0
 public function lists()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     $this->generatePicasaButton();
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = getRequest('p');
     $offset = $curr_page * $limit;
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('photoalbum', 'album');
     $sel->types('hierarchy-type')->name('photoalbum', 'photo');
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $data = $this->prepareData($sel->result, "pages");
     $this->setData($data, $sel->length);
     $this->setDataRangeByPerPage($limit, $curr_page);
     return $this->doData();
 }
コード例 #28
0
 public function discounts()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $objectTypes = umiObjectTypesCollection::getInstance();
     $type_id = $objectTypes->getBaseType("emarket", "discount");
     $limit = getRequest('per_page_limit');
     $curr_page = (int) getRequest('p');
     $offset = $limit * $curr_page;
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'discount');
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $this->setDataRange($limit, $offset);
     $data = $this->prepareData($sel->result, "objects");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
コード例 #29
0
 public function tree()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = getRequest('p');
     $offset = $curr_page * $limit;
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('catalog', 'category');
     $sel->types('hierarchy-type')->name('catalog', 'object');
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $data = $this->prepareData($sel->result, "pages");
     //Завершаем вывод
     $this->setData($data, $sel->length);
     $this->setDataRangeByPerPage($limit, $curr_page);
     return $this->doData();
 }
コード例 #30
0
 public static final function getList($selfDeliveryOnly = false)
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'delivery');
     $regedit = regedit::getInstance();
     if ((bool) $regedit->getVal('//modules/emarket/delivery-with-address')) {
         $types = array();
         $typesSel = new selector('objects');
         $typesSel->types('object-type')->guid('emarket-deliverytype');
         $typesSel->where('class_name')->equals('self');
         foreach ($typesSel as $typeId) {
             $types[] = $typeId->id;
         }
         if ($selfDeliveryOnly) {
             $sel->where('delivery_type_id')->equals($types);
         } else {
             $sel->where('delivery_type_id')->notequals($types);
         }
     }
     return $sel->result();
 }