public function execute() { $aListingTypesInfo = SJB_ListingTypeManager::getAllListingTypesInfo(); $tp = SJB_System::getTemplateProcessor(); $tp->assign('listingTypesInfo', $aListingTypesInfo); $tp->display('form_builder.tpl'); }
public function execute() { $template_processor = SJB_System::getTemplateProcessor(); $listing_types_structure = SJB_ListingTypeManager::createTemplateStructureForListingTypes(); $template_processor->assign("listing_types", $listing_types_structure); $template_processor->display("listing_types.tpl"); }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $user = SJB_UserManager::getCurrentUser(); if ($user) { $userNotificationsManager = new SJB_UserNotificationsManager($user); $userNotificationsInfo = $userNotificationsManager->getUserNotificationsInfo(); $userNotificationsInfo = array_merge($userNotificationsInfo, $_REQUEST); $userNotifications = new SJB_UserNotifications($userNotificationsInfo); $userNotificationsForm = new SJB_Form($userNotifications); $userNotificationsForm->registerTags($tp); $userNotificationsFields = $userNotificationsForm->getFormFieldsInfo(); $tp->assign('form_fields', $userNotificationsFields); if (SJB_Request::getVar('action') === 'save') { $errors = array(); if ($userNotificationsForm->isDataValid($errors)) { $userNotifications->update(); $tp->assign('isSaved', true); } $tp->assign('errors', $errors); } $tp->assign('userNotificationGroups', $userNotificationsManager->getNotificationGroups()->getGroups()); $tp->assign('userNotifications', $userNotificationsManager->getEnabledForGroupUserNotifications()); $listingTypes = SJB_ListingTypeManager::getListingTypeByUserSID($user->getSID()); $approveSetting = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listingTypes); $tp->assign('approve_setting', $approveSetting); $tp->display('user_notifications.tpl'); } else { $tp->display('login.tpl'); } }
public function execute() { $listing_id = isset($_REQUEST['listing_id']) ? $_REQUEST['listing_id'] : null; $listing = SJB_ListingManager::getObjectBySID($listing_id); $current_user = SJB_UserManager::getCurrentUser(); $template_processor = SJB_System::getTemplateProcessor(); if (is_null($listing_id)) { $errors['PARAMETERS_MISSED'] = 1; } elseif (empty($current_user)) { $errors['NOT_LOGGED_IN'] = 1; } elseif (is_null($listing)) { $errors['WRONG_PARAMETERS_SPECIFIED'] = 1; } elseif ($listing->getUserSID() != $current_user->getSID()) { $errors['NOT_OWNER'] = 1; } else { $productInfo = $listing->getProductInfo(); $listing_info = SJB_ListingManager::getListingInfoBySID($listing_id); $listing_type_info = SJB_ListingTypeManager::getListingTypeInfoBySID($listing_info['listing_type_sid']); $waitApprove = $listing_type_info['waitApprove']; $listing_info['type'] = array('id' => $listing_type_info['id'], 'caption' => $listing_type_info['name']); $listing_info['product'] = $productInfo; $template_processor->assign("listing", $listing_info); $contract_id = $listing_info['contract_id']; $template_processor->assign("waitApprove", $waitApprove); } $template_processor->assign("errors", isset($errors) ? $errors : null); $template_processor->display("manage_listing.tpl"); }
/** * @return array */ public function getResources($type = 'all', $role = '') { $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); $resources = array('open_search_by_company_form' => array('title' => 'Open search by company form', 'group' => 'general', 'type' => 'guest')); foreach ($listingTypes as $listingType) { $typeId = strtolower($listingType['id']); $resources = array_merge($resources, array("open_{$typeId}_search_form" => array('title' => "Open {$listingType['name']} search form", 'limitable' => true, 'group' => $listingType['id'], 'type' => 'guest'), "view_{$typeId}_search_results" => array('title' => "View {$listingType['name']} search results", 'limitable' => true, 'group' => $listingType['id'], 'type' => 'guest'), "view_{$typeId}_details" => array('title' => "View {$listingType['name']} details", 'limitable' => true, 'group' => $listingType['id'], 'type' => 'guest'), "flag_{$typeId}" => array('title' => "Flag {$listingType['name']}", 'limitable' => false, 'optional' => true, 'group' => $listingType['id'], 'type' => 'guest'), "view_{$typeId}_contact_info" => array('title' => "View {$listingType['name']} Contact Info", 'limitable' => true, 'optional' => true, 'group' => $listingType['id'], 'type' => 'group'), "use_{$typeId}_alerts" => array('title' => "Use {$listingType['name']} alerts", 'group' => $listingType['id'], 'optional' => true, 'type' => 'group'))); if ($typeId == 'job') { $resources = array_merge($resources, array('apply_for_a_job' => array('title' => 'Apply for a job', 'group' => $listingType['id'], 'optional' => true, 'type' => 'guest'))); } } if ($type == 'guest') { return $resources; } $resources = array_merge($resources, array('delete_user_profile' => array('title' => 'Delete user profile', 'group' => 'general', 'optional' => true, 'type' => 'group'), 'use_private_messages' => array('title' => 'Use private messages', 'group' => 'general', 'optional' => true, 'type' => 'group'), "save_searches" => array('title' => "Save searches", 'group' => 'general', 'optional' => true, 'type' => 'group'), "use_screening_questionnaires" => array('title' => "Use Screening Questionnaires", 'group' => 'general', 'optional' => true, 'type' => 'group'), 'create_sub_accounts' => array('title' => 'Create Sub Accounts', 'group' => 'general', 'optional' => true, 'type' => 'group'))); foreach ($listingTypes as $listingType) { $typeId = strtolower($listingType['id']); $resources = array_merge($resources, array("save_{$typeId}" => array('title' => "Save {$listingType['name']}", 'group' => $listingType['id'], 'optional' => true, 'type' => 'group'), "add_{$typeId}_comments" => array('title' => "Add {$listingType['name']} comments", 'group' => $listingType['id'], 'optional' => true, 'type' => 'group'), "add_{$typeId}_ratings" => array('title' => "Add {$listingType['name']} ratings", 'group' => $listingType['id'], 'type' => 'group'))); } $resources['post_jobs_on_social_networks'] = array('title' => 'Post Jobs on Social Networks', 'group' => 'Job', 'type' => 'group'); if ($type == 'group') { return $resources; } $resources = array_merge($resources, array('add_featured_listings' . $role => array('title' => 'Add featured listings', 'group' => 'general', 'optional' => true, 'type' => 'plan'), 'add_priority_listings' . $role => array('title' => 'Add priority listings', 'group' => 'general', 'optional' => true, 'type' => 'plan'))); foreach ($listingTypes as $listingType) { $typeId = strtolower($listingType['id']); $resources = array_merge($resources, array("post_{$typeId}" => array('title' => "Post {$listingType['name']}", 'limitable' => true, 'group' => $listingType['id'], 'type' => 'plan'))); } $resources = array_merge($resources, array('bulk_job_import' . $role => array('title' => 'Bulk Job Import', 'group' => 'Job', 'optional' => true, 'type' => 'plan'), 'post_jobs_on_social_networks' . $role => array('title' => 'Post Jobs on Social Networks', 'group' => 'Job', 'type' => 'plan'))); return $resources; }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $listing_field_sid = SJB_Request::getVar('listing_sid', null); $errors = array(); $listingTypes = array(); if (!is_null($listing_field_sid)) { $listing_field = SJB_ListingFieldManager::getFieldInfoBySID($listing_field_sid); $listing_type_id = 'Job/Resume'; if ($listing_field['listing_type_sid'] != 0) { $listing_type_id = SJB_ListingTypeManager::getListingTypeIDBySID($listing_field['listing_type_sid']); array_push($listingTypes, SJB_ListingTypeManager::getListingTypeInfoBySID(SJB_Array::get($listing_field, 'listing_type_sid'))); } else { $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); } $tp->assign('listingTypesInfo', $listingTypes); $tp->assign('listing_type_id', $listing_type_id); $tp->assign('listing_sid', $listing_field_sid); $tp->assign('listing_field_info', $listing_field); $tp->assign('listing_type_sid', $listing_field['listing_type_sid']); } else { $errors[] = 'The system cannot proceed as Listing SID is not set'; } $tp->assign('errors', $errors); $tp->display('attention_listing_type_field.tpl'); }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $listing_types = SJB_ListingTypeManager::getAllListingTypesInfo(); $countListings = array(); foreach ($listing_types as $type) { $requested_data = array(); $requested_data['action'] = 'search'; $requested_data['active']['equal'] = '1'; $requested_data['listing_type']['equal'] = $type['id']; $requireApprove = SJB_ListingTypeManager::getWaitApproveSettingByListingType($type['sid']); if ($requireApprove) { $requested_data['status']['equal'] = 'approved'; } $listing = new SJB_Listing(array(), $type['sid']); $id_alias_info = $listing->addIDProperty(); $listing->addActivationDateProperty(); $username_alias_info = $listing->addUsernameProperty(); $listing_type_id_info = $listing->addListingTypeIDProperty(); $listing->addCompanyNameProperty(); if ($type['id'] == 'Resume') { $requested_data['access_type'] = array('accessible' => SJB_UserManager::getCurrentUserSID()); } $criteria = SJB_SearchFormBuilder::extractCriteriaFromRequestData($requested_data, $listing); $aliases = new SJB_PropertyAliases(); $aliases->addAlias($id_alias_info); $aliases->addAlias($username_alias_info); $aliases->addAlias($listing_type_id_info); $searcher = new SJB_ListingSearcher(); $countListings[$type['id']] = $searcher->countRowsByCriteria($criteria, $aliases); } $tp->assign('listings_types', $countListings); $tp->display('count_listings.tpl'); }
public function execute() { $listing_id = SJB_Request::getVar('listing_id', null); $tp = SJB_System::getTemplateProcessor(); if (isset($_REQUEST['action'])) { $action = strtolower($_REQUEST['action']); $comment_id = SJB_Request::getVar('comment_id', null); if (is_null($listing_id) && !is_null($comment_id)) { $listing_id = SJB_CommentManager::getListingSIDByCommentSID($comment_id); } $comment_ids = array(); if (isset($_REQUEST['comment']) && is_array($_REQUEST['comment'])) { $comment_ids = array_keys($_REQUEST['comment']); } else { $comment_ids = array($comment_id); } switch ($action) { case 'delete': foreach ($comment_ids as $comment_id) { SJB_CommentManager::deleteComment($comment_id); } break; case 'disable': foreach ($comment_ids as $comment_id) { SJB_CommentManager::disableComment($comment_id); } break; case 'enable': foreach ($comment_ids as $comment_id) { SJB_CommentManager::enableComment($comment_id); } break; case 'edit': if ($_SERVER['REQUEST_METHOD'] == 'POST') { SJB_DB::query("UPDATE `comments` SET `message` = ?s WHERE `sid` = ?n", $_REQUEST['message'], $comment_id); } else { $listingInfo = SJB_ListingManager::getListingInfoBySID($listing_id); $listingTypeInfo = SJB_ListingTypeManager::getListingTypeInfoBySID($listingInfo['listing_type_sid']); $tp->assign('listingType', SJB_ListingTypeManager::createTemplateStructure($listingTypeInfo)); $tp->assign('comment', SJB_CommentManager::getObjectInfoBySID('comments', $comment_id)); $tp->display('edit_comment.tpl'); return; } break; } header('Location: ' . SJB_System::getSystemSettings('SITE_URL') . '/listing-comments/?listing_id=' . $listing_id); exit; } if (!is_null($listing_id)) { $comments = SJB_CommentManager::getCommentsToListing($listing_id); $listingInfo = SJB_ListingManager::getListingInfoBySID($listing_id); $listingTypeInfo = SJB_ListingTypeManager::getListingTypeInfoBySID($listingInfo['listing_type_sid']); $tp->assign('comments', $comments); $tp->assign('comments_num', count($comments)); $tp->assign('listing_id', $listing_id); $tp->assign('listingType', SJB_ListingTypeManager::createTemplateStructure($listingTypeInfo)); $tp->display('listing_comments.tpl'); } }
public function sync() { $listingInfo = SJB_ListingManager::getListingInfoBySID($this->listingSID); $oCurListing = SJB_ObjectMother::createListing($listingInfo, SJB_ListingTypeManager::getListingTypeSIDByID('Resume')); $this->facebookSocialPlugin->fillObjectOutSocialData($oCurListing); $oCurListing->setSID($this->listingSID); SJB_ListingManager::saveListing($oCurListing); }
public function execute() { $edit_list_controller = new SJB_ListingComplexEditListController($_REQUEST); $template_processor = SJB_System::getTemplateProcessor(); if (!$edit_list_controller->isvalidFieldSID()) { echo 'Invalid Listing Field SID is specified'; } else { switch ($edit_list_controller->getAction()) { case 'add': if ($edit_list_controller->isValidValueSubmitted()) { if (!$edit_list_controller->saveItem()) { $template_processor->assign("error", 'LIST_VALUE_ALREADY_EXISTS'); } } else { $template_processor->assign("error", 'LIST_VALUE_IS_EMPTY'); } break; case 'add_multiple': if ($edit_list_controller->isValidMultiValueSubmitted()) { if (!$edit_list_controller->saveItem(true)) { $template_processor->assign("error", 'LIST_VALUE_ALREADY_EXISTS'); } } else { $template_processor->assign("error", 'LIST_VALUE_IS_EMPTY'); } break; case 'delete': //$edit_list_controller->deleteItem(); break; $item_sid = SJB_Request::getVar('item_sid'); if (is_array($item_sid)) { foreach ($item_sid as $sid => $val) { $edit_list_controller->deleteItem($sid); } } else { $edit_list_controller->deleteItem(); } break; case 'move_up': $edit_list_controller->moveUpItem(); break; case 'move_down': $edit_list_controller->moveDownItem(); break; case 'save_order': $item_order = SJB_Request::getVar('item_order'); $edit_list_controller->saveNewItemsOrder($item_order); break; } $display_list_controller = new SJB_ListingComplexDisplayListController($_REQUEST); $field_info = $display_list_controller->field_info; $parentFieldInfo = SJB_ListingFieldManager::getFieldInfoBySID($field_info['field_sid']); $listing_type_info = SJB_ListingTypeManager::getListingTypeInfoBySID($parentFieldInfo['listing_type_sid']); $display_list_controller->field_info['type_info'] = $listing_type_info; $display_list_controller->field_info['parent_field'] = $parentFieldInfo; $display_list_controller->display("listing_complex_list_editing.tpl"); } }
public function execute() { $template_processor = SJB_System::getTemplateProcessor(); $listingTypeSID = isset($_REQUEST['sid']) ? $_REQUEST['sid'] : null; if (!is_null($listingTypeSID)) { $form_submitted = SJB_Request::getVar('action', ''); $listing_type_info = SJB_ListingTypeManager::getListingTypeInfoBySID($listingTypeSID); $approveSettingChanged = $listing_type_info['waitApprove'] != SJB_Request::getVar('waitApprove'); $listing_type_info = array_merge($listing_type_info, $_REQUEST); $listingType = new SJB_ListingType($listing_type_info); $listingType->setSID($listingTypeSID); $edit_form = new SJB_Form($listingType); $listingTypeEmailAlert = $listingType->getPropertyValue('email_alert'); if (empty($listingTypeEmailAlert)) { $listingType->setPropertyValue('email_alert', 0); } $listingTypeEmailAlertForGuests = $listingType->getPropertyValue('guest_alert_email'); if (empty($listingTypeEmailAlertForGuests)) { $listingType->setPropertyValue('guest_alert_email', 0); } $errors = array(); if ($form_submitted && $edit_form->isDataValid($errors)) { SJB_Breadcrumbs::updateBreadcrumbsByListingTypeSID($listingTypeSID, $listingType->getPropertyValue('name')); SJB_PageManager::updatePagesByListingTypeSID($listingTypeSID, $listingType->getPropertyValue('name')); SJB_ListingTypeManager::saveListingType($listingType); if ($approveSettingChanged) { SJB_BrowseDBManager::rebuildBrowses(); } if ($form_submitted == 'save_info') { SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/listing-types/'); } } $template_processor->assign('errors', $errors); $template_processor->assign('listing_type_sid', $listingTypeSID); $listing_fields_info = SJB_ListingFieldManager::getListingFieldsInfoByListingType($listingTypeSID); $listing_fields = array(); $listing_field_sids = array(); foreach ($listing_fields_info as $listing_field_info) { if ($listing_field_info['type'] == 'logo') { continue; } $listing_field = new SJB_ListingField($listing_field_info); $listing_field->setSID($listing_field_info['sid']); $listing_fields[] = $listing_field; $listing_field_sids[] = $listing_field_info['sid']; } $edit_form->registerTags($template_processor); $template_processor->assign("listing_type_info", $listing_type_info); $template_processor->assign("form_fields", $edit_form->getFormFieldsInfo()); $template_processor->display("edit_listing_type.tpl"); $form_collection = new SJB_FormCollection($listing_fields); $form_collection->registerTags($template_processor); $template_processor->assign("listing_field_sids", $listing_field_sids); $template_processor->display("listing_type_fields.tpl"); } }
public static function createListing($listing_type_id) { $listing_type_sid = SJB_ListingTypeManager::getListingTypeSIDByID($listing_type_id); $listing = new SJB_Listing(array(), $listing_type_sid); $listing->addUsernameProperty(); $listing->addListingTypeIDProperty(); $listing->addActivationDateProperty(); $listing->addExpirationDateProperty(); return $listing; }
public function execute() { $listingTypeSID = SJB_Request::getVar('sid', null); if (!is_null($listingTypeSID)) { SJB_Breadcrumbs::deleteBreadcrumbsByListingTypeSID($listingTypeSID); SJB_ListingTypeManager::deleteListingTypeBySID($listingTypeSID); SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/listing-types/"); } echo 'The system cannot proceed as Listing Type SID is not set'; }
/** * @return array */ public function getAccessPermissions() { $permissions = array('apply_for_a_job'); $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); foreach ($listingTypes as $listingType) { $typeId = strtolower($listingType['id']); $permissions = array_merge($permissions, array("open_{$typeId}_search_form", "view_{$typeId}_search_results", "view_{$typeId}_details", "view_{$typeId}_contact_info", "use_{$typeId}_alerts")); } return $permissions; }
function pluginSettings() { $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); $listingPages = array(); foreach ($listingTypes as $listingType) { $listingPages[] = array('id' => 'display_on_' . strtolower($listingType['id']) . '_page', 'caption' => 'Display for ' . $listingType['name'] . ' details', 'type' => 'boolean', 'length' => '50', 'order' => null); } $currentFirlds = array(array('id' => 'header_code', 'caption' => 'ShareThis Button Header Code', 'type' => 'text', 'length' => '50', 'order' => null), array('id' => 'code', 'caption' => 'ShareThis Button Code', 'type' => 'text', 'comment' => 'To get a code for a button with different type and style, <a href="http://sharethis.com/publishers/get-sharing-button" target="_blank">click here</a><br/>The received code you will need to paste to the text areas above. ', 'length' => '50', 'order' => null), array('id' => 'display_for_all_pages', 'caption' => 'Display for All Pages', 'type' => 'boolean', 'length' => '50', 'order' => null), array('id' => 'display_on_news_page', 'caption' => 'Display for News', 'type' => 'boolean', 'length' => '50', 'order' => null)); return array_merge($currentFirlds, $listingPages); }
public function execute() { $templateProcessor = SJB_System::getTemplateProcessor(); $listingSid = isset($_REQUEST['listing_id']) ? $_REQUEST['listing_id'] : null; $listing = SJB_ListingManager::getObjectBySID($listingSid); if (!is_null($listing) && !$listing->isActive()) { $listingInfo = SJB_ListingManager::getListingInfoBySID($listingSid); $productInfo = !empty($listingInfo['product_info']) ? unserialize($listingInfo['product_info']) : array(); if (isset($listingInfo['complete']) && $listingInfo['complete'] == 1 && $listingInfo['checkouted'] == 1) { $subTotalPrice = 0; // проверить истек ли листинг, если истек , прайс прировнять к renewal_price if (SJB_ListingManager::getIfListingHasExpiredBySID($listing->getID()) && isset($productInfo['renewal_price'])) { $subTotalPrice = $productInfo['renewal_price']; } $userSid = $listing->getUserSID(); $productSid = $productInfo['product_sid']; $listingTitle = $listing->getProperty('Title')->getValue(); $listingTypeSid = $listing->getListingTypeSID(); $listingTypeId = SJB_ListingTypeManager::getListingTypeIDBySID($listingTypeSid); $newProductName = "Reactivation of \"{$listingTitle}\" {$listingTypeId}"; $newProductInfo = SJB_ShoppingCart::createInfoForCustomProduct($userSid, $productSid, $listingSid, $subTotalPrice, $newProductName, 'activateListing'); if ($subTotalPrice <= 0) { if (SJB_ListingManager::activateListingBySID($listing->getSID())) { SJB_Notifications::sendUserListingActivatedLetter($listing, $listing->getUserSID()); } } else { SJB_ShoppingCart::createCustomProduct($newProductInfo, $userSid); $shoppingUrl = SJB_System::getSystemSettings('SITE_URL') . '/shopping-cart/'; SJB_HelperFunctions::redirect($shoppingUrl); } $templateProcessor->assign('listingTypeID', SJB_ListingTypeManager::getListingTypeIDBySID($listingTypeSid)); } elseif ($listingInfo['checkouted'] == 0) { $productsInfoFromShopppingCart = SJB_ShoppingCart::getProductsInfoFromCartByProductSID($productInfo['product_sid'], $listing->getUserSID()); if (empty($productsInfoFromShopppingCart)) { $productInfoToShopCart = SJB_ProductsManager::getProductInfoBySID($productInfo['product_sid']); $productInfo['number_of_listings'] = 1; $productObj = new SJB_Product($productInfoToShopCart, $productInfoToShopCart['product_type']); $productObj->setNumberOfListings($productInfoToShopCart['number_of_listings']); $productInfoToShopCart['price'] = $productObj->getPrice(); SJB_ShoppingCart::addToShoppingCart($productInfoToShopCart, $listing->getUserSID()); } SJB_HelperFunctions::redirect(SJB_System::getSystemsettings('SITE_URL') . '/shopping-cart/'); } else { $errors['LISTING_IS_NOT_COMPLETE'] = 1; } } elseif (is_null($listingSid)) { $errors['INVALID_LISTING_ID'] = 1; } elseif (!is_null($listing) && $listing->isActive()) { $errors['LISTING_ALREADY_ACTIVE'] = 1; } else { $errors['WRONG_LISTING_ID_SPECIFIED'] = 1; } $templateProcessor->assign("errors", isset($errors) ? $errors : null); $templateProcessor->display("pay_for_listing.tpl"); }
/** * @param SJB_GuestAlert $guestAlert * @param SJB_TemplateProcessor $tp */ public function saveNewGuestAlert(SJB_GuestAlert $guestAlert, SJB_TemplateProcessor $tp) { $guestAlert->addDataProperty(serialize($this->criteriaData)); $guestAlert->addListingTypeIDProperty($this->listingTypeID); $guestAlert->save(); $listingTypeSID = SJB_ListingTypeManager::getListingTypeSIDByID($this->listingTypeID); SJB_GuestAlertStatistics::saveEventSubscribed($listingTypeSID, $guestAlert->getSID()); SJB_Notifications::sendConfirmationEmailForGuest($guestAlert); $tp->assign('email', $guestAlert->getAlertEmail()); $this->template = 'alert_created.tpl'; }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $listingTypeSID = SJB_Request::getVar('listing_type'); if (!empty($listingTypeSID)) { SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/flagged-listings/?listing_type_sid=" . $listingTypeSID); } $allListingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); $tp->assign('listing_types', $allListingTypes); $tp->display('select_flagged_listing_type.tpl'); }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $errors = array(); $listing_id = SJB_Request::getVar('listing_id', null); $listingInfo = SJB_ListingManager::getListingInfoBySID($listing_id); $listingTypeInfo = SJB_ListingTypeManager::getListingTypeInfoBySID($listingInfo['listing_type_sid']); $display_form = new SJB_Form(); $display_form->registerTags($tp); if (is_null($listing_id)) { $errors['LISTING_ID_DOESNOT_SPECIFIED'] = $listing_id; } else { $listing = SJB_ListingManager::getObjectBySID($listing_id); $filename = SJB_Request::getVar('filename', false); if ($filename) { $file = SJB_UploadFileManager::openFile($filename, $listing_id); $errors['NO_SUCH_FILE'] = true; } if (!empty($listing)) { $listing->addPicturesProperty(); if ($listing->listing_type_sid == 6) { $listing->deleteProperty('access_type'); $listing->deleteProperty('anonymous'); } $access_type_properties = $listing->getProperty('access_type'); $tp->assign('access_type_properties', $access_type_properties); $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing); $tp->assign("listing", $listing_structure); $display_form = new SJB_Form($listing); $display_form->registerTags($tp); $form_fields = $display_form->getFormFieldsInfo(); $tp->assign("form_fields", $form_fields); $waitApprove = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listing->listing_type_sid); $tp->assign('wait_approve', $waitApprove); } else { $errors['LISTING_DOESNOT_EXIST'] = $listing_id; } } $comments = SJB_CommentManager::getEnabledCommentsToListing($listing_id); $comments_total = count($comments); $rate = SJB_Rating::getRatingNumToListing($listing_id); $displayTemplate = SJB_Request::getVar('display_template', 'display_listing.tpl'); $videoFileId = SJB_Request::getVar('videoFileId', false); if ($videoFileId) { $videoFileLink = SJB_UploadFileManager::getUploadedFileLink($videoFileId); $tp->assign('videoFileLink', $videoFileLink); } $tp->assign('listingType', SJB_ListingTypeManager::createTemplateStructure($listingTypeInfo)); $tp->assign('errors', $errors); $tp->assign('comments_total', $comments_total); $tp->assign('rate', $rate); SJB_System::setGlobalTemplateVariable('wikiExtraParam', $listingTypeInfo['id']); $tp->display($displayTemplate); }
public function isAccessible() { $listingId = SJB_Request::getVar('listing_sid', null); $listingInfo = SJB_ListingManager::getListingInfoBySID($listingId); $listingTypeId = SJB_ListingTypeManager::getListingTypeIDBySID($listingInfo['listing_type_sid']); if ($productInfo = SJB_ProductsManager::getProductInfoBySID(SJB_Request::getVar('product_sid', null))) { $listingTypeId = SJB_ListingTypeManager::getListingTypeIDBySID($productInfo['listing_type_sid']); } $listingType = !in_array($listingTypeId, array('Resume', 'Job')) ? "{$listingTypeId}_listings" : $listingTypeId . 's'; $this->setPermissionLabel('manage_' . strtolower($listingType)); return parent::isAccessible(); }
public function execute() { $template_processor = SJB_System::getTemplateProcessor(); $listingId = SJB_Request::getVar('listing_id', null, 'default', 'int'); $listingType = SJB_Request::getVar('listing_type', null); if (!$listingType) { if ($listingId) { $listingInfo = SJB_ListingManager::getListingInfoBySID($listingId); $listingType = SJB_ListingTypeManager::getListingTypeIDBySID($listingInfo['listing_type_sid']); } else { $listingType = 'job'; } } $displayForm = SJB_Request::getVar('displayForm', false); $error = null; if (!SJB_Acl::getInstance()->isAllowed('save_' . trim($listingType))) { $error = 'DENIED_SAVE_LISTING'; } if (SJB_UserManager::isUserLoggedIn()) { if (!$error) { if (!is_null($listingId)) { if (SJB_UserManager::isUserLoggedIn()) { SJB_SavedListings::saveListingOnDB($listingId, SJB_UserManager::getCurrentUserSID()); SJB_Statistics::addStatistics('saveListing', SJB_ListingTypeManager::getListingTypeSIDByID($listingType), $listingId); } else { SJB_SavedListings::saveListingInCookie($listingId); } $template_processor->assign('saved_listing', SJB_SavedListings::getSavedListingsByUserAndListingSid(SJB_UserManager::getCurrentUserSID(), $listingId)); } else { $error = 'LISTING_ID_NOT_SPECIFIED'; } } $params = SJB_Request::getVar('params', false); $searchId = SJB_Request::getVar('searchId', false); $page = SJB_Request::getVar('page', false); $template_processor->assign("params", $params); $template_processor->assign("searchId", $searchId); $template_processor->assign("page", $page); $template_processor->assign("listing_type", $listingType); $template_processor->assign("listing_sid", $listingId); $template_processor->assign("from_login", SJB_Request::getVar("from_login", false)); $template_processor->assign("error", $error); $template_processor->assign("displayForm", $displayForm); $template_processor->assign("view", SJB_Request::getVar('view')); $template_processor->display("save_listing.tpl"); } else { $template_processor->assign("return_url", base64_encode(SJB_Navigator::getURIThis() . "&from_login=1")); $template_processor->assign("ajaxRelocate", true); $template_processor->display("../users/login.tpl"); } }
private function searchListings($requested_data, $listing_type_id) { $criteria_saver = new SJB_ListingCriteriaSaver(); $found_listings_sids = array(); $listing_type_sid = !empty($listing_type_id) ? SJB_ListingTypeManager::getListingTypeSIDByID($listing_type_id) : 0; $requireApprove = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listing_type_sid); if ($requireApprove) { $requested_data['status']['equal'] = 'approved'; } $requested_data['active']['equal'] = '1'; $criteria_saver->setSessionForCriteria(array_merge($criteria_saver->getCriteria(), $requested_data)); $found_listings_sids = $this->getListingSidCollectionFromRequest($requested_data, $listing_type_sid, $criteria_saver); return $found_listings_sids; }
public static function getListingTypeByUserSID($sid) { if (empty($sid)) { return false; } $types = array(); $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); foreach ($listingTypes as $listingType) { if (SJB_Acl::getInstance()->isAllowed('post_' . $listingType['id'], $sid)) { $types[] = $listingType['sid']; } } return $types; }
/** * @param SJB_FormBuilderData $builderData * @return bool * @throws Exception */ public static function save(SJB_FormBuilderData $builderData) { $listingTypeID = $builderData->getListingTypeID(); $listingTypeSID = SJB_ListingTypeManager::getListingTypeSIDByID($listingTypeID); if (!$listingTypeSID) { throw new Exception('Wrong listing type ID is specified'); } $fieldsHolders = $builderData->getFieldsHoldersData(); SJB_FieldsHolder::saveProcess($listingTypeSID, $fieldsHolders); if ($builderData->getType() == SJB_FormBuilderManager::FORM_BUILDER_TYPE_DISPLAY) { self::saveLayout($listingTypeID, $builderData); } return true; }
public function execute() { $listing_type_sid = isset($_REQUEST['listing_type_sid']) ? $_REQUEST['listing_type_sid'] : null; if (!is_null($listing_type_sid)) { $pages = SJB_PostingPagesManager::getPagesByListingTypeSID($listing_type_sid); $pages_list = array(); if (count($pages) > 1) { $pages_list[] = array('id' => 'no', 'caption' => 'Don’t add to a page'); foreach ($pages as $page) { $pages_list[] = array('id' => $page['sid'], 'caption' => $page['page_name']); } } $listing_field = new SJB_ListingField($_REQUEST, $listing_type_sid, $pages_list); /** * add infilll instructions field */ // $listing_field->addInfillInstructions(SJB_Request::getVar('instructions')); $add_listing_field_form = new SJB_Form($listing_field); $form_is_submitted = isset($_REQUEST['action']) && $_REQUEST['action'] == 'add'; $errors = null; if ($form_is_submitted && $add_listing_field_form->isDataValid($errors)) { $page = array(); if (count($pages) == 1) { $pages = array_pop($pages); $page = array(array('sid' => $pages['sid'], 'listing_type_sid' => $listing_type_sid)); } else { $posting_page = $listing_field->getProperty('posting_page'); $listing_field->deleteProperty('posting_page'); if ($posting_page->value != "no") { $page = array(array('sid' => $posting_page->value, 'listing_type_sid' => $listing_type_sid)); } } SJB_ListingFieldManager::saveListingField($listing_field, $page); $listing_sid = $listing_field->getSID(); SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/attention-listing-type-field/?listing_sid={$listing_sid}"); } else { $template_processor = SJB_System::getTemplateProcessor(); $template_processor->assign("errors", $errors); $template_processor->assign("listing_type_sid", $listing_type_sid); $template_processor->assign("listing_type_info", SJB_ListingTypeManager::getListingTypeInfoBySID($listing_type_sid)); $add_listing_field_form->registerTags($template_processor); $template_processor->assign("form_fields", $add_listing_field_form->getFormFieldsInfo()); $template_processor->display("add_listing_type_field.tpl"); } } else { echo 'The system cannot proceed as Listing Type SID is not set'; } }
public function execute() { $ou = SJB_UserManager::getOnlineUsers(); $onlineUsers = array(); $totalOnlineUsers = 0; $userGroups = SJB_UserGroupManager::createTemplateStructureForUserGroups(); foreach ($userGroups as $userGroup) { $onlineUsers[$userGroup["id"]]["count"] = 0; $onlineUsers[$userGroup["id"]]["caption"] = $userGroup["caption"]; } foreach ($ou as $value) { $onlineUsers[$value["type"]]["count"]++; $totalOnlineUsers++; } $theme = SJB_Settings::getValue('TEMPLATE_USER_THEME', 'default'); $themePath = SJB_TemplatePathManager::getAbsoluteThemePath($theme); // FLAGGED LISTINGS $allListingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); $totalFlagsNum = array(); foreach ($allListingTypes as $type) { $totalFlagsNum[$type['id']] = SJB_ListingManager::getFlagsNumberByListingTypeSID($type['sid'], $filter = null, $groupByListingSID = true); } $files = $this->getCssFiles($themePath); $tp = SJB_System::getTemplateProcessor(); $tp->assign('totalFlagsNum', $totalFlagsNum); $tp->assign('usersInfo', SJB_UserManager::getUsersInfo()); $tp->assign('groupsInfo', SJB_UserManager::getGroupsInfo()); $tp->assign('listingsInfo', SJB_ListingManager::getListingsInfo()); $tp->assign('listingTypesInfo', SJB_ListingTypeManager::getAllListingTypesInfo()); $tp->assign('invoicesInfo', SJB_InvoiceManager::getInvoicesInfo()); $tp->assign('unpaidInvoices', SJB_InvoiceManager::getTotalUnpaidInvoices()); $tp->assign('totalInvoices', SJB_InvoiceManager::getTotalInvoices()); $i18n = SJB_I18N::getInstance(); $lang = $i18n->getLanguageData($i18n->getCurrentLanguage()); $tp->assign("today", strftime($lang['date_format'], time())); // ранее были данные за период: месяц (последние 30 дней), неделя (последние 7 дней) // теперь - текущий месяц и текущая неделя $currMonth = strftime($lang['date_format'], mktime(0, 0, 0, date("m"), 1, date("Y"))); $currWeek = strftime($lang['date_format'], mktime(0, 0, 0, date("m"), date("d") - date("N") + 1, date("Y"))); $tp->assign("weekAgo", $currWeek); $tp->assign("monthAgo", $currMonth); $tp->assign('onlineUsers', $onlineUsers); $tp->assign('totalOnlineUsers', $totalOnlineUsers); if (count($files) > 0) { $tp->assign("file", $files[0]); } $tp->display("index.tpl"); }
public function execute() { $GLOBALS['LEFT_ADMIN_MENU']['Listing Configuration'] = array(array('title' => 'Common Fields', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-fields/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-fields/'), 'perm_label' => 'manage_common_listing_fields'), array('title' => 'Listing Types', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-types/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/add-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/posting-pages/', SJB_System::getSystemsettings('SITE_URL') . '/attention-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-fields/'), 'perm_label' => array('manage_listing_types_and_specific_listing_fields', 'set_posting_pages'))); $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); usort($listingTypes, function ($listingType) { return $listingType['id'] == 'Job' || $listingType['id'] == 'Resume' ? true : false; }); $listingTypes = array_reverse($listingTypes); foreach ($listingTypes as $listingType) { if (!in_array($listingType['id'], array('Resume', 'Job'))) { $title = "'{$listingType['name']}' Listings"; $link = strtolower($listingType['id']) . '-listings/'; $permLabel = strtolower($listingType['id']) . '_listings'; } else { $title = "{$listingType['name']}s"; $link = strtolower($listingType['id']) . 's/'; $permLabel = strtolower($listingType['id']) . 's'; } $manageListings[] = array('title' => 'Manage ' . $title, 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-' . $link, 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing/', SJB_System::getSystemsettings('SITE_URL') . '/display-listing/', SJB_System::getSystemsettings('SITE_URL') . '/manage-pictures/', SJB_System::getSystemsettings('SITE_URL') . '/edit-picture/'), 'perm_label' => 'manage_' . $permLabel); } $listingsManagement = array(array('title' => 'Import Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-listings/', 'highlight' => array(), 'perm_label' => 'import_listings'), array('title' => 'Export Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-listings/', 'highlight' => array(), 'perm_label' => 'export_listings'), array('title' => 'XML Feeds', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-feeds/', 'highlight' => array(), 'perm_label' => 'set_xml_feeds'), array('title' => 'XML Import', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/show-import/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-import/', SJB_System::getSystemsettings('SITE_URL') . '/edit-import/', SJB_System::getSystemsettings('SITE_URL') . '/run-import/'), 'perm_label' => 'set_xml_import'), array('title' => 'Flagged Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/flagged-listings/', 'highlight' => array(), 'perm_label' => 'manage_flagged_listings')); $GLOBALS['LEFT_ADMIN_MENU']['Listing Management'] = array_merge($manageListings, $listingsManagement); $userGroup = array(array('title' => 'User Groups', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/user-groups/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/delete-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile/', SJB_System::getSystemsettings('SITE_URL') . '/add-user-profile-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/system/users/acl/'), 'perm_label' => array('manage_user_groups', 'manage_user_groups_permissions'))); $userGroups = SJB_UserGroupManager::getAllUserGroupsInfo(); $manageUsers = array(); foreach ($userGroups as $userGroups) { $userGroupId = mb_strtolower($userGroups['id'], 'utf8'); if (in_array($userGroups['id'], array('JobSeeker', 'Employer'))) { $name = "{$userGroups['name']}s"; } else { $name = "'{$userGroups['name']}' Users"; } $link = 'manage-users/' . $userGroupId . '/'; $manageUsers[] = array('title' => "Manage {$name}", 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/' . $link, 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/edit-user/', SJB_System::getSystemsettings('SITE_URL') . '/add-user/', SJB_System::getSystemsettings('SITE_URL') . '/manage-users/', SJB_System::getSystemsettings('SITE_URL') . '/email-log/', SJB_System::getSystemsettings('SITE_URL') . '/user-products/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-main/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-inbox/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-outbox/', SJB_System::getSystemsettings('SITE_URL') . '/system/applications/view/', SJB_System::getSystemsettings('SITE_URL') . '/system/users/acl/'), 'perm_label' => 'manage_' . $userGroupId); } $GLOBALS['LEFT_ADMIN_MENU']['Users'] = array_merge($userGroup, $manageUsers); $users = array(array('title' => 'Import Users', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-users/', 'highlight' => array(), 'perm_label' => 'import_users'), array('title' => 'Export Users', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-users/', 'highlight' => array(), 'perm_label' => 'export_users'), array('title' => 'Mass Mailing', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/mailing/', 'highlight' => array(), 'perm_label' => 'create_and_send_mass_mailings'), array('title' => 'Guest Email Alerts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/guest-alerts/', 'highlight' => array(), 'perm_label' => 'manage_guest_email_alerts'), array('title' => 'Banned IPs', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/banned-ips/', 'perm_label' => 'manage_banned_ips')); $GLOBALS['LEFT_ADMIN_MENU']['Users'] = array_merge($GLOBALS['LEFT_ADMIN_MENU']['Users'], $users); $GLOBALS['LEFT_ADMIN_MENU']['Layout and Content'] = array(array('title' => 'Form Builder', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/form-builders/', 'perm_label' => 'edit_form_builder'), array('title' => 'System Templates', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-templates/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Email Templates', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-email-templates/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Themes', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-themes/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Site Pages', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/user-pages/', 'perm_label' => 'manage_site_pages'), array('title' => 'Static Content', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/stat-pages/', 'perm_label' => 'manage_static_content'), array('title' => 'Banners', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-banner-groups/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-banner-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-banner-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-banner/', SJB_System::getSystemsettings('SITE_URL') . '/add-banner/'), 'perm_label' => 'manage_banners'), array('title' => 'News', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/news-categories/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/manage-news/'), 'perm_label' => 'manage_news'), array('title' => 'Polls', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-polls/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/poll-answers/', SJB_System::getSystemsettings('SITE_URL') . '/poll-results/'), 'perm_label' => 'manage_polls')); $GLOBALS['LEFT_ADMIN_MENU']['Billing'] = array(array('title' => 'Invoices', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-invoices/', 'perm_label' => 'manage_invoices', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-invoice/', SJB_System::getSystemsettings('SITE_URL') . '/edit-invoice/')), array('title' => 'Products', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/products/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/edit-product/', SJB_System::getSystemsettings('SITE_URL') . '/add-product/'), 'perm_label' => 'manage_products'), array('title' => 'Promotions', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/promotions/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-promotion-code/', SJB_System::getSystemsettings('SITE_URL') . '/edit-promotion-code/', SJB_System::getSystemsettings('SITE_URL') . '/promotions/log/'), 'perm_label' => 'manage_promotions'), array('title' => 'Tax Rules', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-taxes/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-tax/', SJB_System::getSystemsettings('SITE_URL') . '/edit-tax/'), 'perm_label' => 'manage_tax_rules'), array('title' => 'Payment Gateways', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/system/payment/gateways/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/configure-gateway/'), 'perm_label' => 'manage_payment_gateways'), array('title' => 'Transaction History', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/payments/', 'perm_label' => 'transaction_history'), array('title' => 'Payment Log', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/payment-log/', 'perm_label' => 'payment_log')); $GLOBALS['LEFT_ADMIN_MENU']['Reports'] = array(array('title' => 'General Statistics', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/general-statistics/', 'perm_label' => 'general_statistics'), array('title' => 'Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listings-statistics/', 'perm_label' => 'listings_reports'), array('title' => 'Applications and Views', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/applications-and-views/', 'perm_label' => 'applications_and_views_reports'), array('title' => 'Sales', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/sales/', 'perm_label' => 'sales_reports'), array('title' => 'Guest Alerts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/statistics/guest-alerts/', 'perm_label' => 'guest_alerts_reports'), array('title' => 'Promotions Usage', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/statistics/promotions/', 'perm_label' => 'promotions_statistics')); $GLOBALS['LEFT_ADMIN_MENU']['System Configuration'] = array(array('title' => 'System Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/settings/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/alphabet-letters/', SJB_System::getSystemsettings('SITE_URL') . '/view-error-log/'), 'perm_label' => 'configure_system_settings'), array('title' => 'Social Media', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/social-media/', 'perm_label' => 'social_media', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/social-media/bitly/', SJB_System::getSystemsettings('SITE_URL') . '/social-media/facebook', SJB_System::getSystemsettings('SITE_URL') . '/social-media/linkedin', SJB_System::getSystemsettings('SITE_URL') . '/social-media/twitter', SJB_System::getSystemsettings('SITE_URL') . '/social-media/googleplus')), array('title' => 'Admin Password', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/adminpswd/'), array('title' => 'Admin Sub Accounts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-subadmins/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-subadmin/', SJB_System::getSystemsettings('SITE_URL') . '/edit-subadmin/')), array('title' => 'ZipCode Database', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/import-data/', SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/edit-location/'), 'perm_label' => 'edit_zipcode_database'), array('title' => 'Countries', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/countries/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-country/', SJB_System::getSystemsettings('SITE_URL') . '/import-countries/', SJB_System::getSystemsettings('SITE_URL') . '/edit-country/'), 'perm_label' => 'manage_countries'), array('title' => 'States/Regions', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/states/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-state/', SJB_System::getSystemsettings('SITE_URL') . '/edit-state/', SJB_System::getSystemsettings('SITE_URL') . '/import-states/'), 'perm_label' => 'manage_states_or_regions'), array('title' => 'Manage Currencies', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/currency-list/', 'perm_label' => 'manage_currencies'), array('title' => 'Refine Search Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/refine-search-settings/', 'perm_label' => 'set_refine_search_parameters'), array('title' => 'Flag Listing Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/flag-listing-settings/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/flag/', SJB_System::getSystemsettings('SITE_URL') . '/flag/'), 'perm_label' => 'edit_flag_listing_settings'), array('title' => 'Breadcrumbs Config', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-breadcrumbs/', 'perm_label' => 'configure_breadcrumbs'), array('title' => 'HTML filters', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/filters/', 'perm_label' => 'set_html_filters'), array('title' => 'Task Scheduler', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/task-scheduler-settings/', 'perm_label' => 'set_task_scheduler'), array('title' => 'Plugins', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/system/miscellaneous/plugins/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/system/miscellaneous/fb_app_settings/'), 'perm_label' => array('manage_plug-ins', 'set_phpbb_plug-in', 'set_facebook_plug-in', 'set_linkedin_plug-in', 'set_twitter_plug-in', 'set_wordpress_plug-in', 'set_sharethisplugin', 'set_captchaplugin', 'set_indeedplugin', 'set_jujuplugin', 'set_simplyhiredplugin', 'set_googleplugin', 'set_googleplusplugin', 'set_googleanalyticsplugin', 'set_beyondplugin')), array('title' => 'Backup/Restore', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/backup/', 'perm_label' => 'create_and_restore_backups'), array('title' => 'Email Log', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/email-log/', 'perm_label' => 'email_log')); $GLOBALS['LEFT_ADMIN_MENU']['Language Management'] = array(array('title' => 'Manage Languages', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-languages/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-language/', SJB_System::getSystemsettings('SITE_URL') . '/edit-language/'), 'perm_label' => 'manage_languages'), array('title' => 'Translate Phrases', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-phrases/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-phrase/'), 'perm_label' => 'translate_phrases'), array('title' => 'Import Language', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-language/', 'perm_label' => 'import_languages'), array('title' => 'Export Language', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-language/', 'perm_label' => 'export_languages')); // set subadmin mode if (SJB_SubAdmin::getSubAdminSID()) { $GLOBALS['subadmin_id'] = SJB_SubAdmin::getSubAdminSID(); } }
public static function getActiveAndApproveListingsNumberByUserSID($user_sid) { $approved = ''; $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); foreach ($listingTypes as $listingType) { if (!empty($approved)) { $approved .= ' OR '; } if ($listingType['waitApprove']) { $approved .= "(`listing_type_sid` = {$listingType['sid']} AND `status` = 'approved')"; } else { $approved .= "(`listing_type_sid` = {$listingType['sid']})"; } } return SJB_DB::queryValue("SELECT COUNT(*) FROM `listings` WHERE `active` = 1 AND `user_sid` = ?n AND ({$approved})", $user_sid); }
public static function saveSearchOnDB($requested_data, $search_name, $user_sid, $enableNotify = false, $isAlert = false, $emailFrequency = false) { $is_alert = 0; if ($isAlert) { $is_alert = 1; } if ($enableNotify) { $sid = SJB_DB::query("INSERT INTO saved_searches SET user_sid = ?n, name = ?s, data = ?s, is_alert = ?s, auto_notify = '1', last_send = CURDATE(), email_frequency=?s", $user_sid, $search_name, serialize($requested_data), $is_alert, $emailFrequency); } else { $sid = SJB_DB::query("INSERT INTO saved_searches SET user_sid = ?n, name = ?s, data = ?s, is_alert = ?s, last_send = CURDATE(), email_frequency=?s", $user_sid, $search_name, serialize($requested_data), $is_alert, $emailFrequency); } if ($isAlert && $sid) { $listingTypeSID = SJB_ListingTypeManager::getListingTypeSIDByID($requested_data['listing_type']['equal']); SJB_Statistics::addStatistics('addAlert', $listingTypeSID, $sid); } }
/** * @param $listingSid * @return string */ public static function getBitlyShortenUrlByListingSid($listingSid) { $listingInfo = SJB_ListingManager::getListingInfoBySID($listingSid); $listingType = strtolower(SJB_ListingTypeManager::getListingTypeIDBySID($listingInfo["listing_type_sid"])); $listingLongUrl = SJB_System::getSystemSettings("USER_SITE_URL") . "/display-{$listingType}/{$listingSid}/"; self::$_shortenUrl = self::getListingBitlyShortedUrlBySid($listingSid); if (empty(self::$_shortenUrl)) { $oAuthUrl = self::$_bitlyOauthApi . "shorten?access_token=" . self::getBitlyTokenId() . "&longUrl=" . urlencode($listingLongUrl); $output = json_decode(self::bitlyCurl($oAuthUrl)); if (isset($output->{"data"}->{"hash"})) { self::$_shortenUrl = $output->{"data"}->{"url"}; self::saveBitlyShortenUrlByListingSid($listingSid); } else { return $listingLongUrl; } } return self::$_shortenUrl; }