Exemplo n.º 1
0
            $month = _AUGUST;
        } elseif ($getdate[2] == "09") {
            $month = _SEPTEMBER;
        } elseif ($getdate[2] == "10") {
            $month = _OCTOBER;
        } elseif ($getdate[2] == "11") {
            $month = _NOVEMBER;
        } elseif ($getdate[2] == "12") {
            $month = _DECEMBER;
        }
        if ($month != $thismonth) {
            $year = $getdate[1];
            echo "<li><a href=\"modules.php?name={$module_name}&amp;sa=show_month&amp;year={$year}&amp;month={$getdate['2']}&amp;month_l={$month}\">{$month}, {$year}</a>";
            $thismonth = $month;
        }
    }
    echo "</ul><br><br><center>" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<input type=\"text\" name=\"query\" size=\"30\">&nbsp;" . "<input type=\"submit\" value=\"" . _SEARCH . "\">" . "</form>" . "[ <a href=\"modules.php?name={$module_name}\">Stories Archive Index</a> ]</center>";
    CloseTable();
    include "footer.php";
}
switch ($sa) {
    case "show_all":
        show_all($min);
        break;
    case "show_month":
        show_month($year, $month, $month_l);
        break;
    default:
        select_month();
        break;
}
Exemplo n.º 2
0
function get_service_list_values($id, $modulename, $sessionid, $only_mine = 'true')
{
    require_once 'modules/Services/Services.php';
    require_once 'include/utils/UserInfoUtil.php';
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $log->debug("Entering customer portal Function get_service_list_values");
    $check = checkModuleActive($modulename);
    if ($check == false) {
        return array("#MODULE INACTIVE#");
    }
    $user = new Users();
    $userid = getPortalUserid();
    $current_user = $user->retrieveCurrentUserInfoFromFile($userid);
    //To avoid SQL injection we are type casting as well as bound the id variable
    $id = (int) vtlib_purify($id);
    $entity_ids_list = array();
    $show_all = show_all($modulename);
    if (!validateSession($id, $sessionid)) {
        return null;
    }
    if ($only_mine == 'true' || $show_all == 'false') {
        array_push($entity_ids_list, $id);
    } else {
        $contactquery = "SELECT contactid, parentid FROM vtiger_contactdetails " . " INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid" . " AND vtiger_crmentity.deleted = 0 " . " WHERE (parentid = (SELECT parentid FROM vtiger_contactdetails WHERE contactid = ?)  AND parentid != 0) OR contactid = ?";
        $contactres = $adb->pquery($contactquery, array($id, $id));
        $no_of_cont = $adb->num_rows($contactres);
        for ($i = 0; $i < $no_of_cont; $i++) {
            $cont_id = $adb->query_result($contactres, $i, 'contactid');
            $acc_id = $adb->query_result($contactres, $i, 'parentid');
            if (!in_array($cont_id, $entity_ids_list)) {
                $entity_ids_list[] = $cont_id;
            }
            if (!in_array($acc_id, $entity_ids_list) && $acc_id != '0') {
                $entity_ids_list[] = $acc_id;
            }
        }
    }
    $focus = new Services();
    $focus->filterInactiveFields('Services');
    foreach ($focus->list_fields as $fieldlabel => $values) {
        foreach ($values as $table => $fieldname) {
            $fields_list[$fieldlabel] = $fieldname;
        }
    }
    $fields_list['Related To'] = 'entityid';
    $query = array();
    $params = array();
    $query[] = "select vtiger_service.*," . "case when vtiger_crmentityrel.crmid != vtiger_service.serviceid then vtiger_crmentityrel.crmid else vtiger_crmentityrel.relcrmid end as entityid, " . "'' as setype from vtiger_service " . "inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_service.serviceid " . "left join vtiger_crmentityrel on (vtiger_crmentityrel.relcrmid=vtiger_service.serviceid or vtiger_crmentityrel.crmid=vtiger_service.serviceid) " . "where vtiger_crmentity.deleted = 0 and " . "( vtiger_crmentityrel.crmid in (" . generateQuestionMarks($entity_ids_list) . ") OR " . "(vtiger_crmentityrel.relcrmid in (" . generateQuestionMarks($entity_ids_list) . ") AND vtiger_crmentityrel.module = 'Services')" . ")";
    $params[] = array($entity_ids_list, $entity_ids_list);
    $checkQuotes = checkModuleActive('Quotes');
    if ($checkQuotes == true) {
        $query[] = "select distinct vtiger_service.*,\n\t\t\tvtiger_quotes.accountid as entityid,\n\t\t\t'Accounts' as setype\n\t\t\tfrom vtiger_quotes INNER join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid\n\t\t\tleft join vtiger_inventoryproductrel on vtiger_inventoryproductrel.id=vtiger_quotes.quoteid\n\t\t\tleft join vtiger_service on vtiger_service.serviceid = vtiger_inventoryproductrel.productid\n\t\t\twhere vtiger_inventoryproductrel.productid = vtiger_service.serviceid AND vtiger_crmentity.deleted=0 and accountid in  (" . generateQuestionMarks($entity_ids_list) . ")";
        $params[] = array($entity_ids_list);
    }
    $checkInvoices = checkModuleActive('Invoice');
    if ($checkInvoices == true) {
        $query[] = "select distinct vtiger_service.*, vtiger_invoice.accountid as entityid, 'Accounts' as setype\n\t\t\tfrom vtiger_invoice\n\t\t\tINNER join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid\n\t\t\tleft join vtiger_inventoryproductrel on vtiger_inventoryproductrel.id=vtiger_invoice.invoiceid\n\t\t\tleft join vtiger_service on vtiger_service.serviceid = vtiger_inventoryproductrel.productid\n\t\t\twhere vtiger_inventoryproductrel.productid = vtiger_service.serviceid AND vtiger_crmentity.deleted=0 and accountid in (" . generateQuestionMarks($entity_ids_list) . ")";
        $params[] = array($entity_ids_list, $entity_ids_list);
    }
    $ServicesfieldVisibilityPermissions = array();
    foreach ($fields_list as $fieldlabel => $fieldname) {
        $ServicesfieldVisibilityPermissions[$fieldname] = getFieldVisibilityPermission('Services', $current_user->id, $fieldname);
    }
    $fieldValuesToRound = array('unit_price', 'commissionrate');
    for ($k = 0; $k < count($query); $k++) {
        $res[$k] = $adb->pquery($query[$k], $params[$k]);
        $noofdata[$k] = $adb->num_rows($res[$k]);
        if ($noofdata[$k] == 0) {
            $output[$k][$modulename]['data'] = '';
        }
        for ($j = 0; $j < $noofdata[$k]; $j++) {
            $i = 0;
            foreach ($fields_list as $fieldlabel => $fieldname) {
                $fieldper = $ServicesfieldVisibilityPermissions[$fieldname];
                if ($fieldper == '1' && $fieldname != 'entityid') {
                    continue;
                }
                $output[$k][$modulename]['head'][0][$i]['fielddata'] = Vtiger_Language_Handler::getTranslatedString($fieldlabel, 'Services', vglobal('default_language'));
                $fieldvalue = $adb->query_result($res[$k], $j, $fieldname);
                $fieldid = $adb->query_result($res[$k], $j, 'serviceid');
                if (in_array($fieldname, $fieldValuesToRound)) {
                    $fieldvalue = round($fieldvalue, 2);
                }
                if ($fieldname == 'entityid') {
                    $crmid = $fieldvalue;
                    $module = $adb->query_result($res[$k], $j, 'setype');
                    if ($module == '') {
                        $module = $adb->query_result($adb->pquery("SELECT setype FROM vtiger_crmentity WHERE crmid = ?", array($crmid)), 0, 'setype');
                    }
                    if ($crmid != '' && $module != '') {
                        $fieldvalues = getEntityName($module, array($crmid));
                        if ($module == 'Contacts') {
                            $fieldvalue = '<a href="index.php?module=Contacts&action=index&id=' . $crmid . '">' . $fieldvalues[$crmid] . '</a>';
                        } elseif ($module == 'Accounts') {
                            $fieldvalue = '<a href="index.php?module=Accounts&action=index&id=' . $crmid . '">' . $fieldvalues[$crmid] . '</a>';
                        }
                    } else {
                        $fieldvalue = '';
                    }
                }
                if ($fieldname == 'servicename') {
                    $fieldvalue = '<a href="index.php?module=Services&action=index&id=' . $fieldid . '">' . $fieldvalue . '</a>';
                }
                if ($fieldname == 'unit_price') {
                    $sym = getCurrencySymbol($res[$k], $j, 'currency_id');
                    $fieldvalue = $sym . $fieldvalue;
                }
                $output[$k][$modulename]['data'][$j][$i]['fielddata'] = $fieldvalue;
                $i++;
            }
        }
    }
    $log->debug("Exiting customerportal function get_product_list_values.....");
    return $output;
}
Exemplo n.º 3
0
    //сохраняем все в $add
    restart();
    // вызываем restart(); для очистки формы
} elseif (isset($_POST['clear_form']) || isset($_POST['back'])) {
    // кнопка очистить форму  вызывает restart();
    restart();
} elseif (isset($_POST['clear_base'])) {
    // по кнопке очистить базу очищаем массив $_SESSION['ad']
    save_for_add('NULL');
    restart();
} elseif (isset($_GET['del_ad'])) {
    // ловим ключ del_ad в массиве $_GET
    del_ad((int) $_GET['del_ad']);
    // и удаляем запись по этому ключу в массиве $_SESSION['ad']
    $add = array_values($add);
    save_for_add($add);
    restart();
} elseif (isset($_GET['click_id'])) {
    // действие по клику на объявление
    $click_id = (int) $_GET['click_id'];
    // присваиваем переменной $click_id номер кликнутого объявления
    if (isset($add[$click_id])) {
        // если объявление такое существует
        print_form($add[$click_id]);
        // выводим в форму
    }
} else {
    print_form();
    // иначе выводим пустую форму
    show_all($add);
}
Exemplo n.º 4
0
function Draw_Page($Page_Type)
{
    // Read only pages - these pages don't strictly require user authentication.
    // Therefore, to enable permit-all page viewing, comment out the call
    // to rejectIfNotAuthenticated() in the relevant case block. Note, some of
    // these pages will replace sensitive info such as telephone/email with
    // the string 'PROTECTED'
    // ************************************************************************
    switch ($Page_Type) {
        case "default":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/start_page.php';
            startPage();
            break;
        case "View_Service_Endpoint":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/view_service_endpoint.php';
            view_endpoint();
            break;
        case "Service_Groups":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/view_all.php';
            showAllServiceGroups();
            break;
        case "Service_Group":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/view_sgroup.php';
            showServiceGroup();
            break;
        case "Site":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/view_site.php';
            view_site();
            break;
        case "NGI":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/ngi/view_ngi.php';
            view_ngi();
            break;
        case "Service":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/view_service.php';
            view_se();
            break;
        case "Services":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/view_all.php';
            drawSEs();
            break;
        case "NGIs":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/ngi/view_ngis.php';
            view_ngis();
            break;
        case "Sites":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/view_all.php';
            showAllSites();
            break;
        case "Projects":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/view_all.php';
            show_all_projects();
            break;
        case "Project":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/view_project.php';
            show_project();
            break;
        case "Scope_Help":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/scope_help.php';
            show_help();
            break;
        case "Site_Geo_xml":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/sitesForGoogleMapXML.php';
            show_xml();
            break;
        case "Error_Redirect":
            //rejectIfNotAuthenticated();
            show_view('error.php', $_REQUEST['error']);
            break;
        case "Static_HTML":
            //rejectIfNotAuthenticated();
            Draw_Static_HTML();
            break;
        case "Search":
            //rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/search.php';
            search();
            break;
            // CrUD Pages - These pages MUST have authentication enabled so
            // the calls to rejectIfNotAuthenticated() must be used.
            // *********************************************************************
        // CrUD Pages - These pages MUST have authentication enabled so
        // the calls to rejectIfNotAuthenticated() must be used.
        // *********************************************************************
        case "Revoke_Role":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/political_role/revoke_request.php';
            view_revoke_request();
            break;
        case "Accept_Role_Request":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/political_role/accept_request.php';
            view_accept_request();
            break;
        case "Deny_Role_Request":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/political_role/deny_request.php';
            view_deny_request();
            break;
        case "Role_Requests":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/political_role/view_requests.php';
            view_requests();
            break;
        case "Request_Role":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/political_role/request_role.php';
            request_role();
            break;
        case "Edit_Site":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/edit_site.php';
            edit_site();
            break;
        case "Edit_Service":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/edit_service.php';
            edit_service();
            break;
        case "SE_Downtimes":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/se_downtimes.php';
            se_downtimes();
            break;
        case "Add_Service":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/add_service.php';
            add_service();
            break;
        case "Add_Service_Endpoint":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/add_service_endpoint.php';
            add_service_endpoint();
            break;
        case "Delete_Service":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/delete_service.php';
            delete();
            break;
        case "Edit_User":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/user/edit_user.php';
            edit_user();
            break;
        case "User":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/user/view_user.php';
            view_user();
            break;
        case "Downtime":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/view_downtime.php';
            view();
            break;
        case "My_Sites":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/my_sites.php';
            my_sites();
            break;
        case "Edit_NGI":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/ngi/edit_ngi.php';
            edit_ngi();
            break;
        case "Edit_Service_Group":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/edit_service_group.php';
            edit_service_group();
            break;
        case "Add_Service_Group_SEs":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/add_ses.php';
            add_ses();
            break;
        case "Search_SEs":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/search_ses.php';
            search_ses();
            break;
        case "Remove_Service_Group_SEs":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/remove_ses.php';
            remove_ses();
            break;
        case "Add_Site":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/add_site.php';
            add_site();
            break;
        case "SGroup_Downtimes":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/view_sgroup_downtimes.php';
            view_sgroup_downtimes();
            break;
        case "Add_Service_Group":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/add_service_group.php';
            add_service_group();
            break;
        case "Site_Downtimes":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/site_downtimes.php';
            site_downtimes();
            break;
        case "Register":
            rejectIfNotAuthenticated('Access denied - ' . 'you need to be pre-authenticated before you can register a new account');
            require_once __DIR__ . '/controllers/user/register.php';
            register();
            break;
        case "Add_Downtime":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/add_downtime.php';
            //require_once __DIR__.'/controllers/downtime/add_downtime_old.php';
            add();
            break;
        case "Edit_Downtime":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/edit_downtime.php';
            //require_once __DIR__.'/controllers/downtime/edit_downtime_old.php';
            edit();
            break;
        case "End_Downtime":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/end_downtime.php';
            endDt();
            break;
        case "Downtime_view_endpoint_tree":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/view_endpoint_tree.php';
            getServiceandEndpointList();
            break;
        case "Edit_Downtime_view_endpoint_tree":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/view_endpoint_tree.php';
            editDowntimePopulateEndpointTree();
            break;
        case "Downtime_View_Services":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/view_services.php';
            getSitesServices();
            break;
        case "Delete_Site":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/delete_site.php';
            delete();
            break;
        case "Delete_Downtime":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/delete_downtime.php';
            delete();
            break;
        case "Downtimes_Overview":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/downtime/downtimes_overview.php';
            view();
            break;
        case "Delete_Service_Group":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/delete_service_group.php';
            delete();
            break;
        case "Delete_User":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/user/delete_user.php';
            delete();
            break;
        case "Edit_Certification_Status":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/edit_cert_status.php';
            edit();
            break;
        case "Retrieve_Account":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/user/retrieve_account.php';
            retrieve();
            break;
        case "Remove_Project_NGIs":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/remove_ngis.php';
            remove_ngis_project();
            break;
        case "Add_Project_NGIs":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/add_ngis.php';
            add_ngis_to_project();
            break;
        case "Edit_Project":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/edit_project.php';
            edit_project();
            break;
        case "Delete_Project":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/project/delete_project.php';
            delete_project();
            break;
        case "Admin_Move_Site":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/move_site.php';
            move_site();
            break;
        case "Admin_Move_SEP":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/move_service_end_point.php';
            move_service_end_point();
            break;
        case "Admin_Service_Types":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/view_service_types.php';
            show_all();
            break;
        case "Admin_Service_Type":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/view_service_type.php';
            view_service_type();
            break;
        case "Admin_Edit_Service_Type":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/edit_service_type.php';
            edit_type();
            break;
        case "Admin_Add_Service_Type":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/add_service_type.php';
            add_type();
            break;
        case "Admin_Delete_Service_Type":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/delete_service_type.php';
            delete_service_type();
            break;
        case "Admin_Delete_Service_Type_Denied":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/delete_service_type_denied.php';
            deny_delete_type();
            break;
        case "Admin_Add_NGI":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/add_ngi.php';
            add_ngi();
            break;
        case "Admin_Users":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/users.php';
            show_users();
            break;
        case "Admin_Edit_User_DN":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/edit_user_dn.php';
            edit_dn();
            break;
            //        case "Admin_Change_User_Admin_Status":
            //            rejectIfNotAuthenticated();
            //            require_once __DIR__.'/controllers/admin/edit_user_isadmin.php';
            //            make_admin();
            //            break;
        //        case "Admin_Change_User_Admin_Status":
        //            rejectIfNotAuthenticated();
        //            require_once __DIR__.'/controllers/admin/edit_user_isadmin.php';
        //            make_admin();
        //            break;
        case "Admin_Add_Project":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/add_project.php';
            add_project();
            break;
        case "Admin_Scopes":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/scopes.php';
            show_scopes();
            break;
        case "Admin_Remove_Scope":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/delete_scope.php';
            remove_scope();
            break;
        case "Admin_Add_Scope":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/add_scope.php';
            add_scope();
            break;
        case "Admin_Scope":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/scope.php';
            view_scope();
            break;
        case "Admin_Edit_Scope":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/edit_scope.php';
            edit_scope();
            break;
        case "Admin_Delete_NGI":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/admin/delete_ngi.php';
            delete_ngi();
            break;
        case "User_Validate_DN_Change":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/user/retrieve_account_user_validate.php';
            validate_dn_change();
            break;
        case "Add_Site_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/add_site_property.php';
            add_site_property();
            break;
        case "Add_Service_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/add_service_property.php';
            add_service_property();
            break;
        case "Add_Endpoint_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/add_endpoint_property.php';
            add_endpoint_property();
            break;
        case "Delete_Site_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/delete_site_property.php';
            delete();
            break;
        case "Delete_Service_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/delete_service_property.php';
            delete();
            break;
        case "Delete_Endpoint_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/delete_endpoint_property.php';
            delete();
            break;
        case "Edit_Site_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/site/edit_site_property.php';
            edit_property();
            break;
        case "Edit_Service_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/edit_service_property.php';
            edit_property();
            break;
        case "Edit_Endpoint_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/edit_endpoint_property.php';
            edit_property();
            break;
        case "Add_Service_Group_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/add_service_group_property.php';
            add_service_group_property();
            break;
        case "Edit_Service_Group_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/edit_service_group_property.php';
            edit_property();
            break;
        case "Delete_Service_Group_Property":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service_group/delete_service_group_property.php';
            delete();
            break;
        case "Delete_Service_Endpoint":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/delete_service_endpoint.php';
            delete_endpoint();
            break;
        case "Edit_Service_Endpoint":
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/service/edit_service_endpoint.php';
            edit_endpoint();
            break;
        default:
            // require auth by default
            rejectIfNotAuthenticated();
            require_once __DIR__ . '/controllers/start_page.php';
            startPage();
            break;
    }
}
Exemplo n.º 5
0
        }
        $user->bolt->update("flags={$flags}");
        $user->bolt->flags = $flags;
        Header('Location: bolt_admin.php');
        break;
    case 'hide':
        if (!$course) {
            error_page("no such course");
        }
        $course->update("hidden=1");
        Header('Location: bolt_admin.php');
        break;
    case 'unhide':
        if (!$course) {
            error_page("no such course");
        }
        $course->update("hidden=0");
        Header('Location: bolt_admin.php');
        break;
    case 'clear_confirm':
        clear_confirm();
        break;
    case 'clear':
        clear();
        break;
    case '':
        show_all();
        break;
    default:
        error_page("unknown action {$action}");
}
Exemplo n.º 6
0
/**
 * Get PriceBook list
 * 
 * @param array $input_array    input data
 * @return array                resulted data
 */
