Esempio n. 1
0
$min_steps = 3;
$more_settings_expanded = array_var($_REQUEST, 'more_settings_expanded');
if (config_option('getting_started_step') < 99 && !$more_settings_expanded) {
    // dimension links
    if (can_manage_dimension_members(logged_user())) {
        Hook::fire('more_panel_dimension_links', null, $links);
        $min_steps = count($links);
    }
    // add your first object link
    if (config_option('getting_started_step') < 98) {
        $object_count_rows = DB::executeAll("SELECT count(o.id) as cant, ot.id as ot_id, ot.name FROM " . TABLE_PREFIX . "objects o INNER JOIN " . TABLE_PREFIX . "object_types ot ON o.object_type_id=ot.id \n\t\t\tWHERE ot.name IN ('task','message','weblink','file','expense','objective','event') AND o.trashed_by_id=0 AND o.archived_by_id=0 GROUP BY ot_id");
        $object_count = array();
        foreach ($object_count_rows as $row) {
            $object_count[$row['name']] = $row['cant'];
        }
        $first_tab_panel = TabPanels::findOne(array('conditions' => "object_type_id > 0 AND enabled=1 AND id NOT IN ('more-panel', 'reporting-panel', 'mails-panel') AND \n\t\t\t\t(plugin_id is NULL OR plugin_id = 0 OR plugin_id IN (SELECT id FROM " . TABLE_PREFIX . "plugins WHERE is_activated > 0 AND is_installed > 0))", 'order' => 'ordering'));
        if ($first_tab_panel instanceof TabPanel) {
            $ot = ObjectTypes::findById($first_tab_panel->getObjectTypeId());
            if ($ot instanceof ObjectType) {
                switch ($ot->getName()) {
                    case "task":
                        $selector = '.task-list-row-template .btn.btn-xs.btn-primary';
                        break;
                    case "message":
                    case "weblink":
                    case "file":
                    case "expense":
                    case "objective":
                    case "mail":
                    case "contact":
                    case "event":