function get_pricebooks_list($input_array)
{
    require_once 'modules/PriceBooks/PriceBooks.php';
    require_once 'include/utils/UserInfoUtil.php';
    global $adb, $log;
    global $current_user;
    require_once 'modules/Users/Users.php';
    $log->debug("Entering customer portal function get_pricebooks_list");
    $user = new Users();
    $userid = getPortalUserid();
    $show_all = show_all('PriceBooks');
    $current_user = $user->retrieveCurrentUserInfoFromFile($userid);
    $id = $input_array['id'];
    $only_mine = $input_array['onlymine'];
    $only_base = $input_array['onlybase'];
    $sessionid = $input_array['sessionid'];
    if (!validateSession($id, $sessionid)) {
        return null;
    }
    $entity_ids_list = array();
    if ($only_mine == 'true') {
        array_push($entity_ids_list, $id);
    } else {
        // TODO
    }
    $focus = new PriceBooks();
    $focus->filterInactiveFields('PriceBooks');
    foreach ($focus->list_fields as $fieldlabel => $values) {
        foreach ($values as $table => $fieldname) {
            $fields_list[$fieldlabel] = $fieldname;
        }
    }
    $FieldVisibilityByColumn = array();
    foreach ($fields_list as $fieldlabel => $fieldname) {
        $FieldVisibilityByColumn[$fieldname] = getColumnVisibilityPermission($current_user->id, $fieldname, 'PriceBooks');
    }
    // PriceBooks items selection
    $query = "SELECT * FROM vtiger_pricebook " . "INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid AND vtiger_crmentity.deleted = 0 " . "WHERE active = 1 ";
    if (count($entity_ids_list) > 0) {
        $query .= "AND owner_id IN (" . generateQuestionMarks($entity_ids_list) . ")";
    }
    $params = array($entity_ids_list);
    $res = $adb->pquery($query, $params);
    $noofdata = $adb->num_rows($res);
    for ($j = 0; $j < $noofdata; $j++) {
        $i = 0;
        foreach ($fields_list as $fieldlabel => $fieldname) {
            if (strcmp($fieldname, 'active') == 0) {
                continue;
            }
            $fieldper = $FieldVisibilityByColumn[$fieldname];
            if ($fieldper == '1') {
                continue;
            }
            $output[0]['head'][0][$i]['fielddata'] = $fieldlabel;
            $fieldvalue = $adb->query_result($res, $j, $fieldname);
            $pricebookid = $adb->query_result($res, $j, 'pricebookid');
            if ($fieldname == 'bookname') {
                $fieldvalue = '<a href="index.php?module=PriceBooks&action=index&fun=detail&pricebookid=' . $pricebookid . '">' . $fieldvalue . '</a>';
            }
            if ($fieldname == 'owner_id') {
                // TODO
            }
            $output[1]['data'][$j][$i]['fielddata'] = $fieldvalue;
            $i++;
        }
    }
    $log->debug("Exiting customer portal function get_pricebooks_list");
    return $output;
}
Exemplo n.º 7
0
        @fclose($fp);
    } elseif ($where_ == 'aps') {
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename=slaveserver_' . $server_ . '.log');
        $server = Abstract_Server::load($server_);
        if (!$server) {
            Logger::error('main', '(admin/logs) download_log() - cannot load Server \'' . $server_ . '\'');
            redirect();
        }
        $buf = new Server_Logs($server);
        $buf->process();
        while ($str = $buf->getContent()) {
            echo $str;
        }
    }
    die;
}
$prefs = Preferences::getInstance();
if (is_object($prefs)) {
    $log_flags = $prefs->get('general', 'log_flags');
} else {
    $log_flags = array();
}
if (isset($_GET['show'])) {
    show_specific($_GET['where'], isset($_GET['name']) ? $_GET['name'] : NULL, isset($_GET['server']) ? $_GET['server'] : NULL, $log_flags);
}
if (isset($_GET['download'])) {
    download_log($_GET['where'], isset($_GET['name']) ? $_GET['name'] : NULL, isset($_GET['server']) ? $_GET['server'] : NULL);
}
show_all($log_flags);
Exemplo n.º 8
0
                }
                break;
            case 'tags':
                if (isset($s)) {
                    $id = get_page_id($s);
                    echo "<h3>{$page_display_name} (" . $lang['tags'] . ")</h3>\n\t\t\t\t\t<div class=\"tag_section\">\n";
                    public_tag_cloud('pixie_dynamic_posts', "page_id = {$id} and public = 'yes'");
                    echo "\t\t\t\t\t</div>\n";
                }
                break;
            default:
                $mtitle = "{$page_display_name}";
                if (isset($s)) {
                    $id = get_page_id($s);
                    $rs = safe_rows_start('*', 'pixie_dynamic_posts', "page_id = '{$id}' and public = 'yes' order by posted desc limit {$posts_per_page}");
                    show_all($rs);
                }
                break;
        }
        break;
}
// ------------------------------------------------------------------
// function show all
function show_all($rs)
{
    global $s, $m, $x, $p, $mtitle, $site_url, $comments, $lang, $date_format, $posts_per_page, $timezone;
    echo "<h3>{$mtitle}</h3>\n";
    if (!$m) {
        if (isset($s)) {
            $page_description = safe_field('page_description', 'pixie_core', "page_name='{$s}'");
            //echo "\t\t\t\t\t<div id=\"page_description\">$page_description</div>";
Exemplo n.º 9
0
function pages($k, $t, $c, $d = null, $m = null, $b = null, $ks = null, $nk = null)
{
    $r = "<div class='row no-margin-bottom x-center m-left' style='border-bottom:solid 1px #ddd;'>\n\t<div class='x-100 m-50' style='height:80px;'>\n\t\t<div class='middle'>\n\t\t\t<div class='middle-wrapper'>\n\t\t\t\t<h3>{$t}</h3>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class='x-100 s-50 m-25 center' style='height:80px;'>\n\t\t<div class='middle'><div class='middle-wrapper'><div class='group-button full'>\n\t\t" . link_to_all('TODOS', 'button center', $m) . link_to_create('NOVO', 'button center', $m) . "</div></div></div></div>\n\t<div class='x-100 s-50 m-25' style='height:80px;'>\n\t\t<div class='middle'><div class='middle-wrapper'>" . search_form($c, $m) . "</div></div></div>\n</div>\n<div class='row'>\n\t<div class='x-100'>";
    if ($k == "index") {
        $r .= show_all($d, $ks, $nk);
    } elseif ($k == "read") {
        $r .= show_one($d, $ks, $nk, $b);
    } else {
        $r .= $d;
    }
    $r .= "</div></div>";
    return $r;
}
Exemplo n.º 10
0
    restart();
    // вызываем restart(); для очистки формы
} elseif (isset($_POST['clear_form']) || isset($_POST['back'])) {
    // кнопка очистить форму  вызывает restart();
    save_for_ad_cookie('NULL');
    restart();
} elseif (isset($_POST['clear_base'])) {
    // по кнопке очистить базу очищаем массив $_SESSION['ad']
    unset($_SESSION['ad']);
    restart();
} elseif (isset($_GET['del_ad'])) {
    // ловим ключ del_ad в массиве $_GET
    del_ad((int) $_GET['del_ad']);
    // и удаляем запись по этому ключу в массиве $_SESSION['ad']
    $ad_cookie = array_values($ad_cookie);
    // переназначаем ключи массива с объявлениями после удаления по порядку
    save_for_ad_cookie($ad_cookie);
    restart();
} elseif (isset($_GET['click_id'])) {
    // действие по клику на объявление
    $click_id = (int) $_GET['click_id'];
    // присваиваем переменной $click_id номер кликнутого объявления
    $ad_cookie[$click_id]['id'] = $click_id;
    // присваиваем элементу массива с текущимобъявлением его номер в ключ id для возможности его сохранения
    print_form($ad_cookie[$click_id]);
    // выводим объявление в форму
} else {
    print_form();
    // иначе выводим пустую форму
    show_all($ad_cookie);
}